text:
**About**

611 (SixEleven) uses peer-to-peer technology to operate with no central authority or banks; managing transactions and the issuing of 611 (coin: SIL) is carried out collectively by the network. 611 is open-source. Its design is public, nobody owns or controls 611 and everyone can take part. Through many of its unique properties, 611 allows exciting uses that could not be covered by any previous payment and domain name system.

This Docker image provides `611d` application which can be used to run and interact with the 611 (SixEleven) network.

It loads the latest version of 611 (SixEleven) from git and creates an up-to-date docker image ready to run for you.

**Build**

To build your own image of 611 (SixEleven) from the latest source code on GitHub run the following command in the contrib/docker directory:

```
$ docker build -t [YourAlias]/sixeleven .
```

Note: After the build is complete replace fflo below with [YourAlias].

**Usage**

To start a 611 (SixEleven) instance running the latest version:

```
$ docker run --name some-sixeleven fflo/sixeleven
```

To run a 611 (SixEleven) container in the background, pass the `-d` option to `docker run`:

```
$ docker run -d --name some-sixeleven fflo/sixeleven
```

Once you have a 611 (SixEleven) service running in the background, you can show running containers:

```
$ docker ps
```

Or view the logs of a service:

```
$ docker logs -f some-sixeleven
```

To stop and restart a running container:

```
$ docker stop some-sixeleven
$ docker start some-sixeleven
```

**Data Volumes**

By default, Docker will create ephemeral containers. That is, the blockchain data will not be persisted if you create a new 611 (SixEleven) container.

To create a simple `busybox` data volume and link it to a 611 (SixEleven) service:

```
$ docker create -v /sixeleven --name sixeleven-data busybox /bin/true
$ docker run --volumes-from=sixeleven-data --name=sixeleven-node -d -p 8661:8661 -p 127.0.0.1:8663:8663 fflo/sixeleven
```

**Configuring 611 (SixEleven)**

The easiest method to configure the 611 (SixEleven) server is to pass arguments to the `611d` command. For example, to run 611 through localhost tor socks proxy on port 9050:

```
$ docker run --name sixeleven-node fflo/sixeleven 611d -proxy=127.0.0.1:9050
```

**Debug / Logfile**

By default, 611 (SixEleven) service 611d will dump any log information to the Docker logs. To debug use:

Warning: In case you did not define $SIXELEVEN_RPC_USER and $SIXELEVEN_RPC_PASSWORD, on first init a random password for rpc access will be generated. The output of the 611.conf configuration file will be dumped to the Docker logs on startup.

```
$ docker logs -t sixeleven-node
```

redpajama_set_name: RedPajamaGithub


text:
(function() {
  'use strict';

  angular
    .module('app.primary')
    .run(appRun);

    appRun.$inject = ['routehelper'];
    /*ngInject*/
    function appRun(routehelper) {
      routehelper.configureRoutes(getRoutes());
    }

    function getRoutes() {
      return [{
        state: 'primary',
        config: {
          url: '/',
          templateUrl: '/admin/primary/index.html',
          controller: 'Primary as vm',
          title: 'Primary'
        }
      }];
    }

})();


text:
#region Copyright (c) 2015 KEngine / Kelly <http://github.com/mr-kelly>, All rights reserved.

// KEngine - Toolset and framework for Unity3D
// ===================================
//
// Filename: AudioLoader.cs
// Date:     2015/12/03
// Author:  Kelly
// Email: 23110388@qq.com
// Github: https://github.com/mr-kelly/KEngine
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 3.0 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.

#endregion

using UnityEngine;

namespace KEngine
{
    public class AudioLoader : AbstractResourceLoader
    {
        private AudioClip ResultAudioClip
        {
            get { return ResultObject as AudioClip; }
        }

        private AssetFileLoader AssetFileBridge;

        public override float Progress
        {
            get { return AssetFileBridge.Progress; }
        }

        public static AudioLoader Load(string url, System.Action<bool, AudioClip> callback = null)
        {
            LoaderDelgate newCallback = null;
            if (callback != null)
            {
                newCallback = (isOk, obj) => callback(isOk, obj as AudioClip);
            }
            return AutoNew<AudioLoader>(url, newCallback);
        }

        protected override void Init(string url, params object[] args)
        {
            base.Init(url, args);

            AssetFileBridge = AssetFileLoader.Load(url, (bool isOk, UnityEngine.Object obj) => { OnFinish(obj); });
        }

        protected override void DoDispose()
        {
            base.DoDispose();

            AssetFileBridge.Release();
        }
    }

}


text:
from .average_rating import *
from .cart import *
from .categories import *
from .delivery_time import *
from .pages import *
from .recent_products import *
from .related_products import *
from .text import *
from .topseller import *
from .filter import *
from .forsale import *
from .featured import *
from .latest import *
from .topsellerall import *
from .latestall import *


text:
// Copyright (c) 2017 Gwaredd Mountain, https://opensource.org/licenses/MIT
#if !UNIUM_DISABLE && ( DEVELOPMENT_BUILD || UNITY_EDITOR || UNIUM_ENABLE )

using System;
using System.Collections.Generic;

namespace gw.gql.calc
{
    // BuildTree()

    public partial class Parser
    {
        Stack<Token> mInput;

        //----------------------------------------------------------------------------------------------------

        public LogicalExpression BuildTree( string expr )
        {
            mInput = new Stack<Token>( 16 );
            new Parser().Parse( expr, tok => mInput.Push( tok ) );

            if( mInput.Count == 0 )
            {
                throw new FormatException( "Invalid expression,  no symbols found" );
            }

            // convert stack into AST

            var AST = CreateExpression( mInput.Pop() );

            // check all tokens where consumed

            if( mInput.Count != 0 || AST == null )
            {
                throw new FormatException( "Invalid expression" );
            }

            return AST;
        }

        //----------------------------------------------------------------------------------------------------

        LogicalExpression CreateExpression( Token token )
        {
            if( token.IsOperand() )
            {
                return new OperandExpression( token );
            }
            else if( token.IsBinaryOperator() )
            {
                var rhs = CreateExpression( mInput.Pop() );
                var lhs = CreateExpression( mInput.Pop() );

                return new BinaryExpression( token, lhs, rhs );
            }
            else if( token.IsUnaryOperator() )
            {
                var operand = CreateExpression( mInput.Pop() );
                return new UnaryExpression( token, operand );
            }
            else if( token.Type == Token.Function )
            {
                var args = new LogicalExpression[ token.Args ];

                for( int i = token.Args - 1; i >= 0; i-- )
                {
                    args[ i ] = CreateExpression( mInput.Pop() );
                }

                return new FunctionExpression( token, args );
            }
            else
            {
                throw new FormatException( "Unexpected token type " + token.Type.ToString() );
            }
        }
    }
}

#endif


text:
/*
 *   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/>.
 */

/*
 * JythonObject.java
 * Copyright (C) 2007-2012 University of Waikato, Hamilton, New Zealand
 */

package weka.core.scripting;

/**
 * An indicator interface for Jython objects.
 *
 * @author  fracpete (fracpete at waikato dot ac dot nz)
 * @version $Revision: 8034 $
 */
public interface JythonObject {

}


text:
/*************************************************************************************************/

#ifndef GIL_REDUCE_HPP
#define GIL_REDUCE_HPP

#include <boost/mpl/insert_range.hpp>
#include <boost/mpl/range_c.hpp>
#include <boost/mpl/vector_c.hpp>
#include <boost/mpl/back.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/long.hpp>
#include <boost/mpl/logical.hpp>
#include <boost/mpl/transform.hpp>
#include <boost/mpl/insert.hpp>
#include <boost/mpl/transform.hpp>

#include "../../metafunctions.hpp"
#include "../../typedefs.hpp"
#include "dynamic_at_c.hpp"

////////////////////////////////////////////////////////////////////////////////////////
/// \file
/// \brief Constructs for static-to-dynamic integer convesion
/// \author Lubomir Bourdev and Hailin Jin \n
///         Adobe Systems Incorporated
/// \date 2005-2007 \n Last updated on May 4, 2006
///
////////////////////////////////////////////////////////////////////////////////////////

#ifdef GIL_REDUCE_CODE_BLOAT

// Max number of cases in the cross-expension of binary operation for it to be reduced as unary
#define GIL_BINARY_REDUCE_LIMIT 226

