text:
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using PerformanceMeasuring.GameDebugTools;

namespace PerformanceMeasuring
{
    /// <summary>
    /// This sample game shows how to use the GameDebugTools to measure the performance of a game,
    /// as well as how the number of objects and interactions between them can affect performance.
    /// </summary>
    public class PerformanceMeasuringGame : Game
    {
        // The maximum number of spheres in our world
        const int maximumNumberOfSpheres = 200;

        GraphicsDeviceManager graphics;

        // A SpriteBatch, font, and blank texture for drawing our instruction text
        SpriteBatch spriteBatch;
        SpriteFont font;
        Texture2D blank;

        // The text we draw as instructions.
        string instructions =
#if WINDOWS_PHONE
            "Tap - Toggle collisions\nDrag up/down - Change number of spheres";
#else
            "X - Toggle collisions\nUp - Increase number of spheres\nDown - Decrease number of spheres";
#endif

        // The size of the world. The world is a bounding box ranging from -worldSize to worldSize on
        // the X and Z axis, and from 0 to worldSize on the Y axis.
        const float worldSize = 20f;

        // A model for our ground
        Model ground;

        // An array of spheres and the number of currently active spheres
        Sphere[] spheres = new Sphere[maximumNumberOfSpheres];
        int activeSphereCount = 50;

        // Are we colliding the spheres against each other?
        bool collideSpheres = true;

        // Various input states for changing the simulation
        GamePadState gamePad, gamePadPrev;
        KeyboardState keyboard, keyboardPrev;

        public PerformanceMeasuringGame()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

#if WINDOWS_PHONE
            TargetElapsedTime = TimeSpan.FromTicks(333333);
            graphics.IsFullScreen = true;
#endif
        }

        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // Initialize the DebugSystem and change the visibility of the FpsCounter and TimeRuler.

            // The FpsCounter will show us our current "frames per second". On Windows Phone we can
            // have a maximum of 30 frames per second. On Windows and Xbox, we can reach 60 frames
            // per second with our current game settings.

            // The TimeRuler allows us to instrument our code and figure out where our bottlenecks
            // are so we can speed up slow code.
            DebugSystem.Initialize(this, "Font");
            DebugSystem.Instance.FpsCounter.Visible = true;
            DebugSystem.Instance.TimeRuler.Visible = true;
            DebugSystem.Instance.TimeRuler.ShowLog = true;

            // Enable the Tap and FreeDrag gestures for our input on Windows Phone
            TouchPanel.EnabledGestures = GestureType.Tap | GestureType.FreeDrag;

