text:
using System;
using System.Threading;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Storage;

using JigLibX.Physics;
using JigLibX.Collision;
using JigLibX.Geometry;
using JigLibX.Math;
using JigLibX.Utils;
using JigLibX.Vehicles;
using System.Diagnostics;
using OurCityEngine.Screens;
using OurCityEngine.PhysicObjects;
using OurCityEngine.Cameras;
using OurCityEngine.Debug;
using OurCityEngine.Utils;
using OurCityEngine.AI;
using OurCityEngine.Waypoints;
using OurCity.Effects;
using OurCityEngine.Layers;
#endregion

namespace OurCity.Screens
{
    /// <summary>
    /// This screen implements the actual game logic.
    ///
    /// </summary>
    public class ConceptGameScreen : GameScreen, IGameComponent
    {
        #region Fields
        protected PhysicsSystem physicSystem;

        Model islandModel, camaroModel, wheelModel, waypointModel;

        TriangleMeshObject island;
        CarObject carObject;

        ChaseCamera chaseCamera;
        Layer buildings;

        ContentManager content;

        HudOverlay hud;

        Debug debug;

        List<DrawableGameComponent> components;

        TrafficManager trafficManager;

        Water water;
        SkyDome sky;

        public Camera Camera { get { return CameraManager.Instance.Cameras["Default"]; } }
        public List<DrawableGameComponent> Components { get { return components; } }
        OurCityEngine.Debug.DebugDrawer DebugDrawer { get; set; }

        WaypointManager wpManager;
        DummyWaypointHandler wpHandler;
        #endregion

        #region Initialization
        /// <summary>
        /// Constructor.
        /// </summary>
        public ConceptGameScreen()
        {
            TransitionOnTime = TimeSpan.FromSeconds(1.5);
            TransitionOffTime = TimeSpan.FromSeconds(0.5);
            components = new List<DrawableGameComponent>();
        }

        public void Initialize()
        {
            physicSystem = new PhysicsSystem();
            physicSystem.CollisionSystem = new CollisionSystemSAP();

            #region Camera
            //camera
            chaseCamera = new ChaseCamera(ScreenManager.Game);
            if (!CameraManager.Instance.Cameras.ContainsKey("Chase"))
                CameraManager.Instance.Cameras.Add("Chase", chaseCamera);
            else
                CameraManager.Instance.Cameras["Chase"] = chaseCamera;

            CameraManager.Instance.SetDefault("Chase");

            // Set the camera offsets
            chaseCamera.DesiredPositionOffset = new Vector3(0.0f, 5f, 12f);
            chaseCamera.LookAtOffset = new Vector3(0.0f, 3f, 0.0f);

            // Set camera perspective
            chaseCamera.NearPlaneDistance = 1.0f;
            chaseCamera.FarPlaneDistance = 10000.0f;

            chaseCamera.DontFollow = new Vector3(1000, -17, 1000);

            // set default looking direction
            LookInDirection = Vector3.Forward;
            #endregion

            // sky dome
            sky = new SkyDome(ScreenManager.Game);
            sky.Theta = 2.4f;

            sky.Parameters.NumSamples = 10;
            sky.Initialize();
            sky.Theta = 1.8f;
            Components.Add(sky);

            // water
            water = new Water(ScreenManager.Game, "Map/Textury/SkyBox/skybox02", new Vector3(-1310,-25,-1900),new Vector3(20,5,31));
            water.Initialize();
            water.BumpSpeed = new Vector2(0, .01f);
            water.BumpHeight = 0.5f;
            water.WaveFrequency = 0.5f;
            Components.Add(water);

            // debug
            debug = ((OurCityGame)ScreenManager.Game).Debug;
            debug.Enabled = false;

            DebugDrawer = DebugManager.Instance.Drawer;

            // player
            PlayerManager.Instance.Initialize(this);
        }

        /// <summary>
        /// Load graphics content for the game.
        /// </summary>
        public override void LoadContent()
        {

            if (content == null)
                content = new ContentManager(ScreenManager.Game.Services, "Content");

            Initialize();

            islandModel = content.Load<Model>("Map/ourCity");
            camaroModel = content.Load<Model>("Cars/camaro_n");
            wheelModel = content.Load<Model>("Cars/wheel");

            island = new TriangleMeshObject(ScreenManager.Game, islandModel, Matrix.Identity, Vector3.Zero);
            //island.ApplyAdvancedEffects(terrainEffect);
            this.Components.Add(island);

            // buildings
            buildings = new Buildings(ScreenManager.Game);
            buildings.Initialize();
            buildings.CullingEnabled = true;
            Components.Add(buildings);

            // traffic manager
            trafficManager = new TrafficManager(ScreenManager.Game, content, physicSystem.Gravity.Length());
            trafficManager.AddCar();
            trafficManager.AddCar();
            trafficManager.AddCar();
            trafficManager.AddCar();

            // show traffic manager waypoints for debuging purposes
            debug.ShowPositions(trafficManager.Waypoints);

            foreach (DrawableGameComponent c in trafficManager.Components)
                this.Components.Add(c);

            // car
            carObject = new CarObject(ScreenManager.Game,
                camaroModel,    // model chase
                wheelModel,     // wheel model
                true,   // FW drive
                true,   // RW drive
                30.0f,  // max steer range
                5.0f,   // steer rate
                4.7f,   // wheel side friction
                5.0f,   // wheel forward friction
                0.20f,  // wheel travel - svetla vyska
                0.4f,   // wheel radius - rozvor naprav
                0.05f,  // wheel z offset
                0.45f,  // wheel resting frac
                0.6f,   // wheel damping frac
                4,      // wheel num rays
                250.0f, // drive torque - vykon motoru
                physicSystem.Gravity.Length()
                );

            carObject.Car.Chassis.Body.MoveTo(new Vector3(0, 2, 10), Matrix.CreateFromYawPitchRoll(-1.57f, 0, 0));
            carObject.Car.EnableCar();
            carObject.Car.Chassis.Body.AllowFreezing = false;
            this.Components.Add(carObject);

            #region Waypoints
            waypointModel = content.Load<Model>("Waypoints/waypoint_box");
            wpManager = new WaypointManager();

            List<Vector3> positions = new List<Vector3>();
            positions.Add(new Vector3(102.1698f, -19.75958f, 65.49726f));
            positions.Add(new Vector3(102.3883f, 0.22563f, 193.8246f));
            positions.Add(new Vector3(107.5732f, 0.2405609f, 938.9814f));
            positions.Add(new Vector3(88.17076f, 0.2415653f, 958.3015f));
            positions.Add(new Vector3(-92.6205f, 0.2404301f, 960.243f));
            positions.Add(new Vector3(-109.479f, 0.3087659f, 945.4579f));
            positions.Add(new Vector3(-104.5664f, 0.2465245f, 830.2363f));
            positions.Add(new Vector3(-109.1518f, 0.2462023f, 328.932f));
            positions.Add(new Vector3(-110.2776f, -19.757f, 223.4564f));
            positions.Add(new Vector3(-60.85434f, -19.86155f, 171.6528f));
            positions.Add(new Vector3(-15.97892f, -19.85956f, 106.8634f));
            positions.Add(new Vector3(25.59191f, -19.85958f, 5.352768f));
            positions.Add(new Vector3(53.71033f, -19.85888f, -35.43206f));
            positions.Add(new Vector3(91.76981f, -19.75591f, -32.53667f));

            List<Waypoint> wps = new List<Waypoint>();
            foreach (Vector3 v in positions)
            {
                wps.Add(new Waypoint(ScreenManager.Game, waypointModel, new Vector3(10, 10, 0.01f), Matrix.Identity, v));
            }

            foreach (Waypoint w in wps)
            {
                Components.Add(w);
                wpManager.AddWatchedWaypoint(w);
            }

            wpManager.AddWatchedCar(carObject);

            // Register handler to be notified
            wpHandler = new DummyWaypointHandler(ScreenManager.Game, wpManager, carObject);
            wpManager.WaypointCollision += wpHandler.HandleWaypointCollision;
            Components.Add(wpHandler);
            #endregion

            //HUD
            hud = new HudOverlay(ScreenManager);
            hud.Initialize(); // je treba zavolat jinak neprobehne LoadContent();

            base.LoadContent();
            ScreenManager.Game.ResetElapsedTime();

            Vector3 pos = island.PhysicsBody.Position;

            Logger.Instance.Log("Island position: (" + pos.X + ", " + pos.Y + ", " + pos.Z + ")");
        }