namespace boost { namespace mpl {

///////////////////////////////////////////////////////
/// Mapping vector - represents the mapping of one type vector to another
///  It is not a full-blown MPL Random Access Type sequence; just has at_c and size implemented
///
/// SrcTypes, DstTypes: MPL Random Access Type Sequences
///
/// Implements size and at_c to behave as if this is an MPL vector of integers
///////////////////////////////////////////////////////

template <typename SrcTypes, typename DstTypes>
struct mapping_vector {};

template <typename SrcTypes, typename DstTypes, long K>
struct at_c<mapping_vector<SrcTypes,DstTypes>, K> {
    static const std::size_t value=size<DstTypes>::value - order<DstTypes, typename gil::at_c<SrcTypes,K>::type>::type::value +1;
    typedef size_t<value> type;
};

template <typename SrcTypes, typename DstTypes>
struct size<mapping_vector<SrcTypes,DstTypes> > {
    typedef typename size<SrcTypes>::type type;
    static const std::size_t value=type::value;
};

///////////////////////////////////////////////////////
/// copy_to_vector - copies a sequence (mpl::set) to vector.
///
/// Temporary solution because I couldn't get mpl::copy to do this.
/// This is what I tried:
/// mpl::copy<SET, mpl::back_inserter<mpl::vector<> > >::type;
/// It works when SET is mpl::vector, but not when SET is mpl::set...
///////////////////////////////////////////////////////

namespace detail {
    template <typename SFirst, std::size_t NLeft>
    struct copy_to_vector_impl {
    private:
        typedef typename deref<SFirst>::type T;
        typedef typename next<SFirst>::type next;
        typedef typename copy_to_vector_impl<next, NLeft-1>::type rest;
    public:
        typedef typename push_front<rest, T>::type type;
    };

    template <typename SFirst>
    struct copy_to_vector_impl<SFirst,1> {
        typedef vector<typename deref<SFirst>::type> type;
    };
}

template <typename Src>
struct copy_to_vector {
    typedef typename detail::copy_to_vector_impl<typename begin<Src>::type, size<Src>::value>::type type;
};

template <>
struct copy_to_vector<set<> > {
    typedef vector0<> type;
};

} } // boost::mpl

namespace boost { namespace gil {

///////////////////////////////////////////////////////
///
/// unary_reduce, binary_reduce - given an MPL Random Access Sequence,
/// dynamically specified index to that container, the bits of an instance of the corresponding type and
/// a generic operation, invokes the operation on the given type
///
///////////////////////////////////////////////////////

///////////////////////////////////////////////////////
///
/// \brief Unary reduce.
///
/// Given a set of types and an operation, reduces each type in the set (to reduced_t), then removes duplicates (to unique_t)
/// To apply the operation, first constructs a lookup table that maps each element from Types to its place in unique_t and uses it to map
/// the index to anther index (in map_index). Then invokes apply_operation_base on the unique types with the new index.
///
///////////////////////////////////////////////////////

template <typename Types, typename Op>
struct unary_reduce_impl {
    typedef typename mpl::transform<Types, detail::reduce<Op, mpl::_1> >::type reduced_t;
    typedef typename mpl::copy<reduced_t, mpl::inserter<mpl::set<>, mpl::insert<mpl::_1,mpl::_2> > >::type unique_t;
    static const bool is_single=mpl::size<unique_t>::value==1;
};

template <typename Types, typename Op, bool IsSingle=unary_reduce_impl<Types,Op>::is_single>
struct unary_reduce : public unary_reduce_impl<Types,Op> {
    typedef typename unary_reduce_impl<Types,Op>::reduced_t reduced_t;
    typedef typename unary_reduce_impl<Types,Op>::unique_t unique_t;

    static unsigned short inline map_index(std::size_t index) {
        typedef typename mpl::mapping_vector<reduced_t, unique_t> indices_t;
        return gil::at_c<indices_t, unsigned short>(index);
    }
    template <typename Bits> BOOST_FORCEINLINE static typename Op::result_type applyc(const Bits& bits, std::size_t index, Op op) {
        return apply_operation_basec<unique_t>(bits,map_index(index),op);
    }

    template <typename Bits> BOOST_FORCEINLINE static typename Op::result_type apply(Bits& bits, std::size_t index, Op op) {
        return apply_operation_base<unique_t>(bits,map_index(index),op);
    }
};

template <typename Types, typename Op>
struct unary_reduce<Types,Op,true> : public unary_reduce_impl<Types,Op> {
    typedef typename unary_reduce_impl<Types,Op>::unique_t unique_t;
    static unsigned short inline map_index(std::size_t index) { return 0; }

    template <typename Bits> BOOST_FORCEINLINE static typename Op::result_type applyc(const Bits& bits, std::size_t index, Op op) {
        return op(*gil_reinterpret_cast_c<const typename mpl::front<unique_t>::type*>(&bits));
    }

    template <typename Bits> BOOST_FORCEINLINE static typename Op::result_type apply(Bits& bits, std::size_t index, Op op) {
        return op(*gil_reinterpret_cast<typename       mpl::front<unique_t>::type*>(&bits));
    }
};

///////////////////////////////////////////////////////
///
/// \brief Binary reduce.
///
/// Given two sets of types, Types1 and Types2, first performs unary reduction on each. Then checks if the product of their sizes is above
/// the GIL_BINARY_REDUCE_LIMIT limit. If so, the operation is too complex to be binary-reduced and uses a specialization of binary_reduce_impl
/// to simply call the binary apply_operation_base (which performs two nested 1D apply operations)
/// If the operation is not too complex, uses the other specialization of binary_reduce_impl to create a cross-product of the input types
/// and performs unary reduction on the result (bin_reduced_t). To apply the binary operation, it simply invokes a unary apply_operation_base
/// on the reduced cross-product types
///
///////////////////////////////////////////////////////

namespace detail {
    struct pair_generator {
        template <typename Vec2> struct apply {
            typedef std::pair<const typename mpl::at_c<Vec2,0>::type*, const typename mpl::at_c<Vec2,1>::type*> type;
        };
    };

    // When the types are not too large, applies reduce on their cross product
    template <typename Unary1, typename Unary2, typename Op, bool IsComplex>
    struct binary_reduce_impl {
    //private:
        typedef typename mpl::copy_to_vector<typename Unary1::unique_t>::type vec1_types;
        typedef typename mpl::copy_to_vector<typename Unary2::unique_t>::type vec2_types;

        typedef mpl::cross_vector<mpl::vector2<vec1_types, vec2_types>, pair_generator> BIN_TYPES;
        typedef unary_reduce<BIN_TYPES,Op> bin_reduced_t;

        static unsigned short inline map_index(std::size_t index1, std::size_t index2) {
            unsigned short r1=Unary1::map_index(index1);
            unsigned short r2=Unary2::map_index(index2);
            return bin_reduced_t::map_index(r2*mpl::size<vec1_types>::value + r1);
        }
    public:
        typedef typename bin_reduced_t::unique_t unique_t;

        template <typename Bits1, typename Bits2>
        static typename Op::result_type inline apply(const Bits1& bits1, std::size_t index1, const Bits2& bits2, std::size_t index2, Op op) {
            std::pair<const void*,const void*> pr(&bits1, &bits2);
            return apply_operation_basec<unique_t>(pr, map_index(index1,index2),op);
        }
    };

    // When the types are large performs a double-dispatch. Binary reduction is not done.
    template <typename Unary1, typename Unary2, typename Op>
    struct binary_reduce_impl<Unary1,Unary2,Op,true> {
        template <typename Bits1, typename Bits2>
        static typename Op::result_type inline apply(const Bits1& bits1, std::size_t index1, const Bits2& bits2, std::size_t index2, Op op) {
            return apply_operation_base<Unary1::unique_t,Unary2::unique_t>(bits1, index1, bits2, index2, op);
        }
    };
}

template <typename Types1, typename Types2, typename Op>
struct binary_reduce {
//private:
    typedef unary_reduce<Types1,Op> unary1_t;
    typedef unary_reduce<Types2,Op> unary2_t;

    static const std::size_t CROSS_SIZE = mpl::size<typename unary1_t::unique_t>::value *
                                          mpl::size<typename unary2_t::unique_t>::value;