            base.Initialize();
        }

        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // Load the font for our UI
            font = Content.Load<SpriteFont>("Font");

            // Create a blank texture for our UI drawing
            blank = new Texture2D(GraphicsDevice, 1, 1);
            blank.SetData(new[] { Color.White });

            // Load the ground model
            ground = Content.Load<Model>("Ground");

            // Create our spheres
            CreateSpheres();
        }

        /// <summary>
        /// Helper method that creates all of our spheres.
        /// </summary>
        private void CreateSpheres()
        {
            // Create a random number generator
            Random random = new Random();

            // These are the various colors we use when creating the spheres
            Color[] sphereColors = new[]
            {
                Color.Red,
                Color.Blue,
                Color.Green,
                Color.Orange,
                Color.Pink,
                Color.Purple,
                Color.Yellow
            };

            // The radius of a sphere
            const float radius = 1f;

            for (int i = 0; i < maximumNumberOfSpheres; i++)
            {
                // Create the sphere
                Sphere sphere = new Sphere(GraphicsDevice, radius);

                // Position the sphere in our world
                sphere.Position = new Vector3(
                    RandomFloat(random, -worldSize + radius, worldSize - radius),
                    RandomFloat(random, radius, worldSize - radius),
                    RandomFloat(random, -worldSize + radius, worldSize - radius));

                // Pick a random color for the sphere
                sphere.Color = sphereColors[random.Next(sphereColors.Length)];

                // Create a random velocity vector
                sphere.Velocity = new Vector3(
                    RandomFloat(random, -10f, 10f),
                    RandomFloat(random, -10f, 10f),
                    RandomFloat(random, -10f, 10f));

                // Add the sphere to our array
                spheres[i] = sphere;
            }
        }

        /// <summary>
        /// A helper method that generates a random float in a given range.
        /// </summary>
        private static float RandomFloat(Random random, float min, float max)
        {
            return (float)random.NextDouble() * (max - min) + min;
        }

        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            // We must call StartFrame at the top of Update to indicate to the TimeRuler
            // that a new frame has started.
            DebugSystem.Instance.TimeRuler.StartFrame();

            // We can now begin measuring our Update method
            DebugSystem.Instance.TimeRuler.BeginMark("Update", Color.Blue);

            // Update the input state for the game
            UpdateInput(gameTime);

            // Update all of the spheres in the game, handling collision if desired
            UpdateSpheres(gameTime);

            base.Update(gameTime);

            // End measuring the Update method
            DebugSystem.Instance.TimeRuler.EndMark("Update");
        }

        /// <summary>
        /// Helper method to handle the input for the sample.
        /// </summary>
        private void UpdateInput(GameTime gameTime)
        {
            // Update the game pad and keyboard input states
            gamePadPrev = gamePad;
            gamePad = GamePad.GetState(PlayerIndex.One);
            keyboardPrev = keyboard;
            keyboard = Keyboard.GetState();

            // If we've pressed the Back button or Escape key, exit the game
            if (gamePad.IsButtonDown(Buttons.Back) || keyboard.IsKeyDown(Keys.Escape))
                Exit();

            // If the X key or button was pressed, toggle whether or not we're colliding the spheres
            if ((gamePad.IsButtonDown(Buttons.X) && gamePadPrev.IsButtonUp(Buttons.X)) ||
                (keyboard.IsKeyDown(Keys.X) && keyboardPrev.IsKeyUp(Keys.X)))
            {
                collideSpheres = !collideSpheres;
            }

            // If the user pressed Up or Down on the keyboard, DPad, or left thumbstick, we adjust
            // the number of active spheres in our scene
            if (gamePad.IsButtonDown(Buttons.DPadUp) ||
                gamePad.IsButtonDown(Buttons.LeftThumbstickUp) ||
                keyboard.IsKeyDown(Keys.Up))
            {
                activeSphereCount++;
            }
            else if (gamePad.IsButtonDown(Buttons.DPadDown) ||
                gamePad.IsButtonDown(Buttons.LeftThumbstickDown) ||
                keyboard.IsKeyDown(Keys.Down))
            {
                activeSphereCount--;
            }

            // Poll for all the gestures our game received
            while (TouchPanel.IsGestureAvailable)
            {
                GestureSample gesture = TouchPanel.ReadGesture();

                // If the user tapped the screen, toggle whether or not we're colliding the spheres
                if (gesture.GestureType == GestureType.Tap)
                {
                    collideSpheres = !collideSpheres;
                }

                // If the user dragged on the screen, we adjust the number of active spheres in the scene
                else if (gesture.GestureType == GestureType.FreeDrag)
                {
                    activeSphereCount -= Math.Sign(gesture.Delta.Y);
                }
            }

            // Make sure we clamp our active sphere count so that we don't go above our maximum or below 1
            activeSphereCount = Math.Max(Math.Min(activeSphereCount, maximumNumberOfSpheres), 1);
        }

        /// <summary>
        /// Helper method that updates our sphere simulation.
        /// </summary>
        private void UpdateSpheres(GameTime gameTime)
        {
            // Update all spheres and perform collision against the world
            for (int i = 0; i < activeSphereCount; i++)
            {
                Sphere s = spheres[i];
                s.Update(gameTime);
                BounceSphereInWorld(s);
            }

            // If we are colliding spheres against each other
            if (collideSpheres)
            {
                // Iterate over the list twice to compare the spheres against each other
                for (int i = 0; i < activeSphereCount; i++)
                {
                    for (int j = 0; j < activeSphereCount; j++)
                    {
                        // Make sure we don't collid a sphere with itself
                        if (i == j)
                            continue;

                        // Get the spheres
                        Sphere a = spheres[i];
                        Sphere b = spheres[j];

                        // If the spheres are intersecting
                        if (a.Bounds.Intersects(b.Bounds))
                        {
                            // Get the vector between their centers
                            Vector3 delta = b.Position - a.Position;

                            // Calculate the point halfway between the spheres
                            Vector3 center = a.Position + delta / 2f;

                            // Normalize the delta vector
                            delta.Normalize();

                            // Move the spheres to resolve the collision
                            a.Position = center - delta * a.Radius;
                            b.Position = center + delta * b.Radius;

                            // Reflect the velocities to bounce the spheres
                            a.Velocity = Vector3.Normalize(Vector3.Reflect(a.Velocity, delta)) * b.Velocity.Length();
                            b.Velocity = Vector3.Normalize(Vector3.Reflect(b.Velocity, delta)) * a.Velocity.Length();
                        }
                    }
                }
            }
        }

        /// <summary>
        /// Helper method that keeps a sphere in the world by bouncing it off the walls.
        /// </summary>
        private static void BounceSphereInWorld(Sphere s)
        {
            // First test along the X axis, flipping the velocity if a collision occurs.
            if (s.Position.X < -worldSize + s.Radius)
            {
                s.Position.X = -worldSize + s.Radius;
                if (s.Velocity.X < 0f)
                    s.Velocity.X *= -1f;
            }
            else if (s.Position.X > worldSize - s.Radius)
            {
                s.Position.X = worldSize - s.Radius;
                if (s.Velocity.X > 0f)
                    s.Velocity.X *= -1f;
            }

            // Then we test the Y axis
            if (s.Position.Y < s.Radius)
            {
                s.Position.Y = s.Radius;
                if (s.Velocity.Y < 0f)
                    s.Velocity.Y *= -1f;
            }
            else if (s.Position.Y > worldSize - s.Radius)
            {
                s.Position.Y = worldSize - s.Radius;
                if (s.Velocity.Y > 0f)
                    s.Velocity.Y *= -1f;
            }

            // And lastly the Z axis
            if (s.Position.Z < -worldSize + s.Radius)
            {
                s.Position.Z = -worldSize + s.Radius;
                if (s.Velocity.Z < 0f)
                    s.Velocity.Z *= -1f;
            }
            else if (s.Position.Z > worldSize - s.Radius)
            {
                s.Position.Z = worldSize - s.Radius;
                if (s.Velocity.Z > 0f)
                    s.Velocity.Z *= -1f;
            }
        }

        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            // Begin measuring our Draw method
            DebugSystem.Instance.TimeRuler.BeginMark("Draw", Color.Red);

            GraphicsDevice.Clear(Color.CornflowerBlue);

            // Create a view and projection matrix for our camera
            Matrix view = Matrix.CreateLookAt(
                new Vector3(worldSize, worldSize, worldSize) * 1.5f, Vector3.Zero, Vector3.Up);
            Matrix projection = Matrix.CreatePerspectiveFieldOfView(
                MathHelper.PiOver4, GraphicsDevice.Viewport.AspectRatio, 0.01f, 100f);

            // Set our sampler state to allow the ground to have a repeated texture
            GraphicsDevice.SamplerStates[0] = SamplerState.LinearWrap;

            // Draw the ground scaled to our world
            ground.Draw(Matrix.CreateScale(worldSize, 1f, worldSize), view, projection);

            // Draw all of our spheres
            for (int i = 0; i < activeSphereCount; i++)
            {
                spheres[i].Draw(view, projection);
            }

            // Draw the demo text on top of the scene
            DrawDemoText();

            base.Draw(gameTime);

            // End measuring our Draw method
            DebugSystem.Instance.TimeRuler.EndMark("Draw");
        }

        /// <summary>
        /// Helper that draws our demo text, including our current settings and the instructions.
        /// </summary>
        private void DrawDemoText()
        {
            // Create the text based on our current states
            string demoText = string.Format(
                "Sphere count: {0}\nCollisions Enabled: {1}\n\n{2}",
                activeSphereCount, collideSpheres, instructions);

            // Measure our text and calculate the correct position to draw it
            Vector2 size = font.MeasureString(demoText);
            Vector2 pos = new Vector2(
                GraphicsDevice.Viewport.TitleSafeArea.Right - size.X,
                GraphicsDevice.Viewport.TitleSafeArea.Top);

            spriteBatch.Begin();

            // Draw a blank box as a background for our text
            spriteBatch.Draw(
                blank,
                new Rectangle((int)pos.X - 5, (int)pos.Y, (int)size.X + 10, (int)size.Y + 5),
                Color.Black * .5f);

            // Draw the text itself
            spriteBatch.DrawString(font, demoText, pos, Color.White);

            spriteBatch.End();
        }
    }
}


text:
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

from oslo_config import cfg
from oslo_db.sqlalchemy import session

_FACADE = None

def _create_facade_lazily():
    global _FACADE

    if _FACADE is None:
        _FACADE = session.EngineFacade.from_config(cfg.CONF, sqlite_fk=True)

    return _FACADE

def get_engine():
    """Helper method to grab engine."""
    facade = _create_facade_lazily()
    return facade.get_engine()

def get_session(autocommit=True, expire_on_commit=False, make_new=False):
    """Helper method to grab session."""
    if make_new:  # do not reuse existing facade
        facade = session.EngineFacade.from_config(cfg.CONF, sqlite_fk=True)
    else:
        facade = _create_facade_lazily()
    return facade.get_session(autocommit=autocommit,
                              expire_on_commit=expire_on_commit)

def get_locking_session():
    """Obtain db_session that works with table locking

    supported backends: MySQL and PostgreSQL
    return default session if backend not supported (eg. sqlite)
    """
    if is_mysql() or is_postgres():
        db_session = get_session(
            autocommit=False,
            # to prevent implicit new transactions,
            # which UNLOCKS in MySQL
            expire_on_commit=False,  # need to UNLOCK after commit
            make_new=True)  # brand new facade avoids interference

    else:  # unsupported backend for locking (eg sqlite), return default
        db_session = get_session()

    return db_session