        /// <summary>
        /// Unload graphics content used by the game.
        /// </summary>
        public override void UnloadContent()
        {
            debug.Enabled = false;

            content.Unload();
        }
        #endregion

        #region Update
        public override void Update(GameTime gameTime, bool otherScreenHasFocus,
                                                       bool coveredByOtherScreen)
        {
            base.Update(gameTime, otherScreenHasFocus, false);

            #region Update to debug
            if (debug.Enabled)
            {
                UpdateDebug();
            }
            #endregion

            #region Update to hud
            if (hud != null && hud.Enabled)
            {
                UpdateHud();
            }
            #endregion

            #region Update camera
            // Update the camera to chase the new target
            UpdateCameraChaseTarget();
            CameraManager.Instance.Update(gameTime);
            #endregion

            if (IsActive)
            {
                CheckDeath();
                physicSystem.Integrate((float)gameTime.ElapsedGameTime.Ticks / TimeSpan.TicksPerSecond);
                wpHandler.Enabled = true;
            }
            else
            {
                wpHandler.Enabled = false;
            }

            List<DrawableGameComponent> toUpdate = new List<DrawableGameComponent>();
            foreach (DrawableGameComponent c in Components)
                if (c.Enabled)
                    toUpdate.Add(c);

            foreach (DrawableGameComponent c in toUpdate)
                c.Update(gameTime);
        }

        #region Check death
        private void CheckDeath()
        {
            if (carObject.PhysicsBody.Position.Y < -40)
            {
                //chaseCamera.ChasePosition = chaseCamera.ChasePosition + new Vector3(0, 10, 0);
                hud.Enabled = false;
                ScreenManager.AddScreen(new DeadScreen(), ControllingPlayer);
            }
        }
        #endregion

        #region Update HUD and debug
        /// <summary>
        /// Update to debug
        /// </summary>
        private void UpdateDebug()
        {
            debug.CarPosition = carObject.PhysicsBody.Position;
            debug.CarFWOrientation = carObject.PhysicsBody.Orientation.Forward;
            debug.CarVelocity = carObject.PhysicsBody.Velocity;
            debug.SkyTime = sky.Theta;
            debug.Culling = buildings.CulledObjects + " / " + buildings.Objects.Count;
        }

        private void UpdateHud()
        {
            // assuming velocity is in m/s, converting to km/h
            hud.CarVelocity = (float)Math.Round(carObject.PhysicsBody.Velocity.Length() * 3.6f);

            // set main message shown in hud
            // for example distance to the waypoint
            //TODO make it update only once a while (this could save like 40 fps)
            float distance = Vector3.Distance(carObject.PhysicsBody.Position, new Vector3(0, 0, 0)) - 80;
            float distanceToWP = wpHandler.GetDistanceToNextWaypoint();

            //clear hud message
            hud.MainMessage = "";

            if (wpHandler.GetRemainingTime().TotalSeconds == 10) {
            } else {
            hud.MainMessage = "Next WP " + Math.Round(distanceToWP) + " m";

            if (wpHandler.GetRemainingTime().TotalMilliseconds > 0)
                hud.MainMessage += "\nTime:" + Math.Round(wpHandler.GetRemainingTime().TotalSeconds,2).ToString();
            else
                hud.MainMessage += "\n You lost!";
            }
            // send player location (for minimap)
            hud.PlayerLocation = carObject.PhysicsBody.Position;
        }
        #endregion

        #region Update Chase camera
        /// <summary>
        /// Update the values to be chased by the camera
        /// </summary>
        ///
        private Vector3 LookInDirection { get; set; }

        private void UpdateCameraChaseTarget()
        {
            chaseCamera.ChasePosition = carObject.Car.Chassis.Body.Position;
            chaseCamera.Up = carObject.Car.Chassis.Body.Orientation.Up;

            chaseCamera.SpringEnabled = true;

            // where to look
            if (LookInDirection == Vector3.Forward)
            {
                chaseCamera.ChaseDirection = carObject.Car.Chassis.Body.Orientation.Right;
                return;
            }
            if (LookInDirection == Vector3.Backward)
            {
                // no spring in look-back
                chaseCamera.SpringEnabled = false;
                chaseCamera.ChaseDirection = carObject.Car.Chassis.Body.Orientation.Left;
                return;
            }
            if (LookInDirection == Vector3.Right)
            {
                chaseCamera.ChaseDirection = carObject.Car.Chassis.Body.Orientation.Backward;
                return;
            }
            if (LookInDirection == Vector3.Left)
            {
                chaseCamera.ChaseDirection = carObject.Car.Chassis.Body.Orientation.Forward;
                return;
            }

        }
        #endregion

        #endregion