    typedef detail::binary_reduce_impl<unary1_t,unary2_t,Op, (CROSS_SIZE>GIL_BINARY_REDUCE_LIMIT)> impl;
public:
    template <typename Bits1, typename Bits2>
    static typename Op::result_type inline apply(const Bits1& bits1, std::size_t index1, const Bits2& bits2, std::size_t index2, Op op) {
        return impl::apply(bits1,index1,bits2,index2,op);
    }
};

template <typename Types, typename UnaryOp>
BOOST_FORCEINLINE typename UnaryOp::result_type apply_operation(variant<Types>& arg, UnaryOp op) {
    return unary_reduce<Types,UnaryOp>::template apply(arg._bits, arg._index ,op);
}

template <typename Types, typename UnaryOp>
BOOST_FORCEINLINE typename UnaryOp::result_type apply_operation(const variant<Types>& arg, UnaryOp op) {
    return unary_reduce<Types,UnaryOp>::template applyc(arg._bits, arg._index ,op);
}

template <typename Types1, typename Types2, typename BinaryOp>
BOOST_FORCEINLINE typename BinaryOp::result_type apply_operation(const variant<Types1>& arg1, const variant<Types2>& arg2, BinaryOp op) {
    return binary_reduce<Types1,Types2,BinaryOp>::template apply(arg1._bits, arg1._index, arg2._bits, arg2._index, op);
}

#undef GIL_BINARY_REDUCE_LIMIT

} }  // namespace gil

namespace boost { namespace mpl {
///////////////////////////////////////////////////////
/// \brief Represents the virtual cross-product of the types generated from VecOfVecs.
/// \ingroup CrossVector
/// INPUT:
///   VecOfVecs - a vector of vector types. For example [ [A1,A2,A3], [B1,B2], [C1,C2,C3,C4] ]
///       Each element must be a non-empty mpl vector
///   TypeGen - a metafunction that generates a type from a vector of types, each of which can be
///       selected from the corresponding vector in VecOfVecs. For example, [A1, B2, C4]
///
/// Represents the virtual cross-product of the types generated from VecOfVecs.
/// For example, [ TypeGen[A1,B1,C1], TypeGen[A2,B1,C1], TypeGen[A3,B1,C1],
///                TypeGen[A1,B2,C1], TypeGen[A2,B2,C1], TypeGen[A3,B2,C1],
///                TypeGen[A1,B1,C2], TypeGen[A2,B1,C2], TypeGen[A3,B1,C2], ... ]
///
/// Models an immutable MPL Random Access Sequence
/// Traversal, random-access, etc, is defined, but mutable operations,
///  such as push_back and pop_front are not supported
///////////////////////////////////////////////////////

template <typename VecOfVecs, typename TypeGen>
struct cross_vector {};

/// \brief Iterator of cross_vector
/// \ingroup CrossVectorIterator
template <typename VecOfVecs, typename TypeGen, std::size_t K>
struct cross_iterator {
    typedef mpl::random_access_iterator_tag category;
};

///////////////////////////////////////////////////////
/// Implementation of the iterator functions of cross vector
///////////////////////////////////////////////////////

/// \brief Dereferences a cross-vector iterator
/// \ingroup CrossVectorIterator
/// Creates a vector of the sizes of each type vector in VecOfVecs, then uses it as a basis
/// to represent the iterator's position K as a vector of indices. Extracts the corresponding type of
/// each input vector and passes the element types to the type generation function, which returns the dereferenced type
template <typename VecOfVecs, typename TypeGen, std::size_t K>
struct deref<cross_iterator<VecOfVecs,TypeGen,K> > {
private:
    typedef typename detail::select_subvector_c<VecOfVecs, K>::type DerefTypes;
public:
    typedef typename TypeGen::template apply<DerefTypes>::type type;
};

/// \brief Increments a cross-vector iterator.
/// \ingroup CrossVectorIterator
template <typename VecOfVecs, typename TypeGen, std::size_t K>
struct next<cross_iterator<VecOfVecs,TypeGen,K> > {
    typedef cross_iterator<VecOfVecs,TypeGen,K+1> type;
};

/// \brief Decrements a cross-vector iterator.
/// \ingroup CrossVectorIterator
template <typename VecOfVecs, typename TypeGen, std::size_t K>
struct prior<cross_iterator<VecOfVecs,TypeGen,K> > {
    typedef cross_iterator<VecOfVecs,TypeGen,K-1> type;
};

/// \brief Advances a cross-vector iterator.
/// \ingroup CrossVectorIterator
template <typename VecOfVecs, typename TypeGen, std::size_t K, typename Distance>
struct advance<cross_iterator<VecOfVecs,TypeGen,K>, Distance > {
    typedef cross_iterator<VecOfVecs,TypeGen,K+Distance::value> type;
};

/// \brief Computes the distance between two cross-vector iterator-s.
/// \ingroup CrossVectorIterator
// (shortened the names of the template arguments - otherwise doxygen cannot parse this...)
template <typename VecOfVecs, typename TypeGen, std::size_t K1, std::size_t K2>
struct distance<cross_iterator<VecOfVecs,TypeGen,K1>, cross_iterator<VecOfVecs,TypeGen,K2> > {
    typedef size_t<K2-K1> type;
};

///////////////////////////////////////////////////////
/// Implementation of cross vector
///////////////////////////////////////////////////////
/// \brief Computes the size of a cross vector as the product of the sizes of all vectors in VecOfVecs
/// \ingroup CrossVector
template <typename VecOfVecs, typename TypeGen>
struct size<cross_vector<VecOfVecs,TypeGen> > {
    typedef typename fold<VecOfVecs, size_t<1>, times<_1, size<_2> > >::type type;
    static const std::size_t value=type::value;
};

/// \brief Determines whether a cross vector is empty
/// \ingroup CrossVector
template <typename VecOfVecs, typename TypeGen>
struct empty<cross_vector<VecOfVecs,TypeGen> > {
    typedef typename empty<VecOfVecs>::type type;
};

/// \brief Returns the K-th element of a cross vector
/// \ingroup CrossVector
template <typename VecOfVecs, typename TypeGen, typename K>
struct at<cross_vector<VecOfVecs,TypeGen>, K> {
private:
    typedef cross_iterator<VecOfVecs,TypeGen,K::value> KthIterator;
public:
    typedef typename deref<KthIterator>::type type;
};

/// \brief Returns an iterator to the first element of a cross vector
/// \ingroup CrossVector
template <typename VecOfVecs, typename TypeGen>
struct begin<cross_vector<VecOfVecs,TypeGen> > {
    typedef cross_iterator<VecOfVecs,TypeGen,0> type;
};

/// \brief Returns an iterator to the last element of a cross vector
/// \ingroup CrossVector
template <typename VecOfVecs, typename TypeGen>
struct end<cross_vector<VecOfVecs,TypeGen> > {
private:
    typedef cross_vector<VecOfVecs,TypeGen> this_t;
public:
    typedef cross_iterator<VecOfVecs,TypeGen,size<this_t>::value> type;
};

/// \brief Returns the first element of a cross vector
/// \ingroup CrossVector
template <typename VecOfVecs, typename TypeGen>
struct front<cross_vector<VecOfVecs,TypeGen> > {
private:
    typedef cross_vector<VecOfVecs,TypeGen> this_t;
public:
    typedef typename deref<typename begin<this_t>::type>::type type;
};

/// \brief Returns the last element of a cross vector
/// \ingroup CrossVector
template <typename VecOfVecs, typename TypeGen>
struct back<cross_vector<VecOfVecs,TypeGen> > {
private:
    typedef cross_vector<VecOfVecs,TypeGen> this_t;
    typedef typename size<this_t>::type            size;
    typedef typename minus<size, size_t<1> >::type last_index;
public:
    typedef typename at<this_t, last_index>::type type;
};

/// \brief Transforms the elements of a cross vector
/// \ingroup CrossVector
template <typename VecOfVecs, typename TypeGen, typename OPP>
struct transform<cross_vector<VecOfVecs,TypeGen>, OPP > {
    typedef typename lambda<OPP>::type Op;
    struct adapter {
        template <typename Elements>
        struct apply {
            typedef typename TypeGen::template apply<Elements>::type orig_t;
            typedef typename Op::template apply<orig_t>::type type;
        };
    };
    typedef cross_vector<VecOfVecs, adapter > type;
};

} } // boost::mpl