def lock_tables(session, tables):
    """Write-lock tables for supported backends: MySQL and PostgreSQL"""
    session.begin(subtransactions=True)
    if is_mysql():  # Explicitly LOCK TABLES for MySQL
        session.execute('SET autocommit=0')
        for table in tables:
            session.execute('LOCK TABLES {} WRITE'.format(table))
    elif is_postgres():  # Explicitly LOCK TABLE for Postgres
        session.execute('BEGIN TRANSACTION')
        for table in tables:
            session.execute('LOCK TABLE {} IN EXCLUSIVE MODE'.format(table))

def commit_unlock_tables(session):
    """Commit and unlock tables for supported backends: MySQL and PostgreSQL"""
    session.commit()
    session.execute('COMMIT')  # execute COMMIT on DB backend
    # because sqlalchemy session does not guarantee
    # exact boundary correspondence to DB backend transactions
    # We must guarantee DB commits transaction before UNLOCK

    # unlock
    if is_mysql():
        session.execute('UNLOCK TABLES')
    # postgres automatically releases lock at transaction end

def is_mysql():
    """Return true if and only if database backend is mysql"""
    return (cfg.CONF.database.connection is not None and
            (cfg.CONF.database.connection.split(':/')[0] == 'mysql' or
             cfg.CONF.database.connection.split('+')[0] == 'mysql'))

def is_postgres():
    """Return true if and only if database backend is postgres"""
    return (cfg.CONF.database.connection is not None and
            (cfg.CONF.database.connection.split(':/')[0] == 'postgresql' or
             cfg.CONF.database.connection.split('+')[0] == 'postgresql'))

def is_sqlite():
    """Return true if and only if database backend is sqlite"""
    return (cfg.CONF.database.connection is not None and
            (cfg.CONF.database.connection.split(':/')[0] == 'sqlite' or
             cfg.CONF.database.connection.split('+')[0] == 'sqlite'))

redpajama_set_name: RedPajamaGithub


text:
class CreateIndividualsPermittedVendors < ActiveRecord::Migration
  def change
    create_table :individuals_permitted_vendors do |t|
      t.belongs_to :vendor, index: true
      t.belongs_to :individual, index: true
    end
  end
end


text:
<?php

namespace WellCommerce\Bundle\UnitBundle\DataFixtures\ORM;

use Doctrine\Common\Persistence\ObjectManager;
use WellCommerce\Bundle\CoreBundle\DataFixtures\AbstractDataFixture;
use WellCommerce\Bundle\UnitBundle\Entity\Unit;

/**
 * Class LoadUnitData
 *
 * @author  Adam Piotrowski <adam@wellcommerce.org>
 */
class LoadUnitData extends AbstractDataFixture
{
    public static $samples = ['pcs.', 'set'];

    /**
     * {@inheritDoc}
     */
    public function load(ObjectManager $manager)
    {
        if (!$this->isEnabled()) {
            return;
        }

        foreach (self::$samples as $name) {
            $unit = new Unit();
            foreach ($this->getLocales() as $locale) {
                $unit->translate($locale->getCode())->setName($name);
            }
            $unit->mergeNewTranslations();
            $manager->persist($unit);
            $this->setReference('unit_' . $name, $unit);
        }

        $manager->flush();
    }
}


text:
/*设置整个页面的视点*/

body {
    perspective: 2000;
    -ms-perspective: 2000;
    -moz-perspective: 2000;
    -webkit-perspective: 2000;
}

/*立方体样式*/

.cube {
    position: relative;
    font-size: 80px;
    margin: 100px 350px;
    transform-style: preserve-3d;
    -ms-transform-style: preserve-3d;
    -moz-transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transform: rotateX(-30deg) rotateY(30deg);
    -ms-transform: rotateX(-30deg) rotateY(30deg);
    -moz-transform: rotateX(-30deg) rotateY(30deg);
    -webkit-transform: rotateX(-30deg) rotateY(30deg);
    transform-origin: 90px 90px 0;
    -ms-transform-origin: 90px 90px 0;
    -moz-transform-origin: 90px 90px 0;
    -webkit-transform-origin: 90px 90px 0;
    animation: 5s rolling ease-in-out infinite;
    -ms-animation: 5s rolling ease-in-out infinite;
    -moz-animation: 5s rolling ease-in-out infinite;
    -webkit-animation: 5s rolling ease-in-out infinite;
}

/*旋转动画*/

@keyframes rolling {
    from,
    to {}
    16% {
        transform: rotateY(-90deg);
    }
    33% {
        transform: rotateY(-90deg) rotateZ(135deg);
    }
    50% {
        transform: rotateY(225deg) rotateZ(135deg);
    }
    66% {
        transform: rotateY(135deg) rotateX(135deg);
    }
    83% {
        transform: rotateX(135deg)
    }
}

@-moz-keyframes rolling {
    from,
    to {}
    16% {
        -moz-transform: rotateY(-90deg);
    }
    33% {
        -moz-transform: rotateY(-90deg) rotateZ(135deg);
    }
    50% {
        -moz-transform: rotateY(225deg) rotateZ(135deg);
    }
    66% {
        -moz-transform: rotateY(135deg) rotateX(135deg);
    }
    83% {
        -moz-transform: rotateX(135deg)
    }
}

@-webkit-keyframes rolling {
    from,
    to {}
    16% {
        -webkit-transform: rotateY(-90deg);
    }
    33% {
        -webkit-transform: rotateY(-90deg) rotateZ(135deg);
    }
    50% {
        -webkit-transform: rotateY(225deg) rotateZ(135deg);
    }
    66% {
        -webkit-transform: rotateY(135deg) rotateX(135deg);
    }
    83% {
        -webkit-transform: rotateX(135deg)
    }
}

/*立方体下所有div的样式*/

.cube > div {
    position: absolute;
    width: 180px;
    height: 180px;
    border: 1px solid #000;
    line-height: 180px;
}

/*立方体前面*/