        #region Handle input
        /// <summary>
        /// Lets the game respond to player input. Unlike the Update method,
        /// this will only be called when the gameplay screen is active.
        /// </summary>
        public override void HandleInput(InputState input)
        {
            if (input == null)
                throw new ArgumentNullException("input");

            #region Handle pause
            // Look up inputs for the active player profile.
            int playerIndex = (int)ControllingPlayer.Value;

            KeyboardState keyboardState = input.CurrentKeyboardStates[playerIndex];
            GamePadState gamePadState = input.CurrentGamePadStates[playerIndex];

            // The game pauses either if the user presses the pause button, or if
            // they unplug the active gamepad. This requires us to keep track of
            // whether a gamepad was ever plugged in, because we don't want to pause
            // on PC if they are playing with a keyboard and have no gamepad at all!
            bool gamePadDisconnected = !gamePadState.IsConnected &&
                                       input.GamePadWasConnected[playerIndex];

            if (input.IsPauseGame(ControllingPlayer) || gamePadDisconnected)
            {
                ScreenManager.AddScreen(new PauseMenuScreen(), ControllingPlayer);
                return;
            }
            #endregion

            #region Car Control
            KeyboardState keyState = Keyboard.GetState();
            MouseState mouseState = Mouse.GetState();

            if (keyState.IsKeyDown(Keys.Up) || keyState.IsKeyDown(Keys.Down))
            {
                if (keyState.IsKeyDown(Keys.Up))
                    carObject.Car.Accelerate = 1.0f;
                else
                    carObject.Car.Accelerate = -1.0f;
            }
            else
                carObject.Car.Accelerate = 0.0f;

            if (keyState.IsKeyDown(Keys.Left) || keyState.IsKeyDown(Keys.Right))
            {
                if (keyState.IsKeyDown(Keys.Left))
                    carObject.Car.Steer = 1.0f;
                else
                    carObject.Car.Steer = -1.0f;
            }
            else
                carObject.Car.Steer = 0.0f;

            if (keyState.IsKeyDown(Keys.B))
                carObject.Car.HBrake = 1.0f;
            else
                carObject.Car.HBrake = 0.0f;

            #region Gamepad
            if (gamePadState.IsConnected) {
                carObject.Car.Accelerate = gamePadState.Triggers.Right - gamePadState.Triggers.Left;
                carObject.Car.Steer = gamePadState.ThumbSticks.Left.X * (-1);

                if (gamePadState.IsButtonDown(Buttons.A))
                    carObject.Car.HBrake = 1.0f;
                else
                    carObject.Car.HBrake = 0.0f;
            }
            #endregion
            #endregion

            #region Debug toggle
            if (input.CurrentKeyboardStates[playerIndex].IsKeyUp(Keys.X) && input.LastKeyboardStates[playerIndex].IsKeyDown(Keys.X))
            {
                debug.Enabled = !debug.Enabled;
            }
            #endregion

            #region Handle C key (Debug drawer)
            if (debug.Enabled)
            {

                if (!DebugDrawer.Enabled && keyState.IsKeyDown(Keys.C)) DebugDrawer.Enabled = true;
                if (DebugDrawer.Enabled && keyState.IsKeyUp(Keys.C)) DebugDrawer.Enabled = false;

            }
            #endregion

            #region Camera modes
            if (input.CurrentKeyboardStates[playerIndex].IsKeyUp(Keys.F5) && input.LastKeyboardStates[playerIndex].IsKeyDown(Keys.F5))
            {
                CameraManager.Instance.SetDefault("Chase");
            }
            if (input.CurrentKeyboardStates[playerIndex].IsKeyUp(Keys.F6) && input.LastKeyboardStates[playerIndex].IsKeyDown(Keys.F6))
            {
                if (CameraManager.Instance.Cameras.ContainsKey("Free"))
                    CameraManager.Instance.SetDefault("Free");
                else
                {
                    CameraManager.Instance.Cameras.Add("Free", new Camera(ScreenManager.Game));
                    CameraManager.Instance.SetDefault("Free");
                }
            }
            if (input.CurrentKeyboardStates[playerIndex].IsKeyUp(Keys.F7) && input.LastKeyboardStates[playerIndex].IsKeyDown(Keys.F7))
            {
                if (CameraManager.Instance.Cameras.ContainsKey("Free2"))
                    CameraManager.Instance.SetDefault("Free2");
                else
                {
                    CameraManager.Instance.Cameras.Add("Free2", new Camera(ScreenManager.Game));
                    CameraManager.Instance.SetDefault("Free2");
                }
            }
            if (input.CurrentKeyboardStates[playerIndex].IsKeyUp(Keys.F8) && input.LastKeyboardStates[playerIndex].IsKeyDown(Keys.F8))
            {
                if (CameraManager.Instance.Cameras.ContainsKey("Free3"))
                    CameraManager.Instance.SetDefault("Free3");
                else
                {
                    CameraManager.Instance.Cameras.Add("Free3", new Camera(ScreenManager.Game));
                    CameraManager.Instance.SetDefault("Free3");
                }
            }
            #endregion

            #region Reset car
            if (input.CurrentKeyboardStates[playerIndex].IsKeyUp(Keys.R) && input.LastKeyboardStates[playerIndex].IsKeyDown(Keys.R))
            {
                ResetCar();
            }

            #endregion

            #region Log car position
            if (input.CurrentKeyboardStates[playerIndex].IsKeyUp(Keys.L) && input.LastKeyboardStates[playerIndex].IsKeyDown(Keys.L))
            {
                Vector3 pos = carObject.PhysicsBody.Position;
                Logger.Instance.Log("car position: (" + pos.X + ", " + pos.Y + ", " + pos.Z + ")");

                //add debug sphere to logged location
                debug.SpawnDebugObject(pos);
            }
            #endregion

            #region Toggle hud
            if (input.CurrentKeyboardStates[playerIndex].IsKeyUp(Keys.J) && input.LastKeyboardStates[playerIndex].IsKeyDown(Keys.J))
            {
                hud.Enabled = !hud.Enabled;
            }
            #endregion

            #region Look Back ...
            LookInDirection = Vector3.Forward;
            // back
            if (keyState.IsKeyDown(Keys.NumPad2) || keyState.IsKeyDown(Keys.N)) LookInDirection = Vector3.Backward;
            if (keyState.IsKeyDown(Keys.NumPad4)) LookInDirection = Vector3.Left;
            if (keyState.IsKeyDown(Keys.NumPad6)) LookInDirection = Vector3.Right;

            #endregion

            #region Customise water
            if (debug.Enabled)
            {
                if (Keyboard.GetState().IsKeyDown(Keys.D1))
                    water.WaterAmount = 0;

                if (Keyboard.GetState().IsKeyDown(Keys.D2))
                {
                    water.WaterAmount = 1;
                    water.ShallowWaterColor = Color.DarkSeaGreen;
                    water.DeepWaterColor = Color.Navy;
                    water.ReflectionColor = Color.DarkGray;
                }

                if (Keyboard.GetState().IsKeyDown(Keys.D3))
                {
                    water.WaterAmount = 1;
                    water.ShallowWaterColor = Color.Gold;
                    water.DeepWaterColor = Color.Red;
                    water.ReflectionColor = Color.White;
                }

                if (Keyboard.GetState().IsKeyDown(Keys.D4))
                {
                    water.WaveFrequency = .5f;
                    water.WaveAmplitude = .3f;
                    water.BumpHeight = 1f;
                }

                if (Keyboard.GetState().IsKeyDown(Keys.D5))
                {
                    water.WaveFrequency = .1f;
                    water.WaveAmplitude = .1f;
                    water.BumpHeight = .1f;
                }

                if (Keyboard.GetState().IsKeyDown(Keys.D6))
                {
                    water.WaveFrequency = .1f;
                    water.WaveAmplitude = .5f;
                    water.BumpHeight = .1f;
                }

                if (Keyboard.GetState().IsKeyDown(Keys.D7))
                {
                    water.WaveFrequency = .1f;
                    water.WaveAmplitude = 2f;
                    water.BumpHeight = 1f;
                }

                if (Keyboard.GetState().IsKeyDown(Keys.D8))
                {
                    water.WaveFrequency = 0;
                    water.WaveAmplitude = 0;
                    water.BumpHeight = 0;
                }

                if (Keyboard.GetState().IsKeyDown(Keys.D9))
                {
                    water.WaveFrequency = 0;
                    water.WaveAmplitude = 0;
                    water.BumpHeight = 1;
                }
                if (Keyboard.GetState().IsKeyDown(Keys.D0))
                    water.SetDefault();
            }
            #endregion

        }

        #endregion

        #region Public functions
        public void ResetCar()
        {
            hud.Enabled = true;
            if (wpHandler.GetRemainingTime().TotalMilliseconds > 0)
            { // We still have time
                // Respawn on last waypoint
                Vector3 newPos;
                if (wpHandler.PrevWaypoint == null)
                {
                    newPos = new Vector3(0, 2, 10);
                }
                else
                {
                    newPos = wpHandler.PrevWaypoint.PhysicsBody.Position;
                }

                carObject.Car.Chassis.Body.MoveTo(newPos, Matrix.CreateFromYawPitchRoll(-1.57f, 0, 0));
            }
            else
            { // We lost or havent even started
                carObject.Car.Chassis.Body.MoveTo(new Vector3(0, 2, 10), Matrix.CreateFromYawPitchRoll(-1.57f, 0, 0));
                wpHandler.Initialize();
            }
        }
        #endregion