namespace boost { namespace gil {

template <typename Types, typename T> struct type_to_index;
template <typename V> struct view_is_basic;
struct rgb_t;
struct lab_t;
struct hsb_t;
struct cmyk_t;
struct rgba_t;
struct error_t;

namespace detail {
    ////////////////////////////////////////////////////////
    ////
    ////   Generic reduce operation
    ////
    ////////////////////////////////////////////////////////
    template <typename Op, typename T>
    struct reduce {
        typedef T type;
    };

    ////////////////////////////////////////////////////////
    ////
    ////   Unary reduce_view operation. Splits into basic and non-basic views.
    ////   Algorithm-specific reduce should specialize for basic views
    ////
    ////////////////////////////////////////////////////////

    template <typename Op, typename View, bool IsBasic>
    struct reduce_view_basic {
        typedef View type;
    };

    template <typename Op, typename Loc>
    struct reduce<Op, image_view<Loc> >
        : public reduce_view_basic<Op,image_view<Loc>,view_is_basic<image_view<Loc> >::value> {};

    ////////////////////////////////////////////////////////
    ////
    ////   Unary reduce_image operation. Splits into basic and non-basic images.
    ////   Algorithm-specific reduce should specialize for basic images
    ////
    ////////////////////////////////////////////////////////

    template <typename Op, typename Img, bool IsBasic>
    struct reduce_image_basic {
        typedef Img type;
    };

    template <typename Op, typename V, typename Alloc>
    struct reduce<Op, image<V,Alloc> > : public reduce_image_basic<Op,image<V,Alloc>,image_is_basic<image<V,Alloc> >::value > {};

    ////////////////////////////////////////////////////////
    ////
    ////   Binary reduce_view operation. Splits into basic and non-basic views.
    ////   Algorithm-specific reduce should specialize for basic views
    ////
    ////////////////////////////////////////////////////////

    template <typename Op, typename V1, typename V2, bool AreBasic>
    struct reduce_views_basic {
        typedef std::pair<const V1*, const V2*> type;
    };

    template <typename Op, typename L1, typename L2>
    struct reduce<Op, std::pair<const image_view<L1>*, const image_view<L2>*> >
        : public reduce_views_basic<Op,image_view<L1>,image_view<L2>,
                 mpl::and_<view_is_basic<image_view<L1> >, view_is_basic<image_view<L2> > >::value >
    {};

    ////////////////////////////////////////////////////////
    ////
    ////   Color space unary reduce operation. Reduce a color space to a base with the same number of channels
    ////
    ////////////////////////////////////////////////////////

    template <typename Cs>
    struct reduce_color_space {
        typedef Cs type;
    };

    template <> struct reduce_color_space<lab_t> { typedef rgb_t type; };
    template <> struct reduce_color_space<hsb_t> { typedef rgb_t type; };
    template <> struct reduce_color_space<cmyk_t> { typedef rgba_t type; };

    /*
    ////////////////////////////////////////////////////////
    ////
    ////   Color space binary reduce operation. Given a source and destination color spaces,
    ////   returns a reduced source and destination color spaces that have the same mapping of channels
    ////
    ////   Precondition: The two color spaces must be compatible (i.e. must have the same set of channels)
    ////////////////////////////////////////////////////////

    template <typename Vec, int Basis, int VecSize>
    struct type_vec_to_integer_impl {
        typedef typename mpl::back<Vec>::type     last;
        typedef typename mpl::pop_back<Vec>::type rest;
        static const int value = type_vec_to_integer_impl<rest, Basis, VecSize-1>::value * Basis + last::value;
    };

    template <typename Vec, int Basis>
    struct type_vec_to_integer_impl<Vec,Basis,0> {
        static const int value=0;
    };

    template <typename Vec, int Basis=10>
    struct type_vec_to_integer {
        static const int value = type_vec_to_integer_impl<Vec,Basis, mpl::size<Vec>::value>::value;
    };

    // Given two color spaces and the mapping of the channels between them, returns the reduced pair of color spaces
    // The default version performs no reduction
    template <typename SrcColorSpace, typename DstColorSpace, int Mapping>
    struct reduce_color_spaces_impl {
        typedef SrcColorSpace first_t;
        typedef DstColorSpace second_t;
    };

    // 012: RGB-RGB, bgr-bgr, lab-lab, hsb-hsb
    template <typename SrcColorSpace, typename DstColorSpace>
    struct reduce_color_spaces_impl<SrcColorSpace,DstColorSpace,12> {
        typedef rgb_t first_t;
        typedef rgb_t second_t;
    };

    // 210: RGB-bgr, bgr-RGB
    template <typename SrcColorSpace, typename DstColorSpace>
    struct reduce_color_spaces_impl<SrcColorSpace,DstColorSpace,210> {
        typedef rgb_t first_t;
        typedef bgr_t second_t;
    };

    // 0123: RGBA-RGBA, bgra-bgra, argb-argb, abgr-abgr cmyk-cmyk
    template <typename SrcColorSpace, typename DstColorSpace>
    struct reduce_color_spaces_impl<SrcColorSpace,DstColorSpace,123> {
        typedef rgba_t first_t;
        typedef rgba_t second_t;
    };

    // 3210: RGBA-abgr, bgra-argb, argb-bgra, abgr-RGBA
    template <typename SrcColorSpace, typename DstColorSpace>
    struct reduce_color_spaces_impl<SrcColorSpace,DstColorSpace,3210> {
        typedef rgba_t first_t;
        typedef abgr_t second_t;
    };

    // 1230: RGBA-argb, bgra-abgr
    template <typename SrcColorSpace, typename DstColorSpace>
    struct reduce_color_spaces_impl<SrcColorSpace,DstColorSpace,1230> {
        typedef rgba_t first_t;
        typedef argb_t second_t;
    };

    // 2103: RGBA-bgra, bgra-RGBA (uses subclass to ensure that base color space is not reduced to derived)
    template <typename SrcColorSpace, typename DstColorSpace>
    struct reduce_color_spaces_impl<SrcColorSpace,DstColorSpace,2103> {
        typedef rgba_t first_t;
        typedef bgra_t second_t;
    };

    // 3012: argb-RGBA, abgr-bgra
    template <typename SrcColorSpace, typename DstColorSpace>
    struct reduce_color_spaces_impl<SrcColorSpace,DstColorSpace,3012> {
        typedef argb_t first_t;
        typedef rgba_t second_t;
    };

    // 0321: argb-abgr, abgr-argb
    template <typename SrcColorSpace, typename DstColorSpace>
    struct reduce_color_spaces_impl<SrcColorSpace,DstColorSpace,321> {
        typedef argb_t first_t;
        typedef abgr_t second_t;
    };

    template <typename SrcColorSpace, typename DstColorSpace>
    struct reduce_color_spaces {
        typedef typename channel_order<SrcColorSpace>::type src_order_t;
        typedef typename channel_order<DstColorSpace>::type dst_order_t;
        typedef typename mpl::transform<src_order_t, type_to_index<dst_order_t,mpl::_1> >::type mapping;
        static const int mapping_val = type_vec_to_integer<mapping>::value;

        typedef typename reduce_color_spaces_impl<SrcColorSpace,DstColorSpace,mapping_val>::first_t  _first_t;
        typedef typename reduce_color_spaces_impl<SrcColorSpace,DstColorSpace,mapping_val>::second_t _second_t;
        typedef typename mpl::and_<color_space_is_base<DstColorSpace>, mpl::not_< color_space_is_base<_second_t> > > swap_t;
    public:
        typedef typename mpl::if_<swap_t, _second_t, _first_t>::type first_t;
        typedef typename mpl::if_<swap_t, _first_t, _second_t>::type second_t;
    };
*/
// TODO: Use the old code for reduce_color_spaces above to do color layout reduction
    template <typename SrcLayout, typename DstLayout>
    struct reduce_color_layouts {
        typedef SrcLayout first_t;
        typedef DstLayout second_t;
    };

    ////////////////////////////////////////////////////////
    ////
    ////   Reduce for copy_pixels
    ////
    ////////////////////////////////////////////////////////

    struct copy_pixels_fn;

