text
stringlengths 2
100k
| meta
dict |
---|---|
1
Better estimate needed
Better estimate needed
Better estimate needed
1
1
1
Better estimate needed
7
| {
"pile_set_name": "Github"
} |
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2011-2015 Akira Takahashi
// Copyright (c) 2011-2015 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2015.
// Modifications copyright (c) 2015, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, 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)
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_FUSION_HPP
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_FUSION_HPP
#include <cstddef>
#include <boost/core/enable_if.hpp>
#include <boost/fusion/include/is_sequence.hpp>
#include <boost/fusion/include/size.hpp>
#include <boost/fusion/include/tag_of.hpp>
#include <boost/fusion/include/front.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/fusion/mpl.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/count_if.hpp>
#include <boost/mpl/front.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/mpl/pop_front.hpp>
#include <boost/mpl/size.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
#include <boost/geometry/core/coordinate_system.hpp>
#include <boost/geometry/core/coordinate_type.hpp>
#include <boost/geometry/core/point_type.hpp>
#include <boost/geometry/core/tags.hpp>
namespace boost { namespace geometry
{
namespace fusion_adapt_detail
{
template <class Sequence>
struct all_same :
boost::mpl::bool_<
boost::mpl::count_if<
Sequence,
boost::is_same<
typename boost::mpl::front<Sequence>::type,
boost::mpl::_
>
>::value == boost::mpl::size<Sequence>::value
>
{};
template <class Sequence>
struct is_coordinate_size : boost::mpl::bool_<
boost::fusion::result_of::size<Sequence>::value == 2 ||
boost::fusion::result_of::size<Sequence>::value == 3> {};
template<typename Sequence>
struct is_fusion_sequence
: boost::mpl::and_<boost::fusion::traits::is_sequence<Sequence>,
fusion_adapt_detail::is_coordinate_size<Sequence>,
fusion_adapt_detail::all_same<Sequence> >
{};
} // namespace fusion_adapt_detail
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
namespace traits
{
// Boost Fusion Sequence, 2D or 3D
template <typename Sequence>
struct coordinate_type
<
Sequence,
typename boost::enable_if
<
fusion_adapt_detail::is_fusion_sequence<Sequence>
>::type
>
{
typedef typename boost::mpl::front<Sequence>::type type;
};
template <typename Sequence>
struct dimension
<
Sequence,
typename boost::enable_if
<
fusion_adapt_detail::is_fusion_sequence<Sequence>
>::type
> : boost::mpl::size<Sequence>
{};
template <typename Sequence, std::size_t Dimension>
struct access
<
Sequence,
Dimension,
typename boost::enable_if
<
fusion_adapt_detail::is_fusion_sequence<Sequence>
>::type
>
{
typedef typename coordinate_type<Sequence>::type ctype;
static inline ctype get(Sequence const& point)
{
return boost::fusion::at_c<Dimension>(point);
}
template <class CoordinateType>
static inline void set(Sequence& point, CoordinateType const& value)
{
boost::fusion::at_c<Dimension>(point) = value;
}
};
template <typename Sequence>
struct tag
<
Sequence,
typename boost::enable_if
<
fusion_adapt_detail::is_fusion_sequence<Sequence>
>::type
>
{
typedef point_tag type;
};
} // namespace traits
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
}} // namespace boost::geometry
// Convenience registration macro to bind a Fusion sequence to a CS
#define BOOST_GEOMETRY_REGISTER_BOOST_FUSION_CS(CoordinateSystem) \
namespace boost { namespace geometry { namespace traits { \
template <typename Sequence> \
struct coordinate_system \
< \
Sequence, \
typename boost::enable_if \
< \
fusion_adapt_detail::is_fusion_sequence<Sequence> \
>::type \
> \
{ typedef CoordinateSystem type; }; \
}}}
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_FUSION_HPP
| {
"pile_set_name": "Github"
} |
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// 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)
#ifndef BOOST_GEOMETRY_VIEWS_BOX_VIEW_HPP
#define BOOST_GEOMETRY_VIEWS_BOX_VIEW_HPP
#include <boost/range.hpp>
#include <boost/bgeometry/core/point_type.hpp>
#include <boost/bgeometry/views/detail/points_view.hpp>
#include <boost/bgeometry/algorithms/assign.hpp>
namespace boost { namespace geometry
{
/*!
\brief Makes a box behave like a ring or a range
\details Adapts a box to the Boost.Range concept, enabling the user to iterating
box corners. The box_view is registered as a Ring Concept
\tparam Box \tparam_geometry{Box}
\tparam Clockwise If true, walks in clockwise direction, otherwise
it walks in counterclockwise direction
\ingroup views
\qbk{before.synopsis,
[heading Model of]
[link geometry.reference.concepts.concept_ring Ring Concept]
}
\qbk{[include reference/views/box_view.qbk]}
*/
template <typename Box, bool Clockwise = true>
struct box_view
: public detail::points_view
<
typename geometry::point_type<Box>::type,
5
>
{
typedef typename geometry::point_type<Box>::type point_type;
/// Constructor accepting the box to adapt
explicit box_view(Box const& box)
: detail::points_view<point_type, 5>(copy_policy(box))
{}
private :
class copy_policy
{
public :
inline copy_policy(Box const& box)
: m_box(box)
{}
inline void apply(point_type* points) const
{
// assign_box_corners_oriented requires a range
// an alternative for this workaround would be to pass a range here,
// e.g. use boost::array in points_view instead of c-array
std::pair<point_type*, point_type*> rng = std::make_pair(points, points + 5);
detail::assign_box_corners_oriented<!Clockwise>(m_box, rng);
points[4] = points[0];
}
private :
Box const& m_box;
};
};
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
// All views on boxes are handled as rings
namespace traits
{
template<typename Box, bool Clockwise>
struct tag<box_view<Box, Clockwise> >
{
typedef ring_tag type;
};
template<typename Box>
struct point_order<box_view<Box, false> >
{
static order_selector const value = counterclockwise;
};
template<typename Box>
struct point_order<box_view<Box, true> >
{
static order_selector const value = clockwise;
};
}
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_VIEWS_BOX_VIEW_HPP
| {
"pile_set_name": "Github"
} |
package org.protege.editor.owl.model.inference;
import org.semanticweb.owlapi.model.*;
import org.semanticweb.owlapi.reasoner.*;
import org.semanticweb.owlapi.reasoner.impl.*;
import org.semanticweb.owlapi.util.Version;
import uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl;
import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;
import java.util.Set;
/**
* Author: Matthew Horridge<br>
* The University Of Manchester<br>
* Bio-Health Informatics Group<br>
* Date: 16-Apr-2007<br><br>
*/
public class NoOpReasoner implements OWLReasoner {
private final OWLOntology rootOntology;
private final OWLClass OWL_THING;
private final OWLClass OWL_NOTHING;
private final OWLObjectProperty OWL_TOP_OBJECT_PROPERTY;
private final OWLObjectProperty OWL_BOTTOM_OBJECT_PROPERTY;
private final OWLDataProperty OWL_TOP_DATA_PROPERTY;
private final OWLDataProperty OWL_BOTTOM_DATA_PROPERTY;
public NoOpReasoner(OWLOntology rootOntology) {
this(rootOntology, new OWLDataFactoryImpl());
}
protected NoOpReasoner(OWLOntology rootOntology, OWLDataFactory df) {
this.rootOntology = rootOntology;
OWL_THING = df.getOWLThing();
OWL_NOTHING = df.getOWLNothing();
OWL_TOP_OBJECT_PROPERTY = df.getOWLTopObjectProperty();
OWL_BOTTOM_OBJECT_PROPERTY = df.getOWLBottomObjectProperty();
OWL_TOP_DATA_PROPERTY = df.getOWLTopDataProperty();
OWL_BOTTOM_DATA_PROPERTY = df.getOWLBottomDataProperty();
}
@Nonnull
public OWLOntology getRootOntology() {
return rootOntology;
}
@Nonnull
public Set<OWLAxiom> getPendingAxiomAdditions() {
return Collections.emptySet();
}
@Nonnull
public Set<OWLAxiom> getPendingAxiomRemovals() {
return Collections.emptySet();
}
@Nonnull
public List<OWLOntologyChange> getPendingChanges() {
return Collections.emptyList();
}
@Nonnull
public BufferingMode getBufferingMode() {
return BufferingMode.NON_BUFFERING;
}
public long getTimeOut() {
return 0;
}
@Nonnull
public Set<InferenceType> getPrecomputableInferenceTypes() {
return Collections.emptySet();
}
public boolean isPrecomputed(@Nonnull InferenceType inferenceType) {
return true;
}
public void precomputeInferences(@Nonnull InferenceType... inferenceTypes) throws ReasonerInterruptedException, TimeOutException, InconsistentOntologyException {
}
public void interrupt() {
}
public void dispose() {
}
public void flush() {
}
public boolean isConsistent() throws ReasonerInterruptedException, TimeOutException {
return true;
}
@Nonnull
public NodeSet<OWLClass> getDataPropertyDomains(@Nonnull OWLDataProperty pe, boolean direct) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
return new OWLClassNodeSet();
}
@Nonnull
public Set<OWLLiteral> getDataPropertyValues(@Nonnull OWLNamedIndividual ind, @Nonnull OWLDataProperty pe) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
return Collections.emptySet();
}
@Nonnull
public Node<OWLClass> getEquivalentClasses(@Nonnull OWLClassExpression ce) throws InconsistentOntologyException, ClassExpressionNotInProfileException, ReasonerInterruptedException, TimeOutException {
if (ce.isAnonymous()) {
return new OWLClassNode();
}
else {
return new OWLClassNode(ce.asOWLClass());
}
}
@Nonnull
public Node<OWLDataProperty> getEquivalentDataProperties(@Nonnull OWLDataProperty pe) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
if (pe.isAnonymous()) {
return new OWLDataPropertyNode();
}
else {
return new OWLDataPropertyNode(pe.asOWLDataProperty());
}
}
@Nonnull
public Node<OWLObjectPropertyExpression> getEquivalentObjectProperties(@Nonnull OWLObjectPropertyExpression pe) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
if (pe.isAnonymous()) {
return new OWLObjectPropertyNode();
}
else {
return new OWLObjectPropertyNode(pe.asOWLObjectProperty());
}
}
@Nonnull
public NodeSet<OWLNamedIndividual> getInstances(@Nonnull OWLClassExpression ce, boolean direct) throws InconsistentOntologyException, ClassExpressionNotInProfileException, ReasonerInterruptedException, TimeOutException {
return new OWLNamedIndividualNodeSet();
}
@Nonnull
public Node<OWLObjectPropertyExpression> getInverseObjectProperties(@Nonnull OWLObjectPropertyExpression pe) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
return new OWLObjectPropertyNode();
}
@Nonnull
public NodeSet<OWLClass> getObjectPropertyDomains(@Nonnull OWLObjectPropertyExpression pe, boolean direct) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
return new OWLClassNodeSet();
}
@Nonnull
public NodeSet<OWLClass> getObjectPropertyRanges(@Nonnull OWLObjectPropertyExpression pe, boolean direct) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
return new OWLClassNodeSet();
}
@Nonnull
public NodeSet<OWLNamedIndividual> getObjectPropertyValues(@Nonnull OWLNamedIndividual ind, @Nonnull OWLObjectPropertyExpression pe) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
return new OWLNamedIndividualNodeSet();
}
@Nonnull
public Node<OWLNamedIndividual> getSameIndividuals(@Nonnull OWLNamedIndividual ind) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
return new OWLNamedIndividualNode(ind);
}
@Nonnull
public NodeSet<OWLClass> getSubClasses(@Nonnull OWLClassExpression ce, boolean direct) throws InconsistentOntologyException, ClassExpressionNotInProfileException, ReasonerInterruptedException, TimeOutException {
return new OWLClassNodeSet();
}
@Nonnull
public NodeSet<OWLDataProperty> getSubDataProperties(@Nonnull OWLDataProperty pe, boolean direct) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
return new OWLDataPropertyNodeSet();
}
@Nonnull
public NodeSet<OWLObjectPropertyExpression> getSubObjectProperties(@Nonnull OWLObjectPropertyExpression pe, boolean direct) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
return new OWLObjectPropertyNodeSet();
}
@Nonnull
public NodeSet<OWLClass> getSuperClasses(@Nonnull OWLClassExpression ce, boolean direct) throws InconsistentOntologyException, ClassExpressionNotInProfileException, ReasonerInterruptedException, TimeOutException {
return new OWLClassNodeSet();
}
@Nonnull
public NodeSet<OWLDataProperty> getSuperDataProperties(@Nonnull OWLDataProperty pe, boolean direct) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
return new OWLDataPropertyNodeSet();
}
@Nonnull
public NodeSet<OWLObjectPropertyExpression> getSuperObjectProperties(@Nonnull OWLObjectPropertyExpression pe, boolean direct) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
return new OWLObjectPropertyNodeSet();
}
@Nonnull
public NodeSet<OWLClass> getTypes(@Nonnull OWLNamedIndividual ind, boolean direct) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
return new OWLClassNodeSet();
}
@Nonnull
public Node<OWLClass> getUnsatisfiableClasses() throws ReasonerInterruptedException, TimeOutException {
return new OWLClassNode();
}
public boolean isEntailed(@Nonnull OWLAxiom axiom) throws ReasonerInterruptedException, UnsupportedEntailmentTypeException, TimeOutException, AxiomNotInProfileException, InconsistentOntologyException {
return false;
}
public boolean isEntailed(@Nonnull Set<? extends OWLAxiom> axioms) throws ReasonerInterruptedException, UnsupportedEntailmentTypeException, TimeOutException, AxiomNotInProfileException, InconsistentOntologyException {
return false;
}
public boolean isEntailmentCheckingSupported(@Nonnull AxiomType<?> axiomType) {
return false;
}
public boolean isSatisfiable(@Nonnull OWLClassExpression classExpression) throws ReasonerInterruptedException, TimeOutException, ClassExpressionNotInProfileException, InconsistentOntologyException {
return true;
}
@Nonnull
public Node<OWLClass> getBottomClassNode() {
return new OWLClassNode(OWL_NOTHING);
}
@Nonnull
public Node<OWLDataProperty> getBottomDataPropertyNode() {
return new OWLDataPropertyNode(OWL_BOTTOM_DATA_PROPERTY);
}
@Nonnull
public Node<OWLObjectPropertyExpression> getBottomObjectPropertyNode() {
return new OWLObjectPropertyNode(OWL_BOTTOM_OBJECT_PROPERTY);
}
@Nonnull
public NodeSet<OWLNamedIndividual> getDifferentIndividuals(@Nonnull OWLNamedIndividual ind) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
return new OWLNamedIndividualNodeSet();
}
@Nonnull
public NodeSet<OWLClass> getDisjointClasses(@Nonnull OWLClassExpression ce) {
return new OWLClassNodeSet();
}
@Nonnull
public NodeSet<OWLDataProperty> getDisjointDataProperties(@Nonnull OWLDataPropertyExpression pe) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
return new OWLDataPropertyNodeSet();
}
@Nonnull
public NodeSet<OWLObjectPropertyExpression> getDisjointObjectProperties(@Nonnull OWLObjectPropertyExpression pe) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
return new OWLObjectPropertyNodeSet();
}
@Nonnull
public IndividualNodeSetPolicy getIndividualNodeSetPolicy() {
return IndividualNodeSetPolicy.BY_SAME_AS;
}
@Nonnull
public String getReasonerName() {
return "Prot\u00E9g\u00E9 Null Reasoner";
}
@Nonnull
public Version getReasonerVersion() {
return new Version(1, 0, 0, 0);
}
@Nonnull
public Node<OWLClass> getTopClassNode() {
return new OWLClassNode(OWL_THING);
}
@Nonnull
public Node<OWLDataProperty> getTopDataPropertyNode() {
return new OWLDataPropertyNode(OWL_TOP_DATA_PROPERTY);
}
@Nonnull
public Node<OWLObjectPropertyExpression> getTopObjectPropertyNode() {
return new OWLObjectPropertyNode(OWL_TOP_OBJECT_PROPERTY);
}
@Nonnull
public FreshEntityPolicy getFreshEntityPolicy() {
return FreshEntityPolicy.ALLOW;
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0"?>
<!--
File: CFM56_5.xml
Author: Aero-Matic v 0.8
Inputs:
name: CFM56
type: turbine
thrust: 20000 lb
augmented? no
injected? no
-->
<turbine_engine name="CFM56">
<milthrust> 20000.0 </milthrust>
<bypassratio> 5.9 </bypassratio>
<tsfc> 0.657 </tsfc>
<bleed> 0.04 </bleed>
<idlen1> 30.0 </idlen1>
<idlen2> 60.0 </idlen2>
<maxn1> 100.0 </maxn1>
<maxn2> 100.0 </maxn2>
<augmented> 0 </augmented>
<injected> 0 </injected>
<function name="IdleThrust">
<table>
<independentVar lookup="row">velocities/mach</independentVar>
<independentVar lookup="column">atmosphere/density-altitude</independentVar>
<tableData>
-10000 0 10000 20000 30000 40000 50000 60000
0.0 0.0420 0.0436 0.0528 0.0694 0.0899 0.1183 0.1467 0.0
0.2 0.0500 0.0501 0.0335 0.0544 0.0797 0.1049 0.1342 0.0
0.4 0.0040 0.0047 0.0020 0.0272 0.0595 0.0891 0.1203 0.0
0.6 0.0 0.0 0.0 0.0 0.0276 0.0718 0.1073 0.0
0.8 0.0 0.0 0.0 0.0 0.0174 0.0468 0.0900 0.0
1.0 0.0 0.0 0.0 0.0 0.0 0.0422 0.0700 0.0
</tableData>
</table>
</function>
<function name="MilThrust">
<table>
<independentVar lookup="row">velocities/mach</independentVar>
<independentVar lookup="column">atmosphere/density-altitude</independentVar>
<tableData>
-10000 0 10000 20000 30000 40000 50000 60000
0.0 1.2600 1.0000 0.7400 0.5340 0.3720 0.2410 0.1490 0.0
0.2 1.1710 0.9340 0.6970 0.5060 0.3550 0.2310 0.1430 0.0
0.4 1.1500 0.9210 0.6920 0.5060 0.3570 0.2330 0.1450 0.0
0.6 1.1810 0.9510 0.7210 0.5320 0.3780 0.2480 0.1540 0.0
0.8 1.2580 1.0200 0.7820 0.5820 0.4170 0.2750 0.1700 0.0
1.0 1.3690 1.1200 0.8710 0.6510 0.4750 0.3150 0.1950 0.0
1.2 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0
</tableData>
</table>
</function>
</turbine_engine>
| {
"pile_set_name": "Github"
} |
### 专栏 | 夜话中南海:骆惠宁被习近平看好 晋升副国级指日可待
------------------------
#### [首页](https://github.com/gfw-breaker/banned-news/blob/master/README.md) | [手把手翻墙教程](https://github.com/gfw-breaker/guides/wiki) | [禁闻聚合安卓版](https://github.com/gfw-breaker/bn-android) | [网门安卓版](https://github.com/oGate2/oGate) | [神州正道安卓版](https://github.com/SzzdOgate/update)
<div id="headerimg">
<img alt="香港中联办主任骆惠宁(美联社)" src="https://www.rfa.org/mandarin/zhuanlan/yehuazhongnanhai/gx-01102020154335.html/yt0106v.jpg/image" title="香港中联办主任骆惠宁(美联社)"/>
<div id="headerimgcontents">
<div id="headerimgcaption">
<span>
香港中联办主任骆惠宁(美联社)
</span>
<!-- zoomattribute -->
</div>
<!-- headerimgcaption -->
</div>
<!-- headerimagecontents -->
</div>
<hr/>
#### [翻墙必看视频(文昭、江峰、法轮功、八九六四、香港反送中...)](https://github.com/gfw-breaker/banned-news/blob/master/pages/link3.md)
<div id="storytext">
<div>
<div class="slot_header">
</div>
</div>
<p>
笔者为本专栏撰写的《退休省委书记政治“回春”,中联办即将升格副国级?》一文播出后,又读到一些相关分析文章和言论。比如,香港浸会大学新闻系高级讲师吕秉权先生接受记者采访时表示:“中联办主任王志民被撤换是必然的。香港出这么大的事,可是中联办将有些情报扣压不报。其实,北京当局也一直在等机会调整王志民的职务,以显示那是一个正常的人事安排,不是向任何势力低头。”
</p>
<p>
一位刚刚从北京出来“公干”的前官媒高级记者也对笔者分析说,其实你文章中提到的,一个多月前我们的新华社及各大官媒,刚刚高调对外宣称“外交部驻港公署发言人就路透社当日有关不实报道向该社提出严正交涉”的内容,没有分析完全,甚至是忽略了关键内容。事实上,当时路透社引述了“两名不具名的知情消息人士”的话说出主要内容,是两个部分:一个部分是“考虑撤换中联办主任王志民”;另一部分是所谓“中共中央领导已绕过中联办,在深圳设置对港危机处理中心”。
</p>
<p>
这位前官媒高级记者透露说,其实当时让中国官方恼火的不是关于王志民是否会被撤换的猜测,而是所谓“香港危机处理中心”的说法。如果当时路透社的报道内容只是中央政府打算撤换王志民这一项内容,中央当局才懒得搭理呢。
</p>
<p>
至于香港中联办被拖至香港局势明显有所缓和之后才被宣布换将,“当然是因为不能给外界以‘顶不住舆论压力’的感觉”。但是,这位前中共官媒高级记者也分析说:“面对香港这么长时间的乱局,谁当中联办主任也无能为力。至于他王志民在港期间‘有些情报扣压不报’的可能 ,几乎等于零。”
</p>
<p>
这位人士继续分析说,“记得前北京市长孟学农吗?当时面突如其来的非典重大疫情,在国内外影响巨大,总要有一人被抛出来顶罪吧?这和孟学农有没有能力,是否能胜任正常时期的北京市长职务没有关系。这么大的过去从未经历过的事情,发生在哪一任市长的任期内都会被问责。一样道理,现在香港发生这么大的事情,因为反送中运动要求最强烈的就是林郑下台,所以林郑不能下台,那么中央政府的派驻机构就得有人承担责任 - 虽然事实上,他一点责任也没有。
</p>
<p>
前面刚刚提到的香港学者吕秉权先生对记者分析说:王志民是历任最短的中联办主任。现在也没有报道他另履新职,很不正常。从某个程度讲,王志民其实是被炒鱿鱼了。接替王志民的骆惠宁临危受命也相当不正常。
</p>
<p>
其实,无论从孟学农的日后为官经历,还是其他甚至受到党内处分的中共副部级以上高官的日后为官经历来看,只要他或她在风波过去以后仍未达所在级别的退休年龄,都会“另有任用”的 - 那怕是一任闲差,原级别肯定是要被保留的。
</p>
<p>
王志民也是一样。王志民从年青时代当兵服役再到进入中共政坛的几十年下来,一直都是在家乡福建和中共驻港机构交叉任职。所以当初他一经被任命为中联办主任,外界分析都一致把他与现政治局委员兼北京市委书记蔡奇一起,归为习近平最信任的“习近平派系”里面最重要的“福建帮”。
</p>
<p>
前一段香港“动暴乱”最为严重的时间,王志民的中联办主任依然安稳,也被外界分析认为,是“习近平力保自己的福建马仔”。现如今,王志民一被调回内地“待分配”,外界又有媒体硬是把王志民与所谓“江派 ”联系在一起,深挖出了王志民与曾庆红的关系。
</p>
<p>
不过,即使王志民是所谓“习近平派系”,他习近平也只能“忍痛割爱”。因为对香港中联办的问责,总不能兑现到一个副主任头上吧?
</p>
<p>
至于为什么安排了一个退休省委书记前住香港接替王志民,依笔者之见,绝非诺大中共政权里的成千上万名,尚属“年富力强”的副省部级和正省部级干部里,根本找不出一个政治上和骆惠宁一样强,能力上也不比骆惠宁弱的。而是因为习近平当局在考虑,为王志民安排 中联办主任接班人的过程中,很可能提出了一个“一揽子”解决方案,就是把新任该办的主任人选,同时也是中共中央香港工委书记人选与中联办的组织规格高升一级的设想,一并解决。
</p>
<p>
既然有让中联办升格的计划,成为中联办主任换将的大前提,那么具体人选的考量首先就排除了从副省部级,包括从中联办或者中共港澳办以及外交部等相关机构提拔一个副职的可能性。因为从副省部级,到不久的将来就会随着中联办的升格而升格的副国级,假设安排一个副省部级接替王志民的话,等于让他连升两级。
</p>
<p>
再者,中共组织规范中,对正部级晋升副国级的杠杠和框框有很多很多。其中一个重要特征就是,除非专业性特强的岗位,比如由国务院委员兼任外交部长的职位只会从外交系统内逐级培养上去。但专业性不强,而又非“党外人士”出任的副国级领导岗位,无论是国务院以及中央党务系统 ,还是全国人大和全国政协的党内副委员长或者副主席,原则上都是先从政治犒赏的角度,提拔那些在地方省委书记岗位上劳苦功高者。最典型的例子莫过于以国务委员兼任的公安部长职务,从2002年周永康从四川省委书记位置上升任此职开始,再往后的孟建柱、郭声琨,还有现任的赵克志,都是省委一把手出身。
</p>
<p>
同样道理,如果读者对笔者关于中联办即将升格的分析将信将疑的话,我们不妨假设这已经在中共内部形成定论,那么在此前提下,为中联办新任主任的人选考虑,就会和此前及此后,为国务委员兼公安部长一职的继任人选的考虑角度一样,十有八九会从劳苦功高的省委书记,特别是已经具有几个不同省份的省长和省委书记任职经历,同时也是被习近平认为是政治上信得过的,范围已经很窄的干部群里考虑。
</p>
<p>
吕秉权先生还分析说:骆惠宁到香港有一个很重要的身份,是中共香港工委书记。中央这么部署主要出于以下考量:一是北京当局很想找一个悍将,尽快执行习近平及十九届四中全会的一些相当棘手的工作,包括在香港成立国安的执行机制,和特区政府成立抵御“外部势力”的抗衡机制。
</p>
<p>
这些具体的操作,要插手香港公务员系统、教育系统,以及让国内的国企进驻,清洗港资等等,需要大刀阔斧。骆惠宁以前在山西反腐,查处过特大贪腐案。他到香港,可能有一定震慑作用。
</p>
<p>
中联办自己的官网对外介绍它自己的主要职责是:联系外交部驻香港特别行政区特派员公署和中国人民解放军驻香港部队;联系并协助内地有关部门管理在香港的中资机构;促进香港与内地之间的经济、教育、科学、文化、体育等领域的交流与合作;联系香港社会各界人士,增进内地与香港之间的交往,反映香港居民对内地的意见;处理有关涉台事务;承办中央人民政府交办的其他事项。
</p>
<p>
在这次持续数月的香港“动暴乱”之前,所谓“承办中央人民政府交办的其他事项”,应该是没有什么新鲜内容。但“动暴乱”之后 ,所谓中央政府对香港的“全面管治权”,已经被习近平一再要求“落在实处”。
</p>
<p>
因为习近平提出的,针对“一国两制”在实践中出现的新情况、新问题、新挑战,在其十九届四中全会的《决定》中,特别要求要“健全中央依照《宪法》和《基本法》对特别行政区行使全面管治权的制度”。国务院港澳办主任张晓明发表了《坚持和完善“一国两制”制度体系》,明白告诉港人:《宪法》和《基本法》赋予中央的权力包括(1)特区的创制权;(2)特区政府的组织权;(3)《基本法》的制定、修改、解释权;(4)对特区高度自治的监督权;(5)向特首发出指令权;(6)外交事务权;(7)防务权;(8)决定在特区实施全国性法律;(9)宣布特区进入战争或紧急状态;(10)可根据需要向特区作出新的授权;而为了“完善特别行政区同宪法和基本法实施相关的制度和机制”,上述十项权力将会加以制度化、规范化、程序化。
</p>
<p>
中央政府的这些所谓“全面管制权”的内容有些较为空泛,有些则十分具体。比如,对特区政府的监督权平时同由谁来具体实施和操作?只能是中央政府,其实也就是习近平的党中央对香港的派驻机构中联办。
</p>
<p>
再比如,向特首发出指令权。重大事项的指令当然会是习近平亲自下令,但一般情况下的指令权行使,也会具体由中联办负责 。
</p>
<p>
从这个角度分析,把香港特区政府类比为内地的某个所谓“民族自治区” 的政府,而把中联办类比成这个自治区的党委,并非不贴切。
</p>
<p>
也就是说,随着对香港“全面管制权”的加强和落实,中联办即使还会沿用旧名,其职能也远远不是用“联络”二字所能够囊括的。
</p>
<p>
如此前提之下 ,因为香港特区政府的特殊,事实上是被视作副国级,所以中央政府事实上,就是党中央的驻港机构也被明确为副国级;对香港政府,还有香港警方等,行使命令权时才更有权威性。正如我们本专栏上一篇文章的最后一部分所分析的那样:中联办代表中央,充当香港行政当局事实上的“上级领导”的角色,是毫无疑问的。由此说来,无论是基于开展工作的便利,理顺中联办与香港行政当局之间的事实上的领导和被领导的关系,还是基于对外彰显中联办的权威性,似乎都有必要将中联办升格为副国级。最简单、最直接的办法就是,给中联办主任一个副国级的全国政协副主席职务 。如此一来,骆惠宁的年龄就不再是问题了。
</p>
<p>
现如今,退位港澳特首被安排为一至两届全国政协副主席渐成惯例。而2017年3月,当时尚还在位的时任香港特首梁振英就被安排为政协副主席,以香港特首身份同时兼任国家领导人和行政长官,成为首例。当时还引发外界争议,质疑这两项职务同兼会有“矛盾”。
</p>
<p>
其实,当时的梁振英也是因为在此前的2016年底,已经宣布放弃争取连任香港特首,才被提前安排进入全国政协副主席序列的。
</p>
<p>
而笔者当时所听到的信息就是,中共内部早有动议,让港澳特首一上任就成为当然的全国政协副主席。理由是,形成某个具体人以国家领导身份出任香港特首或者澳门特首的事实,明确特区政府享受高规格政治地位,有利于向台湾示范。这一动议能否会被采纳尚不好说,但未来中联办主任享受副国级待遇的设计也许两个多月之后就会实现,无论是被安排为全国政协副主席,还是北京已有传闻的,被增补为国务院的国务委员。
</p>
<p>
(文章只代表特约评论员个人的立场和观点)
</p>
</div>
<hr/>
手机上长按并复制下列链接或二维码分享本文章:<br/>
https://github.com/gfw-breaker/banned-news/blob/master/pages/yehuazhongnanhai/gx-01102020154335.md <br/>
<a href='https://github.com/gfw-breaker/banned-news/blob/master/pages/yehuazhongnanhai/gx-01102020154335.md'><img src='https://github.com/gfw-breaker/banned-news/blob/master/pages/yehuazhongnanhai/gx-01102020154335.md.png'/></a> <br/>
原文地址(需翻墙访问):https://www.rfa.org/mandarin/zhuanlan/yehuazhongnanhai/gx-01102020154335.html
------------------------
#### [首页](https://github.com/gfw-breaker/banned-news/blob/master/README.md) | [一键翻墙软件](https://github.com/gfw-breaker/nogfw/blob/master/README.md) | [《九评共产党》](https://github.com/gfw-breaker/9ping.md/blob/master/README.md#九评之一评共产党是什么) | [《解体党文化》](https://github.com/gfw-breaker/jtdwh.md/blob/master/README.md) | [《共产主义的终极目的》](https://github.com/gfw-breaker/gczydzjmd.md/blob/master/README.md)
<img src='http://gfw-breaker.win/banned-news/pages/yehuazhongnanhai/gx-01102020154335.md' width='0px' height='0px'/> | {
"pile_set_name": "Github"
} |
/*
* Device Tree for the ST-Ericsson Nomadik S8815 board
* Produced by Calao Systems
*/
/dts-v1/;
/include/ "ste-nomadik-stn8815.dtsi"
/ {
model = "Calao Systems USB-S8815";
compatible = "calaosystems,usb-s8815";
chosen {
bootargs = "root=/dev/ram0 console=ttyAMA1,115200n8 earlyprintk";
};
/* This is where the interrupt is routed on the S8815 board */
external-bus@34000000 {
ethernet@300 {
interrupt-parent = <&gpio3>;
interrupts = <8 0x1>;
};
};
src@101e0000 {
/* These chrystal drivers are not used on this board */
disable-sxtalo;
disable-mxtalo;
};
pinctrl {
/* Hog CD pins */
pinctrl-names = "default";
pinctrl-0 = <&cd_default_mode>;
mmcsd-cd {
cd_default_mode: cd_default {
cd_default_cfg1 {
/* CD input GPIO */
ste,pins = "GPIO111_H21";
ste,input = <0>;
};
cd_default_cfg2 {
/* CD GPIO biasing */
ste,pins = "GPIO112_J21";
ste,output = <0>;
};
};
};
user-led {
user_led_default_mode: user_led_default {
user_led_default_cfg {
ste,pins = "GPIO2_C5";
ste,output = <1>;
};
};
};
user-button {
user_button_default_mode: user_button_default {
user_button_default_cfg {
ste,pins = "GPIO3_A4";
ste,input = <0>;
};
};
};
};
/* Custom board node with GPIO pins to active etc */
usb-s8815 {
/* The S8815 is using this very GPIO pin for the SMSC91x IRQs */
ethernet-gpio {
gpios = <&gpio3 8 0x1>;
};
/* This will bias the MMC/SD card detect line */
mmcsd-gpio {
gpios = <&gpio3 16 0x1>;
};
};
/* The user LED on the board is set up to be used for heartbeat */
leds {
compatible = "gpio-leds";
user-led {
label = "user_led";
gpios = <&gpio0 2 0x1>;
default-state = "off";
linux,default-trigger = "heartbeat";
pinctrl-names = "default";
pinctrl-0 = <&user_led_default_mode>;
};
};
/* User key mapped in as "escape" */
gpio-keys {
compatible = "gpio-keys";
user-button {
label = "user_button";
gpios = <&gpio0 3 0x1>;
linux,code = <1>; /* KEY_ESC */
gpio-key,wakeup;
pinctrl-names = "default";
pinctrl-0 = <&user_button_default_mode>;
};
};
};
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.3.1">
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="defines_73.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
<?php
$settings = require_once '../settings.php';
use Yandex\Dictionary\DictionaryClient;
use Yandex\Common\Exception\ForbiddenException;
use Yandex\Dictionary\Exception\DictionaryException;
$errorMessage = false;
// Is auth
if (isset($_COOKIE['yaAccessToken']) && isset($_COOKIE['yaClientId'])) {
if (!isset($settings["dictionary"]["key"]) || !$settings["dictionary"]["key"]) {
throw new DictionaryException('Empty dictionary key. Get key from https://tech.yandex.ru/keys/get/?service=dict');
}
$dictionaryClient = new DictionaryClient($settings["dictionary"]["key"]);
if (isset($_POST['word']) && $_POST['word'] && isset($_POST['language']) && $_POST['language']) {
$translation = explode('-', $_POST['language']);
if (count($translation) === 2) {
$from = $translation[0];
$to = $translation[1];
$dictionaryClient
->setTranslateFrom($from)
->setTranslateTo($to);
$result = $dictionaryClient->lookup($_POST['word']);
if ($result) {
/** @var \Yandex\Dictionary\DictionaryDefinition $dictionaryDefinition */
$dictionaryDefinition = $result[0];
$dictionaryTranslation = $dictionaryDefinition->getTranslations();
/** @var \Yandex\Dictionary\DictionaryTranslation $dictionaryTranslation */
$dictionaryTranslation = $dictionaryDefinition->getTranslations()[0];
$word = $dictionaryTranslation->getText();
}
}
}
try {
$languages = $dictionaryClient->getLanguages();
} catch (ForbiddenException $ex) {
$errorMessage = $ex->getMessage();
$errorMessage .= '<p>Возможно, у приложения нет прав на доступ к ресурсу. Попробуйте '
. '<a href="' . rtrim(str_replace($_SERVER['DOCUMENT_ROOT'], '', __DIR__), "/") . "/../OAuth/" .
'">авторизироваться</a> и повторить.</p>';
} catch (Exception $ex) {
$errorMessage = $ex->getMessage();
}
}
?>
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Yandex PHP Library: DataSync Demo</title>
<link rel="stylesheet" href="//yandex.st/bootstrap/3.0.0/css/bootstrap.min.css">
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
<link rel="stylesheet" href="/examples/Disk/css/style.css">
</head>
<body>
<div class="container">
<div class="jumbotron">
<h2><span class="glyphicon glyphicon-shopping-cart"></span> Пример работы с API Словаря</h2>
</div>
<ol class="breadcrumb">
<li><a href="/examples">Examples</a></li>
<li class="active">Dictionary</li>
</ol>
<?php
if (!isset($_COOKIE['yaAccessToken']) || !isset($_COOKIE['yaClientId'])) {
?>
<div class="alert alert-info">
Для просмотра этой страници вам необходимо авторизироваться.
<a id="goToAuth"
href="<?php echo rtrim(str_replace($_SERVER['DOCUMENT_ROOT'], '', __DIR__), "/") . '/../OAuth/' ?>"
class="alert-link">Перейти на страницу авторизации</a>.
</div>
<?php
} elseif ($errorMessage) {
?>
<div class="alert alert-danger">
<?= $errorMessage ?>
</div>
<?php
} elseif (isset($languages)) {
?>
<div>
<form class="form-horizontal" action="index.php" method="post">
<div class="form-group">
<label for="inputLanguage" class="col-sm-4 control-label">Язык</label>
<div class="col-sm-8">
<select class="form-control" name="language" id="inputLanguage">
<?php foreach ($languages as $languageNames) { ?>
<option value="<?= $languageNames[0] . '-' . $languageNames[1] ?>"
<?= ($_POST['language'] === $languageNames[0] . '-' . $languageNames[1]) ?
'selected' : '' ?>
>
<?= $languageNames[0] . ' - ' . $languageNames[1] ?>
</option>
<?php
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="inputWord" class="col-sm-4 control-label">Слово</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="inputWord" name="word"
placeholder="Слово">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Перевод</label>
<div class="col-sm-8">
<?= (isset($word)) ? $word : '' ?>
</div>
</div>
<button type="submit" class="btn btn-primary">Перевести</button>
</form>
</div>
<?php
}
?>
<script src="http://yandex.st/jquery/2.0.3/jquery.min.js"></script>
<script src="http://yandex.st/jquery/cookie/1.0/jquery.cookie.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script>
$(function () {
$('#goToAuth').click(function (e) {
$.cookie('back', location.href, {expires: 256, path: '/'});
});
});
</script>
</body>
</html>
| {
"pile_set_name": "Github"
} |
---
---
kind: Service
foo: bar
key: value
alist:
- 1
- 2
- 3
---
---
---
kind: Pod
key2: value2
image: somewhere:latest
---
| {
"pile_set_name": "Github"
} |
/*!
* Font Awesome Free 5.3.1 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/
@import "_variables.less";
@font-face {
font-family: 'Font Awesome 5 Free';
font-style: normal;
font-weight: 900;
src: url('@{fa-font-path}/fa-solid-900.eot');
src: url('@{fa-font-path}/fa-solid-900.eot?#iefix') format('embedded-opentype'),
url('@{fa-font-path}/fa-solid-900.woff2') format('woff2'),
url('@{fa-font-path}/fa-solid-900.woff') format('woff'),
url('@{fa-font-path}/fa-solid-900.ttf') format('truetype'),
url('@{fa-font-path}/fa-solid-900.svg#fontawesome') format('svg');
}
.fa,
.fas {
font-family: 'Font Awesome 5 Free';
font-weight: 900;
}
| {
"pile_set_name": "Github"
} |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dba9e42ad4040154b8541513b096645f, type: 3}
m_Name: head of securitie uniform
m_EditorClassIdentifier:
Base:
Equipped:
Texture: {fileID: 2800000, guid: 6cd3f0ad8ace5f04094f3314aafd2628, type: 3}
Sprites:
- {fileID: 21300000, guid: 6cd3f0ad8ace5f04094f3314aafd2628, type: 3}
- {fileID: 21300002, guid: 6cd3f0ad8ace5f04094f3314aafd2628, type: 3}
- {fileID: 21300004, guid: 6cd3f0ad8ace5f04094f3314aafd2628, type: 3}
- {fileID: 21300006, guid: 6cd3f0ad8ace5f04094f3314aafd2628, type: 3}
EquippedData: {fileID: 4900000, guid: 7aac3933244add6459e0fbb7e2854694, type: 3}
InHandsLeft:
Texture: {fileID: 2800000, guid: 41bacba10cd9c244a94d400b6983d0d3, type: 3}
Sprites:
- {fileID: 21300000, guid: 41bacba10cd9c244a94d400b6983d0d3, type: 3}
- {fileID: 21300002, guid: 41bacba10cd9c244a94d400b6983d0d3, type: 3}
- {fileID: 21300004, guid: 41bacba10cd9c244a94d400b6983d0d3, type: 3}
- {fileID: 21300006, guid: 41bacba10cd9c244a94d400b6983d0d3, type: 3}
EquippedData: {fileID: 4900000, guid: 621214d035653434f8270910130b66af, type: 3}
InHandsRight:
Texture: {fileID: 2800000, guid: 1cf1c4e45bc190b499419530e8a10187, type: 3}
Sprites:
- {fileID: 21300000, guid: 1cf1c4e45bc190b499419530e8a10187, type: 3}
- {fileID: 21300002, guid: 1cf1c4e45bc190b499419530e8a10187, type: 3}
- {fileID: 21300004, guid: 1cf1c4e45bc190b499419530e8a10187, type: 3}
- {fileID: 21300006, guid: 1cf1c4e45bc190b499419530e8a10187, type: 3}
EquippedData: {fileID: 4900000, guid: 6b6780dd824122a4dbe120ccd15520c2, type: 3}
ItemIcon:
Texture: {fileID: 2800000, guid: 0f1d9b1df45c36045a1ae0156b37c95e, type: 3}
Sprites:
- {fileID: 21300000, guid: 0f1d9b1df45c36045a1ae0156b37c95e, type: 3}
EquippedData: {fileID: 0}
SpriteEquipped: {fileID: 11400000, guid: 9cae95e6d40d31e4e80dcce51dbdc0c6, type: 2}
SpriteInHandsLeft: {fileID: 11400000, guid: 11e9dd2ed1ce63140b5027196d7c93ca,
type: 2}
SpriteInHandsRight: {fileID: 11400000, guid: 827fc5476f5037541ad3c0a00e192850,
type: 2}
SpriteItemIcon: {fileID: 11400000, guid: 6eb8bab1a89d35a408fcae45f10e36db, type: 2}
Palette:
- {r: 0, g: 0, b: 0, a: 0}
- {r: 0, g: 0, b: 0, a: 0}
- {r: 0, g: 0, b: 0, a: 0}
- {r: 0, g: 0, b: 0, a: 0}
- {r: 0, g: 0, b: 0, a: 0}
- {r: 0, g: 0, b: 0, a: 0}
- {r: 0, g: 0, b: 0, a: 0}
- {r: 0, g: 0, b: 0, a: 0}
IsPaletted: 0
Base_Adjusted:
Equipped:
Texture: {fileID: 2800000, guid: a979341c0fcac5141a67d60da5fee349, type: 3}
Sprites:
- {fileID: 21300000, guid: a979341c0fcac5141a67d60da5fee349, type: 3}
- {fileID: 21300002, guid: a979341c0fcac5141a67d60da5fee349, type: 3}
- {fileID: 21300004, guid: a979341c0fcac5141a67d60da5fee349, type: 3}
- {fileID: 21300006, guid: a979341c0fcac5141a67d60da5fee349, type: 3}
EquippedData: {fileID: 4900000, guid: 1a3b8c031e347624899ca3322633c44a, type: 3}
InHandsLeft:
Texture: {fileID: 0}
Sprites: []
EquippedData: {fileID: 0}
InHandsRight:
Texture: {fileID: 0}
Sprites: []
EquippedData: {fileID: 0}
ItemIcon:
Texture: {fileID: 0}
Sprites: []
EquippedData: {fileID: 0}
SpriteEquipped: {fileID: 11400000, guid: c9a035efbd317ff48be93505539c113a, type: 2}
SpriteInHandsLeft: {fileID: 0}
SpriteInHandsRight: {fileID: 0}
SpriteItemIcon: {fileID: 0}
Palette:
- {r: 0, g: 0, b: 0, a: 0}
- {r: 0, g: 0, b: 0, a: 0}
- {r: 0, g: 0, b: 0, a: 0}
- {r: 0, g: 0, b: 0, a: 0}
- {r: 0, g: 0, b: 0, a: 0}
- {r: 0, g: 0, b: 0, a: 0}
- {r: 0, g: 0, b: 0, a: 0}
- {r: 0, g: 0, b: 0, a: 0}
IsPaletted: 0
DressVariant:
Equipped:
Texture: {fileID: 2800000, guid: 69b4890e57afed344863af4b39104a53, type: 3}
Sprites:
- {fileID: 21300000, guid: 69b4890e57afed344863af4b39104a53, type: 3}
- {fileID: 21300002, guid: 69b4890e57afed344863af4b39104a53, type: 3}
- {fileID: 21300004, guid: 69b4890e57afed344863af4b39104a53, type: 3}
- {fileID: 21300006, guid: 69b4890e57afed344863af4b39104a53, type: 3}
EquippedData: {fileID: 4900000, guid: a1f58268c9a622142b4de9eccd638a2a, type: 3}
InHandsLeft:
Texture: {fileID: 2800000, guid: 41bacba10cd9c244a94d400b6983d0d3, type: 3}
Sprites:
- {fileID: 21300000, guid: 41bacba10cd9c244a94d400b6983d0d3, type: 3}
- {fileID: 21300002, guid: 41bacba10cd9c244a94d400b6983d0d3, type: 3}
- {fileID: 21300004, guid: 41bacba10cd9c244a94d400b6983d0d3, type: 3}
- {fileID: 21300006, guid: 41bacba10cd9c244a94d400b6983d0d3, type: 3}
EquippedData: {fileID: 4900000, guid: 621214d035653434f8270910130b66af, type: 3}
InHandsRight:
Texture: {fileID: 2800000, guid: 1cf1c4e45bc190b499419530e8a10187, type: 3}
Sprites:
- {fileID: 21300000, guid: 1cf1c4e45bc190b499419530e8a10187, type: 3}
- {fileID: 21300002, guid: 1cf1c4e45bc190b499419530e8a10187, type: 3}
- {fileID: 21300004, guid: 1cf1c4e45bc190b499419530e8a10187, type: 3}
- {fileID: 21300006, guid: 1cf1c4e45bc190b499419530e8a10187, type: 3}
EquippedData: {fileID: 4900000, guid: 6b6780dd824122a4dbe120ccd15520c2, type: 3}
ItemIcon:
Texture: {fileID: 2800000, guid: c63bc9c36530fe244a05e8d3b66f2606, type: 3}
Sprites:
- {fileID: 21300000, guid: c63bc9c36530fe244a05e8d3b66f2606, type: 3}
EquippedData: {fileID: 0}
SpriteEquipped: {fileID: 11400000, guid: 35419a376ea86d046a3428579de5fdeb, type: 2}
SpriteInHandsLeft: {fileID: 11400000, guid: 11e9dd2ed1ce63140b5027196d7c93ca,
type: 2}
SpriteInHandsRight: {fileID: 11400000, guid: 827fc5476f5037541ad3c0a00e192850,
type: 2}
SpriteItemIcon: {fileID: 11400000, guid: adf97b1192359bb49b10c29e0be0d8ea, type: 2}
Palette:
- {r: 0, g: 0, b: 0, a: 0}
- {r: 0, g: 0, b: 0, a: 0}
- {r: 0, g: 0, b: 0, a: 0}
- {r: 0, g: 0, b: 0, a: 0}
- {r: 0, g: 0, b: 0, a: 0}
- {r: 0, g: 0, b: 0, a: 0}
- {r: 0, g: 0, b: 0, a: 0}
- {r: 0, g: 0, b: 0, a: 0}
IsPaletted: 0
Variants: []
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, SAP SE. 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.
*
* 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.
*
*/
#ifndef CPU_S390_GC_SHARED_CARDTABLEBARRIERSETASSEMBLER_S390_HPP
#define CPU_S390_GC_SHARED_CARDTABLEBARRIERSETASSEMBLER_S390_HPP
#include "asm/macroAssembler.hpp"
#include "gc/shared/modRefBarrierSetAssembler.hpp"
class CardTableBarrierSetAssembler: public ModRefBarrierSetAssembler {
protected:
void store_check(MacroAssembler* masm, Register store_addr, Register tmp);
virtual void gen_write_ref_array_post_barrier(MacroAssembler* masm, DecoratorSet decorators, Register addr, Register count,
bool do_return);
virtual void oop_store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
const Address& dst, Register val, Register tmp1, Register tmp2, Register tmp3);
};
#endif // CPU_S390_GC_SHARED_CARDTABLEBARRIERSETASSEMBLER_S390_HPP
| {
"pile_set_name": "Github"
} |
// Copyright 2014 The Prometheus 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 expfmt
import (
"fmt"
"io"
"math"
"strings"
dto "github.com/prometheus/client_model/go"
"github.com/prometheus/common/model"
)
// MetricFamilyToText converts a MetricFamily proto message into text format and
// writes the resulting lines to 'out'. It returns the number of bytes written
// and any error encountered. The output will have the same order as the input,
// no further sorting is performed. Furthermore, this function assumes the input
// is already sanitized and does not perform any sanity checks. If the input
// contains duplicate metrics or invalid metric or label names, the conversion
// will result in invalid text format output.
//
// This method fulfills the type 'prometheus.encoder'.
func MetricFamilyToText(out io.Writer, in *dto.MetricFamily) (int, error) {
var written int
// Fail-fast checks.
if len(in.Metric) == 0 {
return written, fmt.Errorf("MetricFamily has no metrics: %s", in)
}
name := in.GetName()
if name == "" {
return written, fmt.Errorf("MetricFamily has no name: %s", in)
}
// Comments, first HELP, then TYPE.
if in.Help != nil {
n, err := fmt.Fprintf(
out, "# HELP %s %s\n",
name, escapeString(*in.Help, false),
)
written += n
if err != nil {
return written, err
}
}
metricType := in.GetType()
n, err := fmt.Fprintf(
out, "# TYPE %s %s\n",
name, strings.ToLower(metricType.String()),
)
written += n
if err != nil {
return written, err
}
// Finally the samples, one line for each.
for _, metric := range in.Metric {
switch metricType {
case dto.MetricType_COUNTER:
if metric.Counter == nil {
return written, fmt.Errorf(
"expected counter in metric %s %s", name, metric,
)
}
n, err = writeSample(
name, metric, "", "",
metric.Counter.GetValue(),
out,
)
case dto.MetricType_GAUGE:
if metric.Gauge == nil {
return written, fmt.Errorf(
"expected gauge in metric %s %s", name, metric,
)
}
n, err = writeSample(
name, metric, "", "",
metric.Gauge.GetValue(),
out,
)
case dto.MetricType_UNTYPED:
if metric.Untyped == nil {
return written, fmt.Errorf(
"expected untyped in metric %s %s", name, metric,
)
}
n, err = writeSample(
name, metric, "", "",
metric.Untyped.GetValue(),
out,
)
case dto.MetricType_SUMMARY:
if metric.Summary == nil {
return written, fmt.Errorf(
"expected summary in metric %s %s", name, metric,
)
}
for _, q := range metric.Summary.Quantile {
n, err = writeSample(
name, metric,
model.QuantileLabel, fmt.Sprint(q.GetQuantile()),
q.GetValue(),
out,
)
written += n
if err != nil {
return written, err
}
}
n, err = writeSample(
name+"_sum", metric, "", "",
metric.Summary.GetSampleSum(),
out,
)
if err != nil {
return written, err
}
written += n
n, err = writeSample(
name+"_count", metric, "", "",
float64(metric.Summary.GetSampleCount()),
out,
)
case dto.MetricType_HISTOGRAM:
if metric.Histogram == nil {
return written, fmt.Errorf(
"expected histogram in metric %s %s", name, metric,
)
}
infSeen := false
for _, q := range metric.Histogram.Bucket {
n, err = writeSample(
name+"_bucket", metric,
model.BucketLabel, fmt.Sprint(q.GetUpperBound()),
float64(q.GetCumulativeCount()),
out,
)
written += n
if err != nil {
return written, err
}
if math.IsInf(q.GetUpperBound(), +1) {
infSeen = true
}
}
if !infSeen {
n, err = writeSample(
name+"_bucket", metric,
model.BucketLabel, "+Inf",
float64(metric.Histogram.GetSampleCount()),
out,
)
if err != nil {
return written, err
}
written += n
}
n, err = writeSample(
name+"_sum", metric, "", "",
metric.Histogram.GetSampleSum(),
out,
)
if err != nil {
return written, err
}
written += n
n, err = writeSample(
name+"_count", metric, "", "",
float64(metric.Histogram.GetSampleCount()),
out,
)
default:
return written, fmt.Errorf(
"unexpected type in metric %s %s", name, metric,
)
}
written += n
if err != nil {
return written, err
}
}
return written, nil
}
// writeSample writes a single sample in text format to out, given the metric
// name, the metric proto message itself, optionally an additional label name
// and value (use empty strings if not required), and the value. The function
// returns the number of bytes written and any error encountered.
func writeSample(
name string,
metric *dto.Metric,
additionalLabelName, additionalLabelValue string,
value float64,
out io.Writer,
) (int, error) {
var written int
n, err := fmt.Fprint(out, name)
written += n
if err != nil {
return written, err
}
n, err = labelPairsToText(
metric.Label,
additionalLabelName, additionalLabelValue,
out,
)
written += n
if err != nil {
return written, err
}
n, err = fmt.Fprintf(out, " %v", value)
written += n
if err != nil {
return written, err
}
if metric.TimestampMs != nil {
n, err = fmt.Fprintf(out, " %v", *metric.TimestampMs)
written += n
if err != nil {
return written, err
}
}
n, err = out.Write([]byte{'\n'})
written += n
if err != nil {
return written, err
}
return written, nil
}
// labelPairsToText converts a slice of LabelPair proto messages plus the
// explicitly given additional label pair into text formatted as required by the
// text format and writes it to 'out'. An empty slice in combination with an
// empty string 'additionalLabelName' results in nothing being
// written. Otherwise, the label pairs are written, escaped as required by the
// text format, and enclosed in '{...}'. The function returns the number of
// bytes written and any error encountered.
func labelPairsToText(
in []*dto.LabelPair,
additionalLabelName, additionalLabelValue string,
out io.Writer,
) (int, error) {
if len(in) == 0 && additionalLabelName == "" {
return 0, nil
}
var written int
separator := '{'
for _, lp := range in {
n, err := fmt.Fprintf(
out, `%c%s="%s"`,
separator, lp.GetName(), escapeString(lp.GetValue(), true),
)
written += n
if err != nil {
return written, err
}
separator = ','
}
if additionalLabelName != "" {
n, err := fmt.Fprintf(
out, `%c%s="%s"`,
separator, additionalLabelName,
escapeString(additionalLabelValue, true),
)
written += n
if err != nil {
return written, err
}
}
n, err := out.Write([]byte{'}'})
written += n
if err != nil {
return written, err
}
return written, nil
}
var (
escape = strings.NewReplacer("\\", `\\`, "\n", `\n`)
escapeWithDoubleQuote = strings.NewReplacer("\\", `\\`, "\n", `\n`, "\"", `\"`)
)
// escapeString replaces '\' by '\\', new line character by '\n', and - if
// includeDoubleQuote is true - '"' by '\"'.
func escapeString(v string, includeDoubleQuote bool) string {
if includeDoubleQuote {
return escapeWithDoubleQuote.Replace(v)
}
return escape.Replace(v)
}
| {
"pile_set_name": "Github"
} |
/* vpm_int.h */
/*
* Written by Dr Stephen N Henson ([email protected]) for the OpenSSL project
* 2013.
*/
/* ====================================================================
* Copyright (c) 2013 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* [email protected].
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* ([email protected]). This product includes software written by Tim
* Hudson ([email protected]).
*
*/
/* internal only structure to hold additional X509_VERIFY_PARAM data */
struct X509_VERIFY_PARAM_ID_st {
STACK_OF(OPENSSL_STRING) *hosts; /* Set of acceptable names */
unsigned int hostflags; /* Flags to control matching features */
char *peername; /* Matching hostname in peer certificate */
char *email; /* If not NULL email address to match */
size_t emaillen;
unsigned char *ip; /* If not NULL IP address to match */
size_t iplen; /* Length of IP address */
unsigned char poison; /* Fail all verifications */
};
| {
"pile_set_name": "Github"
} |
// <auto-generated />
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Ombi.Store.Context;
namespace Ombi.Store.Migrations.Settings
{
[DbContext(typeof(SettingsContext))]
partial class SettingsContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.2-servicing-10034");
modelBuilder.Entity("Ombi.Store.Entities.ApplicationConfiguration", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("Type");
b.Property<string>("Value");
b.HasKey("Id");
b.ToTable("ApplicationConfiguration");
});
modelBuilder.Entity("Ombi.Store.Entities.GlobalSettings", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Content");
b.Property<string>("SettingsName");
b.HasKey("Id");
b.ToTable("GlobalSettings");
});
#pragma warning restore 612, 618
}
}
}
| {
"pile_set_name": "Github"
} |
<?php
/*
* This file is part of SwiftMailer.
* (c) 2004-2009 Chris Corbyn
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* An embedded file, in a multipart message.
*
* @author Chris Corbyn
*/
class Swift_EmbeddedFile extends Swift_Mime_EmbeddedFile
{
/**
* Create a new EmbeddedFile.
*
* Details may be optionally provided to the constructor.
*
* @param string|Swift_OutputByteStream $data
* @param string $filename
* @param string $contentType
*/
public function __construct($data = null, $filename = null, $contentType = null)
{
call_user_func_array(
array($this, 'Swift_Mime_EmbeddedFile::__construct'),
Swift_DependencyContainer::getInstance()
->createDependenciesFor('mime.embeddedfile')
);
$this->setBody($data);
$this->setFilename($filename);
if ($contentType) {
$this->setContentType($contentType);
}
}
/**
* Create a new EmbeddedFile.
*
* @param string|Swift_OutputByteStream $data
* @param string $filename
* @param string $contentType
*
* @return Swift_Mime_EmbeddedFile
*/
public static function newInstance($data = null, $filename = null, $contentType = null)
{
return new self($data, $filename, $contentType);
}
/**
* Create a new EmbeddedFile from a filesystem path.
*
* @param string $path
*
* @return Swift_Mime_EmbeddedFile
*/
public static function fromPath($path)
{
return self::newInstance()->setFile(
new Swift_ByteStream_FileByteStream($path)
);
}
}
| {
"pile_set_name": "Github"
} |
/*=========================================================================
Program: Visualization Toolkit
Module: vtkPeriodicTable.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkPeriodicTable.h"
#include "vtkAbstractArray.h"
#include "vtkBlueObeliskData.h"
#include "vtkColor.h"
#include "vtkDebugLeaks.h"
#include "vtkFloatArray.h"
#include "vtkLookupTable.h"
#include "vtkMutexLock.h"
#include "vtkObjectFactory.h"
#include "vtkStdString.h"
#include "vtkStringArray.h"
#include "vtkUnsignedShortArray.h"
#include <cassert>
#include <cctype>
#include <cstring>
#include <string>
// Setup static variables
vtkNew<vtkBlueObeliskData> vtkPeriodicTable::BlueObeliskData;
//------------------------------------------------------------------------------
vtkStandardNewMacro(vtkPeriodicTable);
//------------------------------------------------------------------------------
vtkPeriodicTable::vtkPeriodicTable()
{
this->BlueObeliskData->GetWriteMutex()->Lock();
if (!this->BlueObeliskData->IsInitialized())
{
this->BlueObeliskData->Initialize();
}
this->BlueObeliskData->GetWriteMutex()->Unlock();
}
//------------------------------------------------------------------------------
vtkPeriodicTable::~vtkPeriodicTable() = default;
//------------------------------------------------------------------------------
void vtkPeriodicTable::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
os << indent << "BlueObeliskData:\n";
this->BlueObeliskData->PrintSelf(os, indent.GetNextIndent());
}
//------------------------------------------------------------------------------
unsigned short vtkPeriodicTable::GetNumberOfElements()
{
return this->BlueObeliskData->GetNumberOfElements();
}
//------------------------------------------------------------------------------
const char* vtkPeriodicTable::GetSymbol(unsigned short atomicNum)
{
if (atomicNum > this->GetNumberOfElements())
{
vtkWarningMacro("Atomic number out of range ! Using 0 instead of " << atomicNum);
atomicNum = 0;
}
return this->BlueObeliskData->GetSymbols()->GetValue(atomicNum).c_str();
}
//------------------------------------------------------------------------------
const char* vtkPeriodicTable::GetElementName(unsigned short atomicNum)
{
if (atomicNum > this->GetNumberOfElements())
{
vtkWarningMacro("Atomic number out of range ! Using 0 instead of " << atomicNum);
atomicNum = 0;
}
return this->BlueObeliskData->GetNames()->GetValue(atomicNum).c_str();
}
//------------------------------------------------------------------------------
unsigned short vtkPeriodicTable::GetAtomicNumber(const vtkStdString& str)
{
return this->GetAtomicNumber(str.c_str());
}
//------------------------------------------------------------------------------
unsigned short vtkPeriodicTable::GetAtomicNumber(const char* str)
{
// If the string is null or the BODR object is not initialized, just
// return 0.
if (!str)
{
return 0;
}
// First attempt to just convert the string to an integer. If this
// works, return the integer
int atoi_num = atoi(str);
if (atoi_num > 0 && atoi_num <= static_cast<int>(this->GetNumberOfElements()))
{
return static_cast<unsigned short>(atoi_num);
}
// Convert str to lowercase (see note about casts in
// https://en.cppreference.com/w/cpp/string/byte/tolower)
std::string lowerStr(str);
std::transform(lowerStr.cbegin(), lowerStr.cend(), lowerStr.begin(),
[](unsigned char c) -> char { return static_cast<char>(std::tolower(c)); });
// Cache pointers:
vtkStringArray* lnames = this->BlueObeliskData->GetLowerNames();
vtkStringArray* lsymbols = this->BlueObeliskData->GetLowerSymbols();
const unsigned short numElements = this->GetNumberOfElements();
// Compare with other lowercase strings
for (unsigned short ind = 0; ind <= numElements; ++ind)
{
if (lnames->GetValue(ind).compare(lowerStr) == 0 ||
lsymbols->GetValue(ind).compare(lowerStr) == 0)
{
return ind;
}
}
// Manually test some non-standard names:
// - Deuterium
if (lowerStr == "d" || lowerStr == "deuterium")
{
return 1;
}
// - Tritium
else if (lowerStr == "t" || lowerStr == "tritium")
{
return 1;
}
// - Aluminum (vs. Aluminium)
else if (lowerStr == "aluminum")
{
return 13;
}
return 0;
}
//------------------------------------------------------------------------------
float vtkPeriodicTable::GetCovalentRadius(unsigned short atomicNum)
{
if (atomicNum > this->GetNumberOfElements())
{
vtkWarningMacro("Atomic number out of range ! Using 0 instead of " << atomicNum);
atomicNum = 0;
}
return this->BlueObeliskData->GetCovalentRadii()->GetValue(atomicNum);
}
//------------------------------------------------------------------------------
float vtkPeriodicTable::GetVDWRadius(unsigned short atomicNum)
{
if (atomicNum > this->GetNumberOfElements())
{
vtkWarningMacro("Atomic number out of range ! Using 0 instead of " << atomicNum);
atomicNum = 0;
}
return this->BlueObeliskData->GetVDWRadii()->GetValue(atomicNum);
}
//------------------------------------------------------------------------------
float vtkPeriodicTable::GetMaxVDWRadius()
{
float maxRadius = 0;
for (unsigned short i = 0; i < this->GetNumberOfElements(); i++)
{
maxRadius = std::max(maxRadius, this->GetVDWRadius(i));
}
return maxRadius;
}
//------------------------------------------------------------------------------
void vtkPeriodicTable::GetDefaultLUT(vtkLookupTable* lut)
{
const unsigned short numColors = this->GetNumberOfElements() + 1;
vtkFloatArray* colors = this->BlueObeliskData->GetDefaultColors();
lut->SetNumberOfColors(numColors);
lut->SetIndexedLookup(true);
float rgb[3];
for (vtkIdType i = 0; static_cast<unsigned int>(i) < numColors; ++i)
{
colors->GetTypedTuple(i, rgb);
lut->SetTableValue(i, rgb[0], rgb[1], rgb[2]);
lut->SetAnnotation(i, this->GetSymbol(static_cast<unsigned short>(i)));
}
}
//------------------------------------------------------------------------------
void vtkPeriodicTable::GetDefaultRGBTuple(unsigned short atomicNum, float rgb[3])
{
this->BlueObeliskData->GetDefaultColors()->GetTypedTuple(atomicNum, rgb);
}
//------------------------------------------------------------------------------
vtkColor3f vtkPeriodicTable::GetDefaultRGBTuple(unsigned short atomicNum)
{
vtkColor3f result;
this->BlueObeliskData->GetDefaultColors()->GetTypedTuple(atomicNum, result.GetData());
return result;
}
| {
"pile_set_name": "Github"
} |
# $Id$Revision$
## Process this file with automake to produce Makefile.in
pdfdir = $(pkgdatadir)/doc/pdf
AM_CPPFLAGS = \
-DSMYRNA_PATH=\""$(pkgdatadir)/smyrna"\" \
-I$(top_srcdir) \
-I$(top_srcdir)/lib/cgraph \
-I$(top_srcdir)/lib/cdt \
-I$(top_srcdir)/lib/glcomp \
-I$(top_srcdir)/lib/utilities \
-I$(top_srcdir)/lib/xdot \
-I$(top_srcdir)/lib/glcomp \
-I$(top_srcdir)/lib/ast \
-I$(top_srcdir)/lib/sfio \
-I$(top_srcdir)/lib/neatogen \
-I$(top_srcdir)/lib/topfish \
-I$(top_srcdir)/lib/gvpr \
-I$(top_srcdir)/lib/common \
-I$(top_srcdir)/cmd/smyrna/gui \
$(GTK_CFLAGS) $(GLUT_CFLAGS) $(GTKGLEXT_CFLAGS) $(GLADE_CFLAGS) $(FREETYPE2_CFLAGS) $(FONTCONFIG_CFLAGS) $(GTS_CFLAGS) $(XRENDER_CFLAGS)
bin_PROGRAMS =
man_MANS =
pdf_DATA =
if WITH_SMYRNA
if ENABLE_SHARED
bin_PROGRAMS += smyrna
endif
if ENABLE_STATIC
bin_PROGRAMS += smyrna_static
endif
man_MANS += smyrna.1
pdf_DATA += smyrna.1.pdf
endif
noinst_HEADERS = arcball.h draw.h glexpose.h \
glmotion.h gltemplate.h gui/appmouse.h gui/callbacks.h \
hotkeymap.h materials.h md5.h polytess.h selectionfuncs.h \
smyrna_utils.h smyrnadefs.h topfisheyeview.h \
topviewdefs.h topviewfuncs.h trackball.h tvnodes.h \
viewport.h viewportcamera.h support.h \
gui/datalistcallbacks.h gui/frmobjectui.h \
gui/glcompui.h gui/gui.h gui/menucallbacks.h \
gui/toolboxcallbacks.h gui/topviewsettings.h gvprpipe.h hier.h glutrender.h
smyrna_SOURCES = arcball.c draw.c glexpose.c \
glmotion.c gltemplate.c gui/appmouse.c gui/callbacks.c \
gvprpipe.c hier.c hotkeymap.c main.c md5.c polytess.c \
selectionfuncs.c smyrna_utils.c topfisheyeview.c \
topviewfuncs.c trackball.c tvnodes.c \
viewport.c viewportcamera.c \
gui/datalistcallbacks.c gui/frmobjectui.c \
gui/glcompui.c gui/gui.c gui/menucallbacks.c \
gui/toolboxcallbacks.c gui/topviewsettings.c glutrender.c
smyrna_LDADD = $(top_builddir)/lib/cgraph/libcgraph_C.la \
$(top_builddir)/lib/cdt/libcdt_C.la \
$(top_builddir)/lib/xdot/libxdot_C.la \
$(top_builddir)/lib/glcomp/libglcomp_C.la \
$(top_builddir)/lib/topfish/libtopfish_C.la \
$(top_builddir)/lib/common/libcommon_C.la \
$(top_builddir)/lib/gvpr/libgvpr_C.la \
$(top_builddir)/lib/expr/libexpr_C.la \
$(top_builddir)/lib/ingraphs/libingraphs_C.la \
$(top_builddir)/lib/neatogen/libneatogen_C.la \
$(GTK_LIBS) $(GLUT_LIBS) $(GTKGLEXT_LIBS) $(GLADE_LIBS) $(X_LIBS) $(EXPAT_LIBS) $(GTS_LIBS) $(MATH_LIBS) $(EXTRA_SMYRNA_LDFLAGS)
smyrna_static_SOURCES = $(smyrna_SOURCES)
smyrna_static_LDADD = $(top_builddir)/lib/cgraph/libcgraph_C.la \
$(top_builddir)/lib/cdt/libcdt_C.la \
$(top_builddir)/lib/xdot/libxdot_C.la \
$(top_builddir)/lib/glcomp/libglcomp_C.la \
$(top_builddir)/lib/topfish/libtopfish_C.la \
$(top_builddir)/lib/common/libcommon_C.la \
$(top_builddir)/lib/gvpr/libgvpr_C.la \
$(top_builddir)/lib/expr/libexpr_C.la \
$(top_builddir)/lib/ingraphs/libingraphs_C.la \
$(top_builddir)/lib/neatogen/libneatogen_C.la \
$(GTK_LIBS) $(GLUT_LIBS) $(GTKGLEXT_LIBS) $(GLADE_LIBS) $(X_LIBS) $(EXPAT_LIBS) $(GTS_LIBS) $(MATH_LIBS)
smyrna.1.pdf: $(srcdir)/smyrna.1
- @GROFF@ -Tps -man $(srcdir)/smyrna.1 | @PS2PDF@ - - >smyrna.1.pdf
EXTRA_DIST = smyrna.vcxproj* $(man_MANS) $(pdf_DATA) smyrna.1
DISTCLEANFILES = $(pdf_DATA)
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2001-2017, Zoltan Farkas All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*
* Additionally licensed with:
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.spf4j.base;
import com.google.common.primitives.Ints;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.annotation.ParametersAreNonnullByDefault;
/**
*
* @author zoly
*/
@ParametersAreNonnullByDefault
public final class Version implements Comparable<Version>, Serializable {
private static final long serialVersionUID = 1L;
private transient Comparable[] components;
private final String image;
public Version(final String version) {
this((CharSequence) version);
}
public Version(final CharSequence version) {
this.image = version.toString();
parse(version);
}
private void parse(final CharSequence version) {
List<Comparable<?>> comps = new ArrayList<>(4);
StringBuilder sb = new StringBuilder();
for (int i = 0, l = version.length(); i < l; i++) {
char c = version.charAt(i);
final int length = sb.length();
if (c == '.') {
addPart(sb.toString(), comps);
sb.setLength(0);
} else if (Character.isDigit(c)) {
if (length > 0) {
char prev = sb.charAt(length - 1);
if (!Character.isDigit(prev)) {
comps.add(sb.toString());
sb.setLength(0);
}
}
sb.append(c);
} else {
if (length > 0) {
char prev = sb.charAt(length - 1);
if (Character.isDigit(prev)) {
comps.add(Integer.valueOf(sb.toString()));
sb.setLength(0);
}
}
sb.append(c);
}
}
if (sb.length() > 0) {
addPart(sb.toString(), comps);
}
components = comps.toArray(new Comparable[comps.size()]);
}
private static void addPart(final String strPart, final Collection<Comparable<?>> comps) {
Integer nr = Ints.tryParse(strPart);
if (nr == null) {
comps.add(strPart);
} else {
comps.add(nr);
}
}
@Override
@SuppressWarnings("unchecked")
public int compareTo(final Version o) {
if (components.length == o.components.length) {
return Comparables.compareArrays(components, o.components);
} else if (components.length < o.components.length) {
int res = Comparables.compareArrays(components, o.components, 0, components.length);
if (res == 0) {
Comparable component = o.components[components.length];
if (component instanceof String && ((String) component).contains("SNAPSHOT")) {
return 1;
} else {
return -1;
}
}
return res;
} else {
int res = Comparables.compareArrays(components, o.components, 0, o.components.length);
if (res == 0) {
Comparable component = components[o.components.length];
if (component instanceof String && ((String) component).contains("SNAPSHOT")) {
return -1;
} else {
return 1;
}
}
return res;
}
}
@Override
public int hashCode() {
return image.hashCode();
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
return this.compareTo((Version) obj) == 0;
}
public String getImage() {
return image;
}
public Comparable[] getComponents() {
return components.clone();
}
public Comparable getComponent(final int pos) {
return components[pos];
}
@SuppressFBWarnings("CLI_CONSTANT_LIST_INDEX")
public int getMajor() {
return (int) components[0];
}
@SuppressFBWarnings("CLI_CONSTANT_LIST_INDEX")
public int getMinor() {
return (int) components[1];
}
@SuppressFBWarnings("CLI_CONSTANT_LIST_INDEX")
public int getPatch() {
return (int) components[2];
}
public int getNrComponents() {
return components.length;
}
private void readObject(final java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
s.defaultReadObject();
parse(this.image);
}
@Override
public String toString() {
return image;
}
}
| {
"pile_set_name": "Github"
} |
/**
* This file is copyright 2017 State of the Netherlands (Ministry of Interior Affairs and Kingdom Relations).
* It is made available under the terms of the GNU Affero General Public License, version 3 as published by the Free Software Foundation.
* The project of which this file is part, may be found at https://github.com/MinBZK/operatieBRP.
*/
/**
*
*/
package nl.bzk.brp.preview.model;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.jmx.export.annotation.ManagedAttribute;
import org.springframework.jmx.export.annotation.ManagedResource;
import org.springframework.stereotype.Component;
/**
* Deze klasse bevat de instellingen die door het dashboard worden gebruikt. Deze instellingen kunnen worden gewijzigd
* gedurende de demo en moeten 'on the fly' zichtbaar worden.
*/
@Component
@Scope(BeanDefinition.SCOPE_SINGLETON)
@ManagedResource(
description = "Deze klasse wordt gebruikt om de instelligen van het dashboard scherm dynamisch aan te kunnen passen.",
objectName = "dashboardSettings")
public class DashboardSettings {
/** De constante MAX_AANTAL_BERICHTEN. */
public static final int MAX_AANTAL_BERICHTEN_PER_RESPONSE = 100;
/** De constante MAX_AANTAL_BERICHTEN. */
public static final int MAX_AANTAL_BERICHTEN_TONEN = 7;
/** De constante DEFAULTPAGINA. */
public static final int DEFAULT_PAGINA = 1;
/** De constante DEFAULT_BERICHTEN_VOLLEDIG. */
public static final int DEFAULT_BERICHTEN_VOLLEDIG = 3;
/** Het maximaal aantal berichten per response. */
private int maximaalAantalBerichtenPerResponse = MAX_AANTAL_BERICHTEN_PER_RESPONSE;
/** Het maximaal aantal berichten op het scherm. */
private int maximaalAantalBerichtenTonen;
/** Het aantal berichten dat volledig getoond wordt op het dashboard. */
private int aantalBerichtenVolledig = DEFAULT_BERICHTEN_VOLLEDIG;
/** Het aantal berichten dat volledig getoond wordt op het dashboard. */
private int aantalRecenteBsnsVoorAutocompletion = 100;
public DashboardSettings() {
maximaalAantalBerichtenTonen = MAX_AANTAL_BERICHTEN_TONEN;
}
public int getMaximumAantalBerichtenPerResponse() {
return maximaalAantalBerichtenPerResponse;
}
/**
* Zet de maximum aantal berichten per response.
*
* @param aantalBerichtenPerResponse de new maximum aantal berichten per response
*/
@ManagedAttribute(defaultValue = "10")
public void setMaximumAantalBerichtenPerResponse(final int aantalBerichtenPerResponse) {
maximaalAantalBerichtenPerResponse = aantalBerichtenPerResponse;
}
/**
* Geef de aantal berichten volledig.
*
* @return de aantal berichten volledig
*/
public int getAantalBerichtenVolledig() {
return aantalBerichtenVolledig;
}
/**
* Zet de aantal berichten volledig.
*
* @param aantalBerichtenVolledig de new aantal berichten volledig
*/
@ManagedAttribute
public void setAantalBerichtenVolledig(final int aantalBerichtenVolledig) {
this.aantalBerichtenVolledig = aantalBerichtenVolledig;
}
/**
* Geef de maximaal aantal berichten tonen.
*
* @return de maximaal aantal berichten tonen
*/
public int getMaximaalAantalBerichtenTonen() {
return maximaalAantalBerichtenTonen;
}
/**
* Zet de maximum aantal berichten tonen.
*
* @param aantalBerichtenTonenOpScherm de new maximum aantal berichten tonen
*/
@ManagedAttribute(defaultValue = "5")
public void setMaximumAantalBerichtenTonen(final int aantalBerichtenTonenOpScherm) {
maximaalAantalBerichtenTonen = aantalBerichtenTonenOpScherm;
}
public int getAantalRecenteBsnsVoorAutocompletion() {
return aantalRecenteBsnsVoorAutocompletion;
}
public void setAantalRecenteBsnsVoorAutocompletion(final int aantalRecenteBsnsVoorAutocompletion) {
this.aantalRecenteBsnsVoorAutocompletion = aantalRecenteBsnsVoorAutocompletion;
}
}
| {
"pile_set_name": "Github"
} |
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
// Generated using tools/cldr/cldr-to-icu/build-icu-data.xml
sa{
AuxExemplarCharacters{"[\u200C\u200D ऍ ऑ \u0945 ॉ]"}
ExemplarCharacters{
"[\u0951\u0952 \u093C \u0901 \u0902 ः ॐ अ आ इ ई उ ऊ ऋ ॠ ऌ ॡ ए ऐ ओ औ क ख ग घ ङ"
" च छ ज झ ञ ट ठ ड ढ ण त थ द ध न प फ ब भ म य र ल ळ व श ष स ह ऽ ा ि ी \u0941 "
"\u0942 \u0943 \u0944 \u0962 \u0963 \u0947 \u0948 ो ौ \u094D]"
}
ExemplarCharactersIndex{
"[अ आ इ ई उ ऊ ऋ ॠ ऌ ॡ ए ऐ ओ औ क ख ग घ ङ च छ ज झ ञ ट ठ ड ढ ण त थ द ध न प फ ब भ"
" म य र ल ळ व श ष स ह]"
}
ExemplarCharactersNumbers{"[\\- ‑ , . % ‰ + 0० 1१ 2२ 3३ 4४ 5५ 6६ 7७ 8८ 9९]"}
ExemplarCharactersPunctuation{
"[_ \\- ‑ – — , ; \\: ! ? . … ' ‘ ’ \u0022 “ ” ( ) \\[ \\] \\{ \\} § @ * / "
"\\\\ \\& # ′ ″ ` + | ~]"
}
NumberElements{
default{"deva"}
latn{
miscPatterns{
atLeast{"≥{0}"}
range{"{0}–{1}"}
}
patterns{
accountingFormat{"¤ #,##0.00"}
currencyFormat{"¤#,##,##0.00"}
decimalFormat{"#,##,##0.###"}
percentFormat{"#,##,##0%"}
scientificFormat{"[#E0]"}
}
symbols{
decimal{"."}
exponential{"E"}
group{","}
infinity{"∞"}
minusSign{"-"}
nan{"NaN"}
perMille{"‰"}
percentSign{"%"}
plusSign{"+"}
superscriptingExponent{"×"}
}
}
minimumGroupingDigits{"1"}
native{"deva"}
}
calendar{
generic{
DateTimePatterns{
"h:mm:ss a zzzz",
"h:mm:ss a z",
"h:mm:ss a",
"h:mm a",
"G EEEE, d MMMM y",
"G d MMMM y",
"G d MMM y",
"G d/M/y",
"{1}, {0}",
"{1} तेन {0}",
"{1} तेन {0}",
"{1}, {0}",
"{1}, {0}",
}
}
gregorian{
AmPmMarkers{
"पूर्वाह्न",
"अपराह्न",
}
AmPmMarkersAbbr{
"AM",
"PM",
}
AmPmMarkersNarrow{
"AM",
"PM",
}
DateTimePatterns{
"h:mm:ss a zzzz",
"h:mm:ss a z",
"h:mm:ss a",
"h:mm a",
"EEEE, d MMMM y",
"d MMMM y",
"d MMM y",
"d/M/yy",
"{1}, {0}",
"{1} तदा {0}",
"{1} तदा {0}",
"{1}, {0}",
"{1}, {0}",
}
appendItems{
Timezone{"{0} {1}"}
}
availableFormats{
Bh{"B h"}
Bhm{"B h:mm"}
Bhms{"B h:mm:ss"}
E{"ccc"}
EBhm{"E B h:mm"}
EBhms{"E B h:mm:ss"}
EHm{"E HH:mm"}
EHms{"E HH:mm:ss"}
Ed{"E d"}
Ehm{"E h:mm a"}
Ehms{"E h:mm:ss a"}
Gy{"y G"}
GyMMM{"MMM G y"}
GyMMMEd{"E, d MMM y G"}
GyMMMd{"d MMM y G"}
H{"HH"}
Hm{"HH:mm"}
Hms{"HH:mm:ss"}
Hmsv{"HH:mm:ss v"}
Hmv{"HH:mm v"}
M{"L"}
MEd{"E, d/M"}
MMM{"LLL"}
MMMEd{"E, d MMM"}
MMMMW{
other{"'week' W 'of' MMM"}
}
MMMMd{"d MMMM"}
MMMd{"d MMM"}
Md{"d/M"}
d{"d"}
h{"h a"}
hm{"h:mm a"}
hms{"h:mm:ss a"}
hmsv{"h:mm:ss a v"}
hmv{"h:mm a v"}
ms{"mm:ss"}
y{"y"}
yM{"M/y"}
yMEd{"E, d/M/y"}
yMMM{"MMM y"}
yMMMEd{"E, d MMM y"}
yMMMM{"MMMM y"}
yMMMd{"d MMM y"}
yMd{"d/M/y"}
yQQQ{"QQQ y"}
yQQQQ{"QQQQ y"}
yw{
other{"'week' w 'of' Y"}
}
}
dayNames{
format{
abbreviated{
"रवि",
"सोम",
"मंगल",
"बुध",
"गुरु",
"शुक्र",
"शनि",
}
narrow{
"र",
"सो",
"मं",
"बु",
"गु",
"शु",
"श",
}
short{
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
}
wide{
"रविवासरः",
"सोमवासरः",
"मंगलवासरः",
"बुधवासरः",
"गुरुवासर:",
"शुक्रवासरः",
"शनिवासरः",
}
}
stand-alone{
abbreviated{
"रवि",
"सोम",
"मंगल",
"बुध",
"गुरु",
"शुक्र",
"शनि",
}
narrow{
"र",
"सो",
"मं",
"बु",
"गु",
"शु",
"श",
}
short{
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
}
wide{
"रविवासरः",
"सोमवासरः",
"मंगलवासरः",
"बुधवासरः",
"गुरुवासर:",
"शुक्रवासरः",
"शनिवासरः",
}
}
}
dayPeriod{
stand-alone{
abbreviated{
am{"AM"}
pm{"PM"}
}
narrow{
am{"AM"}
pm{"PM"}
}
wide{
am{"AM"}
pm{"PM"}
}
}
}
eras{
abbreviated{
"BCE",
"CE",
}
abbreviated%variant{
"ईसवी पूर्व",
"संवत्",
}
wide{
"BCE",
"CE",
}
}
intervalFormats{
H{
H{"HH–HH"}
}
Hm{
H{"HH:mm–HH:mm"}
m{"HH:mm–HH:mm"}
}
Hmv{
H{"HH:mm–HH:mm v"}
m{"HH:mm–HH:mm v"}
}
Hv{
H{"HH–HH v"}
}
M{
M{"MM–MM"}
}
MEd{
M{"MM-dd, E – MM-dd, E"}
d{"MM-dd, E – MM-dd, E"}
}
MMM{
M{"LLL–LLL"}
}
MMMEd{
M{"MMM d, E – MMM d, E"}
d{"MMM d, E – MMM d, E"}
}
MMMd{
M{"MMM d – MMM d"}
d{"MMM d–d"}
}
Md{
M{"MM-dd – MM-dd"}
d{"MM-dd – MM-dd"}
}
d{
d{"d–d"}
}
fallback{"{0} – {1}"}
h{
a{"h a – h a"}
h{"h–h a"}
}
hm{
a{"h:mm a – h:mm a"}
h{"h:mm–h:mm a"}
m{"h:mm–h:mm a"}
}
hmv{
a{"h:mm a – h:mm a v"}
h{"h:mm–h:mm a v"}
m{"h:mm–h:mm a v"}
}
hv{
a{"h a – h a v"}
h{"h–h a v"}
}
y{
y{"y–y"}
}
yM{
M{"y-MM – y-MM"}
y{"y-MM – y-MM"}
}
yMEd{
M{"y-MM-dd, E – y-MM-dd, E"}
d{"y-MM-dd, E – y-MM-dd, E"}
y{"y-MM-dd, E – y-MM-dd, E"}
}
yMMM{
M{"y MMM–MMM"}
y{"y MMM – y MMM"}
}
yMMMEd{
M{"y MMM d, E – MMM d, E"}
d{"y MMM d, E – MMM d, E"}
y{"y MMM d, E – y MMM d, E"}
}
yMMMM{
M{"y MMMM–MMMM"}
y{"y MMMM – y MMMM"}
}
yMMMd{
M{"y MMM d – MMM d"}
d{"y MMM d–d"}
y{"y MMM d – y MMM d"}
}
yMd{
M{"y-MM-dd – y-MM-dd"}
d{"y-MM-dd – y-MM-dd"}
y{"y-MM-dd – y-MM-dd"}
}
}
monthNames{
format{
abbreviated{
"जनवरी:",
"फरवरी:",
"मार्च:",
"अप्रैल:",
"मई",
"जून:",
"जुलाई:",
"अगस्त:",
"सितंबर:",
"अक्तूबर:",
"नवंबर:",
"दिसंबर:",
}
narrow{
"ज",
"फ",
"मा",
"अ",
"म",
"जू",
"जु",
"अ",
"सि",
"अ",
"न",
"दि",
}
wide{
"जनवरीमासः",
"फरवरीमासः",
"मार्चमासः",
"अप्रैलमासः",
"मईमासः",
"जूनमासः",
"जुलाईमासः",
"अगस्तमासः",
"सितंबरमासः",
"अक्तूबरमासः",
"नवंबरमासः",
"दिसंबरमासः",
}
}
stand-alone{
abbreviated{
"जनवरी:",
"फरवरी:",
"मार्च:",
"अप्रैल:",
"मई",
"जून:",
"जुलाई:",
"अगस्त:",
"सितंबर:",
"अक्तूबर:",
"नवंबर:",
"दिसंबर:",
}
narrow{
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
}
wide{
"जनवरीमासः",
"फरवरीमासः",
"मार्चमासः",
"अप्रैलमासः",
"मईमासः",
"जूनमासः",
"जुलाईमासः",
"अगस्तमासः",
"सितंबरमासः",
"अक्तूबरमासः",
"नवंबरमासः",
"दिसंबरमासः",
}
}
}
quarters{
format{
abbreviated{
"त्रैमासिक1",
"त्रैमासिक2",
"त्रैमासिक3",
"त्रैमासिक4",
}
narrow{
"1",
"2",
"3",
"4",
}
wide{
"प्रथम त्रैमासिक",
"द्वितीय त्रैमासिक",
"तृतीय त्रैमासिक",
"चतुर्थ त्रैमासिक",
}
}
stand-alone{
abbreviated{
"त्रैमासिक1",
"त्रैमासिक2",
"त्रैमासिक3",
"त्रैमासिक4",
}
narrow{
"1",
"2",
"3",
"4",
}
wide{
"प्रथम त्रैमासिक",
"द्वितीय त्रैमासिक",
"तृतीय त्रैमासिक",
"चतुर्थ त्रैमासिक",
}
}
}
}
}
fields{
day{
dn{"वासर:"}
relative{
"-1"{"गतदिनम्"}
"0"{"अद्य"}
"1"{"श्वः"}
}
}
day-narrow{
dn{"दिवा"}
}
day-short{
dn{"अहन्"}
relative{
"-1"{"ह्यः"}
"0"{"अद्य"}
"1"{"श्वः"}
}
}
dayperiod{
dn{"पूर्वाह्न/अपराह्न"}
}
era{
dn{"युग"}
}
hour{
dn{"होरा"}
}
hour-narrow{
dn{"होरा"}
}
hour-short{
dn{"होरा"}
}
minute{
dn{"निमेष"}
}
minute-narrow{
dn{"निमेष"}
}
minute-short{
dn{"निमेष"}
}
month{
dn{"मास:"}
}
month-narrow{
dn{"मास"}
}
month-short{
dn{"मास"}
}
quarter{
dn{"त्रेमासिक"}
}
quarter-narrow{
dn{"त्रेमासिक"}
}
quarter-short{
dn{"त्रेमासिक"}
}
second{
dn{"क्षण"}
}
second-narrow{
dn{"पल"}
}
second-short{
dn{"पल"}
}
week{
dn{"सप्ताह:"}
}
week-narrow{
dn{"सप्ताह"}
}
week-short{
dn{"सप्ताह"}
}
weekday{
dn{"सप्ताहस्य दिनं"}
}
year{
dn{"वर्ष:"}
}
year-narrow{
dn{"वर्ष"}
}
year-short{
dn{"वर्ष:"}
}
zone{
dn{"समय मण्डल"}
}
}
listPattern{
standard{
2{"{0} तथा {1}"}
end{"{0}, तथा {1}"}
}
}
measurementSystemNames{
UK{"यूके"}
US{"यूएस"}
metric{"छन्दोमान"}
}
}
| {
"pile_set_name": "Github"
} |
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
namespace NuGetGallery.FunctionalTests.ODataFeeds
{
public class SearchTest
: GalleryTestBase
{
public SearchTest(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
}
[Fact]
[Description("Performs a querystring-based search of the v1 feed. Confirms expected packages are returned.")]
[Priority(0)]
[Category("P0Tests")]
public async Task SearchV1Feed()
{
await SearchFeedAsync(UrlHelper.V1FeedRootUrl, "Json.NET");
}
[Fact]
[Description("Performs a querystring-based search of the v2 feed. Confirms expected packages are returned.")]
[Priority(0)]
[Category("P0Tests")]
public async Task SearchV2Feed()
{
await SearchFeedAsync(UrlHelper.V2FeedRootUrl, "Json.NET");
}
private async Task SearchFeedAsync(string feedRootUrl, string title)
{
var requestUrl = feedRootUrl + @"Search()?$filter=IsLatestVersion&$skip=0&$top=25&searchTerm='newtonsoft%20json'&targetFramework='net40'&includePrerelease=false";
TestOutputHelper.WriteLine("Request: GET " + requestUrl);
string responseText;
using (var httpClient = new HttpClient())
using (var response = await httpClient.GetAsync(requestUrl))
{
TestOutputHelper.WriteLine("Response: HTTP " + response.StatusCode);
responseText = await response.Content.ReadAsStringAsync();
}
var expectedUrl = feedRootUrl + "package/Newtonsoft.Json/";
Assert.True(responseText.Contains(@"<title type=""text"">" + title + @"</title>")
|| responseText.Contains(@"<d:Title>" + title + @"</d:Title>"), "The expected package title '" + title + "' wasn't found in the feed. Feed contents: " + responseText);
Assert.True(responseText.Contains(@"<content type=""application/zip"" src=""" + expectedUrl), "The expected package URL '" + expectedUrl + "' wasn't found in the feed. Feed contents: " + responseText);
Assert.False(responseText.Contains(@"jquery"), "The feed contains non-matching package names. Feed contents: " + responseText);
}
}
}
| {
"pile_set_name": "Github"
} |
/*
* IMC compatible decoder
* Copyright (c) 2002-2004 Maxim Poliakovski
* Copyright (c) 2006 Benjamin Larsson
* Copyright (c) 2006 Konstantin Shishkov
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_IMCDATA_H
#define AVCODEC_IMCDATA_H
#include <stdint.h>
static const uint16_t band_tab[33] = {
0, 3, 6, 9, 12, 16, 20, 24, 29, 34, 40,
46, 53, 60, 68, 76, 84, 93, 102, 111, 121, 131,
141, 151, 162, 173, 184, 195, 207, 219, 231, 243, 256,
};
static const int8_t cyclTab[32] = {
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31, 32, 32,
};
static const int8_t cyclTab2[32] = {
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 21, 22,
23, 24, 25, 26, 27, 28, 29};
static const float imc_weights1[31] = {
0.119595, 0.123124, 0.129192, 9.97377e-2, 8.1923e-2, 9.61153e-2, 8.77885e-2, 8.61174e-2,
9.00882e-2, 9.91658e-2, 0.112991, 0.131126, 0.152886, 0.177292, 0.221782, 0.244917, 0.267386,
0.306816, 0.323046, 0.33729, 0.366773, 0.392557, 0.398076, 0.403302, 0.42451, 0.444777,
0.449188, 0.455445, 0.477853, 0.500669, 0.510395};
static const float imc_weights2[31] = {
3.23466e-3, 3.49886e-3, 3.98413e-3, 1.98116e-3, 1.16465e-3, 1.79283e-3, 1.40372e-3, 1.33274e-3,
1.50523e-3, 1.95064e-3, 2.77472e-3, 4.14725e-3, 6.2776e-3, 9.36401e-3, 1.71397e-2, 2.24052e-2,
2.83971e-2, 4.11689e-2, 4.73165e-2, 5.31631e-2, 6.66614e-2, 8.00824e-2, 8.31588e-2, 8.61397e-2,
9.89229e-2, 0.112197, 0.115227, 0.119613, 0.136174, 0.15445, 0.162685};
static const float imc_quantizer1[4][8] = {
{ 8.4431201e-1, 4.7358301e-1, 1.448354, 2.7073899e-1, 7.4449003e-1, 1.241991, 1.845484, 0.0},
{ 8.6876702e-1, 4.7659001e-1, 1.478224, 2.5672799e-1, 7.55777e-1, 1.3229851, 2.03438, 0.0},
{ 7.5891501e-1, 6.2272799e-1, 1.271322, 3.47904e-1, 7.5317699e-1, 1.150767, 1.628476, 0.0},
{ 7.65257e-1, 6.44647e-1, 1.263824, 3.4548101e-1, 7.6384902e-1, 1.214466, 1.7638789, 0.0},
};
static const float imc_quantizer2[2][56] = {
{ 1.39236e-1, 3.50548e-1, 5.9547901e-1, 8.5772401e-1, 1.121545, 1.3882281, 1.695882, 2.1270809,
7.2221003e-2, 1.85177e-1, 2.9521701e-1, 4.12568e-1, 5.4068601e-1, 6.7679501e-1, 8.1196898e-1, 9.4765198e-1,
1.0779999, 1.203415, 1.337265, 1.481871, 1.639982, 1.814766, 2.0701399, 2.449862,
3.7533998e-2, 1.02722e-1, 1.6021401e-1, 2.16043e-1, 2.7231601e-1, 3.3025399e-1, 3.9022601e-1, 4.52849e-1,
5.1794899e-1, 5.8529502e-1, 6.53956e-1, 7.2312802e-1, 7.9150802e-1, 8.5891002e-1, 9.28141e-1, 9.9706203e-1,
1.062153, 1.12564, 1.189834, 1.256122, 1.324469, 1.3955311, 1.468906, 1.545084,
1.6264729, 1.711524, 1.802705, 1.91023, 2.0533991, 2.22333, 2.4830019, 3.253329 },
{ 1.11654e-1, 3.54469e-1, 6.4232099e-1, 9.6128798e-1, 1.295053, 1.61777, 1.989839, 2.51107,
5.7721999e-2, 1.69879e-1, 2.97589e-1, 4.3858799e-1, 5.9039903e-1, 7.4934798e-1, 9.1628098e-1, 1.087297,
1.262751, 1.4288321, 1.6040879, 1.79067, 2.000668, 2.2394669, 2.649332, 5.2760072,
2.9722e-2, 8.7316997e-2, 1.4445201e-1, 2.04247e-1, 2.6879501e-1, 3.3716801e-1, 4.08811e-1, 4.8306999e-1,
5.6049401e-1, 6.3955498e-1, 7.2044599e-1, 8.0427998e-1, 8.8933599e-1, 9.7537601e-1, 1.062461, 1.1510431,
1.240236, 1.326715, 1.412513, 1.500502, 1.591749, 1.686413, 1.785239, 1.891233,
2.0051291, 2.127681, 2.2709141, 2.475826, 2.7219379, 3.101985, 4.686213, 6.2287788},
};
static const float xTab[14] = {7.6, 3.6, 4.4, 3.7, 6.1, 5.1, 2.3, 1.6, 6.2, 1.5, 1.8, 1.2, 0, 0}; //10014048
/* precomputed table for 10^(i/4), i=-15..16 */
static const float imc_exp_tab[32] = {
1.778280e-4, 3.162278e-4, 5.623413e-4, 1.000000e-3,
1.778280e-3, 3.162278e-3, 5.623413e-3, 1.000000e-2,
1.778280e-2, 3.162278e-2, 5.623413e-2, 1.000000e-1,
1.778280e-1, 3.162278e-1, 5.623413e-1, 1.000000e00,
1.778280e00, 3.162278e00, 5.623413e00, 1.000000e01,
1.778280e01, 3.162278e01, 5.623413e01, 1.000000e02,
1.778280e02, 3.162278e02, 5.623413e02, 1.000000e03,
1.778280e03, 3.162278e03, 5.623413e03, 1.000000e04
};
static const float * const imc_exp_tab2 = imc_exp_tab + 8;
static const uint8_t imc_cb_select[4][32] = {
{ 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2 },
{ 0, 2, 0, 3, 2, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
{ 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2 },
{ 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
static const uint8_t imc_huffman_sizes[4] = {
17, 17, 18, 18
};
static const uint8_t imc_huffman_lens[4][4][18] = {
{
{ 16, 15, 13, 11, 8, 5, 3, 1, 2, 4, 6, 9, 10, 12, 14, 16, 7, 0 },
{ 10, 8, 7, 6, 4, 4, 3, 2, 2, 3, 4, 6, 7, 9, 11, 11, 7, 0 },
{ 15, 15, 14, 11, 8, 6, 4, 2, 1, 4, 5, 7, 9, 10, 12, 13, 4, 0 },
{ 13, 11, 10, 8, 6, 4, 2, 2, 2, 3, 5, 7, 9, 12, 15, 15, 14, 0 },
},
{
{ 14, 12, 10, 8, 7, 4, 2, 2, 2, 3, 5, 7, 9, 11, 13, 14, 7, 0 },
{ 14, 13, 11, 8, 6, 4, 3, 2, 2, 3, 5, 7, 9, 10, 12, 14, 3, 0 },
{ 13, 12, 10, 7, 5, 4, 3, 2, 2, 3, 4, 6, 8, 9, 11, 13, 4, 0 },
{ 13, 12, 10, 7, 5, 4, 3, 2, 2, 3, 4, 6, 8, 9, 11, 13, 4, 0 },
},
{
{ 16, 14, 12, 10, 8, 5, 3, 1, 2, 4, 7, 9, 11, 13, 15, 17, 6, 17 },
{ 15, 13, 11, 8, 6, 4, 2, 2, 2, 3, 5, 7, 10, 12, 14, 16, 9, 16 },
{ 14, 12, 11, 9, 8, 6, 3, 1, 2, 5, 7, 10, 13, 15, 16, 17, 4, 17 },
{ 16, 14, 12, 9, 7, 5, 2, 2, 2, 3, 4, 6, 8, 11, 13, 15, 10, 16 },
},
{
{ 13, 11, 10, 8, 7, 5, 2, 2, 2, 4, 6, 9, 12, 14, 15, 16, 3, 16 },
{ 11, 11, 10, 9, 8, 7, 5, 4, 3, 3, 3, 3, 3, 3, 4, 5, 6, 5 },
{ 9, 9, 7, 6, 5, 4, 3, 3, 2, 3, 4, 5, 4, 5, 5, 6, 8, 6 },
{ 13, 12, 10, 8, 5, 3, 3, 2, 2, 3, 4, 7, 9, 11, 14, 15, 6, 15 },
}
};
static const uint16_t imc_huffman_bits[4][4][18] = {
{
{ 0xCC32, 0x6618, 0x1987, 0x0660, 0x00CD, 0x0018, 0x0007, 0x0000, 0x0002, 0x000D, 0x0032, 0x0199, 0x0331, 0x0CC2, 0x330D, 0xCC33, 0x0067, 0x0000 },
{ 0x02FE, 0x00BE, 0x005E, 0x002D, 0x000A, 0x0009, 0x0003, 0x0003, 0x0000, 0x0002, 0x0008, 0x002C, 0x005D, 0x017E, 0x05FE, 0x05FF, 0x005C, 0x0000 },
{ 0x5169, 0x5168, 0x28B5, 0x0517, 0x00A3, 0x0029, 0x0008, 0x0003, 0x0000, 0x0009, 0x0015, 0x0050, 0x0144, 0x028A, 0x0A2C, 0x145B, 0x000B, 0x0000 },
{ 0x1231, 0x048D, 0x0247, 0x0090, 0x0025, 0x0008, 0x0001, 0x0003, 0x0000, 0x0005, 0x0013, 0x0049, 0x0122, 0x0919, 0x48C3, 0x48C2, 0x2460, 0x0000 },
},
{
{ 0x2D1D, 0x0B46, 0x02D0, 0x00B5, 0x0059, 0x000A, 0x0003, 0x0001, 0x0000, 0x0004, 0x0017, 0x005B, 0x0169, 0x05A2, 0x168F, 0x2D1C, 0x0058, 0x0000 },
{ 0x1800, 0x0C01, 0x0301, 0x0061, 0x0019, 0x0007, 0x0004, 0x0003, 0x0000, 0x0005, 0x000D, 0x0031, 0x00C1, 0x0181, 0x0601, 0x1801, 0x0002, 0x0000 },
{ 0x1556, 0x0AAA, 0x02AB, 0x0054, 0x0014, 0x000B, 0x0002, 0x0003, 0x0000, 0x0003, 0x0008, 0x002B, 0x00AB, 0x0154, 0x0554, 0x1557, 0x0009, 0x0000 },
{ 0x1556, 0x0AAA, 0x02AB, 0x0054, 0x0014, 0x000B, 0x0002, 0x0003, 0x0000, 0x0003, 0x0008, 0x002B, 0x00AB, 0x0154, 0x0554, 0x1557, 0x0009, 0x0000 },
},
{
{ 0x2993, 0x0A65, 0x0298, 0x00A7, 0x0028, 0x0004, 0x0000, 0x0001, 0x0001, 0x0003, 0x0015, 0x0052, 0x014D, 0x0533, 0x14C8, 0x5324, 0x000B, 0x5325 },
{ 0x09B8, 0x026F, 0x009A, 0x0012, 0x0005, 0x0000, 0x0001, 0x0002, 0x0003, 0x0001, 0x0003, 0x0008, 0x004C, 0x0136, 0x04DD, 0x1373, 0x0027, 0x1372 },
{ 0x0787, 0x01E0, 0x00F1, 0x003D, 0x001F, 0x0006, 0x0001, 0x0001, 0x0001, 0x0002, 0x000E, 0x0079, 0x03C2, 0x0F0D, 0x1E19, 0x3C30, 0x0000, 0x3C31 },
{ 0x4B06, 0x12C0, 0x04B1, 0x0097, 0x0024, 0x0008, 0x0002, 0x0003, 0x0000, 0x0003, 0x0005, 0x0013, 0x004A, 0x0259, 0x0961, 0x2582, 0x012D, 0x4B07 },
},
{
{ 0x0A5A, 0x0297, 0x014A, 0x0053, 0x0028, 0x000B, 0x0003, 0x0000, 0x0002, 0x0004, 0x0015, 0x00A4, 0x052C, 0x14B7, 0x296C, 0x52DB, 0x0003, 0x52DA },
{ 0x0193, 0x0192, 0x00C8, 0x0065, 0x0033, 0x0018, 0x0007, 0x0004, 0x0000, 0x0004, 0x0005, 0x0007, 0x0006, 0x0003, 0x0005, 0x0005, 0x000D, 0x0004 },
{ 0x0012, 0x0013, 0x0005, 0x0003, 0x0000, 0x0003, 0x0005, 0x0004, 0x0003, 0x0003, 0x0005, 0x0005, 0x0004, 0x0004, 0x0003, 0x0005, 0x0008, 0x0004 },
{ 0x0D66, 0x06B2, 0x01AD, 0x006A, 0x000C, 0x0005, 0x0004, 0x0000, 0x0003, 0x0002, 0x0007, 0x0034, 0x00D7, 0x0358, 0x1ACF, 0x359C, 0x001B, 0x359D },
}
};
#endif /* AVCODEC_IMCDATA_H */
| {
"pile_set_name": "Github"
} |
const isReply = tweet => {
const RT = /^RT/i
if (
RT.test(tweet.text) ||
tweet.is_quote_status ||
tweet.retweeted_status ||
tweet.in_reply_to_status_id ||
tweet.in_reply_to_status_id_str ||
tweet.in_reply_to_user_id ||
tweet.in_reply_to_user_id_str ||
tweet.in_reply_to_screen_name
)
return true
}
module.exports = isReply
| {
"pile_set_name": "Github"
} |
store:
memory:
limit: 1000
packages:
'@useoptic/*':
access: $all
publish: $all
proxy: npmjs
'*/*':
access: $all
proxy: npmjs
'**':
access: $all
proxy: npmjs
uplinks:
npmjs:
url: https://registry.npmjs.org/
logs:
- {type: stdout, format: pretty, level: trace} | {
"pile_set_name": "Github"
} |
/**
*
* APDPlat - Application Product Development Platform
* Copyright (c) 2013, 杨尚川, [email protected]
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.apdplat.platform.model.handler;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Date;
import java.util.Locale;
import javax.annotation.PostConstruct;
import org.apdplat.module.log.model.OperateLog;
import org.apdplat.module.log.model.OperateLogType;
import org.apdplat.module.security.model.User;
import org.apdplat.module.security.service.UserHolder;
import org.apdplat.module.system.service.PropertyHolder;
import org.apdplat.module.system.service.SystemListener;
import org.apdplat.platform.annotation.IgnoreBusinessLog;
import org.apdplat.platform.log.APDPlatLogger;
import org.apdplat.platform.log.APDPlatLoggerFactory;
import org.apdplat.platform.log.BufferLogCollector;
import org.apdplat.platform.model.Model;
import org.apdplat.platform.model.ModelListener;
import org.springframework.stereotype.Service;
/**
* 记录业务操作日志模型事件处理器
* @author 杨尚川
*/
@Service
public class OperateLogModelHandler extends ModelHandler{
private static final APDPlatLogger LOG = APDPlatLoggerFactory.getAPDPlatLogger(OperateLogModelHandler.class);
private static final boolean CREATE;
private static final boolean DELETE;
private static final boolean UPDATE;
static{
CREATE=PropertyHolder.getBooleanProperty("log.create");
DELETE=PropertyHolder.getBooleanProperty("log.delete");
UPDATE=PropertyHolder.getBooleanProperty("log.update");
if(CREATE){
LOG.info("启用添加数据日志");
LOG.info("Enable create data log", Locale.ENGLISH);
}else{
LOG.info("禁用添加数据日志");
LOG.info("Disable create data log", Locale.ENGLISH);
}
if(DELETE){
LOG.info("启用删除数据日志");
LOG.info("Enable delete data log", Locale.ENGLISH);
}else{
LOG.info("禁用删除数据日志");
LOG.info("Disable delete data log", Locale.ENGLISH);
}
if(UPDATE){
LOG.info("启用更新数据日志");
LOG.info("Enable update data log", Locale.ENGLISH);
}else{
LOG.info("禁用更新数据日志");
LOG.info("Disable update data log", Locale.ENGLISH);
}
}
/**
* 注册模型处理器
*/
@PostConstruct
public void init(){
ModelListener.addModelHandler(this);
}
@Override
public void postPersist(Model model) {
if(CREATE){
saveLog(model,OperateLogType.ADD);
LOG.debug("记录模型创建日志: "+model);
}
}
@Override
public void postRemove(Model model) {
if(DELETE){
saveLog(model,OperateLogType.DELETE);
LOG.debug("记录模型删除日志: "+model);
}
}
@Override
public void postUpdate(Model model) {
if(UPDATE){
saveLog(model,OperateLogType.UPDATE);
LOG.debug("记录模型修改日志: "+model);
}
}
/**
* 将日志加入BufferLogCollector定义的内存缓冲区
* @param model
* @param type
*/
private void saveLog(Model model, String type){
//判断模型是否已经指定忽略记录增删改日志
if(!model.getClass().isAnnotationPresent(IgnoreBusinessLog.class)){
User user=UserHolder.getCurrentLoginUser();
String ip=UserHolder.getCurrentUserLoginIp();
OperateLog operateLog=new OperateLog();
if(user != null){
operateLog.setUsername(user.getUsername());
}
operateLog.setLoginIP(ip);
try {
operateLog.setServerIP(InetAddress.getLocalHost().getHostAddress());
} catch (UnknownHostException ex) {
LOG.error("无法获取服务器IP", ex);
}
operateLog.setAppName(SystemListener.getContextPath());
operateLog.setOperatingTime(new Date());
operateLog.setOperatingType(type);
operateLog.setOperatingModel(model.getMetaData());
operateLog.setOperatingID(model.getId());
//将日志加入内存缓冲区
BufferLogCollector.collect(operateLog);
}
}
}
| {
"pile_set_name": "Github"
} |
/* eslint-disable */
require('eventsource-polyfill')
var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
hotClient.subscribe(function (event) {
if (event.action === 'reload') {
window.location.reload()
}
})
| {
"pile_set_name": "Github"
} |
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002-2005 Masao Mutoh
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
#include "rbgtk3private.h"
#define RG_TARGET_NAMESPACE cTreeView
#define _SELF(s) (RVAL2GTKTREEVIEW(s))
static VALUE rb_mGtk;
static ID id_model;
static ID id_selection;
static VALUE
rg_initialize(int argc, VALUE *argv, VALUE self)
{
VALUE model;
GtkWidget *widget;
if (rb_scan_args(argc, argv, "01", &model) == 1) {
G_CHILD_SET(self, id_model, model);
widget = gtk_tree_view_new_with_model(RVAL2GTKTREEMODEL(model));
}
else {
widget = gtk_tree_view_new();
}
RBGTK_INITIALIZE(self, widget);
return Qnil;
}
static VALUE
rg_selection(VALUE self)
{
VALUE ret = GOBJ2RVAL(gtk_tree_view_get_selection(_SELF(self)));
G_CHILD_SET(self, id_selection, ret);
return ret;
}
static VALUE
rg_columns_autosize(VALUE self)
{
gtk_tree_view_columns_autosize(_SELF(self));
return self;
}
static VALUE
rg_append_column(VALUE self, VALUE column)
{
G_CHILD_ADD(self, column);
return INT2NUM(gtk_tree_view_append_column(_SELF(self),
RVAL2GTKTREEVIEWCOLUMN(column)));
}
static VALUE
rg_remove_column(VALUE self, VALUE column)
{
G_CHILD_REMOVE(self, column);
return INT2NUM(gtk_tree_view_remove_column(_SELF(self),
RVAL2GTKTREEVIEWCOLUMN(column)));
}
static void
cell_data_func(GtkTreeViewColumn *column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer func)
{
iter->user_data3 = model;
rb_funcall((VALUE)func, id_call, 4, GOBJ2RVAL(column),
GOBJ2RVAL(cell), GOBJ2RVAL(model),
GTKTREEITER2RVAL(iter));
}
static VALUE
rg_insert_column(int argc, VALUE *argv, VALUE self)
{
VALUE args[4];
rb_scan_args(argc, argv, "22", /* NORMAL ATTRIBUTES DATA_FUNC */
&args[0], /* column position position */
&args[1], /* position title title */
&args[2], /* renderer renderer */
&args[3]); /* attributes */
if (argc == 2) {
G_CHILD_ADD(self, args[0]);
return INT2NUM(gtk_tree_view_insert_column(_SELF(self),
RVAL2GTKTREEVIEWCOLUMN(args[0]),
NUM2INT(args[1])));
} else if (argc == 3) {
int ret;
VALUE func = rb_block_proc();
G_RELATIVE(self, argv[2]);
G_RELATIVE(self, func);
ret = gtk_tree_view_insert_column_with_data_func(_SELF(self),
NUM2INT(args[0]),
RVAL2CSTR(args[1]),
RVAL2GTKCELLRENDERER(args[2]),
(GtkTreeCellDataFunc)cell_data_func,
(gpointer)func,
NULL);
return INT2NUM(ret);
} else if (argc == 4) {
int i;
int col;
int ret;
const gchar *name;
VALUE ary;
GtkCellRenderer* renderer = RVAL2GTKCELLRENDERER(args[2]);
GtkTreeViewColumn* column = gtk_tree_view_column_new();
Check_Type(args[3], T_HASH);
/* TODO: Should this really be done before we know that everything
* below worked without error? */
G_CHILD_ADD(self, args[2]);
G_CHILD_ADD(self, args[3]);
gtk_tree_view_column_set_title(column, RVAL2CSTR(args[1]));
gtk_tree_view_column_pack_start(column, renderer, TRUE);
ret = gtk_tree_view_insert_column(_SELF(self), column, NUM2INT(args[0]));
ary = rb_funcall(args[3], rb_intern("to_a"), 0);
for (i = 0; i < RARRAY_LEN(ary); i++) {
VALUE val = RARRAY_PTR(RARRAY_PTR(ary)[i])[0];
if (SYMBOL_P(val)) {
name = rb_id2name(SYM2ID(val));
} else {
name = RVAL2CSTR(val);
}
col = NUM2INT(RARRAY_PTR(RARRAY_PTR(ary)[i])[1]);
gtk_tree_view_column_add_attribute(column,
renderer,
name, col);
}
return INT2NUM(ret);
} else {
rb_raise(rb_eArgError, "Wrong number of arguments: %d", argc);
}
return Qnil;
}
static VALUE
rg_get_column(VALUE self, VALUE num)
{
return GOBJ2RVAL(gtk_tree_view_get_column(_SELF(self), NUM2INT(num)));
}
static VALUE
rg_columns(VALUE self)
{
return GOBJGLIST2RVAL_FREE(gtk_tree_view_get_columns(_SELF(self)),
g_list_free, NULL);
}
static VALUE
rg_move_column_after(VALUE self, VALUE column, VALUE base_column)
{
gtk_tree_view_move_column_after(_SELF(self), RVAL2GTKTREEVIEWCOLUMN(column),
NIL_P(base_column) ? NULL : RVAL2GTKTREEVIEWCOLUMN(base_column));
return self;
}
static gboolean
column_drop_func(GtkTreeView *treeview, GtkTreeViewColumn *column, GtkTreeViewColumn *prev_column, GtkTreeViewColumn *next_column, gpointer func)
{
return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 4, GOBJ2RVAL(treeview),
GOBJ2RVAL(column), GOBJ2RVAL(prev_column),
GOBJ2RVAL(next_column)));
}
static VALUE
rg_set_column_drag_function(VALUE self)
{
VALUE func = rb_block_proc();
G_RELATIVE(self, func);
gtk_tree_view_set_column_drag_function(_SELF(self),
(GtkTreeViewColumnDropFunc)column_drop_func,
(gpointer)func, NULL);
return self;
}
static VALUE
rg_scroll_to_point(VALUE self, VALUE x, VALUE y)
{
gtk_tree_view_scroll_to_point(_SELF(self), NUM2INT(x), NUM2INT(y));
return self;
}
static VALUE
rg_scroll_to_cell(VALUE self, VALUE path, VALUE column, VALUE use_align, VALUE row_align, VALUE col_align)
{
gtk_tree_view_scroll_to_cell(_SELF(self),
NIL_P(path) ? NULL : RVAL2GTKTREEPATH(path),
NIL_P(column) ? NULL : RVAL2GTKTREEVIEWCOLUMN(column),
RVAL2CBOOL(use_align),
NUM2DBL(row_align), NUM2DBL(col_align));
return self;
}
static VALUE
rg_set_cursor(VALUE self, VALUE path, VALUE focus_column, VALUE start_editing)
{
gtk_tree_view_set_cursor(_SELF(self), RVAL2GTKTREEPATH(path),
NIL_P(focus_column) ? NULL : RVAL2GTKTREEVIEWCOLUMN(focus_column),
RVAL2CBOOL(start_editing));
return self;
}
static VALUE
rg_cursor(VALUE self)
{
GtkTreePath* path;
GtkTreeViewColumn* focus_column;
gtk_tree_view_get_cursor(_SELF(self), &path, &focus_column);
return rb_ary_new3(2, path ? GTKTREEPATH2RVAL(path) : Qnil,
GOBJ2RVAL(focus_column));
}
static VALUE
rg_expand_all(VALUE self)
{
gtk_tree_view_expand_all(_SELF(self));
return self;
}
static VALUE
rg_collapse_all(VALUE self)
{
gtk_tree_view_collapse_all(_SELF(self));
return self;
}
static VALUE
rg_expand_row(VALUE self, VALUE path, VALUE open_all)
{
return CBOOL2RVAL(gtk_tree_view_expand_row(_SELF(self),
RVAL2GTKTREEPATH(path),
RVAL2CBOOL(open_all)));
}
static VALUE
rg_expand_to_path(VALUE self, VALUE path)
{
gtk_tree_view_expand_to_path(_SELF(self), RVAL2GTKTREEPATH(path));
return self;
}
static VALUE
rg_collapse_row(VALUE self, VALUE path)
{
return CBOOL2RVAL(gtk_tree_view_collapse_row(_SELF(self),
RVAL2GTKTREEPATH(path)));
}
static void
mapping_func(GtkTreeView *treeview, GtkTreePath *path, gpointer func)
{
rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(treeview),
GTKTREEPATH2RVAL(path));
}
static VALUE
rg_map_expanded_rows(VALUE self)
{
VALUE func = rb_block_proc();
G_RELATIVE(self, func);
gtk_tree_view_map_expanded_rows(_SELF(self),
(GtkTreeViewMappingFunc)mapping_func,
(gpointer)func);
return self;
}
static VALUE
rg_row_expanded_p(VALUE self, VALUE path)
{
return CBOOL2RVAL(gtk_tree_view_row_expanded(_SELF(self),
RVAL2GTKTREEPATH(path)));
}
static VALUE
rg_get_path_at_pos(VALUE self, VALUE x, VALUE y)
{
GtkTreePath* path;
GtkTreeViewColumn* column;
gint cell_x, cell_y;
gboolean ret;
ret = gtk_tree_view_get_path_at_pos(_SELF(self),
NUM2INT(x), NUM2INT(y),
&path, &column, &cell_x, &cell_y);
return ret ? rb_ary_new3(4,
path ? GTKTREEPATH2RVAL(path) : Qnil,
column ? GOBJ2RVAL(column) : Qnil,
INT2NUM(cell_x), INT2NUM(cell_y)) : Qnil;
}
static VALUE
rg_get_cell_area(VALUE self, VALUE path, VALUE column)
{
GdkRectangle rect;
gtk_tree_view_get_cell_area(_SELF(self),
NIL_P(path) ? NULL : RVAL2GTKTREEPATH(path),
NIL_P(column) ? NULL : RVAL2GTKTREEVIEWCOLUMN(column),
&rect);
return GDKRECTANGLE2RVAL(&rect);
}
static VALUE
rg_get_background_area(VALUE self, VALUE path, VALUE column)
{
GdkRectangle rect;
gtk_tree_view_get_background_area(_SELF(self),
NIL_P(path) ? NULL : RVAL2GTKTREEPATH(path),
NIL_P(column) ? NULL : RVAL2GTKTREEVIEWCOLUMN(column),
&rect);
return GDKRECTANGLE2RVAL(&rect);
}
static VALUE
rg_visible_rect(VALUE self)
{
GdkRectangle rect;
gtk_tree_view_get_visible_rect(_SELF(self), &rect);
return GDKRECTANGLE2RVAL(&rect);
}
static VALUE
rg_visible_range(VALUE self)
{
GtkTreePath* start_path;
GtkTreePath* end_path;
gboolean valid_paths = gtk_tree_view_get_visible_range(_SELF(self), &start_path, &end_path);
return valid_paths ? rb_assoc_new(GTKTREEPATH2RVAL(start_path),
GTKTREEPATH2RVAL(end_path)) : Qnil;
}
static VALUE
rg_bin_window(VALUE self)
{
return GOBJ2RVAL(gtk_tree_view_get_bin_window(_SELF(self)));
}
static VALUE
rg_convert_bin_window_to_tree_coords(VALUE self, VALUE bx, VALUE by)
{
gint tx, ty;
gtk_tree_view_convert_bin_window_to_tree_coords(_SELF(self),
NUM2INT(bx), NUM2INT(by),
&tx, &ty);
return rb_ary_new3(2, INT2NUM(tx), INT2NUM(ty));
}
static VALUE
rg_convert_bin_window_to_widget_coords(VALUE self, VALUE bx, VALUE by)
{
gint wx, wy;
gtk_tree_view_convert_bin_window_to_widget_coords(_SELF(self),
NUM2INT(bx), NUM2INT(by),
&wx, &wy);
return rb_ary_new3(2, INT2NUM(wx), INT2NUM(wy));
}
static VALUE
rg_convert_tree_to_bin_window_coords(VALUE self, VALUE tx, VALUE ty)
{
gint bx, by;
gtk_tree_view_convert_tree_to_bin_window_coords(_SELF(self),
NUM2INT(tx), NUM2INT(ty),
&bx, &by);
return rb_ary_new3(2, INT2NUM(bx), INT2NUM(by));
}
static VALUE
rg_convert_tree_to_widget_coords(VALUE self, VALUE tx, VALUE ty)
{
gint wx, wy;
gtk_tree_view_convert_tree_to_widget_coords(_SELF(self),
NUM2INT(tx), NUM2INT(ty),
&wx, &wy);
return rb_ary_new3(2, INT2NUM(wx), INT2NUM(wy));
}
static VALUE
rg_convert_widget_to_bin_window_coords(VALUE self, VALUE wx, VALUE wy)
{
gint bx, by;
gtk_tree_view_convert_widget_to_bin_window_coords(_SELF(self),
NUM2INT(wx), NUM2INT(wy),
&bx, &by);
return rb_ary_new3(2, INT2NUM(bx), INT2NUM(by));
}
static VALUE
rg_convert_widget_to_tree_coords(VALUE self, VALUE wx, VALUE wy)
{
gint tx, ty;
gtk_tree_view_convert_widget_to_tree_coords(_SELF(self),
NUM2INT(wx), NUM2INT(wy),
&tx, &ty);
return rb_ary_new3(2, INT2NUM(tx), INT2NUM(ty));
}
static VALUE
rg_enable_model_drag_dest(VALUE self, VALUE rbtargets, VALUE rbactions)
{
GtkTreeView *view = _SELF(self);
GdkDragAction actions = RVAL2GDKDRAGACTION(rbactions);
long n;
GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(rbtargets, &n);
gtk_tree_view_enable_model_drag_dest(view, targets, n, actions);
g_free(targets);
return self;
}
static VALUE
rg_enable_model_drag_source(VALUE self, VALUE rbstart_button_mask, VALUE rbtargets, VALUE rbactions)
{
GtkTreeView *view = _SELF(self);
GdkModifierType start_button_mask = RVAL2GDKMODIFIERTYPE(rbstart_button_mask);
GdkDragAction actions = RVAL2GDKDRAGACTION(rbactions);
long n;
GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES_ACCEPT_NIL(rbtargets, &n);
if (targets == NULL)
return self;
gtk_tree_view_enable_model_drag_source(view, start_button_mask, targets, n, actions);
g_free(targets);
return self;
}
static VALUE
rg_unset_rows_drag_source(VALUE self)
{
gtk_tree_view_unset_rows_drag_source(_SELF(self));
return self;
}
static VALUE
rg_unset_rows_drag_dest(VALUE self)
{
gtk_tree_view_unset_rows_drag_dest(_SELF(self));
return self;
}
static VALUE
rg_set_drag_dest_row(VALUE self, VALUE path, VALUE pos)
{
gtk_tree_view_set_drag_dest_row(_SELF(self),
NIL_P(path)?NULL:RVAL2GTKTREEPATH(path),
RVAL2GTKTREEVIEWDROPPOSITION(pos));
return self;
}
static VALUE
rg_drag_dest_row(VALUE self)
{
GtkTreePath* path = NULL;
GtkTreeViewDropPosition pos;
gtk_tree_view_get_drag_dest_row(_SELF(self), &path, &pos);
return rb_ary_new3(2, path ? GTKTREEPATH2RVAL(path) : Qnil,
GTKTREEVIEWDROPPOSITION2RVAL(pos));
}
static VALUE
rg_get_dest_row_at_pos(VALUE self, VALUE drag_x, VALUE drag_y)
{
GtkTreePath* path;
GtkTreeViewDropPosition pos;
gboolean ret;
ret = gtk_tree_view_get_dest_row_at_pos(_SELF(self),
NUM2INT(drag_x), NUM2INT(drag_y),
&path, &pos);
return ret ? rb_ary_new3(2, path ? GTKTREEPATH2RVAL(path) : Qnil,
GTKTREEVIEWDROPPOSITION2RVAL(pos)) : Qnil;
}
static VALUE
rg_create_row_drag_icon(VALUE self, VALUE path)
{
return GOBJ2RVAL(gtk_tree_view_create_row_drag_icon(_SELF(self),
RVAL2GTKTREEPATH(path)));
}
/*
We don't need this.
GtkTreeViewSearchEqualFunc gtk_tree_view_get_search_equal_func
(GtkTreeView *tree_view);
*/
static gboolean
search_equal_func(GtkTreeModel *model, gint column, const gchar *key, GtkTreeIter *iter, gpointer func)
{
iter->user_data3 = model;
return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 4,
GOBJ2RVAL(model), INT2NUM(column),
CSTR2RVAL(key), GTKTREEITER2RVAL(iter)));
}
static VALUE
rg_set_search_equal_func(VALUE self)
{
VALUE func = rb_block_proc();
G_RELATIVE(self, func);
gtk_tree_view_set_search_equal_func(_SELF(self),
(GtkTreeViewSearchEqualFunc)search_equal_func,
(gpointer)func, NULL);
return self;
}
/*
* Optional Signals
*/
static VALUE
treeview_signal_func(G_GNUC_UNUSED guint num, const GValue *values)
{
GtkTreeView* view = g_value_get_object(&values[0]);
GtkTreeIter* iter = g_value_get_boxed(&values[1]);
iter->user_data3 = gtk_tree_view_get_model(view);
return rb_ary_new3(3, GOBJ2RVAL(view), GTKTREEITER2RVAL(iter), GVAL2RVAL(&values[2]));
}
static VALUE
rg_set_cursor_on_cell(VALUE self, VALUE path, VALUE focus_column, VALUE focus_cell, VALUE start_editing)
{
gtk_tree_view_set_cursor_on_cell(_SELF(self), RVAL2GTKTREEPATH(path),
NIL_P(focus_column) ? NULL : RVAL2GTKTREEVIEWCOLUMN(focus_column),
NIL_P(focus_cell) ? NULL : RVAL2GTKCELLRENDERER(focus_cell),
RVAL2CBOOL(start_editing));
return self;
}
/* How can I implement this?
GtkTreeViewRowSeparatorFunc gtk_tree_view_get_row_separator_func
(GtkTreeView *tree_view);
*/
static gboolean
row_separator_func(GtkTreeModel *model, GtkTreeIter *iter, gpointer func)
{
VALUE ret;
iter->user_data3 = model;
ret = rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(model),
GTKTREEITER2RVAL(iter));
return CBOOL2RVAL(ret);
}
static VALUE
rg_set_row_separator_func(VALUE self)
{
VALUE func = rb_block_proc();
G_RELATIVE(self, func);
gtk_tree_view_set_row_separator_func(_SELF(self),
row_separator_func,
(gpointer)func,
(GDestroyNotify)NULL);
return self;
}
static VALUE
rg_search_entry(VALUE self)
{
return GOBJ2RVAL(gtk_tree_view_get_search_entry(_SELF(self)));
}
static VALUE
rg_set_search_entry(VALUE self, VALUE entry)
{
gtk_tree_view_set_search_entry(_SELF(self), RVAL2GTKENTRY(entry));
return self;
}
/* Can't define this.
GtkTreeViewSearchPositionFunc gtk_tree_view_get_search_position_func
(GtkTreeView *tree_view);
*/
struct callback_arg
{
VALUE callback;
VALUE tree_view;
VALUE search_dialog;
};
static VALUE
invoke_callback(VALUE data)
{
struct callback_arg *arg = (struct callback_arg *)data;
rb_funcall(arg->callback, id_call, 2, arg->tree_view, arg->search_dialog);
return Qnil;
}
static void
search_position_func(GtkTreeView *tree_view, GtkWidget *search_dialog, gpointer func)
{
struct callback_arg arg;
arg.callback = (VALUE)func;
arg.tree_view = GOBJ2RVAL(tree_view);
arg.search_dialog = GOBJ2RVAL(search_dialog);
G_PROTECT_CALLBACK(invoke_callback, &arg);
}
static void
remove_callback_reference(gpointer data)
{
G_CHILD_REMOVE(rb_mGtk, (VALUE)data);
}
static VALUE
rg_set_search_position_func(VALUE self)
{
VALUE func = rb_block_proc();
G_CHILD_ADD(rb_mGtk, func);
gtk_tree_view_set_search_position_func(_SELF(self),
(GtkTreeViewSearchPositionFunc)search_position_func,
(gpointer)func,
(GDestroyNotify)remove_callback_reference);
return self;
}
void
Init_gtk_treeview(VALUE mGtk)
{
rb_mGtk = mGtk;
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TREE_VIEW, "TreeView", mGtk);
id_selection = rb_intern("selection");
id_model = rb_intern("model");
RG_DEF_METHOD(initialize, -1);
RG_DEF_METHOD(selection, 0);
RG_DEF_METHOD(columns_autosize, 0);
RG_DEF_METHOD(append_column, 1);
RG_DEF_METHOD(remove_column, 1);
RG_DEF_METHOD(insert_column, -1);
RG_DEF_METHOD(get_column, 1);
RG_DEF_METHOD(columns, 0);
RG_DEF_METHOD(move_column_after, 2);
RG_DEF_METHOD(set_column_drag_function, 0);
RG_DEF_METHOD(scroll_to_point, 2);
RG_DEF_METHOD(scroll_to_cell, 5);
RG_DEF_METHOD(set_cursor, 3);
RG_DEF_METHOD(cursor, 0);
RG_DEF_METHOD(expand_all, 0);
RG_DEF_METHOD(collapse_all, 0);
RG_DEF_METHOD(expand_row, 2);
RG_DEF_METHOD(collapse_row, 1);
RG_DEF_METHOD(expand_to_path, 1);
RG_DEF_METHOD(map_expanded_rows, 0);
RG_DEF_METHOD_P(row_expanded, 1);
RG_DEF_METHOD(get_path_at_pos, 2);
RG_DEF_ALIAS("get_path", "get_path_at_pos");
RG_DEF_METHOD(get_cell_area, 2);
RG_DEF_METHOD(get_background_area, 2);
RG_DEF_METHOD(visible_rect, 0);
RG_DEF_METHOD(visible_range, 0);
RG_DEF_METHOD(bin_window, 0);
RG_DEF_METHOD(convert_bin_window_to_tree_coords, 2);
RG_DEF_METHOD(convert_bin_window_to_widget_coords, 2);
RG_DEF_METHOD(convert_tree_to_bin_window_coords, 2);
RG_DEF_METHOD(convert_tree_to_widget_coords, 2);
RG_DEF_METHOD(convert_widget_to_bin_window_coords, 2);
RG_DEF_METHOD(convert_widget_to_tree_coords, 2);
RG_DEF_METHOD(enable_model_drag_dest, 2);
RG_DEF_METHOD(enable_model_drag_source, 3);
RG_DEF_METHOD(unset_rows_drag_source, 0);
RG_DEF_METHOD(unset_rows_drag_dest, 0);
RG_DEF_METHOD(set_drag_dest_row, 2);
RG_DEF_METHOD(drag_dest_row, 0);
RG_DEF_METHOD(get_dest_row_at_pos, 2);
RG_DEF_ALIAS("get_dest_row", "get_dest_row_at_pos");
RG_DEF_METHOD(create_row_drag_icon, 1);
RG_DEF_METHOD(set_search_equal_func, 0);
RG_DEF_METHOD(set_cursor_on_cell, 4);
RG_DEF_METHOD(set_row_separator_func, 0);
RG_DEF_METHOD(search_entry, 0);
RG_DEF_METHOD(set_search_entry, 1);
RG_DEF_METHOD(set_search_position_func, 0);
G_DEF_CLASS(GTK_TYPE_TREE_VIEW_DROP_POSITION, "DropPosition", RG_TARGET_NAMESPACE);
G_DEF_CLASS(GTK_TYPE_TREE_VIEW_GRID_LINES, "GridLines", RG_TARGET_NAMESPACE);
/* Option Signals */
G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "row-collapsed", (GValToRValSignalFunc)treeview_signal_func);
G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "row-expanded", (GValToRValSignalFunc)treeview_signal_func);
G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "test-collapse-row", (GValToRValSignalFunc)treeview_signal_func);
G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "test-expand-row", (GValToRValSignalFunc)treeview_signal_func);
}
| {
"pile_set_name": "Github"
} |
# WeBWorK problem written by Carl Yao
# Portland Community College
#
# Sketch the graph of a piecewise function, and find domain and range.
#
# Last update: Carl Yao 09/07/2018
#
# ENDDESCRIPTION
## DBsubject('Algebra')
## DBchapter('Function')
## DBsection('Domain and Range')
## KEYWORDS('function','domain','range','graph')
## DBCCSS('8.F','F-IF')
## TitleText1('')
## EditionText1('')
## AuthorText1('')
## Section1('')
## Problem1('')
## Author('Alex Jordan, Carl Yao, Chris Hughes')
## Institution('PCC')
##############################################
DOCUMENT();
loadMacros(
"PGgraphmacros.pl",
"PGstandard.pl",
"MathObjects.pl",
"PGML.pl",
"PCCgraphMacros.pl",
"PCCmacros.pl",
"PGcourse.pl",
);
##############################################
TEXT(beginproblem());
Context("Numeric");
Context()->noreduce('(-x)-y','(-x)+y');
do {
$m1 = random(-2,2,0.5);
$b1 = random(-3,3,1);
$func1 = Compute("$m1*x+$b1")->reduce;
$x1 = random(-7,-4,1);
$y1 = $func1->eval(x=>$x1);
$x2 = random(-3,-1,1);
$y2 = $func1->eval(x=>$x2);
} until $y1 != $y2;
do {
$m2 = random(-2,2,0.5);
$b2 = random(-3,3,1);
$func2 = Compute("$m2*x+$b2")->reduce;
$x4 = random(1,3,1);
$y4 = $func2->eval(x=>$x4);
$x5 = random(4,7,1);
$y5 = $func2->eval(x=>$x5);
} until $y4 != $y5;
$x3 = random(0,1,1) ? $x2 : $x4;
if (random(0,1,1) == 0) {
$y3 = random(min($y1,$y2)+0.1,max($y1,$y2)-0.1,0.1);
} else {
$y3 = random(min($y4,$y5)+0.1,max($y4,$y5)-0.1,0.1);
}
$x1orc = random(0,1,1) ? "(" : "[";
$x2orc = $x3 == $x2 ? "]" : ")";
$x4orc = $x3 == $x4 ? "[" : "(";
$x5orc = random(0,1,1) ? ")" : "]";
Context("Interval");
$domain1 = Compute("$x1orc $x1,$x2 $x2orc");
if ($m1 > 0) {
$y1orc = $x1orc eq "(" ? "(" : "[";
$y2orc = ")";
$range1 = Compute("$y1orc $y1,$y2 $y2orc");
} else {
$y2orc = "(";
$y1orc = $x1orc eq "(" ? ")" : "]";
$range1 = Compute("$y2orc $y2,$y1 $y1orc");
}
$domain2 = Compute("$x4orc $x4,$x5 $x5orc");
if ($m2 > 0) {
$y4orc = "(";
$y5orc = $x5orc eq ")" ? ")" : "]";
$range2 = Compute("$y4orc $y4,$y5 $y5orc");
} else {
$y5orc = $x5orc eq ")" ? "(" : "[";
$y4orc = ")";
$range2 = Compute("$y5orc $y5,$y4 $y4orc");
}
$domain = $domain1 + $domain2;
$range = Union($range1,$range2);
$x6 = random($x1+0.5,$x2-0.5,0.5);
$y6 = $func1->eval(x=>$x6);
$x7 = random($x4+0.5,$x5-0.5,0.5);
$y7 = $func2->eval(x=>$x7);
($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$x1,$x5],[$y1,$y2,$y4,$y5,0]);
@xticks = @$xticks_ref;
@yticks = @$yticks_ref;
for my $i (0..0) {
$gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1],
axes=>[0,0],
grid=>[$ticknum[0],$ticknum[1]],
size=>[xPixels(),yPixels()]
);
$gr[$i]->lb('reset');
for my $j (@xticks) {
if (abs($j)<10**(-10)) {next;}
$gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top'));
}
for my $j (@yticks) {
if (abs($j)<10**(-10)) {next;}
$gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle'));
}
add_functions($gr[$i], "$func1 for x in $x1orc $x1,$x2) using color:blue and weight:1");
add_functions($gr[$i], "$func2 for x in ($x4,$x5 $x5orc using color:blue and weight:1");
$gr[$i]->stamps( closed_circle($x3,$y3,'blue') );
}
$ALT = "This is the graph of a piecewise function. The left piece if part of a line with the domain $x1orc $x1,$x2). There is a dot on the function at ($x3,$y3). The right piece is part of a line with the domain $x4orc $x4,$x5 $x5orc.";
$x1s = $x1orc eq '(' ? '\lt' : '\le';
$x5s = $x5orc eq ')' ? '\lt' : '\le';
##############################################
BEGIN_PGML
A piecewise function's equation is given:
[``
f(x)=
\begin{cases}
[$func1] &\text{if }[$x1] [$x1s] x \lt [$x2] \\
[$y3] &\text{if }x=[$x3] \\
[$func2] &\text{if }[$x4]\lt x [$x5s] [$x5] \\
\end{cases}
``]
Sketch the function's graph on scratch paper, and then answer the following questions.
###Question 1
[`f([$x6])=`] [______________]{$y6}
[`f([$x3])=`] [______________]{$y3}
[`f([$x7])=`] [______________]{$y7}
###Question 2
* Use *inf* to represent [`\infty`].
* Use upper case U to represent "union" in set notation.
The function's domain is [_______________]{$domain}.
The function's range is [______________]{$range}.
END_PGML
##############################################
if ($m1 == 1) {
$s1 = "$x6";
} elsif ($m1 == -1) {
$s1 = "-($x6)";
} else {
$s1 = "$m1($x6)";
}
if ($b1 == 0) {
$s2 = "";
} elsif ($b1 < 0) {
$s2 = "$b1";
} else {
$s2 = "+$b1";
}
if ($m2 == 1) {
$s3 = "$x7";
} elsif ($m2 == -1) {
$s3 = "-($x7)";
} else {
$s3 = "$m2($x7)";
}
if ($b2 == 0) {
$s4 = "";
} elsif ($b2 < 0) {
$s4 = "$b2";
} else {
$s4 = "+$b2";
}
BEGIN_PGML_SOLUTION
[@EnlargeImageStatementPGML()@]**
>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<<
###Question 1
Since [`[$x1] [$x1s] [$x6] \lt [$x2]`], we use [`f(x)=[$func1]`] to calculate [`f([$x6])`]:
[`` f([$x6]) = [$s1][$s2] = [$y6] ``]
Since [`f(x)=[$y3]`] when [`x=[$x3]`], [`f([$x3])=[$y3]`].
Since [`x\lt[$x7]`], we use [`f(x)=[$func2]`] to calculate [`f([$x7])`]:
[`` f([$x7]) = [$s3][$s4] = [$y7] ``]
###Question 2
The segment on the left side starts at [`x=[$x1]`], and we can calculate the corresponding [`y`]-value by [`f([$x1])=[$y1]`]. It ends at [`([$x2],[$y2])`].
Similarly, the segment on the right side starts at [`x=[$x4]`], and we can calculate the corresponding [`y`]-value by [`f([$x4])=[$y4]`]. It ends at [`([$x5],[$y5])`].
By the graph, the function's domain is [`[$domain]`], and its range is [`[$range]`].
END_PGML_SOLUTION
ENDDOCUMENT();
| {
"pile_set_name": "Github"
} |
<patch-1.0>
<obj type="cbp" sha="589b835807a3b8c8b05793bc4bd9adaf853f9705" name="detune" x="500" y="0">
<params>
<frac32.s.map name="value" onParent="true" value="0.0"/>
</params>
<attribs/>
</obj>
<obj type="cbp" sha="589b835807a3b8c8b05793bc4bd9adaf853f9705" name="detunerange" x="600" y="0">
<params>
<frac32.s.map name="value" onParent="true" value="0.0"/>
</params>
<attribs/>
</obj>
<obj type="randtrig" sha="7c693e3fcb8abe7dc3908628ef0eb911a4a19ce1" name="randtrig_1" x="20" y="80">
<params/>
<attribs/>
</obj>
<obj type="*c" sha="1ea155bb99343babad87e3ff0de80e6bf568e8da" name="lspread" x="100" y="80">
<params>
<frac32.u.map name="amp" onParent="true" value="7.5"/>
</params>
<attribs/>
</obj>
<obj type="envdlinmx" sha="a2e1da37932bdfc8056cd08cca74d2ebc6735f40" name="length" x="200" y="80">
<params>
<frac32.s.map name="d" onParent="true" value="-44.0"/>
</params>
<attribs/>
</obj>
<obj type="<c" sha="355de7092a37338e16e09397154948f860a9160c" name="<c_1" x="320" y="80">
<params>
<frac32.u.map name="c" value="0.04999971389770508"/>
</params>
<attribs/>
</obj>
<obj type="randtrig" sha="7c693e3fcb8abe7dc3908628ef0eb911a4a19ce1" name="randtrig_2" x="420" y="80">
<params/>
<attribs/>
</obj>
<obj type="*c" sha="1ea155bb99343babad87e3ff0de80e6bf568e8da" name="ospread" x="500" y="80">
<params>
<frac32.u.map name="amp" onParent="true" value="0.0"/>
</params>
<attribs/>
</obj>
<obj type="randtrig" sha="7c693e3fcb8abe7dc3908628ef0eb911a4a19ce1" name="randtrig_3" x="420" y="120">
<params/>
<attribs/>
</obj>
<obj type="*" sha="b031e26920f6cf5c1a53377ee6021573c4e3ac02" name="*_2" x="560" y="120">
<params/>
<attribs/>
</obj>
<obj type="+" sha="81c2c147faf13ae4c2d00419326d0b6aec478b27" name="+_1" x="620" y="120">
<params/>
<attribs/>
</obj>
<obj type="*" sha="b031e26920f6cf5c1a53377ee6021573c4e3ac02" name="*_3" x="700" y="120">
<params/>
<attribs/>
</obj>
<obj type="+" sha="81c2c147faf13ae4c2d00419326d0b6aec478b27" name="+_2" x="760" y="120">
<params/>
<attribs/>
</obj>
<obj type="interp~" sha="5a9175b8d44d830756d1599a86b4a6a49813a19b" name="interp~_2" x="860" y="120">
<params/>
<attribs/>
</obj>
<obj type="delread2~~" sha="22a07dcbe5007bc4095bed25946486e7c98caf23" name="delread2~~_1" x="920" y="120">
<params>
<frac32.u.map name="time" value="2.0"/>
</params>
<attribs>
<objref attributeName="delayname" obj="../d"/>
</attribs>
</obj>
<obj type="*" sha="d67b6c172dd96232df67e96baf19e3062e880e68" name="*_1" x="920" y="220">
<params/>
<attribs/>
</obj>
<obj type="window" sha="ff29ab0721db1b1238076400832e919d860fc38f" name="window_1" x="540" y="240">
<params/>
<attribs/>
</obj>
<obj type="interp~" sha="5a9175b8d44d830756d1599a86b4a6a49813a19b" name="interp~_1" x="600" y="240">
<params/>
<attribs/>
</obj>
<obj type="div8" sha="776c01564ea89f47347a594dcf67670e795e61f6" name="div8_1" x="980" y="240">
<params/>
<attribs/>
</obj>
<obj type="outlet~" sha="72226293648dde4dd4739bc1b8bc46a6bf660595" name="outlet~_1" x="1040" y="240">
<params/>
<attribs/>
</obj>
<nets>
<net>
<source name="length env"/>
<dest name="<c_1 in"/>
<dest name="window_1 phase"/>
<dest name="*_3 b"/>
</net>
<net>
<source name="<c_1 out"/>
<dest name="length trig"/>
<dest name="randtrig_1 trig"/>
<dest name="randtrig_2 trig"/>
<dest name="randtrig_3 trig"/>
</net>
<net>
<source name="randtrig_1 rand"/>
<dest name="lspread in"/>
</net>
<net>
<source name="lspread out"/>
<dest name="length dm"/>
</net>
<net>
<source name="randtrig_2 rand"/>
<dest name="ospread in"/>
</net>
<net>
<source name="delread2~~_1 out"/>
<dest name="*_1 a"/>
</net>
<net>
<source name="*_1 result"/>
<dest name="div8_1 in"/>
</net>
<net>
<source name="div8_1 out"/>
<dest name="outlet~_1 outlet"/>
</net>
<net>
<source name="window_1 win"/>
<dest name="interp~_1 i"/>
</net>
<net>
<source name="interp~_1 o"/>
<dest name="*_1 b"/>
</net>
<net>
<source name="detunerange out"/>
<dest name="*_2 a"/>
</net>
<net>
<source name="randtrig_3 rand"/>
<dest name="*_2 b"/>
</net>
<net>
<source name="*_2 result"/>
<dest name="+_1 in2"/>
</net>
<net>
<source name="detune out"/>
<dest name="+_1 in1"/>
</net>
<net>
<source name="interp~_2 o"/>
<dest name="delread2~~_1 timem"/>
</net>
<net>
<source name="+_1 out"/>
<dest name="*_3 a"/>
</net>
<net>
<source name="ospread out"/>
<dest name="+_2 in1"/>
</net>
<net>
<source name="*_3 result"/>
<dest name="+_2 in2"/>
</net>
<net>
<source name="+_2 out"/>
<dest name="interp~_2 i"/>
</net>
</nets>
<settings>
<subpatchmode>polyphonic</subpatchmode>
<MidiChannel>1</MidiChannel>
<NPresets>8</NPresets>
<NPresetEntries>32</NPresetEntries>
<NModulationSources>8</NModulationSources>
<NModulationTargetsPerSource>8</NModulationTargetsPerSource>
</settings>
<notes><![CDATA[]]></notes>
</patch-1.0> | {
"pile_set_name": "Github"
} |
# Logging level
log4j.rootLogger=INFO, stderr
# log to stderr
log4j.appender.stderr = org.apache.log4j.ConsoleAppender
log4j.appender.stderr.Target = System.err
log4j.appender.stderr.layout = org.apache.log4j.PatternLayout
log4j.appender.stderr.layout.ConversionPattern=%-5p - %d{yyyy-MM-dd HH:mm:ss.SSS}; %C; %m%n
# quiet down the ZK logging for cli tools
log4j.logger.org.apache.zookeeper=WARN
log4j.logger.org.apache.solr.common.cloud=WARN
| {
"pile_set_name": "Github"
} |
% omfi.ch: Primitives for extra level of infinity.
%
% This file is part of the Omega project, which
% is based on the web2c distribution of TeX.
%
% Copyright (c) 1994--2000 John Plaice and Yannis Haralambous
%
% This library is free software; you can redistribute it and/or
% modify it under the terms of the GNU Library General Public
% License as published by the Free Software Foundation; either
% version 2 of the License, or (at your option) any later version.
%
% This library is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
% Library General Public License for more details.
%
% You should have received a copy of the GNU Library General Public
% License along with this library; if not, write to the Free Software
% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
%
%---------------------------------------
@x [10] m.135 l.2878 - Omega fi order of infinity
specifies the order of infinity to which glue setting applies (|normal|,
|fil|, |fill|, or |filll|). The |subtype| field is not used.
@y
specifies the order of infinity to which glue setting applies (|normal|,
|sfi|, |fil|, |fill|, or |filll|). The |subtype| field is not used.
@z
%---------------------------------------
@x [10] m.150 l.3136 - Omega fi order of infinity
orders of infinity (|normal|, |fil|, |fill|, or |filll|)
@y
orders of infinity (|normal|, |sfi|, |fil|, |fill|, or |filll|)
@z
%---------------------------------------
@x [10] m.150 l.3145 - Omega fi order of infinity
@d fil=1 {first-order infinity}
@d fill=2 {second-order infinity}
@d filll=3 {third-order infinity}
@y
@d sfi=1 {first-order infinity}
@d fil=2 {second-order infinity}
@d fill=3 {third-order infinity}
@d filll=4 {fourth-order infinity}
@z
%---------------------------------------
@x [10] m.150 l.3150 - Omega fi order of infinity
@!glue_ord=normal..filll; {infinity to the 0, 1, 2, or 3 power}
@y
@!glue_ord=normal..filll; {infinity to the 0, 1, 2, 3, or 4 power}
@z
%---------------------------------------
@x [11] m.162 l.3296 - Omega fi order of infinity
@d fil_glue==zero_glue+glue_spec_size {\.{0pt plus 1fil minus 0pt}}
@y
@d sfi_glue==zero_glue+glue_spec_size {\.{0pt plus 1fi minus 0pt}}
@d fil_glue==sfi_glue+glue_spec_size {\.{0pt plus 1fil minus 0pt}}
@z
%---------------------------------------
@x [11] m.164 l.3296 - Omega fi order of infinity
stretch(fil_glue):=unity; stretch_order(fil_glue):=fil;@/
@y
stretch(sfi_glue):=unity; stretch_order(sfi_glue):=sfi;@/
stretch(fil_glue):=unity; stretch_order(fil_glue):=fil;@/
@z
%---------------------------------------
@x [12] m.177 l.3591 - Omega fi order of infinity
begin print("fil");
while order>fil do
@y
begin print("fi");
while order>sfi do
@z
%---------------------------------------
@x [26] m.454 l.8924 - Omega fi order of infinity
if scan_keyword("fil") then
@.fil@>
begin cur_order:=fil;
@y
if scan_keyword("fi") then
@.fil@>
begin cur_order:=sfi;
@z
%---------------------------------------
@x [33] m.650 l.12877 - Omega fi order of infinity
total_stretch[fil]:=0; total_shrink[fil]:=0;
@y
total_stretch[sfi]:=0; total_shrink[sfi]:=0;
total_stretch[fil]:=0; total_shrink[fil]:=0;
@z
%---------------------------------------
@x [33] m.659 l.12996 - Omega fi order of infinity
else if total_stretch[fil]<>0 then o:=fil
@y
else if total_stretch[fil]<>0 then o:=fil
else if total_stretch[sfi]<>0 then o:=sfi
@z
%---------------------------------------
@x [33] m.665 l.13061 - Omega fi order of infinity
else if total_shrink[fil]<>0 then o:=fil
@y
else if total_shrink[fil]<>0 then o:=fil
else if total_shrink[sfi]<>0 then o:=sfi
@z
%---------------------------------------
@x [38] m.822 l.16135 - Omega fi order of infinity
contains six scaled numbers, since it must record the net change in glue
stretchability with respect to all orders of infinity. The natural width
difference appears in |mem[q+1].sc|; the stretch differences in units of
pt, fil, fill, and filll appear in |mem[q+2..q+5].sc|; and the shrink difference
appears in |mem[q+6].sc|. The |subtype| field of a delta node is not used.
@d delta_node_size=7 {number of words in a delta node}
@y
contains seven scaled numbers, since it must record the net change in glue
stretchability with respect to all orders of infinity. The natural width
difference appears in |mem[q+1].sc|; the stretch differences in units of
pt, sfi, fil, fill, and filll appear in |mem[q+2..q+6].sc|; and the shrink
difference appears in |mem[q+7].sc|. The |subtype| field of a delta node
is not used.
@d delta_node_size=8 {number of words in a delta node}
@z
%---------------------------------------
@x [38] m.823 l.16144 - Omega fi order of infinity
@ As the algorithm runs, it maintains a set of six delta-like registers
for the length of the line following the first active breakpoint to the
current position in the given hlist. When it makes a pass through the
active list, it also maintains a similar set of six registers for the
@y
@ As the algorithm runs, it maintains a set of seven delta-like registers
for the length of the line following the first active breakpoint to the
current position in the given hlist. When it makes a pass through the
active list, it also maintains a similar set of seven registers for the
@z
%---------------------------------------
@x [38] m.823 l.16154 - Omega fi order of infinity
k:=1 to 6 do cur_active_width[k]:=cur_active_width[k]+mem[q+k].sc|};$$ and we
want to do this without the overhead of |for| loops. The |do_all_six|
macro makes such six-tuples convenient.
@d do_all_six(#)==#(1);#(2);#(3);#(4);#(5);#(6)
@<Glob...@>=
@!active_width:array[1..6] of scaled;
{distance from first active node to~|cur_p|}
@!cur_active_width:array[1..6] of scaled; {distance from current active node}
@!background:array[1..6] of scaled; {length of an ``empty'' line}
@!break_width:array[1..6] of scaled; {length being computed after current break}
@y
k:=1 to 7 do cur_active_width[k]:=cur_active_width[k]+mem[q+k].sc|};$$ and we
want to do this without the overhead of |for| loops. The |do_all_six|
macro makes such six-tuples convenient.
@d do_all_six(#)==#(1);#(2);#(3);#(4);#(5);#(6);#(7)
@<Glo...@>=
@!active_width:array[1..7] of scaled;
{distance from first active node to~|cur_p|}
@!cur_active_width:array[1..7] of scaled; {distance from current active node}
@!background:array[1..7] of scaled; {length of an ``empty'' line}
@!break_width:array[1..7] of scaled; {length being computed after current break}
@z
%---------------------------------------
@x [38] m.827 l.16242 - Omega fi order of infinity
background[2]:=0; background[3]:=0; background[4]:=0; background[5]:=0;@/
@y
background[2]:=0; background[3]:=0; background[4]:=0; background[5]:=0;@/
background[6]:=0;@/
@z
%---------------------------------------
@x [38] m.827 l.16260 - Omega fi order of infinity
background[6]:=shrink(q)+shrink(r);
@y
background[7]:=shrink(q)+shrink(r);
@z
%---------------------------------------
@x [38] m.838 l.16470 - Omega fi order of infinity
break_width[6]:=break_width[6]-shrink(v);
@y
break_width[7]:=break_width[7]-shrink(v);
@z
%---------------------------------------
@x [38] m.852 l.16713 - Omega fi order of infinity
subarray |cur_active_width[2..5]|, in units of points, fil, fill, and filll.
@y
subarray |cur_active_width[2..6]|, in units of points, sfi, fil, fill and filll.
@z
%---------------------------------------
@x [38] m.852 l.16722 - Omega fi order of infinity
if (cur_active_width[3]<>0)or(cur_active_width[4]<>0)or@|
(cur_active_width[5]<>0) then
@y
if (cur_active_width[3]<>0)or(cur_active_width[4]<>0)or@|
(cur_active_width[5]<>0)or(cur_active_width[6]<>0) then
@z
%---------------------------------------
@x [38] m.853 l.16738 - Omega fi order of infinity
we can shrink the line from |r| to |cur_p| by at most |cur_active_width[6]|.
@<Set the value of |b| to the badness for shrinking...@>=
begin if -shortfall>cur_active_width[6] then b:=inf_bad+1
else b:=badness(-shortfall,cur_active_width[6]);
@y
we can shrink the line from |r| to |cur_p| by at most |cur_active_width[7]|.
@<Set the value of |b| to the badness for shrinking...@>=
begin if -shortfall>cur_active_width[7] then b:=inf_bad+1
else b:=badness(-shortfall,cur_active_width[7]);
@z
%---------------------------------------
@x [39] m.868 l.17054 - Omega fi order of infinity
active_width[6]:=active_width[6]+shrink(q)
@y
active_width[7]:=active_width[7]+shrink(q)
@z
%---------------------------------------
@x [44] m.975 l.18932 - Omega fi order of infinity
if (active_height[3]<>0) or (active_height[4]<>0) or
(active_height[5]<>0) then b:=0
else b:=badness(h-cur_height,active_height[2])
else if cur_height-h>active_height[6] then b:=awful_bad
else b:=badness(cur_height-h,active_height[6])
@y
if (active_height[3]<>0) or (active_height[4]<>0) or
(active_height[5]<>0) or (active_height[6]<>0) then b:=0
else b:=badness(h-cur_height,active_height[2])
else if cur_height-h>active_height[7] then b:=awful_bad
else b:=badness(cur_height-h,active_height[7])
@z
%---------------------------------------
@x [44] m.976 l.18947 - Omega fi order of infinity
active_height[6]:=active_height[6]+shrink(q);
@y
active_height[7]:=active_height[7]+shrink(q);
@z
%---------------------------------------
@x [48] m.1201 l.22454 - Omega fi order of infinity
(total_shrink[fil]<>0)or(total_shrink[fill]<>0)or
(total_shrink[filll]<>0)) then
@y
(total_shrink[sfi]<>0)or(total_shrink[fil]<>0)or
(total_shrink[fill]<>0)or(total_shrink[filll]<>0)) then
@z
| {
"pile_set_name": "Github"
} |
a 形容词
ad 副形词
ag 形容词性语素
an 名形词
b 区别词
c 连词
d 副词
df 副词*
dg 副语素
e 叹词
eng 外语
f 方位词
g 语素
h 前接成分
i 成语
j 简称略语
k 后接成分
l 习用语
m 数词
mg 数语素
mq 数词*
n 名词
ng 名语素
nr 人名
nrfg 名词*
nrt 名词*
ns 地名
nt 机构团体
nz 其他专名
o 拟声词
p 介词
q 量词
r 代词
rg 代词语素
rr 代词*
rz 代词*
s 处所词
t 时间词
tg 时语素
u 助词
ud 助词*
ug 助词*
uj 助词*
ul 助词*
uv 助词*
uz 助词*
v 动词
vd 副动词
vg 动语素
vi 动词*
vn 名动词
vq 动词*
w 标点符号
x 非语素字
y 语气词
z 状态词
zg 状态词* | {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.tencentcloudapi.cbs.v20170312.models;
import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;
public class ResizeDiskResponse extends AbstractModel{
/**
* 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
*/
@SerializedName("RequestId")
@Expose
private String RequestId;
/**
* Get 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
* @return RequestId 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
*/
public String getRequestId() {
return this.RequestId;
}
/**
* Set 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
* @param RequestId 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
*/
public void setRequestId(String RequestId) {
this.RequestId = RequestId;
}
/**
* Internal implementation, normal users should not use it.
*/
public void toMap(HashMap<String, String> map, String prefix) {
this.setParamSimple(map, prefix + "RequestId", this.RequestId);
}
}
| {
"pile_set_name": "Github"
} |
[[users_find_all]]
=== Find all users
include::success.adoc[]
include::defaulting.adoc[]
include::invalid-page.adoc[]
include::invalid-size.adoc[] | {
"pile_set_name": "Github"
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_25) on Thu Mar 08 16:56:22 CET 2012 -->
<TITLE>
Y-Index
</TITLE>
<META NAME="date" CONTENT="2012-03-08">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Y-Index";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index-20.html"><B>PREV LETTER</B></A>
<A HREF="index-22.html"><B>NEXT LETTER</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../index.html?index-filesindex-21.html" target="_top"><B>FRAMES</B></A>
<A HREF="index-21.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<A HREF="index-1.html">A</A> <A HREF="index-2.html">B</A> <A HREF="index-3.html">C</A> <A HREF="index-4.html">D</A> <A HREF="index-5.html">E</A> <A HREF="index-6.html">F</A> <A HREF="index-7.html">G</A> <A HREF="index-8.html">H</A> <A HREF="index-9.html">I</A> <A HREF="index-10.html">L</A> <A HREF="index-11.html">M</A> <A HREF="index-12.html">N</A> <A HREF="index-13.html">O</A> <A HREF="index-14.html">P</A> <A HREF="index-15.html">R</A> <A HREF="index-16.html">S</A> <A HREF="index-17.html">T</A> <A HREF="index-18.html">V</A> <A HREF="index-19.html">W</A> <A HREF="index-20.html">X</A> <A HREF="index-21.html">Y</A> <A HREF="index-22.html">Z</A> <HR>
<A NAME="_Y_"><!-- --></A><H2>
<B>Y</B></H2>
<DL>
<DT><A HREF="../org/jmc/OBJFile.Vertex.html#y"><B>y</B></A> -
Variable in class org.jmc.<A HREF="../org/jmc/OBJFile.Vertex.html" title="class in org.jmc">OBJFile.Vertex</A>
<DD>
<DT><A HREF="../org/jmc/PreviewPanel.ChunkImage.html#y"><B>y</B></A> -
Variable in class org.jmc.<A HREF="../org/jmc/PreviewPanel.ChunkImage.html" title="class in org.jmc">PreviewPanel.ChunkImage</A>
<DD>
<DT><A HREF="../org/jmc/OBJFile.html#y_offset"><B>y_offset</B></A> -
Variable in class org.jmc.<A HREF="../org/jmc/OBJFile.html" title="class in org.jmc">OBJFile</A>
<DD>Offsets of the file.
<DT><A HREF="../org/jmc/OBJExportThread.html#ymin"><B>ymin</B></A> -
Variable in class org.jmc.<A HREF="../org/jmc/OBJExportThread.html" title="class in org.jmc">OBJExportThread</A>
<DD>Altitude above which we are saving.
</DL>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index-20.html"><B>PREV LETTER</B></A>
<A HREF="index-22.html"><B>NEXT LETTER</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../index.html?index-filesindex-21.html" target="_top"><B>FRAMES</B></A>
<A HREF="index-21.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<A HREF="index-1.html">A</A> <A HREF="index-2.html">B</A> <A HREF="index-3.html">C</A> <A HREF="index-4.html">D</A> <A HREF="index-5.html">E</A> <A HREF="index-6.html">F</A> <A HREF="index-7.html">G</A> <A HREF="index-8.html">H</A> <A HREF="index-9.html">I</A> <A HREF="index-10.html">L</A> <A HREF="index-11.html">M</A> <A HREF="index-12.html">N</A> <A HREF="index-13.html">O</A> <A HREF="index-14.html">P</A> <A HREF="index-15.html">R</A> <A HREF="index-16.html">S</A> <A HREF="index-17.html">T</A> <A HREF="index-18.html">V</A> <A HREF="index-19.html">W</A> <A HREF="index-20.html">X</A> <A HREF="index-21.html">Y</A> <A HREF="index-22.html">Z</A> <HR>
</BODY>
</HTML>
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2003-2018, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* - Neither the name of New Artisans LLC nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <system.hh>
#include "pyinterp.h"
#include "pyutils.h"
#if PY_MAJOR_VERSION < 3
#include "pyfstream.h"
#endif
#include "commodity.h"
#include "annotate.h"
#include "balance.h"
namespace ledger {
using namespace boost::python;
namespace {
boost::optional<balance_t> py_value_0(const balance_t& balance) {
return balance.value(CURRENT_TIME());
}
boost::optional<balance_t> py_value_1(const balance_t& balance,
const commodity_t * in_terms_of) {
return balance.value(CURRENT_TIME(), in_terms_of);
}
boost::optional<balance_t> py_value_2(const balance_t& balance,
const commodity_t * in_terms_of,
const datetime_t& moment) {
return balance.value(moment, in_terms_of);
}
boost::optional<balance_t> py_value_2d(const balance_t& balance,
const commodity_t * in_terms_of,
const date_t& moment) {
return balance.value(datetime_t(moment), in_terms_of);
}
boost::optional<amount_t>
py_commodity_amount_0(const balance_t& balance) {
return balance.commodity_amount();
}
boost::optional<amount_t>
py_commodity_amount_1(const balance_t& balance,
const commodity_t& commodity) {
return balance.commodity_amount(commodity);
}
#if 0
void py_print(balance_t& balance, object out) {
if (PyFile_Check(out.ptr())) {
pyofstream outstr(reinterpret_cast<PyFileObject *>(out.ptr()));
balance.print(outstr);
} else {
PyErr_SetString(PyExc_IOError,
_("Argument to balance.print_(file) is not a file object"));
}
}
#endif
long balance_len(balance_t& bal) {
return static_cast<long>(bal.amounts.size());
}
amount_t balance_getitem(balance_t& bal, long i) {
long len = static_cast<long>(bal.amounts.size());
if (labs(i) >= len) {
PyErr_SetString(PyExc_IndexError, _("Index out of range"));
throw_error_already_set();
}
long x = i < 0 ? len + i : i;
balance_t::amounts_map::iterator elem = bal.amounts.begin();
while (--x >= 0)
elem++;
return (*elem).second;
}
balance_t py_strip_annotations_0(balance_t& balance) {
return balance.strip_annotations(keep_details_t());
}
balance_t py_strip_annotations_1(balance_t& balance, const keep_details_t& keep) {
return balance.strip_annotations(keep);
}
PyObject * py_balance_unicode(balance_t& balance) {
return str_to_py_unicode(balance.to_string());
}
} // unnamed namespace
#define EXC_TRANSLATOR(type) \
void exc_translate_ ## type(const type& err) { \
PyErr_SetString(PyExc_ArithmeticError, err.what()); \
}
EXC_TRANSLATOR(balance_error)
void export_balance()
{
class_< balance_t > ("Balance")
.def(init<balance_t>())
.def(init<amount_t>())
.def(init<long>())
.def(init<string>())
.def(self += self)
.def(self += other<amount_t>())
.def(self += long())
.def(self + self)
.def(self + other<amount_t>())
.def(self + long())
.def(self -= self)
.def(self -= other<amount_t>())
.def(self -= long())
.def(self - self)
.def(self - other<amount_t>())
.def(self - long())
.def(self *= other<amount_t>())
.def(self *= long())
.def(self * other<amount_t>())
.def(self * long())
.def(self /= other<amount_t>())
.def(self /= long())
.def(self / other<amount_t>())
.def(self / long())
.def(- self)
.def(self == self)
.def(self == other<amount_t>())
.def(self == long())
.def(self != self)
.def(self != other<amount_t>())
.def(self != long())
.def(! self)
.def("__str__", &balance_t::to_string)
.def("to_string", &balance_t::to_string)
.def("__unicode__", py_balance_unicode)
.def("negated", &balance_t::negated)
.def("in_place_negate", &balance_t::in_place_negate,
return_internal_reference<>())
.def(- self)
.def("abs", &balance_t::abs)
.def("__abs__", &balance_t::abs)
.def("__len__", balance_len)
.def("__getitem__", balance_getitem)
.def("rounded", &balance_t::rounded)
.def("in_place_round", &balance_t::in_place_round,
return_internal_reference<>())
.def("truncated", &balance_t::truncated)
.def("in_place_truncate", &balance_t::in_place_truncate,
return_internal_reference<>())
.def("floored", &balance_t::floored)
.def("in_place_floor", &balance_t::in_place_floor,
return_internal_reference<>())
.def("unrounded", &balance_t::unrounded)
.def("in_place_unround", &balance_t::in_place_unround,
return_internal_reference<>())
.def("reduced", &balance_t::reduced)
.def("in_place_reduce", &balance_t::in_place_reduce,
return_internal_reference<>())
.def("unreduced", &balance_t::unreduced)
.def("in_place_unreduce", &balance_t::in_place_unreduce,
return_internal_reference<>())
.def("value", py_value_0)
.def("value", py_value_1, args("in_terms_of"))
.def("value", py_value_2, args("in_terms_of", "moment"))
.def("value", py_value_2d, args("in_terms_of", "moment"))
.def("__nonzero__", &balance_t::is_nonzero)
.def("is_nonzero", &balance_t::is_nonzero)
.def("is_zero", &balance_t::is_zero)
.def("is_realzero", &balance_t::is_realzero)
.def("is_empty", &balance_t::is_empty)
.def("single_amount", &balance_t::single_amount)
.def("to_amount", &balance_t::to_amount)
.def("commodity_count", &balance_t::commodity_count)
.def("commodity_amount", py_commodity_amount_0)
.def("commodity_amount", py_commodity_amount_1)
.def("number", &balance_t::number)
.def("strip_annotations", py_strip_annotations_0)
.def("strip_annotations", py_strip_annotations_1)
.def("valid", &balance_t::valid)
;
register_optional_to_python<balance_t>();
implicitly_convertible<long, balance_t>();
implicitly_convertible<string, balance_t>();
implicitly_convertible<amount_t, balance_t>();
#define EXC_TRANSLATE(type) \
register_exception_translator<type>(&exc_translate_ ## type);
EXC_TRANSLATE(balance_error);
}
} // namespace ledger
| {
"pile_set_name": "Github"
} |
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="employee" type="extendedpersoninfo"/>
<xs:complexType name="personinfo">
<xs:attribute name="id" type="xs:positiveInteger"/>
</xs:complexType>
<xs:complexType name="extendedpersoninfo">
<xs:complexContent>
<xs:extension base="personinfo">
<xs:all>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
<xs:element name="address" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:element name="country" type="xs:string"/>
</xs:all>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
| {
"pile_set_name": "Github"
} |
# created by tools/loadICU.tcl -- do not edit
namespace eval ::tcl::clock {
::msgcat::mcset kok DAYS_OF_WEEK_FULL [list \
"\u0906\u0926\u093f\u0924\u094d\u092f\u0935\u093e\u0930"\
"\u0938\u094b\u092e\u0935\u093e\u0930"\
"\u092e\u0902\u0917\u0933\u093e\u0930"\
"\u092c\u0941\u0927\u0935\u093e\u0930"\
"\u0917\u0941\u0930\u0941\u0935\u093e\u0930"\
"\u0936\u0941\u0915\u094d\u0930\u0935\u093e\u0930"\
"\u0936\u0928\u093f\u0935\u093e\u0930"]
::msgcat::mcset kok MONTHS_ABBREV [list \
"\u091c\u093e\u0928\u0947\u0935\u093e\u0930\u0940"\
"\u092b\u0947\u092c\u0943\u0935\u093e\u0930\u0940"\
"\u092e\u093e\u0930\u094d\u091a"\
"\u090f\u092a\u094d\u0930\u093f\u0932"\
"\u092e\u0947"\
"\u091c\u0942\u0928"\
"\u091c\u0941\u0932\u0948"\
"\u0913\u0917\u0938\u094d\u091f"\
"\u0938\u0947\u092a\u094d\u091f\u0947\u0902\u092c\u0930"\
"\u0913\u0915\u094d\u091f\u094b\u092c\u0930"\
"\u0928\u094b\u0935\u094d\u0939\u0947\u0902\u092c\u0930"\
"\u0921\u093f\u0938\u0947\u0902\u092c\u0930"]
::msgcat::mcset kok MONTHS_FULL [list \
"\u091c\u093e\u0928\u0947\u0935\u093e\u0930\u0940"\
"\u092b\u0947\u092c\u094d\u0930\u0941\u0935\u093e\u0930\u0940"\
"\u092e\u093e\u0930\u094d\u091a"\
"\u090f\u092a\u094d\u0930\u093f\u0932"\
"\u092e\u0947"\
"\u091c\u0942\u0928"\
"\u091c\u0941\u0932\u0948"\
"\u0913\u0917\u0938\u094d\u091f"\
"\u0938\u0947\u092a\u094d\u091f\u0947\u0902\u092c\u0930"\
"\u0913\u0915\u094d\u091f\u094b\u092c\u0930"\
"\u0928\u094b\u0935\u094d\u0939\u0947\u0902\u092c\u0930"\
"\u0921\u093f\u0938\u0947\u0902\u092c\u0930"]
::msgcat::mcset kok AM "\u0915\u094d\u0930\u093f\u0938\u094d\u0924\u092a\u0942\u0930\u094d\u0935"
::msgcat::mcset kok PM "\u0915\u094d\u0930\u093f\u0938\u094d\u0924\u0936\u0916\u093e"
}
| {
"pile_set_name": "Github"
} |
// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2011 - Calixte DENIZET
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
//
// <-- CLI SHELL MODE -->
//
// <-- Non-regression test for bug 9755 -->
//
// <-- Bugzilla URL -->
// http://bugzilla.scilab.org/9755
//
// <-- Short Description -->
// Completion on paths was not case insensitive on Windows
//
if getos() == 'Windows' then
ilib_verbose(0);
ierr = exec(SCI+"/modules/completion/tests/utilities/build_primitives.sce","errcatch",-1);
if ierr <> 0 then pause, end
ierr = exec(TMPDIR + "/completion/loader.sce","errcatch",-1);
if ierr <> 0 then pause, end
currentline = 'cd c:/u';
r = completeline(currentline,'Users',getfilepartlevel(currentline),getpartlevel(currentline),%t);
if r <> 'cd c:/Users' then pause,end
currentline = 'cd c:/programs Files/f';
r = completeline(currentline,'Fichiers',getfilepartlevel(currentline),getpartlevel(currentline),%t);
if r <> 'cd c:/programs Files/Fichiers' then pause,end
end
| {
"pile_set_name": "Github"
} |
// This module defines interface to the QsciStyledText class.
//
// Copyright (c) 2017 Riverbank Computing Limited <[email protected]>
//
// This file is part of QScintilla.
//
// 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 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 do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// [email protected].
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#ifndef QSCISTYLEDTEXT_H
#define QSCISTYLEDTEXT_H
#include <qstring.h>
#include <Qsci/qsciglobal.h>
class QsciScintillaBase;
class QsciStyle;
//! \brief The QsciStyledText class is a container for a piece of text and the
//! style used to display the text.
class QSCINTILLA_EXPORT QsciStyledText
{
public:
//! Constructs a QsciStyledText instance for text \a text and style number
//! \a style.
QsciStyledText(const QString &text, int style);
//! Constructs a QsciStyledText instance for text \a text and style \a
//! style.
QsciStyledText(const QString &text, const QsciStyle &style);
//! \internal Apply the style to a particular editor.
void apply(QsciScintillaBase *sci) const;
//! Returns a reference to the text.
const QString &text() const {return styled_text;}
//! Returns the number of the style.
int style() const;
private:
QString styled_text;
int style_nr;
const QsciStyle *explicit_style;
};
#endif
| {
"pile_set_name": "Github"
} |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Nicola Baldo <[email protected]>
*/
#include "ns3/lte-enb-cphy-sap.h"
namespace ns3 {
LteEnbCphySapProvider::~LteEnbCphySapProvider ()
{
}
LteEnbCphySapUser::~LteEnbCphySapUser ()
{
}
} // namespace ns3
| {
"pile_set_name": "Github"
} |
@echo off
rem ***************************************************************************
rem * _ _ ____ _
rem * Project ___| | | | _ \| |
rem * / __| | | | |_) | |
rem * | (__| |_| | _ <| |___
rem * \___|\___/|_| \_\_____|
rem *
rem * Copyright (C) 2014 - 2015, Steve Holme, <[email protected]>.
rem *
rem * This software is licensed as described in the file COPYING, which
rem * you should have received as part of this distribution. The terms
rem * are also available at https://curl.haxx.se/docs/copyright.html.
rem *
rem * You may opt to use, copy, modify, merge, publish, distribute and/or sell
rem * copies of the Software, and permit persons to whom the Software is
rem * furnished to do so, under the terms of the COPYING file.
rem *
rem * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
rem * KIND, either express or implied.
rem *
rem ***************************************************************************
:begin
rem Check we are running on a Windows NT derived OS
if not "%OS%" == "Windows_NT" goto nodos
rem Set our variables
setlocal
:parseArgs
if "%~1" == "" goto prerequisites
if /i "%~1" == "-?" (
goto syntax
) else if /i "%~1" == "-h" (
goto syntax
) else if /i "%~1" == "-help" (
goto syntax
) else (
if not defined SRC_DIR (
set SRC_DIR=%~1%
) else (
goto unknown
)
)
shift & goto parseArgs
:prerequisites
rem Check we have Perl installed
echo %PATH% | findstr /I /C:"\Perl" 1>nul
if errorlevel 1 (
if not exist "%SystemDrive%\Perl" (
if not exist "%SystemDrive%\Perl64" goto noperl
)
)
:configure
if "%SRC_DIR%" == "" set SRC_DIR=..
if not exist "%SRC_DIR%" goto nosrc
:start
rem Check the src directory
if exist %SRC_DIR%\src (
for /f "delims=" %%i in ('dir "%SRC_DIR%\src\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\src" -Wtool_hugehelp.c "%%i"
for /f "delims=" %%i in ('dir "%SRC_DIR%\src\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\src" "%%i"
)
rem Check the lib directory
if exist %SRC_DIR%\lib (
for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib" "%%i"
for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib" -Wcurl_config.h.cmake "%%i"
)
rem Check the lib\vtls directory
if exist %SRC_DIR%\lib\vtls (
for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vtls\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vtls" "%%i"
for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vtls\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vtls" "%%i"
)
goto success
:syntax
rem Display the help
echo.
echo Usage: checksrc [directory]
echo.
echo directory - Specifies the curl source directory
goto success
:unknown
echo.
echo Error: Unknown argument '%1'
goto error
:nodos
echo.
echo Error: Only a Windows NT based Operating System is supported
goto error
:noperl
echo.
echo Error: Perl is not installed
goto error
:nosrc
echo.
echo Error: "%SRC_DIR%" does not exist
goto error
:error
if "%OS%" == "Windows_NT" endlocal
exit /B 1
:success
endlocal
exit /B 0
| {
"pile_set_name": "Github"
} |
/** \file
*
* This file contains special DoxyGen information for the generation of the main page and other special
* documentation pages. It is not a project source file.
*/
/** @defgroup Group_BoardDrivers Board Drivers
*
* Functions, macros, variables, enums and types related to the control of physical board hardware.
*/
/** @defgroup Group_PeripheralDrivers On-chip Peripheral Drivers
*
* Functions, macros, variables, enums and types related to the control of AVR subsystems.
*/
/** @defgroup Group_MiscDrivers Miscellaneous Drivers
*
* Miscellaneous driver Functions, macros, variables, enums and types.
*/
| {
"pile_set_name": "Github"
} |
%% start of file `moderncvcolorpurple.sty'.
%% Copyright 2006-2012 Xavier Danaux ([email protected]).
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License version 1.3c,
% available at http://www.latex-project.org/lppl/.
%-------------------------------------------------------------------------------
% identification
%-------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{moderncvcolorpurple}[2012/10/31 v1.2.0 modern curriculum vitae and letter color scheme: purple]
%-------------------------------------------------------------------------------
% color scheme definition
%-------------------------------------------------------------------------------
\definecolor{color0}{rgb}{0,0,0}% black
\definecolor{color1}{rgb}{0.50,0.33,0.80}% purple
\definecolor{color2}{rgb}{0.45,0.45,0.45}% dark grey
\endinput
%% end of file `moderncvcolorpurple.sty'.
| {
"pile_set_name": "Github"
} |
{
"@type" : "gx:OffsetTime",
"@value" : "10:15:30+01:00"
} | {
"pile_set_name": "Github"
} |
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width" />
<title>错误</title>
</head>
<body>
<hgroup>
<h1>错误。</h1>
<h2>处理你的请求时出错。</h2>
</hgroup>
</body>
</html>
| {
"pile_set_name": "Github"
} |
/***************************************************************************/
/* */
/* ftadvanc.c */
/* */
/* Quick computation of advance widths (body). */
/* */
/* Copyright 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_ADVANCES_H
#include FT_INTERNAL_OBJECTS_H
static FT_Error
_ft_face_scale_advances( FT_Face face,
FT_Fixed* advances,
FT_UInt count,
FT_Int32 flags )
{
FT_Fixed scale;
FT_UInt nn;
if ( flags & FT_LOAD_NO_SCALE )
return FT_Err_Ok;
if ( face->size == NULL )
return FT_Err_Invalid_Size_Handle;
if ( flags & FT_LOAD_VERTICAL_LAYOUT )
scale = face->size->metrics.y_scale;
else
scale = face->size->metrics.x_scale;
/* this must be the same scaling as to get linear{Hori,Vert}Advance */
/* (see `FT_Load_Glyph' implementation in src/base/ftobjs.c) */
for ( nn = 0; nn < count; nn++ )
advances[nn] = FT_MulDiv( advances[nn], scale, 64 );
return FT_Err_Ok;
}
/* at the moment, we can perform fast advance retrieval only in */
/* the following cases: */
/* */
/* - unscaled load */
/* - unhinted load */
/* - light-hinted load */
#define LOAD_ADVANCE_FAST_CHECK( flags ) \
( flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING ) || \
FT_LOAD_TARGET_MODE( flags ) == FT_RENDER_MODE_LIGHT )
/* documentation is in ftadvanc.h */
FT_EXPORT_DEF( FT_Error )
FT_Get_Advance( FT_Face face,
FT_UInt gindex,
FT_Int32 flags,
FT_Fixed *padvance )
{
FT_Face_GetAdvancesFunc func;
if ( !face )
return FT_Err_Invalid_Face_Handle;
if ( gindex >= (FT_UInt)face->num_glyphs )
return FT_Err_Invalid_Glyph_Index;
func = face->driver->clazz->get_advances;
if ( func && LOAD_ADVANCE_FAST_CHECK( flags ) )
{
FT_Error error;
error = func( face, gindex, 1, flags, padvance );
if ( !error )
return _ft_face_scale_advances( face, padvance, 1, flags );
if ( error != FT_ERROR_BASE( FT_Err_Unimplemented_Feature ) )
return error;
}
return FT_Get_Advances( face, gindex, 1, flags, padvance );
}
/* documentation is in ftadvanc.h */
FT_EXPORT_DEF( FT_Error )
FT_Get_Advances( FT_Face face,
FT_UInt start,
FT_UInt count,
FT_Int32 flags,
FT_Fixed *padvances )
{
FT_Face_GetAdvancesFunc func;
FT_UInt num, end, nn;
FT_Error error = FT_Err_Ok;
if ( !face )
return FT_Err_Invalid_Face_Handle;
num = (FT_UInt)face->num_glyphs;
end = start + count;
if ( start >= num || end < start || end > num )
return FT_Err_Invalid_Glyph_Index;
if ( count == 0 )
return FT_Err_Ok;
func = face->driver->clazz->get_advances;
if ( func && LOAD_ADVANCE_FAST_CHECK( flags ) )
{
error = func( face, start, count, flags, padvances );
if ( !error )
goto Exit;
if ( error != FT_ERROR_BASE( FT_Err_Unimplemented_Feature ) )
return error;
}
error = FT_Err_Ok;
if ( flags & FT_ADVANCE_FLAG_FAST_ONLY )
return FT_Err_Unimplemented_Feature;
flags |= FT_LOAD_ADVANCE_ONLY;
for ( nn = 0; nn < count; nn++ )
{
error = FT_Load_Glyph( face, start + nn, flags );
if ( error )
break;
padvances[nn] = ( flags & FT_LOAD_VERTICAL_LAYOUT )
? face->glyph->advance.y
: face->glyph->advance.x;
}
if ( error )
return error;
Exit:
return _ft_face_scale_advances( face, padvances, count, flags );
}
/* END */
| {
"pile_set_name": "Github"
} |
namespace Cassette.Scripts
{
public interface ICoffeeScriptCompiler : ICompiler
{
}
} | {
"pile_set_name": "Github"
} |
package fingerprint
import (
"fmt"
log "github.com/hashicorp/go-hclog"
"github.com/hashicorp/nomad/nomad/structs"
"github.com/shirou/gopsutil/mem"
)
const bytesInMB int64 = 1024 * 1024
// MemoryFingerprint is used to fingerprint the available memory on the node
type MemoryFingerprint struct {
StaticFingerprinter
logger log.Logger
}
// NewMemoryFingerprint is used to create a Memory fingerprint
func NewMemoryFingerprint(logger log.Logger) Fingerprint {
f := &MemoryFingerprint{
logger: logger.Named("memory"),
}
return f
}
func (f *MemoryFingerprint) Fingerprint(req *FingerprintRequest, resp *FingerprintResponse) error {
var totalMemory int64
cfg := req.Config
if cfg.MemoryMB != 0 {
totalMemory = int64(cfg.MemoryMB) * bytesInMB
} else {
memInfo, err := mem.VirtualMemory()
if err != nil {
f.logger.Warn("error reading memory information", "error", err)
return err
}
if memInfo.Total > 0 {
totalMemory = int64(memInfo.Total)
}
}
if totalMemory > 0 {
resp.AddAttribute("memory.totalbytes", fmt.Sprintf("%d", totalMemory))
memoryMB := totalMemory / bytesInMB
// COMPAT(0.10): Unused since 0.9.
resp.Resources = &structs.Resources{
MemoryMB: int(memoryMB),
}
resp.NodeResources = &structs.NodeResources{
Memory: structs.NodeMemoryResources{
MemoryMB: memoryMB,
},
}
}
return nil
}
| {
"pile_set_name": "Github"
} |
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:exslt="http://exslt.org/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd" version="3.3" ID="P0b002ee18a8aac3e">
<name type="corporate">
<namePart>United States Government Printing Office</namePart>
<role>
<roleTerm type="text" authority="marcrelator">printer</roleTerm>
<roleTerm type="code" authority="marcrelator">prt</roleTerm>
</role>
<role>
<roleTerm type="text" authority="marcrelator">distributor</roleTerm>
<roleTerm type="code" authority="marcrelator">dst</roleTerm>
</role>
</name>
<name type="corporate">
<namePart>United States</namePart>
<namePart>United States District Court Western District of Michigan</namePart>
<role>
<roleTerm type="text" authority="marcrelator">author</roleTerm>
<roleTerm type="code" authority="marcrelator">aut</roleTerm>
</role>
<description>Government Organization</description>
</name>
<typeOfResource>text</typeOfResource>
<genre authority="marcgt">government publication</genre>
<language>
<languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</language>
<extension>
<collectionCode>USCOURTS</collectionCode>
<category>Judicial Publications</category>
<branch>judicial</branch>
<dateIngested>2015-01-06</dateIngested>
</extension>
<originInfo>
<publisher>Administrative Office of the United States Courts</publisher>
<dateIssued encoding="w3cdtf">2015-01-05</dateIssued>
<issuance>monographic</issuance>
</originInfo>
<physicalDescription>
<note type="source content type">deposited</note>
<digitalOrigin>born digital</digitalOrigin>
</physicalDescription>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="uri">http://www.gpo.gov/fdsys/pkg/USCOURTS-miwd-2_14-cr-00027</identifier>
<identifier type="local">P0b002ee18a8aac3e</identifier>
<recordInfo>
<recordContentSource authority="marcorg">DGPO</recordContentSource>
<recordCreationDate encoding="w3cdtf">2015-01-06</recordCreationDate>
<recordChangeDate encoding="w3cdtf">2015-01-06</recordChangeDate>
<recordIdentifier source="DGPO">USCOURTS-miwd-2_14-cr-00027</recordIdentifier>
<recordOrigin>machine generated</recordOrigin>
<languageOfCataloging>
<languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</languageOfCataloging>
</recordInfo>
<accessCondition type="GPO scope determination">fdlp</accessCondition>
<extension>
<docClass>USCOURTS</docClass>
<accessId>USCOURTS-miwd-2_14-cr-00027</accessId>
<courtType>District</courtType>
<courtCode>miwd</courtCode>
<courtCircuit>6th</courtCircuit>
<courtState>Michigan</courtState>
<courtSortOrder>2254</courtSortOrder>
<caseNumber>2:14-cr-00027</caseNumber>
<caseOffice>Northern Division (2)</caseOffice>
<caseType>criminal</caseType>
<party firstName="Nathan" fullName="Nathan Alfred Joyal" lastName="Joyal" middleName="Alfred" role="defendant"></party>
<party fullName="USA" lastName="USA" role="plaintiff"></party>
</extension>
<titleInfo>
<title>USA v. Joyal</title>
<partNumber>2:14-cr-00027</partNumber>
</titleInfo>
<location>
<url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/pkg/USCOURTS-miwd-2_14-cr-00027/content-detail.html</url>
</location>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="preferred citation">2:14-cr-00027;14-027</identifier>
<name type="corporate">
<namePart>United States District Court Western District of Michigan</namePart>
<namePart>6th Circuit</namePart>
<namePart>Northern Division (2)</namePart>
<affiliation>U.S. Courts</affiliation>
<role>
<roleTerm authority="marcrelator" type="text">author</roleTerm>
<roleTerm authority="marcrelator" type="code">aut</roleTerm>
</role>
</name>
<name type="personal">
<displayForm>Nathan Alfred Joyal</displayForm>
<namePart type="family">Joyal</namePart>
<namePart type="given">Nathan</namePart>
<namePart type="termsOfAddress"></namePart>
<description>defendant</description>
</name>
<name type="personal">
<displayForm>USA</displayForm>
<namePart type="family">USA</namePart>
<namePart type="given"></namePart>
<namePart type="termsOfAddress"></namePart>
<description>plaintiff</description>
</name>
<extension>
<docClass>USCOURTS</docClass>
<accessId>USCOURTS-miwd-2_14-cr-00027</accessId>
<courtType>District</courtType>
<courtCode>miwd</courtCode>
<courtCircuit>6th</courtCircuit>
<courtState>Michigan</courtState>
<courtSortOrder>2254</courtSortOrder>
<caseNumber>2:14-cr-00027</caseNumber>
<caseOffice>Northern Division (2)</caseOffice>
<caseType>criminal</caseType>
<party firstName="Nathan" fullName="Nathan Alfred Joyal" lastName="Joyal" middleName="Alfred" role="defendant"></party>
<party fullName="USA" lastName="USA" role="plaintiff"></party>
<state>Michigan</state>
</extension>
<relatedItem type="constituent" ID="id-USCOURTS-miwd-2_14-cr-00027-0" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-miwd-2_14-cr-00027/USCOURTS-miwd-2_14-cr-00027-0/mods.xml">
<titleInfo>
<title>USA v. Joyal</title>
<subTitle>REPORT AND RECOMMENDATION that the guilty plea of Nathan Alfred Joyal as to Counts One and Twelve be accepted; objections to R&R due within 14 days; signed by Magistrate Judge Timothy P. Greeley (Magistrate Judge Timothy P. Greeley, pjc)</subTitle>
<partNumber>0</partNumber>
</titleInfo>
<originInfo>
<dateIssued>2014-12-01</dateIssued>
</originInfo>
<relatedItem type="otherFormat" xlink:href="http://www.gpo.gov/fdsys/pkg/USCOURTS-miwd-2_14-cr-00027/pdf/USCOURTS-miwd-2_14-cr-00027-0.pdf">
<identifier type="FDsys Unique ID">D09002ee18a8b3010</identifier>
</relatedItem>
<identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-miwd-2_14-cr-00027/USCOURTS-miwd-2_14-cr-00027-0</identifier>
<identifier type="former granule identifier">miwd-2_14-cr-00027_0.pdf</identifier>
<location>
<url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-miwd-2_14-cr-00027/USCOURTS-miwd-2_14-cr-00027-0/content-detail.html</url>
<url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-miwd-2_14-cr-00027/pdf/USCOURTS-miwd-2_14-cr-00027-0.pdf</url>
</location>
<extension>
<searchTitle>USCOURTS 2:14-cr-00027; USA v. Joyal; </searchTitle>
<courtName>United States District Court Western District of Michigan</courtName>
<state>Michigan</state>
<accessId>USCOURTS-miwd-2_14-cr-00027-0</accessId>
<sequenceNumber>0</sequenceNumber>
<dateIssued>2014-12-01</dateIssued>
<docketText>REPORT AND RECOMMENDATION that the guilty plea of Nathan Alfred Joyal as to Counts One and Twelve be accepted; objections to R&R due within 14 days; signed by Magistrate Judge Timothy P. Greeley (Magistrate Judge Timothy P. Greeley, pjc)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-miwd-2_14-cr-00027-1" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-miwd-2_14-cr-00027/USCOURTS-miwd-2_14-cr-00027-1/mods.xml">
<titleInfo>
<title>USA v. Joyal</title>
<subTitle>ORDER ADOPTING REPORT AND RECOMMENDATION 40 as to Nathan Alfred Joyal ; signed by Judge R. Allan Edgar (Judge R. Allan Edgar, cam)</subTitle>
<partNumber>1</partNumber>
</titleInfo>
<originInfo>
<dateIssued>2015-01-05</dateIssued>
</originInfo>
<relatedItem type="otherFormat" xlink:href="http://www.gpo.gov/fdsys/pkg/USCOURTS-miwd-2_14-cr-00027/pdf/USCOURTS-miwd-2_14-cr-00027-1.pdf">
<identifier type="FDsys Unique ID">D09002ee18a8b300f</identifier>
</relatedItem>
<identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-miwd-2_14-cr-00027/USCOURTS-miwd-2_14-cr-00027-1</identifier>
<identifier type="former granule identifier">miwd-2_14-cr-00027_1.pdf</identifier>
<location>
<url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-miwd-2_14-cr-00027/USCOURTS-miwd-2_14-cr-00027-1/content-detail.html</url>
<url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-miwd-2_14-cr-00027/pdf/USCOURTS-miwd-2_14-cr-00027-1.pdf</url>
</location>
<extension>
<searchTitle>USCOURTS 2:14-cr-00027; USA v. Joyal; </searchTitle>
<courtName>United States District Court Western District of Michigan</courtName>
<state>Michigan</state>
<accessId>USCOURTS-miwd-2_14-cr-00027-1</accessId>
<sequenceNumber>1</sequenceNumber>
<dateIssued>2015-01-05</dateIssued>
<docketText>ORDER ADOPTING REPORT AND RECOMMENDATION 40 as to Nathan Alfred Joyal ; signed by Judge R. Allan Edgar (Judge R. Allan Edgar, cam)</docketText>
</extension>
</relatedItem>
</mods> | {
"pile_set_name": "Github"
} |
---
title: User Account Control Overview
description: Windows Server Security
ms.topic: article
ms.assetid: 1b7a39cd-fc10-4408-befd-4b2c45806732
ms.author: lizross
author: eross-msft
manager: mtillman
ms.date: 10/12/2016
---
# User Account Control Overview
User Account Control \(UAC\) is a fundamental component of Microsoft's overall security vision. UAC helps mitigate the impact of a malicious program.
## <a name="BKMK_OVER"></a>Feature description
UAC allows all users to log on to their computers using a standard user account. Processes launched using a standard user token may perform tasks using access rights granted to a standard user. For instance, Windows Explorer automatically inherits standard user level permissions. Additionally, any programs that are executed using Windows Explorer \(for example, by double\-clicking an application shortcut\) also run with the standard set of user permissions. Many applications, including those that are included with the operating system itself, are designed to work properly in this way.
Other applications, especially those that were not specifically designed with security settings in mind, often require additional permissions to run successfully. These types of programs are referred to as legacy applications. Additionally, actions such as installing new software and making configuration changes to programs such as Windows Firewall, require more permissions than what is available to a standard user account.
When an applications needs to run with more than standard user rights, UAC can restore additional user groups to the token. This enables the user to have explicit control of programs that are making system level changes to their computer or device.
## <a name="BKMK_APP"></a>Practical applications
Admin Approval Mode in UAC helps prevent malicious programs from silently installing without an administrator's knowledge. It also helps protect from inadvertent system\-wide changes. Lastly, it can be used to enforce a higher level of compliance where administrators must actively consent or provide credentials for each administrative process.
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
| {
"pile_set_name": "Github"
} |
// +build go1.7
package aws
import "context"
var (
backgroundCtx = context.Background()
)
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2008, Willow Garage, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Willow Garage, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "shape.h"
#include <ros/assert.h>
#include <OgreSceneManager.h>
#include <OgreSceneNode.h>
#include <OgreVector3.h>
#include <OgreQuaternion.h>
#include <OgreEntity.h>
#include <OgreMaterialManager.h>
#include <OgreTextureManager.h>
#include <OgreTechnique.h>
#include <stdint.h>
namespace rviz
{
Ogre::Entity* Shape::createEntity(const std::string& name, Type type, Ogre::SceneManager* scene_manager)
{
if (type == Mesh)
return nullptr; // the entity is initialized after the vertex data was specified
std::string mesh_name;
switch (type)
{
case Cone:
mesh_name = "rviz_cone.mesh";
break;
case Cube:
mesh_name = "rviz_cube.mesh";
break;
case Cylinder:
mesh_name = "rviz_cylinder.mesh";
break;
case Sphere:
mesh_name = "rviz_sphere.mesh";
break;
default:
ROS_BREAK();
}
return scene_manager->createEntity(name, mesh_name);
}
Shape::Shape(Type type, Ogre::SceneManager* scene_manager, Ogre::SceneNode* parent_node)
: Object(scene_manager), type_(type)
{
static uint32_t count = 0;
std::stringstream ss;
ss << "Shape" << count++;
entity_ = createEntity(ss.str(), type, scene_manager);
if (!parent_node)
{
parent_node = scene_manager_->getRootSceneNode();
}
scene_node_ = parent_node->createChildSceneNode();
offset_node_ = scene_node_->createChildSceneNode();
if (entity_)
offset_node_->attachObject(entity_);
ss << "Material";
material_name_ = ss.str();
material_ = Ogre::MaterialManager::getSingleton().create(material_name_, ROS_PACKAGE_NAME);
material_->setReceiveShadows(false);
material_->getTechnique(0)->setLightingEnabled(true);
material_->getTechnique(0)->setAmbient(0.5, 0.5, 0.5);
if (entity_)
entity_->setMaterialName(material_name_);
#if (OGRE_VERSION_MAJOR <= 1 && OGRE_VERSION_MINOR <= 4)
if (entity_)
entity_->setNormaliseNormals(true);
#endif
}
Shape::~Shape()
{
scene_manager_->destroySceneNode(scene_node_->getName());
scene_manager_->destroySceneNode(offset_node_->getName());
if (entity_)
scene_manager_->destroyEntity(entity_);
material_->unload();
Ogre::MaterialManager::getSingleton().remove(material_->getName());
}
void Shape::setColor(const Ogre::ColourValue& c)
{
material_->getTechnique(0)->setAmbient(c * 0.5);
material_->getTechnique(0)->setDiffuse(c);
if (c.a < 0.9998)
{
material_->getTechnique(0)->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
material_->getTechnique(0)->setDepthWriteEnabled(false);
}
else
{
material_->getTechnique(0)->setSceneBlending(Ogre::SBT_REPLACE);
material_->getTechnique(0)->setDepthWriteEnabled(true);
}
}
void Shape::setColor(float r, float g, float b, float a)
{
setColor(Ogre::ColourValue(r, g, b, a));
}
void Shape::setOffset(const Ogre::Vector3& offset)
{
offset_node_->setPosition(offset);
}
void Shape::setPosition(const Ogre::Vector3& position)
{
scene_node_->setPosition(position);
}
void Shape::setOrientation(const Ogre::Quaternion& orientation)
{
scene_node_->setOrientation(orientation);
}
void Shape::setScale(const Ogre::Vector3& scale)
{
scene_node_->setScale(scale);
}
const Ogre::Vector3& Shape::getPosition()
{
return scene_node_->getPosition();
}
const Ogre::Quaternion& Shape::getOrientation()
{
return scene_node_->getOrientation();
}
void Shape::setUserData(const Ogre::Any& data)
{
if (entity_)
entity_->getUserObjectBindings().setUserAny(data);
else
ROS_ERROR("Shape not yet fully constructed. Cannot set user data. Did you add triangles to the mesh "
"already?");
}
} // namespace rviz
| {
"pile_set_name": "Github"
} |
/**
@author Sergey Mamontov
@since 4.0
@copyright © 2010-2018 PubNub, Inc.
*/
#import "PNResult+Private.h"
#import "PNPrivateStructures.h"
#import "PNStatus.h"
#import "PNJSON.h"
NS_ASSUME_NONNULL_BEGIN
#pragma mark Protected interface declaration
@interface PNResult () <NSCopying>
#pragma mark - Information
@property (nonatomic, assign) NSInteger statusCode;
@property (nonatomic, assign) PNOperationType operation;
@property (nonatomic, assign, getter = isTLSEnabled) BOOL TLSEnabled;
@property (nonatomic, assign, getter = isUnexpectedServiceData) BOOL unexpectedServiceData;
@property (nonatomic, copy) NSString *uuid;
@property (nonatomic, nullable, copy) NSString *authKey;
@property (nonatomic, copy) NSString *origin;
@property (nonatomic, nullable, copy) NSURLRequest *clientRequest;
@property (nonatomic, nullable, copy) NSDictionary<NSString *, id> *serviceData;
#pragma mark - Misc
/**
@brief Create instance copy with additional adjustments on whether service data information should be copied
sor not.
@param shouldCopyServiceData Whether service data should be passed to new copy or not.
@return Receiver's new copy.
*/
- (id)copyWithServiceData:(BOOL)shouldCopyServiceData;
/**
@brief Ensure what passed \c serviceData has required data type (dictionary). If \c serviceData has
different data type, it will be wrapped into dictionary.
@discussion If unexpected data type will be passes, object will set corresponding flag, so it will be
processed and printed out to log file for further investigation.
@param serviceData Reference on data which should be verified and used for resulting object.
@return \c Normalized service data dictionary.
*/
- (NSDictionary *)normalizedServiceData:(nullable id)serviceData;
#pragma mark -
@end
NS_ASSUME_NONNULL_END
#pragma mark Interface implementation
@implementation PNResult
#pragma mark - Information
- (NSString *)stringifiedOperation {
return (self.operation >= PNSubscribeOperation ? PNOperationTypeStrings[self.operation] : @"Unknown");
}
#pragma mark - Initialization and Configuration
+ (instancetype)objectForOperation:(PNOperationType)operation completedWithTask:(NSURLSessionDataTask *)task
processedData:(NSDictionary<NSString *, id> *)processedData
processingError:(NSError *)error {
return [[self alloc] initForOperation:operation completedWithTask:task
processedData:processedData processingError:error];
}
- (instancetype)initForOperation:(PNOperationType)operation completedWithTask:(NSURLSessionDataTask *)task
processedData:(NSDictionary<NSString *, id> *)processedData
processingError:(NSError *)__unused error {
// Check whether initialization was successful or not.
if ((self = [super init])) {
_statusCode = (task ? ((NSHTTPURLResponse *)task.response).statusCode : 200);
_operation = operation;
_clientRequest = [task.currentRequest copy];
if ([processedData[@"status"] isKindOfClass:[NSNumber class]]) {
NSMutableDictionary *dataForUpdate = [processedData mutableCopy];
NSNumber *statusCode = [dataForUpdate[@"status"] copy];
[dataForUpdate removeObjectForKey:@"status"];
processedData = [dataForUpdate copy];
_statusCode = (([statusCode integerValue] > 200) ? [statusCode integerValue] : _statusCode);
}
// Received unknown response from service.
else if (processedData && ![processedData isKindOfClass:[NSDictionary class]]){
_unexpectedServiceData = YES;
processedData = [self normalizedServiceData:processedData];
}
_serviceData = [processedData copy];
}
return self;
}
- (id)copyWithZone:(NSZone *)zone {
return [self copyWithServiceData:YES];
}
- (instancetype)copyWithMutatedData:(id)data {
PNResult *result = [self copyWithServiceData:NO];
[result updateData:data];
return result;
}
- (void)updateData:(id)data {
_serviceData = [[self normalizedServiceData:data] copy];
_unexpectedServiceData = ![_serviceData isEqual:data];
}
#pragma mark - Misc
- (id)copyWithServiceData:(BOOL)shouldCopyServiceData {
PNResult *result = [[self class] new];
result.statusCode = self.statusCode;
result.operation = self.operation;
result.TLSEnabled = self.isTLSEnabled;
result.uuid = self.uuid;
result.authKey = self.authKey;
result.origin = self.origin;
result.clientRequest = self.clientRequest;
if (shouldCopyServiceData) {
[result updateData:self.serviceData];
}
return result;
}
- (NSDictionary *)normalizedServiceData:(id)serviceData {
NSDictionary *normalizedServiceData = serviceData?: @{};
if (serviceData && ![serviceData isKindOfClass:[NSDictionary class]]) {
normalizedServiceData = @{@"information": serviceData};
}
return normalizedServiceData;
}
- (NSMethodSignature *)methodSignatureForSelector:(SEL)__unused selector {
return [[self class] instanceMethodSignatureForSelector:@selector(doNothing)];
}
- (void)forwardInvocation:(NSInvocation *)__unused invocation {
}
- (void)doNothing {
}
- (NSDictionary *)dictionaryRepresentation {
id processedData = ([self.serviceData mutableCopy]?: @"no data");
if (self.serviceData[@"envelope"]) {
processedData[@"envelope"] = [self.serviceData[@"envelope"] valueForKey:@"dictionaryRepresentation"];
}
NSMutableDictionary *response = [@{@"Status code": @(self.statusCode),
@"Processed data": processedData} mutableCopy];
if (_unexpectedServiceData) { response[@"Unexpected"] = @(YES); }
return @{@"Operation": PNOperationTypeStrings[[self operation]],
@"Request": @{@"Method": (self.clientRequest.HTTPMethod?: @"GET"),
@"URL": ([self.clientRequest.URL absoluteString]?: @"null"),
@"POST Body size": [self.clientRequest valueForHTTPHeaderField:@"content-length"] ?: @0,
@"Secure": (self.isTLSEnabled ? @"YES" : @"NO"),
@"UUID": (self.uuid?: @"unknown"),
@"Authorization": (self.authKey?: @"not set"),
@"Origin": (self.origin?: @"unknown")},
@"Response": response};
}
- (NSString *)stringifiedRepresentation {
return [PNJSON JSONStringFrom:[self dictionaryRepresentation] withError:NULL];
}
- (NSString *)debugDescription {
return [[self dictionaryRepresentation] description];
}
#pragma mark -
@end
| {
"pile_set_name": "Github"
} |
#import <Foundation/Foundation.h>
@interface PodsDummy_MKDropdownMenu : NSObject
@end
@implementation PodsDummy_MKDropdownMenu
@end
| {
"pile_set_name": "Github"
} |
# Copyright (C) 2014 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
def SplitStream(stream, fnProcessLine, fnLineOutsideChunk):
""" Reads the given input stream and splits it into chunks based on
information extracted from individual lines.
Arguments:
- fnProcessLine: Called on each line with the text and line number. Must
return a triplet, composed of the name of the chunk started on this line,
the data extracted, and the name of the architecture this test applies to
(or None to indicate that all architectures should run this test).
- fnLineOutsideChunk: Called on attempt to attach data prior to creating
a chunk.
"""
lineNo = 0
allChunks = []
currentChunk = None
for line in stream:
lineNo += 1
line = line.strip()
if not line:
continue
# Let the child class process the line and return information about it.
# The _processLine method can modify the content of the line (or delete it
# entirely) and specify whether it starts a new group.
processedLine, newChunkName, testArch = fnProcessLine(line, lineNo)
# Currently, only a full chunk can be specified as architecture-specific.
assert testArch is None or newChunkName is not None
if newChunkName is not None:
currentChunk = (newChunkName, [], lineNo, testArch)
allChunks.append(currentChunk)
if processedLine is not None:
if currentChunk is not None:
currentChunk[1].append(processedLine)
else:
fnLineOutsideChunk(line, lineNo)
return allChunks
| {
"pile_set_name": "Github"
} |
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>Uses of Class com.sun.net.httpserver.Authenticator.Failure (Java SE 12 & JDK 12 )</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class com.sun.net.httpserver.Authenticator.Failure (Java SE 12 & JDK 12 )";
}
}
catch(err) {
}
//-->
var pathtoroot = "../../../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../index.html">Overview</a></li>
<li><a href="../../../../../module-summary.html">Module</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../Authenticator.Failure.html" title="class in com.sun.net.httpserver">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><div style="margin-top: 14px;"><strong>Java SE 12 & JDK 12</strong> </div></div>
</div>
<div class="subNav">
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding"> </div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<main role="main">
<div class="header">
<h2 title="Uses of Class com.sun.net.httpserver.Authenticator.Failure" class="title">Uses of Class<br>com.sun.net.httpserver.Authenticator.Failure</h2>
</div>
<div class="classUseContainer">No usage of com.sun.net.httpserver.Authenticator.Failure</div>
</main>
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../index.html">Overview</a></li>
<li><a href="../../../../../module-summary.html">Module</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../Authenticator.Failure.html" title="class in com.sun.net.httpserver">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><div style="margin-top: 14px;"><strong>Java SE 12 & JDK 12</strong> </div></div>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small><a href="https://bugreport.java.com/bugreport/">Report a bug or suggest an enhancement</a><br> For further API reference and developer documentation see the <a href="https://docs.oracle.com/pls/topic/lookup?ctx=javase12.0.2&id=homepage" target="_blank">Java SE Documentation</a>, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.<br> Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.<br> <a href="../../../../../../../legal/copyright.html">Copyright</a> © 1993, 2019, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.<br>All rights reserved. Use is subject to <a href="https://www.oracle.com/technetwork/java/javase/terms/license/java12.0.2speclicense.html">license terms</a> and the <a href="https://www.oracle.com/technetwork/java/redist-137594.html">documentation redistribution policy</a>. <!-- Version 12.0.2+10 --></small></p>
</footer>
</body>
</html>
| {
"pile_set_name": "Github"
} |
<Workspace Version="0.6.3.7375" X="25.7568511889424" Y="-12.0600006018043" zoom="0.795506748218387" Description="" Category="" Name="Home">
<Elements>
<Dynamo.Nodes.FormElementBySelection type="Dynamo.Nodes.FormElementBySelection" guid="1a39f421-00cf-4d0a-8d43-a9ab4312829d" nickname="Select Face" x="5.33389417570697" y="336.461412623619" isVisible="true" isUpstreamVisible="true" lacing="Disabled" faceRef="411def96-34e9-4877-8c19-0a3361b583c2-0003bdd2:2:SURFACE" />
<Dynamo.Nodes.Function type="Dynamo.Nodes.Function" guid="baa3514f-28aa-4021-a70a-41ec0fa9b98d" nickname="UV/XYZ Grid From Face" x="376.3699898845" y="341.415211212729" isVisible="true" isUpstreamVisible="true" lacing="Disabled">
<ID value="2da1e687-e083-4273-9058-e3906ff985a4" />
<Name value="UV/XYZ Grid From Face" />
<Description value="Returns UV coordinates, XYZ coordinates and normals for a face with UV subdivision" />
<Inputs>
<Input value="face" />
<Input value="U" />
<Input value="V" />
</Inputs>
<Outputs>
<Output value="XYZs" />
<Output value="Normals" />
<Output value="UVs" />
</Outputs>
</Dynamo.Nodes.Function>
<Dynamo.Nodes.FamilyTypeSelector type="Dynamo.Nodes.FamilyTypeSelector" guid="8e9c267d-9028-4844-9d3d-afb09a6839e8" nickname="Select Family Type" x="5.33389417570697" y="772.088681406822" isVisible="true" isUpstreamVisible="true" lacing="Disabled" index="4" />
<Dynamo.Nodes.BoolSelector type="Dynamo.Nodes.BoolSelector" guid="f587de81-71cd-4e3b-87fa-a3ce513e5b7e" nickname="Reverse" x="5.33389417570697" y="609.172014740155" isVisible="true" isUpstreamVisible="true" lacing="Disabled">
<System.Boolean value="False" />
</Dynamo.Nodes.BoolSelector>
<Dynamo.Nodes.IntegerSliderInput type="Dynamo.Nodes.IntegerSliderInput" guid="3f653ca4-eb83-4201-bf6a-c8a6ae7f02e3" nickname="U" x="5.33389417570697" y="430.509031671238" isVisible="true" isUpstreamVisible="true" lacing="Disabled">
<System.Int32 value="16" min="0" max="20" />
</Dynamo.Nodes.IntegerSliderInput>
<Dynamo.Nodes.IntegerSliderInput type="Dynamo.Nodes.IntegerSliderInput" guid="c6ce8489-9e2b-4ed3-a3dc-4bb9e0c31a29" nickname="V" x="5.33389417570697" y="506.223317385524" isVisible="true" isUpstreamVisible="true" lacing="Disabled">
<System.Int32 value="4" min="0" max="20" />
</Dynamo.Nodes.IntegerSliderInput>
<Dynamo.Nodes.IntegerSliderInput type="Dynamo.Nodes.IntegerSliderInput" guid="5f3ebbc2-407b-4105-94e1-ac90099248b6" nickname="Shift" x="5.33389417570697" y="686.656141724282" isVisible="true" isUpstreamVisible="true" lacing="Disabled">
<System.Int32 value="0" min="0" max="3" />
</Dynamo.Nodes.IntegerSliderInput>
<Dynamo.Nodes.AdaptiveComponentByUvsOnFace type="Dynamo.Nodes.AdaptiveComponentByUvsOnFace" guid="df39693e-5692-49f2-bcb0-a68be6a05840" nickname="Adaptive Component by UVs on Face" x="1165.83379408699" y="628.386366700292" isVisible="true" isUpstreamVisible="true" lacing="Longest">
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bdd4</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bddb</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bde2</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bde9</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bdf0</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bdf7</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bdfe</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be05</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be0c</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be13</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be1a</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be21</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be28</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be2f</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be36</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be3d</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be44</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be4b</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be52</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be59</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be60</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be67</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be6e</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be75</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be7c</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be83</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be8a</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be91</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be98</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003be9f</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bea6</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bead</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003beb4</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bebb</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bec2</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bec9</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bed0</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bed7</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bede</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bee5</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003beec</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bef3</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003befa</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bf01</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bf08</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bf0f</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bf16</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bf1d</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bf24</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bf2b</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bf32</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bf39</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bf40</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bf47</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bf4e</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bf55</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bf5c</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bf63</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bf6a</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bf71</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bf78</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bf7f</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bf86</Element>
</Run>
<Run>
<Element>c14d2b77-c1d3-4880-a55c-2e4f0a6eecdd-0003bf8d</Element>
</Run>
</Dynamo.Nodes.AdaptiveComponentByUvsOnFace>
<Dynamo.Nodes.Function type="Dynamo.Nodes.Function" guid="8b22de1d-49ff-4bf1-b7e5-71275ca6c45a" nickname="Quadrilateral Pattern From Grid" x="664.421923322351" y="624.792734814565" isVisible="true" isUpstreamVisible="true" lacing="Disabled">
<ID value="bb451a28-77b5-4e67-b562-0ad960c6abd8" />
<Name value="Quadrilateral Pattern From Grid" />
<Description value="Creates groups of points from a list of UVs or XYZs for the placement of quadrilateral panels. The placement pattern can be reversed (boolean) and shifted (integer)." />
<Inputs>
<Input value="list" />
<Input value="V" />
<Input value="reverse?" />
<Input value="shift placement" />
</Inputs>
<Outputs>
<Output value="list" />
</Outputs>
</Dynamo.Nodes.Function>
<Dynamo.Nodes.SunPathDirection type="Dynamo.Nodes.SunPathDirection" guid="f52e8707-19a5-417c-a769-cfc9f226adf8" nickname="SunPath Direction" x="5.33389417570697" y="205.309901822453" isVisible="true" isUpstreamVisible="true" lacing="Disabled">
<instance id="230266" />
</Dynamo.Nodes.SunPathDirection>
<Dynamo.Nodes.Function type="Dynamo.Nodes.Function" guid="e6e8d225-df40-4ce1-9c62-8fe020603866" nickname="Altitude And Azimuth From Vector" x="820.431708212301" y="201.980521354844" isVisible="true" isUpstreamVisible="true" lacing="Disabled">
<ID value="1e4729d4-4868-4859-94df-65d0eb8a1eea" />
<Name value="Altitude And Azimuth From Vector" />
<Description value="Computes the altitude and azimuth of a given vector" />
<Inputs>
<Input value="XYZ" />
<Input value="Deg/Rad" />
</Inputs>
<Outputs>
<Output value="Altitude" />
<Output value="Azimuth" />
</Outputs>
</Dynamo.Nodes.Function>
<Dynamo.Nodes.BoolSelector type="Dynamo.Nodes.BoolSelector" guid="23fe9ef3-9391-4a50-a1e1-11d5a8c18caa" nickname="Boolean" x="677.574907922302" y="271.13089755201" isVisible="true" isUpstreamVisible="true" lacing="Disabled">
<System.Boolean value="False" />
</Dynamo.Nodes.BoolSelector>
<Dynamo.Nodes.Function type="Dynamo.Nodes.Function" guid="27623e70-2e39-46e8-bf89-e855b4ececfe" nickname="Quadrilateral Pattern From Grid" x="666.549324717451" y="485.496613452304" isVisible="true" isUpstreamVisible="true" lacing="Disabled">
<ID value="bb451a28-77b5-4e67-b562-0ad960c6abd8" />
<Name value="Quadrilateral Pattern From Grid" />
<Description value="Creates groups of points from a list of UVs or XYZs for the placement of quadrilateral panels. The placement pattern can be reversed (boolean) and shifted (integer)." />
<Inputs>
<Input value="list" />
<Input value="V" />
<Input value="reverse?" />
<Input value="shift placement" />
</Inputs>
<Outputs>
<Output value="list" />
</Outputs>
</Dynamo.Nodes.Function>
<Dynamo.Nodes.Map type="Dynamo.Nodes.Map" guid="1afc279f-1447-4c53-8f4f-863d49e69386" nickname="Map" x="899.417111723643" y="430.613598971372" isVisible="true" isUpstreamVisible="true" lacing="Disabled" />
<Dynamo.Nodes.XyzAverage type="Dynamo.Nodes.XyzAverage" guid="514956ee-893e-4c60-bf9f-766c42450328" nickname="Average XYZs" x="748.077038656075" y="399.951209220148" isVisible="true" isUpstreamVisible="true" lacing="Longest" />
<Dynamo.Nodes.Function type="Dynamo.Nodes.Function" guid="4c061481-b731-4f66-ada8-d29672b2523f" nickname="Altitude And Azimuth From Vector" x="822.25879057598" y="300.25549619421" isVisible="true" isUpstreamVisible="true" lacing="Disabled">
<ID value="1e4729d4-4868-4859-94df-65d0eb8a1eea" />
<Name value="Altitude And Azimuth From Vector" />
<Description value="Computes the altitude and azimuth of a given vector" />
<Inputs>
<Input value="XYZ" />
<Input value="Deg/Rad" />
</Inputs>
<Outputs>
<Output value="Altitude" />
<Output value="Azimuth" />
</Outputs>
</Dynamo.Nodes.Function>
<Dynamo.Nodes.Subtraction type="Dynamo.Nodes.Subtraction" guid="dfd0efcd-f2c2-4244-8449-8c32c0601032" nickname="Subtract" x="1275.34583817333" y="286.468873140393" isVisible="true" isUpstreamVisible="true" lacing="Longest" />
<Dynamo.Nodes.Map type="Dynamo.Nodes.Map" guid="2d30dad8-95cf-4976-902a-b9897c788e1b" nickname="Map" x="1094.54124123396" y="373.175877931311" isVisible="true" isUpstreamVisible="true" lacing="Disabled" />
<Dynamo.Nodes.FamilyInstanceParameterSetter type="Dynamo.Nodes.FamilyInstanceParameterSetter" guid="162077a1-501d-4b32-967f-083e3227893c" nickname="Set Element Parameter" x="1460.88527682728" y="451.907396840241" isVisible="true" isUpstreamVisible="true" lacing="Longest">
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
<Run />
</Dynamo.Nodes.FamilyInstanceParameterSetter>
<Dynamo.Nodes.StringInput type="Dynamo.Nodes.StringInput" guid="0f0b4a5e-519d-45f0-8ae8-297a1eaf8a99" nickname="Parameter Name" x="5.33389417570697" y="850.668746782628" isVisible="true" isUpstreamVisible="true" lacing="Disabled">
<System.String value="azimuth_delta" />
</Dynamo.Nodes.StringInput>
</Elements>
<Connectors>
<Dynamo.Models.ConnectorModel start="1a39f421-00cf-4d0a-8d43-a9ab4312829d" start_index="0" end="baa3514f-28aa-4021-a70a-41ec0fa9b98d" end_index="0" portType="0" />
<Dynamo.Models.ConnectorModel start="1a39f421-00cf-4d0a-8d43-a9ab4312829d" start_index="0" end="df39693e-5692-49f2-bcb0-a68be6a05840" end_index="1" portType="0" />
<Dynamo.Models.ConnectorModel start="baa3514f-28aa-4021-a70a-41ec0fa9b98d" start_index="1" end="27623e70-2e39-46e8-bf89-e855b4ececfe" end_index="0" portType="0" />
<Dynamo.Models.ConnectorModel start="baa3514f-28aa-4021-a70a-41ec0fa9b98d" start_index="2" end="8b22de1d-49ff-4bf1-b7e5-71275ca6c45a" end_index="0" portType="0" />
<Dynamo.Models.ConnectorModel start="8e9c267d-9028-4844-9d3d-afb09a6839e8" start_index="0" end="df39693e-5692-49f2-bcb0-a68be6a05840" end_index="2" portType="0" />
<Dynamo.Models.ConnectorModel start="f587de81-71cd-4e3b-87fa-a3ce513e5b7e" start_index="0" end="8b22de1d-49ff-4bf1-b7e5-71275ca6c45a" end_index="2" portType="0" />
<Dynamo.Models.ConnectorModel start="f587de81-71cd-4e3b-87fa-a3ce513e5b7e" start_index="0" end="27623e70-2e39-46e8-bf89-e855b4ececfe" end_index="2" portType="0" />
<Dynamo.Models.ConnectorModel start="3f653ca4-eb83-4201-bf6a-c8a6ae7f02e3" start_index="0" end="baa3514f-28aa-4021-a70a-41ec0fa9b98d" end_index="1" portType="0" />
<Dynamo.Models.ConnectorModel start="c6ce8489-9e2b-4ed3-a3dc-4bb9e0c31a29" start_index="0" end="baa3514f-28aa-4021-a70a-41ec0fa9b98d" end_index="2" portType="0" />
<Dynamo.Models.ConnectorModel start="c6ce8489-9e2b-4ed3-a3dc-4bb9e0c31a29" start_index="0" end="8b22de1d-49ff-4bf1-b7e5-71275ca6c45a" end_index="1" portType="0" />
<Dynamo.Models.ConnectorModel start="c6ce8489-9e2b-4ed3-a3dc-4bb9e0c31a29" start_index="0" end="27623e70-2e39-46e8-bf89-e855b4ececfe" end_index="1" portType="0" />
<Dynamo.Models.ConnectorModel start="5f3ebbc2-407b-4105-94e1-ac90099248b6" start_index="0" end="8b22de1d-49ff-4bf1-b7e5-71275ca6c45a" end_index="3" portType="0" />
<Dynamo.Models.ConnectorModel start="5f3ebbc2-407b-4105-94e1-ac90099248b6" start_index="0" end="27623e70-2e39-46e8-bf89-e855b4ececfe" end_index="3" portType="0" />
<Dynamo.Models.ConnectorModel start="df39693e-5692-49f2-bcb0-a68be6a05840" start_index="0" end="162077a1-501d-4b32-967f-083e3227893c" end_index="0" portType="0" />
<Dynamo.Models.ConnectorModel start="8b22de1d-49ff-4bf1-b7e5-71275ca6c45a" start_index="0" end="df39693e-5692-49f2-bcb0-a68be6a05840" end_index="0" portType="0" />
<Dynamo.Models.ConnectorModel start="f52e8707-19a5-417c-a769-cfc9f226adf8" start_index="0" end="e6e8d225-df40-4ce1-9c62-8fe020603866" end_index="0" portType="0" />
<Dynamo.Models.ConnectorModel start="e6e8d225-df40-4ce1-9c62-8fe020603866" start_index="1" end="dfd0efcd-f2c2-4244-8449-8c32c0601032" end_index="0" portType="0" />
<Dynamo.Models.ConnectorModel start="23fe9ef3-9391-4a50-a1e1-11d5a8c18caa" start_index="0" end="e6e8d225-df40-4ce1-9c62-8fe020603866" end_index="1" portType="0" />
<Dynamo.Models.ConnectorModel start="23fe9ef3-9391-4a50-a1e1-11d5a8c18caa" start_index="0" end="4c061481-b731-4f66-ada8-d29672b2523f" end_index="1" portType="0" />
<Dynamo.Models.ConnectorModel start="27623e70-2e39-46e8-bf89-e855b4ececfe" start_index="0" end="1afc279f-1447-4c53-8f4f-863d49e69386" end_index="1" portType="0" />
<Dynamo.Models.ConnectorModel start="1afc279f-1447-4c53-8f4f-863d49e69386" start_index="0" end="2d30dad8-95cf-4976-902a-b9897c788e1b" end_index="1" portType="0" />
<Dynamo.Models.ConnectorModel start="514956ee-893e-4c60-bf9f-766c42450328" start_index="0" end="1afc279f-1447-4c53-8f4f-863d49e69386" end_index="0" portType="0" />
<Dynamo.Models.ConnectorModel start="4c061481-b731-4f66-ada8-d29672b2523f" start_index="1" end="2d30dad8-95cf-4976-902a-b9897c788e1b" end_index="0" portType="0" />
<Dynamo.Models.ConnectorModel start="dfd0efcd-f2c2-4244-8449-8c32c0601032" start_index="0" end="162077a1-501d-4b32-967f-083e3227893c" end_index="2" portType="0" />
<Dynamo.Models.ConnectorModel start="2d30dad8-95cf-4976-902a-b9897c788e1b" start_index="0" end="dfd0efcd-f2c2-4244-8449-8c32c0601032" end_index="1" portType="0" />
<Dynamo.Models.ConnectorModel start="0f0b4a5e-519d-45f0-8ae8-297a1eaf8a99" start_index="0" end="162077a1-501d-4b32-967f-083e3227893c" end_index="1" portType="0" />
</Connectors>
<Notes>
<Dynamo.Models.NoteModel text="Compute altitude and azimuth for the sun's current position and for each panel's average surface normal. 
This example is made for vertical louvers - if you are designing horizontal shading devices, use the altitude outputs instead." x="783.502412527352" y="86.1811921857714" />
<Dynamo.Models.NoteModel text="REQUIRED PACKAGES:

- Altitude And Azimuth From Vector
- Simple Patterning
- XYZ Grid From Face" x="324.44277639429" y="12.1506714852864" />
<Dynamo.Models.NoteModel text="This definition populates the surface of a mass with quadrilateral curtain wall panels and computes the average surface normal of each panel. It then writes the delta between the sun's altitude and azimuth and the repective panel normals into each respective panel. This workflow could be used to animate panels that keep rotating in order to stay perpendicular to the sun rays.

For questions email me at [email protected]" x="7.48328883108388" y="13.3961767953386" />
<Dynamo.Models.NoteModel text="Find average surface normal for each panel" x="874.891899637736" y="524.118201606359" />
<Dynamo.Models.NoteModel text="For each panel, find the delta to the sun's altitude and azimuth and write it to the chosen family parameter." x="1382.63083579296" y="379.598051013058" />
</Notes>
</Workspace> | {
"pile_set_name": "Github"
} |
{
"_from": "string-width@^1.0.1",
"_id": "[email protected]",
"_inBundle": false,
"_integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"_location": "/string-width",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "string-width@^1.0.1",
"name": "string-width",
"escapedName": "string-width",
"rawSpec": "^1.0.1",
"saveSpec": null,
"fetchSpec": "^1.0.1"
},
"_requiredBy": [
"/cliui",
"/wrap-ansi",
"/yargs"
],
"_resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"_shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3",
"_spec": "string-width@^1.0.1",
"_where": "C:\\Users\\Administrator\\Desktop\\GameFramework\\node_modules\\yargs",
"author": {
"name": "Sindre Sorhus",
"email": "[email protected]",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/string-width/issues"
},
"bundleDependencies": false,
"dependencies": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
"strip-ansi": "^3.0.0"
},
"deprecated": false,
"description": "Get the visual width of a string - the number of columns required to display it",
"devDependencies": {
"ava": "*",
"xo": "*"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"homepage": "https://github.com/sindresorhus/string-width#readme",
"keywords": [
"string",
"str",
"character",
"char",
"unicode",
"width",
"visual",
"column",
"columns",
"fullwidth",
"full-width",
"full",
"ansi",
"escape",
"codes",
"cli",
"command-line",
"terminal",
"console",
"cjk",
"chinese",
"japanese",
"korean",
"fixed-width"
],
"license": "MIT",
"name": "string-width",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/string-width.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "1.0.2"
}
| {
"pile_set_name": "Github"
} |
#!/bin/sh
# 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.
export LOADER_PATH="/opt/syncope/conf,/opt/syncope/lib"
java -Dfile.encoding=UTF-8 -server -Xms1536m -Xmx1536m -XX:NewSize=256m -XX:MaxNewSize=256m \
-XX:+DisableExplicitGC -Djava.security.egd=file:/dev/./urandom -jar /opt/syncope/lib/syncope-wa.war
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) Enalean, 2018. All Rights Reserved.
*
* This file is a part of Tuleap.
*
* Tuleap is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Tuleap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tuleap. If not, see <http://www.gnu.org/licenses/>.
*/
import { getBranches, createPullrequest } from "../api/rest-querier.js";
import { redirectTo } from "../helpers/window-helper.js";
export async function init(
context,
{ repository_id, project_id, parent_repository_id, parent_repository_name, parent_project_id }
) {
try {
const branches = (await getBranches(repository_id)).map(extendBranch);
context.commit("setSourceBranches", branches);
if (parent_repository_id) {
const parent_repository_branches = (await getBranches(parent_repository_id)).map(
extendBranchForParent
);
context.commit("setDestinationBranches", branches.concat(parent_repository_branches));
} else {
context.commit("setDestinationBranches", branches);
}
} catch (e) {
context.commit("setHasErrorWhileLoadingBranchesToTrue");
}
function extendBranch(branch) {
return {
display_name: branch.name,
repository_id,
project_id,
...branch,
};
}
function extendBranchForParent(branch) {
return {
display_name: `${parent_repository_name} : ${branch.name}`,
repository_id: parent_repository_id,
project_id: parent_project_id,
...branch,
};
}
}
export async function create(context, { source_branch, destination_branch }) {
try {
context.commit("setIsCreatinPullRequest", true);
const pullrequest = await createPullrequest(
source_branch.repository_id,
source_branch.name,
destination_branch.repository_id,
destination_branch.name
);
redirectTo(
`/plugins/git/?action=pull-requests&repo_id=${destination_branch.repository_id}&group_id=${destination_branch.project_id}#/pull-requests/${pullrequest.id}/overview`
);
} catch (e) {
const { error } = await e.response.json();
context.commit("setCreateErrorMessage", error.message);
context.commit("setIsCreatinPullRequest", false);
}
}
| {
"pile_set_name": "Github"
} |
// (C) Copyright John Maddock 2007.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// This file is machine generated, do not edit by hand
// Polynomial evaluation using second order Horners rule
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_7_HPP
#define BOOST_MATH_TOOLS_RAT_EVAL_7_HPP
namespace boost{ namespace math{ namespace tools{ namespace detail{
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(0);
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
V t[4];
t[0] = a[4] * x2 + a[2];
t[1] = a[3] * x2 + a[1];
t[2] = b[4] * x2 + b[2];
t[3] = b[3] * x2 + b[1];
t[0] *= x2;
t[2] *= x2;
t[0] += static_cast<V>(a[0]);
t[2] += static_cast<V>(b[0]);
t[1] *= x;
t[3] *= x;
return (t[0] + t[1]) / (t[2] + t[3]);
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
V t[4];
t[0] = a[0] * z2 + a[2];
t[1] = a[1] * z2 + a[3];
t[2] = b[0] * z2 + b[2];
t[3] = b[1] * z2 + b[3];
t[0] *= z2;
t[2] *= z2;
t[0] += static_cast<V>(a[4]);
t[2] += static_cast<V>(b[4]);
t[1] *= z;
t[3] *= z;
return (t[0] + t[1]) / (t[2] + t[3]);
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
V t[4];
t[0] = a[5] * x2 + a[3];
t[1] = a[4] * x2 + a[2];
t[2] = b[5] * x2 + b[3];
t[3] = b[4] * x2 + b[2];
t[0] *= x2;
t[1] *= x2;
t[2] *= x2;
t[3] *= x2;
t[0] += static_cast<V>(a[1]);
t[1] += static_cast<V>(a[0]);
t[2] += static_cast<V>(b[1]);
t[3] += static_cast<V>(b[0]);
t[0] *= x;
t[2] *= x;
return (t[0] + t[1]) / (t[2] + t[3]);
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
V t[4];
t[0] = a[0] * z2 + a[2];
t[1] = a[1] * z2 + a[3];
t[2] = b[0] * z2 + b[2];
t[3] = b[1] * z2 + b[3];
t[0] *= z2;
t[1] *= z2;
t[2] *= z2;
t[3] *= z2;
t[0] += static_cast<V>(a[4]);
t[1] += static_cast<V>(a[5]);
t[2] += static_cast<V>(b[4]);
t[3] += static_cast<V>(b[5]);
t[0] *= z;
t[2] *= z;
return (t[0] + t[1]) / (t[2] + t[3]);
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
V t[4];
t[0] = a[6] * x2 + a[4];
t[1] = a[5] * x2 + a[3];
t[2] = b[6] * x2 + b[4];
t[3] = b[5] * x2 + b[3];
t[0] *= x2;
t[1] *= x2;
t[2] *= x2;
t[3] *= x2;
t[0] += static_cast<V>(a[2]);
t[1] += static_cast<V>(a[1]);
t[2] += static_cast<V>(b[2]);
t[3] += static_cast<V>(b[1]);
t[0] *= x2;
t[2] *= x2;
t[0] += static_cast<V>(a[0]);
t[2] += static_cast<V>(b[0]);
t[1] *= x;
t[3] *= x;
return (t[0] + t[1]) / (t[2] + t[3]);
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
V t[4];
t[0] = a[0] * z2 + a[2];
t[1] = a[1] * z2 + a[3];
t[2] = b[0] * z2 + b[2];
t[3] = b[1] * z2 + b[3];
t[0] *= z2;
t[1] *= z2;
t[2] *= z2;
t[3] *= z2;
t[0] += static_cast<V>(a[4]);
t[1] += static_cast<V>(a[5]);
t[2] += static_cast<V>(b[4]);
t[3] += static_cast<V>(b[5]);
t[0] *= z2;
t[2] *= z2;
t[0] += static_cast<V>(a[6]);
t[2] += static_cast<V>(b[6]);
t[1] *= z;
t[3] *= z;
return (t[0] + t[1]) / (t[2] + t[3]);
}
}
}}}} // namespaces
#endif // include guard
| {
"pile_set_name": "Github"
} |
/*
Copyright 2005-2014 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. Threading Building Blocks is free software;
you can redistribute it and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. Threading Building Blocks is
distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details. You should have received a copy of
the GNU General Public License along with Threading Building Blocks; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
As a special exception, you may use this file as part of a free software library without
restriction. Specifically, if other files instantiate templates or use macros or inline
functions from this file, or you compile this file and link it with other files to produce
an executable, this file does not by itself cause the resulting executable to be covered
by the GNU General Public License. This exception does not however invalidate any other
reasons why the executable file might be covered by the GNU General Public License.
*/
#ifndef _TBB_tbb_misc_H
#define _TBB_tbb_misc_H
#include "tbb/tbb_stddef.h"
#include "tbb/tbb_machine.h"
#include "tbb/atomic.h" // For atomic_xxx definitions
#if __linux__ || __FreeBSD__
#include <sys/param.h> // __FreeBSD_version
#if __FreeBSD_version >= 701000
#include <sys/cpuset.h>
#endif
#endif
// Does the operating system have a system call to pin a thread to a set of OS processors?
#define __TBB_OS_AFFINITY_SYSCALL_PRESENT ((__linux__ && !__ANDROID__) || (__FreeBSD_version >= 701000))
// On IBM* Blue Gene* CNK nodes, the affinity API has restrictions that prevent its usability for TBB,
// and also sysconf(_SC_NPROCESSORS_ONLN) already takes process affinity into account.
#define __TBB_USE_OS_AFFINITY_SYSCALL (__TBB_OS_AFFINITY_SYSCALL_PRESENT && !__bg__)
namespace tbb {
namespace internal {
const size_t MByte = 1024*1024;
#if __TBB_WIN8UI_SUPPORT
// In Win8UI mode, TBB uses a thread creation API that does not allow to specify the stack size.
// Still, the thread stack size value, either explicit or default, is used by the scheduler.
// So here we set the default value to match the platform's default of 1MB.
const size_t ThreadStackSize = 1*MByte;
#else
const size_t ThreadStackSize = (sizeof(uintptr_t) <= 4 ? 2 : 4 )*MByte;
#endif
#ifndef __TBB_HardwareConcurrency
//! Returns maximal parallelism level supported by the current OS configuration.
int AvailableHwConcurrency();
#else
inline int AvailableHwConcurrency() {
int n = __TBB_HardwareConcurrency();
return n > 0 ? n : 1; // Fail safety strap
}
#endif /* __TBB_HardwareConcurrency */
#if _WIN32||_WIN64
//! Returns number of processor groups in the current OS configuration.
/** AvailableHwConcurrency must be called at least once before calling this method. **/
int NumberOfProcessorGroups();
//! Retrieves index of processor group containing processor with the given index
int FindProcessorGroupIndex ( int processorIndex );
//! Affinitizes the thread to the specified processor group
void MoveThreadIntoProcessorGroup( void* hThread, int groupIndex );
#endif /* _WIN32||_WIN64 */
//! Throws std::runtime_error with what() returning error_code description prefixed with aux_info
void handle_win_error( int error_code );
//! True if environment variable with given name is set and not 0; otherwise false.
bool GetBoolEnvironmentVariable( const char * name );
//! Prints TBB version information on stderr
void PrintVersion();
//! Prints arbitrary extra TBB version information on stderr
void PrintExtraVersionInfo( const char* category, const char* format, ... );
//! A callback routine to print RML version information on stderr
void PrintRMLVersionInfo( void* arg, const char* server_info );
// For TBB compilation only; not to be used in public headers
#if defined(min) || defined(max)
#undef min
#undef max
#endif
//! Utility template function returning lesser of the two values.
/** Provided here to avoid including not strict safe <algorithm>.\n
In case operands cause signed/unsigned or size mismatch warnings it is caller's
responsibility to do the appropriate cast before calling the function. **/
template<typename T1, typename T2>
T1 min ( const T1& val1, const T2& val2 ) {
return val1 < val2 ? val1 : val2;
}
//! Utility template function returning greater of the two values.
/** Provided here to avoid including not strict safe <algorithm>.\n
In case operands cause signed/unsigned or size mismatch warnings it is caller's
responsibility to do the appropriate cast before calling the function. **/
template<typename T1, typename T2>
T1 max ( const T1& val1, const T2& val2 ) {
return val1 < val2 ? val2 : val1;
}
//! Utility helper structure to ease overload resolution
template<int > struct int_to_type {};
//------------------------------------------------------------------------
// FastRandom
//------------------------------------------------------------------------
/** Defined in tbb_main.cpp **/
unsigned GetPrime ( unsigned seed );
//! A fast random number generator.
/** Uses linear congruential method. */
class FastRandom {
private:
#if __TBB_OLD_PRIMES_RNG
unsigned x, a;
static const unsigned c = 1;
#else
unsigned x, c;
static const unsigned a = 0x9e3779b1; // a big prime number
#endif //__TBB_OLD_PRIMES_RNG
public:
//! Get a random number.
unsigned short get() {
return get(x);
}
//! Get a random number for the given seed; update the seed for next use.
unsigned short get( unsigned& seed ) {
unsigned short r = (unsigned short)(seed>>16);
__TBB_ASSERT(c&1, "c must be odd for big rng period");
seed = seed*a+c;
return r;
}
//! Construct a random number generator.
FastRandom( void* unique_ptr ) { init(uintptr_t(unique_ptr)); }
FastRandom( uint32_t seed) { init(seed); }
FastRandom( uint64_t seed) { init(seed); }
template <typename T>
void init( T seed ) {
init(seed,int_to_type<sizeof(seed)>());
}
void init( uint64_t seed , int_to_type<8> ) {
init(uint32_t((seed>>32)+seed), int_to_type<4>());
}
void init( uint32_t seed, int_to_type<4> ) {
#if __TBB_OLD_PRIMES_RNG
x = seed;
a = GetPrime( seed );
#else
// threads use different seeds for unique sequences
c = (seed|1)*0xba5703f5; // c must be odd, shuffle by a prime number
x = c^(seed>>1); // also shuffle x for the first get() invocation
#endif
}
};
//------------------------------------------------------------------------
// Atomic extensions
//------------------------------------------------------------------------
//! Atomically replaces value of dst with newValue if they satisfy condition of compare predicate
/** Return value semantics is the same as for CAS. **/
template<typename T1, typename T2, class Pred>
T1 atomic_update ( tbb::atomic<T1>& dst, T2 newValue, Pred compare ) {
T1 oldValue = dst;
while ( compare(oldValue, newValue) ) {
if ( dst.compare_and_swap((T1)newValue, oldValue) == oldValue )
break;
oldValue = dst;
}
return oldValue;
}
//! One-time initialization states
enum do_once_state {
do_once_uninitialized = 0, ///< No execution attempts have been undertaken yet
do_once_pending, ///< A thread is executing associated do-once routine
do_once_executed, ///< Do-once routine has been executed
initialization_complete = do_once_executed ///< Convenience alias
};
//! One-time initialization function
/** /param initializer Pointer to function without arguments
The variant that returns bool is used for cases when initialization can fail
and it is OK to continue execution, but the state should be reset so that
the initialization attempt was repeated the next time.
/param state Shared state associated with initializer that specifies its
initialization state. Must be initially set to #uninitialized value
(e.g. by means of default static zero initialization). **/
template <typename F>
void atomic_do_once ( const F& initializer, atomic<do_once_state>& state ) {
// tbb::atomic provides necessary acquire and release fences.
// The loop in the implementation is necessary to avoid race when thread T2
// that arrived in the middle of initialization attempt by another thread T1
// has just made initialization possible.
// In such a case T2 has to rely on T1 to initialize, but T1 may already be past
// the point where it can recognize the changed conditions.
while ( state != do_once_executed ) {
if( state == do_once_uninitialized ) {
if( state.compare_and_swap( do_once_pending, do_once_uninitialized ) == do_once_uninitialized ) {
run_initializer( initializer, state );
break;
}
}
spin_wait_while_eq( state, do_once_pending );
}
}
// Run the initializer which can not fail
inline void run_initializer( void (*f)(), atomic<do_once_state>& state ) {
f();
state = do_once_executed;
}
// Run the initializer which can require repeated call
inline void run_initializer( bool (*f)(), atomic<do_once_state>& state ) {
state = f() ? do_once_executed : do_once_uninitialized;
}
#if __TBB_USE_OS_AFFINITY_SYSCALL
#if __linux__
typedef cpu_set_t basic_mask_t;
#elif __FreeBSD_version >= 701000
typedef cpuset_t basic_mask_t;
#else
#error affinity_helper is not implemented in this OS
#endif
class affinity_helper : no_copy {
basic_mask_t* threadMask;
int is_changed;
public:
affinity_helper() : threadMask(NULL), is_changed(0) {}
~affinity_helper();
void protect_affinity_mask();
};
#else
class affinity_helper : no_copy {
public:
void protect_affinity_mask() {}
};
#endif /* __TBB_USE_OS_AFFINITY_SYSCALL */
extern bool cpu_has_speculation();
} // namespace internal
} // namespace tbb
#endif /* _TBB_tbb_misc_H */
| {
"pile_set_name": "Github"
} |
/*
Copyright 2015 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package generator_test
import (
"bytes"
"strings"
"testing"
"k8s.io/gengo/generator"
"k8s.io/gengo/namer"
"k8s.io/gengo/parser"
)
func construct(t *testing.T, files map[string]string) *generator.Context {
b := parser.New()
for name, src := range files {
if err := b.AddFileForTest("/tmp/"+name, name, []byte(src)); err != nil {
t.Fatal(err)
}
}
c, err := generator.NewContext(b, namer.NameSystems{
"public": namer.NewPublicNamer(0),
"private": namer.NewPrivateNamer(0),
}, "public")
if err != nil {
t.Fatal(err)
}
return c
}
func TestSnippetWriter(t *testing.T) {
var structTest = map[string]string{
"base/foo/proto/foo.go": `
package foo
// Blah is a test.
// A test, I tell you.
type Blah struct {
// A is the first field.
A int64 ` + "`" + `json:"a"` + "`" + `
// B is the second field.
// Multiline comments work.
B string ` + "`" + `json:"b"` + "`" + `
}
`,
}
c := construct(t, structTest)
b := &bytes.Buffer{}
err := generator.NewSnippetWriter(b, c, "$", "$").
Do("$.|public$$.|private$", c.Order[0]).
Error()
if err != nil {
t.Errorf("Unexpected error %v", err)
}
if e, a := "Blahblah", b.String(); e != a {
t.Errorf("Expected %q, got %q", e, a)
}
err = generator.NewSnippetWriter(b, c, "$", "$").
Do("$.|public", c.Order[0]).
Error()
if err == nil {
t.Errorf("expected error on invalid template")
} else {
// Dear reader, I apologize for making the worst change
// detection test in the history of ever.
if e, a := "snippet_writer_test.go", err.Error(); !strings.Contains(a, e) {
t.Errorf("Expected %q but didn't find it in %q", e, a)
}
}
}
| {
"pile_set_name": "Github"
} |
/* =========================================================================
zhttp_private_selftest.c - run private classes selftests
Runs all private classes selftests.
-------------------------------------------------------------------------
Copyright (c) the Contributors as noted in the AUTHORS file.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Read the zproject/README.md for information about making permanent changes. #
################################################################################
=========================================================================
*/
#include "zhttp_classes.h"
// -------------------------------------------------------------------------
// Run all private classes tests.
//
void
zhttp_private_selftest (bool verbose, const char *subtest)
{
}
/*
################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Read the zproject/README.md for information about making permanent changes. #
################################################################################
*/
| {
"pile_set_name": "Github"
} |
// Copyright 2017 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include <memory>
#include <QDialog>
#include <QSortFilterProxyModel>
#include <QStandardItemModel>
#include <QVariant>
#include "citra_qt/multiplayer/chat_room.h"
#include "citra_qt/multiplayer/validation.h"
#include "network/network.h"
namespace Ui {
class HostRoom;
}
namespace Core {
class AnnounceMultiplayerSession;
}
class ConnectionError;
class ComboBoxProxyModel;
class ChatMessage;
namespace Network::VerifyUser {
class Backend;
};
class HostRoomWindow : public QDialog {
Q_OBJECT
public:
explicit HostRoomWindow(QWidget* parent, QStandardItemModel* list,
std::shared_ptr<Core::AnnounceMultiplayerSession> session);
~HostRoomWindow();
/**
* Updates the dialog with a new game list model.
* This model should be the original model of the game list.
*/
void UpdateGameList(QStandardItemModel* list);
void RetranslateUi();
private:
void Host();
std::unique_ptr<Network::VerifyUser::Backend> CreateVerifyBackend(bool use_validation) const;
std::unique_ptr<Ui::HostRoom> ui;
std::weak_ptr<Core::AnnounceMultiplayerSession> announce_multiplayer_session;
QStandardItemModel* game_list;
ComboBoxProxyModel* proxy;
Validation validation;
};
/**
* Proxy Model for the game list combo box so we can reuse the game list model while still
* displaying the fields slightly differently
*/
class ComboBoxProxyModel : public QSortFilterProxyModel {
Q_OBJECT
public:
int columnCount(const QModelIndex& idx) const override {
return 1;
}
QVariant data(const QModelIndex& idx, int role) const override;
bool lessThan(const QModelIndex& left, const QModelIndex& right) const override;
};
| {
"pile_set_name": "Github"
} |
# Copyright 2016 gRPC 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.
# Docker file for building protoc and gRPC protoc plugin artifacts.
# forked from https://github.com/google/protobuf/blob/master/protoc-artifacts/Dockerfile
FROM centos:6.6
RUN yum install -y git \
tar \
wget \
make \
autoconf \
curl-devel \
unzip \
automake \
libtool \
glibc-static.i686 \
glibc-devel \
glibc-devel.i686
# Install GCC 4.7 to support -static-libstdc++
RUN wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo -P /etc/yum.repos.d
RUN bash -c 'echo "enabled=1" >> /etc/yum.repos.d/devtools-1.1.repo'
RUN bash -c "sed -e 's/\$basearch/i386/g' /etc/yum.repos.d/devtools-1.1.repo > /etc/yum.repos.d/devtools-i386-1.1.repo"
RUN sed -e 's/testing-/testing-i386-/g' -i /etc/yum.repos.d/devtools-i386-1.1.repo
# We'll get and "Rpmdb checksum is invalid: dCDPT(pkg checksums)" error caused by
# docker issue when using overlay storage driver, but all the stuff we need
# will be installed, so for now we just ignore the error.
# https://github.com/docker/docker/issues/10180
RUN yum install -y devtoolset-1.1 \
devtoolset-1.1-libstdc++-devel \
devtoolset-1.1-libstdc++-devel.i686 || true
# Update Git to version >1.7 to allow cloning submodules with --reference arg.
RUN yum remove -y git && yum clean all
RUN yum install -y https://centos6.iuscommunity.org/ius-release.rpm && yum clean all
RUN yum install -y git2u && yum clean all
# Start in devtoolset environment that uses GCC 4.7
CMD ["scl", "enable", "devtoolset-1.1", "bash"]
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env python3
r'''Purify text files.
1. In each line, remove trailing whitespace characters.
Whitespace characters are:
\t \v \n \r space
2. In each file, remove leading and trailing empty lines, i.e., the whole line
only consists of whitespace characters.
3. Add a UNIX new-line character \n to EOF if the EOF does not have one
already. The only exception to this rule is when the file is actually
empty.
4. Convert to UNIX line ending characters.
This means to convert \r\n to \n.
'''
import argparse
import re
__EMPTYLINE_REGEX__ = re.compile(r'^\s*$')
def fix_lines(lines):
'''Purify a list of lines.
Args:
line: The list of lines to process.
Returns:
The purified lines, as a list of strings.
'''
retval = []
# Fix each line.
for line in lines:
line = fix_line(line)
retval.append(line)
# Remove leading and trailing empty lines.
while retval and __EMPTYLINE_REGEX__.match(retval[0]):
retval.pop(0)
while retval and __EMPTYLINE_REGEX__.match(retval[-1]):
retval.pop(-1)
return retval
def fix_line(line):
'''Purify one line.
Args:
line: String. The line to process.
Returns:
The purified line.
'''
return line.rstrip() + '\n'
def purify_text_files(filelist):
'''Purify text files in-place.
The detailed specs of the purification are described in the module
docstring.
Args:
filelist: A list of file paths.
'''
for path in filelist:
with open(path, 'r') as f:
old_lines = f.readlines()
new_lines = fix_lines(old_lines)
if old_lines != new_lines:
with open(path, 'w') as f:
for line in new_lines:
f.write(line)
print('Fixing', path)
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
'files', nargs=argparse.REMAINDER, help='Paths to the files to format.'
)
args = parser.parse_args()
purify_text_files(args.files)
if __name__ == '__main__':
main()
| {
"pile_set_name": "Github"
} |
#pragma once
#include "csv.hpp" | {
"pile_set_name": "Github"
} |
package user
import (
"net/http"
"github.com/Sirupsen/logrus"
"github.com/asaskevich/govalidator"
"github.com/emicklei/go-restful"
"github.com/facebookgo/stackerr"
"github.com/bearded-web/bearded/models/user"
"github.com/bearded-web/bearded/pkg/filters"
"github.com/bearded-web/bearded/pkg/fltr"
"github.com/bearded-web/bearded/pkg/manager"
"github.com/bearded-web/bearded/pkg/pagination"
"github.com/bearded-web/bearded/pkg/validate"
"github.com/bearded-web/bearded/services"
)
type UserService struct {
*services.BaseService
sorter *fltr.Sorter
}
func New(base *services.BaseService) *UserService {
return &UserService{
BaseService: base,
sorter: fltr.NewSorter("created", "updated", "email", "nickname"),
}
}
func addDefaults(r *restful.RouteBuilder) {
r.Notes("Authorization required")
r.Do(services.ReturnsE(
http.StatusUnauthorized,
http.StatusForbidden,
http.StatusInternalServerError,
))
}
func (s *UserService) Register(container *restful.Container) {
ws := &restful.WebService{}
ws.Path("/api/v1/users")
ws.Doc("User management")
ws.Consumes(restful.MIME_JSON)
ws.Produces(restful.MIME_JSON)
ws.Filter(filters.AuthTokenFilter(s.BaseManager()))
ws.Filter(filters.AuthRequiredFilter(s.BaseManager()))
r := ws.GET("").To(s.list)
r.Doc("list")
r.Operation("list")
r.Writes(user.UserList{})
s.SetParams(r, fltr.GetParams(ws, manager.UserFltr{}))
r.Param(s.sorter.Param())
r.Param(s.Paginator.SkipParam())
r.Param(s.Paginator.LimitParam())
r.Do(services.Returns(http.StatusOK))
r.Do(services.ReturnsE(http.StatusBadRequest))
addDefaults(r)
ws.Route(r)
r = ws.POST("").To(s.create)
r.Doc("create")
r.Operation("create")
r.Writes(user.User{}) // on the response
r.Reads(userEntity{})
r.Do(services.Returns(http.StatusCreated))
r.Do(services.ReturnsE(http.StatusConflict))
addDefaults(r)
ws.Route(r)
r = ws.GET("{user-id}").To(s.get)
r.Doc("get")
r.Operation("get")
r.Param(ws.PathParameter("user-id", ""))
r.Writes(user.User{}) // on the response
r.Do(services.Returns(
http.StatusOK,
http.StatusNotFound))
r.Do(services.ReturnsE(http.StatusBadRequest))
addDefaults(r)
ws.Route(r)
r = ws.POST("{user-id}/password").To(s.setPassword)
r.Doc("setPassword")
r.Operation("setPassword")
r.Reads(passwordEntity{})
r.Param(ws.PathParameter("user-id", ""))
r.Do(services.Returns(
http.StatusCreated,
http.StatusNotFound))
r.Do(services.ReturnsE(http.StatusBadRequest))
addDefaults(r)
r.Notes("Authorization required. This method available only for administrator")
ws.Route(r)
container.Add(ws)
}
// ====== service operations
func (s *UserService) list(req *restful.Request, resp *restful.Response) {
// TODO (m0sth8): do not show emails and other fields for everyone
// TODO (m0sth8): filter by email for admin only
query, err := fltr.FromRequest(req, manager.UserFltr{})
if err != nil {
resp.WriteServiceError(http.StatusBadRequest, services.NewBadReq(err.Error()))
return
}
mgr := s.Manager()
defer mgr.Close()
skip, limit := s.Paginator.Parse(req)
opt := manager.Opts{
Sort: s.sorter.Parse(req),
Limit: limit,
Skip: skip,
}
results, count, err := mgr.Users.FilterByQuery(query, opt)
if err != nil {
logrus.Error(stackerr.Wrap(err))
resp.WriteServiceError(http.StatusInternalServerError, services.DbErr)
return
}
previous, next := s.Paginator.Urls(req, skip, limit, count)
result := &user.UserList{
Meta: pagination.Meta{Count: count, Previous: previous, Next: next},
Results: results,
}
resp.WriteEntity(result)
}
func (s *UserService) create(req *restful.Request, resp *restful.Response) {
// TODO (m0sth8): Check permissions
raw := &userEntity{}
if err := req.ReadEntity(raw); err != nil {
logrus.Error(stackerr.Wrap(err))
resp.WriteServiceError(http.StatusBadRequest, services.WrongEntityErr)
return
}
mgr := s.Manager()
defer mgr.Close()
u := filters.GetUser(req)
if !mgr.Permission.IsAdmin(u) {
logrus.Warnf("User %s try to create user without admin permission", u)
resp.WriteServiceError(http.StatusForbidden, services.AuthForbidErr)
return
}
// check email
if valid, err := govalidator.ValidateStruct(raw); !valid {
resp.WriteServiceError(http.StatusBadRequest, services.NewBadReq(err.Error()))
return
}
// check password
if valid, reason := validate.Password(raw.Password); !valid {
resp.WriteServiceError(http.StatusBadRequest, services.NewBadReq("Password %s", reason))
return
}
// hash password
pass, err := s.PassCtx().Encrypt(raw.Password)
if err != nil {
logrus.Error(stackerr.Wrap(err))
resp.WriteServiceError(http.StatusInternalServerError, services.AppErr)
return
}
obj, err := mgr.Users.Create(&user.User{
Nickname: raw.Nickname,
Email: raw.Email,
Password: pass,
})
if err != nil {
if mgr.IsDup(err) {
resp.WriteServiceError(
http.StatusConflict,
services.NewError(services.CodeDuplicate, "user with this email is existed"))
return
}
logrus.Error(stackerr.Wrap(err))
resp.WriteServiceError(http.StatusInternalServerError, services.DbErr)
return
}
resp.WriteHeader(http.StatusCreated)
resp.WriteEntity(obj)
}
func (s *UserService) get(req *restful.Request, resp *restful.Response) {
// TODO (m0sth8): Check permissions
userId := req.PathParameter("user-id")
if !s.IsId(userId) {
resp.WriteServiceError(http.StatusBadRequest, services.IdHexErr)
return
}
mgr := s.Manager()
defer mgr.Close()
u, err := mgr.Users.GetById(mgr.ToId(userId))
if err != nil {
if mgr.IsNotFound(err) {
resp.WriteErrorString(http.StatusNotFound, "Not found")
return
}
logrus.Error(stackerr.Wrap(err))
resp.WriteServiceError(http.StatusInternalServerError, services.DbErr)
return
}
resp.WriteEntity(u)
}
func (s *UserService) setPassword(req *restful.Request, resp *restful.Response) {
// TODO (m0sth8): Check permissions for admins
userId := req.PathParameter("user-id")
if !s.IsId(userId) {
resp.WriteServiceError(http.StatusBadRequest, services.IdHexErr)
return
}
raw := &passwordEntity{}
if err := req.ReadEntity(raw); err != nil {
logrus.Error(stackerr.Wrap(err))
resp.WriteServiceError(http.StatusBadRequest, services.WrongEntityErr)
return
}
mgr := s.Manager()
defer mgr.Close()
u, err := mgr.Users.GetById(mgr.ToId(userId))
if err != nil {
if mgr.IsNotFound(err) {
resp.WriteErrorString(http.StatusNotFound, "Not found")
return
}
logrus.Error(stackerr.Wrap(err))
resp.WriteServiceError(http.StatusInternalServerError, services.DbErr)
return
}
currentUser := filters.GetUser(req)
if !mgr.Permission.IsAdmin(currentUser) || currentUser.Id != u.Id {
logrus.Warnf("User %s try to set password for user %s", currentUser, u)
resp.WriteServiceError(http.StatusForbidden, services.AuthForbidErr)
return
}
pass, err := s.PassCtx().Encrypt(raw.Password)
if err != nil {
logrus.Error(stackerr.Wrap(err))
resp.WriteServiceError(http.StatusInternalServerError, services.AppErr)
return
}
u.Password = pass
if err := mgr.Users.Update(u); err != nil {
if mgr.IsNotFound(err) {
resp.WriteErrorString(http.StatusNotFound, "Not found")
return
}
logrus.Error(stackerr.Wrap(err))
resp.WriteServiceError(http.StatusInternalServerError, services.DbErr)
return
}
// resp.WriteHeader(http.StatusCreated) - this method doesn't work if body isn't written
resp.ResponseWriter.WriteHeader(http.StatusCreated)
}
| {
"pile_set_name": "Github"
} |
<annotation>
<folder>imagesRaw</folder>
<filename>2017-12-15 16:16:21.331026.jpg</filename>
<path>/Users/abell/Development/other.nyc/Camera/imagesRaw/2017-12-15 16:16:21.331026.jpg</path>
<source>
<database>Unknown</database>
</source>
<size>
<width>352</width>
<height>240</height>
<depth>3</depth>
</size>
<segmented>0</segmented>
<object>
<name>bus</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>58</xmin>
<ymin>141</ymin>
<xmax>118</xmax>
<ymax>190</ymax>
</bndbox>
</object>
<object>
<name>car</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>124</xmin>
<ymin>137</ymin>
<xmax>138</xmax>
<ymax>146</ymax>
</bndbox>
</object>
<object>
<name>car</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>147</xmin>
<ymin>143</ymin>
<xmax>165</xmax>
<ymax>155</ymax>
</bndbox>
</object>
<object>
<name>car</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>158</xmin>
<ymin>132</ymin>
<xmax>172</xmax>
<ymax>143</ymax>
</bndbox>
</object>
<object>
<name>car</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>179</xmin>
<ymin>136</ymin>
<xmax>193</xmax>
<ymax>147</ymax>
</bndbox>
</object>
<object>
<name>car</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>181</xmin>
<ymin>151</ymin>
<xmax>203</xmax>
<ymax>168</ymax>
</bndbox>
</object>
<object>
<name>car</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>206</xmin>
<ymin>155</ymin>
<xmax>229</xmax>
<ymax>172</ymax>
</bndbox>
</object>
<object>
<name>car</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>224</xmin>
<ymin>202</ymin>
<xmax>278</xmax>
<ymax>239</ymax>
</bndbox>
</object>
<object>
<name>car</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>149</xmin>
<ymin>154</ymin>
<xmax>168</xmax>
<ymax>170</ymax>
</bndbox>
</object>
<object>
<name>car</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>130</xmin>
<ymin>165</ymin>
<xmax>159</xmax>
<ymax>184</ymax>
</bndbox>
</object>
<object>
<name>car</name>
<pose>Unspecified</pose>
<truncated>1</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>95</xmin>
<ymin>212</ymin>
<xmax>150</xmax>
<ymax>240</ymax>
</bndbox>
</object>
</annotation>
| {
"pile_set_name": "Github"
} |
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
#pragma once
#include "pch.h"
namespace SDKTemplate
{
value struct Scenario;
partial ref class MainPage
{
internal:
static property Platform::String^ FEATURE_NAME
{
Platform::String^ get()
{
return "Low latency input sample";
}
}
static property Platform::Array<Scenario>^ scenarios
{
Platform::Array<Scenario>^ get()
{
return scenariosInner;
}
}
private:
static Platform::Array<Scenario>^ scenariosInner;
};
public value struct Scenario
{
Platform::String^ Title;
Platform::String^ ClassName;
};
}
| {
"pile_set_name": "Github"
} |
// Copyright 2015 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.
// unicode holds packages with implementations of Unicode standards that are
// mostly used as building blocks for other packages in golang.org/x/text,
// layout engines, or are otherwise more low-level in nature.
package unicode
| {
"pile_set_name": "Github"
} |
# This file is distributed under the same license as the Django package.
#
# Translators:
# Jannis Leidel <[email protected]>, 2011.
# jon_atkinson <[email protected]>, 2011.
# <[email protected]>, 2012.
# Ross Poulton <[email protected]>, 2011, 2012.
msgid ""
msgstr ""
"Project-Id-Version: Django\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-01-01 16:10+0100\n"
"PO-Revision-Date: 2013-01-02 08:47+0000\n"
"Last-Translator: Ross Poulton <[email protected]>\n"
"Language-Team: English (United Kingdom) (http://www.transifex.com/projects/p/"
"django/language/en_GB/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en_GB\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: conf/global_settings.py:48
msgid "Afrikaans"
msgstr ""
#: conf/global_settings.py:49
msgid "Arabic"
msgstr "Arabic"
#: conf/global_settings.py:50
msgid "Azerbaijani"
msgstr "Azerbaijani"
#: conf/global_settings.py:51
msgid "Bulgarian"
msgstr "Bulgarian"
#: conf/global_settings.py:52
msgid "Belarusian"
msgstr ""
#: conf/global_settings.py:53
msgid "Bengali"
msgstr "Bengali"
#: conf/global_settings.py:54
msgid "Breton"
msgstr ""
#: conf/global_settings.py:55
msgid "Bosnian"
msgstr "Bosnian"
#: conf/global_settings.py:56
msgid "Catalan"
msgstr "Catalan"
#: conf/global_settings.py:57
msgid "Czech"
msgstr "Czech"
#: conf/global_settings.py:58
msgid "Welsh"
msgstr "Welsh"
#: conf/global_settings.py:59
msgid "Danish"
msgstr "Danish"
#: conf/global_settings.py:60
msgid "German"
msgstr "German"
#: conf/global_settings.py:61
msgid "Greek"
msgstr "Greek"
#: conf/global_settings.py:62
msgid "English"
msgstr "English"
#: conf/global_settings.py:63
msgid "British English"
msgstr "British English"
#: conf/global_settings.py:64
msgid "Esperanto"
msgstr "Esperanto"
#: conf/global_settings.py:65
msgid "Spanish"
msgstr "Spanish"
#: conf/global_settings.py:66
msgid "Argentinian Spanish"
msgstr "Argentinian Spanish"
#: conf/global_settings.py:67
msgid "Mexican Spanish"
msgstr "Mexican Spanish"
#: conf/global_settings.py:68
msgid "Nicaraguan Spanish"
msgstr "Nicaraguan Spanish"
#: conf/global_settings.py:69
msgid "Venezuelan Spanish"
msgstr ""
#: conf/global_settings.py:70
msgid "Estonian"
msgstr "Estonian"
#: conf/global_settings.py:71
msgid "Basque"
msgstr "Basque"
#: conf/global_settings.py:72
msgid "Persian"
msgstr "Persian"
#: conf/global_settings.py:73
msgid "Finnish"
msgstr "Finnish"
#: conf/global_settings.py:74
msgid "French"
msgstr "French"
#: conf/global_settings.py:75
msgid "Frisian"
msgstr "Frisian"
#: conf/global_settings.py:76
msgid "Irish"
msgstr "Irish"
#: conf/global_settings.py:77
msgid "Galician"
msgstr "Galician"
#: conf/global_settings.py:78
msgid "Hebrew"
msgstr "Hebrew"
#: conf/global_settings.py:79
msgid "Hindi"
msgstr "Hindi"
#: conf/global_settings.py:80
msgid "Croatian"
msgstr "Croatian"
#: conf/global_settings.py:81
msgid "Hungarian"
msgstr "Hungarian"
#: conf/global_settings.py:82
msgid "Interlingua"
msgstr ""
#: conf/global_settings.py:83
msgid "Indonesian"
msgstr "Indonesian"
#: conf/global_settings.py:84
msgid "Icelandic"
msgstr "Icelandic"
#: conf/global_settings.py:85
msgid "Italian"
msgstr "Italian"
#: conf/global_settings.py:86
msgid "Japanese"
msgstr "Japanese"
#: conf/global_settings.py:87
msgid "Georgian"
msgstr "Georgian"
#: conf/global_settings.py:88
msgid "Kazakh"
msgstr "Kazakh"
#: conf/global_settings.py:89
msgid "Khmer"
msgstr "Khmer"
#: conf/global_settings.py:90
msgid "Kannada"
msgstr "Kannada"
#: conf/global_settings.py:91
msgid "Korean"
msgstr "Korean"
#: conf/global_settings.py:92
msgid "Luxembourgish"
msgstr ""
#: conf/global_settings.py:93
msgid "Lithuanian"
msgstr "Lithuanian"
#: conf/global_settings.py:94
msgid "Latvian"
msgstr "Latvian"
#: conf/global_settings.py:95
msgid "Macedonian"
msgstr "Macedonian"
#: conf/global_settings.py:96
msgid "Malayalam"
msgstr "Malayalam"
#: conf/global_settings.py:97
msgid "Mongolian"
msgstr "Mongolian"
#: conf/global_settings.py:98
msgid "Norwegian Bokmal"
msgstr "Norwegian Bokmal"
#: conf/global_settings.py:99
msgid "Nepali"
msgstr "Nepali"
#: conf/global_settings.py:100
msgid "Dutch"
msgstr "Dutch"
#: conf/global_settings.py:101
msgid "Norwegian Nynorsk"
msgstr "Norwegian Nynorsk"
#: conf/global_settings.py:102
msgid "Punjabi"
msgstr "Punjabi"
#: conf/global_settings.py:103
msgid "Polish"
msgstr "Polish"
#: conf/global_settings.py:104
msgid "Portuguese"
msgstr "Portuguese"
#: conf/global_settings.py:105
msgid "Brazilian Portuguese"
msgstr "Brazilian Portuguese"
#: conf/global_settings.py:106
msgid "Romanian"
msgstr "Romanian"
#: conf/global_settings.py:107
msgid "Russian"
msgstr "Russian"
#: conf/global_settings.py:108
msgid "Slovak"
msgstr "Slovak"
#: conf/global_settings.py:109
msgid "Slovenian"
msgstr "Slovenian"
#: conf/global_settings.py:110
msgid "Albanian"
msgstr "Albanian"
#: conf/global_settings.py:111
msgid "Serbian"
msgstr "Serbian"
#: conf/global_settings.py:112
msgid "Serbian Latin"
msgstr "Serbian Latin"
#: conf/global_settings.py:113
msgid "Swedish"
msgstr "Swedish"
#: conf/global_settings.py:114
msgid "Swahili"
msgstr "Swahili"
#: conf/global_settings.py:115
msgid "Tamil"
msgstr "Tamil"
#: conf/global_settings.py:116
msgid "Telugu"
msgstr "Telugu"
#: conf/global_settings.py:117
msgid "Thai"
msgstr "Thai"
#: conf/global_settings.py:118
msgid "Turkish"
msgstr "Turkish"
#: conf/global_settings.py:119
msgid "Tatar"
msgstr "Tatar"
#: conf/global_settings.py:120
msgid "Udmurt"
msgstr ""
#: conf/global_settings.py:121
msgid "Ukrainian"
msgstr "Ukrainian"
#: conf/global_settings.py:122
msgid "Urdu"
msgstr "Urdu"
#: conf/global_settings.py:123
msgid "Vietnamese"
msgstr "Vietnamese"
#: conf/global_settings.py:124
msgid "Simplified Chinese"
msgstr "Simplified Chinese"
#: conf/global_settings.py:125
msgid "Traditional Chinese"
msgstr "Traditional Chinese"
#: core/validators.py:21 forms/fields.py:52
msgid "Enter a valid value."
msgstr "Enter a valid value."
#: core/validators.py:104 forms/fields.py:464
msgid "Enter a valid email address."
msgstr ""
#: core/validators.py:107 forms/fields.py:1013
msgid ""
"Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens."
msgstr ""
"Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens."
#: core/validators.py:110 core/validators.py:129 forms/fields.py:987
msgid "Enter a valid IPv4 address."
msgstr "Enter a valid IPv4 address."
#: core/validators.py:115 core/validators.py:130
msgid "Enter a valid IPv6 address."
msgstr "Enter a valid IPv6 address."
#: core/validators.py:125 core/validators.py:128
msgid "Enter a valid IPv4 or IPv6 address."
msgstr "Enter a valid IPv4 or IPv6 address."
#: core/validators.py:151 db/models/fields/__init__.py:655
msgid "Enter only digits separated by commas."
msgstr "Enter only digits separated by commas."
#: core/validators.py:157
#, python-format
msgid "Ensure this value is %(limit_value)s (it is %(show_value)s)."
msgstr "Ensure this value is %(limit_value)s (it is %(show_value)s)."
#: core/validators.py:176 forms/fields.py:210 forms/fields.py:263
#, python-format
msgid "Ensure this value is less than or equal to %(limit_value)s."
msgstr "Ensure this value is less than or equal to %(limit_value)s."
#: core/validators.py:182 forms/fields.py:211 forms/fields.py:264
#, python-format
msgid "Ensure this value is greater than or equal to %(limit_value)s."
msgstr "Ensure this value is greater than or equal to %(limit_value)s."
#: core/validators.py:189
#, python-format
msgid ""
"Ensure this value has at least %(limit_value)d characters (it has "
"%(show_value)d)."
msgstr ""
"Ensure this value has at least %(limit_value)d characters (it has "
"%(show_value)d)."
#: core/validators.py:196
#, python-format
msgid ""
"Ensure this value has at most %(limit_value)d characters (it has "
"%(show_value)d)."
msgstr ""
"Ensure this value has at most %(limit_value)d characters (it has "
"%(show_value)d)."
#: db/models/base.py:857
#, python-format
msgid "%(field_name)s must be unique for %(date_field)s %(lookup)s."
msgstr "%(field_name)s must be unique for %(date_field)s %(lookup)s."
#: db/models/base.py:880 forms/models.py:573
msgid "and"
msgstr "and"
#: db/models/base.py:881 db/models/fields/__init__.py:70
#, python-format
msgid "%(model_name)s with this %(field_label)s already exists."
msgstr "%(model_name)s with this %(field_label)s already exists."
#: db/models/fields/__init__.py:67
#, python-format
msgid "Value %r is not a valid choice."
msgstr "Value %r is not a valid choice."
#: db/models/fields/__init__.py:68
msgid "This field cannot be null."
msgstr "This field cannot be null."
#: db/models/fields/__init__.py:69
msgid "This field cannot be blank."
msgstr "This field cannot be blank."
#: db/models/fields/__init__.py:76
#, python-format
msgid "Field of type: %(field_type)s"
msgstr "Field of type: %(field_type)s"
#: db/models/fields/__init__.py:517 db/models/fields/__init__.py:985
msgid "Integer"
msgstr "Integer"
#: db/models/fields/__init__.py:521 db/models/fields/__init__.py:983
#, python-format
msgid "'%s' value must be an integer."
msgstr "'%s' value must be an integer."
#: db/models/fields/__init__.py:569
#, python-format
msgid "'%s' value must be either True or False."
msgstr "'%s' value must be either True or False."
#: db/models/fields/__init__.py:571
msgid "Boolean (Either True or False)"
msgstr "Boolean (Either True or False)"
#: db/models/fields/__init__.py:622
#, python-format
msgid "String (up to %(max_length)s)"
msgstr "String (up to %(max_length)s)"
#: db/models/fields/__init__.py:650
msgid "Comma-separated integers"
msgstr "Comma-separated integers"
#: db/models/fields/__init__.py:664
#, python-format
msgid "'%s' value has an invalid date format. It must be in YYYY-MM-DD format."
msgstr ""
"'%s' value has an invalid date format. It must be in YYYY-MM-DD format."
#: db/models/fields/__init__.py:666 db/models/fields/__init__.py:754
#, python-format
msgid ""
"'%s' value has the correct format (YYYY-MM-DD) but it is an invalid date."
msgstr ""
"'%s' value has the correct format (YYYY-MM-DD) but it is an invalid date."
#: db/models/fields/__init__.py:669
msgid "Date (without time)"
msgstr "Date (without time)"
#: db/models/fields/__init__.py:752
#, python-format
msgid ""
"'%s' value has an invalid format. It must be in YYYY-MM-DD HH:MM[:ss[."
"uuuuuu]][TZ] format."
msgstr ""
"'%s' value has an invalid format. It must be in YYYY-MM-DD HH:MM[:ss[."
"uuuuuu]][TZ] format."
#: db/models/fields/__init__.py:756
#, python-format
msgid ""
"'%s' value has the correct format (YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ]) but "
"it is an invalid date/time."
msgstr ""
"'%s' value has the correct format (YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ]) but "
"it is an invalid date/time."
#: db/models/fields/__init__.py:760
msgid "Date (with time)"
msgstr "Date (with time)"
#: db/models/fields/__init__.py:849
#, python-format
msgid "'%s' value must be a decimal number."
msgstr "'%s' value must be a decimal number."
#: db/models/fields/__init__.py:851
msgid "Decimal number"
msgstr "Decimal number"
#: db/models/fields/__init__.py:908
msgid "Email address"
msgstr "Email address"
#: db/models/fields/__init__.py:927
msgid "File path"
msgstr "File path"
#: db/models/fields/__init__.py:954
#, python-format
msgid "'%s' value must be a float."
msgstr "'%s' value must be a float."
#: db/models/fields/__init__.py:956
msgid "Floating point number"
msgstr "Floating point number"
#: db/models/fields/__init__.py:1017
msgid "Big (8 byte) integer"
msgstr "Big (8 byte) integer"
#: db/models/fields/__init__.py:1031
msgid "IPv4 address"
msgstr "IPv4 address"
#: db/models/fields/__init__.py:1047
msgid "IP address"
msgstr "IP address"
#: db/models/fields/__init__.py:1090
#, python-format
msgid "'%s' value must be either None, True or False."
msgstr "'%s' value must be either None, True or False."
#: db/models/fields/__init__.py:1092
msgid "Boolean (Either True, False or None)"
msgstr "Boolean (Either True, False or None)"
#: db/models/fields/__init__.py:1141
msgid "Positive integer"
msgstr "Positive integer"
#: db/models/fields/__init__.py:1152
msgid "Positive small integer"
msgstr "Positive small integer"
#: db/models/fields/__init__.py:1163
#, python-format
msgid "Slug (up to %(max_length)s)"
msgstr "Slug (up to %(max_length)s)"
#: db/models/fields/__init__.py:1181
msgid "Small integer"
msgstr "Small integer"
#: db/models/fields/__init__.py:1187
msgid "Text"
msgstr "Text"
#: db/models/fields/__init__.py:1205
#, python-format
msgid ""
"'%s' value has an invalid format. It must be in HH:MM[:ss[.uuuuuu]] format."
msgstr ""
"'%s' value has an invalid format. It must be in HH:MM[:ss[.uuuuuu]] format."
#: db/models/fields/__init__.py:1207
#, python-format
msgid ""
"'%s' value has the correct format (HH:MM[:ss[.uuuuuu]]) but it is an invalid "
"time."
msgstr ""
"'%s' value has the correct format (HH:MM[:ss[.uuuuuu]]) but it is an invalid "
"time."
#: db/models/fields/__init__.py:1210
msgid "Time"
msgstr "Time"
#: db/models/fields/__init__.py:1272
msgid "URL"
msgstr "URL"
#: db/models/fields/files.py:216
msgid "File"
msgstr "File"
#: db/models/fields/files.py:323
msgid "Image"
msgstr "Image"
#: db/models/fields/related.py:979
#, python-format
msgid "Model %(model)s with pk %(pk)r does not exist."
msgstr "Model %(model)s with pk %(pk)r does not exist."
#: db/models/fields/related.py:981
msgid "Foreign Key (type determined by related field)"
msgstr "Foreign Key (type determined by related field)"
#: db/models/fields/related.py:1111
msgid "One-to-one relationship"
msgstr "One-to-one relationship"
#: db/models/fields/related.py:1178
msgid "Many-to-many relationship"
msgstr "Many-to-many relationship"
#: db/models/fields/related.py:1203
msgid ""
"Hold down \"Control\", or \"Command\" on a Mac, to select more than one."
msgstr ""
"Hold down \"Control\", or \"Command\" on a Mac, to select more than one."
#: forms/fields.py:51
msgid "This field is required."
msgstr "This field is required."
#: forms/fields.py:209
msgid "Enter a whole number."
msgstr "Enter a whole number."
#: forms/fields.py:241 forms/fields.py:262
msgid "Enter a number."
msgstr "Enter a number."
#: forms/fields.py:265
#, python-format
msgid "Ensure that there are no more than %s digits in total."
msgstr "Ensure that there are no more than %s digits in total."
#: forms/fields.py:266
#, python-format
msgid "Ensure that there are no more than %s decimal places."
msgstr "Ensure that there are no more than %s decimal places."
#: forms/fields.py:267
#, python-format
msgid "Ensure that there are no more than %s digits before the decimal point."
msgstr "Ensure that there are no more than %s digits before the decimal point."
#: forms/fields.py:355 forms/fields.py:953
msgid "Enter a valid date."
msgstr "Enter a valid date."
#: forms/fields.py:378 forms/fields.py:954
msgid "Enter a valid time."
msgstr "Enter a valid time."
#: forms/fields.py:399
msgid "Enter a valid date/time."
msgstr "Enter a valid date/time."
#: forms/fields.py:475
msgid "No file was submitted. Check the encoding type on the form."
msgstr "No file was submitted. Check the encoding type on the form."
#: forms/fields.py:476
msgid "No file was submitted."
msgstr "No file was submitted."
#: forms/fields.py:477
msgid "The submitted file is empty."
msgstr "The submitted file is empty."
#: forms/fields.py:478
#, python-format
msgid ""
"Ensure this filename has at most %(max)d characters (it has %(length)d)."
msgstr ""
"Ensure this filename has at most %(max)d characters (it has %(length)d)."
#: forms/fields.py:479
msgid "Please either submit a file or check the clear checkbox, not both."
msgstr "Please either submit a file or check the clear checkbox, not both."
#: forms/fields.py:534
msgid ""
"Upload a valid image. The file you uploaded was either not an image or a "
"corrupted image."
msgstr ""
"Upload a valid image. The file you uploaded was either not an image or a "
"corrupted image."
#: forms/fields.py:580
msgid "Enter a valid URL."
msgstr "Enter a valid URL."
#: forms/fields.py:666 forms/fields.py:746
#, python-format
msgid "Select a valid choice. %(value)s is not one of the available choices."
msgstr "Select a valid choice. %(value)s is not one of the available choices."
#: forms/fields.py:747 forms/fields.py:835 forms/models.py:1002
msgid "Enter a list of values."
msgstr "Enter a list of values."
#: forms/formsets.py:324 forms/formsets.py:326
msgid "Order"
msgstr "Order"
#: forms/formsets.py:328
msgid "Delete"
msgstr "Delete"
#: forms/models.py:567
#, python-format
msgid "Please correct the duplicate data for %(field)s."
msgstr "Please correct the duplicate data for %(field)s."
#: forms/models.py:571
#, python-format
msgid "Please correct the duplicate data for %(field)s, which must be unique."
msgstr "Please correct the duplicate data for %(field)s, which must be unique."
#: forms/models.py:577
#, python-format
msgid ""
"Please correct the duplicate data for %(field_name)s which must be unique "
"for the %(lookup)s in %(date_field)s."
msgstr ""
"Please correct the duplicate data for %(field_name)s which must be unique "
"for the %(lookup)s in %(date_field)s."
#: forms/models.py:585
msgid "Please correct the duplicate values below."
msgstr "Please correct the duplicate values below."
#: forms/models.py:852
msgid "The inline foreign key did not match the parent instance primary key."
msgstr "The inline foreign key did not match the parent instance primary key."
#: forms/models.py:913
msgid "Select a valid choice. That choice is not one of the available choices."
msgstr ""
"Select a valid choice. That choice is not one of the available choices."
#: forms/models.py:1003
#, python-format
msgid "Select a valid choice. %s is not one of the available choices."
msgstr "Select a valid choice. %s is not one of the available choices."
#: forms/models.py:1005
#, python-format
msgid "\"%s\" is not a valid value for a primary key."
msgstr "\"%s\" is not a valid value for a primary key."
#: forms/util.py:81
#, python-format
msgid ""
"%(datetime)s couldn't be interpreted in time zone %(current_timezone)s; it "
"may be ambiguous or it may not exist."
msgstr ""
"%(datetime)s couldn't be interpreted in time zone %(current_timezone)s; it "
"may be ambiguous or it may not exist."
#: forms/widgets.py:336
msgid "Currently"
msgstr "Currently"
#: forms/widgets.py:337
msgid "Change"
msgstr "Change"
#: forms/widgets.py:338
msgid "Clear"
msgstr "Clear"
#: forms/widgets.py:594
msgid "Unknown"
msgstr "Unknown"
#: forms/widgets.py:595
msgid "Yes"
msgstr "Yes"
#: forms/widgets.py:596
msgid "No"
msgstr "No"
#: template/defaultfilters.py:794
msgid "yes,no,maybe"
msgstr "yes,no,maybe"
#: template/defaultfilters.py:822 template/defaultfilters.py:833
#, python-format
msgid "%(size)d byte"
msgid_plural "%(size)d bytes"
msgstr[0] "%(size)d byte"
msgstr[1] "%(size)d bytes"
#: template/defaultfilters.py:835
#, python-format
msgid "%s KB"
msgstr "%s KB"
#: template/defaultfilters.py:837
#, python-format
msgid "%s MB"
msgstr "%s MB"
#: template/defaultfilters.py:839
#, python-format
msgid "%s GB"
msgstr "%s GB"
#: template/defaultfilters.py:841
#, python-format
msgid "%s TB"
msgstr "%s TB"
#: template/defaultfilters.py:842
#, python-format
msgid "%s PB"
msgstr "%s PB"
#: utils/dateformat.py:47
msgid "p.m."
msgstr "p.m."
#: utils/dateformat.py:48
msgid "a.m."
msgstr "a.m."
#: utils/dateformat.py:53
msgid "PM"
msgstr "PM"
#: utils/dateformat.py:54
msgid "AM"
msgstr "AM"
#: utils/dateformat.py:103
msgid "midnight"
msgstr "midnight"
#: utils/dateformat.py:105
msgid "noon"
msgstr "noon"
#: utils/dates.py:6
msgid "Monday"
msgstr "Monday"
#: utils/dates.py:6
msgid "Tuesday"
msgstr "Tuesday"
#: utils/dates.py:6
msgid "Wednesday"
msgstr "Wednesday"
#: utils/dates.py:6
msgid "Thursday"
msgstr "Thursday"
#: utils/dates.py:6
msgid "Friday"
msgstr "Friday"
#: utils/dates.py:7
msgid "Saturday"
msgstr "Saturday"
#: utils/dates.py:7
msgid "Sunday"
msgstr "Sunday"
#: utils/dates.py:10
msgid "Mon"
msgstr "Mon"
#: utils/dates.py:10
msgid "Tue"
msgstr "Tue"
#: utils/dates.py:10
msgid "Wed"
msgstr "Wed"
#: utils/dates.py:10
msgid "Thu"
msgstr "Thu"
#: utils/dates.py:10
msgid "Fri"
msgstr "Fri"
#: utils/dates.py:11
msgid "Sat"
msgstr "Sat"
#: utils/dates.py:11
msgid "Sun"
msgstr "Sun"
#: utils/dates.py:18
msgid "January"
msgstr "January"
#: utils/dates.py:18
msgid "February"
msgstr "February"
#: utils/dates.py:18
msgid "March"
msgstr "March"
#: utils/dates.py:18
msgid "April"
msgstr "April"
#: utils/dates.py:18
msgid "May"
msgstr "May"
#: utils/dates.py:18
msgid "June"
msgstr "June"
#: utils/dates.py:19
msgid "July"
msgstr "July"
#: utils/dates.py:19
msgid "August"
msgstr "August"
#: utils/dates.py:19
msgid "September"
msgstr "September"
#: utils/dates.py:19
msgid "October"
msgstr "October"
#: utils/dates.py:19
msgid "November"
msgstr "November"
#: utils/dates.py:20
msgid "December"
msgstr "December"
#: utils/dates.py:23
msgid "jan"
msgstr "jan"
#: utils/dates.py:23
msgid "feb"
msgstr "feb"
#: utils/dates.py:23
msgid "mar"
msgstr "mar"
#: utils/dates.py:23
msgid "apr"
msgstr "apr"
#: utils/dates.py:23
msgid "may"
msgstr "may"
#: utils/dates.py:23
msgid "jun"
msgstr "jun"
#: utils/dates.py:24
msgid "jul"
msgstr "jul"
#: utils/dates.py:24
msgid "aug"
msgstr "aug"
#: utils/dates.py:24
msgid "sep"
msgstr "sep"
#: utils/dates.py:24
msgid "oct"
msgstr "oct"
#: utils/dates.py:24
msgid "nov"
msgstr "nov"
#: utils/dates.py:24
msgid "dec"
msgstr "dec"
#: utils/dates.py:31
msgctxt "abbrev. month"
msgid "Jan."
msgstr "Jan."
#: utils/dates.py:32
msgctxt "abbrev. month"
msgid "Feb."
msgstr "Feb."
#: utils/dates.py:33
msgctxt "abbrev. month"
msgid "March"
msgstr "March"
#: utils/dates.py:34
msgctxt "abbrev. month"
msgid "April"
msgstr "April"
#: utils/dates.py:35
msgctxt "abbrev. month"
msgid "May"
msgstr "May"
#: utils/dates.py:36
msgctxt "abbrev. month"
msgid "June"
msgstr "June"
#: utils/dates.py:37
msgctxt "abbrev. month"
msgid "July"
msgstr "July"
#: utils/dates.py:38
msgctxt "abbrev. month"
msgid "Aug."
msgstr "Aug."
#: utils/dates.py:39
msgctxt "abbrev. month"
msgid "Sept."
msgstr "Sept."
#: utils/dates.py:40
msgctxt "abbrev. month"
msgid "Oct."
msgstr "Oct."
#: utils/dates.py:41
msgctxt "abbrev. month"
msgid "Nov."
msgstr "Nov."
#: utils/dates.py:42
msgctxt "abbrev. month"
msgid "Dec."
msgstr "Dec."
#: utils/dates.py:45
msgctxt "alt. month"
msgid "January"
msgstr "January"
#: utils/dates.py:46
msgctxt "alt. month"
msgid "February"
msgstr "February"
#: utils/dates.py:47
msgctxt "alt. month"
msgid "March"
msgstr "March"
#: utils/dates.py:48
msgctxt "alt. month"
msgid "April"
msgstr "April"
#: utils/dates.py:49
msgctxt "alt. month"
msgid "May"
msgstr "May"
#: utils/dates.py:50
msgctxt "alt. month"
msgid "June"
msgstr "June"
#: utils/dates.py:51
msgctxt "alt. month"
msgid "July"
msgstr "July"
#: utils/dates.py:52
msgctxt "alt. month"
msgid "August"
msgstr "August"
#: utils/dates.py:53
msgctxt "alt. month"
msgid "September"
msgstr "September"
#: utils/dates.py:54
msgctxt "alt. month"
msgid "October"
msgstr "October"
#: utils/dates.py:55
msgctxt "alt. month"
msgid "November"
msgstr "November"
#: utils/dates.py:56
msgctxt "alt. month"
msgid "December"
msgstr "December"
#: utils/text.py:70
#, python-format
msgctxt "String to return when truncating text"
msgid "%(truncated_text)s..."
msgstr "%(truncated_text)s..."
#: utils/text.py:239
msgid "or"
msgstr "or"
#. Translators: This string is used as a separator between list elements
#: utils/text.py:256
msgid ", "
msgstr ", "
#: utils/timesince.py:22
msgid "year"
msgid_plural "years"
msgstr[0] "year"
msgstr[1] "years"
#: utils/timesince.py:23
msgid "month"
msgid_plural "months"
msgstr[0] "month"
msgstr[1] "months"
#: utils/timesince.py:24
msgid "week"
msgid_plural "weeks"
msgstr[0] "week"
msgstr[1] "weeks"
#: utils/timesince.py:25
msgid "day"
msgid_plural "days"
msgstr[0] "day"
msgstr[1] "days"
#: utils/timesince.py:26
msgid "hour"
msgid_plural "hours"
msgstr[0] "hour"
msgstr[1] "hours"
#: utils/timesince.py:27
msgid "minute"
msgid_plural "minutes"
msgstr[0] "minute"
msgstr[1] "minutes"
#: utils/timesince.py:43
msgid "minutes"
msgstr "minutes"
#: utils/timesince.py:48
#, python-format
msgid "%(number)d %(type)s"
msgstr "%(number)d %(type)s"
#: utils/timesince.py:54
#, python-format
msgid ", %(number)d %(type)s"
msgstr ", %(number)d %(type)s"
#: views/static.py:56
msgid "Directory indexes are not allowed here."
msgstr "Directory indexes are not allowed here."
#: views/static.py:58
#, python-format
msgid "\"%(path)s\" does not exist"
msgstr "\"%(path)s\" does not exist"
#: views/static.py:98
#, python-format
msgid "Index of %(directory)s"
msgstr "Index of %(directory)s"
#: views/generic/dates.py:42
msgid "No year specified"
msgstr "No year specified"
#: views/generic/dates.py:98
msgid "No month specified"
msgstr "No month specified"
#: views/generic/dates.py:157
msgid "No day specified"
msgstr "No day specified"
#: views/generic/dates.py:213
msgid "No week specified"
msgstr "No week specified"
#: views/generic/dates.py:368 views/generic/dates.py:393
#, python-format
msgid "No %(verbose_name_plural)s available"
msgstr "No %(verbose_name_plural)s available"
#: views/generic/dates.py:646
#, python-format
msgid ""
"Future %(verbose_name_plural)s not available because %(class_name)s."
"allow_future is False."
msgstr ""
"Future %(verbose_name_plural)s not available because %(class_name)s."
"allow_future is False."
#: views/generic/dates.py:678
#, python-format
msgid "Invalid date string '%(datestr)s' given format '%(format)s'"
msgstr "Invalid date string '%(datestr)s' given format '%(format)s'"
#: views/generic/detail.py:54
#, python-format
msgid "No %(verbose_name)s found matching the query"
msgstr "No %(verbose_name)s found matching the query"
#: views/generic/list.py:51
msgid "Page is not 'last', nor can it be converted to an int."
msgstr "Page is not 'last', nor can it be converted to an int."
#: views/generic/list.py:56
#, python-format
msgid "Invalid page (%(page_number)s): %(message)s"
msgstr ""
#: views/generic/list.py:137
#, python-format
msgid "Empty list and '%(class_name)s.allow_empty' is False."
msgstr "Empty list and '%(class_name)s.allow_empty' is False."
| {
"pile_set_name": "Github"
} |
#include <QtCore/QCoreApplication>
#include <QtCore/QFile>
#include <QtCore/QDir>
#include <QtCore/QTextStream>
#include <QtCore/QTextCodec>
static const QString OUTPUT_DIR("output");
static const QString INPUT_DIR("input");
/**
* Create a new directory in the current one.
* If it already exists then delete all files in it.
* @param dirname The name of the new directory.
*/
void createDir(const QString& dirName)
{
QDir curr = QDir::current();
if (!curr.exists(dirName))
curr.mkdir(dirName);
else
{
QDir dir(curr.absolutePath() + "/" + dirName);
foreach (QString e, dir.entryList())
{
QFile::remove(dir.absolutePath() + "/" + e);
}
}
}
/**
* Create and/or empty the input and ouput directories.
*/
void reinitDirs()
{
createDir(INPUT_DIR);
createDir(OUTPUT_DIR);
}
/**
* 'argc' and 'argv' are unused.
*/
int main(int argc, char *argv[])
{
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
QTextStream out(stdout);
// Not required because of the call to 'setCodecForLocale' above.
//out.setCodec("UTF-8");
// Create directory 'input' and 'output' if they doesn't exist.
reinitDirs();
QString filename = QString::fromUtf8("abc123 èéà @Ã#$ƇȤՖÿ");
out << filename << endl <<
"length : " << filename.length() << endl;
QDir input(INPUT_DIR);
{
QFile f(input.absolutePath() + "/" + filename);
f.open(QIODevice::WriteOnly);
}
foreach (QString entry, input.entryList())
{
if (entry == "." || entry == "..")
continue;
QFile f(QString(OUTPUT_DIR) + "/" + entry);
f.open(QIODevice::WriteOnly);
}
out << "You can now compare the files created in both 'input' and 'ouput' folder" << endl;
return 0;
}
| {
"pile_set_name": "Github"
} |
# [jQuery UI](http://jqueryui.com/) - Interactions and Widgets for the web
jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of jQuery. Whether you're building highly interactive web applications, or you just need to add a date picker to a form control, jQuery UI is the perfect choice.
If you want to use jQuery UI, go to [jqueryui.com](http://jqueryui.com) to get started, [jqueryui.com/demos/](http://jqueryui.com/demos/) for demos, [api.jqueryui.com](http://api.jqueryui.com/) for API documentation, or the [Using jQuery UI Forum](http://forum.jquery.com/using-jquery-ui) for discussions and questions.
If you want to report a bug/issue, please visit [bugs.jqueryui.com](http://bugs.jqueryui.com).
If you are interested in helping develop jQuery UI, you are in the right place.
To discuss development with team members and the community, visit the [Developing jQuery UI Forum](http://forum.jquery.com/developing-jquery-ui) or [#jqueryui-dev on irc.freenode.net](http://irc.jquery.org/).
## For contributors
If you want to help and provide a patch for a bugfix or new feature, please take
a few minutes and look at [our Getting Involved guide](http://wiki.jqueryui.com/w/page/35263114/Getting-Involved).
In particular check out the [Coding standards](http://wiki.jqueryui.com/w/page/12137737/Coding-standards)
and [Commit Message Style Guide](http://wiki.jqueryui.com/w/page/25941597/Commit-Message-Style-Guide).
In general, fork the project, create a branch for a specific change and send a
pull request for that branch. Don't mix unrelated changes. You can use the commit
message as the description for the pull request.
## Running the Unit Tests
Run the unit tests with a local server that supports PHP. No database is required. Pre-configured php local servers are available for Windows and Mac. Here are some options:
- Windows: [WAMP download](http://www.wampserver.com/en/)
- Mac: [MAMP download](http://www.mamp.info/en/index.html)
- Linux: [Setting up LAMP](https://www.linux.com/learn/tutorials/288158-easy-lamp-server-installation)
- [Mongoose (most platforms)](http://code.google.com/p/mongoose/)
## Building jQuery UI
jQuery UI uses the [Grunt](http://github.com/gruntjs/grunt) build system.
To build jQuery UI, you must have [node.js](http://nodejs.org/) installed and then run the following commands:
```sh
# Install the Grunt CLI
npm install -g grunt-cli
# Clone the jQuery UI git repo
git clone git://github.com/jquery/jquery-ui.git
cd jquery-ui
# Install the node module dependencies
npm install
# Run the build task
grunt build
# There are many other tasks that can be run through Grunt.
# For a list of all tasks:
grunt --help
```
## For committers
When looking at pull requests, first check for [proper commit messages](http://wiki.jqueryui.com/w/page/12137724/Bug-Fixing-Guide).
Do not merge pull requests directly through GitHub's interface.
Most pull requests are a single commit; cherry-picking will avoid creating a merge commit.
It's also common for contributors to make minor fixes in an additional one or two commits.
These should be squashed before landing in master.
**Make sure the author has a valid name and email address associated with the commit.**
Fetch the remote first:
git fetch [their-fork.git] [their-branch]
Then cherry-pick the commit(s):
git cherry-pick [sha-of-commit]
If you need to edit the commit message:
git cherry-pick -e [sha-of-commit]
If you need to edit the changes:
git cherry-pick -n [sha-of-commit]
# make changes
git commit --author="[author-name-and-email]"
If it should go to the stable branch, cherry-pick it to stable:
git checkout 1-8-stable
git cherry-pick -x [sha-of-commit-from-master]
*NOTE: Do not cherry-pick into 1-8-stable until you have pushed the commit from master upstream.*
| {
"pile_set_name": "Github"
} |
package uast
import (
"bytes"
"io"
"log"
"sort"
"github.com/minio/highwayhash"
"gopkg.in/bblfsh/client-go.v3/tools"
"gopkg.in/bblfsh/sdk.v2/uast/nodes"
"gopkg.in/src-d/go-git.v4/plumbing"
)
// ChangesXPather extracts changed UAST nodes from files changed in the current commit.
type ChangesXPather struct {
XPath string
}
var hashKey = []byte{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
}
// Extract returns the list of (inserted, removed) UAST nodes filtered by XPath.
func (xpather ChangesXPather) Extract(changes []Change) ([]nodes.Node, []nodes.Node) {
var resultAdded, resultRemoved []nodes.Node
for _, change := range changes {
if change.After == nil {
continue
}
oldNodes := xpather.filter(change.Before, change.Change.From.TreeEntry.Hash)
newNodes := xpather.filter(change.After, change.Change.To.TreeEntry.Hash)
oldHashes := xpather.hash(oldNodes)
newHashes := xpather.hash(newNodes)
// there can be hash collisions; we ignore them
for hash, node := range newHashes {
if _, exists := oldHashes[hash]; !exists {
resultAdded = append(resultAdded, node)
}
}
for hash, node := range oldHashes {
if _, exists := newHashes[hash]; !exists {
resultRemoved = append(resultRemoved, node)
}
}
}
return resultAdded, resultRemoved
}
func (xpather ChangesXPather) filter(root nodes.Node, origin plumbing.Hash) []nodes.Node {
if root == nil {
return nil
}
filtered, err := tools.Filter(root, xpather.XPath)
if err != nil {
log.Printf("libuast filter error on object %s: %v", origin.String(), err)
return []nodes.Node{}
}
var result []nodes.Node
for filtered.Next() {
result = append(result, filtered.Node().(nodes.Node))
}
return result
}
func (xpather ChangesXPather) hash(nodesToHash []nodes.Node) map[uint64]nodes.Node {
result := map[uint64]nodes.Node{}
for _, node := range nodesToHash {
buffer := &bytes.Buffer{}
stringifyUASTNode(node, buffer)
result[highwayhash.Sum64(buffer.Bytes(), hashKey)] = node
}
return result
}
func stringifyUASTNode(node nodes.Node, writer io.Writer) {
for element := range tools.Iterate(tools.NewIterator(node, tools.PositionOrder)) {
var keys []string
obj := element.(nodes.Object)
for key, val := range obj {
if _, ok := val.(nodes.String); ok {
keys = append(keys, key)
}
}
sort.Strings(keys)
for _, key := range keys {
writer.Write([]byte(key + "=" + string(obj[key].(nodes.String)) + ";"))
}
}
}
| {
"pile_set_name": "Github"
} |
<template>
<div class="typora-export os-windows">
<div id='write' class='is-node'><p><span>1、添加项目必须按照如下格式进行</span></p>
<pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang="json"
style="break-inside: unset;"><div class="CodeMirror cm-s-inner CodeMirror-wrap" lang="json"><div
style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"><textarea
autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0"
style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div
class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler"
cm-not-content="true"></div><div
class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer"
style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div
style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div
role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div
class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div
class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline"
style="position: relative;"><div
class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div
class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre
class=" CodeMirror-line " role="presentation"><span role="presentation"
style="padding-right: 0.1px;">{</span></pre></div><pre
class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span
class="cm-string cm-property">"name"</span>: <span class="cm-string">"大数据测试平台"</span>,</span></pre><pre
class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span
class="cm-string cm-property">"code"</span>:<span class="cm-string">"test1"</span>,</span></pre><pre
class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span
class="cm-string cm-property">"description"</span>:<span class="cm-string">"我是描述信息"</span>,</span></pre><pre
class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span
class="cm-string cm-property">"groups"</span>: [</span></pre><pre class=" CodeMirror-line "
role="presentation"><span
role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre
class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span
class="cm-string cm-property">"name"</span>: <span class="cm-string">"用户模块"</span>,</span></pre><pre
class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span
class="cm-string cm-property">"uri"</span>:<span class="cm-string">"http://knife4j.xiaominfo.com"</span>,</span></pre><pre
class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span
class="cm-string cm-property">"header"</span>:<span class="cm-string">"server1"</span>,</span></pre><pre
class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span
class="cm-string cm-property">"url"</span>: <span
class="cm-string">"/v2/api-docs?group=2.X版本"</span>,</span></pre><pre class=" CodeMirror-line "
role="presentation"><span
role="presentation" style="padding-right: 0.1px;"> <span
class="cm-string cm-property">"swaggerVersion"</span>: <span class="cm-string">"2.0"</span></span></pre><pre
class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> },{</span></pre><pre
class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span
class="cm-string cm-property">"name"</span>: <span class="cm-string">"订单模块"</span>,</span></pre><pre
class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span
class="cm-string cm-property">"uri"</span>:<span class="cm-string">"http://swagger-bootstrap-ui.xiaominfo.com"</span>,</span></pre><pre
class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span
class="cm-string cm-property">"header"</span>:<span class="cm-string">"server2"</span>,</span></pre><pre
class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span
class="cm-string cm-property">"url"</span>: <span
class="cm-string">"/v2/api-docs?group=1.8.X版本接口"</span>,</span></pre><pre class=" CodeMirror-line "
role="presentation"><span
role="presentation" style="padding-right: 0.1px;"> <span
class="cm-string cm-property">"swaggerVersion"</span>: <span class="cm-string">"2.0"</span></span></pre><pre
class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre
class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span
class="cm-comment">//more..</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span
role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line "
role="presentation"><span
role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div
style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 420px;"></div><div
class="CodeMirror-gutters" style="display: none; height: 420px;"></div></div></div></pre>
<p>
<span>2、平台会根据用户上传的JSON文件在服务端保存一个</span><code>.json</code><span>文件,每一个项目代表内容都是以上一个完整的</span><code>json</code><span>文件</span>
</p>
<p><span>3、项目</span><code>code</code><span>必须唯一</span></p>
<p><span>4、项目下的服务列表信息中,</span><code>header</code><span>必须全局唯一,该参数值用户可以随机生成,只需要保证唯一性即可,作为Spring Cloud Gateway网关组件的转发依据</span>
</p>
<p>
<span>5、</span><code>groups</code><span>集合中,所提供的Swagger接口必须保证可以访问,完整的访问路径是</span><code>uri</code><span>+</span><code>url</code>
</p>
<p> </p></div>
</div>
</template>
<style scoped>
html {overflow-x: initial !important;}:root { --bg-color:#ffffff; --text-color:#333333; --select-text-bg-color:#B5D6FC; --select-text-font-color:auto; --monospace:"Lucida Console",Consolas,"Courier",monospace; }
html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body { margin: 0px; padding: 0px; height: auto; bottom: 0px; top: 0px; left: 0px; right: 0px; font-size: 1rem; line-height: 1.42857; overflow-x: hidden; background: inherit; tab-size: 4; }
iframe { margin: auto; }
a.url { word-break: break-all; }
a:active, a:hover { outline: 0px; }
.in-text-selection, ::selection { text-shadow: none; background: var(--select-text-bg-color); color: var(--select-text-font-color); }
#write { margin: 0px auto; height: auto; width: inherit; word-break: normal; overflow-wrap: break-word; position: relative; white-space: normal; overflow-x: visible; padding-top: 0px; }
#write.first-line-indent p { text-indent: 2em; }
#write.first-line-indent li p, #write.first-line-indent p * { text-indent: 0px; }
#write.first-line-indent li { margin-left: 2em; }
.for-image #write { padding-left: 8px; padding-right: 8px; }
body.typora-export { padding-left: 30px; padding-right: 30px; }
.typora-export .footnote-line, .typora-export li, .typora-export p { white-space: pre-wrap; }
@media screen and (max-width: 500px) {
body.typora-export { padding-left: 0px; padding-right: 0px; }
#write { padding-left: 20px; padding-right: 20px; }
.CodeMirror-sizer { margin-left: 0px !important; }
.CodeMirror-gutters { display: none !important; }
}
#write li > figure:last-child { margin-bottom: 0.5rem; }
#write ol, #write ul { position: relative; }
img { max-width: 100%; vertical-align: middle; }
button, input, select, textarea { color: inherit; font: inherit; }
input[type="checkbox"], input[type="radio"] { line-height: normal; padding: 0px; }
*, ::after, ::before { box-sizing: border-box; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p, #write pre { width: inherit; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p { position: relative; }
p { line-height: inherit; }
h1, h2, h3, h4, h5, h6 { break-after: avoid-page; break-inside: avoid; orphans: 2; }
p { orphans: 4; }
h1 { font-size: 2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.4rem; }
h5 { font-size: 1.2rem; }
h6 { font-size: 1rem; }
.md-math-block, .md-rawblock, h1, h2, h3, h4, h5, h6, p { margin-top: 1rem; margin-bottom: 1rem; }
.hidden { display: none; }
.md-blockmeta { color: rgb(204, 204, 204); font-weight: 700; font-style: italic; }
a { cursor: pointer; }
sup.md-footnote { padding: 2px 4px; background-color: rgba(238, 238, 238, 0.7); color: rgb(85, 85, 85); border-radius: 4px; cursor: pointer; }
sup.md-footnote a, sup.md-footnote a:hover { color: inherit; text-transform: inherit; text-decoration: inherit; }
#write input[type="checkbox"] { cursor: pointer; width: inherit; height: inherit; }
figure { overflow-x: auto; margin: 1.2em 0px; max-width: calc(100% + 16px); padding: 0px; }
figure > table { margin: 0px !important; }
tr { break-inside: avoid; break-after: auto; }
thead { display: table-header-group; }
table { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; text-align: left; }
table.md-table td { min-width: 32px; }
.CodeMirror-gutters { border-right: 0px; background-color: inherit; }
.CodeMirror-linenumber { user-select: none; }
.CodeMirror { text-align: left; }
.CodeMirror-placeholder { opacity: 0.3; }
.CodeMirror pre { padding: 0px 4px; }
.CodeMirror-lines { padding: 0px; }
div.hr:focus { cursor: none; }
#write pre { white-space: pre-wrap; }
#write.fences-no-line-wrapping pre { white-space: pre; }
#write pre.ty-contain-cm { white-space: normal; }
.CodeMirror-gutters { margin-right: 4px; }
.md-fences { font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; overflow: visible; white-space: pre; background: inherit; position: relative !important; }
.md-diagram-panel { width: 100%; margin-top: 10px; text-align: center; padding-top: 0px; padding-bottom: 8px; overflow-x: auto; }
#write .md-fences.mock-cm { white-space: pre-wrap; }
.md-fences.md-fences-with-lineno { padding-left: 0px; }
#write.fences-no-line-wrapping .md-fences.mock-cm { white-space: pre; overflow-x: auto; }
.md-fences.mock-cm.md-fences-with-lineno { padding-left: 8px; }
.CodeMirror-line, twitterwidget { break-inside: avoid; }
.footnotes { opacity: 0.8; font-size: 0.9rem; margin-top: 1em; margin-bottom: 1em; }
.footnotes + .footnotes { margin-top: 0px; }
.md-reset { margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: top; background: 0px 0px; text-decoration: none; text-shadow: none; float: none; position: static; width: auto; height: auto; white-space: nowrap; cursor: inherit; -webkit-tap-highlight-color: transparent; line-height: normal; font-weight: 400; text-align: left; box-sizing: content-box; direction: ltr; }
li div { padding-top: 0px; }
blockquote { margin: 1rem 0px; }
li .mathjax-block, li p { margin: 0.5rem 0px; }
li { margin: 0px; position: relative; }
blockquote > :last-child { margin-bottom: 0px; }
blockquote > :first-child, li > :first-child { margin-top: 0px; }
.footnotes-area { color: rgb(136, 136, 136); margin-top: 0.714rem; padding-bottom: 0.143rem; white-space: normal; }
#write .footnote-line { white-space: pre-wrap; }
@media print {
body, html { border: 1px solid transparent; height: 99%; break-after: avoid; break-before: avoid; }
#write { margin-top: 0px; padding-top: 0px; border-color: transparent !important; }
.typora-export * { -webkit-print-color-adjust: exact; }
html.blink-to-pdf { font-size: 13px; }
.typora-export #write { padding-left: 32px; padding-right: 32px; padding-bottom: 0px; break-after: avoid; }
.typora-export #write::after { height: 0px; }
}
.footnote-line { margin-top: 0.714em; font-size: 0.7em; }
a img, img a { cursor: pointer; }
pre.md-meta-block { font-size: 0.8rem; min-height: 0.8rem; white-space: pre-wrap; background: rgb(204, 204, 204); display: block; overflow-x: hidden; }
p > .md-image:only-child:not(.md-img-error) img, p > img:only-child { display: block; margin: auto; }
p > .md-image:only-child { display: inline-block; width: 100%; }
#write .MathJax_Display { margin: 0.8em 0px 0px; }
.md-math-block { width: 100%; }
.md-math-block:not(:empty)::after { display: none; }
[contenteditable="true"]:active, [contenteditable="true"]:focus, [contenteditable="false"]:active, [contenteditable="false"]:focus { outline: 0px; box-shadow: none; }
.md-task-list-item { position: relative; list-style-type: none; }
.task-list-item.md-task-list-item { padding-left: 0px; }
.md-task-list-item > input { position: absolute; top: 0px; left: 0px; margin-left: -1.2em; margin-top: calc(1em - 10px); border: none; }
.math { font-size: 1rem; }
.md-toc { min-height: 3.58rem; position: relative; font-size: 0.9rem; border-radius: 10px; }
.md-toc-content { position: relative; margin-left: 0px; }
.md-toc-content::after, .md-toc::after { display: none; }
.md-toc-item { display: block; color: rgb(65, 131, 196); }
.md-toc-item a { text-decoration: none; }
.md-toc-inner:hover { text-decoration: underline; }
.md-toc-inner { display: inline-block; cursor: pointer; }
.md-toc-h1 .md-toc-inner { margin-left: 0px; font-weight: 700; }
.md-toc-h2 .md-toc-inner { margin-left: 2em; }
.md-toc-h3 .md-toc-inner { margin-left: 4em; }
.md-toc-h4 .md-toc-inner { margin-left: 6em; }
.md-toc-h5 .md-toc-inner { margin-left: 8em; }
.md-toc-h6 .md-toc-inner { margin-left: 10em; }
@media screen and (max-width: 48em) {
.md-toc-h3 .md-toc-inner { margin-left: 3.5em; }
.md-toc-h4 .md-toc-inner { margin-left: 5em; }
.md-toc-h5 .md-toc-inner { margin-left: 6.5em; }
.md-toc-h6 .md-toc-inner { margin-left: 8em; }
}
a.md-toc-inner { font-size: inherit; font-style: inherit; font-weight: inherit; line-height: inherit; }
.footnote-line a:not(.reversefootnote) { color: inherit; }
.md-attr { display: none; }
.md-fn-count::after { content: "."; }
code, pre, samp, tt { font-family: var(--monospace); }
kbd { margin: 0px 0.1em; padding: 0.1em 0.6em; font-size: 0.8em; color: rgb(36, 39, 41); background: rgb(255, 255, 255); border: 1px solid rgb(173, 179, 185); border-radius: 3px; box-shadow: rgba(12, 13, 14, 0.2) 0px 1px 0px, rgb(255, 255, 255) 0px 0px 0px 2px inset; white-space: nowrap; vertical-align: middle; }
.md-comment { color: rgb(162, 127, 3); opacity: 0.8; font-family: var(--monospace); }
code { text-align: left; vertical-align: initial; }
a.md-print-anchor { white-space: pre !important; border-width: initial !important; border-style: none !important; border-color: initial !important; display: inline-block !important; position: absolute !important; width: 1px !important; right: 0px !important; outline: 0px !important; background: 0px 0px !important; text-decoration: initial !important; text-shadow: initial !important; }
.md-inline-math .MathJax_SVG .noError { display: none !important; }
.html-for-mac .inline-math-svg .MathJax_SVG { vertical-align: 0.2px; }
.md-math-block .MathJax_SVG_Display { text-align: center; margin: 0px; position: relative; text-indent: 0px; max-width: none; max-height: none; min-height: 0px; min-width: 100%; width: auto; overflow-y: hidden; display: block !important; }
.MathJax_SVG_Display, .md-inline-math .MathJax_SVG_Display { width: auto; margin: inherit; display: inline-block !important; }
.MathJax_SVG .MJX-monospace { font-family: var(--monospace); }
.MathJax_SVG .MJX-sans-serif { font-family: sans-serif; }
.MathJax_SVG { display: inline; font-style: normal; font-weight: 400; line-height: normal; zoom: 90%; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; }
.MathJax_SVG * { transition: none 0s ease 0s; }
.MathJax_SVG_Display svg { vertical-align: middle !important; margin-bottom: 0px !important; margin-top: 0px !important; }
.os-windows.monocolor-emoji .md-emoji { font-family: "Segoe UI Symbol", sans-serif; }
.md-diagram-panel > svg { max-width: 100%; }
[lang="flow"] svg, [lang="mermaid"] svg { max-width: 100%; height: auto; }
[lang="mermaid"] .node text { font-size: 1rem; }
table tr th { border-bottom: 0px; }
video { max-width: 100%; display: block; margin: 0px auto; }
iframe { max-width: 100%; width: 100%; border: none; }
.highlight td, .highlight tr { border: 0px; }
svg[id^="mermaidChart"] { line-height: 1em; }
mark { background: rgb(255, 255, 0); color: rgb(0, 0, 0); }
.md-html-inline .md-plain, .md-html-inline strong, mark .md-inline-math, mark strong { color: inherit; }
mark .md-meta { color: rgb(0, 0, 0); opacity: 0.3 !important; }
.CodeMirror { height: auto; }
.CodeMirror.cm-s-inner { background: inherit; }
.CodeMirror-scroll { overflow: auto hidden; z-index: 3; }
.CodeMirror-gutter-filler, .CodeMirror-scrollbar-filler { background-color: rgb(255, 255, 255); }
.CodeMirror-gutters { border-right: 1px solid rgb(221, 221, 221); background: inherit; white-space: nowrap; }
.CodeMirror-linenumber { padding: 0px 3px 0px 5px; text-align: right; color: rgb(153, 153, 153); }
.cm-s-inner .cm-keyword { color: rgb(119, 0, 136); }
.cm-s-inner .cm-atom, .cm-s-inner.cm-atom { color: rgb(34, 17, 153); }
.cm-s-inner .cm-number { color: rgb(17, 102, 68); }
.cm-s-inner .cm-def { color: rgb(0, 0, 255); }
.cm-s-inner .cm-variable { color: rgb(0, 0, 0); }
.cm-s-inner .cm-variable-2 { color: rgb(0, 85, 170); }
.cm-s-inner .cm-variable-3 { color: rgb(0, 136, 85); }
.cm-s-inner .cm-string { color: rgb(170, 17, 17); }
.cm-s-inner .cm-property { color: rgb(0, 0, 0); }
.cm-s-inner .cm-operator { color: rgb(152, 26, 26); }
.cm-s-inner .cm-comment, .cm-s-inner.cm-comment { color: rgb(170, 85, 0); }
.cm-s-inner .cm-string-2 { color: rgb(255, 85, 0); }
.cm-s-inner .cm-meta { color: rgb(85, 85, 85); }
.cm-s-inner .cm-qualifier { color: rgb(85, 85, 85); }
.cm-s-inner .cm-builtin { color: rgb(51, 0, 170); }
.cm-s-inner .cm-bracket { color: rgb(153, 153, 119); }
.cm-s-inner .cm-tag { color: rgb(17, 119, 0); }
.cm-s-inner .cm-attribute { color: rgb(0, 0, 204); }
.cm-s-inner .cm-header, .cm-s-inner.cm-header { color: rgb(0, 0, 255); }
.cm-s-inner .cm-quote, .cm-s-inner.cm-quote { color: rgb(0, 153, 0); }
.cm-s-inner .cm-hr, .cm-s-inner.cm-hr { color: rgb(153, 153, 153); }
.cm-s-inner .cm-link, .cm-s-inner.cm-link { color: rgb(0, 0, 204); }
.cm-negative { color: rgb(221, 68, 68); }
.cm-positive { color: rgb(34, 153, 34); }
.cm-header, .cm-strong { font-weight: 700; }
.cm-del { text-decoration: line-through; }
.cm-em { font-style: italic; }
.cm-link { text-decoration: underline; }
.cm-error { color: red; }
.cm-invalidchar { color: red; }
.cm-constant { color: rgb(38, 139, 210); }
.cm-defined { color: rgb(181, 137, 0); }
div.CodeMirror span.CodeMirror-matchingbracket { color: rgb(0, 255, 0); }
div.CodeMirror span.CodeMirror-nonmatchingbracket { color: rgb(255, 34, 34); }
.cm-s-inner .CodeMirror-activeline-background { background: inherit; }
.CodeMirror { position: relative; overflow: hidden; }
.CodeMirror-scroll { height: 100%; outline: 0px; position: relative; box-sizing: content-box; background: inherit; }
.CodeMirror-sizer { position: relative; }
.CodeMirror-gutter-filler, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-vscrollbar { position: absolute; z-index: 6; display: none; }
.CodeMirror-vscrollbar { right: 0px; top: 0px; overflow: hidden; }
.CodeMirror-hscrollbar { bottom: 0px; left: 0px; overflow: hidden; }
.CodeMirror-scrollbar-filler { right: 0px; bottom: 0px; }
.CodeMirror-gutter-filler { left: 0px; bottom: 0px; }
.CodeMirror-gutters { position: absolute; left: 0px; top: 0px; padding-bottom: 30px; z-index: 3; }
.CodeMirror-gutter { white-space: normal; height: 100%; box-sizing: content-box; padding-bottom: 30px; margin-bottom: -32px; display: inline-block; }
.CodeMirror-gutter-wrapper { position: absolute; z-index: 4; background: 0px 0px !important; border: none !important; }
.CodeMirror-gutter-background { position: absolute; top: 0px; bottom: 0px; z-index: 4; }
.CodeMirror-gutter-elt { position: absolute; cursor: default; z-index: 4; }
.CodeMirror-lines { cursor: text; }
.CodeMirror pre { border-radius: 0px; border-width: 0px; background: 0px 0px; font-family: inherit; font-size: inherit; margin: 0px; white-space: pre; overflow-wrap: normal; color: inherit; z-index: 2; position: relative; overflow: visible; }
.CodeMirror-wrap pre { overflow-wrap: break-word; white-space: pre-wrap; word-break: normal; }
.CodeMirror-code pre { border-right: 30px solid transparent; width: fit-content; }
.CodeMirror-wrap .CodeMirror-code pre { border-right: none; width: auto; }
.CodeMirror-linebackground { position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px; z-index: 0; }
.CodeMirror-linewidget { position: relative; z-index: 2; overflow: auto; }
.CodeMirror-wrap .CodeMirror-scroll { overflow-x: hidden; }
.CodeMirror-measure { position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden; }
.CodeMirror-measure pre { position: static; }
.CodeMirror div.CodeMirror-cursor { position: absolute; visibility: hidden; border-right: none; width: 0px; }
.CodeMirror div.CodeMirror-cursor { visibility: hidden; }
.CodeMirror-focused div.CodeMirror-cursor { visibility: inherit; }
.cm-searching { background: rgba(255, 255, 0, 0.4); }
@media print {
.CodeMirror div.CodeMirror-cursor { visibility: hidden; }
}
html {
font-size: 16px;
}
body {
background: #fff;
font-family: Monaco,Source Han Sans SC, sans-serif;
color: #555;
}
#write {
max-width: 60em;
}
margin 0 auto {
padding: 20px 30px 50px;
}
h1,
h2,
h3,
h4,
h5,
h6 {
position: relative;
margin-top: 1em;
margin-bottom: 1em;
font-weight: bold;
line-height: 1.4em;
}
h1 {
font-size: 2em;
line-height: 1.2em;
}
h2 {
font-size: 1.5em;
line-height: 1.225em;
}
h3 {
font-size: 1.3em;
line-height: 1.43em;
}
h4 {
font-size: 1.2em;
}
h5 {
font-size: 1em;
}
h6 {
font-size: 1em;
color: #999;
}
hr {
border: 1px solid #ddd;
}
a {
text-decoration: none;
color: #258fb8;
}
a:hover,
a:active {
text-decoration: underline;
}
ul,
ol {
padding-left: 2em;
}
.task-list {
padding-left: 2em;
}
.task-list-item {
padding-left: 1.6em;
}
.task-list-item input {
top: 3px;
left: 8px;
}
table {
width: 100%;
border-collapse: collapse;
border-spacing: 0;
}
table th {
font-weight: bold;
border-bottom: 3px solid #ddd;
padding-bottom: 0.5em;
}
table td {
border-bottom: 1px solid #ddd;
padding: 10px 0;
}
blockquote {
border-left: 5px solid #ddd;
padding-left: 0.5em;
font-family: Source Han Serif SC, serif;
color: #555;
}
blockquote blockquote {
padding-right: 0;
}
.md-fences,
code,
tt {
margin: 0 0.3em;
padding: 0 0.3em;
background: #eee;
font-family: mononoki, monospace;
text-shadow: 0 1px #fff;
}
.md-fences {
margin: 15px auto;
padding: 0.7em 1em;
text-shadow: none;
}
/** ported from https://codemirror.net/theme/material.css **/
/*
Name: material
Author: Michael Kaminsky (http://github.com/mkaminsky11)
Original material color scheme by Mattia Astorino (https://github.com/equinusocio/material-theme)
*/
.cm-s-inner {
background-color: #263238;
color: rgba(233, 237, 237, 1);
}
.cm-s-inner .CodeMirror-gutters {
background: #263238;
color: rgb(83,127,126);
border: none;
}
.cm-s-inner .CodeMirror-guttermarker, .cm-s-inner .CodeMirror-guttermarker-subtle, .cm-s-inner .CodeMirror-linenumber { color: rgb(83,127,126); }
.cm-s-inner .CodeMirror-cursor { border-left: 1px solid #f8f8f0; }
.cm-s-inner div.CodeMirror-selected { background: rgba(255, 255, 255, 0.15); }
.cm-s-inner.CodeMirror-focused div.CodeMirror-selected { background: rgba(255, 255, 255, 0.10); }
.cm-s-inner .CodeMirror-line::selection, .cm-s-inner .CodeMirror-line > span::selection, .cm-s-inner .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); }
.cm-s-inner .CodeMirror-line::-moz-selection, .cm-s-inner .CodeMirror-line > span::-moz-selection, .cm-s-inner .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); }
.cm-s-inner .CodeMirror-activeline-background { background: rgba(0, 0, 0, 0); }
.cm-s-inner .cm-keyword { color: rgba(199, 146, 234, 1); }
.cm-s-inner .cm-operator { color: rgba(233, 237, 237, 1); }
.cm-s-inner .cm-variable-2 { color: #80CBC4; }
.cm-s-inner .cm-variable-3 { color: #82B1FF; }
.cm-s-inner .cm-builtin { color: #DECB6B; }
.cm-s-inner .cm-atom { color: #F77669; }
.cm-s-inner .cm-number { color: #F77669; }
.cm-s-inner .cm-def { color: rgba(233, 237, 237, 1); }
.cm-s-inner .cm-string { color: #C3E88D; }
.cm-s-inner .cm-string-2 { color: #80CBC4; }
.cm-s-inner .cm-comment { color: #546E7A; }
.cm-s-inner .cm-variable { color: #82B1FF; }
.cm-s-inner .cm-tag { color: #80CBC4; }
.cm-s-inner .cm-meta { color: #80CBC4; }
.cm-s-inner .cm-attribute { color: #FFCB6B; }
.cm-s-inner .cm-property { color: #80CBAE; }
.cm-s-inner .cm-qualifier { color: #DECB6B; }
.cm-s-inner .cm-variable-3 { color: #DECB6B; }
.cm-s-inner .cm-tag { color: rgba(255, 83, 112, 1); }
.cm-s-inner .cm-error {
color: rgba(255, 255, 255, 1.0);
background-color: #EC5F67;
}
.cm-s-inner .CodeMirror-matchingbracket {
text-decoration: underline;
color: white !important;
}
/**apply to code fences with plan text**/
.md-fences {
background-color: #263238;
color: rgba(233, 237, 237, 1);
border: none;
}
.md-fences .code-tooltip {
background-color: #263238;
}
.cm-s-typora-default {
background-color: #263238;
color: rgba(233, 237, 237, 1);
}
.cm-s-typora-default .CodeMirror-gutters {
background: #263238;
color: rgb(83,127,126);
border: none;
}
.cm-s-typora-default .CodeMirror-guttermarker, .cm-s-typora-default .CodeMirror-guttermarker-subtle, .cm-s-typora-default .CodeMirror-linenumber { color: rgb(83,127,126); }
.cm-s-typora-default .CodeMirror-cursor { border-left: 1px solid #f8f8f0; }
.cm-s-typora-default div.CodeMirror-selected { background: rgba(255, 255, 255, 0.15); }
.cm-s-typora-default.CodeMirror-focused div.CodeMirror-selected { background: rgba(255, 255, 255, 0.10); }
.cm-s-typora-default .CodeMirror-line::selection, .cm-s-typora-default .CodeMirror-line > span::selection, .cm-s-typora-default .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); }
.cm-s-typora-default .CodeMirror-line::-moz-selection, .cm-s-typora-default .CodeMirror-line > span::-moz-selection, .cm-s-typora-default .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); }
.cm-s-typora-default .CodeMirror-activeline-background { background: rgba(0, 0, 0, 0); }
.cm-s-typora-default .cm-keyword { color: rgba(199, 146, 234, 1); }
.cm-s-typora-default .cm-operator { color: rgba(233, 237, 237, 1); }
.cm-s-typora-default .cm-variable-2 { color: #80CBC4; }
.cm-s-typora-default .cm-variable-3 { color: #82B1FF; }
.cm-s-typora-default .cm-builtin { color: #DECB6B; }
.cm-s-typora-default .cm-atom { color: #F77669; }
.cm-s-typora-default .cm-number { color: #F77669; }
.cm-s-typora-default .cm-def { color: rgba(233, 237, 237, 1); }
.cm-s-typora-default .cm-string { color: #C3E88D; }
.cm-s-typora-default .cm-string-2 { color: #80CBC4; }
.cm-s-typora-default .cm-comment { color: #546E7A; }
.cm-s-typora-default .cm-variable { color: #82B1FF; }
.cm-s-typora-default .cm-tag { color: #80CBC4; }
.cm-s-typora-default .cm-meta { color: #80CBC4; }
.cm-s-typora-default .cm-attribute { color: #FFCB6B; }
.cm-s-typora-default .cm-property { color: #80CBAE; }
.cm-s-typora-default .cm-qualifier { color: #DECB6B; }
.cm-s-typora-default .cm-variable-3 { color: #DECB6B; }
.cm-s-typora-default .cm-tag { color: rgba(255, 83, 112, 1); }
.cm-s-typora-default .cm-error {
color: rgba(255, 255, 255, 1.0);
background-color: #EC5F67;
}
.cm-s-typora-default .CodeMirror-matchingbracket {
text-decoration: underline;
color: white !important;
}
/**apply to code fences with plan text**/
.md-fences {
background-color: #263238;
color: rgba(233, 237, 237, 1);
border: none;
}
.md-fences .code-tooltip {
background-color: #263238;
}
.CodeMirror div.CodeMirror-cursor {
border-left: 1px solid #e4629a;
}
#write pre.md-meta-block {
padding: 1em;
background-color: #fff;
border-bottom: 1px dashed #ddd;
color: #80cbc4;
margin-top: 0 !important;
}
.md-image>.md-meta {
color: inherit;
}
header,
.context-menu,
.megamenu-content,
footer {
font-family: Source Han Sans SC, sans-serif;
}
@media print {
html {
font-size: 13px;
}
table,
pre {
page-break-inside: avoid;
}
pre {
word-wrap: break-word;
}
}
header,
.context-menu,
.megamenu-content,
footer {
font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, sans-serif;
}
.md-diagram-panel-preview {
color: #263238;
}
.typora-export li, .typora-export p, .typora-export, .footnote-line {white-space: normal;}
</style> | {
"pile_set_name": "Github"
} |
\documentclass[12pt,fleqn]{article}
\usepackage{../../vkCourseML}
\theorembodyfont{\rmfamily}
\newtheorem{esProblem}{Задача}
\title{Машинное обучение, ФКН ВШЭ\\Теоретическое домашнее задание №9}
\author{}
\date{}
\begin{document}
\maketitle
\begin{esProblem}[1 балл]
Рассмотрим двойственное представление задачи гребневой регрессии:
\[
Q(a)
=
\frac{1}{2} \| K a - y \|^2 + \frac{\lambda}{2} a^T K a \to \min_a.
\]
Покажите, что решение этой задачи записывается как
\[
a = (K + \lambda I)^{-1} y.
\]
\end{esProblem}
\begin{esProblem}[1 балл]
Покажите, что функция
\[
K(x, z) = \cos(x - z)
\]
для~$x, z \in \RR$ является ядром.
\end{esProblem}
\begin{esProblem}[1 балл]
Рассмотрим функцию, равную косинусу угла между двумя векторами~$x, z \in \RR^d$:
\[
K(x, z) = \cos(\widehat{x, z}).
\]
Покажите, что она является ядром.
\end{esProblem}
\begin{esProblem}[1 балл]
Рассмотрим ядра~$K_1(x, z) = (xz + 1)^2$ и~$K_2(x, z) = (xz - 1)^2$,
заданные для~$x, z \in \RR$.
Найдите спрямляющие пространства для~$K_1$, $K_2$ и~$K_1 + K_2$.
\end{esProblem}
\begin{esProblem}[2 балла]
Рассмотрим следующую функцию на пространстве вещественных чисел:
\[
K(x, z) = \frac{1}{1 + e^{-xz}}.
\]
Покажите, что она не является ядром.
\end{esProblem}
\begin{esProblem}[2 балла]
На одном из семинаров было рассмотрено all-subsequences kernel. Рассмотрим его модификацию fixed length subsequences kernel, которая учитывает лишь подпоследовательности фиксированной длины $p$:
\begin{align*}
\left(\phi^p(s) \right)_u = \left| \{i: s(i) = u \} \right|, \, u \in \Sigma^p,\\
K_p(s, t) = \left\langle \phi^p(s), \phi^p(t) \right\rangle = \sum_{u \in \Sigma^p} (\phi^p(s))_u (\phi^p(t))_u.
\end{align*}
Выведите реккурентные формулы для вычисления $K_p(s, t)$ аналогично выведенным на семинаре.
\end{esProblem}
\end{document}
| {
"pile_set_name": "Github"
} |
// RUN: %clang_cc1 -emit-llvm %s -o /dev/null
struct face_cachel {
unsigned int reverse :1;
unsigned char font_specified[1];
};
void
ensure_face_cachel_contains_charset (struct face_cachel *cachel) {
cachel->font_specified[0] = 0;
}
| {
"pile_set_name": "Github"
} |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Media;
namespace SvgToXaml.WrapPanel
{
public class VirtualizingWrapPanel : VirtualizingPanel, IScrollInfo
{
private const double ScrollLineAmount = 16.0;
private Size _extentSize;
private Size _viewportSize;
private Point _offset;
private ItemsControl _itemsControl;
private readonly Dictionary<UIElement, Rect> _childLayouts = new Dictionary<UIElement, Rect>();
public static readonly DependencyProperty ItemWidthProperty =
DependencyProperty.Register("ItemWidth", typeof(double), typeof(VirtualizingWrapPanel), new PropertyMetadata(32.0, HandleItemDimensionChanged));
public static readonly DependencyProperty ItemHeightProperty =
DependencyProperty.Register("ItemHeight", typeof(double), typeof(VirtualizingWrapPanel), new PropertyMetadata(32.0, HandleItemDimensionChanged));
private static readonly DependencyProperty VirtualItemIndexProperty =
DependencyProperty.RegisterAttached("VirtualItemIndex", typeof(int), typeof(VirtualizingWrapPanel), new PropertyMetadata(-1));
private IRecyclingItemContainerGenerator _itemsGenerator;
private bool _isInMeasure;
private static int GetVirtualItemIndex(DependencyObject obj)
{
return (int)obj.GetValue(VirtualItemIndexProperty);
}
private static void SetVirtualItemIndex(DependencyObject obj, int value)
{
obj.SetValue(VirtualItemIndexProperty, value);
}
public double ItemHeight
{
get { return (double)GetValue(ItemHeightProperty); }
set { SetValue(ItemHeightProperty, value); }
}
public double ItemWidth
{
get { return (double)GetValue(ItemWidthProperty); }
set { SetValue(ItemWidthProperty, value); }
}
public VirtualizingWrapPanel()
{
if (!DesignerProperties.GetIsInDesignMode(this))
{
Dispatcher.BeginInvoke((Action)Initialize);
}
}
private void Initialize()
{
_itemsControl = ItemsControl.GetItemsOwner(this);
_itemsGenerator = (IRecyclingItemContainerGenerator)ItemContainerGenerator;
InvalidateMeasure();
}
protected override void OnItemsChanged(object sender, ItemsChangedEventArgs args)
{
base.OnItemsChanged(sender, args);
InvalidateMeasure();
}
protected override Size MeasureOverride(Size availableSize)
{
if (_itemsControl == null)
{
return availableSize;
}
_isInMeasure = true;
_childLayouts.Clear();
var extentInfo = GetExtentInfo(availableSize);
EnsureScrollOffsetIsWithinConstrains(extentInfo);
var layoutInfo = GetLayoutInfo(availableSize, ItemHeight, extentInfo);
RecycleItems(layoutInfo);
// Determine where the first item is in relation to previously realized items
var generatorStartPosition = _itemsGenerator.GeneratorPositionFromIndex(layoutInfo.FirstRealizedItemIndex);
var visualIndex = 0;
var currentX = layoutInfo.FirstRealizedItemLeft;
var currentY = layoutInfo.FirstRealizedLineTop;
using (_itemsGenerator.StartAt(generatorStartPosition, GeneratorDirection.Forward, true))
{
for (var itemIndex = layoutInfo.FirstRealizedItemIndex; itemIndex <= layoutInfo.LastRealizedItemIndex; itemIndex++, visualIndex++)
{
bool newlyRealized;
var child = (UIElement)_itemsGenerator.GenerateNext(out newlyRealized);
SetVirtualItemIndex(child, itemIndex);
if (newlyRealized)
{
InsertInternalChild(visualIndex, child);
}
else
{
// check if item needs to be moved into a new position in the Children collection
if (visualIndex < Children.Count)
{
if (!ReferenceEquals(Children[visualIndex], child))
{
var childCurrentIndex = Children.IndexOf(child);
if (childCurrentIndex >= 0)
{
RemoveInternalChildRange(childCurrentIndex, 1);
}
InsertInternalChild(visualIndex, child);
}
}
else
{
// we know that the child can't already be in the children collection
// because we've been inserting children in correct visualIndex order,
// and this child has a visualIndex greater than the Children.Count
AddInternalChild(child);
}
}
// only prepare the item once it has been added to the visual tree
_itemsGenerator.PrepareItemContainer(child);
child.Measure(new Size(ItemWidth, ItemHeight));
_childLayouts.Add(child, new Rect(currentX, currentY, ItemWidth, ItemHeight));
if (currentX + ItemWidth * 2 >= availableSize.Width)
{
// wrap to a new line
currentY += ItemHeight;
currentX = 0;
}
else
{
currentX += ItemWidth;
}
}
}
RemoveRedundantChildren();
UpdateScrollInfo(availableSize, extentInfo);
var desiredSize = new Size(double.IsInfinity(availableSize.Width) ? 0 : availableSize.Width,
double.IsInfinity(availableSize.Height) ? 0 : availableSize.Height);
_isInMeasure = false;
return desiredSize;
}
private void EnsureScrollOffsetIsWithinConstrains(ExtentInfo extentInfo)
{
_offset.Y = Clamp(_offset.Y, 0, extentInfo.MaxVerticalOffset);
}
private void RecycleItems(ItemLayoutInfo layoutInfo)
{
foreach (UIElement child in Children)
{
var virtualItemIndex = GetVirtualItemIndex(child);
if (virtualItemIndex < layoutInfo.FirstRealizedItemIndex || virtualItemIndex > layoutInfo.LastRealizedItemIndex)
{
var generatorPosition = _itemsGenerator.GeneratorPositionFromIndex(virtualItemIndex);
if (generatorPosition.Index >= 0)
{
_itemsGenerator.Recycle(generatorPosition, 1);
}
}
SetVirtualItemIndex(child, -1);
}
}
protected override Size ArrangeOverride(Size finalSize)
{
foreach (UIElement child in Children)
{
child.Arrange(_childLayouts[child]);
}
return finalSize;
}
private void UpdateScrollInfo(Size availableSize, ExtentInfo extentInfo)
{
_viewportSize = availableSize;
_extentSize = new Size(availableSize.Width, extentInfo.ExtentHeight);
InvalidateScrollInfo();
}
private void RemoveRedundantChildren()
{
// iterate backwards through the child collection because we're going to be
// removing items from it
for (var i = Children.Count - 1; i >= 0; i--)
{
var child = Children[i];
// if the virtual item index is -1, this indicates
// it is a recycled item that hasn't been reused this time round
if (GetVirtualItemIndex(child) == -1)
{
RemoveInternalChildRange(i, 1);
}
}
}
private ItemLayoutInfo GetLayoutInfo(Size availableSize, double itemHeight, ExtentInfo extentInfo)
{
if (_itemsControl == null)
{
return new ItemLayoutInfo();
}
// we need to ensure that there is one realized item prior to the first visible item, and one after the last visible item,
// so that keyboard navigation works properly. For example, when focus is on the first visible item, and the user
// navigates up, the ListBox selects the previous item, and the scrolls that into view - and this triggers the loading of the rest of the items
// in that row
var firstVisibleLine = (int)Math.Floor(VerticalOffset / itemHeight);
var firstRealizedIndex = Math.Max(extentInfo.ItemsPerLine * firstVisibleLine - 1, 0);
var firstRealizedItemLeft = firstRealizedIndex % extentInfo.ItemsPerLine * ItemWidth - HorizontalOffset;
// ReSharper disable once PossibleLossOfFraction
var firstRealizedItemTop = firstRealizedIndex / extentInfo.ItemsPerLine * itemHeight - VerticalOffset;
var firstCompleteLineTop = (firstVisibleLine == 0 ? firstRealizedItemTop : firstRealizedItemTop + ItemHeight);
var completeRealizedLines = (int)Math.Ceiling((availableSize.Height - firstCompleteLineTop) / itemHeight);
var lastRealizedIndex = Math.Min(firstRealizedIndex + completeRealizedLines * extentInfo.ItemsPerLine + 2, _itemsControl.Items.Count - 1);
return new ItemLayoutInfo
{
FirstRealizedItemIndex = firstRealizedIndex,
FirstRealizedItemLeft = firstRealizedItemLeft,
FirstRealizedLineTop = firstRealizedItemTop,
LastRealizedItemIndex = lastRealizedIndex,
};
}
private ExtentInfo GetExtentInfo(Size viewPortSize)
{
if (_itemsControl == null)
{
return new ExtentInfo();
}
var itemsPerLine = Math.Max((int)Math.Floor(viewPortSize.Width / ItemWidth), 1);
var totalLines = (int)Math.Ceiling((double)_itemsControl.Items.Count / itemsPerLine);
var extentHeight = Math.Max(totalLines * ItemHeight, viewPortSize.Height);
return new ExtentInfo
{
ItemsPerLine = itemsPerLine,
TotalLines = totalLines,
ExtentHeight = extentHeight,
MaxVerticalOffset = extentHeight - viewPortSize.Height,
};
}
public void LineUp()
{
SetVerticalOffset(VerticalOffset - ScrollLineAmount);
}
public void LineDown()
{
SetVerticalOffset(VerticalOffset + ScrollLineAmount);
}
public void LineLeft()
{
SetHorizontalOffset(HorizontalOffset + ScrollLineAmount);
}
public void LineRight()
{
SetHorizontalOffset(HorizontalOffset - ScrollLineAmount);
}
public void PageUp()
{
SetVerticalOffset(VerticalOffset - ViewportHeight);
}
public void PageDown()
{
SetVerticalOffset(VerticalOffset + ViewportHeight);
}
public void PageLeft()
{
SetHorizontalOffset(HorizontalOffset + ItemWidth);
}
public void PageRight()
{
SetHorizontalOffset(HorizontalOffset - ItemWidth);
}
public void MouseWheelUp()
{
SetVerticalOffset(VerticalOffset - ScrollLineAmount * SystemParameters.WheelScrollLines);
}
public void MouseWheelDown()
{
SetVerticalOffset(VerticalOffset + ScrollLineAmount * SystemParameters.WheelScrollLines);
}
public void MouseWheelLeft()
{
SetHorizontalOffset(HorizontalOffset - ScrollLineAmount * SystemParameters.WheelScrollLines);
}
public void MouseWheelRight()
{
SetHorizontalOffset(HorizontalOffset + ScrollLineAmount * SystemParameters.WheelScrollLines);
}
public void SetHorizontalOffset(double offset)
{
if (_isInMeasure)
{
return;
}
offset = Clamp(offset, 0, ExtentWidth - ViewportWidth);
_offset = new Point(offset, _offset.Y);
InvalidateScrollInfo();
InvalidateMeasure();
}
public void SetVerticalOffset(double offset)
{
if (_isInMeasure)
{
return;
}
offset = Clamp(offset, 0, ExtentHeight - ViewportHeight);
_offset = new Point(_offset.X, offset);
InvalidateScrollInfo();
InvalidateMeasure();
}
public Rect MakeVisible(Visual visual, Rect rectangle)
{
if (rectangle.IsEmpty ||
visual == null ||
ReferenceEquals(visual, this) ||
!IsAncestorOf(visual))
{
return Rect.Empty;
}
rectangle = visual.TransformToAncestor(this).TransformBounds(rectangle);
var viewRect = new Rect(HorizontalOffset, VerticalOffset, ViewportWidth, ViewportHeight);
rectangle.X += viewRect.X;
rectangle.Y += viewRect.Y;
viewRect.X = CalculateNewScrollOffset(viewRect.Left, viewRect.Right, rectangle.Left, rectangle.Right);
viewRect.Y = CalculateNewScrollOffset(viewRect.Top, viewRect.Bottom, rectangle.Top, rectangle.Bottom);
SetHorizontalOffset(viewRect.X);
SetVerticalOffset(viewRect.Y);
rectangle.Intersect(viewRect);
rectangle.X -= viewRect.X;
rectangle.Y -= viewRect.Y;
return rectangle;
}
private static double CalculateNewScrollOffset(double topView, double bottomView, double topChild, double bottomChild)
{
var offBottom = topChild < topView && bottomChild < bottomView;
var offTop = bottomChild > bottomView && topChild > topView;
var tooLarge = (bottomChild - topChild) > (bottomView - topView);
if (!offBottom && !offTop)
return topView;
if ((offBottom && !tooLarge) || (offTop && tooLarge))
return topChild;
return bottomChild - (bottomView - topView);
}
public ItemLayoutInfo GetVisibleItemsRange()
{
return GetLayoutInfo(_viewportSize, ItemHeight, GetExtentInfo(_viewportSize));
}
public bool CanVerticallyScroll
{
get;
set;
}
public bool CanHorizontallyScroll
{
get;
set;
}
public double ExtentWidth => _extentSize.Width;
public double ExtentHeight => _extentSize.Height;
public double ViewportWidth => _viewportSize.Width;
public double ViewportHeight => _viewportSize.Height;
public double HorizontalOffset => _offset.X;
public double VerticalOffset => _offset.Y;
public ScrollViewer ScrollOwner
{
get;
set;
}
private void InvalidateScrollInfo()
{
ScrollOwner?.InvalidateScrollInfo();
}
private static void HandleItemDimensionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var wrapPanel = (d as VirtualizingWrapPanel);
wrapPanel?.InvalidateMeasure();
}
private double Clamp(double value, double min, double max)
{
return Math.Min(Math.Max(value, min), max);
}
internal class ExtentInfo
{
public int ItemsPerLine;
public int TotalLines;
public double ExtentHeight;
public double MaxVerticalOffset;
}
public class ItemLayoutInfo
{
public int FirstRealizedItemIndex;
public double FirstRealizedLineTop;
public double FirstRealizedItemLeft;
public int LastRealizedItemIndex;
}
}
}
| {
"pile_set_name": "Github"
} |
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
struct c<T where h: d {
var d {
for c : B<Int>
struct B<I
| {
"pile_set_name": "Github"
} |
//
// UITextField+RACSignalSupport.m
// ReactiveObjC
//
// Created by Josh Abernathy on 4/17/12.
// Copyright (c) 2012 GitHub, Inc. All rights reserved.
//
#import "UITextField+RACSignalSupport.h"
#import <ReactiveObjC/RACEXTKeyPathCoding.h>
#import <ReactiveObjC/RACEXTScope.h>
#import "NSObject+RACDeallocating.h"
#import "NSObject+RACDescription.h"
#import "RACSignal+Operations.h"
#import "UIControl+RACSignalSupport.h"
#import "UIControl+RACSignalSupportPrivate.h"
@implementation UITextField (RACSignalSupport)
- (RACSignal *)rac_textSignal {
@weakify(self);
return [[[[[RACSignal
defer:^{
@strongify(self);
return [RACSignal return:self];
}]
concat:[self rac_signalForControlEvents:UIControlEventAllEditingEvents]]
map:^(UITextField *x) {
return x.text;
}]
takeUntil:self.rac_willDeallocSignal]
setNameWithFormat:@"%@ -rac_textSignal", RACDescription(self)];
}
- (RACChannelTerminal *)rac_newTextChannel {
return [self rac_channelForControlEvents:UIControlEventAllEditingEvents key:@keypath(self.text) nilValue:@""];
}
@end
| {
"pile_set_name": "Github"
} |
{
"name": "RNViewPagerDemo",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.0.0-alpha.12",
"react-native": "^0.48.4",
"react-native-deprecated-custom-components": "^0.1.1",
"rn-viewpager": "^1.2.4"
},
"devDependencies": {
"babel-jest": "19.0.0",
"babel-preset-react-native": "1.9.1",
"jest": "19.0.2",
"react-test-renderer": "~15.4.1"
},
"jest": {
"preset": "react-native"
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.channel;
import java.util.Comparator;
import org.springframework.messaging.Message;
/**
* @author Mark Fisher
*/
public class MessagePayloadTestComparator implements Comparator<Message<Comparable<Object>>> {
public int compare(Message<Comparable<Object>> message1, Message<Comparable<Object>> message2) {
return message1.getPayload().compareTo(message2.getPayload());
}
}
| {
"pile_set_name": "Github"
} |
// Copyright 2015 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 htmlindex
import (
"testing"
"golang.org/x/text/encoding"
"golang.org/x/text/encoding/charmap"
"golang.org/x/text/encoding/internal/identifier"
"golang.org/x/text/encoding/unicode"
"golang.org/x/text/language"
)
func TestGet(t *testing.T) {
for i, tc := range []struct {
name string
canonical string
err error
}{
{"utf-8", "utf-8", nil},
{" utf-8 ", "utf-8", nil},
{" l5 ", "windows-1254", nil},
{"latin5 ", "windows-1254", nil},
{"latin 5", "", errInvalidName},
{"latin-5", "", errInvalidName},
} {
enc, err := Get(tc.name)
if err != tc.err {
t.Errorf("%d: error was %v; want %v", i, err, tc.err)
}
if err != nil {
continue
}
if got, err := Name(enc); got != tc.canonical {
t.Errorf("%d: Name(Get(%q)) = %q; want %q (%v)", i, tc.name, got, tc.canonical, err)
}
}
}
func TestTables(t *testing.T) {
for name, index := range nameMap {
got, err := Get(name)
if err != nil {
t.Errorf("%s:err: expected non-nil error", name)
}
if want := encodings[index]; got != want {
t.Errorf("%s:encoding: got %v; want %v", name, got, want)
}
mib, _ := got.(identifier.Interface).ID()
if mibMap[mib] != index {
t.Errorf("%s:mibMab: got %d; want %d", name, mibMap[mib], index)
}
}
}
func TestName(t *testing.T) {
for i, tc := range []struct {
desc string
enc encoding.Encoding
name string
err error
}{{
"defined encoding",
charmap.ISO8859_2,
"iso-8859-2",
nil,
}, {
"defined Unicode encoding",
unicode.UTF16(unicode.BigEndian, unicode.IgnoreBOM),
"utf-16be",
nil,
}, {
"undefined Unicode encoding in HTML standard",
unicode.UTF16(unicode.BigEndian, unicode.UseBOM),
"",
errUnsupported,
}, {
"undefined other encoding in HTML standard",
charmap.CodePage437,
"",
errUnsupported,
}, {
"unknown encoding",
encoding.Nop,
"",
errUnknown,
}} {
name, err := Name(tc.enc)
if name != tc.name || err != tc.err {
t.Errorf("%d:%s: got %q, %v; want %q, %v", i, tc.desc, name, err, tc.name, tc.err)
}
}
}
func TestLanguageDefault(t *testing.T) {
for _, tc := range []struct{ tag, want string }{
{"und", "windows-1252"}, // The default value.
{"ar", "windows-1256"},
{"ba", "windows-1251"},
{"be", "windows-1251"},
{"bg", "windows-1251"},
{"cs", "windows-1250"},
{"el", "iso-8859-7"},
{"et", "windows-1257"},
{"fa", "windows-1256"},
{"he", "windows-1255"},
{"hr", "windows-1250"},
{"hu", "iso-8859-2"},
{"ja", "shift_jis"},
{"kk", "windows-1251"},
{"ko", "euc-kr"},
{"ku", "windows-1254"},
{"ky", "windows-1251"},
{"lt", "windows-1257"},
{"lv", "windows-1257"},
{"mk", "windows-1251"},
{"pl", "iso-8859-2"},
{"ru", "windows-1251"},
{"sah", "windows-1251"},
{"sk", "windows-1250"},
{"sl", "iso-8859-2"},
{"sr", "windows-1251"},
{"tg", "windows-1251"},
{"th", "windows-874"},
{"tr", "windows-1254"},
{"tt", "windows-1251"},
{"uk", "windows-1251"},
{"vi", "windows-1258"},
{"zh-hans", "gb18030"},
{"zh-hant", "big5"},
// Variants and close approximates of the above.
{"ar_EG", "windows-1256"},
{"bs", "windows-1250"}, // Bosnian Latin maps to Croatian.
// Use default fallback in case of miss.
{"nl", "windows-1252"},
} {
if got := LanguageDefault(language.MustParse(tc.tag)); got != tc.want {
t.Errorf("LanguageDefault(%s) = %s; want %s", tc.tag, got, tc.want)
}
}
}
| {
"pile_set_name": "Github"
} |
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.iota.mobile"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="16" />
<application
android:label="Bazel App"
android:name=".App"
>
<activity
android:name=".DummyActivity"
android:label="Bazel App" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
| {
"pile_set_name": "Github"
} |
// Copyright 2016 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 ignore
package main
// This file contains definitions for interpreting the trie value of the idna
// trie generated by "go run gen*.go". It is shared by both the generator
// program and the resultant package. Sharing is achieved by the generator
// copying gen_trieval.go to trieval.go and changing what's above this comment.
// info holds information from the IDNA mapping table for a single rune. It is
// the value returned by a trie lookup. In most cases, all information fits in
// a 16-bit value. For mappings, this value may contain an index into a slice
// with the mapped string. Such mappings can consist of the actual mapped value
// or an XOR pattern to be applied to the bytes of the UTF8 encoding of the
// input rune. This technique is used by the cases packages and reduces the
// table size significantly.
//
// The per-rune values have the following format:
//
// if mapped {
// if inlinedXOR {
// 15..13 inline XOR marker
// 12..11 unused
// 10..3 inline XOR mask
// } else {
// 15..3 index into xor or mapping table
// }
// } else {
// 15..13 unused
// 12 modifier (including virama)
// 11 virama modifier
// 10..8 joining type
// 7..3 category type
// }
// 2 use xor pattern
// 1..0 mapped category
//
// See the definitions below for a more detailed description of the various
// bits.
type info uint16
const (
catSmallMask = 0x3
catBigMask = 0xF8
indexShift = 3
xorBit = 0x4 // interpret the index as an xor pattern
inlineXOR = 0xE000 // These bits are set if the XOR pattern is inlined.
joinShift = 8
joinMask = 0x07
viramaModifier = 0x0800
modifier = 0x1000
)
// A category corresponds to a category defined in the IDNA mapping table.
type category uint16
const (
unknown category = 0 // not defined currently in unicode.
mapped category = 1
disallowedSTD3Mapped category = 2
deviation category = 3
)
const (
valid category = 0x08
validNV8 category = 0x18
validXV8 category = 0x28
disallowed category = 0x40
disallowedSTD3Valid category = 0x80
ignored category = 0xC0
)
// join types and additional rune information
const (
joiningL = (iota + 1)
joiningD
joiningT
joiningR
//the following types are derived during processing
joinZWJ
joinZWNJ
joinVirama
numJoinTypes
)
func (c info) isMapped() bool {
return c&0x3 != 0
}
func (c info) category() category {
small := c & catSmallMask
if small != 0 {
return category(small)
}
return category(c & catBigMask)
}
func (c info) joinType() info {
if c.isMapped() {
return 0
}
return (c >> joinShift) & joinMask
}
func (c info) isModifier() bool {
return c&(modifier|catSmallMask) == modifier
}
func (c info) isViramaModifier() bool {
return c&(viramaModifier|catSmallMask) == viramaModifier
}
| {
"pile_set_name": "Github"
} |
import expect from 'expect'
import StorageManager, { CollectionDefinitionMap } from '@worldbrain/storex'
import { DexieStorageBackend } from '@worldbrain/storex-backend-dexie'
import inMemory from '@worldbrain/storex-backend-dexie/lib/in-memory'
import { StorageChangeDetector } from './storage-change-detector'
const DEFAULT_COLLECTION_DEFINITIONS: CollectionDefinitionMap = {
page: {
version: new Date(1),
fields: {
url: { type: 'string' },
title: { type: 'string', optional: true },
},
},
}
async function setupTest(options?: {
collections: CollectionDefinitionMap
toTrack?: string[]
}) {
const storageBackend = new DexieStorageBackend({
dbName: 'test',
idbImplementation: inMemory(),
legacyMemexCompatibility: true,
})
const storageManager = new StorageManager({ backend: storageBackend })
const collectionDefinitions =
(options && options.collections) || DEFAULT_COLLECTION_DEFINITIONS
storageManager.registry.registerCollections(collectionDefinitions)
await storageManager.finishInitialization()
const changeDetector = new StorageChangeDetector({
storageManager,
toTrack:
(options && options.toTrack) || Object.keys(collectionDefinitions),
})
return { storageManager, changeDetector }
}
describe('Storage change detector for tests', () => {
it('should correctly detect creations', async () => {
const { storageManager, changeDetector } = await setupTest()
await changeDetector.capture()
const url = 'http://test.com'
const title = 'Test page'
const pageId = (
await storageManager.collection('page').createObject({
url,
title,
})
).object.id
expect(await changeDetector.compare()).toEqual({
page: {
[pageId]: {
type: 'create',
object: {
id: pageId,
url,
title,
},
},
},
})
})
it('should correctly detect updates', async () => {
const { storageManager, changeDetector } = await setupTest()
const url = 'http://test.com'
const firstTitle = 'Test page'
const pageId = (
await storageManager.collection('page').createObject({
url,
title: firstTitle,
})
).object.id
await changeDetector.capture()
const secondTitle = 'Updated page title'
await storageManager.collection('page').updateObjects(
{ id: pageId },
{
url,
title: secondTitle,
},
)
expect(await changeDetector.compare()).toEqual({
page: {
[pageId]: {
type: 'modify',
updates: {
title: secondTitle,
},
},
},
})
})
it('should correctly detect updating a previously absent optional field', async () => {
const { storageManager, changeDetector } = await setupTest()
const url = 'http://test.com'
const pageId = (
await storageManager.collection('page').createObject({
url,
})
).object.id
await changeDetector.capture()
const secondTitle = 'Updated page title'
await storageManager.collection('page').updateObjects(
{ id: pageId },
{
url,
title: secondTitle,
},
)
expect(await changeDetector.compare()).toEqual({
page: {
[pageId]: {
type: 'modify',
updates: {
title: secondTitle,
},
},
},
})
})
it('should correctly detect removal of fields', async () => {
const { storageManager, changeDetector } = await setupTest()
const url = 'http://test.com'
const firstTitle = 'Test page'
const pageId = (
await storageManager.collection('page').createObject({
url,
title: firstTitle,
})
).object.id
await changeDetector.capture()
const secondTitle = undefined
await storageManager.collection('page').updateObjects(
{ id: pageId },
{
url,
title: secondTitle,
},
)
expect(await changeDetector.compare()).toEqual({
page: {
[pageId]: {
type: 'modify',
updates: {
title: secondTitle,
},
},
},
})
})
it('should correctly detect deletions', async () => {
const { storageManager, changeDetector } = await setupTest()
const url = 'http://test.com'
const firstTitle = 'Test page'
const pageId = (
await storageManager.collection('page').createObject({
url,
title: firstTitle,
})
).object.id
await changeDetector.capture()
await storageManager.collection('page').deleteObjects({ id: pageId })
expect(await changeDetector.compare()).toEqual({
page: {
[pageId]: {
type: 'delete',
},
},
})
})
it('should correctly detect unintended updates (query too wide)', async () => {
const { storageManager, changeDetector } = await setupTest()
const firstPageId = (
await storageManager.collection('page').createObject({
url: 'first-url',
title: 'first-title',
})
).object.id
const secondPageId = (
await storageManager.collection('page').createObject({
url: 'second-url',
title: 'second-title',
})
).object.id
await changeDetector.capture()
await storageManager.collection('page').updateObjects(
{},
{
title: 'third-title',
},
)
expect(await changeDetector.compare()).toEqual({
page: {
[firstPageId]: {
type: 'modify',
updates: {
title: 'third-title',
},
},
[secondPageId]: {
type: 'modify',
updates: {
title: 'third-title',
},
},
},
})
})
it('should correctly detect unintended deletions (query too wide)', async () => {
const { storageManager, changeDetector } = await setupTest()
const firstPageId = (
await storageManager.collection('page').createObject({
url: 'first-url',
title: 'first-title',
})
).object.id
const secondPageId = (
await storageManager.collection('page').createObject({
url: 'second-url',
title: 'second-title',
})
).object.id
await changeDetector.capture()
await storageManager.collection('page').deleteObjects({})
expect(await changeDetector.compare()).toEqual({
page: {
[firstPageId]: {
type: 'delete',
},
[secondPageId]: {
type: 'delete',
},
},
})
})
it('should work with compound primary keys', async () => {
const { storageManager, changeDetector } = await setupTest({
collections: {
page: {
version: new Date(1),
fields: {
url: { type: 'string' },
title: { type: 'string' },
},
indices: [{ field: ['url', 'title'], pk: true }],
},
},
})
await changeDetector.capture()
const url = 'test.com'
const title = 'test-page'
await storageManager.collection('page').createObject({
url,
title,
})
expect(await changeDetector.compare()).toEqual({
page: {
'["test.com","test-page"]': {
type: 'create',
object: {
url,
title,
},
},
},
})
})
})
| {
"pile_set_name": "Github"
} |
/*
// Copyright (c) 2015-2018 Pierre Guillot.
// For information on usage and redistribution, and for a DISCLAIMER OF ALL
// WARRANTIES, see the file, "LICENSE.txt," in this distribution.
*/
#include "PluginEditorConsole.hpp"
#include "PluginLookAndFeel.hpp"
//////////////////////////////////////////////////////////////////////////////////////////////
// CONSOLE BUTTON //
//////////////////////////////////////////////////////////////////////////////////////////////
class ConsoleButton : public Button
{
public:
ConsoleButton(Image const& image) : Button(""), m_image()
{
setClickingTogglesState(false);
setAlwaysOnTop(true);
m_image.setImage(image);
m_image.setTransformToFit(Rectangle<float>(0.f, 0.f, 18.f, 18.f), RectanglePlacement::stretchToFit);
m_image.setAlpha(0.5f);
addAndMakeVisible(m_image);
setSize(18, 18);
}
void buttonStateChanged() final
{
m_image.setAlpha((isDown() || isOver()) ? 1.f : 0.5f);
}
void paintButton(Graphics& g, bool over, bool down) final {};
private:
DrawableImage m_image;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ConsoleButton)
};
//////////////////////////////////////////////////////////////////////////////////////////////
// CONSOLE //
//////////////////////////////////////////////////////////////////////////////////////////////
PluginEditorConsole::PluginEditorConsole(CamomileAudioProcessor& p) :
m_history(p), m_table(),
m_level_button(new ConsoleButton(ImageCache::getFromMemory(BinaryData::settings_png, BinaryData::settings_pngSize))),
m_clear_button(new ConsoleButton(ImageCache::getFromMemory(BinaryData::garbage_png, BinaryData::garbage_pngSize))),
m_copy_button(new ConsoleButton(ImageCache::getFromMemory(BinaryData::copy_png, BinaryData::copy_pngSize))),
m_reload_button(new ConsoleButton(ImageCache::getFromMemory(BinaryData::reload_png, BinaryData::reload_pngSize))),
m_font(CamoLookAndFeel::getDefaultFont().withPointHeight(10.f))
{
m_size = 0;
setWantsKeyboardFocus(true);
m_table.setBounds(2, 2, getWidth() - 2, getHeight() - 30);
m_table.setModel(this);
m_table.setOutlineThickness(0);
m_table.setWantsKeyboardFocus(true);
m_table.setMultipleSelectionEnabled(true);
m_table.setMouseMoveSelectsRows(false);
m_table.setRowHeight(static_cast<int>(m_font.getHeight() + 2));
m_table.setColour(ListBox::ColourIds::backgroundColourId, Colours::transparentWhite);
m_table.getViewport()->setScrollBarsShown(true, true, true, true);
m_table.getViewport()->setScrollBarThickness(4);
addAndMakeVisible(m_table);
m_clear_button->addListener(this);
addAndMakeVisible(m_clear_button.get());
m_copy_button->addListener(this);
addAndMakeVisible(m_copy_button.get());
m_level_button->addListener(this);
addAndMakeVisible(m_level_button.get());
m_reload_button->addListener(this);
addAndMakeVisible(m_reload_button.get());
startTimer(100);
}
PluginEditorConsole::~PluginEditorConsole()
{
stopTimer();
}
void PluginEditorConsole::clearSelection()
{
stopTimer();
SparseSet<int> const selection = m_table.getSelectedRows();
if(selection.isEmpty())
{
const size_t n = m_history.size(m_level);
for(size_t i = n; i > 0; --i)
{
m_history.clear(m_level, i-1);
}
}
else
{
const int n = selection.size();
for(int i = n; i > 0; --i)
{
m_history.clear(m_level, static_cast<size_t>(selection[i-1]));
}
}
m_table.deselectAllRows();
timerCallback();
startTimer(100);
}
void PluginEditorConsole::copySelection()
{
String text;
stopTimer();
SparseSet<int> const selection = m_table.getSelectedRows();
if(selection.isEmpty())
{
const size_t n = m_history.size(m_level);
for(size_t i = 0; i < n; ++i)
{
text += String(m_history.get(m_level, static_cast<size_t>(i)).second + "\n");
}
}
else
{
const int n = selection.size();
for(int i = 0; i < n; ++i)
{
text += String(m_history.get(m_level, static_cast<size_t>(selection[i])).second + "\n");
}
}
SystemClipboard::copyTextToClipboard(text);
startTimer(100);
}
void PluginEditorConsole::paint(Graphics& g)
{
g.setColour(Colours::black.withAlpha(0.5f));
g.drawHorizontalLine(getHeight() - 28, 2.f, static_cast<float>(getWidth()) - 2.f);
}
void PluginEditorConsole::resized()
{
const int btn_height = getHeight() - 22;
const int btn_width = 26;
const int btn_woffset = 4;
const int tbl_height = getHeight() - 30;
const int tbl_wdith = getWidth() - 2;
m_level_button->setTopLeftPosition(btn_woffset+btn_width*0, btn_height);
m_clear_button->setTopLeftPosition(btn_woffset+btn_width*1, btn_height);
m_copy_button->setTopLeftPosition(btn_woffset+btn_width*2, btn_height);
m_reload_button->setTopLeftPosition(btn_woffset+btn_width*3, btn_height);
m_table.setSize(tbl_wdith, tbl_height);
}
bool PluginEditorConsole::keyPressed(const KeyPress& key)
{
if(key.getModifiers() == ModifierKeys::commandModifier && key.getTextCharacter() == 'c')
{
copySelection();
return true;
}
return false;
}
void PluginEditorConsole::deleteKeyPressed(int lastRowSelected)
{
clearSelection();
}
void PluginEditorConsole::buttonClicked(Button* button)
{
if(button == m_reload_button.get())
{
m_history.reloadPatch();
}
else if(button == m_clear_button.get())
{
clearSelection();
}
else if(button == m_copy_button.get())
{
copySelection();
}
else
{
juce::PopupMenu m;
m.addItem(1, "Fatal", true, m_level == ConsoleLevel::Fatal);
m.addItem(2, "Error", true, m_level == ConsoleLevel::Error);
m.addItem(3, "Normal", true, m_level == ConsoleLevel::Normal);
m.addItem(4, "All", true, m_level == ConsoleLevel::Log);
stopTimer();
int const level = m.show(0, 0, static_cast<int>(m_font.getHeight() + 2));
if(level != 0 && static_cast<ConsoleLevel>(level - 1) != m_level)
{
m_level = static_cast<ConsoleLevel>(level - 1);
m_size = m_history.size(m_level);
m_table.updateContent();
m_table.deselectAllRows();
}
startTimer(100);
}
}
void PluginEditorConsole::paintListBoxItem(int rowNumber, Graphics& g, int width, int height, bool rowIsSelected)
{
std::pair<size_t, std::string> const message(m_history.get(m_level, rowNumber));
if(rowIsSelected)
{
g.setColour(Colours::black);
g.fillRect(0, 0, width, height);
}
if(message.first == ConsoleLevel::Fatal)
{
g.setColour(Colours::red);
}
else if(message.first == ConsoleLevel::Error)
{
g.setColour(Colours::orange);
}
else if(message.first == ConsoleLevel::Normal)
{
g.setColour(rowIsSelected ? Colours::lightgrey : Colours::black.withAlpha(0.5f));
}
else
{
g.setColour(Colours::green);
}
String const mess = String(message.second).trimCharactersAtEnd(" \n");
g.setFont(m_font);
g.drawText(mess, 2, 0, width, height, juce::Justification::centredLeft, 0);
}
void PluginEditorConsole::timerCallback()
{
m_history.processPrints();
const size_t size = m_history.size(m_level);
if(m_size != size)
{
m_size = size;
m_table.updateContent();
}
}
| {
"pile_set_name": "Github"
} |
Notes on starting parasol on OpenStack VM machines.
Task: Establish a cluster of machines with the parasol cluster management
system installed and running, and with UCSC/kent/lastz commands and
scripts to perform the typical UCSC lastz/chainNet pipeline of
processing.
Theory of operation:
1. Start up one machine to perform the function of the parasol 'hub'.
Add utilities for kent commands, lastz binaries, and parasol administration.
NFS export a filesystem for common use by the parasol nodes.
This hub machine can donate extra CPU cores to add to the pool of resources
for this parasol cluster. Two CPU cores should be reservered for
parasol and NFS operations.
2. With the known internal IP address for the parasol 'hub' machine,
start up some number of instances to perform the functions
of the parasol 'nodes'. These nodes use the IP address of the 'hub'
machine to mount the filesystem from the 'hub' machine.
Minimal installation of anything else is not required on these
machines, they can obtain everything they need from the NFS filesystem
from the 'hub' machine. And they can report to the 'hub' machine
their individual characteristics for the parasol administration
to add them to the pool of resources for this cluster.
3. After all the machine instances are up and running and proven to
have correct ssh access between the hub and the nodes, the parasol
server on the hub can be started.
4. The system should now be ready to run the lastz/chainNet process.
Work on the hub machine, keep the data in the NFS exported filesystem
so that all nodes can see the same set of files.
| {
"pile_set_name": "Github"
} |
// +build acceptance networking
package v2
import (
"testing"
"github.com/rackspace/gophercloud/openstack/networking/v2/networks"
"github.com/rackspace/gophercloud/openstack/networking/v2/ports"
"github.com/rackspace/gophercloud/openstack/networking/v2/subnets"
"github.com/rackspace/gophercloud/pagination"
th "github.com/rackspace/gophercloud/testhelper"
)
func TestPortCRUD(t *testing.T) {
Setup(t)
defer Teardown()
// Setup network
t.Log("Setting up network")
networkID, err := createNetwork()
th.AssertNoErr(t, err)
defer networks.Delete(Client, networkID)
// Setup subnet
t.Logf("Setting up subnet on network %s", networkID)
subnetID, err := createSubnet(networkID)
th.AssertNoErr(t, err)
defer subnets.Delete(Client, subnetID)
// Create port
t.Logf("Create port based on subnet %s", subnetID)
portID := createPort(t, networkID, subnetID)
// List ports
t.Logf("Listing all ports")
listPorts(t)
// Get port
if portID == "" {
t.Fatalf("In order to retrieve a port, the portID must be set")
}
p, err := ports.Get(Client, portID).Extract()
th.AssertNoErr(t, err)
th.AssertEquals(t, p.ID, portID)
// Update port
p, err = ports.Update(Client, portID, ports.UpdateOpts{Name: "new_port_name"}).Extract()
th.AssertNoErr(t, err)
th.AssertEquals(t, p.Name, "new_port_name")
// Delete port
res := ports.Delete(Client, portID)
th.AssertNoErr(t, res.Err)
}
func createPort(t *testing.T, networkID, subnetID string) string {
enable := false
opts := ports.CreateOpts{
NetworkID: networkID,
Name: "my_port",
AdminStateUp: &enable,
FixedIPs: []ports.IP{ports.IP{SubnetID: subnetID}},
}
p, err := ports.Create(Client, opts).Extract()
th.AssertNoErr(t, err)
th.AssertEquals(t, p.NetworkID, networkID)
th.AssertEquals(t, p.Name, "my_port")
th.AssertEquals(t, p.AdminStateUp, false)
return p.ID
}
func listPorts(t *testing.T) {
count := 0
pager := ports.List(Client, ports.ListOpts{})
err := pager.EachPage(func(page pagination.Page) (bool, error) {
count++
t.Logf("--- Page ---")
portList, err := ports.ExtractPorts(page)
th.AssertNoErr(t, err)
for _, p := range portList {
t.Logf("Port: ID [%s] Name [%s] Status [%d] MAC addr [%s] Fixed IPs [%#v] Security groups [%#v]",
p.ID, p.Name, p.Status, p.MACAddress, p.FixedIPs, p.SecurityGroups)
}
return true, nil
})
th.CheckNoErr(t, err)
if count == 0 {
t.Logf("No pages were iterated over when listing ports")
}
}
func createNetwork() (string, error) {
res, err := networks.Create(Client, networks.CreateOpts{Name: "tmp_network", AdminStateUp: networks.Up}).Extract()
return res.ID, err
}
func createSubnet(networkID string) (string, error) {
s, err := subnets.Create(Client, subnets.CreateOpts{
NetworkID: networkID,
CIDR: "192.168.199.0/24",
IPVersion: subnets.IPv4,
Name: "my_subnet",
EnableDHCP: subnets.Down,
}).Extract()
return s.ID, err
}
func TestPortBatchCreate(t *testing.T) {
// todo
}
| {
"pile_set_name": "Github"
} |
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_uart.c
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal.h
tx\stm32f0xx_hal_uart.o: ../Inc/stm32f0xx_hal_conf.h
tx\stm32f0xx_hal_uart.o: ../Inc/main.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_rcc.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_def.h
tx\stm32f0xx_hal_uart.o: ../Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f0xx.h
tx\stm32f0xx_hal_uart.o: ../Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f042x6.h
tx\stm32f0xx_hal_uart.o: ../Drivers/CMSIS/Include/core_cm0.h
tx\stm32f0xx_hal_uart.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
tx\stm32f0xx_hal_uart.o: ../Drivers/CMSIS/Include/core_cmInstr.h
tx\stm32f0xx_hal_uart.o: ../Drivers/CMSIS/Include/cmsis_armcc.h
tx\stm32f0xx_hal_uart.o: ../Drivers/CMSIS/Include/core_cmFunc.h
tx\stm32f0xx_hal_uart.o: ../Drivers/CMSIS/Device/ST/STM32F0xx/Include/system_stm32f0xx.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal.h
tx\stm32f0xx_hal_uart.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_rcc_ex.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_gpio.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_gpio_ex.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_dma.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_dma_ex.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_cortex.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_adc.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_adc_ex.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_flash.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_flash_ex.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_i2c.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_i2c_ex.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_iwdg.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pwr.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pwr_ex.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_rtc.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_rtc_ex.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_spi.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_spi_ex.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_tim.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_tim_ex.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_uart.h
tx\stm32f0xx_hal_uart.o: ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_uart_ex.h
| {
"pile_set_name": "Github"
} |
/* No comment provided by engineer. */
"%d days ago" = "%d dage siden";
/* No comment provided by engineer. */
"%d hours ago" = "%d timer siden";
/* No comment provided by engineer. */
"%d minutes ago" = "%d minutter siden";
/* No comment provided by engineer. */
"%d months ago" = "%d måneder siden";
/* No comment provided by engineer. */
"%d seconds ago" = "%d sekunder siden";
/* No comment provided by engineer. */
"%d weeks ago" = "%d uger siden";
/* No comment provided by engineer. */
"%d years ago" = "%d år siden";
/* No comment provided by engineer. */
"A minute ago" = "Et minut siden";
/* No comment provided by engineer. */
"An hour ago" = "En time siden";
/* No comment provided by engineer. */
"Just now" = "Lige nu";
/* No comment provided by engineer. */
"Last month" = "Sidste måned";
/* No comment provided by engineer. */
"Last week" = "Sidste uge";
/* No comment provided by engineer. */
"Last year" = "Sidste år";
/* No comment provided by engineer. */
"Yesterday" = "I går";
/* No comment provided by engineer. */
"1 year ago" = "1 år siden";
/* No comment provided by engineer. */
"1 month ago" = "1 måned siden";
/* No comment provided by engineer. */
"1 week ago" = "1 uge siden";
/* No comment provided by engineer. */
"1 day ago" = "1 dag siden";
/* No comment provided by engineer. */
"This morning" = "Her til morgen";
/* No comment provided by engineer. */
"This afternoon" = "Her til eftermiddag";
/* No comment provided by engineer. */
"Today" = "I dag";
/* No comment provided by engineer. */
"This week" = "Denne uge";
/* No comment provided by engineer. */
"This month" = "Denne måned";
/* No comment provided by engineer. */
"This year" = "Dette år"; | {
"pile_set_name": "Github"
} |
--[[
This data loader is a lightly-modified version of the one from dcgan.torch
(see https://github.com/soumith/dcgan.torch/blob/master/data/data.lua).
If you want to add a new dataset, you can create a new dataset_name and corresponding
donkey_file that creates minibatches.
--]]
local Threads = require 'threads'
Threads.serialization('threads.sharedserialize')
local data = {}
local result = {}
local unpack = unpack and unpack or table.unpack
function data.new(n, dataset_name, opt_)
opt_ = opt_ or {}
local self = {}
for k,v in pairs(data) do
self[k] = v
end
local donkey_file
if dataset_name == 'cub' or dataset_name == 'flowers' then
donkey_file = 'donkey_folder_txt.lua'
elseif dataset_name == 'coco' then
donkey_file = 'donkey_folder_coco.lua'
elseif dataset_name == 'coco_txt' then
donkey_file = 'donkey_folder_txt_coco.lua'
else
error('Unknown dataset: ' .. dataset_name)
end
if n > 0 then
local options = opt_
self.threads = Threads(n,
function() require 'torch' end,
function(idx)
opt = options
tid = idx
local seed = (opt.manualSeed and opt.manualSeed or 0) + idx
torch.manualSeed(seed)
torch.setnumthreads(1)
print(string.format('Starting donkey with id: %d seed: %d', tid, seed))
assert(options, 'options not found')
assert(opt, 'opt not given')
paths.dofile(donkey_file)
end)
else
if donkey_file then paths.dofile(donkey_file) end
self.threads = {}
function self.threads:addjob(f1, f2) f2(f1()) end
function self.threads:dojob() end
function self.threads:synchronize() end
end
local nSamples = 0
self.threads:addjob(function() return trainLoader:size() end,
function(c) nSamples = c end)
self.threads:synchronize()
self._size = nSamples
for i = 1, n do
self.threads:addjob(self._getFromThreads,
self._pushResult)
end
return self
end
function data._getFromThreads()
assert(opt.batchSize, 'opt.batchSize not found')
return trainLoader:sample(opt.batchSize)
end
function data._pushResult(...)
local res = {...}
if res == nil then
self.threads:synchronize()
end
result[1] = res
end
function data:getBatch()
-- queue another job
self.threads:addjob(self._getFromThreads, self._pushResult)
self.threads:dojob()
local res = result[1]
result[1] = nil
if torch.type(res) == 'table' then
return unpack(res)
end
return res
end
function data:size()
return self._size
end
return data
| {
"pile_set_name": "Github"
} |
#[doc = "Reader of register TOCC"]
pub type R = crate::R<u32, super::TOCC>;
#[doc = "Writer for register TOCC"]
pub type W = crate::W<u32, super::TOCC>;
#[doc = "Register TOCC `reset()`'s with value 0xffff_0000"]
impl crate::ResetValue for super::TOCC {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0xffff_0000
}
}
#[doc = "Reader of field `ETOC`"]
pub type ETOC_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `ETOC`"]
pub struct ETOC_W<'a> {
w: &'a mut W,
}
impl<'a> ETOC_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
self.w
}
}
#[doc = "Timeout Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum TOS_A {
#[doc = "0: Continuout operation"]
CONT = 0,
#[doc = "1: Timeout controlled by TX Event FIFO"]
TXEF = 1,
#[doc = "2: Timeout controlled by Rx FIFO 0"]
RXF0 = 2,
#[doc = "3: Timeout controlled by Rx FIFO 1"]
RXF1 = 3,
}
impl From<TOS_A> for u8 {
#[inline(always)]
fn from(variant: TOS_A) -> Self {
variant as _
}
}
#[doc = "Reader of field `TOS`"]
pub type TOS_R = crate::R<u8, TOS_A>;
impl TOS_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> TOS_A {
match self.bits {
0 => TOS_A::CONT,
1 => TOS_A::TXEF,
2 => TOS_A::RXF0,
3 => TOS_A::RXF1,
_ => unreachable!(),
}
}
#[doc = "Checks if the value of the field is `CONT`"]
#[inline(always)]
pub fn is_cont(&self) -> bool {
*self == TOS_A::CONT
}
#[doc = "Checks if the value of the field is `TXEF`"]
#[inline(always)]
pub fn is_txef(&self) -> bool {
*self == TOS_A::TXEF
}
#[doc = "Checks if the value of the field is `RXF0`"]
#[inline(always)]
pub fn is_rxf0(&self) -> bool {
*self == TOS_A::RXF0
}
#[doc = "Checks if the value of the field is `RXF1`"]
#[inline(always)]
pub fn is_rxf1(&self) -> bool {
*self == TOS_A::RXF1
}
}
#[doc = "Write proxy for field `TOS`"]
pub struct TOS_W<'a> {
w: &'a mut W,
}
impl<'a> TOS_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: TOS_A) -> &'a mut W {
{
self.bits(variant.into())
}
}
#[doc = "Continuout operation"]
#[inline(always)]
pub fn cont(self) -> &'a mut W {
self.variant(TOS_A::CONT)
}
#[doc = "Timeout controlled by TX Event FIFO"]
#[inline(always)]
pub fn txef(self) -> &'a mut W {
self.variant(TOS_A::TXEF)
}
#[doc = "Timeout controlled by Rx FIFO 0"]
#[inline(always)]
pub fn rxf0(self) -> &'a mut W {
self.variant(TOS_A::RXF0)
}
#[doc = "Timeout controlled by Rx FIFO 1"]
#[inline(always)]
pub fn rxf1(self) -> &'a mut W {
self.variant(TOS_A::RXF1)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x03 << 1)) | (((value as u32) & 0x03) << 1);
self.w
}
}
#[doc = "Reader of field `TOP`"]
pub type TOP_R = crate::R<u16, u16>;
#[doc = "Write proxy for field `TOP`"]
pub struct TOP_W<'a> {
w: &'a mut W,
}
impl<'a> TOP_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u16) -> &'a mut W {
self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16);
self.w
}
}
impl R {
#[doc = "Bit 0 - Enable Timeout Counter"]
#[inline(always)]
pub fn etoc(&self) -> ETOC_R {
ETOC_R::new((self.bits & 0x01) != 0)
}
#[doc = "Bits 1:2 - Timeout Select"]
#[inline(always)]
pub fn tos(&self) -> TOS_R {
TOS_R::new(((self.bits >> 1) & 0x03) as u8)
}
#[doc = "Bits 16:31 - Timeout Period"]
#[inline(always)]
pub fn top(&self) -> TOP_R {
TOP_R::new(((self.bits >> 16) & 0xffff) as u16)
}
}
impl W {
#[doc = "Bit 0 - Enable Timeout Counter"]
#[inline(always)]
pub fn etoc(&mut self) -> ETOC_W {
ETOC_W { w: self }
}
#[doc = "Bits 1:2 - Timeout Select"]
#[inline(always)]
pub fn tos(&mut self) -> TOS_W {
TOS_W { w: self }
}
#[doc = "Bits 16:31 - Timeout Period"]
#[inline(always)]
pub fn top(&mut self) -> TOP_W {
TOP_W { w: self }
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2005 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#import <Foundation/Foundation.h>
#import <Foundation/NSURLCredentialStorage.h>
@class NSURLAuthenticationChallenge;
@interface WebPanelAuthenticationHandler : NSObject
{
NSMapTable *windowToPanel;
NSMapTable *challengeToWindow;
NSMapTable *windowToChallengeQueue;
}
+ (id)sharedHandler;
- (void)startAuthentication:(NSURLAuthenticationChallenge *)challenge window:(NSWindow *)w;
- (void)cancelAuthentication:(NSURLAuthenticationChallenge *)challenge;
@end
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.