        #region Draw
        /// <summary>
        /// Draws the gameplay screen.
        /// </summary>
        public override void Draw(GameTime gameTime)
        {
            List<DrawableGameComponent> toDraw = new List<DrawableGameComponent>();
            foreach (DrawableGameComponent c in Components)
                if (c.Visible)
                    toDraw.Add(c);

            // only draw debug objects (waypoints) if debug enabled
            if (debug.Enabled)
            {
                toDraw.AddRange(debug.debugObjects);
            }

            foreach (DrawableGameComponent c in toDraw)
                c.Draw(gameTime);

            hud.Draw(gameTime);
        }

        #endregion

        #region Misc

        #region IDrawable Members

        public int DrawOrder
        {
            get;
            set;
        }

        public event EventHandler<EventArgs> DrawOrderChanged;

        public bool Visible
        {
            get { throw new NotImplementedException(); }
        }

        public event EventHandler<EventArgs> VisibleChanged;

        #endregion

        #region ImmovableSkinPredicate
        class ImmovableSkinPredicate : CollisionSkinPredicate1
        {
            public override bool ConsiderSkin(CollisionSkin skin0)
            {
                if (skin0.Owner != null && !skin0.Owner.Immovable)
                    return true;
                else
                    return false;
            }
        }
        #endregion

        #endregion
    }
}


text:
Contact Us

<form>

	Full Real Name

    <input type="text" name='member[nama]' value = "<?= set_value('member[nama]')?>" class="form-control" id="" placeholder="Username.." required>

	Email Address

    <input type="text" name='member[email]' value = "<?= set_value('member[email]')?>" class="form-control" id="" placeholder="Username.." required>

	Question or Comments
	<textarea class='form-control' style="height:200px"></textarea>

  <button type="submit" class="btn btn-danger pull-right">Submit</button>

</form>

redpajama_set_name: RedPajamaGithub


text:
using UnityEngine;
using System.Collections;

public class ShrinkExplosion : MonoBehaviour {

    JumpGameReferences jgr;

    void Awake() {
        jgr = GameObject.FindGameObjectWithTag(TagsAndLayers.gameController).GetComponent<JumpGameReferences>();
    }

    void OnTriggerEnter(Collider other)
    {
        Debug.Log("I hit a pillar");
        if (other.CompareTag(TagsAndLayers.jumppadPillar))
        {

            Jumppad contactedJumppad = other.GetComponentInChildren<Jumppad>();

            if (contactedJumppad == null)
                return;

            Debug.Log("I'm hitting " + contactedJumppad.name);

            contactedJumppad.transform.localScale = Vector3.Lerp(contactedJumppad.transform.localScale, contactedJumppad.LowScale, 3 * Time.deltaTime);
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;

namespace ContactsManager.Models
{
    public class InMemoryContactRepository : IContactRepository
    {
        private readonly List<Contact> _contacts = new List<Contact>
        {
            new Contact { ContactId = 1, Name = "Filip W", Address = "107 Atlantic Avenue", City = "Toronto", State = "ON", Zip = "M6K 1Y2", Email = "filip.wojcieszyn@climaxmedia.com", Twitter = "filip_woj" },
            new Contact { ContactId = 2, Name = "Josh Donaldson", Address = "1 Blue Jays Way", City = "Toronto", State = "ON", Zip = "M5V 1J1", Email = "joshd@bluejays.com", Twitter = "BringerOfRain20" },
            new Contact { ContactId = 3, Name = "Aaron Sanchez", Address = "1 Blue Jays Way", City = "Toronto", State = "ON", Zip = "M5V 1J1", Email = "aarons@bluejays.com", Twitter = "A_Sanch41" },
            new Contact { ContactId = 4, Name = "Jose Bautista", Address = "1 Blue Jays Way", City = "Toronto", State = "ON", Zip = "M5V 1J1", Email = "joseb@bluejays.com", Twitter = "JoeyBats19" },
            new Contact { ContactId = 5, Name = "Edwin Encarnacion", Address = "1 Blue Jays Way", City = "Toronto", State = "ON", Zip = "M5V 1J1", Email = "edwine@bluejays.com", Twitter = "Encadwin" },
        };

        public IQueryable<Contact> GetAll()
        {
            return _contacts.AsQueryable();
        }

        public Contact Get(int id)
        {
            return _contacts.FirstOrDefault(x => x.ContactId == id);
        }

        public void Add(Contact contact)
        {
            if (_contacts.Any(x => x.ContactId == contact.ContactId))
            {
                throw new InvalidOperationException(string.Format("Contact with id '{0}' already exists", contact.ContactId));
            }

            _contacts.Add(contact);
        }

        public void Update(Contact updatedContact)
        {
            var contact = Get(updatedContact.ContactId);
            if (contact == null)
            {
                throw new InvalidOperationException(string.Format("Contact with id '{0}' does not exists", contact.ContactId));
            }

            contact.Address = updatedContact.Address;
            contact.City = updatedContact.City;
            contact.Email = updatedContact.Email;
            contact.Name = updatedContact.Name;
            contact.State = updatedContact.State;
            contact.Twitter = updatedContact.Twitter;
            contact.Zip = updatedContact.Zip;
        }

        public void Delete(int id)
        {
            var contact = Get(id);
            if (contact == null)
            {
                throw new InvalidOperationException(string.Format("Contact with id '{0}' does not exists", contact.ContactId));
            }

            _contacts.Remove(contact);
        }
    }
}


text:
@interface MOBProjectionEPSG2317 : MOBProjection

@end


text:
package org.assertj.core.internal.bigdecimals;

import static java.math.BigDecimal.ONE;
import static java.math.BigDecimal.TEN;
import static java.math.BigDecimal.ZERO;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.assertj.core.api.Assertions.assertThatNullPointerException;
import static org.assertj.core.api.Assertions.withinPercentage;
import static org.assertj.core.data.Percentage.withPercentage;
import static org.assertj.core.error.ShouldBeEqualWithinPercentage.shouldBeEqualWithinPercentage;
import static org.assertj.core.test.TestData.someInfo;
import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown;
import static org.assertj.core.util.FailureMessages.actualIsNull;
import static org.mockito.Mockito.verify;

import java.math.BigDecimal;

import org.assertj.core.api.AssertionInfo;
import org.assertj.core.internal.BigDecimalsBaseTest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;

public class BigDecimals_assertIsCloseToPercentage_Test extends BigDecimalsBaseTest {

  @Test
  public void should_fail_if_actual_is_null() {
    assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> numbers.assertIsCloseToPercentage(someInfo(), null, ONE, withPercentage(1)))
                                                   .withMessage(actualIsNull());
  }

  @Test
  public void should_fail_if_expected_value_is_null() {
    assertThatNullPointerException().isThrownBy(() -> numbers.assertIsCloseToPercentage(someInfo(), ONE, null, withPercentage(1)));
  }

  @Test
  public void should_fail_if_percentage_is_null() {
    assertThatNullPointerException().isThrownBy(() -> numbers.assertIsCloseToPercentage(someInfo(), ONE, ZERO, null));
  }

  @Test
  public void should_fail_if_percentage_is_negative() {
    assertThatIllegalArgumentException().isThrownBy(() -> numbers.assertIsCloseToPercentage(someInfo(), ONE, ZERO, withPercentage(-1)));
  }

  @ParameterizedTest
  @CsvSource({
    "1, 1, 1",
    "1, 2, 100",
    "-1, -1, 1",
    "-1, -2, 100",
    "-1, 1, 200"
  })
  public void should_pass_if_difference_is_less_than_given_percentage(BigDecimal actual, BigDecimal other, Integer percentage) {
    numbers.assertIsCloseToPercentage(someInfo(), actual, other, withPercentage(percentage));
  }

  @ParameterizedTest
  @CsvSource({
    "1, 1, 0",
    "2, 1, 100",
    "1, 2, 50",
    "-1, -1, 0",
    "-2, -1, 100",
    "-1, -2, 50"
  })
  public void should_pass_if_difference_is_equal_to_given_percentage(BigDecimal actual, BigDecimal other, Integer percentage) {
    numbers.assertIsCloseToPercentage(someInfo(), actual, other, withPercentage(percentage));
  }

  @Test
  public void should_fail_if_actual_is_not_close_enough_to_expected_value() {
    AssertionInfo info = someInfo();
    try {
      numbers.assertIsCloseToPercentage(someInfo(), ONE, TEN, withPercentage(10));
    } catch (AssertionError e) {
      verify(failures).failure(info, shouldBeEqualWithinPercentage(ONE, TEN, withinPercentage(10), TEN.subtract(ONE)));
      return;
    }
    failBecauseExpectedAssertionErrorWasNotThrown();
  }
}


text:
require File.expand_path('../application', __FILE__)

# Initialize the rails application
TwitterEmail::Application.initialize!


text:
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;

namespace RiotSharp.MatchEndpoint
{
    class LaneConverter : JsonConverter
    {
        public override bool CanConvert(Type objectType)
        {
            return typeof(string).IsAssignableFrom(objectType);
        }

        public override object ReadJson(JsonReader reader, Type objectType, object existingValue,
            JsonSerializer serializer)
        {
            var token = JToken.Load(reader);
            if (token.Value<string>() == null) return null;
            var str = token.Value<string>();
            switch (str)
            {
                case "MID":
                    return Lane.Mid;
                case "MIDDLE":
                    return Lane.Middle;
                case "TOP":
                    return Lane.Top;
                case "JUNGLE":
                    return Lane.Jungle;
                case "BOT":
                    return Lane.Bot;
                case "BOTTOM":
                    return Lane.Bottom;
                default:
                    return null;
            }
        }

        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            serializer.Serialize(writer, ((Lane)value).ToCustomString());
        }
    }
}


text:
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 4.0.2
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package org.opensim.modeling;

public class SWIGTYPE_p_DecorativeGeometryRep {
  private transient long swigCPtr;

