text:
package org.neo4j.kernel.impl.nioneo.xa;

import javax.transaction.xa.XAResource;

import org.neo4j.kernel.impl.core.PropertyIndex;
import org.neo4j.kernel.impl.core.ReadOnlyNeoException;
import org.neo4j.kernel.impl.nioneo.store.PropertyData;
import org.neo4j.kernel.impl.nioneo.store.PropertyIndexData;
import org.neo4j.kernel.impl.nioneo.store.PropertyStore;
import org.neo4j.kernel.impl.nioneo.store.RelationshipChainPosition;
import org.neo4j.kernel.impl.nioneo.store.RelationshipData;
import org.neo4j.kernel.impl.nioneo.store.RelationshipTypeData;
import org.neo4j.kernel.impl.nioneo.store.RelationshipTypeStore;
import org.neo4j.kernel.impl.persistence.PersistenceSource;
import org.neo4j.kernel.impl.persistence.ResourceConnection;
import org.neo4j.kernel.impl.transaction.XaDataSourceManager;
import org.neo4j.kernel.impl.transaction.xaframework.XaDataSource;
import org.neo4j.kernel.impl.util.ArrayMap;

/**
 * The NioNeo persistence source implementation. If this class is registered as
 * persistence source for Neo4j kernel operations that are performed on the node space
 * will be forwarded to this class {@link ResourceConnection} implementation.
 */
public class NioNeoDbPersistenceSource implements PersistenceSource
{
    private static final String MODULE_NAME = "NioNeoDbPersistenceSource";

    private NeoStoreXaDataSource xaDs = null;
    private String dataSourceName = null;
    private ResourceConnection readOnlyResourceConnection;

    public synchronized void init()
    {
        // Do nothing
    }

    public synchronized void start( XaDataSourceManager xaDsManager )
    {
        xaDs = (NeoStoreXaDataSource) xaDsManager.getXaDataSource( "nioneodb" );
        if ( xaDs == null )
        {
            throw new IllegalStateException(
                "Unable to get nioneodb datasource" );
        }
        readOnlyResourceConnection = new ReadOnlyResourceConnection( xaDs );
    }

    public synchronized void reload()
    {
        // Do nothing
    }

    public synchronized void stop()
    {
        if ( xaDs != null )
        {
            xaDs.close();
        }
    }

    public synchronized void destroy()
    {
        // Do nothing
    }

    public String getModuleName()
    {
        return MODULE_NAME;
    }

    public ResourceConnection createResourceConnection()
    {
        if ( xaDs.isReadOnly() )
        {
            throw new ReadOnlyNeoException();
        }
        return new NioNeoDbResourceConnection( this.xaDs );
    }

    public ResourceConnection createReadOnlyResourceConnection()
    {
        return readOnlyResourceConnection;
    }

    private static class ReadOnlyResourceConnection implements
        ResourceConnection
    {
        private final NeoReadTransaction neoTransaction;
        private final RelationshipTypeStore relTypeStore;

        ReadOnlyResourceConnection( NeoStoreXaDataSource xaDs )
        {
            this.neoTransaction = xaDs.getReadOnlyTransaction();
            this.relTypeStore = xaDs.getNeoStore().getRelationshipTypeStore();
        }

        public XAResource getXAResource()
        {
            throw new IllegalStateException(
                "This is a read only transaction, " +
                "this method should never be invoked" );
        }

        public void destroy()
        {
            throw new IllegalStateException(
                "This is a read only transaction, " +
                "this method should never be invoked" );
        }

        public void nodeDelete( int nodeId )
        {
            throw new IllegalStateException(
                "This is a read only transaction, " +
                "this method should never be invoked" );
        }

        public int nodeAddProperty( int nodeId, PropertyIndex index,
            Object value )
        {
            throw new IllegalStateException(
                "This is a read only transaction, " +
                "this method should never be invoked" );
        }

        public void nodeChangeProperty( int nodeId, int propertyId, Object value )
        {
            throw new IllegalStateException(
                "This is a read only transaction, " +
                "this method should never be invoked" );
        }

        public void nodeRemoveProperty( int nodeId, int propertyId )
        {
            throw new IllegalStateException(
                "This is a read only transaction, " +
                "this method should never be invoked" );
        }

        public void nodeCreate( int nodeId )
        {
            throw new IllegalStateException(
                "This is a read only transaction, " +
                "this method should never be invoked" );
        }

        public void relationshipCreate( int id, int typeId, int startNodeId,
            int endNodeId )
        {
            throw new IllegalStateException(
                "This is a read only transaction, " +
                "this method should never be invoked" );
        }

        public void relDelete( int relId )
        {
            throw new IllegalStateException(
                "This is a read only transaction, " +
                "this method should never be invoked" );
        }

        public int relAddProperty( int relId, PropertyIndex index, Object value )
        {
            throw new IllegalStateException(
                "This is a read only transaction, " +
                "this method should never be invoked" );
        }

        public void relChangeProperty( int relId, int propertyId, Object value )
        {
            throw new IllegalStateException(
                "This is a read only transaction, " +
                "this method should never be invoked" );
        }

        public void relRemoveProperty( int relId, int propertyId )
        {
            throw new IllegalStateException(
                "This is a read only transaction, " +
                "this method should never be invoked" );
        }

        public String loadIndex( int id )
        {
            return neoTransaction.getPropertyIndex( id );
        }

        public PropertyIndexData[] loadPropertyIndexes( int maxCount )
        {
            return neoTransaction.getPropertyIndexes( maxCount );
        }

        public Object loadPropertyValue( int id )
        {
            return neoTransaction.propertyGetValue( id );
        }

        public RelationshipTypeData[] loadRelationshipTypes()
        {
            RelationshipTypeData relTypeData[] =
                relTypeStore.getRelationshipTypes();
            RelationshipTypeData rawRelTypeData[] =
                new RelationshipTypeData[relTypeData.length];
            for ( int i = 0; i < relTypeData.length; i++ )
            {
                rawRelTypeData[i] = new RelationshipTypeData(
                    relTypeData[i].getId(), relTypeData[i].getName() );
            }
            return rawRelTypeData;
        }

        public boolean nodeLoadLight( int id )
        {
            return neoTransaction.nodeLoadLight( id );
        }

        public ArrayMap<Integer,PropertyData> nodeLoadProperties( int nodeId )
        {
            return neoTransaction.nodeGetProperties( nodeId );
        }

        public RelationshipData relLoadLight( int id )
        {
            return neoTransaction.relationshipLoad( id );
        }

        public ArrayMap<Integer,PropertyData> relLoadProperties( int relId )
        {
            return neoTransaction.relGetProperties( relId );
        }

        public void createPropertyIndex( String key, int id )
        {
            throw new IllegalStateException(
                "This is a read only transaction, " +
                "this method should never be invoked" );
        }

        public void createRelationshipType( int id, String name )
        {
            throw new IllegalStateException(
                "This is a read only transaction, " +
                "this method should never be invoked" );
        }

        public RelationshipChainPosition getRelationshipChainPosition(
            int nodeId )
        {
            return neoTransaction.getRelationshipChainPosition( nodeId );
        }

        public Iterable<RelationshipData> getMoreRelationships( int nodeId,
            RelationshipChainPosition position )
        {
            return neoTransaction.getMoreRelationships( nodeId, position );
        }
    }

    private static class NioNeoDbResourceConnection implements
        ResourceConnection
    {
        private NeoStoreXaConnection xaCon;
        private NodeEventConsumer nodeConsumer;
        private RelationshipEventConsumer relConsumer;
        private RelationshipTypeEventConsumer relTypeConsumer;
        private PropertyIndexEventConsumer propIndexConsumer;
        private PropertyStore propStore;

        NioNeoDbResourceConnection( NeoStoreXaDataSource xaDs )
        {
            this.xaCon = (NeoStoreXaConnection) xaDs.getXaConnection();
            nodeConsumer = xaCon.getNodeConsumer();
            relConsumer = xaCon.getRelationshipConsumer();
            relTypeConsumer = xaCon.getRelationshipTypeConsumer();
            propIndexConsumer = xaCon.getPropertyIndexConsumer();
            propStore = xaCon.getPropertyStore();
        }

        public XAResource getXAResource()
        {
            return this.xaCon.getXaResource();
        }

        public void destroy()
        {
            xaCon.destroy();
            xaCon = null;
            nodeConsumer = null;
            relConsumer = null;
            relTypeConsumer = null;
            propIndexConsumer = null;
        }

        public void nodeDelete( int nodeId )
        {
            nodeConsumer.deleteNode( nodeId );
        }

        public int nodeAddProperty( int nodeId, PropertyIndex index,
            Object value )
        {
            int propertyId = propStore.nextId();
            nodeConsumer.addProperty( nodeId, propertyId, index, value );
            return propertyId;
        }

        public void nodeChangeProperty( int nodeId, int propertyId, Object value )
        {
            nodeConsumer.changeProperty( nodeId, propertyId, value );
        }

        public void nodeRemoveProperty( int nodeId, int propertyId )
        {
            nodeConsumer.removeProperty( nodeId, propertyId );
        }

        public void nodeCreate( int nodeId )
        {
            nodeConsumer.createNode( nodeId );
        }

        public void relationshipCreate( int id, int typeId, int startNodeId,
            int endNodeId )
        {
            relConsumer.createRelationship( id, startNodeId, endNodeId, typeId );
        }

        public void relDelete( int relId )
        {
            relConsumer.deleteRelationship( relId );
        }

        public int relAddProperty( int relId, PropertyIndex index, Object value )
        {
            int propertyId = propStore.nextId();
            relConsumer.addProperty( relId, propertyId, index, value );
            return propertyId;
        }

        public void relChangeProperty( int relId, int propertyId, Object value )
        {
            relConsumer.changeProperty( relId, propertyId, value );
        }

        public void relRemoveProperty( int relId, int propertyId )
        {
            relConsumer.removeProperty( relId, propertyId );
        }

        public String loadIndex( int id )
        {
            return propIndexConsumer.getKeyFor( id );
        }

        public PropertyIndexData[] loadPropertyIndexes( int maxCount )
        {
            return propIndexConsumer.getPropertyIndexes( maxCount );
        }

        public Object loadPropertyValue( int id )
        {
            return xaCon.getNeoTransaction().propertyGetValue( id );
        }

        public RelationshipTypeData[] loadRelationshipTypes()
        {
            RelationshipTypeData relTypeData[] =
                relTypeConsumer.getRelationshipTypes();
            RelationshipTypeData rawRelTypeData[] =
                new RelationshipTypeData[relTypeData.length];
            for ( int i = 0; i < relTypeData.length; i++ )
            {
                rawRelTypeData[i] = new RelationshipTypeData(
                    relTypeData[i].getId(), relTypeData[i].getName() );
            }
            return rawRelTypeData;
        }

        public boolean nodeLoadLight( int id )
        {
            return nodeConsumer.loadLightNode( id );
        }

        public ArrayMap<Integer,PropertyData> nodeLoadProperties( int nodeId )
        {
            return nodeConsumer.getProperties( nodeId );
        }

        public RelationshipData relLoadLight( int id )
        {
            return relConsumer.getRelationship( id );
        }

        public ArrayMap<Integer,PropertyData> relLoadProperties( int relId )
        {
            return relConsumer.getProperties( relId );
        }

        public void createPropertyIndex( String key, int id )
        {
            propIndexConsumer.createPropertyIndex( id, key );
        }

        public void createRelationshipType( int id, String name )
        {
            relTypeConsumer.addRelationshipType( id, name );
        }

        public RelationshipChainPosition getRelationshipChainPosition(
            int nodeId )
        {
            return relConsumer.getRelationshipChainPosition( nodeId );
        }

        public Iterable<RelationshipData> getMoreRelationships( int nodeId,
            RelationshipChainPosition position )
        {
            return relConsumer.getMoreRelationships( nodeId, position );
        }
    }