    /*
    // 1D reduce for copy_pixels reduces the channel to mutable and the color space to its base with same dimensions
    template <typename View>
    struct reduce_view_basic<copy_pixels_fn,View,true> {
    private:
        typedef typename reduce_color_space<typename View::color_space_t>::type Cs;    // reduce the color space
        typedef layout<Cs, typename View::channel_mapping_t> layout_t;
    public:
        typedef typename derived_view_type<View, use_default, layout_t, use_default, use_default, mpl::true_>::type type;
    };
*/
    // Incompatible views cannot be used in copy_pixels - will throw std::bad_cast
    template <typename V1, typename V2, bool Compatible>
    struct reduce_copy_pixop_compat {
        typedef error_t type;
    };

    // For compatible basic views, reduce their color spaces based on their channel mapping.
    // Make the source immutable and the destination mutable (they should already be that way)
    template <typename V1, typename V2>
    struct reduce_copy_pixop_compat<V1,V2,true> {
        typedef layout<typename V1::color_space_t, typename V1::channel_mapping_t> layout1;
        typedef layout<typename V2::color_space_t, typename V2::channel_mapping_t> layout2;

        typedef typename reduce_color_layouts<layout1,layout2>::first_t L1;
        typedef typename reduce_color_layouts<layout1,layout2>::second_t L2;

        typedef typename derived_view_type<V1, use_default, L1, use_default, use_default, use_default, mpl::false_>::type DV1;
        typedef typename derived_view_type<V2, use_default, L2, use_default, use_default, use_default, mpl::true_ >::type DV2;

        typedef std::pair<const DV1*, const DV2*> type;
    };

    // The general 2D version branches into compatible and incompatible views
    template <typename V1, typename V2>
    struct reduce_views_basic<copy_pixels_fn, V1, V2, true>
        : public reduce_copy_pixop_compat<V1, V2, mpl::and_<views_are_compatible<V1,V2>, view_is_mutable<V2> >::value > {
    };

    ////////////////////////////////////////////////////////
    ////
    ////   Reduce for variant destructor (basic views have no destructor)
    ////
    ////////////////////////////////////////////////////////

    struct destructor_op;
    template <typename View> struct reduce_view_basic<destructor_op,View,true> { typedef gray8_view_t type; };

    ////////////////////////////////////////////////////////
    ////
    ////   Reduce for get_dimensions (basic views and images have the same structure and the dimensions are contained at the beginning)
    ////
    ////////////////////////////////////////////////////////

    struct any_type_get_dimensions;
    template <typename View> struct reduce_view_basic<any_type_get_dimensions,View,true> { typedef gray8_view_t type; };
    template <typename Img>  struct reduce_image_basic<any_type_get_dimensions,Img,true> { typedef gray8_image_t type; };

    ////////////////////////////////////////////////////////
    ////
    ////   Reduce for get_num_channels (only color space matters)
    ////
    ////////////////////////////////////////////////////////

    struct any_type_get_num_channels;
    template <typename View> struct reduce_view_basic<any_type_get_num_channels,View,true> {
        typedef typename View::color_space_t::base Cs;
        typedef typename view_type<bits8,typename reduce_color_space<Cs>::type>::type type;
    };
    template <typename Img>  struct reduce_image_basic<any_type_get_num_channels,Img,true> {
        typedef typename Img::color_space_t::base Cs;
        typedef typename image_type<bits8,typename reduce_color_space<Cs>::type>::type type;
    };

    ////////////////////////////////////////////////////////
    ////
    ////   Reduce for resample_pixels (same as copy_pixels)
    ////
    ////////////////////////////////////////////////////////

    template <typename Sampler, typename MapFn> struct resample_pixels_fn;

    template <typename S, typename M, typename V, bool IsBasic>
    struct reduce_view_basic<resample_pixels_fn<S,M>, V, IsBasic> : public reduce_view_basic<copy_pixels_fn, V, IsBasic> {};

    template <typename S, typename M, typename V1, typename V2, bool IsBasic>
    struct reduce_views_basic<resample_pixels_fn<S,M>, V1, V2, IsBasic> : public reduce_views_basic<copy_pixels_fn, V1, V2, IsBasic> {};

    ////////////////////////////////////////////////////////
    ////
    ////   Reduce for copy_and_convert_pixels
    ////   (the only reduction could be made when views are compatible and have the same mapping, planarity and stepness)
    ////
    ////////////////////////////////////////////////////////

    template <typename CC> class copy_and_convert_pixels_fn;

    // the only thing for 1D reduce is making them all mutable...
    template <typename CC, typename View, bool IsBasic>
    struct reduce_view_basic<copy_and_convert_pixels_fn<CC>, View, IsBasic>
        : public derived_view_type<View, use_default, use_default, use_default, use_default, mpl::true_> {
    };

    // For 2D reduce, if they have the same channels and color spaces (i.e. the same pixels) then copy_and_convert is just copy.
    // In this case, reduce their common color space. In general make the first immutable and the second mutable
    template <typename CC, typename V1, typename V2, bool AreBasic>
    struct reduce_views_basic<copy_and_convert_pixels_fn<CC>, V1, V2, AreBasic> {
        typedef is_same<typename V1::pixel_t, typename V2::pixel_t> Same;

        typedef reduce_color_space<typename V1::color_space_t::base> CsR;
        typedef typename mpl::if_<Same, typename CsR::type, typename V1::color_space_t>::type Cs1;
        typedef typename mpl::if_<Same, typename CsR::type, typename V2::color_space_t>::type Cs2;

        typedef typename derived_view_type<V1, use_default, layout<Cs1, typename V1::channel_mapping_t>, use_default, use_default, mpl::false_>::type DV1;
        typedef typename derived_view_type<V2, use_default, layout<Cs2, typename V2::channel_mapping_t>, use_default, use_default, mpl::true_ >::type DV2;

        typedef std::pair<const DV1*, const DV2*> type;
    };

    //integral_image_generator
    //resize_clobber_image_fnobj
    //image_default_construct_fnobj
    //fill_converted_pixels_fn
    //bind(gil::detail::copy_pixels_fn(), _1, dst)
    //bind(gil::detail::copy_pixels_fn(), src,_1)

    //bind(detail::copy_and_convert_pixels_fn(), _1, dst)
    //bind(detail::copy_and_convert_pixels_fn(), src, _1)
    //gil::detail::fill_pixels_fn<Value>(val)

    //detail::copy_construct_in_place_fn<base_t>
    //detail::equal_to_fn<typename variant<Types>::base_t>

    //detail::any_image_get_view<typename any_image<Types>::view_t>
    //detail::any_image_get_const_view<typename any_image<Types>::view_t>
    //detail::flipped_up_down_view_fn<any_image_view<ViewTypes> >
    //detail::flipped_left_right_view_fn<typename any_image_view<ViewTypes>::dynamic_step_t>
    //detail::tranposed_view_fn<typename any_image_view<ViewTypes>::dynamic_step_t>
    //detail::rotated90cw_view_fn<typename any_image_view<ViewTypes>::dynamic_step_t>
    //detail::rotated90ccw_view_fn<typename any_image_view<ViewTypes>::dynamic_step_t>
    //detail::rotated180_view_fn<typename any_image_view<ViewTypes>::dynamic_step_t>
    //detail::subimage_view_fn<any_image_view<ViewTypes> >
    //detail::subsampled_view_fn<typename any_image_view<ViewTypes>::dynamic_step_t>
    //detail::nth_channel_view_fn<typename nth_channel_view_type<any_image_view<ViewTypes> >
    //detail::color_converted_view_fn<DstP,typename color_convert_view_type<any_image_view<ViewTypes>, DstP>::type >
}

} }  // namespace boost::gil

#endif // GIL_REDUCE_CODE_BLOAT

#endif


text:
<?php

namespace common\modules\user\clients;

use yii\authclient\OAuth2;
use yii\base\Exception;
use yii\helpers\Json;

class QqAuth extends OAuth2
{
    public $authUrl = 'https://graph.qq.com/oauth2.0/authorize';
    public $tokenUrl = 'https://graph.qq.com/oauth2.0/token';
    public $apiBaseUrl = 'https://graph.qq.com';

    public function init()
    {
        parent::init();
        if ($this->scope === null) {
            $this->scope = implode(',', [
                'get_user_info',
            ]);
        }
    }

    protected function initUserAttributes()
    {
        // 因为authclient升级导致processResponse方法没有了,QQ获取openid这个接口的返回又很奇葩,是个jsonp格式,httpclient又不支持

        $openid = $this->getOpenId();
        $qquser = $this->api("user/get_user_info", 'GET', ['oauth_consumer_key'=>$openid['client_id'], 'openid'=>$openid['openid']]);
        $qquser['openid'] = $openid['openid'];
        $qquser['id'] = $qquser['openid'];
        $qquser['login'] = $qquser['nickname'];
        $qquser['email'] = $qquser['nickname'] . '@qq.com';
        $qquser['avatar'] = $qquser['figureurl_qq_2'];
        return $qquser;
    }