  protected SWIGTYPE_p_DecorativeGeometryRep(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
    swigCPtr = cPtr;
  }

  protected SWIGTYPE_p_DecorativeGeometryRep() {
    swigCPtr = 0;
  }

  protected static long getCPtr(SWIGTYPE_p_DecorativeGeometryRep obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }
}


text:
/* $Id: PenaltyTestCase.java 924666 2010-03-18 08:26:30Z jeremias $ */

package org.apache.xmlgraphics.image.loader;

import junit.framework.TestCase;

import org.apache.xmlgraphics.image.loader.util.Penalty;
import org.junit.Test;

/**
 * Tests for the {@link Penalty}.
 */
public class PenaltyTestCase extends TestCase {

    /**
     * Tests for penalty handling.
     *
     * @if an error occurs
     */
    @Test
    public void testTruncatePenalty() {
        assertEquals(0, Penalty.truncate(0));
        long penalty = Integer.MAX_VALUE;
        assertEquals(Integer.MAX_VALUE, Penalty.truncate(penalty));

        // Force integer wrap-around
        penalty++;
        assertEquals(Integer.MAX_VALUE, Penalty.truncate(penalty));
        // For comparison, normal casting does this
        assertEquals(Integer.MIN_VALUE, (int) penalty);

        // Now on the other end of the spectrum...
        penalty = Integer.MIN_VALUE;
        assertEquals(Integer.MIN_VALUE, Penalty.truncate(penalty));

        // Force integer wrap-around
        penalty -= 500;
        assertEquals(Integer.MIN_VALUE, Penalty.truncate(penalty));
        // For comparison, normal casting does this
        assertEquals(Integer.MAX_VALUE - 499, (int) penalty);
    }

    /**
     * Tests for the {@link Penalty} class.
     *
     * @if an error occurs
     */
    @Test
    public void testPenalty() {
        Penalty p1 = Penalty.toPenalty(100);
        assertEquals(100, p1.getValue());
        Penalty p2 = p1.add(Penalty.toPenalty(50));
        assertEquals(150, p2.getValue());

        p1 = Penalty.toPenalty(0);
        assertEquals(0, p1.getValue());

        p1 = Penalty.INFINITE_PENALTY;
        assertEquals(Integer.MAX_VALUE, p1.getValue());
        assertTrue(p1.isInfinitePenalty());
        p2 = p1.add(p2);
        assertEquals(Integer.MAX_VALUE, p2.getValue());
        assertTrue(p2.isInfinitePenalty());
    }

}


text:
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Diagnostics.Contracts;
using System;

// Disable the "this variable is not used" warning as every field would imply it.
#pragma warning disable 0414
// Disable the "this variable is never assigned to".
#pragma warning disable 0067
// Disable the "this event is never assigned to".
#pragma warning disable 0649
// Disable the "this variable is never used".
#pragma warning disable 0169
// Disable the "new keyword not required" warning.
#pragma warning disable 0109
// Disable the "extern without DllImport" warning.
#pragma warning disable 0626
// Disable the "could hide other member" warning, can happen on certain properties.
#pragma warning disable 0108

namespace System.DirectoryServices
{
  public partial class DirectoryEntry : System.ComponentModel.Component
  {
    #region Methods and constructors
    public void Close()
    {
    }

    public void CommitChanges()
    {
    }

    public System.DirectoryServices.DirectoryEntry CopyTo(System.DirectoryServices.DirectoryEntry newParent)
    {
      Contract.Ensures(Contract.Result<DirectoryEntry>() != null);
      return default(System.DirectoryServices.DirectoryEntry);
    }

    // newname can be null
    public System.DirectoryServices.DirectoryEntry CopyTo(System.DirectoryServices.DirectoryEntry newParent, string newName)
    {
      Contract.Ensures(Contract.Result<DirectoryEntry>() != null);
      return default(System.DirectoryServices.DirectoryEntry);
    }

    public void DeleteTree()
    {
    }

    public DirectoryEntry(string path)
    {
    }

    public DirectoryEntry()
    {
    }

    public DirectoryEntry(string path, string username, string password)
    {
    }

    public DirectoryEntry(string path, string username, string password, AuthenticationTypes authenticationType)
    {
    }

    public DirectoryEntry(Object adsObject)
    {
    }

    protected override void Dispose(bool disposing)
    {
    }

    public static bool Exists(string path)
    {
      return default(bool);
    }

    public Object Invoke(string methodName, Object[] args)
    {
      Contract.Ensures(Contract.Result<object>() != null);
      return default(Object);
    }

    public Object InvokeGet(string propertyName)
    {
      return default(Object);
    }

    public void InvokeSet(string propertyName, Object[] args)
    {
    }

    public void MoveTo(System.DirectoryServices.DirectoryEntry newParent, string newName)
    {
    }