    public String toString()
    {
        return "A persistence source to [" + dataSourceName + "]";
    }

    public int nextId( Class<?> clazz )
    {
        return xaDs.nextId( clazz );
    }

    // for recovery, returns a xa
    public XAResource getXaResource()
    {
        return this.xaDs.getXaConnection().getXaResource();
    }

    public void setDataSourceName( String dataSourceName )
    {
        this.dataSourceName = dataSourceName;
    }

    public String getDataSourceName()
    {
        return this.dataSourceName;
    }

    public long getHighestPossibleIdInUse( Class<?> clazz )
    {
        return xaDs.getHighestPossibleIdInUse( clazz );
    }

    public long getNumberOfIdsInUse( Class<?> clazz )
    {
        return xaDs.getNumberOfIdsInUse( clazz );
    }

    public XaDataSource getXaDataSource()
    {
        return xaDs;
    }
}


text:
#region Copyright
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Math\MathHelper.cs" company="Xemio Network">
//      Copyright (c) 2013 Xemio Network (xemio.net)
//
//      Permission is hereby granted, free of charge, to any person obtaining a copy of
//      this software and associated documentation files (the "Software"), to deal in
//      the Software without restriction, including without limitation the rights to
//      use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
//      the Software, and to permit persons to whom the Software is furnished to do so,
//      subject to the following conditions:
//
//      The above copyright notice and this permission notice shall be included in all
//      copies or substantial portions of the Software.
//
//      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//      IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
//      FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
//      COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
//      IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
//      CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// </copyright>
// <summary>
//   Empty
// </summary>
// --------------------------------------------------------------------------------------------------------------------
#endregion

namespace Rewtek.GameLibrary.Math
{
    using System;
    using Math = System.Math;

    public static class MathHelper
    {
        #region Constants
        /// <summary>
        /// Natural base for logarithms.
        /// </summary>
        public const float E = (float)Math.E;
        /// <summary>
        /// Natural base for logarithms.
        /// </summary>
        public const float Log10E = 0.4342945f;
        /// <summary>
        /// Natural base for logarithms.
        /// </summary>
        public const float Log2E = 1.442695f;
        /// <summary>
        /// π
        /// </summary>
        public const float Pi = (float)Math.PI;
        /// <summary>
        /// π divided by 2.
        /// </summary>
        public const float PiOver2 = (float)(Math.PI * 0.5);
        /// <summary>
        /// π divided by 4.
        /// </summary>
        public const float PiOver4 = (float)(Math.PI * 0.25);
        /// <summary>
        /// Two times π.
        /// </summary>
        public const float TwoPi = 2 * (float)Math.PI;
        /// <summary>
        /// 180 divided by π.
        /// </summary>
        private const double OneEightyOverPi = 180.0 / Math.PI;
        /// <summary>
        /// π divided by 180.
        /// </summary>
        private const double PiOverOneEighty = Math.PI / 180.0;
        #endregion

        #region Methods
        /// <summary>
        /// Returns the sinus for the specified value.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public static float Sin(float value)
        {
            return (float)Math.Sin(value);
        }
        /// <summary>
        /// Returns the cosinus for the specified value.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public static float Cos(float value)
        {
            return (float)Math.Cos(value);
        }
        /// <summary>
        /// Returns the square root for the specified value.
        /// </summary>
        /// <param name="value">The value.</param>
        public static float Sqrt(float value)
        {
            return (float)Math.Sqrt(value);
        }
        /// <summary>
        /// Rounds the specified value.
        /// </summary>
        /// <param name="value">The value.</param>
        public static float Round(float value)
        {
            return (float)Math.Round(value);
        }
        /// <summary>
        /// Calculates an angle out of given coordinates.
        /// </summary>
        /// <param name="x">The x.</param>
        /// <param name="y">The y.</param>
        public static float ToAngle(float x, float y)
        {
            return (float)Math.Atan2(y, x) + MathHelper.Pi;
        }
        /// <summary>
        /// Calculates an angle out of given coordinates.
        /// </summary>
        /// <param name="vector">The vector.</param>
        public static float ToAngle(Vector2 vector)
        {
            return MathHelper.ToAngle(vector.X, vector.Y);
        }
        /// <summary>
        /// Converts an angle to a direction vector.
        /// </summary>
        /// <param name="angle">The angle.</param>
        public static Vector2 ToVector(float angle)
        {
            return new Vector2(MathHelper.Cos(angle), MathHelper.Sin(angle));
        }
        /// <summary>
        /// Returns the Cartesian coordinate for one axis of a point that is defined by a given triangle and two normalized barycentric (areal) coordinates.
        /// </summary>
        /// <param name="value1">The value1.</param>
        /// <param name="value2">The value2.</param>
        /// <param name="value3">The value3.</param>
        /// <param name="amount1">The amount1.</param>
        /// <param name="amount2">The amount2.</param>
        public static float Barycentric(float value1, float value2, float value3, float amount1, float amount2)
        {
            return value1 + (value2 - value1) * amount1 + (value3 - value1) * amount2;
        }
        /// <summary>
        /// Performs a Catmull-Rom interpolation using the specified positions.
        /// </summary>
        /// <param name="value1">The value1.</param>
        /// <param name="value2">The value2.</param>
        /// <param name="value3">The value3.</param>
        /// <param name="value4">The value4.</param>
        /// <param name="amount">The amount.</param>
        public static float CatmullRom(float value1, float value2, float value3, float value4, float amount)
        {
            // Using formula from http://www.mvps.org/directx/articles/catmull/

            double amountSquared = amount * amount;
            double amountCubed = amountSquared * amount;

            return (float)(0.5 * (2.0 * value2 + (value3 - value1) * amount +
                (2.0 * value1 - 5.0 * value2 + 4.0 * value3 - value4) * amountSquared +
                (3.0 * value2 - value1 - 3.0 * value3 + value4) * amountCubed));
        }
        /// <summary>
        /// Restricts a value to be within a specified range.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <param name="min">The minimum.</param>
        /// <param name="max">The maximum.</param>
        public static float Clamp(float value, float min, float max)
        {
            value = (value > max) ? max : value;
            value = (value < min) ? min : value;

            return value;
        }
        /// <summary>
        /// Calculates the absolute value of the difference of two values.
        /// </summary>
        /// <param name="value1">The value1.</param>
        /// <param name="value2">The value2.</param>
        public static float Distance(float value1, float value2)
        {
            return Math.Abs(value1 - value2);
        }
        /// <summary>
        /// Performs a Hermite spline interpolation.
        /// </summary>
        /// <param name="value1">The value1.</param>
        /// <param name="tangent1">The tangent1.</param>
        /// <param name="value2">The value2.</param>
        /// <param name="tangent2">The tangent2.</param>
        /// <param name="amount">The amount.</param>
        public static float Hermite(float value1, float tangent1, float value2, float tangent2, float amount)
        {
            float a2 = amount * amount;
            float asqr3 = amount * a2;
            float a3 = a2 + a2 + a2;

            return (value1 * (((asqr3 + asqr3) - a3) + 1f)) +
                   (value2 * ((-2f * asqr3) + a3)) +
                   (tangent1 * ((asqr3 - (a2 + a2)) + amount)) +
                   (tangent2 * (asqr3 - a2));
        }
        /// <summary>
        /// Linearly interpolates between two values.
        /// </summary>
        /// <param name="value1">The value1.</param>
        /// <param name="value2">The value2.</param>
        /// <param name="amount">The amount.</param>
        public static float Lerp(float value1, float value2, float amount)
        {
            return value1 + (value2 - value1) * amount;
        }
        /// <summary>
        /// Returns the absolute value.
        /// </summary>
        /// <param name="value">The value.</param>
        public static float Abs(float value)
        {
            return Math.Abs(value);
        }
        /// <summary>
        /// Returns the greater of two values.
        /// </summary>
        /// <param name="value1">The value1.</param>
        /// <param name="value2">The value2.</param>
        public static float Max(float value1, float value2)
        {
            return Math.Max(value1, value2);
        }
        /// <summary>
        /// Returns the lesser of two values.
        /// </summary>
        /// <param name="value1">The value1.</param>
        /// <param name="value2">The value2.</param>
        public static float Min(float value1, float value2)
        {
            return Math.Min(value1, value2);
        }
        /// <summary>
        /// Interpolates between two values using a cubic equation.
        /// </summary>
        /// <param name="value1">The value1.</param>
        /// <param name="value2">The value2.</param>
        /// <param name="amount">The amount.</param>
        public static float SmoothStep(float value1, float value2, float amount)
        {
            float result = MathHelper.Clamp(amount, 0.0f, 1.0f);
            result = MathHelper.Hermite(value1, 0.0f, value2, 0.0f, result);

            return result;
        }
        /// <summary>
        /// Converts radians to degrees.
        /// </summary>
        /// <param name="radians">The radians.</param>
        public static float ToDegrees(float radians)
        {
            return (float)(radians * OneEightyOverPi);
        }
        /// <summary>
        /// Converts degrees to radians.
        /// </summary>
        /// <param name="degrees">The degrees.</param>
        public static float ToRadians(float degrees)
        {
            return (float)(degrees * PiOverOneEighty);
        }
        /// <summary>
        /// Reduces a given angle to a value between π and -π.
        /// </summary>
        /// <param name="angle">The angle.</param>
        public static float WrapAngle(float angle)
        {
            return (float)Math.IEEERemainder((double)angle, 6.2831854820251465);
        }
        #endregion
    }
}

redpajama_set_name: RedPajamaGithub


text:
#ifndef itkLevelSetEvolutionNumberOfIterationsStoppingCriterion_h
#define itkLevelSetEvolutionNumberOfIterationsStoppingCriterion_h

#include "itkObjectFactory.h"
#include "itkLevelSetEvolutionStoppingCriterion.h"