    public function getOpenId()
    {
        $request = $this->createApiRequest()
            ->setMethod('get')
            ->setUrl('oauth2.0/me');

        $response = $request->send();
        $rawResponse = $response->getContent();
        if(strpos($rawResponse, "callback") !== false){
            $lpos = strpos($rawResponse, "(");
            $rpos = strrpos($rawResponse, ")");
            $rawResponse = substr($rawResponse, $lpos + 1, $rpos - $lpos -1);
            $openid = Json::decode($rawResponse);
            return $openid;
        }
        return false;
    }
    protected function defaultName()
    {
        return 'QQ';
    }

    protected function defaultTitle()
    {
        return 'QQ';
    }
}


text:
import shelve
import sys
from QBOmy import QBO

intermediateObjCount=0;
# [{name:bag,selected:boolean,intermediate sql,schema}]
BagDict2 = [];
Selected = []
OperationsList = []
qbo=None;
d=None
def initBackend():
    global qbo,intermediateObjCount, BagDict2,d,Selected
    d = shelve.open("session_shelve_file") # open, with (g)dbm filename -- no suffix
    if(d.has_key("key")):
        # if(d.has_key("BagDict2")):
        #     del d["BagDict2"]
        #     d["BagDict2"]=[]
        Selected = d["Selected"]
        intermediateObjCount=d["intermediateObjCount"]
        BagDict2 = d["BagDict2"]
        OperationsList = d["OperationsList"]
    else:
        intermediateObjCount=0
        BagDict2 = []
        Selected = [None,None]
       	OperationsList = [{"name":"union","selected":False},
			  {"name":"except","selected":False},
			  {"name":"intersect","selected":False}]
    qbo=QBO({"intermediateObjCount":intermediateObjCount, "BagDict2":BagDict2,"Selected":Selected,"OperationsList":OperationsList})

def addBagHelper(x,cnt):
    try_name=x+("" if cnt==0 else str(cnt))
    found=False
    for val in qbo.BagDict2:
        if(val["name"]==try_name):
            found=True
            addBagHelper(x,cnt+1)
            break;
    if not found:
     #   sys.stderr.write("hello")
        qbo.insertObjectInBag(x,try_name)
def addBag(x):
    # -- main code
    global qbo,d
    initBackend()
    addBagHelper(x,0)
    endBackend()

def endBackend():
    global d;
    d["intermediateObjCount"]=qbo.intermediateObjCount
    d["BagDict2"]=qbo.BagDict2
    d["Selected"] = qbo.Selected
    d["OperationsList"]=qbo.OperationsList
    d["key"]=True
    d.close()

def getObjects():
    global qbo,d
    initBackend()
    retval=qbo.ObjectsList
    endBackend()
    return retval

def getObjectsWithNames():
    global qbo,d
    initBackend()
    retval=qbo.ObjectsListWithNames
    endBackend()
    return retval

def getBags():
    global qbo,d
    initBackend()
    retval=qbo.BagDict2
    endBackend()
    return retval

def deleteAllBags():
    global qbo,d
    initBackend()
    qbo.BagDict2=[]
    endBackend()

def selectTable(x):
    global qbo
    initBackend()
    qbo.selectTable(x)
    # for obj in qbo.BagDict2:
    # 	if(obj['name']==x):
    #     	obj['selected']=True
    endBackend()

def unSelectTable(x):
    global qbo
    initBackend()
    qbo.unselectTable(x)
    # for obj in qbo.BagDict2:
    # 	if(obj['name']==x):
    #     	obj['selected']=False
    endBackend()
def selectOperation(x):
    global qbo
    initBackend()
    sys.stderr.write(x)
    qbo.selectOperation(x)
    # for obj in qbo.BagDict2:
    # 	if(obj['name']==x):
    #     	obj['selected']=True
    endBackend()

def unSelectOperation(x):
    global qbo
    initBackend()
    sys.stderr.write(x)
    qbo.unselectOperation(x)
    # for obj in qbo.BagDict2:
    # 	if(obj['name']==x):
    #     	obj['selected']=False
    endBackend()

def deleteBag(x):
    global qbo
    initBackend()
    for i, obj in enumerate(qbo.BagDict2):
        if(obj["name"]==x):
            del qbo.BagDict2[i]
            break;
    endBackend()

def operateHelper(x,cnt):
    try_name=x+("" if cnt==0 else str(cnt))
    found=False
    for val in qbo.BagDict2:
        if(val["name"]==try_name):
            found=True
            operateHelper(x,cnt+1)
            break;
    if not found:
        sys.stderr.write("hello")
        qbo.operate(try_name);

def operate():
    global qbo
    initBackend()
    operateHelper('intermediateBag',0)
    endBackend()

def renameBagHelper(x,cnt):

    try_name=x+('' if cnt==0 else str(cnt))
    for obj in qbo.BagDict2:
        if(obj["name"]==try_name):
            return renameBagHelper(x,cnt+1)
    return try_name

def renameBag(x,newname):
    global qbo
    initBackend()
    for i, obj in enumerate(qbo.BagDict2):
        if(obj["name"]==x):
            qbo.renameBag(i,x,renameBagHelper(newname,0))
    endBackend()

def viewData(x):
    global qbo
    initBackend()
    retval= qbo.viewData(x)
    endBackend()
    return retval

def printForm(x):
    global qbo
    initBackend()
    retval= qbo.printForm(x)
    endBackend()
    return retval

def finalize(table,finalSchema,initialCount,finalCount):
    initBackend()
    whereString = ""
    colString = ""
    colCount=0
    whereCount=0
    for i in finalSchema:
        if(colCount==0):
            colString = colString + i[0]
            colCount = colCount+1
        else:
            colString = colString + " , "+ i[0]
            colCount = colCount+1
        if(i[1]!=None):
            sys.stderr.write("^^^"+str(i[0])+"^^^"+str(i[1])+"^^^");
            if(whereCount == 0):
                whereString = ' where ' + i[0] + " like '" +i[1] +"'"
                whereCount = whereCount +1
            else:
                whereString = whereString + "," + i[0] + " like '" + i[1] + "'"
                whereCount = whereCount +1
    sys.stderr.write("Finalize whereString: "+whereString +" colString: " + colString);
    if(initialCount==finalCount):
        colString ="*"
    for index,i in enumerate(qbo.BagDict2):
        if(i["name"] == table):
            oldsql = i["sql"]+ ' as ' + table
            newsql = "select "+colString+" "+oldsql[oldsql.find("from"):]+whereString
#            sys.stderr.write("---  "+ oldsql+ " ----")
#            sys.stderr.write("---  "+ newsql+ " ----")
            qbo.BagDict2[index]["sql"] = newsql
            sys.stderr.write("---- > "+ str(qbo.BagDict2[index]["sql"])+ "<-------")
            endBackend()
            return
    endBackend()

def getOperations():
    global qbo,d
    initBackend()
    retval=qbo.OperationsList
    endBackend()
    return retval


text:
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * @fileoverview Polymer element for signin fatal error.
 */

import '//resources/js/action_link.js';
import '//resources/polymer/v3_0/iron-icon/iron-icon.js';
import '../../components/oobe_icons.m.js';
import '../../components/common_styles/common_styles.m.js';
import '../../components/common_styles/oobe_dialog_host_styles.m.js';
import '../../components/dialogs/oobe_adaptive_dialog.js';