    public void MoveTo(System.DirectoryServices.DirectoryEntry newParent)
    {
    }

    public void RefreshCache()
    {
    }

    public void RefreshCache(string[] propertyNames)
    {
    }

    public void Rename(string newName)
    {
    }
    #endregion

    #region Properties and indexers
    public AuthenticationTypes AuthenticationType
    {
      get
      {
        return default(AuthenticationTypes);
      }
      set
      {
      }
    }

    public DirectoryEntries Children
    {
      get
      {
        Contract.Ensures(Contract.Result<DirectoryEntries>() != null);

        return default(DirectoryEntries);
      }
    }

    public Guid Guid
    {
      get
      {
        return default(Guid);
      }
    }

    public string Name
    {
      get
      {
        return default(string);
      }
    }

    public string NativeGuid
    {
      get
      {
        return default(string);
      }
    }

    public Object NativeObject
    {
      get
      {
        return default(Object);
      }
    }

    public ActiveDirectorySecurity ObjectSecurity
    {
      get
      {
        return default(ActiveDirectorySecurity);
      }
      set
      {
      }
    }

    public DirectoryEntryConfiguration Options
    {
      get
      {
        return default(DirectoryEntryConfiguration);
      }
    }

    public System.DirectoryServices.DirectoryEntry Parent
    {
      get
      {
        Contract.Ensures(Contract.Result<DirectoryEntry>() != null);
        return default(System.DirectoryServices.DirectoryEntry);
      }
    }

    public string Password
    {
      set
      {
      }
    }

    public string Path
    {
      get
      {
        return default(string);
      }
      set
      {
      }
    }

    public PropertyCollection Properties
    {
      get
      {
        return default(PropertyCollection);
      }
    }

    public string SchemaClassName
    {
      get
      {
        return default(string);
      }
    }

    public System.DirectoryServices.DirectoryEntry SchemaEntry
    {
      get
      {
        return default(System.DirectoryServices.DirectoryEntry);
      }
    }

    public bool UsePropertyCache
    {
      get
      {
        return default(bool);
      }
      set
      {
      }
    }

    // may return nul
    public string Username
    {
      get
      {
        return default(string);
      }
      set
      {
      }
    }
    #endregion
  }
}


text:
"""
    sphinx.transforms
    ~~~~~~~~~~~~~~~~~

    Docutils transforms used by Sphinx when reading documents.

    :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
"""

from docutils import nodes
from docutils.transforms import Transform
from docutils.transforms.parts import ContentsFilter

from sphinx import addnodes
from sphinx.locale import _
from sphinx.util.i18n import format_date
from sphinx.util.nodes import apply_source_workaround

default_substitutions = set([
    'version',
    'release',
    'today',
])

class DefaultSubstitutions(Transform):
    """
    Replace some substitutions if they aren't defined in the document.
    """
    # run before the default Substitutions
    default_priority = 210

    def apply(self):
        env = self.document.settings.env
        config = self.document.settings.env.config
        # only handle those not otherwise defined in the document
        to_handle = default_substitutions - set(self.document.substitution_defs)
        for ref in self.document.traverse(nodes.substitution_reference):
            refname = ref['refname']
            if refname in to_handle:
                text = config[refname]
                if refname == 'today' and not text:
                    # special handling: can also specify a strftime format
                    text = format_date(config.today_fmt or _('%b %d, %Y'),
                                       language=config.language, warn=env.warn)
                ref.replace_self(nodes.Text(text, text))

class MoveModuleTargets(Transform):
    """
    Move module targets that are the first thing in a section to the section
    title.

    XXX Python specific
    """
    default_priority = 210

    def apply(self):
        for node in self.document.traverse(nodes.target):
            if not node['ids']:
                continue
            if ('ismod' in node and
                    node.parent.__class__ is nodes.section and
                    # index 0 is the section title node
                    node.parent.index(node) == 1):
                node.parent['ids'][0:0] = node['ids']
                node.parent.remove(node)

class HandleCodeBlocks(Transform):
    """
    Several code block related transformations.
    """
    default_priority = 210

    def apply(self):
        # move doctest blocks out of blockquotes
        for node in self.document.traverse(nodes.block_quote):
            if all(isinstance(child, nodes.doctest_block) for child
                   in node.children):
                node.replace_self(node.children)
        # combine successive doctest blocks
        # for node in self.document.traverse(nodes.doctest_block):
        #    if node not in node.parent.children:
        #        continue
        #    parindex = node.parent.index(node)
        #    while len(node.parent) > parindex+1 and \
        #            isinstance(node.parent[parindex+1], nodes.doctest_block):
        #        node[0] = nodes.Text(node[0] + '\n\n' +
        #                             node.parent[parindex+1][0])
        #        del node.parent[parindex+1]

class AutoNumbering(Transform):
    """
    Register IDs of tables, figures and literal_blocks to assign numbers.
    """
    default_priority = 210

    def apply(self):
        domain = self.document.settings.env.domains['std']

        for node in self.document.traverse(nodes.Element):
            if domain.is_enumerable_node(node) and domain.get_numfig_title(node) is not None:
                self.document.note_implicit_target(node)

class SortIds(Transform):
    """
    Sort secion IDs so that the "id[0-9]+" one comes last.
    """
    default_priority = 261

    def apply(self):
        for node in self.document.traverse(nodes.section):
            if len(node['ids']) > 1 and node['ids'][0].startswith('id'):
                node['ids'] = node['ids'][1:] + [node['ids'][0]]

class CitationReferences(Transform):
    """
    Replace citation references by pending_xref nodes before the default
    docutils transform tries to resolve them.
    """
    default_priority = 619

    def apply(self):
        for citnode in self.document.traverse(nodes.citation_reference):
            cittext = citnode.astext()
            refnode = addnodes.pending_xref(cittext, refdomain='std', reftype='citation',
                                            reftarget=cittext, refwarn=True,
                                            ids=citnode["ids"])
            refnode.source = citnode.source or citnode.parent.source
            refnode.line = citnode.line or citnode.parent.line
            refnode += nodes.Text('[' + cittext + ']')
            citnode.parent.replace(citnode, refnode)

TRANSLATABLE_NODES = {
    'literal-block': nodes.literal_block,
    'doctest-block': nodes.doctest_block,
    'raw': nodes.raw,
    'index': addnodes.index,
    'image': nodes.image,
}

class ApplySourceWorkaround(Transform):
    """
    update source and rawsource attributes
    """
    default_priority = 10

    def apply(self):
        for n in self.document.traverse():
            if isinstance(n, (nodes.TextElement, nodes.image)):
                apply_source_workaround(n)

class AutoIndexUpgrader(Transform):
    """
    Detect old style; 4 column based indices and automatically upgrade to new style.
    """
    default_priority = 210

    def apply(self):
        env = self.document.settings.env
        for node in self.document.traverse(addnodes.index):
            if 'entries' in node and any(len(entry) == 4 for entry in node['entries']):
                msg = ('4 column based index found. '
                       'It might be a bug of extensions you use: %r' % node['entries'])
                env.warn_node(msg, node)
                for i, entry in enumerate(node['entries']):
                    if len(entry) == 4:
                        node['entries'][i] = entry + (None,)

class ExtraTranslatableNodes(Transform):
    """
    make nodes translatable
    """
    default_priority = 10

    def apply(self):
        targets = self.document.settings.env.config.gettext_additional_targets
        target_nodes = [v for k, v in TRANSLATABLE_NODES.items() if k in targets]
        if not target_nodes:
            return