namespace itk
{
/**
 * \class LevelSetEvolutionStoppingCriterion
\ingroup ITKLevelSetsv4
*/
template <typename TLevelSetContainer>
class ITK_TEMPLATE_EXPORT LevelSetEvolutionNumberOfIterationsStoppingCriterion
  : public LevelSetEvolutionStoppingCriterion<TLevelSetContainer>
{
public:
  ITK_DISALLOW_COPY_AND_MOVE(LevelSetEvolutionNumberOfIterationsStoppingCriterion);

  using Self = LevelSetEvolutionNumberOfIterationsStoppingCriterion;
  using Superclass = LevelSetEvolutionStoppingCriterion<TLevelSetContainer>;
  using Pointer = SmartPointer<Self>;
  using ConstPointer = SmartPointer<const Self>;

  /** Method for creation through object factory */
  itkNewMacro(Self);

  /** Run-time type information (and related methods). */
  itkTypeMacro(LevelSetEvolutionNumberOfIterationsStoppingCriterion, LevelSetEvolutionStoppingCriterion);

  using LevelSetContainerType = TLevelSetContainer;
  using LevelSetContainerPointer = typename LevelSetContainerType::Pointer;

  using LevelSetIdentifierType = typename LevelSetContainerType::LevelSetIdentifierType;
  using LevelSetType = typename LevelSetContainerType::LevelSetType;
  using LevelSetPointer = typename LevelSetContainerType::LevelSetPointer;

  using InputIndexType = typename LevelSetContainerType::InputIndexType;
  using OutputType = typename LevelSetContainerType::OutputType;
  using OutputRealType = typename LevelSetContainerType::OutputRealType;
  using GradientType = typename LevelSetContainerType::GradientType;
  using HessianType = typename LevelSetContainerType::HessianType;

  using HeavisideType = typename LevelSetContainerType::HeavisideType;
  using HeavisidePointer = typename LevelSetContainerType::HeavisideType;

  bool
  IsSatisfied() const override;

  std::string
  GetDescription() const override;

protected:
  /** Constructor */
  LevelSetEvolutionNumberOfIterationsStoppingCriterion() = default;

  /** Destructor */
  ~LevelSetEvolutionNumberOfIterationsStoppingCriterion() override = default;
};
} // namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#  include "itkLevelSetEvolutionNumberOfIterationsStoppingCriterion.hxx"
#endif
#endif


text:
package com.google.devtools.moe.client.database;

import static com.google.common.truth.Truth.assertThat;
import static org.easymock.EasyMock.expect;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;

import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.devtools.moe.client.FileSystem;
import com.google.devtools.moe.client.SystemFileSystem;
import com.google.devtools.moe.client.gson.GsonModule;
import com.google.devtools.moe.client.project.InvalidProject;
import com.google.devtools.moe.client.repositories.Revision;
import com.google.devtools.moe.client.testing.DummyDb;
import com.google.gson.Gson;
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import junit.framework.TestCase;
import org.easymock.EasyMock;
import org.easymock.IMocksControl;
import org.mockito.Mockito;

/**
 * Tests for the FileDb
 */
public class FileDbTest extends TestCase {
  private static final Gson GSON = GsonModule.provideGson();
  private final FileSystem filesystem = new SystemFileSystem();

  @Override
  public void setUp() throws Exception {
    super.setUp();
  }

  public void testValidDb() throws Exception {
    String dbText =
        Joiner.on("\n")
            .join(
                "{",
                "  'equivalences': [",
                "    {",
                "      'rev1': {",
                "        'revId': 'r1',",
                "        'repositoryName': 'name1'",
                "      },",
                "      'rev2': {",
                "        'revId': 'r2',",
                "        'repositoryName': 'name2'",
                "      }",
                "    }",
                "  ]",
                "}",
                "");
    FileDb db = parseJson(dbText);
    assertEquals(
        db.getEquivalences(),
        ImmutableSet.of(
            RepositoryEquivalence.create(
                Revision.create("r1", "name1"), Revision.create("r2", "name2"))));
  }

  public void testEmptyDb() throws Exception {
    FileDb db = parseJson("{}");
    assertThat(db.getEquivalences()).isEmpty();
  }

  public void testNoteEquivalence() throws Exception {
    FileDb db = parseJson("{\"equivalences\":[]}");
    RepositoryEquivalence e =
        RepositoryEquivalence.create(
            Revision.create("r1", "name1"), Revision.create("r2", "name2"));
    db.noteEquivalence(e);
    assertEquals(db.getEquivalences(), ImmutableSet.of(e));
  }

  public void testNoteMigration() throws Exception {
    FileDb db = parseJson("{}");
    SubmittedMigration migration =
        SubmittedMigration.create(Revision.create("r1", "name1"), Revision.create("r2", "name2"));
    assertTrue(db.noteMigration(migration));
    // The migration has already been added, so noting it again should return false.
    assertFalse(db.noteMigration(migration));
  }

  public void testFindEquivalences() throws Exception {
    String dbText =
        Joiner.on("\n")
            .join(
                "{",
                "  'equivalences': [",
                "    {",
                "      'rev1': {",
                "        'revId': 'r1',",
                "        'repositoryName': 'name1'",
                "      },",
                "      'rev2': {",
                "        'revId': 'r2',",
                "        'repositoryName': 'name2'",
                "      }",
                "    },",
                "    {",
                "      'rev1': {",
                "        'revId': 'r3',",
                "        'repositoryName': 'name2'",
                "      },",
                "      'rev2': {",
                "        'revId': 'r1',",
                "        'repositoryName': 'name1'",
                "      }",
                "    }",
                "  ]",
                "}",
                "");

    FileDb db = parseJson(null, dbText);
    assertEquals(
        db.findEquivalences(Revision.create("r1", "name1"), "name2"),
        ImmutableSet.of(Revision.create("r2", "name2"), Revision.create("r3", "name2")));
  }

  public void testMakeDbFromFile() throws Exception {
    IMocksControl control = EasyMock.createControl();
    FileSystem filesystem = control.createMock(FileSystem.class);
    File dbFile = new File("/path/to/db");
    FileDb.Factory factory = new FileDb.Factory(filesystem, GsonModule.provideGson());
    String dbText =
        Joiner.on("\n")
            .join(
                "{",
                "  'equivalences': [",
                "    {",
                "      'rev1': {",
                "        'revId': 'r1',",
                "        'repositoryName': 'name1'",
                "      },",
                "      'rev2': {",
                "        'revId': 'r2',",
                "        'repositoryName': 'name2'",
                "      }",
                "    }",
                "  ]",
                "}",
                "");

    expect(filesystem.fileToString(dbFile)).andReturn(dbText);
    expect(filesystem.exists(dbFile)).andReturn(true);

    control.replay();
    assertThat(factory.load(dbFile.toPath()).getEquivalences())
        .isEqualTo(parseJson(dbFile.getPath(), dbText).getEquivalences());
    control.verify();
  }

  public void testWriteDbToFile() throws Exception {
    IMocksControl control = EasyMock.createControl();
    FileSystem filesystem = control.createMock(FileSystem.class);
    File dbFile = new File("/path/to/db");
    String dbText = "{\n  \"equivalences\": [],\n  \"migrations\": []\n}\n";
    DbStorage dbStorage = GSON.fromJson(dbText, DbStorage.class);
    Db db = new FileDb(dbFile.getPath(), dbStorage, new FileDb.Writer(GSON, filesystem));
    filesystem.write(dbText, dbFile);
    EasyMock.expectLastCall();
    control.replay();
    db.write();
    control.verify();
  }

  public void testSerialization() throws InvalidProject {
    String dbText =
        Joiner.on("\n")
            .join(
                "{",
                "  'equivalences': [",
                "    {",
                "      'rev1': {",
                "        'revId': 'r1',",
                "        'repositoryName': 'name1'",
                "      },",
                "      'rev2': {",
                "        'revId': 'r2',",
                "        'repositoryName': 'name2'",
                "      }",
                "    }",
                "  ],",
                "  'migrations': [",
                "    {",
                "      'fromRevision': {",
                "        'revId': 'r1',",
                "        'repositoryName': 'name1'",
                "      },",
                "      'toRevision': {",
                "        'revId': 'r2',",
                "        'repositoryName': 'name2'",
                "      }",
                "    }",
                "  ]",
                "}",
                "");
    FileDb db = parseJson(dbText.replace('\'', '"'));
    RepositoryEquivalence equivalence = Iterables.getOnlyElement(db.getEquivalences());
    assertEquals("r1", equivalence.getRevisionForRepository("name1").revId());
    assertEquals("r2", equivalence.getRevisionForRepository("name2").revId());
    SubmittedMigration migration = Iterables.getOnlyElement(db.getMigrations());
    assertEquals("name1", migration.fromRevision().repositoryName());
    assertEquals("r1", migration.fromRevision().revId());
    assertEquals("name2", migration.toRevision().repositoryName());
    assertEquals("r2", migration.toRevision().revId());
  }

  private FileDb parseJson(String dbText) throws InvalidProject {
    return parseJson(null, dbText);
  }

  private FileDb parseJson(String location, String dbText) throws InvalidProject {
    DbStorage dbStorage = GSON.fromJson(dbText, DbStorage.class);
    return new FileDb(location, dbStorage, new FileDb.Writer(GSON, filesystem));
  }

  public void testDatabaseUriSwitching_dummy() {
    FileDb.Factory factory = new FileDb.Factory(null, null);
    assertThat(FileDb.Module.db(null, "dummy", false, factory, null)).isInstanceOf(DummyDb.class);
    assertThat(FileDb.Module.db(null, "dummy:blah", false, factory, null))
        .isInstanceOf(DummyDb.class);
  }

  public void testDatabaseUriSwitching_legacyFilePath() {
    FileDb.Factory factory = spy(new FileDb.Factory(null, null));
    Mockito.doReturn(null).when(factory).load(Mockito.<Path>any());
    FileDb.Module.db(null, "/blah", false, factory, null);
    verify(factory).load(Paths.get("/blah"));
  }

  public void testDatabaseUriSwitching_fileUrl() {
    FileDb.Factory factory = spy(new FileDb.Factory(null, null));
    Mockito.doReturn(null).when(factory).load(Mockito.<Path>any());
    FileDb.Module.db(null, "file:///blah", false, factory, null);
    verify(factory).load(Paths.get("/blah")); // URI compresses this.
  }

  public void testDatabaseUriSwitching_badUrl() {
    try {
      FileDb.Module.db(null, "file://blah", false, null, null);
      fail("Should have thrown");
    } catch (InvalidProject expected) {
    }
  }
}


text:
require 'pact_broker/api/resources/base_resource'

module Webmachine
  class Request
    def put?
      method == "PUT" || method == "PATCH"
    end
  end
end

module PactBroker
  module Api
    module Resources

      class Pacticipant < BaseResource

        def content_types_provided
          [["application/hal+json", :to_json]]
        end

        def content_types_accepted
          [["application/json", :from_json]]
        end

        def allowed_methods
          ["GET", "PATCH", "DELETE"]
        end

        def known_methods
          super + ['PATCH']
        end

        def from_json
          if pacticipant
            @pacticipant = pacticipant_service.update params.merge(name: pacticipant_name)
          else
            @pacticipant = pacticipant_service.create params.merge(name: pacticipant_name)
            response.headers["Location"] = pacticipant_url(base_url, pacticipant)
          end
          response.body = to_json
        end

        def resource_exists?
          pacticipant
        end

        def delete_resource
          pacticipant_service.delete pacticipant_name
          true
        end

        def to_json
          PactBroker::Api::Decorators::PacticipantDecorator.new(pacticipant).to_json(base_url: base_url)
        end

        private

        def pacticipant
          @pacticipant ||= pacticipant_service.find_pacticipant_by_name(pacticipant_name)
        end

        def pacticipant_name
          identifier_from_path[:name]
        end

      end
    end

  end
end