import {html, mixinBehaviors, PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js';

import {LoginScreenBehavior, LoginScreenBehaviorInterface} from '../../components/behaviors/login_screen_behavior.m.js';
import {OobeDialogHostBehavior} from '../../components/behaviors/oobe_dialog_host_behavior.m.js';
import {OobeI18nBehavior, OobeI18nBehaviorInterface} from '../../components/behaviors/oobe_i18n_behavior.m.js';
import {OobeTextButton} from '../../components/buttons/oobe_text_button.js';
import {OOBE_UI_STATE, SCREEN_GAIA_SIGNIN} from '../../components/display_manager_types.m.js';
import {OobeTypes} from '../../components/oobe_types.m.js';

/**
 * @constructor
 * @extends {PolymerElement}
 * @implements {LoginScreenBehaviorInterface}
 * @implements {OobeI18nBehaviorInterface}
 */
const SigninFatalErrorBase = mixinBehaviors(
    [OobeI18nBehavior, OobeDialogHostBehavior, LoginScreenBehavior],
    PolymerElement);

/**
 * @typedef {{
 *   actionButton:  OobeTextButton,
 * }}
 */
SigninFatalErrorBase.$;

/**
 * @polymer
 */
class SigninFatalScreen extends SigninFatalErrorBase {
  static get is() {
    return 'signin-fatal-error-element';
  }

  static get template() {
    return html`{__html_template__}`;
  }

  static get properties() {
    return {
      /**
       * Subtitle that will be shown to the user describing the error
       * @private
       */
      errorSubtitle_: {
        type: String,
        computed: 'computeSubtitle_(locale, errorState_, params_)',
      },

      /**
       * Error state from the screen
       * @private
       */
      errorState_: {
        type: Number,
        value: 0,
      },

      /**
       * Additional information that will be used when creating the subtitle.
       * @private
       */
      params_: {
        type: Object,
        value: {},
      },

      keyboardHint_: {
        type: String,
      },

      details_: {
        type: String,
      },

      helpLinkText_: {
        type: String,
      },
    };
  }

  ready() {
    super.ready();
    this.initializeLoginScreen('SignInFatalErrorScreen');
  }

  /** Initial UI State for screen */
  getOobeUIInitialState() {
    return OOBE_UI_STATE.BLOCKING;
  }

  /**
   * Returns the control which should receive initial focus.
   */
  get defaultControl() {
    return this.$.actionButton;
  }

  /**
   * Invoked just before being shown. Contains all the data for the screen.
   * @suppress {missingProperties} params_ fields.
   */
  onBeforeShow(data) {
    this.errorState_ = data && 'errorState' in data && data.errorState;
    this.params_ = data;
    this.keyboardHint_ = this.params_.keyboardHint;
    this.details_ = this.params_.details;
    this.helpLinkText_ = this.params_.helpLinkText;
  }

  onClick_() {
    this.userActed('screen-dismissed');
  }

  /**
   * Generates the key for the button that is shown to the
   * user based on the error
   * @param {number} error_state
   * @private
   * @suppress {missingProperties} OobeTypes
   */
  computeButtonKey_(error_state) {
    if (this.errorState_ == OobeTypes.FatalErrorCode.INSECURE_CONTENT_BLOCKED) {
      return 'fatalErrorDoneButton';
    }

    return 'fatalErrorTryAgainButton';
  }

  /**
   * Generates the subtitle that is shown to the
   * user based on the error
   * @param {string} locale
   * @param {number} error_state
   * @param {string} params
   * @private
   * @suppress {missingProperties} errorText in this.params_
   */
  computeSubtitle_(locale, error_state, params) {
    switch (this.errorState_) {
      case OobeTypes.FatalErrorCode.SCRAPED_PASSWORD_VERIFICATION_FAILURE:
        return this.i18n('fatalErrorMessageVerificationFailed');
      case OobeTypes.FatalErrorCode.MISSING_GAIA_INFO:
        return this.i18n('fatalErrorMessageNoAccountDetails');
      case OobeTypes.FatalErrorCode.INSECURE_CONTENT_BLOCKED:
        return this.i18n(
            'fatalErrorMessageInsecureURL',
            'url' in this.params_ && this.params_.url);
      case OobeTypes.FatalErrorCode.CUSTOM:
        return this.params_.errorText;
      case OobeTypes.FatalErrorCode.UNKNOWN:
        return '';
    }
  }

  onHelpLinkClicked_() {
    this.userActed('learn-more');
  }
}

customElements.define(SigninFatalScreen.is, SigninFatalScreen);


text:
%% Machine Learning Online Class - Exercise 4 Neural Network Learning

%  Instructions
%  ------------
%
%  This file contains code that helps you get started on the
%  linear exercise. You will need to complete the following functions
%  in this exericse:
%
%     sigmoidGradient.m
%     randInitializeWeights.m
%     nnCostFunction.m
%
%  For this exercise, you will not need to change any code in this file,
%  or any other files other than those mentioned above.
%

%% Initialization
clear ; close all; clc

%% Setup the parameters you will use for this exercise
input_layer_size  = 400;  % 20x20 Input Images of Digits
hidden_layer_size = 25;   % 25 hidden units
num_labels = 10;          % 10 labels, from 1 to 10
                          % (note that we have mapped "0" to label 10)

%% =========== Part 1: Loading and Visualizing Data =============
%  We start the exercise by first loading and visualizing the dataset.
%  You will be working with a dataset that contains handwritten digits.
%

% Load Training Data
fprintf('Loading and Visualizing Data ...\n')

load('ex4data1.mat');
m = size(X, 1);

% Randomly select 100 data points to display
sel = randperm(size(X, 1));
sel = sel(1:100);

displayData(X(sel, :));

fprintf('Program paused. Press enter to continue.\n');
pause;

%% ================ Part 2: Loading Parameters ================
% In this part of the exercise, we load some pre-initialized
% neural network parameters.

fprintf('\nLoading Saved Neural Network Parameters ...\n')

% Load the weights into variables Theta1 and Theta2
load('ex4weights.mat');

% Unroll parameters
nn_params = [Theta1(:) ; Theta2(:)];

%% ================ Part 3: Compute Cost (Feedforward) ================
%  To the neural network, you should first start by implementing the
%  feedforward part of the neural network that returns the cost only. You
%  should complete the code in nnCostFunction.m to return cost. After
%  implementing the feedforward to compute the cost, you can verify that
%  your implementation is correct by verifying that you get the same cost
%  as us for the fixed debugging parameters.
%
%  We suggest implementing the feedforward cost *without* regularization
%  first so that it will be easier for you to debug. Later, in part 4, you
%  will get to implement the regularized cost.
%
fprintf('\nFeedforward Using Neural Network ...\n')

% Weight regularization parameter (we set this to 0 here).
lambda = 0;

J = nnCostFunction(nn_params, input_layer_size, hidden_layer_size, ...
                   num_labels, X, y, lambda);

fprintf(['Cost at parameters (loaded from ex4weights): %f '...
         '\n(this value should be about 0.287629)\n'], J);

fprintf('\nProgram paused. Press enter to continue.\n');
pause;

%% =============== Part 4: Implement Regularization ===============
%  Once your cost function implementation is correct, you should now
%  continue to implement the regularization with the cost.
%

fprintf('\nChecking Cost Function (w/ Regularization) ... \n')

% Weight regularization parameter (we set this to 1 here).
lambda = 1;

J = nnCostFunction(nn_params, input_layer_size, hidden_layer_size, ...
                   num_labels, X, y, lambda);

fprintf(['Cost at parameters (loaded from ex4weights): %f '...
         '\n(this value should be about 0.383770)\n'], J);

fprintf('Program paused. Press enter to continue.\n');
pause;

%% ================ Part 5: Sigmoid Gradient  ================
%  Before you start implementing the neural network, you will first
%  implement the gradient for the sigmoid function. You should complete the
%  code in the sigmoidGradient.m file.
%

fprintf('\nEvaluating sigmoid gradient...\n')

g = sigmoidGradient([1 -0.5 0 0.5 1]);
fprintf('Sigmoid gradient evaluated at [1 -0.5 0 0.5 1]:\n  ');
fprintf('%f ', g);
fprintf('\n\n');

fprintf('Program paused. Press enter to continue.\n');
pause;

%% ================ Part 6: Initializing Pameters ================
%  In this part of the exercise, you will be starting to implment a two
%  layer neural network that classifies digits. You will start by
%  implementing a function to initialize the weights of the neural network
%  (randInitializeWeights.m)

fprintf('\nInitializing Neural Network Parameters ...\n')

initial_Theta1 = randInitializeWeights(input_layer_size, hidden_layer_size);
initial_Theta2 = randInitializeWeights(hidden_layer_size, num_labels);

% Unroll parameters
initial_nn_params = [initial_Theta1(:) ; initial_Theta2(:)];

%% =============== Part 7: Implement Backpropagation ===============
%  Once your cost matches up with ours, you should proceed to implement the
%  backpropagation algorithm for the neural network. You should add to the
%  code you've written in nnCostFunction.m to return the partial
%  derivatives of the parameters.
%
fprintf('\nChecking Backpropagation... \n');

%  Check gradients by running checkNNGradients
checkNNGradients;

fprintf('\nProgram paused. Press enter to continue.\n');
pause;

%% =============== Part 8: Implement Regularization ===============
%  Once your backpropagation implementation is correct, you should now
%  continue to implement the regularization with the cost and gradient.
%

fprintf('\nChecking Backpropagation (w/ Regularization) ... \n')

%  Check gradients by running checkNNGradients
lambda = 3;
checkNNGradients(lambda);

% Also output the costFunction debugging values
debug_J  = nnCostFunction(nn_params, input_layer_size, ...
                          hidden_layer_size, num_labels, X, y, lambda);

fprintf(['\n\nCost at (fixed) debugging parameters (w/ lambda = 10): %f ' ...
         '\n(this value should be about 0.576051)\n\n'], debug_J);

fprintf('Program paused. Press enter to continue.\n');
pause;

%% =================== Part 8: Training NN ===================
%  You have now implemented all the code necessary to train a neural
%  network. To train your neural network, we will now use "fmincg", which
%  is a function which works similarly to "fminunc". Recall that these
%  advanced optimizers are able to train our cost functions efficiently as
%  long as we provide them with the gradient computations.
%
fprintf('\nTraining Neural Network... \n')

%  After you have completed the assignment, change the MaxIter to a larger
%  value to see how more training helps.
options = optimset('MaxIter', 450);

%  You should also try different values of lambda
lambda = 1;

% Create "short hand" for the cost function to be minimized
costFunction = @(p) nnCostFunction(p, ...
                                   input_layer_size, ...
                                   hidden_layer_size, ...
                                   num_labels, X, y, lambda);

% Now, costFunction is a function that takes in only one argument (the
% neural network parameters)
[nn_params, cost] = fmincg(costFunction, initial_nn_params, options);

% Obtain Theta1 and Theta2 back from nn_params
Theta1 = reshape(nn_params(1:hidden_layer_size * (input_layer_size + 1)), ...
                 hidden_layer_size, (input_layer_size + 1));

Theta2 = reshape(nn_params((1 + (hidden_layer_size * (input_layer_size + 1))):end), ...
                 num_labels, (hidden_layer_size + 1));

fprintf('Program paused. Press enter to continue.\n');
pause;

%% ================= Part 9: Visualize Weights =================
%  You can now "visualize" what the neural network is learning by
%  displaying the hidden units to see what features they are capturing in
%  the data.

fprintf('\nVisualizing Neural Network... \n')

displayData(Theta1(:, 2:end));

fprintf('\nProgram paused. Press enter to continue.\n');
pause;

%% ================= Part 10: Implement Predict =================
%  After training the neural network, we would like to use it to predict
%  the labels. You will now implement the "predict" function to use the
%  neural network to predict the labels of the training set. This lets
%  you compute the training set accuracy.

pred = predict(Theta1, Theta2, X);

fprintf('\nTraining Set Accuracy: %f\n', mean(double(pred == y)) * 100);


text:
title: Devin Nunes, California Congressperson
name: Devin Nunes
avatar: /ui/img/avatars/Devin_Nunes.jpg
party: republican
state: california
type: congressperson
lasthall: 2003-01-03
phone: 202-225-2523
never: TRUE
twitter: Rep_DevinNunes
---


text:
from pyplusplus import module_builder
from pyplusplus.module_builder.call_policies import *
from pyplusplus import function_transformers as FT
from pygccxml import declarations
import os
import sys
import re

sys.path.append("..")
from wrap_helpers import *

class OsgSimWrapper(BaseWrapper):
    "Class that knows how to generate code for osgSim python module"
    def __init__(self):
        BaseWrapper.__init__(self, files=["wrap_osgSim.h",])
        # Don't rewrap anything already wrapped by osg etc.
        # See http://www.language-binding.net/pyplusplus/documentation/multi_module_development.html
        # For base classes to be properly referenced, we really need to register all of the dependencies...
        self.mb.register_module_dependency('../osg/generated_code/')
        self.mb.register_module_dependency('../osgText/generated_code/') # vector<Vec4f>
        if False: # Temporarily set to False for faster iterations during initial development
            self.mb.register_module_dependency('../osgUtil/generated_code/')
            self.mb.register_module_dependency('../osgDB/generated_code/')
            self.mb.register_module_dependency('../osgGA/generated_code/') # Included to linearize dependency chain
            self.mb.register_module_dependency('../osgViewer/generated_code/') # Included to linearize dependency chain
            self.mb.register_module_dependency('../osgManipulator/generated_code/') # Included to linearize dependency chain
            self.mb.register_module_dependency('../osgWidget/generated_code/') # Included to linearize dependency chain
            self.mb.register_module_dependency('../osgFX/generated_code/') # Included to linearize dependency chain
            self.mb.register_module_dependency('../osgVolume/generated_code/') # Included to linearize dependency chain

    def wrap(self):
        mb = self.mb

        # Wrap everything in the "osg" namespace
        osgSim = mb.namespace("osgSim")
        osgSim.include()

        # mb.free_functions(lambda f: f.name.startswith("osgSim")).include() # no free functions!

        wrap_call_policies(self.mb)

        self.wrap_all_osg_referenced(osgSim)

        hide_nonpublic(mb)

        # 1>C:\boost\include\boost-1_56\boost/python/detail/destroy.hpp(33) : error C2248: 'osgSim::ShapeAttributeList::~ShapeAttributeList' : cannot access protected member declared in class 'osgSim::ShapeAttributeList'
        cls = osgSim.class_("ShapeAttributeList")
        cls.member_functions("compare").exclude()
        # hack_osg_arg(cls, "compare", "inst")

        # 1>..\..\..\..\src\modules\osgSim\generated_code\ImpostorSpriteManager.pypp.cpp(12) : error C2065: 'ImpostorSpriteManager_wrapper' : undeclared identifier
        for cls_name in ["GeographicLocation", "ImpostorSpriteManager", ]:
            cls = osgSim.class_(cls_name)
            cls.held_type = 'osg::ref_ptr< %s >' % cls.decl_string # no wrapper class...

        # 2>F:\Users\cmbruns\git\osgpyplusplus\src\modules\osgSim\generated_code\vector_less__osg_scope_ref_ptr_less_osg_scope_TemplateArray_less_osg_scope_Vec3f_comma__Vec3ArrayType_comma__3_comma__5126_greater___greater___greater_.pypp.cpp(13) : error C2065: 'Vec3ArrayType' : undeclared identifier
        for fn in osgSim.class_("SphereSegment").member_functions("computeIntersection"):
            fn.exclude()

        # 1>..\..\..\..\src\modules\osgSim\generated_code\ScalarBar.pypp.cpp(54) : error C2059: syntax error : '<'
        osgSim.class_("ScalarBar").constructors(arg_types=[None]*7).exclude()

        # 1>C:\boost\include\boost-1_56\boost/python/object/make_instance.hpp(27) : error C2664: 'boost::mpl::assertion_failed' : cannot convert parameter 1 from 'boost::mpl::failed ************boost::mpl::or_<T1,T2>::* ***********' to 'boost::mpl::assert<false>::type'
        # osgSim.class_("GeographicLocation").no_init = True
        # osgSim.class_("GeographicLocation").constructors().exclude()
        osgSim.class_("GeographicLocation").exclude()

        # 1>..\..\..\..\src\modules\osgSim\generated_code\vector_vector_bool.pypp.cpp(7) : fatal error C1083: Cannot open include file: '_vector_bool__value_traits.pypp.hpp': No such file or directory
        for fn_name in ["getSwitchSetList", "getValueList", "setSwitchSetList", "setValueList", ]:
            osgSim.class_("MultiSwitch").member_functions(fn_name).exclude()

        # 1>..\..\..\..\src\modules\osgSim\generated_code\DistanceHeightList.pypp.cpp(7) : fatal error C1083: Cannot open include file: '_pair_double_double__value_traits.pypp.hpp': No such file or directory
        osgSim.class_("ElevationSlice").member_function("getDistanceHeightIntersections").exclude()

        self.generate_module_code('_osgSim')

if __name__ == "__main__":
    wrapper = OsgSimWrapper()
    wrapper.wrap()