        def is_translatable_node(node):
            return isinstance(node, tuple(target_nodes))

        for node in self.document.traverse(is_translatable_node):
            node['translatable'] = True

class FilterSystemMessages(Transform):
    """Filter system messages from a doctree."""
    default_priority = 999

    def apply(self):
        env = self.document.settings.env
        filterlevel = env.config.keep_warnings and 2 or 5
        for node in self.document.traverse(nodes.system_message):
            if node['level'] < filterlevel:
                env.app.debug('%s [filtered system message]', node.astext())
                node.parent.remove(node)

class SphinxContentsFilter(ContentsFilter):
    """
    Used with BuildEnvironment.add_toc_from() to discard cross-file links
    within table-of-contents link nodes.
    """
    def visit_pending_xref(self, node):
        text = node.astext()
        self.parent.append(nodes.literal(text, text))
        raise nodes.SkipNode

    def visit_image(self, node):
        raise nodes.SkipNode


text:
import Mixin from '@ember/object/mixin';
import { computed } from '@ember/object';

export default Mixin.create({
  safeStyle:  null,
  _safeStyle: computed('safeStyle', function() {
    if ( this.get('safeStyle') ) {
      return this.get('safeStyle').htmlSafe();
    } else {
      return ''.htmlSafe();
    }
  }),

  attributeBindings: ['_safeStyle:style'],
});


text:
// b2Body Globals
var b2Body_ApplyAngularImpulse = Module.cwrap('b2Body_ApplyAngularImpulse', 'null',
  ['number', 'number', 'number']);

var b2Body_ApplyLinearImpulse = Module.cwrap('b2Body_ApplyLinearImpulse', 'null',
  ['number', 'number', 'number', 'number', 'number', 'number']);

var b2Body_ApplyForce = Module.cwrap('b2Body_ApplyForce', 'number',
  ['number', 'number', 'number', 'number', 'number', 'number']);

var b2Body_ApplyForceToCenter = Module.cwrap('b2Body_ApplyForceToCenter', 'number',
  ['number', 'number', 'number', 'number']);

var b2Body_ApplyTorque = Module.cwrap('b2Body_ApplyTorque', 'number',
  ['number', 'number', 'number']);

var b2Body_DestroyFixture = Module.cwrap('b2Body_DestroyFixture', 'null',
  ['number', 'number']);

var b2Body_GetAngle = Module.cwrap('b2Body_GetAngle', 'number', ['number']);

var b2Body_GetAngularVelocity =
  Module.cwrap('b2Body_GetAngularVelocity', 'number', ['number']);

var b2Body_GetInertia = Module.cwrap('b2Body_GetInertia', 'number', ['number']);

var b2Body_GetLinearVelocity =
  Module.cwrap('b2Body_GetLinearVelocity', 'null', ['number', 'number']);

var b2Body_GetLocalPoint = Module.cwrap('b2Body_GetLocalPoint', 'null',
  ['number', 'number', 'number', 'number']);

var b2Body_GetLocalVector = Module.cwrap('b2Body_GetLocalVector', 'null',
  ['number', 'number', 'number', 'number']);

var b2Body_GetMass = Module.cwrap('b2Body_GetMass', 'number', ['number']);

var b2Body_GetPosition = Module.cwrap('b2Body_GetPosition', 'null', ['number', 'number']);

var b2Body_GetTransform = Module.cwrap('b2Body_GetTransform', 'null',
  ['number', 'number']);

var b2Body_GetType = Module.cwrap('b2Body_GetType', 'number', ['number']);

var b2Body_GetWorldCenter = Module.cwrap('b2Body_GetWorldCenter', 'null',
  ['number', 'number']);

var b2Body_GetWorldPoint = Module.cwrap('b2Body_GetWorldPoint', 'null',
  ['number', 'number', 'number', 'number']);

var b2Body_GetWorldVector = Module.cwrap('b2Body_GetWorldVector', 'null',
  ['number', 'number', 'number', 'number']);

var b2Body_SetAngularVelocity = Module.cwrap('b2Body_SetAngularVelocity', 'null',
  ['number', 'number']);

var b2Body_SetAwake =
  Module.cwrap('b2Body_SetAwake', 'number',['number', 'number']);

var b2Body_SetFixedRotation =
  Module.cwrap('b2Body_SetFixedRotation', 'number',['number', 'number']);

var b2Body_SetLinearVelocity = Module.cwrap('b2Body_SetLinearVelocity', 'null',
  ['number', 'number', 'number']);

var b2Body_SetMassData = Module.cwrap('b2Body_SetMassData', 'null',
  ['number', 'number', 'number',
   'number', 'number']);

var b2Body_SetTransform =
  Module.cwrap('b2Body_SetTransform', 'null', ['number', 'number', 'number']);

var b2Body_SetType =
  Module.cwrap('b2Body_SetType', 'null', ['number', 'number']);

// memory offsets
var b2Body_xf_offset = Offsets.b2Body.xf;
var b2Body_userData_offset = Offsets.b2Body.userData;
/**@constructor*/
function b2Body(ptr) {
  this.buffer = new DataView(Module.HEAPU8.buffer, ptr);
  this.ptr = ptr;
  this.fixtures = [];
}

b2Body.prototype.ApplyAngularImpulse = function(impulse, wake) {
  b2Body_ApplyAngularImpulse(this.ptr, impulse, wake);
};

b2Body.prototype.ApplyLinearImpulse = function(impulse, point, wake) {
  b2Body_ApplyLinearImpulse(this.ptr, impulse.x, impulse.y, point.x, point.y, wake);
};

b2Body.prototype.ApplyForce = function(force, point, wake) {
  b2Body_ApplyForce(this.ptr, force.x, force.y, point.x, point.y, wake);
};

b2Body.prototype.ApplyForceToCenter = function(force, wake) {
  b2Body_ApplyForceToCenter(this.ptr, force.x, force.y, wake);
};

b2Body.prototype.ApplyTorque = function(force, wake) {
  b2Body_ApplyTorque(this.ptr, force, wake);
};

b2Body.prototype.CreateFixtureFromDef = function(fixtureDef) {
  var fixture = new b2Fixture();
  fixture.FromFixtureDef(fixtureDef);
  fixture._SetPtr(fixtureDef.shape._CreateFixture(this, fixtureDef));
  fixture.body = this;
  b2World._Push(fixture, this.fixtures);
  world.fixturesLookup[fixture.ptr] = fixture;
  fixture.SetFilterData(fixtureDef.filter);
  return fixture;
};

b2Body.prototype.CreateFixtureFromShape = function(shape, density) {
  var fixtureDef = new b2FixtureDef();
  fixtureDef.shape = shape;
  fixtureDef.density = density;
  return this.CreateFixtureFromDef(fixtureDef);
};

b2Body.prototype.DestroyFixture = function(fixture) {
  b2Body_DestroyFixture(this.ptr, fixture.ptr);
  b2World._RemoveItem(fixture, this.fixtures);
};

b2Body.prototype.GetAngle = function() {
  return b2Body_GetAngle(this.ptr);
};

b2Body.prototype.GetAngularVelocity = function() {
  return b2Body_GetAngularVelocity(this.ptr);
};

b2Body.prototype.GetInertia = function() {
  return b2Body_GetInertia(this.ptr);
};

b2Body.prototype.GetMass = function() {
  return b2Body_GetMass(this.ptr);
};

b2Body.prototype.GetLinearVelocity = function() {
  b2Body_GetLinearVelocity(this.ptr, _vec2Buf.byteOffset);
  var result = new Float32Array(_vec2Buf.buffer, _vec2Buf.byteOffset, _vec2Buf.length);
  return new b2Vec2(result[0], result[1]);
};

b2Body.prototype.GetLocalPoint = function(vec) {
  b2Body_GetLocalPoint(this.ptr, vec.x, vec.y, _vec2Buf.byteOffset);
  var result = new Float32Array(_vec2Buf.buffer, _vec2Buf.byteOffset, _vec2Buf.length);
  return new b2Vec2(result[0], result[1]);
};

b2Body.prototype.GetLocalVector = function(vec) {
  b2Body_GetLocalVector(this.ptr, vec.x, vec.y, _vec2Buf.byteOffset);
  var result = new Float32Array(_vec2Buf.buffer, _vec2Buf.byteOffset, _vec2Buf.length);
  return new b2Vec2(result[0], result[1]);
};

b2Body.prototype.GetPosition = function() {
  b2Body_GetPosition(this.ptr, _vec2Buf.byteOffset);
  var result = new Float32Array(_vec2Buf.buffer, _vec2Buf.byteOffset, _vec2Buf.length);
  return  new b2Vec2(result[0], result[1]);
};

b2Body.prototype.GetTransform = function() {
  var transform = new b2Transform();
  transform.p.x = this.buffer.getFloat32(b2Body_xf_offset, true);
  transform.p.y = this.buffer.getFloat32(b2Body_xf_offset+4, true);
  transform.q.s = this.buffer.getFloat32(b2Body_xf_offset+8, true);
  transform.q.c = this.buffer.getFloat32(b2Body_xf_offset+12, true);
  return transform;
};

b2Body.prototype.GetType = function() {
  return b2Body_GetType(this.ptr);
};

b2Body.prototype.GetUserData = function() {
  return this.buffer.getUint32(b2Body_userData_offset, true);
};

b2Body.prototype.GetWorldCenter = function() {
  b2Body_GetWorldCenter(this.ptr, _vec2Buf.byteOffset);
  var result = new Float32Array(_vec2Buf.buffer, _vec2Buf.byteOffset, _vec2Buf.length);
  return new b2Vec2(result[0], result[1]);
};

b2Body.prototype.GetWorldPoint = function(vec) {
  b2Body_GetWorldPoint(this.ptr, vec.x, vec.y, _vec2Buf.byteOffset);
  var result = new Float32Array(_vec2Buf.buffer, _vec2Buf.byteOffset, _vec2Buf.length);
  return new b2Vec2(result[0], result[1]);
};

b2Body.prototype.GetWorldVector = function(vec) {
  b2Body_GetWorldVector(this.ptr, vec.x, vec.y, _vec2Buf.byteOffset);
  var result = new Float32Array(_vec2Buf.buffer, _vec2Buf.byteOffset, _vec2Buf.length);
  return new b2Vec2(result[0], result[1]);
};

b2Body.prototype.SetAngularVelocity = function(angle) {
  b2Body_SetAngularVelocity(this.ptr, angle);
};

b2Body.prototype.SetAwake = function(flag) {
  b2Body_SetAwake(this.ptr, flag);
};

b2Body.prototype.SetFixedRotation = function(flag) {
  b2Body_SetFixedRotation(this.ptr, flag);
};

b2Body.prototype.SetLinearVelocity = function(v) {
  b2Body_SetLinearVelocity(this.ptr, v.x, v.y);
};

b2Body.prototype.SetMassData = function(massData) {
  b2Body_SetMassData(this.ptr, massData.mass, massData.center.x, massData.center.y, massData.I);
};

b2Body.prototype.SetTransform = function(v, angle) {
  b2Body_SetTransform(this.ptr, v.x, v.y, angle);
};

b2Body.prototype.SetType = function(type) {
  b2Body_SetType(this.ptr, type);
};

// General body globals
var b2_staticBody = 0;
var b2_kinematicBody = 1;
var b2_dynamicBody = 2;

/** @constructor */
function b2BodyDef() {
  this.active = true;
  this.allowSleep = true;
  this.angle = 0;
  this.angularVelocity = 0;
  this.angularDamping = 0;
  this.awake = true;
  this.bullet = false;
  this.fixedRotation = false;
  this.gravityScale = 1.0;
  this.linearDamping = 0;
  this.linearVelocity = new b2Vec2();
  this.position = new b2Vec2();
  this.type = b2_staticBody;
  this.userData = null;
}


text:
"""
Demos of time encoding and decoding algorithms that use spline
interpolation with IAF neurons.
"""

# Copyright (c) 2009-2015, Lev Givon
# All rights reserved.
# Distributed under the terms of the BSD license:
# http://www.opensource.org/licenses/bsd-license

import numpy as np

# Set matplotlib backend so that plots can be generated without a
# display:
import matplotlib
matplotlib.use('AGG')

from bionet.utils.misc import func_timer
import bionet.utils.band_limited as bl
import bionet.utils.plotting as pl
import bionet.ted.iaf as iaf

# For determining output plot file names:
output_name = 'iaf_spline_demo_'
output_count = 0
output_ext = '.png'

# Define algorithm parameters and input signal:
dur = 0.1
dt = 1e-6
f = 32
bw = 2*np.pi*f
t = np.arange(0, dur, dt)

np.random.seed(0)

noise_power = None
if noise_power == None:
    fig_title = 'IAF Input Signal with No Noise';
else:
    fig_title = 'IAF Input Signal with %d dB of Noise' % noise_power;
print fig_title
u = func_timer(bl.gen_band_limited)(dur, dt, f, noise_power)
pl.plot_signal(t, u, fig_title,
               output_name + str(output_count) + output_ext)

b = 3.5   # bias
d = 0.7   # threshold
R = 10.0  # resistance
C = 0.01  # capacitance

# Test leaky algorithms:

output_count += 1
fig_title = 'Signal Encoded Using Leaky IAF Encoder'
print fig_title
s = func_timer(iaf.iaf_encode)(u, dt, b, d, R, C)
pl.plot_encoded(t, u, s, fig_title,
                output_name + str(output_count) + output_ext)

output_count += 1
fig_title = 'Signal Decoded Using Leaky\nSpline Interpolation IAF Decoder'
print fig_title
u_rec = func_timer(iaf.iaf_decode_spline)(s, dur, dt, b, d, R, C)
pl.plot_compare(t, u, u_rec, fig_title,
                output_name + str(output_count) + output_ext)

# Test ideal algorithms:

R = np.inf

output_count += 1
fig_title = 'Signal Encoded Using Ideal IAF Encoder'
print fig_title
s = func_timer(iaf.iaf_encode)(u, dt, b, d, R, C)
pl.plot_encoded(t, u, s, fig_title,
                output_name + str(output_count) + output_ext)

output_count += 1
fig_title = 'Signal Decoded Using Ideal\nSpline Interpolation IAF Decoder'
print fig_title
u_rec = func_timer(iaf.iaf_decode_spline)(s, dur, dt, b, d, R, C)
pl.plot_compare(t, u, u_rec, fig_title,
                output_name + str(output_count) + output_ext)


text:
import React, { Component } from 'react';
import { withRouter } from 'react-router-dom';

class FormationDetail extends Component {
  render() {
    const id = this.props.match.params.id;
    return (

这是阵型{id}

    );
  }
}

export default withRouter(FormationDetail);