text:
"""
.. _example-sLORETA:

=============================================
Compute sLORETA inverse solution on raw data
=============================================

Compute sLORETA inverse solution on raw dataset restricted
to a brain label and stores the solution in stc files for
visualisation.

"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD (3-clause)

import matplotlib.pyplot as plt

import mne
from mne.datasets import sample
from mne.minimum_norm import apply_inverse_raw, read_inverse_operator

print(__doc__)

data_path = sample.data_path()
fname_inv = data_path + '/MEG/sample/sample_audvis-meg-oct-6-meg-inv.fif'
fname_raw = data_path + '/MEG/sample/sample_audvis_raw.fif'
label_name = 'Aud-lh'
fname_label = data_path + '/MEG/sample/labels/%s.label' % label_name

snr = 1.0  # use smaller SNR for raw data
lambda2 = 1.0 / snr ** 2
method = "sLORETA"  # use sLORETA method (could also be MNE or dSPM)

# Load data
raw = mne.io.read_raw_fif(fname_raw)
inverse_operator = read_inverse_operator(fname_inv)
label = mne.read_label(fname_label)

raw.set_eeg_reference('average', projection=True)  # set average reference.
start, stop = raw.time_as_index([0, 15])  # read the first 15s of data

# Compute inverse solution
stc = apply_inverse_raw(raw, inverse_operator, lambda2, method, label,
                        start, stop, pick_ori=None)

# Save result in stc files
stc.save('mne_%s_raw_inverse_%s' % (method, label_name))

###############################################################################
# View activation time-series
plt.plot(1e3 * stc.times, stc.data[::100, :].T)
plt.xlabel('time (ms)')
plt.ylabel('%s value' % method)
plt.show()


text:
gemoji
======

Emoji images and names. See the LICENSE for copyright information.

Installation
------------

Add `gemoji` to your Gemfile.

``` ruby
gem 'gemoji'
```

**Sync images**

Images can be copied to your public directory with `rake emoji` in your app. This is the recommended approach since the images will be available at a consistent location. This works best with cached formatted user content generated by tools like [html-pipeline](https://github.com/jch/html-pipeline).

``` ruby
# Rakefile
load 'tasks/emoji.rake'
```

```
$ rake emoji
```

**Assets Precompiling**

If you must, you can manually add all the images to your asset load path.

``` ruby
# config/application.rb
config.assets.paths << Emoji.images_path
```

Then have them compiled to public on deploy.

``` ruby
# config/application.rb
config.assets.precompile << "emoji/**/*.png"
```

**WARNING** Since there are a ton of images, just adding the path may slow down other lookups if you aren't using it. Compiling all the emojis on deploy will add overhead to your deploy if even the images haven't changed. Theres just so many more superfluous files to iterate over. Also, the urls will be fingerprinted which may not be ideal for referencing from cached content.

Example Rails Helper
--------------------

This would allow emojifying content such as: `it's raining :cat:s and :dog:s!`

See the [Emoji cheat sheet](http://www.emoji-cheat-sheet.com) for more examples.

```ruby
module EmojiHelper
  def emojify(content)
    h(content).to_str.gsub(/:([\w+-]+):/) do |match|
      if emoji = Emoji.find_by_alias($1)
        %(<img alt="#$1" src="#{asset_path("emoji/#{emoji.image_filename}")}" style="vertical-align:middle" width="20" height="20" />)
      else
        match
      end
    end.html_safe if content.present?
  end
end
```

Unicode mapping
---------------

Translate emoji names to unicode and vice versa.

```ruby
>> Emoji.find_by_alias("cat").raw
=> "🐱"  # Don't see a cat? That's U+1F431.

>> Emoji.find_by_unicode("\u{1f431}").name
=> "cat"
```

Adding new emoji
----------------

You can add new emoji characters to the `Emoji.all` list:

```ruby
emoji = Emoji.create("music") do |char|
  char.add_alias "song"
  char.add_unicode_alias "\u{266b}"
  char.add_tag "notes"
end

emoji.name #=> "music"
emoji.raw  #=> "♫"
emoji.image_filename #=> "unicode/266b.png"

# Creating custom emoji (no Unicode aliases):
emoji = Emoji.create("music") do |char|
  char.add_tag "notes"
end

emoji.custom? #=> true
emoji.image_filename #=> "music.png"
```

As you create new emoji, you must ensure that you also create and put the images
they reference by their `image_filename` to your assets directory.

For existing emojis, you can edit the list of aliases or add new tags in an edit block:

```ruby
emoji = Emoji.find_by_alias "musical_note"

Emoji.edit_emoji(emoji) do |char|
  char.add_alias "music"
  char.add_unicode_alias "\u{266b}"
  char.add_tag "notes"
end

Emoji.find_by_alias "music"       #=> emoji
Emoji.find_by_unicode "\u{266b}"  #=> emoji
```


text:
require 'test_helper'

class UnlockTest < ActiveSupport::TestCase
  should "unlock the Curve brick" do
    Unlock.create!(:brick_type => "Kicker", :is_unlocked => true, :minimum_length => 0)
    Unlock.create!(:brick_type => "Curve", :is_unlocked => false, :minimum_length => 10)

    MarbleRun.create!(:total_length => 11)

    Unlock.unlock_bricks

    assert_equal 2, Unlock.where(:is_unlocked => true).count
  end
end


text:
package org.semanticweb.elk.owl.visitors;

import org.semanticweb.elk.owl.interfaces.ElkDeclarationAxiom;

/**
 * Visitor pattern interface for instances of {@link ElkDeclarationAxiom}.
 *
 * @author Frantisek Simancik
 *
 * @author "Yevgeny Kazakov"
 *
 * @param <O>
 *            the type of the output of this visitor
 */
public interface ElkDeclarationAxiomVisitor<O> {

	O visit(ElkDeclarationAxiom axiom);
}


text:
<?xml version="1.0" ?><!DOCTYPE section [
<!ENTITY % openstack SYSTEM "entities/openstack.ent">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY nbsp " ">
<!ENTITY times "×">
<!ENTITY hellip "…">
<!ENTITY COPY '<command xmlns="http://docbook.org/ns/docbook">COPY</command>'>
<!ENTITY GET '<command xmlns="http://docbook.org/ns/docbook">GET</command>'>
<!ENTITY HEAD '<command xmlns="http://docbook.org/ns/docbook">HEAD</command>'>
<!ENTITY PUT '<command xmlns="http://docbook.org/ns/docbook">PUT</command>'>
<!ENTITY POST '<command xmlns="http://docbook.org/ns/docbook">POST</command>'>
<!ENTITY DELETE '<command xmlns="http://docbook.org/ns/docbook">DELETE</command>'>
<!ENTITY CHECK '<inlinemediaobject xmlns="http://docbook.org/ns/docbook">
<imageobject>
<imagedata fileref="../common/figures/Check_mark_23x20_02.svg"
format="SVG" scale="60"/>
</imageobject>
</inlinemediaobject>'>
]>

    <?dbhtml stop-chunking?>
    <title>Log in to the dashboard</title>
    <para>The dashboard is available on the node with the
            <literal>nova-dashboard</literal> server role.</para>
    <procedure>
        <step>
            <para>Ask the cloud operator for the host name or public
                IP address from which you can access the dashboard,
                and for your user name and password.</para>
        </step>
        <step>
            <para>Open a web browser that has JavaScript and cookies
                enabled.</para>
            <note>
                <para>To use the Virtual Network Computing (VNC)
                    client for the dashboard, your browser must
                    support HTML5 Canvas and HTML5 WebSockets. The VNC
                    client is based on noVNC. For details, see <link xlink:href="https://github.com/kanaka/noVNC/blob/master/README.md">noVNC: HTML5 VNC Client</link>. For a list of
                    supported browsers, see <link xlink:href="https://github.com/kanaka/noVNC/wiki/Browser-support">Browser
                    support</link>.</para>
            </note>
        </step>
        <step>
            <para>In the address bar, enter the host name or IP
                address for the dashboard.</para>
            <screen><userinput>https://<replaceable>ipAddressOrHostName</replaceable>/</userinput></screen>
            <note>
                <para>If a certificate warning appears when you try to
                    access the URL for the first time, a self-signed
                    certificate is in use, which is not considered
                    trustworthy by default. Verify the certificate or
                    add an exception in the browser to bypass the
                    warning.</para>
            </note>
        </step>
        <step>
            <para>On the <guilabel>Log In</guilabel> page, enter your
                user name and password, and click <guibutton>Sign
                    In</guibutton>.</para>
            <para>The top of the window displays your user name. You
                can also access <guilabel>Settings</guilabel> or sign
                out of the dashboard.</para>
            <para>The visible tabs and functions in the dashboard
                depend on the access permissions, or <emphasis role="italic">roles</emphasis>, of the user you
                are logged in as.<itemizedlist>
                    <listitem><para>If you are logged in as an end user, the <link linkend="dashboard_project_tab">Project</link> tab is
                            displayed.</para></listitem>
                    <listitem><para>If you are logged in as an administrator, the <link linkend="dashboard_project_tab">Project</link> tab and <link linkend="dashboard_admin_tab">Admin</link> tab are
                            displayed.</para></listitem>
                </itemizedlist></para>
        </step>
    </procedure>

        <title>OpenStack dashboard—Project tab</title>
        <para>Projects are organizational units in the cloud, and are
            also known as tenants or accounts. Each user is a member
            of one or more projects. Within a project, a user creates
            and manages instances.</para>
        <para>From the <guilabel>Project</guilabel> tab, you can view and manage
            the resources in a selected project, including instances and images.
            You select the project from the <guilabel>CURRENT PROJECT</guilabel>
            list at the top of the tab.</para>

            <title>Project tab</title>
            <mediaobject>
                <imageobject>
                    <imagedata contentwidth="6in" fileref="figures/dashboard-project-tab.png" format="PNG" width="6in"/>
                </imageobject>
            </mediaobject>

        <para>From the <guilabel>Project</guilabel> tab, you can
        access the following tabs:</para>
          <informaltable rules="all" width="75%">
            <col width="30%"/>
            <col width="70%"/>

                <guilabel>Compute</guilabel> tab

                <para><guilabel>概览</guilabel></para>
                <para>View reports for the project.</para>

                <para><guilabel>实例</guilabel></para>
                <para>View, launch, create a snapshot from, stop, pause, or
                  reboot instances, or connect to them through VNC.</para>

                <para><guilabel>云硬盘</guilabel></para>
                <para>Use the following tabs to complete these
                  tasks:</para>
                  <variablelist>
                    <varlistentry>
                    <term><guilabel>云硬盘</guilabel></term>
                    <listitem>
                      <para>View, create, edit, and delete volumes.</para>
                    </listitem>
                    </varlistentry>
                    <varlistentry>
                      <term><guilabel>云硬盘快照</guilabel></term>
                      <listitem>
                        <para>View, create, edit, and delete volume snapshots.</para>
                      </listitem>
                    </varlistentry>
                  </variablelist>

                <para><guilabel>镜像</guilabel></para>
                <para>View images and instance snapshots created by project
                    users, plus any images that are publicly available. Create,
                    edit, and delete images, and launch instances from images
                    and snapshots.</para>

                <para><guilabel>访问 & 安全</guilabel></para>
                <para>Use the following tabs to complete these tasks:</para>
                <variablelist>
                  <varlistentry>
                    <term><guilabel>安全组</guilabel></term>
                    <listitem><para>View, create, edit, and delete security
                      groups and security group rules.</para>
                    </listitem>
                  </varlistentry>
                  <varlistentry>
                    <term><guilabel>密钥对</guilabel></term>
                    <listitem><para>View, create, edit, import, and delete key
                      pairs.</para>
                    </listitem>
                  </varlistentry>
                  <varlistentry>
                    <term><guilabel>浮动IP</guilabel></term>
                    <listitem>
                      <para>Allocate an IP address to or release it
                      from a project.</para>
                    </listitem>
                  </varlistentry>
                  <varlistentry>
                    <term><guilabel>访问API</guilabel></term>
                    <listitem><para>View API endpoints.</para>
                    </listitem>
                  </varlistentry>
                </variablelist>

                <guilabel>网络</guilabel> tab

                <para><guilabel>网络拓扑</guilabel></para>
                <para>View the network topology.</para>

                <para><guilabel>网络</guilabel></para>
                <para>Create and manage public and private networks.</para>

                <para><guilabel>路由</guilabel></para>
                <para>Create and manage subnets.</para>

                <guilabel>对象存储</guilabel> tab

                <para><guilabel>容器</guilabel></para>
                <para>Create and manage containers and objects.</para>

                <guilabel>编配</guilabel> tab

                <para><guilabel>栈</guilabel></para>
                <para>Use the REST API to orchestrate multiple
                        composite cloud applications.</para>

          </informaltable>

        <title>OpenStack dashboard—Admin tab</title>
        <para>Administrative users can use the
                <guilabel>Admin</guilabel> tab to view usage and to
            manage instances, volumes, flavors, images, projects,
            users, services, and quotas.</para>

            <title>Admin tab</title>
            <mediaobject>
                <imageobject>
                    <imagedata contentwidth="6in" fileref="figures/dashboard-admin-tab.png" format="PNG" width="6in"/>
                </imageobject>
            </mediaobject>

        <para>Access the following categories to complete these tasks:</para>
        <informaltable rules="all" width="75%">
            <col width="30%"/>
            <col width="70%"/>

                <guilabel>系统面板</guilabel> tab

                <para><guilabel>概览</guilabel></para>
                <para>View basic reports.</para>

                <para><guilabel>资源使用情况</guilabel></para>
                <para>Use the following tabs to view the following usages:</para>

                <variablelist>

                  <varlistentry>
                    <term><guilabel>日报</guilabel></term>
                    <listitem>
                      <para>View the daily report.</para>
                    </listitem>
                  </varlistentry>
                  <varlistentry>
                    <term><guilabel>统计数据</guilabel></term>
                    <listitem>
                      <para>View the statistics of all resources.</para>
                    </listitem>
                  </varlistentry>
                </variablelist>

                <para><guilabel>虚拟机管理器</guilabel></para>
                <para>View the hypervisor summary.</para>

                <para><guilabel>主机集合</guilabel></para>
                <para>View, create, and edit host aggregates. View the list of
              availability zones.</para>

                <para><guilabel>实例</guilabel></para>
                <para>View, pause, resume, suspend, migrate, soft or hard
                  reboot, and delete running instances that belong to users of
                  some, but not all, projects. Also, view the log for an instance
                  or access an instance through VNC.</para>

                <para><guilabel>云硬盘</guilabel></para>
                <para>View, create, edit, and delete volumes and
                        volume types.</para>

                <para><guilabel>云主机类型</guilabel></para>
                <para>View, create, edit, view extra specifications for, and
                  delete flavors. A flavor is size of an instance.</para>

                <para><guilabel>镜像</guilabel></para>
                <para>View, create, edit properties for, and delete custom
                  images.</para>

                <para><guilabel>网络</guilabel></para>
                <para>View, create, edit properties for, and delete networks.</para>

                <para><guilabel>路由</guilabel></para>
                <para>View, create, edit properties for, and delete routers.</para>

                <para><guilabel>系统信息</guilabel></para>
                <para>Use the following tabs to view the service information:</para>
                <variablelist>
                  <varlistentry>
                    <term><guilabel>服务</guilabel></term>
                    <listitem><para>View a list of the services.</para>
                    </listitem>
                  </varlistentry>
                  <varlistentry>
                    <term><guilabel>计算服务</guilabel></term>
                    <listitem><para>View a list of all Compute services.</para>
                    </listitem>
                  </varlistentry>
                  <varlistentry>
                    <term><guilabel>网络代理</guilabel></term>
                    <listitem><para>View the network agents.</para>
                    </listitem>
                  </varlistentry>
                  <varlistentry>
                    <term><guilabel>默认配额</guilabel></term>
                    <listitem><para>View default quota values. Quotas are hard-coded
                      in OpenStack Compute and define the maximum allowable size
                      and number of resources.</para>
                    </listitem>
                  </varlistentry>
                </variablelist>

                <guilabel>认证面板</guilabel> tab

                <para><guilabel>项目</guilabel></para>
                <para>View, create, assign users to, remove users from, and
                  delete projects.</para>

                <para><guilabel>用户</guilabel></para>
                <para>View, create, enable, disable, and delete users.</para>

          </informaltable>


text:
.class Lcom/htc/weather/animations/Anim52$6;
.super Lcom/htc/weather/animations/ImageViewAndAnimationSets;
.source "Anim52.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/htc/weather/animations/Anim52;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/htc/weather/animations/Anim52;

# direct methods
.method constructor <init>(Lcom/htc/weather/animations/Anim52;)V
    .locals 0
    .parameter

    .prologue
    .line 463
    iput-object p1, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    invoke-direct {p0}, Lcom/htc/weather/animations/ImageViewAndAnimationSets;-><init>()V

    return-void
.end method

# virtual methods
.method protected initialImageView()Landroid/widget/ImageView;
    .locals 6

    .prologue
    const/high16 v3, 0x3f80

    const/4 v5, -0x2

    .line 467
    new-instance v0, Landroid/widget/ImageView;

    iget-object v1, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v1, v1, Lcom/htc/weather/animations/WeatherAnimationData;->mContext:Landroid/content/Context;

    invoke-direct {v0, v1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    .line 468
    .local v0, imageView:Landroid/widget/ImageView;
    iget-object v1, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v1, v1, Lcom/htc/weather/animations/WeatherAnimationData;->mContext:Landroid/content/Context;

    const v2, 0x208034f

    invoke-static {v1, v2}, Lcom/htc/weather/AnimImages;->getResBitmap(Landroid/content/Context;I)Landroid/graphics/Bitmap;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    .line 470
    iget-object v1, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v1, v1, Lcom/htc/weather/animations/WeatherAnimationData;->mEnv:Lcom/htc/weather/EnvSetting$Env;

    iget v1, v1, Lcom/htc/weather/EnvSetting$Env;->scale_x_:F

    cmpl-float v1, v1, v3

    if-nez v1, :cond_0

    iget-object v1, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v1, v1, Lcom/htc/weather/animations/WeatherAnimationData;->mEnv:Lcom/htc/weather/EnvSetting$Env;

    iget v1, v1, Lcom/htc/weather/EnvSetting$Env;->scale_y_:F

    cmpl-float v1, v1, v3

    if-nez v1, :cond_0

    .line 471
    new-instance v1, Landroid/widget/AbsoluteLayout$LayoutParams;

    iget-object v2, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v2, v2, Lcom/htc/weather/animations/WeatherAnimationData;->shift_x_:I

    add-int/lit8 v2, v2, 0x32

    iget-object v3, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v3, v3, Lcom/htc/weather/animations/WeatherAnimationData;->mEnv:Lcom/htc/weather/EnvSetting$Env;

    iget v3, v3, Lcom/htc/weather/EnvSetting$Env;->offset_x_:I

    add-int/2addr v2, v3

    iget-object v3, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v3, v3, Lcom/htc/weather/animations/WeatherAnimationData;->shift_y_:I

    add-int/lit8 v3, v3, 0x4b

    iget-object v4, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v4, v4, Lcom/htc/weather/animations/WeatherAnimationData;->mEnv:Lcom/htc/weather/EnvSetting$Env;

    iget v4, v4, Lcom/htc/weather/EnvSetting$Env;->offset_y_:I

    add-int/2addr v3, v4

    invoke-direct {v1, v5, v5, v2, v3}, Landroid/widget/AbsoluteLayout$LayoutParams;-><init>(IIII)V

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 481
    :goto_0
    return-object v0

    .line 476
    :cond_0
    new-instance v1, Landroid/widget/AbsoluteLayout$LayoutParams;

    iget-object v2, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v2, v2, Lcom/htc/weather/animations/WeatherAnimationData;->shift_x_:I

    add-int/lit8 v2, v2, 0x32

    iget-object v3, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v3, v3, Lcom/htc/weather/animations/WeatherAnimationData;->mEnv:Lcom/htc/weather/EnvSetting$Env;

    iget v3, v3, Lcom/htc/weather/EnvSetting$Env;->offset_x_:I

    add-int/2addr v2, v3

    int-to-float v2, v2

    iget-object v3, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v3, v3, Lcom/htc/weather/animations/WeatherAnimationData;->mEnv:Lcom/htc/weather/EnvSetting$Env;

    iget v3, v3, Lcom/htc/weather/EnvSetting$Env;->scale_x_:F

    mul-float/2addr v2, v3

    float-to-int v2, v2

    iget-object v3, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v3, v3, Lcom/htc/weather/animations/WeatherAnimationData;->shift_y_:I

    add-int/lit8 v3, v3, 0x4b

    iget-object v4, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v4, v4, Lcom/htc/weather/animations/WeatherAnimationData;->mEnv:Lcom/htc/weather/EnvSetting$Env;

    iget v4, v4, Lcom/htc/weather/EnvSetting$Env;->offset_y_:I

    add-int/2addr v3, v4

    int-to-float v3, v3

    iget-object v4, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v4, v4, Lcom/htc/weather/animations/WeatherAnimationData;->mEnv:Lcom/htc/weather/EnvSetting$Env;

    iget v4, v4, Lcom/htc/weather/EnvSetting$Env;->scale_y_:F

    mul-float/2addr v3, v4

    float-to-int v3, v3

    invoke-direct {v1, v5, v5, v2, v3}, Landroid/widget/AbsoluteLayout$LayoutParams;-><init>(IIII)V

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    goto :goto_0
.end method

.method protected initialInAnimationSet()Landroid/view/animation/AnimationSet;
    .locals 18

    .prologue
    .line 486
    new-instance v14, Landroid/view/animation/AnimationSet;

    const/4 v1, 0x0

    invoke-direct {v14, v1}, Landroid/view/animation/AnimationSet;-><init>(Z)V

    .line 487
    .local v14, inAnimationSet:Landroid/view/animation/AnimationSet;
    move-object/from16 v0, p0

    iget-object v1, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v1, v1, Lcom/htc/weather/animations/WeatherAnimationData;->mEnv:Lcom/htc/weather/EnvSetting$Env;

    iget v1, v1, Lcom/htc/weather/EnvSetting$Env;->scale_x_:F

    const/high16 v2, 0x3f80

    cmpl-float v1, v1, v2

    if-nez v1, :cond_0

    move-object/from16 v0, p0

    iget-object v1, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v1, v1, Lcom/htc/weather/animations/WeatherAnimationData;->mEnv:Lcom/htc/weather/EnvSetting$Env;

    iget v1, v1, Lcom/htc/weather/EnvSetting$Env;->scale_y_:F

    const/high16 v2, 0x3f80

    cmpl-float v1, v1, v2

    if-nez v1, :cond_0

    .line 488
    new-instance v1, Lcom/htc/weather/animations/WeatherTranslateAnimation;

    const/high16 v2, 0x4120

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v3, v3, Lcom/htc/weather/animations/WeatherAnimationData;->shift_x_:I

    int-to-float v3, v3

    add-float/2addr v2, v3

    const/high16 v3, -0x3e10

    move-object/from16 v0, p0

    iget-object v4, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v4, v4, Lcom/htc/weather/animations/WeatherAnimationData;->shift_x_:I

    int-to-float v4, v4

    add-float/2addr v3, v4

    const/high16 v4, 0x4248

    move-object/from16 v0, p0

    iget-object v5, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v5, v5, Lcom/htc/weather/animations/WeatherAnimationData;->shift_y_:I

    int-to-float v5, v5

    add-float/2addr v4, v5

    const/high16 v5, 0x4248

    move-object/from16 v0, p0

    iget-object v6, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v6, v6, Lcom/htc/weather/animations/WeatherAnimationData;->shift_y_:I

    int-to-float v6, v6

    add-float/2addr v5, v6

    const-wide/16 v6, 0x3de

    new-instance v8, Landroid/view/animation/LinearInterpolator;

    invoke-direct {v8}, Landroid/view/animation/LinearInterpolator;-><init>()V

    move-object/from16 v0, p0

    iget-object v9, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-wide v9, v9, Lcom/htc/weather/animations/WeatherAnimationData;->delay_:J

    const-wide/16 v16, 0x21

    mul-long v9, v9, v16

    invoke-direct/range {v1 .. v10}, Lcom/htc/weather/animations/WeatherTranslateAnimation;-><init>(FFFFJLandroid/view/animation/Interpolator;J)V

    invoke-virtual {v14, v1}, Landroid/view/animation/AnimationSet;->addAnimation(Landroid/view/animation/Animation;)V

    .line 492
    new-instance v1, Lcom/htc/weather/animations/WeatherScaleAnimation;

    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v2, v2, Lcom/htc/weather/animations/WeatherAnimationData;->scale_x_:F

    const/high16 v3, 0x3fa0

    move-object/from16 v0, p0

    iget-object v4, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v4, v4, Lcom/htc/weather/animations/WeatherAnimationData;->scale_x_:F

    mul-float/2addr v3, v4

    move-object/from16 v0, p0

    iget-object v4, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v4, v4, Lcom/htc/weather/animations/WeatherAnimationData;->scale_y_:F

    const/high16 v5, 0x3fa0

    move-object/from16 v0, p0

    iget-object v6, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v6, v6, Lcom/htc/weather/animations/WeatherAnimationData;->scale_y_:F

    mul-float/2addr v5, v6

    const-wide/16 v6, 0x3de

    new-instance v8, Landroid/view/animation/DecelerateInterpolator;

    invoke-direct {v8}, Landroid/view/animation/DecelerateInterpolator;-><init>()V

    move-object/from16 v0, p0

    iget-object v9, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-wide v9, v9, Lcom/htc/weather/animations/WeatherAnimationData;->delay_:J

    const-wide/16 v16, 0x21

    mul-long v9, v9, v16

    invoke-direct/range {v1 .. v10}, Lcom/htc/weather/animations/WeatherScaleAnimation;-><init>(FFFFJLandroid/view/animation/Interpolator;J)V

    invoke-virtual {v14, v1}, Landroid/view/animation/AnimationSet;->addAnimation(Landroid/view/animation/Animation;)V

    .line 506
    :goto_0
    const/4 v1, 0x2

    new-array v13, v1, [F

    fill-array-data v13, :array_0

    .line 507
    .local v13, from:[F
    const/4 v1, 0x2

    new-array v15, v1, [F

    const/4 v1, 0x0

    const v2, 0x3f4ccccd

    aput v2, v15, v1

    const/4 v1, 0x1

    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v2, v2, Lcom/htc/weather/animations/WeatherAnimationData;->alpha_:F

    aput v2, v15, v1

    .line 508
    .local v15, to:[F
    const/4 v1, 0x2

    new-array v12, v1, [J

    fill-array-data v12, :array_1

    .line 509
    .local v12, dur:[J
    new-instance v11, Lcom/htc/weather/animations/compoundAlphaAnimation;

    array-length v1, v13

    invoke-direct {v11, v1, v13, v15}, Lcom/htc/weather/animations/compoundAlphaAnimation;-><init>(I[F[F)V

    .line 511
    .local v11, ca:Lcom/htc/weather/animations/compoundAlphaAnimation;
    invoke-virtual {v11, v12}, Lcom/htc/weather/animations/compoundAlphaAnimation;->setDuration([J)V

    .line 512
    invoke-virtual {v14, v11}, Landroid/view/animation/AnimationSet;->addAnimation(Landroid/view/animation/Animation;)V

    .line 521
    const/4 v1, 0x1

    invoke-virtual {v14, v1}, Landroid/view/animation/AnimationSet;->setFillAfter(Z)V

    .line 523
    return-object v14

    .line 497
    .end local v11           #ca:Lcom/htc/weather/animations/compoundAlphaAnimation;
    .end local v12           #dur:[J
    .end local v13           #from:[F
    .end local v15           #to:[F
    :cond_0
    new-instance v1, Lcom/htc/weather/animations/WeatherTranslateAnimation;

    const/high16 v2, 0x4120

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v3, v3, Lcom/htc/weather/animations/WeatherAnimationData;->shift_x_:I

    int-to-float v3, v3

    add-float/2addr v2, v3

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v3, v3, Lcom/htc/weather/animations/WeatherAnimationData;->mEnv:Lcom/htc/weather/EnvSetting$Env;

    iget v3, v3, Lcom/htc/weather/EnvSetting$Env;->scale_x_:F

    mul-float/2addr v2, v3

    const/high16 v3, -0x3e10

    move-object/from16 v0, p0

    iget-object v4, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v4, v4, Lcom/htc/weather/animations/WeatherAnimationData;->shift_x_:I

    int-to-float v4, v4

    add-float/2addr v3, v4

    move-object/from16 v0, p0

    iget-object v4, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v4, v4, Lcom/htc/weather/animations/WeatherAnimationData;->mEnv:Lcom/htc/weather/EnvSetting$Env;

    iget v4, v4, Lcom/htc/weather/EnvSetting$Env;->scale_x_:F

    mul-float/2addr v3, v4

    const/high16 v4, 0x4248

    move-object/from16 v0, p0

    iget-object v5, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v5, v5, Lcom/htc/weather/animations/WeatherAnimationData;->shift_y_:I

    int-to-float v5, v5

    add-float/2addr v4, v5

    move-object/from16 v0, p0

    iget-object v5, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v5, v5, Lcom/htc/weather/animations/WeatherAnimationData;->mEnv:Lcom/htc/weather/EnvSetting$Env;

    iget v5, v5, Lcom/htc/weather/EnvSetting$Env;->scale_y_:F

    mul-float/2addr v4, v5

    const/high16 v5, 0x4248

    move-object/from16 v0, p0

    iget-object v6, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v6, v6, Lcom/htc/weather/animations/WeatherAnimationData;->shift_y_:I

    int-to-float v6, v6

    add-float/2addr v5, v6

    move-object/from16 v0, p0

    iget-object v6, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v6, v6, Lcom/htc/weather/animations/WeatherAnimationData;->mEnv:Lcom/htc/weather/EnvSetting$Env;

    iget v6, v6, Lcom/htc/weather/EnvSetting$Env;->scale_y_:F

    mul-float/2addr v5, v6

    const-wide/16 v6, 0x3de

    new-instance v8, Landroid/view/animation/LinearInterpolator;

    invoke-direct {v8}, Landroid/view/animation/LinearInterpolator;-><init>()V

    move-object/from16 v0, p0

    iget-object v9, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-wide v9, v9, Lcom/htc/weather/animations/WeatherAnimationData;->delay_:J

    const-wide/16 v16, 0x21

    mul-long v9, v9, v16

    invoke-direct/range {v1 .. v10}, Lcom/htc/weather/animations/WeatherTranslateAnimation;-><init>(FFFFJLandroid/view/animation/Interpolator;J)V

    invoke-virtual {v14, v1}, Landroid/view/animation/AnimationSet;->addAnimation(Landroid/view/animation/Animation;)V

    .line 501
    new-instance v1, Lcom/htc/weather/animations/WeatherScaleAnimation;

    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v2, v2, Lcom/htc/weather/animations/WeatherAnimationData;->scale_x_:F

    const/high16 v3, 0x3fa0

    move-object/from16 v0, p0

    iget-object v4, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v4, v4, Lcom/htc/weather/animations/WeatherAnimationData;->scale_x_:F

    mul-float/2addr v3, v4

    move-object/from16 v0, p0

    iget-object v4, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v4, v4, Lcom/htc/weather/animations/WeatherAnimationData;->scale_y_:F

    const/high16 v5, 0x3fa0

    move-object/from16 v0, p0

    iget-object v6, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v6, v6, Lcom/htc/weather/animations/WeatherAnimationData;->scale_y_:F

    mul-float/2addr v5, v6

    const-wide/16 v6, 0x3de

    new-instance v8, Landroid/view/animation/DecelerateInterpolator;

    invoke-direct {v8}, Landroid/view/animation/DecelerateInterpolator;-><init>()V

    move-object/from16 v0, p0

    iget-object v9, v0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-wide v9, v9, Lcom/htc/weather/animations/WeatherAnimationData;->delay_:J

    const-wide/16 v16, 0x21

    mul-long v9, v9, v16

    invoke-direct/range {v1 .. v10}, Lcom/htc/weather/animations/WeatherScaleAnimation;-><init>(FFFFJLandroid/view/animation/Interpolator;J)V

    invoke-virtual {v14, v1}, Landroid/view/animation/AnimationSet;->addAnimation(Landroid/view/animation/Animation;)V

    goto/16 :goto_0

    .line 506
    nop

    :array_0
    .array-data 0x4
        0x0t 0x0t 0x0t 0x0t
        0xcdt 0xcct 0x4ct 0x3ft
    .end array-data

    .line 508
    :array_1
    .array-data 0x8
        0x4at 0x1t 0x0t 0x0t 0x0t 0x0t 0x0t 0x0t
        0x94t 0x2t 0x0t 0x0t 0x0t 0x0t 0x0t 0x0t
    .end array-data
.end method

.method protected initialOutAnimationSet()Landroid/view/animation/AnimationSet;
    .locals 15

    .prologue
    const/high16 v2, -0x3e10

    const/high16 v14, 0x3fa0

    const-wide/16 v5, 0x294

    const-wide/16 v12, 0x21

    const/high16 v11, 0x3f80

    .line 528
    new-instance v10, Landroid/view/animation/AnimationSet;

    const/4 v0, 0x0

    invoke-direct {v10, v0}, Landroid/view/animation/AnimationSet;-><init>(Z)V

    .line 529
    .local v10, outAnimationSet:Landroid/view/animation/AnimationSet;
    iget-object v0, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v0, v0, Lcom/htc/weather/animations/WeatherAnimationData;->mEnv:Lcom/htc/weather/EnvSetting$Env;

    iget v0, v0, Lcom/htc/weather/EnvSetting$Env;->scale_x_:F

    cmpl-float v0, v0, v11

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v0, v0, Lcom/htc/weather/animations/WeatherAnimationData;->mEnv:Lcom/htc/weather/EnvSetting$Env;

    iget v0, v0, Lcom/htc/weather/EnvSetting$Env;->scale_y_:F

    cmpl-float v0, v0, v11

    if-nez v0, :cond_0

    .line 530
    new-instance v0, Lcom/htc/weather/animations/WeatherTranslateAnimation;

    iget-object v1, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v1, v1, Lcom/htc/weather/animations/WeatherAnimationData;->shift_x_:I

    int-to-float v1, v1

    add-float/2addr v1, v2

    const/high16 v2, -0x3d74

    iget-object v3, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v3, v3, Lcom/htc/weather/animations/WeatherAnimationData;->shift_x_:I

    int-to-float v3, v3

    add-float/2addr v2, v3

    const/high16 v3, 0x4248

    iget-object v4, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v4, v4, Lcom/htc/weather/animations/WeatherAnimationData;->shift_y_:I

    int-to-float v4, v4

    add-float/2addr v3, v4

    const/high16 v4, 0x425c

    iget-object v7, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v7, v7, Lcom/htc/weather/animations/WeatherAnimationData;->shift_y_:I

    int-to-float v7, v7

    add-float/2addr v4, v7

    new-instance v7, Landroid/view/animation/LinearInterpolator;

    invoke-direct {v7}, Landroid/view/animation/LinearInterpolator;-><init>()V

    iget-object v8, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-wide v8, v8, Lcom/htc/weather/animations/WeatherAnimationData;->delay_:J

    mul-long/2addr v8, v12

    invoke-direct/range {v0 .. v9}, Lcom/htc/weather/animations/WeatherTranslateAnimation;-><init>(FFFFJLandroid/view/animation/Interpolator;J)V

    invoke-virtual {v10, v0}, Landroid/view/animation/AnimationSet;->addAnimation(Landroid/view/animation/Animation;)V

    .line 534
    new-instance v0, Lcom/htc/weather/animations/WeatherScaleAnimation;

    iget-object v1, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v1, v1, Lcom/htc/weather/animations/WeatherAnimationData;->scale_x_:F

    mul-float/2addr v1, v14

    iget-object v2, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v2, v2, Lcom/htc/weather/animations/WeatherAnimationData;->scale_x_:F

    mul-float/2addr v2, v11

    iget-object v3, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v3, v3, Lcom/htc/weather/animations/WeatherAnimationData;->scale_y_:F

    mul-float/2addr v3, v14

    iget-object v4, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v4, v4, Lcom/htc/weather/animations/WeatherAnimationData;->scale_y_:F

    mul-float/2addr v4, v11

    new-instance v7, Landroid/view/animation/AccelerateInterpolator;

    invoke-direct {v7}, Landroid/view/animation/AccelerateInterpolator;-><init>()V

    iget-object v8, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-wide v8, v8, Lcom/htc/weather/animations/WeatherAnimationData;->delay_:J

    mul-long/2addr v8, v12

    invoke-direct/range {v0 .. v9}, Lcom/htc/weather/animations/WeatherScaleAnimation;-><init>(FFFFJLandroid/view/animation/Interpolator;J)V

    invoke-virtual {v10, v0}, Landroid/view/animation/AnimationSet;->addAnimation(Landroid/view/animation/Animation;)V

    .line 538
    new-instance v2, Lcom/htc/weather/animations/WeatherAlphaAnimation;

    iget-object v0, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v3, v0, Lcom/htc/weather/animations/WeatherAnimationData;->alpha_:F

    const/4 v4, 0x0

    new-instance v7, Landroid/view/animation/AccelerateInterpolator;

    invoke-direct {v7}, Landroid/view/animation/AccelerateInterpolator;-><init>()V

    iget-object v0, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-wide v0, v0, Lcom/htc/weather/animations/WeatherAnimationData;->delay_:J

    mul-long v8, v0, v12

    invoke-direct/range {v2 .. v9}, Lcom/htc/weather/animations/WeatherAlphaAnimation;-><init>(FFJLandroid/view/animation/Interpolator;J)V

    invoke-virtual {v10, v2}, Landroid/view/animation/AnimationSet;->addAnimation(Landroid/view/animation/Animation;)V

    .line 554
    :goto_0
    const/4 v0, 0x1

    invoke-virtual {v10, v0}, Landroid/view/animation/AnimationSet;->setFillAfter(Z)V

    .line 556
    return-object v10

    .line 542
    :cond_0
    new-instance v0, Lcom/htc/weather/animations/WeatherTranslateAnimation;

    iget-object v1, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v1, v1, Lcom/htc/weather/animations/WeatherAnimationData;->shift_x_:I

    int-to-float v1, v1

    add-float/2addr v1, v2

    iget-object v2, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v2, v2, Lcom/htc/weather/animations/WeatherAnimationData;->mEnv:Lcom/htc/weather/EnvSetting$Env;

    iget v2, v2, Lcom/htc/weather/EnvSetting$Env;->scale_x_:F

    mul-float/2addr v1, v2

    const/high16 v2, -0x3d74

    iget-object v3, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v3, v3, Lcom/htc/weather/animations/WeatherAnimationData;->shift_x_:I

    int-to-float v3, v3

    add-float/2addr v2, v3

    iget-object v3, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v3, v3, Lcom/htc/weather/animations/WeatherAnimationData;->mEnv:Lcom/htc/weather/EnvSetting$Env;

    iget v3, v3, Lcom/htc/weather/EnvSetting$Env;->scale_x_:F

    mul-float/2addr v2, v3

    const/high16 v3, 0x4248

    iget-object v4, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v4, v4, Lcom/htc/weather/animations/WeatherAnimationData;->shift_y_:I

    int-to-float v4, v4

    add-float/2addr v3, v4

    iget-object v4, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v4, v4, Lcom/htc/weather/animations/WeatherAnimationData;->mEnv:Lcom/htc/weather/EnvSetting$Env;

    iget v4, v4, Lcom/htc/weather/EnvSetting$Env;->scale_y_:F

    mul-float/2addr v3, v4

    const/high16 v4, 0x425c

    iget-object v7, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v7, v7, Lcom/htc/weather/animations/WeatherAnimationData;->shift_y_:I

    int-to-float v7, v7

    add-float/2addr v4, v7

    iget-object v7, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-object v7, v7, Lcom/htc/weather/animations/WeatherAnimationData;->mEnv:Lcom/htc/weather/EnvSetting$Env;

    iget v7, v7, Lcom/htc/weather/EnvSetting$Env;->scale_y_:F

    mul-float/2addr v4, v7

    new-instance v7, Landroid/view/animation/LinearInterpolator;

    invoke-direct {v7}, Landroid/view/animation/LinearInterpolator;-><init>()V

    iget-object v8, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-wide v8, v8, Lcom/htc/weather/animations/WeatherAnimationData;->delay_:J

    mul-long/2addr v8, v12

    invoke-direct/range {v0 .. v9}, Lcom/htc/weather/animations/WeatherTranslateAnimation;-><init>(FFFFJLandroid/view/animation/Interpolator;J)V

    invoke-virtual {v10, v0}, Landroid/view/animation/AnimationSet;->addAnimation(Landroid/view/animation/Animation;)V

    .line 546
    new-instance v0, Lcom/htc/weather/animations/WeatherScaleAnimation;

    iget-object v1, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v1, v1, Lcom/htc/weather/animations/WeatherAnimationData;->scale_x_:F

    mul-float/2addr v1, v14

    iget-object v2, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v2, v2, Lcom/htc/weather/animations/WeatherAnimationData;->scale_x_:F

    mul-float/2addr v2, v11

    iget-object v3, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v3, v3, Lcom/htc/weather/animations/WeatherAnimationData;->scale_y_:F

    mul-float/2addr v3, v14

    iget-object v4, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v4, v4, Lcom/htc/weather/animations/WeatherAnimationData;->scale_y_:F

    mul-float/2addr v4, v11

    new-instance v7, Landroid/view/animation/AccelerateInterpolator;

    invoke-direct {v7}, Landroid/view/animation/AccelerateInterpolator;-><init>()V

    iget-object v8, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-wide v8, v8, Lcom/htc/weather/animations/WeatherAnimationData;->delay_:J

    mul-long/2addr v8, v12

    invoke-direct/range {v0 .. v9}, Lcom/htc/weather/animations/WeatherScaleAnimation;-><init>(FFFFJLandroid/view/animation/Interpolator;J)V

    invoke-virtual {v10, v0}, Landroid/view/animation/AnimationSet;->addAnimation(Landroid/view/animation/Animation;)V

    .line 550
    new-instance v2, Lcom/htc/weather/animations/WeatherAlphaAnimation;

    iget-object v0, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget v3, v0, Lcom/htc/weather/animations/WeatherAnimationData;->alpha_:F

    const/4 v4, 0x0

    new-instance v7, Landroid/view/animation/AccelerateInterpolator;

    invoke-direct {v7}, Landroid/view/animation/AccelerateInterpolator;-><init>()V

    iget-object v0, p0, Lcom/htc/weather/animations/Anim52$6;->this$0:Lcom/htc/weather/animations/Anim52;

    iget-wide v0, v0, Lcom/htc/weather/animations/WeatherAnimationData;->delay_:J

    mul-long v8, v0, v12

    invoke-direct/range {v2 .. v9}, Lcom/htc/weather/animations/WeatherAlphaAnimation;-><init>(FFJLandroid/view/animation/Interpolator;J)V

    invoke-virtual {v10, v2}, Landroid/view/animation/AnimationSet;->addAnimation(Landroid/view/animation/Animation;)V

    goto/16 :goto_0
.end method

.method protected initialRestAnimationSet()Landroid/view/animation/AnimationSet;
    .locals 1

    .prologue
    .line 562
    const/4 v0, 0x0

    return-object v0
.end method


text:
[![Live demo](https://img.shields.io/badge/Live-Demo-brightgreen.svg?style=flat-square)](https://tinyfilemanager.github.io/demo/)
[![Live demo](https://img.shields.io/badge/Help-Docs-lightgrey.svg?style=flat-square)](https://github.com/prasathmani/tinyfilemanager/wiki)
[![GitHub Release](https://img.shields.io/github/release/qubyte/rubidium.svg?style=flat-square)](https://github.com/prasathmani/tinyfilemanager/releases)
[![GitHub License](https://img.shields.io/github/license/prasathmani/tinyfilemanager.svg?style=flat-square)](https://github.com/prasathmani/tinyfilemanager/blob/master/LICENSE)
[![Paypal](https://img.shields.io/badge/Donate-Paypal-lightgrey.svg?style=flat-square)](https://www.paypal.me/prasathmani)

> TinyFileManager is web based file manager and it is a simple, fast and small file manager with a single file, multi-language ready web application for storing, uploading, editing and managing files and folders online via web browser. The Application runs on PHP 5.5+, It allows the creation of multiple users and each user can have its own directory and a build-in support for managing text files with cloud9 IDE and it supports syntax highlighting for over 150+ languages and over 35+ themes.

## Demo

[Demo](https://tinyfilemanager.github.io/demo/)

Login Details : admin/admin@123 | user/12345

## Documentation

Tinyfilemanager is highly documented on the [wiki pages](https://github.com/prasathmani/tinyfilemanager/wiki).

[![Tiny File Manager](screenshot.gif)](screenshot.gif)

## Requirements

- PHP 5.5.0 or higher.
- Fileinfo, iconv, zip, tar and mbstring extensions are strongly recommended.

## How to use

Download ZIP with latest version from master branch.

Just copy the tinyfilemanager.php to your webspace - thats all :)
You can also change the file name from "tinyfilemanager.php" to something else, you know what i meant for.

Default username/password: **admin/admin@123** and **user/12345**.

:warning: Warning: Please set your own username and password in `$auth_users` before use. password is encrypted with password_hash(). to generate new password hash [here](https://tinyfilemanager.github.io/docs/pwd.html)

To enable/disable authentication set `$use_auth` to true or false.

:information_source: Rename the `config-sample.php` file into `config.php` to use configuration, it is an additional configuration file, Feel free to remove completely this file and configure "tinyfilemanager.php" as a single file application.

### :loudspeaker: Features

- :cd: Open Source, light and extremely simple
- :iphone: Mobile friendly view for touch devices
- :information_source: Basic features likes Create, Delete, Modify, View, Quick Preview, Download, Copy and Move files
- :arrow_double_up: Ajax Upload, Ability to drag & drop, upload from URL, multiple files upload with file extensions filter
- :file_folder: Ability to create folders and files
- :gift: Ability to compress, extract files (`zip`, `tar`)
- :sunglasses: Support user permissions - based on session and each user root folder mapping
- :floppy_disk: Copy direct file URL
- :pencil2: Cloud9 IDE - Syntax highlighting for over `150+` languages, Over `35+` themes with your favorite programming style
- :page_facing_up: Google/Microsoft doc viewer helps you preview `PDF/DOC/XLS/PPT/etc`. 25 MB can be previewed with the Google Drive viewer
- :zap: Backup files and IP blacklist and whitelist
- :mag_right: Search - Search and filter files using `datatable js`
- :file_folder: Exclude folders and files from listing
- :globe_with_meridians: Multi-language(20+) support and for translations `translation.json` is file required
- :bangbang: lots more...

## Deploy by Docker

Make sure you have **already installed docker**, [Install reference](https://docs.docker.com/engine/install/)

> **Notice:** Your need an absolute path, and it will be served by tinyfilemanager.
>
> If you want to serve this project at **raspberry pi or another special platform**, you can download project and **build image by yourself**.

You can execute this following commands:

```shell
$ docker run -d -v /absolute/path:/var/www/html/data -p 80:80 --restart=always --name tinyfilemanager tinyfilemanager/tinyfilemanager:master
$ docker ps
CONTAINER ID   IMAGE                                COMMAND                  CREATED         STATUS         PORTS                                       NAMES
648dfba9c0ff   tinyfilemanager/tinyfilemanager:master   "docker-php-entrypoi…"   4 minutes ago   Up 4 minutes   0.0.0.0:80->80/tcp, :::80->80/tcp           tinyfilemanager
```
Access `http://127.0.0.1/` and enter default username and password, then enjoy it.

DockerHub: [https://hub.docker.com/r/tinyfilemanager/tinyfilemanager](https://hub.docker.com/r/tinyfilemanager/tinyfilemanager)

#### How to change config within docker

**Important!!!** First, you can copy `config-sample.php` to `config.php`, and must modify this following config

Origin:

```php
// Root path for file manager
// use absolute path of directory i.e: '/var/www/folder' or $_SERVER['DOCUMENT_ROOT'].'/folder'
$root_path = $_SERVER['DOCUMENT_ROOT'];

// Root url for links in file manager.Relative to $http_host. Variants: '', 'path/to/subfolder'
// Will not working if $root_path will be outside of server document root
$root_url = '';
```

Modified:

```php
// Root path for file manager
// use absolute path of directory i.e: '/var/www/folder' or $_SERVER['DOCUMENT_ROOT'].'/folder'
$root_path = $_SERVER['DOCUMENT_ROOT'].'/data';

// Root url for links in file manager.Relative to $http_host. Variants: '', 'path/to/subfolder'
// Will not working if $root_path will be outside of server document root
$root_url = 'data/';
```

Then, change another config what you want, and add a new volume `-v /absolute/path/config.php:/var/www/html/config.php` in `docker run` command, like this:

```shell
$ docker run -d -v /absolute/path:/var/www/html/data -v /absolute/path/config.php:/var/www/html/config.php -p 80:80 --restart=always --name tinyfilemanager tinyfilemanager/tinyfilemanager:master
```

#### Stop running

If you want to stop a running docker service, or you want to restart a service, you should stop it first, or you got `docker: Error response from daemon: Conflict. The container name "/tinyfilemanager" is already in use by container ...` problem. You can execute this command:

```shell
$ docker rm -f tinyfilemanager
```

### License, Credit

- Available under the [GNU license](https://github.com/prasathmani/tinyfilemanager/blob/master/LICENSE)
- Original concept and development by github.com/alexantr/filemanager
- CDN Used - _jQuery, Bootstrap, Font Awesome, Highlight js, ace js, DropZone js, ekko-lightbox js, and DataTable js_
- To report a bug or request a feature, please file an [issue](https://github.com/prasathmani/tinyfilemanager/issues)
- [Contributors](https://github.com/prasathmani/tinyfilemanager/wiki/Authors-and-Contributors)


text:
FactoryGirl.define do
  factory :application, class: Doorkeeper::Application do
    sequence(:name) { |n| "Application #{n}" }
    redirect_uri 'urn:ietf:wg:oauth:2.0:oob'
    default_scope ['public', 'project', 'classification']
    trust_level 0
    owner { build :user }

    factory :first_party_app do
      trust_level 2
    end

    factory :secure_app do
      trust_level 1
    end
  end
end


text:
package org.knowm.xchange.abucoins.service;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.knowm.xchange.Exchange;
import org.knowm.xchange.abucoins.AbucoinsAdapters;
import org.knowm.xchange.abucoins.dto.AbucoinsCreateLimitOrderRequest;
import org.knowm.xchange.abucoins.dto.AbucoinsCreateMarketOrderRequest;
import org.knowm.xchange.abucoins.dto.AbucoinsOrderRequest;
import org.knowm.xchange.abucoins.dto.marketdata.AbucoinsCreateOrderResponse;
import org.knowm.xchange.abucoins.dto.trade.AbucoinsOrder;
import org.knowm.xchange.dto.Order;
import org.knowm.xchange.dto.trade.*;
import org.knowm.xchange.exceptions.ExchangeException;
import org.knowm.xchange.exceptions.NotAvailableFromExchangeException;
import org.knowm.xchange.exceptions.NotYetImplementedForExchangeException;
import org.knowm.xchange.service.trade.TradeService;
import org.knowm.xchange.service.trade.params.CancelOrderByCurrencyPair;
import org.knowm.xchange.service.trade.params.CancelOrderParams;
import org.knowm.xchange.service.trade.params.TradeHistoryParams;
import org.knowm.xchange.service.trade.params.orders.DefaultOpenOrdersParamCurrencyPair;
import org.knowm.xchange.service.trade.params.orders.OpenOrdersParamCurrencyPair;
import org.knowm.xchange.service.trade.params.orders.OpenOrdersParams;

/**
 * Author: bryant_harris
 */

public class AbucoinsTradeService extends AbucoinsTradeServiceRaw implements TradeService {

  /**
   * Constructor
   *
   * @param exchange
   */
  public AbucoinsTradeService(Exchange exchange) {

    super(exchange);
  }

  @Override
  public OpenOrders getOpenOrders() throws IOException {
    return getOpenOrders(createOpenOrdersParams());
  }

  @Override
  public OpenOrders getOpenOrders(OpenOrdersParams params) throws IOException {
    if ( params instanceof OpenOrdersParamCurrencyPair ) {
      OpenOrdersParamCurrencyPair cpParams = (OpenOrdersParamCurrencyPair) params;
      AbucoinsOrderRequest orderRequest = new AbucoinsOrderRequest(AbucoinsOrder.Status.open,
                                                                   AbucoinsAdapters.adaptCurrencyPairToProductID(cpParams.getCurrencyPair()));
      AbucoinsOrder[] openOrders = getAbucoinsOrders(orderRequest);
      return AbucoinsAdapters.adaptOpenOrders(openOrders);
    }

    throw new NotYetImplementedForExchangeException("Only OpenOrdersParamCurrencyPair supported");
  }

  @Override
  public String placeMarketOrder(MarketOrder marketOrder) throws IOException {
    AbucoinsCreateMarketOrderRequest req = AbucoinsAdapters.adaptAbucoinsCreateMarketOrderRequest(marketOrder);
    AbucoinsCreateOrderResponse resp = createAbucoinsOrder(req);
    if ( resp.getMessage() != null )
      throw new ExchangeException(resp.getMessage());
    return resp.getId();
  }

  @Override
  public String placeLimitOrder(LimitOrder limitOrder) throws IOException {
    AbucoinsCreateLimitOrderRequest req = AbucoinsAdapters.adaptAbucoinsCreateLimitOrderRequest(limitOrder);
    AbucoinsCreateOrderResponse resp = createAbucoinsOrder(req);
    if ( resp.getMessage() != null )
      throw new ExchangeException(resp.getMessage());
    return resp.getId();
  }

  @Override
  public String placeStopOrder(StopOrder stopOrder) throws IOException {
    throw new NotAvailableFromExchangeException();
  }

  @Override
  public boolean cancelOrder(String orderId) throws IOException {

    String id = deleteAbucoinsOrder(orderId);
    return id.equals(orderId);
  }

  @Override
  public boolean cancelOrder(CancelOrderParams orderParams) throws IOException {
    if (orderParams instanceof CancelOrderByCurrencyPair) {
      CancelOrderByCurrencyPair cob = (CancelOrderByCurrencyPair) orderParams;
      deleteAllAbucoinsOrders(AbucoinsAdapters.adaptCurrencyPairToProductID(cob.getCurrencyPair()));
      return true;
    } else {
      throw new NotYetImplementedForExchangeException("Only CancelOrderByCurrencyPair supported");
    }
  }

  @Override
  public UserTrades getTradeHistory(TradeHistoryParams params) throws IOException {
    throw new NotAvailableFromExchangeException();
  }

  @Override
  public TradeHistoryParams createTradeHistoryParams() {
    return new AbucoinsTradeHistoryParams();
  }

  @Override
  public OpenOrdersParams createOpenOrdersParams() {
    return new DefaultOpenOrdersParamCurrencyPair();
  }

  @Override
  public Collection<Order> getOrder(String... orderIds) throws IOException {

    List<Order> orders = new ArrayList<>();
    for (String orderId : orderIds) {
      AbucoinsOrder AbucoinsOrder = getAbucoinsOrder(orderId);
      orders.add(AbucoinsAdapters.adaptOrder(AbucoinsOrder));
    }
    return orders;
  }

}


text:
require 'spec_helper'
require_relative '../lib/sf_integrator/integrator.rb'

describe SfIntegrator::Integrator do
  subject { described_class }

  context 'valid configs' do
    before do
      SfIntegrator::Integrator.configure do |config|
        config.username = 'lccezinha@gmail.com'
        config.password = 'batata880AvOSHd43zql8ZIMJ1emQNjkt'
        config.client_id = '3MVG9xOCXq4ID1uFbfzoMHMM0bGJfUgjThmhEmajKOh75cvDlJn.E3g5FYx2R45vTpFRJfiPDfda5o.td8HQ2'
        config.client_secret = '3340784302062558262'
      end
    end

    it { expect(subject.configs.username).to eql('lccezinha@gmail.com') }
    it { expect(subject.configs.password).to eql('batata880AvOSHd43zql8ZIMJ1emQNjkt') }
    it { expect(subject.configs.client_id).to eql('3MVG9xOCXq4ID1uFbfzoMHMM0bGJfUgjThmhEmajKOh75cvDlJn.E3g5FYx2R45vTpFRJfiPDfda5o.td8HQ2') }
    it { expect(subject.configs.client_secret).to eql('3340784302062558262') }
  end
end