.front {
    transform: translateZ(90px);
    -ms-transform: translateZ(90px);
    -moz-transform: translateZ(90px);
    -webkit-transform: translateZ(90px);
    /*设置方格线*/
    background: linear-gradient(top, transparent 59px, #000 60px), linear-gradient(left, #f00 59px, #000 60px);
    background: -ms-linear-gradient(top, transparent 59px, #000 60px), -ms-linear-gradient(left, #f00 59px, #000 60px);
    background: -moz-linear-gradient(top, transparent 59px, #000 60px), -moz-linear-gradient(left, #f00 59px, #000 60px);
    background: -webkit-linear-gradient(top, transparent 59px, #000 60px), -webkit-linear-gradient(left, #f00 59px, #000 60px);
    background-size: 60px 60px;
}

/*立方体后面*/

.back {
    transform: translateZ(-90px) rotateY(-180deg);
    -ms-transform: translateZ(-90px) rotateY(-180deg);
    -moz-transform: translateZ(-90px) rotateY(-180deg);
    -webkit-transform: translateZ(-90px) rotateY(-180deg);
    /*设置方格线*/
    background: linear-gradient(top, transparent 59px, #000 60px), linear-gradient(left, #ff0 59px, #000 60px);
    background: -ms-linear-gradient(top, transparent 59px, #000 60px), -ms-linear-gradient(left, #ff0 59px, #000 60px);
    background: -moz-linear-gradient(top, transparent 59px, #000 60px), -moz-linear-gradient(left, #ff0 59px, #000 60px);
    background: -webkit-linear-gradient(top, transparent 59px, #000 60px), -webkit-linear-gradient(left, #ff0 59px, #000 60px);
    background-size: 60px 60px;
}

/*立方体左面*/

.left {
    transform: translateX(-90px)rotateY(-90deg);
    -ms-transform: translateX(-90px)rotateY(-90deg);
    -moz-transform: translateX(-90px)rotateY(-90deg);
    -webkit-transform: translateX(-90px)rotateY(-90deg);
    /*设置方格线*/
    background: linear-gradient(top, transparent 59px, #000 60px), linear-gradient(left, #fb0 59px, #000 60px);
    background: -ms-linear-gradient(top, transparent 59px, #000 60px), -ms-linear-gradient(left, #fb0 59px, #000 60px);
    background: -moz-linear-gradient(top, transparent 59px, #000 60px), -moz-linear-gradient(left, #fb0 59px, #000 60px);
    background: -webkit-linear-gradient(top, transparent 59px, #000 60px), -webkit-linear-gradient(left, #fb0 59px, #000 60px);
    background-size: 60px 60px;
}

/*立方体右面*/

.right {
    transform: translateX(90px)rotateY(90deg);
    -ms-transform: translateX(90px)rotateY(90deg);
    -moz-transform: translateX(90px)rotateY(90deg);
    -webkit-transform: translateX(90px)rotateY(90deg);
    /*设置方格线*/
    background: linear-gradient(top, transparent 59px, #000 60px), linear-gradient(left, #0f0 59px, #000 60px);
    background: -ms-linear-gradient(top, transparent 59px, #000 60px), -ms-linear-gradient(left, #0f0 59px, #000 60px);
    background: -moz-linear-gradient(top, transparent 59px, #000 60px), -moz-linear-gradient(left, #0f0 59px, #000 60px);
    background: -webkit-linear-gradient(top, transparent 59px, #000 60px), -webkit-linear-gradient(left, #0f0 59px, #000 60px);
    background-size: 60px 60px;
}

/*立方体上面*/

.top {
    transform: translateY(-90px)rotateX(90deg);
    -ms-transform: translateY(-90px)rotateX(90deg);
    -moz-transform: translateY(-90px)rotateX(90deg);
    -webkit-transform: translateY(-90px)rotateX(90deg);
    /*设置方格线*/
    background: linear-gradient(top, transparent 59px, #000 60px), linear-gradient(left, #00f 59px, #000 60px);
    background: -ms-linear-gradient(top, transparent 59px, #000 60px), -ms-linear-gradient(left, #00f 59px, #000 60px);
    background: -moz-linear-gradient(top, transparent 59px, #000 60px), -moz-linear-gradient(left, #00f 59px, #000 60px);
    background: -webkit-linear-gradient(top, transparent 59px, #000 60px), -webkit-linear-gradient(left, #00f 59px, #000 60px);
    background-size: 60px 60px;
}

/*立方体下面*/

.bottom {
    transform: translateY(90px)rotateX(-90deg);
    -ms-transform: translateY(90px)rotateX(-90deg);
    -moz-transform: translateY(90px)rotateX(-90deg);
    -webkit-transform: translateY(90px)rotateX(-90deg);
    /*设置方格线*/
    background: linear-gradient(top, transparent 59px, #000 60px), linear-gradient(left, #fff 59px, #000 60px);
    background: -ms-linear-gradient(top, transparent 59px, #000 60px), -ms-linear-gradient(left, #fff 59px, #000 60px);
    background: -moz-linear-gradient(top, transparent 59px, #000 60px), -moz-linear-gradient(left, #fff 59px, #000 60px);
    background: -webkit-linear-gradient(top, transparent 59px, #000 60px), -webkit-linear-gradient(left, #fff 59px, #000 60px);
    background-size: 60px 60px;
}


text:
#if ! defined(EPPRESPONSEDATACREATEHOST_HPP)    /* { */
#define       EPPRESPONSEDATACREATEHOST_HPP        1

#include "EppResponseDataCreate.hpp"

/**
 * This EppResponseDataCreateHost class implements EPP
 * Response Data entity for EPP Command Create of EPP Contact objects.
 *
 * @author Ning Zhang ning.zhang@neustar.com
 * @version $Revision: 1.1 $ $Date: 2005/12/06 20:11:35 $
 */
class EPP_EXPORT EppResponseDataCreateHost : public EppResponseDataCreate
{
private:
	DOMString name;

public:
	/**
	 * Creates an EppResponseDataCreateHost object
	 */
	EppResponseDataCreateHost()
	{
		this->name = null;
		this->roid = null;
	};

	/**
	 * Creates an EppResponseDataCreateHost object
	 *
	 * @param name the name of the EppHost object created
	 */
	EppResponseDataCreateHost( DOMString name )
	{
		this->name = name;
		this->roid = null;
	};

	/**
	 * Creates an EppResponseDataCreateHost object
	 *
	 * @param name the name of the EppHost object created
	 * @param roid the ROID of the EppHost object created
	 *
	 * @deprecated for EPP-04 (06/29/2001)
	 */
	EppResponseDataCreateHost( DOMString name, DOMString roid )
	{
		this->name = name;
		this->roid = roid;
	};

	/**
	 * Destructor
	 */
	~EppResponseDataCreateHost() {};

	/**
	 * Returns the run-time type of an EppEntity object
	 */
	virtual int getEntityType()
	{
		return EppEntity::TYPE_EppResponseDataCreateHost;
	};

	/**
	 * Gets the name of the host created
	 */
	DOMString getName()
	{
		return this->name;
	};

	/**
	 * Sets the name of the host created
	 */
	void setName( DOMString name )
	{
		this->name = name;
	};

	/**
	 * Converts an XML element into an
	 * EppResponseDataCreateHost object. The caller of this
	 * method must make sure that the root node is the resData element of
	 * EPP responseType for creating an EPP Host object
	 *
	 * @param root root node for an EppResponseDataCreateHost
	 *             object in XML format
	 *
	 * @return an EppResponseDataCreateHost object,
	 *         or null if the node is invalid
	 */
	static EppResponseDataCreateHost * fromXML( const DOM_Node& root );

	/**
	 * Converts an EppResponseDataCreateHost object
	 * into an XML element.
	 *
	 * @param doc the XML DOM_Element object
	 * @param tag the tag/element name for the
	 *        EppResponseDataCreateHost object
	 *
	 * @return an DOM_Element object
	 */
	DOM_Element toXML( DOM_Document& doc, const DOMString& tag );
};

#endif     /* EPPRESPONSEDATACREATEHOST_HPP */  /* } */


text:
package com.google.cloud.vmmigration.v1.samples;

// [START vmmigration_v1_generated_VmMigration_CreateCloneJob_LRO_async]
import com.google.api.gax.longrunning.OperationFuture;
import com.google.cloud.vmmigration.v1.CloneJob;
import com.google.cloud.vmmigration.v1.CreateCloneJobRequest;
import com.google.cloud.vmmigration.v1.MigratingVmName;
import com.google.cloud.vmmigration.v1.OperationMetadata;
import com.google.cloud.vmmigration.v1.VmMigrationClient;

public class AsyncCreateCloneJobLRO {

  public static void main(String[] args) throws Exception {
    asyncCreateCloneJobLRO();
  }

  public static void asyncCreateCloneJobLRO() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
      CreateCloneJobRequest request =
          CreateCloneJobRequest.newBuilder()
              .setParent(
                  MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
                      .toString())
              .setCloneJobId("cloneJobId2071309915")
              .setCloneJob(CloneJob.newBuilder().build())
              .setRequestId("requestId693933066")
              .build();
      OperationFuture<CloneJob, OperationMetadata> future =
          vmMigrationClient.createCloneJobOperationCallable().futureCall(request);
      // Do something.
      CloneJob response = future.get();
    }
  }
}
// [END vmmigration_v1_generated_VmMigration_CreateCloneJob_LRO_async]


text:
package me.coley.bmf.insn.impl;

import me.coley.bmf.insn.Instruction;
import me.coley.bmf.insn.OpType;

public class INEG extends Instruction {
    public INEG() {
        super(OpType.MATH, Instruction.INEG, 1);
    }
}


text:
package main

import (
	"flag"
	"fmt"
	"github.com/ant0ine/go-json-rest/rest"
	"github.com/crunchydata/crunchy-postgresql-manager/cpmserverapi"
	"github.com/crunchydata/crunchy-postgresql-manager/logit"
	"log"
	"net/http"
)

func init() {
	fmt.Println("before parsing in init")
	flag.Parse()
}

var CPMDIR = "/var/cpm/"
var CPMBIN = CPMDIR + "bin/"

func main() {

	logit.Info.Println("serveragent starting")

	api := rest.NewApi()
	api.Use(rest.DefaultDevStack...)
	router, err := rest.MakeRouter(
		&rest.Route{"POST", "/metrics/iostat", cpmserverapi.MetricIostat},
		&rest.Route{"POST", "/metrics/df", cpmserverapi.MetricDf},
		&rest.Route{"POST", "/metrics/mem", cpmserverapi.MetricMEM},
		&rest.Route{"POST", "/metrics/cpu", cpmserverapi.MetricCPU},
		&rest.Route{"POST", "/disk/provision", cpmserverapi.DiskProvision},
		&rest.Route{"POST", "/disk/delete", cpmserverapi.DiskDelete},
		&rest.Route{"GET", "/status", cpmserverapi.Status},
	)
	if err != nil {
		log.Fatal(err)
	}
	api.SetApp(router)
	log.Fatal(http.ListenAndServe(":10001", api.MakeHandler()))
	log.Fatal(http.ListenAndServeTLS(":10000", "/var/cpm/keys/cert.pem", "/var/cpm/keys/key.pem", api.MakeHandler()))
}


text:
package org.jetbrains.idea.svn;

import static com.intellij.openapi.util.io.FileUtil.delete;
import static com.intellij.openapi.util.io.FileUtil.ensureExists;
import static com.intellij.openapi.util.io.FileUtil.writeToFile;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.empty;
import static org.junit.Assert.assertThat;

import com.intellij.openapi.diff.impl.patch.FilePatch;
import com.intellij.openapi.diff.impl.patch.PatchReader;
import com.intellij.openapi.diff.impl.patch.PatchSyntaxException;
import com.intellij.openapi.diff.impl.patch.TextFilePatch;
import com.intellij.openapi.diff.impl.patch.formove.PatchApplier;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileVisitor;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.idea.svn.info.Info;
import org.jetbrains.idea.svn.status.StatusType;

// TODO Seems we could just apply corresponding patches with "svn patch" without custom code
public class ConflictCreator {
  private final SvnVcs myVcs;
  private final VirtualFile myTheirsDir;
  private final VirtualFile myMineDir;
  private final TreeConflictData.Data myData;
  private final SvnClientRunner myClientRunner;

  public ConflictCreator(SvnVcs vcs,
                         VirtualFile dir,
                         VirtualFile mineDir,
                         TreeConflictData.Data data,
                         final SvnClientRunner clientRunner) {
    myVcs = vcs;
    myTheirsDir = dir;
    myMineDir = mineDir;
    myData = data;
    myClientRunner = clientRunner;
  }

  public void create() throws PatchSyntaxException, IOException {
    for (TreeConflictData.FileData data : myData.getLeftFiles()) {
      applyFileData(myMineDir, data);
    }

    final List<TextFilePatch> patches = new PatchReader(myData.getTheirsPatch()).readTextPatches();
    final List<FilePatch> filePatchList = new ArrayList<>(patches);
    for (Iterator<FilePatch> iterator = filePatchList.iterator(); iterator.hasNext(); ) {
      final FilePatch patch = iterator.next();
      if (patch.isDeletedFile()) {
        myClientRunner.delete(myTheirsDir, patch.getBeforeName());
        iterator.remove();
      }
    }

    if (!filePatchList.isEmpty()) {
      PatchApplier applier = new PatchApplier(myVcs.getProject(), myTheirsDir, filePatchList, null, null);
      applier.setIgnoreContentRootsCheck();
      applier.execute();
      assertThat(applier.getRemainingPatches(), is(empty()));
    }

    for (TextFilePatch patch : patches) {
      if (patch.isNewFile() || !Objects.equals(patch.getAfterName(), patch.getBeforeName())) {
        String subPath = "";
        for (String part : patch.getAfterName().split("/")) {
          final String path = subPath + part;
          Info info = myVcs.getInfo(new File(myTheirsDir.getPath(), path));
          if (info == null || info.getUrl() == null) {
            myClientRunner.add(myTheirsDir, path);
          }
          subPath = path + "/";
        }
        if (!patch.isNewFile()) {
          myClientRunner.delete(myTheirsDir, patch.getBeforeName());
        }
      }
    }

    VfsUtilCore.visitChildrenRecursively(myTheirsDir, new VirtualFileVisitor<Void>() {
      @NotNull
      @Override
      public Result visitFileEx(@NotNull VirtualFile file) {
        if (!myTheirsDir.equals(file) && file.isDirectory() && file.getChildren().length == 0) {
          try {
            myClientRunner.delete(myTheirsDir, file.getPath());
          }
          catch (IOException e) {
            throw new VisitorException(e);
          }
        }
        return file.isDirectory() && SvnUtil.isAdminDirectory(file) ? SKIP_CHILDREN : CONTINUE;
      }
    }, IOException.class);

    // this will commit all patch changes
    myClientRunner.checkin(myTheirsDir);
    // this will create the conflict
    myClientRunner.update(myMineDir);
    myClientRunner.update(myTheirsDir);
  }

  private void applyFileData(final VirtualFile root, final TreeConflictData.FileData fileData) throws IOException {
    final File target = new File(root.getPath(), fileData.myRelativePath);

    // we don't apply property changes for now
    if (StatusType.STATUS_MISSING.equals(fileData.myNodeStatus)) {
      delete(target);
    }
    else if (StatusType.STATUS_UNVERSIONED.equals(fileData.myNodeStatus)) {
      createFile(fileData, target);
    }
    else if (StatusType.STATUS_ADDED.equals(fileData.myNodeStatus)) {
      if (fileData.myCopyFrom != null) {
        myClientRunner.copy(root, fileData.myCopyFrom, fileData.myRelativePath);
      }
      else {
        createFile(fileData, target);
        myClientRunner.add(root, fileData.myRelativePath);
      }
    }
    else if (StatusType.STATUS_DELETED.equals(fileData.myNodeStatus)) {
      myClientRunner.delete(root, fileData.myRelativePath);
    }
    else if (StatusType.STATUS_NORMAL.equals(fileData.myNodeStatus) && StatusType.STATUS_MODIFIED.equals(fileData.myContentsStatus)) {
      createFile(fileData, target);
    }
  }

  private static void createFile(final TreeConflictData.FileData fileData, File target) throws IOException {
    if (fileData.myIsDir) {
      ensureExists(target);
    } else {
      writeToFile(target, fileData.myContents);
    }
  }
}


text:
History
-------

0.7.0
+++++

- Introduced the [RESPONSE_HEADER Setting in #15](https://github.com/bradmontgomery/django-querycount/pull/15). Thanks @LifeCoder45!

0.6.0
+++++

- Fixed Issue #14 so that running tests doesn't result in ``AttributeError: 'QueryCountMiddleware' object has no attribute 'get_response'``.
- Removed the `test_app` and replaced existing tests with very simple smoke tests.

0.5.0
+++++

- Added support for Django 1.10 Middleware.

0.4.2
+++++

- Fixed an issue that may cause an exception if we got a `None` value for the sql query.

0.4.1
+++++

- Fixed an issue where previous request's queries didn't get reset.
- Minor output formatting

0.4.0
+++++

- Included a count for duplicate sql queries. (`issue #7 <https://github.com/bradmontgomery/django-querycount/issues/7>`_)
- Included a new setting option, ``DISPLAY_DUPLICATES`` to control how many
  duplicate queries are printed in the shell.

0.3.0
+++++

- Added `IGNORE_SQL_PATTERNS`. `PR #6 <https://github.com/bradmontgomery/django-querycount/pull/6>`_. Thanks @GitFree
- Changed `IGNORE_PATTERNS` setting to `IGNORE_REQUEST_PATTERNS` (but still
  support the old setting)

0.2.0
+++++

- Added an `IGNORE_PATTERNS` setting and ability to ignore certain http requests.
- Slight project reorganization.

0.1.1
+++++

- Minor update to dynamically put version number in setup.py

0.1.0
+++++

- Added "elapsed" and "query count" log thresholds. `PR #4 <https://github.com/bradmontgomery/django-querycount/pull/4>`_. Thanks @alonisser

0.0.0
+++++

- Initial version. Huge thanks to @mrrrgn for making this look like a real project.


text:
<?php

namespace Nemundo\Admin\Com\Card;

use Nemundo\Html\Block\Div;

class AdminCardContainer extends Div
{

    public function getContent()
    {

        $this->addCssClass('admin-card-container');

        return parent::getContent(); // TODO: Change the autogenerated stub
    }

}


text:
from .exceptions import ClientException, SnapshotException
from . import debug, cache
from .region import Region

class Snapshot:
    """Manage operations related to Droplet snapshots"""

    def __init__(self, render):
        self.render = render
        self.region = Region(self.render)

    def __unique__(self, name):
        entries = self.list()
        if len(set(i.name for i in entries)) != len(entries):
            return False
        return True

    @debug
    def list(self):
        """List snapshots"""
        return self.render('images', '/images', params={
            'filter': 'my_images'
        })

    def show(self, name):
        """Show details for a single snapshot"""
        id = self.id_from_name(name)
        return self.render('image', '/images/%s' % id)

    @debug
    def transfer(self, name, region):
        id = self.id_from_name(name)
        region_id = self.region.id_from_name(region)

        try:
            return self.render('event_id', '/images/%s/transfer' % id, params={
                'region_id': region_id
            })
        except ClientException as e:
            raise ImageException(str(e))

    @debug
    def id_from_name(self, name):
        """Translate snapshot name into ID"""
        if not self.__unique__(name):
            raise SnapshotException("More than one snapshot matches %s" % name)
        res = next((
            r.id for r in self.list() if r.name.lower() == name.lower()),
            None)
        if res:
            return res
        raise SnapshotException('No snapshot called %s' % name)

    @debug
    def destroy(self, name):
        """Destroy snapshot"""
        try:
            id = self.id_from_name(name)
            return self.render('status', '/images/%s/destroy' % id)
        except ClientException as e:
            raise SnapshotException(str(e))


text:
// Configuration for browserify task(s)
// Compiles JavaScript into single bundle file
'use strict';

var taskConfig = function(grunt) {

  grunt.config.set('browserify', {
    server: {
      options: {
        transform:  [ require('grunt-react').browserify ],
        browserifyOptions: {
          debug: true
        },
        watch: true
      },
      files: {
        '<%= yeogurt.tmp %>/scripts/main.js': ['<%= yeogurt.client %>/scripts/main.js']
      }
    },
    dist: {
      options: {
        transform:  [ require('grunt-react').browserify ],
        browserifyOptions: {
          debug: true
        },
        preBundleCB: function(b) {
          // Minify code
          return b.plugin('minifyify', {
            map: 'main.js.map',
            output: 'dist/client/scripts/main.js.map'
          });
        }
      },
      files: {
        '<%= yeogurt.dist %>/client/scripts/main.js': ['<%= yeogurt.client %>/scripts/main.js']
      }
    },
    test: {
      options: {
        transform:  [ require('grunt-react').browserify ],
        browserifyOptions: {
          debug: true
        },
        watch: true
      },
      files: {
        'test/scripts/bundle.js': ['test/spec/**/*.spec.js']
      }
    }
  });

};

module.exports = taskConfig;


text:
package org.apache.drill.exec.work.batch;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.concurrent.TimeUnit;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

import com.google.common.base.Stopwatch;

public class FileTest {
  public static void main(String[] args) throws IOException {
    Configuration conf = new Configuration();
    conf.set(FileSystem.FS_DEFAULT_NAME_KEY, "sync:///");
    System.out.println(FileSystem.getDefaultUri(conf));
    FileSystem fs = FileSystem.get(conf);
//    FileSystem fs = new LocalSyncableFileSystem(conf);
    Path path = new Path("/tmp/testFile");
    FSDataOutputStream out = fs.create(path);
    byte[] s = "hello world".getBytes();
    out.write(s);
    out.sync();
//    out.close();
    FSDataInputStream in = fs.open(path);
    byte[] bytes = new byte[s.length];
    in.read(bytes);
    System.out.println(new String(bytes));
    File file = new File("/tmp/testFile");
    FileOutputStream fos = new FileOutputStream(file);
    FileInputStream fis = new FileInputStream(file);
    fos.write(s);
    fos.getFD().sync();
    fis.read(bytes);
    System.out.println(new String(bytes));
    out = fs.create(new Path("/tmp/file"));
    for (int i = 0; i < 100; i++) {
      bytes = new byte[256*1024];
      Stopwatch watch = new Stopwatch();
      watch.start();
      out.write(bytes);
      out.sync();
      long t = watch.elapsed(TimeUnit.MILLISECONDS);
      System.out.printf("Elapsed: %d. Rate %d.\n", t, (long) ((long) bytes.length * 1000L / t));
    }
  }
}


text:
package com.amazonaws.services.snowball.model;

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ListClusterJobsRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * The 39-character ID for the cluster that you want to list, for example
     * CID123e4567-e89b-12d3-a456-426655440000.
     *

     */
    private String clusterId;
    /**
     *

     * The number of JobListEntry objects to return.
     *

     */
    private Integer maxResults;
    /**
     *

     * HTTP requests are stateless. To identify what object comes "next" in the list of JobListEntry
     * objects, you have the option of specifying NextToken as the starting point for your returned list.
     *

     */
    private String nextToken;

    /**
     *

     * The 39-character ID for the cluster that you want to list, for example
     * CID123e4567-e89b-12d3-a456-426655440000.
     *

     *
     * @param clusterId
     *        The 39-character ID for the cluster that you want to list, for example
     *        CID123e4567-e89b-12d3-a456-426655440000.
     */

    public void setClusterId(String clusterId) {
        this.clusterId = clusterId;
    }

    /**
     *

     * The 39-character ID for the cluster that you want to list, for example
     * CID123e4567-e89b-12d3-a456-426655440000.
     *

     *
     * @return The 39-character ID for the cluster that you want to list, for example
     *         CID123e4567-e89b-12d3-a456-426655440000.
     */

    public String getClusterId() {
        return this.clusterId;
    }

    /**
     *

     * The 39-character ID for the cluster that you want to list, for example
     * CID123e4567-e89b-12d3-a456-426655440000.
     *

     *
     * @param clusterId
     *        The 39-character ID for the cluster that you want to list, for example
     *        CID123e4567-e89b-12d3-a456-426655440000.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListClusterJobsRequest withClusterId(String clusterId) {
        setClusterId(clusterId);
        return this;
    }

    /**
     *

     * The number of JobListEntry objects to return.
     *

     *
     * @param maxResults
     *        The number of JobListEntry objects to return.
     */

    public void setMaxResults(Integer maxResults) {
        this.maxResults = maxResults;
    }

    /**
     *

     * The number of JobListEntry objects to return.
     *

     *
     * @return The number of JobListEntry objects to return.
     */

    public Integer getMaxResults() {
        return this.maxResults;
    }

    /**
     *

     * The number of JobListEntry objects to return.
     *

     *
     * @param maxResults
     *        The number of JobListEntry objects to return.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListClusterJobsRequest withMaxResults(Integer maxResults) {
        setMaxResults(maxResults);
        return this;
    }

    /**
     *

     * HTTP requests are stateless. To identify what object comes "next" in the list of JobListEntry
     * objects, you have the option of specifying NextToken as the starting point for your returned list.
     *

     *
     * @param nextToken
     *        HTTP requests are stateless. To identify what object comes "next" in the list of JobListEntry
     *        objects, you have the option of specifying NextToken as the starting point for your returned
     *        list.
     */

    public void setNextToken(String nextToken) {
        this.nextToken = nextToken;
    }

    /**
     *

     * HTTP requests are stateless. To identify what object comes "next" in the list of JobListEntry
     * objects, you have the option of specifying NextToken as the starting point for your returned list.
     *

     *
     * @return HTTP requests are stateless. To identify what object comes "next" in the list of
     *         JobListEntry objects, you have the option of specifying NextToken as the
     *         starting point for your returned list.
     */

    public String getNextToken() {
        return this.nextToken;
    }

    /**
     *

     * HTTP requests are stateless. To identify what object comes "next" in the list of JobListEntry
     * objects, you have the option of specifying NextToken as the starting point for your returned list.
     *

     *
     * @param nextToken
     *        HTTP requests are stateless. To identify what object comes "next" in the list of JobListEntry
     *        objects, you have the option of specifying NextToken as the starting point for your returned
     *        list.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListClusterJobsRequest withNextToken(String nextToken) {
        setNextToken(nextToken);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getClusterId() != null)
            sb.append("ClusterId: ").append(getClusterId()).append(",");
        if (getMaxResults() != null)
            sb.append("MaxResults: ").append(getMaxResults()).append(",");
        if (getNextToken() != null)
            sb.append("NextToken: ").append(getNextToken());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof ListClusterJobsRequest == false)
            return false;
        ListClusterJobsRequest other = (ListClusterJobsRequest) obj;
        if (other.getClusterId() == null ^ this.getClusterId() == null)
            return false;
        if (other.getClusterId() != null && other.getClusterId().equals(this.getClusterId()) == false)
            return false;
        if (other.getMaxResults() == null ^ this.getMaxResults() == null)
            return false;
        if (other.getMaxResults() != null && other.getMaxResults().equals(this.getMaxResults()) == false)
            return false;
        if (other.getNextToken() == null ^ this.getNextToken() == null)
            return false;
        if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getClusterId() == null) ? 0 : getClusterId().hashCode());
        hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode());
        hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
        return hashCode;
    }

    @Override
    public ListClusterJobsRequest clone() {
        return (ListClusterJobsRequest) super.clone();
    }

}


text:
<?php
namespace app\admin\controller;

use houdunwang\core\Controller;
use houdunwang\view\View;
use system\model\Grade as banji;
class Entry extends Common
{
    public function index()
    {

//        echo '我是后台entry控制器的index方法';
        return View::make();
    }

}


text:
package com.google.android.exoplayer2.ext.ffmpeg;

import android.os.Handler;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.audio.AudioProcessor;
import com.google.android.exoplayer2.audio.AudioRendererEventListener;
import com.google.android.exoplayer2.audio.AudioSink;
import com.google.android.exoplayer2.audio.DefaultAudioSink;
import com.google.android.exoplayer2.audio.SimpleDecoderAudioRenderer;
import com.google.android.exoplayer2.drm.DrmSessionManager;
import com.google.android.exoplayer2.drm.ExoMediaCrypto;
import com.google.android.exoplayer2.util.Assertions;
import com.google.android.exoplayer2.util.MimeTypes;
import java.util.Collections;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;

/**
 * Decodes and renders audio using FFmpeg.
 */
public final class FfmpegAudioRenderer extends SimpleDecoderAudioRenderer {

  /** The number of input and output buffers. */
  private static final int NUM_BUFFERS = 16;
  /** The default input buffer size. */
  private static final int DEFAULT_INPUT_BUFFER_SIZE = 960 * 6;

  private final boolean enableFloatOutput;

  private @MonotonicNonNull FfmpegDecoder decoder;

  public FfmpegAudioRenderer() {
    this(/* eventHandler= */ null, /* eventListener= */ null);
  }

  /**
   * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
   *     null if delivery of events is not required.
   * @param eventListener A listener of events. May be null if delivery of events is not required.
   * @param audioProcessors Optional {@link AudioProcessor}s that will process audio before output.
   */
  public FfmpegAudioRenderer(
      @Nullable Handler eventHandler,
      @Nullable AudioRendererEventListener eventListener,
      AudioProcessor... audioProcessors) {
    this(
        eventHandler,
        eventListener,
        new DefaultAudioSink(/* audioCapabilities= */ null, audioProcessors),
        /* enableFloatOutput= */ false);
  }

  /**
   * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
   *     null if delivery of events is not required.
   * @param eventListener A listener of events. May be null if delivery of events is not required.
   * @param audioSink The sink to which audio will be output.
   * @param enableFloatOutput Whether to enable 32-bit float audio format, if supported on the
   *     device/build and if the input format may have bit depth higher than 16-bit. When using
   *     32-bit float output, any audio processing will be disabled, including playback speed/pitch
   *     adjustment.
   */
  public FfmpegAudioRenderer(
      @Nullable Handler eventHandler,
      @Nullable AudioRendererEventListener eventListener,
      AudioSink audioSink,
      boolean enableFloatOutput) {
    super(
        eventHandler,
        eventListener,
        /* drmSessionManager= */ null,
        /* playClearSamplesWithoutKeys= */ false,
        audioSink);
    this.enableFloatOutput = enableFloatOutput;
  }

  @Override
  protected int supportsFormatInternal(DrmSessionManager<ExoMediaCrypto> drmSessionManager,
      Format format) {
    Assertions.checkNotNull(format.sampleMimeType);
    if (!FfmpegLibrary.isAvailable()) {
      return FORMAT_UNSUPPORTED_TYPE;
    } else if (!FfmpegLibrary.supportsFormat(format.sampleMimeType, format.pcmEncoding)
        || !isOutputSupported(format)) {
      return FORMAT_UNSUPPORTED_SUBTYPE;
    } else if (!supportsFormatDrm(drmSessionManager, format.drmInitData)) {
      return FORMAT_UNSUPPORTED_DRM;
    } else {
      return FORMAT_HANDLED;
    }
  }

  @Override
  public final int supportsMixedMimeTypeAdaptation() throws ExoPlaybackException {
    return ADAPTIVE_NOT_SEAMLESS;
  }

  @Override
  protected FfmpegDecoder createDecoder(Format format, ExoMediaCrypto mediaCrypto)
      throws FfmpegDecoderException {
    int initialInputBufferSize =
        format.maxInputSize != Format.NO_VALUE ? format.maxInputSize : DEFAULT_INPUT_BUFFER_SIZE;
    decoder =
        new FfmpegDecoder(
            NUM_BUFFERS, NUM_BUFFERS, initialInputBufferSize, format, shouldUseFloatOutput(format));
    return decoder;
  }

  @Override
  public Format getOutputFormat() {
    Assertions.checkNotNull(decoder);
    int channelCount = decoder.getChannelCount();
    int sampleRate = decoder.getSampleRate();
    @C.PcmEncoding int encoding = decoder.getEncoding();
    return Format.createAudioSampleFormat(
        /* id= */ null,
        MimeTypes.AUDIO_RAW,
        /* codecs= */ null,
        Format.NO_VALUE,
        Format.NO_VALUE,
        channelCount,
        sampleRate,
        encoding,
        Collections.emptyList(),
        /* drmInitData= */ null,
        /* selectionFlags= */ 0,
        /* language= */ null);
  }

  private boolean isOutputSupported(Format inputFormat) {
    return shouldUseFloatOutput(inputFormat)
        || supportsOutput(inputFormat.channelCount, C.ENCODING_PCM_16BIT);
  }

  private boolean shouldUseFloatOutput(Format inputFormat) {
    Assertions.checkNotNull(inputFormat.sampleMimeType);
    if (!enableFloatOutput || !supportsOutput(inputFormat.channelCount, C.ENCODING_PCM_FLOAT)) {
      return false;
    }
    switch (inputFormat.sampleMimeType) {
      case MimeTypes.AUDIO_RAW:
        // For raw audio, output in 32-bit float encoding if the bit depth is > 16-bit.
        return inputFormat.pcmEncoding == C.ENCODING_PCM_24BIT
            || inputFormat.pcmEncoding == C.ENCODING_PCM_32BIT
            || inputFormat.pcmEncoding == C.ENCODING_PCM_FLOAT;
      case MimeTypes.AUDIO_AC3:
        // AC-3 is always 16-bit, so there is no point outputting in 32-bit float encoding.
        return false;
      default:
        // For all other formats, assume that it's worth using 32-bit float encoding.
        return true;
    }
  }

}


text:
require 'puppet'
require 'puppet/type/neutron_config'

describe 'Puppet::Type.type(:neutron_config)' do

  before :each do
    @neutron_config = Puppet::Type.type(:neutron_config).new(:name => 'DEFAULT/foo', :value => 'bar')
  end

  it 'should require a name' do
    expect {
      Puppet::Type.type(:neutron_config).new({})
    }.to raise_error(Puppet::Error, 'Title or name must be provided')
  end

  it 'should not expect a name with whitespace' do
    expect {
      Puppet::Type.type(:neutron_config).new(:name => 'f oo')
    }.to raise_error(Puppet::Error, /Parameter name failed/)
  end

  it 'should fail when there is no section' do
    expect {
      Puppet::Type.type(:neutron_config).new(:name => 'foo')
    }.to raise_error(Puppet::Error, /Parameter name failed/)
  end

  it 'should not require a value when ensure is absent' do
    Puppet::Type.type(:neutron_config).new(:name => 'DEFAULT/foo', :ensure => :absent)
  end

  it 'should accept a valid value' do
    @neutron_config[:value] = 'bar'
    expect(@neutron_config[:value]).to eq(['bar'])
  end

  it 'should accept a value with whitespace' do
    @neutron_config[:value] = 'b ar'
    expect(@neutron_config[:value]).to eq(['b ar'])
  end

  it 'should accept valid ensure values' do
    @neutron_config[:ensure] = :present
    expect(@neutron_config[:ensure]).to eq(:present)
    @neutron_config[:ensure] = :absent
    expect(@neutron_config[:ensure]).to eq(:absent)
  end

  it 'should not accept invalid ensure values' do
    expect {
      @neutron_config[:ensure] = :latest
    }.to raise_error(Puppet::Error, /Invalid value/)
  end

  it 'should autorequire the package that install the file' do
    catalog = Puppet::Resource::Catalog.new
    anchor = Puppet::Type.type(:anchor).new(:name => 'neutron::install::end')
    catalog.add_resource anchor, @neutron_config
    dependency = @neutron_config.autorequire
    expect(dependency.size).to eq(1)
    expect(dependency[0].target).to eq(@neutron_config)
    expect(dependency[0].source).to eq(anchor)
  end

end