text:
NovAtel ProPak6 is a standalone GNSS receiver. It works with a separate NovAtel-supported IMU (in this case, the NovAtel IMU-IGM-A1)to provide localization functionality.

The IMU-IGM-A1 is an IMU that pairs with a SPAN-enabled GNSS receiver such as the SPAN ProPak6.

![novatel_pp6](images/Novatel_pp6.png)

The GPS Receiver/Antenna used with the GPS-IMU component is the **NovAtel GPS-703-GGG-HV**.

![gps_receiver](images/gps_receiver.png)

### Installing the GPS Receiver and Antenna

The installation instructions describe the procedure to mount, connect, and take the lever arm measurements for the GPS NovAtel SPAN® ProPak6™ **and** the NovAtel IMU-IGM-A1.

##### Components for the Installation

The components that are required for the installation include:

- NovAtel GPS SPAN ProPak6
- NovAtel IMU-IGM-A1
- NovAtel GPS-703-GGG-HV Antenna
- NovAtel GPS-C006 Cable (to connect antenna to GPS)
- NovAtel 01019014 Main Cable (to connect GPS to a serial port on the IPC)
- Data Transport Unit (DTU) – similar to a 4G router
- Magnetic adapters (for antenna and DTU)
- DB9 straight through cable

##### Mounting

You can place the two devices, the ProPak6 and the IMU in most places in the vehicle, but it is suggested that you follow these recommendations:

- Place and secure the ProPak6 and the IMU side-by-side inside the trunk with the Y-axis pointing forward.
- Mount the NovAtel GPS-703-GGG-HV antenna on top of the vehicle or on top of the trunk lid as shown:

![gps_receiver_on_car](images/gps_receiver_on_car.png)

- Use a magnetic adapter to tightly attach the antenna to the trunk lid.
- Install the antenna cable in the trunk by opening the trunk and placing the cable in the space between the trunk lid and the body of the car.

##### Wiring

Follow these steps to connect the ProPak6 GNSS Receiver and the IMU to the Apollo system:

* Use the split cable that comes with IMU-IGM-A1 to connect the IMU Main port and theProPak6 COM3/IMU port.
* Use a USB-A-to-MicroUSB cable to connect the USB port of the IPC and the MicroUSB port of the ProPak6.
* Connect the other end of the IMU-IGM-A1 split cable to the vehicle power.
* Connect the GNSS antenna to Propak6.
* Connect the Propak6 power cable.

![wiring](images/wiring.png)

#### Taking the Lever Arm Measurement

Follow these steps:

* Before taking the measurement, turn on the IPC.
* When the IMU and the GPS Antenna are in position, the distance from the IMU to the GPS Antenna must be measured. The center of the IMU and the center of the antenna are labeled on the exterior of the devices.
* The distance should be measured as: X offset, Y offset, and Z offset. The axis should be determined by the IMU. The error of offset must be within one centimeter to achieve high accuracy in positioning and localization.

### Configuring the GPS and IMU

Configure the GPS and IMU as shown below. This process can be done either by keying in the commands, or by loading batch configuraion file in NovAtel Connect.

```
WIFICONFIG STATE OFF
UNLOGALL THISPORT
CONNECTIMU COM3 IMU_ADIS16488
INSCOMMAND ENABLE
SETIMUORIENTATION 5
ALIGNMENTMODE AUTOMATIC
VEHICLEBODYROTATION 0 0 0
COM COM1 9600 N 8 1 N OFF OFF
COM COM2 9600 N 8 1 N OFF OFF
INTERFACEMODE COM1 NOVATEL NOVATEL ON
PPSCONTROL ENABLE POSITIVE 1.0 10000
MARKCONTROL MARK1 ENABLE POSITIVE
EVENTINCONTROL MARK1 ENABLE POSITIVE 0 2
interfacemode usb2 rtcmv3 none off
rtksource auto any
psrdiffsource auto any
SETIMUTOANTOFFSET 0.00 1.10866 1.14165 0.05 0.05 0.08
SETINSOFFSET 0 0 0
EVENTOUTCONTROL MARK2 ENABLE POSITIVE 999999990 10
EVENTOUTCONTROL MARK1 ENABLE POSITIVE 500000000 500000000

LOG COM2 GPRMC ONTIME 1.0 0.25
LOG USB1 GPGGA ONTIME 1.0

log USB1 bestgnssposb ontime 1
log USB1 bestgnssvelb ontime 1
log USB1 bestposb ontime 1
log USB1 INSPVAXB ontime 1
log USB1 INSPVASB ontime 0.01
log USB1 CORRIMUDATASB ontime 0.01
log USB1 RAWIMUSXB onnew 0 0
log USB1 mark1pvab onnew

log USB1 rangeb ontime 1
log USB1 bdsephemerisb
log USB1 gpsephemb
log USB1 gloephemerisb
log USB1 bdsephemerisb ontime 15
log USB1 gpsephemb ontime 15
log USB1 gloephemerisb ontime 15

log USB1 imutoantoffsetsb once
log USB1 vehiclebodyrotationb onchanged

SAVECONFIG
```

**![warning_icon](images/warning_icon.png) WARNING:** Modify the **<u>SETIMUTOANTOFFSET</u>** line based on the actual measurement (of the antenna and the IMU offset).

For example:

```
SETIMUTOANTOFFSET -0.05 0.5 0.8 0.05 0.05 0.08
```

The first 3 numbers indicate the result of the lever arm distance measurement. The last 3 numbers are the uncertainty of the measurement.

### References

For more information about the NovAtel SPAN ProPak6 and the IMU-IGM-A1, see:
* [NovAtel ProPak6 Installation & Operation Manual](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
* [NovAtel IMU-IGM-A1 Product Page](https://www.novatel.com/products/span-gnss-inertial-systems/span-imus/span-mems-imus/imu-igm-a1/#overview)

* [NovAtel GPS-703-GGG-HV](https://www.novatel.com/products/gnss-antennas/high-performance-gnss-antennas/gps-703-ggg-hv/)

## Disclaimer

This device is `Apollo Platform Supported`


text:
using ExcelDna.Integration;
using Microsoft.Office.Interop.Excel;

public class TestCommands
{
    // Defines a macro that uses the COM object model to add a diamond shape to the active sheet.
    [ExcelCommand(ShortCut = "^D")] // Ctrl+Shift+D
    public static void AddDiamond()
    {
        Application xlApp = (Application)ExcelDnaUtil.Application;
        string version = xlApp.Version;

        Worksheet ws = xlApp.ActiveSheet as Worksheet;  // Need to change type - it might be a Chart, then ws would be null
        Shape diamond = ws.Shapes.AddShape(Microsoft.Office.Core.MsoAutoShapeType.msoShapeDiamond, 10, 10, 100, 100);
        diamond.Fill.BackColor.RGB = (int)XlRgbColor.rgbSlateBlue;
    }
}

redpajama_set_name: RedPajamaGithub


text:
//
// Instruction.cs
//
// Author:
//   Jb Evain (jbevain@novell.com)
//
// (C) 2009 - 2010 Novell, Inc. (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

using System;
using System.Reflection.Emit;
using System.Text;

namespace Mono.Reflection
{

    sealed class Instruction
    {

        int offset;
        OpCode opcode;
        object operand;

        Instruction previous;
        Instruction next;

        public int Offset
        {
            get { return offset; }
        }

        public OpCode OpCode
        {
            get { return opcode; }
        }

        public object Operand
        {
            get { return operand; }
            internal set { operand = value; }
        }

        public Instruction Previous
        {
            get { return previous; }
            internal set { previous = value; }
        }

        public Instruction Next
        {
            get { return next; }
            internal set { next = value; }
        }

        public int Size
        {
            get
            {
                int size = opcode.Size;

                switch (opcode.OperandType)
                {
                    case OperandType.InlineSwitch:
                        size += (1 + ((int[])operand).Length) * 4;
                        break;
                    case OperandType.InlineI8:
                    case OperandType.InlineR:
                        size += 8;
                        break;
                    case OperandType.InlineBrTarget:
                    case OperandType.InlineField:
                    case OperandType.InlineI:
                    case OperandType.InlineMethod:
                    case OperandType.InlineString:
                    case OperandType.InlineTok:
                    case OperandType.InlineType:
                    case OperandType.ShortInlineR:
                        size += 4;
                        break;
                    case OperandType.InlineVar:
                        size += 2;
                        break;
                    case OperandType.ShortInlineBrTarget:
                    case OperandType.ShortInlineI:
                    case OperandType.ShortInlineVar:
                        size += 1;
                        break;
                }

                return size;
            }
        }

        internal Instruction(int offset, OpCode opcode)
        {
            this.offset = offset;
            this.opcode = opcode;
        }

        public override string ToString()
        {
            var instruction = new StringBuilder();

            AppendLabel(instruction, this);
            instruction.Append(':');
            instruction.Append(' ');
            instruction.Append(opcode.Name);

            if (operand == null)
                return instruction.ToString();

            instruction.Append(' ');

            switch (opcode.OperandType)
            {
                case OperandType.ShortInlineBrTarget:
                case OperandType.InlineBrTarget:
                    AppendLabel(instruction, (Instruction)operand);
                    break;
                case OperandType.InlineSwitch:
                    var labels = (Instruction[])operand;
                    for (int i = 0; i < labels.Length; i++)
                    {
                        if (i > 0)
                            instruction.Append(',');

                        AppendLabel(instruction, labels[i]);
                    }
                    break;
                case OperandType.InlineString:
                    instruction.Append('\"');
                    instruction.Append(operand);
                    instruction.Append('\"');
                    break;
                default:
                    instruction.Append(operand);
                    break;
            }

            return instruction.ToString();
        }

        static void AppendLabel(StringBuilder builder, Instruction instruction)
        {
            builder.Append("IL_");
            builder.Append(instruction.offset.ToString("x4"));
        }
    }
}


text:
#pragma once

#include <queue>
#include "../../blowbox/input/key.h"
#include "../../blowbox/memory/shared_ptr.h"
#include "../../blowbox/lua/lua_class.h"

namespace blowbox
{
	/**
	* @enum blowbox::KeyEvent
	* @brief A type of key event
	*/
	enum KeyEvent
	{
		Pressed,
		Down,
		Released
	};

	/**
	* @struct blowbox::KeyData
	* @brief Holds data about a key and its event
	*/
	struct KeyData
	{
		Key key;
		KeyEvent type;
	};

	/**
	* @struct blowbox::KeyState
	* @brief Keeps the state for any key
	*/
	struct KeyState
	{
		bool pressed;
		bool down;
		bool released;
	};

	/**
	* @class blowbox::Keyboard
	* @brief Manages the keyboard
	* @author Riko Ophorst
	*/
	class Keyboard: public LuaClass
	{
	public:
		/**
		* @brief Default constructor
		*/
		Keyboard();

		/**
		* @brief Lua Keyboard constructor
		* @param[in] L (lua_State*) the lua state
		*/
		Keyboard(lua_State* L);

		/**
		* @brief Default destructor
		*/
		~Keyboard();

		/**
		* @brief Retrieves a pointer to the Keyboard instance
		* @return A pointer to the Keyboard's instance
		*/
		static Keyboard*		Instance();

		/**
		* @brief Retrieves whether given Key is down
		* @return bool Is the Key down?
		*/
		bool&					IsDown(Key key);

		/**
		* @brief Retrieves whether given Key is pressed
		* @return bool Is the Key pressed?
		*/
		bool&					IsPressed(Key key);

		/**
		* @brief Retrieves whether given Key is released
		* @return bool Is the Key released?
		*/
		bool&					IsReleased(Key key);

		/**
		* @brief Retrieves the last key that was pressed
		* @return Key The key that was last pressed
		*/
		Key						LastKey();

		/**
		* @brief Receive an event
		* @param[in] evt (KeyData) The data of the event
		*/
		void					ReceiveEvent(KeyData evt);

		/**
		* @brief Reset all the states
		*/
		void					ResetStates();

		/**
		* @brief Update the keyboard
		*/
		void					Update();

		/**
		* @brief Registers this object's functions in lua
		* @param[in] L (lua_State*) the lua state
		*/
		static void LuaRegisterFunctions(lua_State* L);

		/**
		* @brief Is the key pressed?
		* @param[in] L (lua_State*) the lua state
		*/
		static int LuaIsPressed(lua_State* L);

		/**
		* @brief Is the key released?
		* @param[in] L (lua_State*) the lua state
		*/
		static int LuaIsReleased(lua_State* L);

		/**
		* @brief Is the key down?
		* @param[in] L (lua_State*) the lua state
		*/
		static int LuaIsDown(lua_State* L);

		/**
		* @brief Gets the last key
		* @param[in] L (lua_State*) the lua state
		*/
		static int LuaLastKey(lua_State* L);

		CLASSNAME("Keyboard");
	private:
		KeyState				keyStates_[255];
		Key						lastKey_;
		std::queue<KeyData>		queue_;
	};
}


text:
// Match Option
//
// Douglas Thrift
//
// MatchOption.cs

public enum MatchOption
{
    None,
    Set,
    Option,
}


text:
<!DOCTYPE html>
<!--
Copyright (C) 2016 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>gr-ranged-comment-layer</title>

<script src="../../../bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
<script src="../../../bower_components/web-component-tester/browser.js"></script>
<link rel="import" href="../../../test/common-test-setup.html"/>
<script src="../gr-diff/gr-diff-line.js"></script>

<link rel="import" href="gr-ranged-comment-layer.html">

<script>void(0);</script>

<test-fixture id="basic">
  <template>
    <gr-ranged-comment-layer></gr-ranged-comment-layer>
  </template>
</test-fixture>

<script>
  suite('gr-ranged-comment-layer', () => {
    let element;
    let sandbox;

    setup(() => {
      const initialComments = {
        left: [
          {
            id: '12345',
            line: 39,
            message: 'range comment',
            range: {
              end_character: 9,
              end_line: 39,
              start_character: 6,
              start_line: 36,
            },
          }, {
            id: '23456',
            line: 100,
            message: 'non range comment',
          },
        ],
        right: [
          {
            id: '34567',
            line: 10,
            message: 'range comment',
            range: {
              end_character: 22,
              end_line: 12,
              start_character: 10,
              start_line: 10,
            },
          }, {
            id: '45678',
            line: 100,
            message: 'single line range comment',
            range: {
              end_character: 15,
              end_line: 100,
              start_character: 5,
              start_line: 100,
            },
          }, {
            id: '8675309',
            line: 55,
            message: 'nonsense range',
            range: {
              end_character: 2,
              end_line: 55,
              start_character: 32,
              start_line: 55,
            },
          },
        ],
      };

      sandbox = sinon.sandbox.create();
      element = fixture('basic');
      element.comments = initialComments;
    });

    teardown(() => {
      sandbox.restore();
    });

    suite('annotate', () => {
      let sandbox;
      let el;
      let line;
      let annotateElementStub;

      setup(() => {
        sandbox = sinon.sandbox.create();
        annotateElementStub = sandbox.stub(GrAnnotation, 'annotateElement');
        el = document.createElement('div');
        el.setAttribute('data-side', 'left');
        line = new GrDiffLine(GrDiffLine.Type.BOTH);
        line.text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit,';
      });

      teardown(() => {
        sandbox.restore();
      });

      test('type=Remove no-comment', () => {
        line.type = GrDiffLine.Type.REMOVE;
        line.beforeNumber = 40;

        element.annotate(el, line);

        assert.isFalse(annotateElementStub.called);
      });

      test('type=Remove has-comment', () => {
        line.type = GrDiffLine.Type.REMOVE;
        line.beforeNumber = 36;
        const expectedStart = 6;
        const expectedLength = line.text.length - expectedStart;

        element.annotate(el, line);

        assert.isTrue(annotateElementStub.called);
        const lastCall = annotateElementStub.lastCall;
        assert.equal(lastCall.args[0], el);
        assert.equal(lastCall.args[1], expectedStart);
        assert.equal(lastCall.args[2], expectedLength);
        assert.equal(lastCall.args[3], 'range');
      });

      test('type=Remove has-comment hovering', () => {
        line.type = GrDiffLine.Type.REMOVE;
        line.beforeNumber = 36;
        element.set(['comments', 'left', 0, '__hovering'], true);

        const expectedStart = 6;
        const expectedLength = line.text.length - expectedStart;

        element.annotate(el, line);

        assert.isTrue(annotateElementStub.called);
        const lastCall = annotateElementStub.lastCall;
        assert.equal(lastCall.args[0], el);
        assert.equal(lastCall.args[1], expectedStart);
        assert.equal(lastCall.args[2], expectedLength);
        assert.equal(lastCall.args[3], 'rangeHighlight');
      });

      test('type=Both has-comment', () => {
        line.type = GrDiffLine.Type.BOTH;
        line.beforeNumber = 36;

        const expectedStart = 6;
        const expectedLength = line.text.length - expectedStart;

        element.annotate(el, line);

        assert.isTrue(annotateElementStub.called);
        const lastCall = annotateElementStub.lastCall;
        assert.equal(lastCall.args[0], el);
        assert.equal(lastCall.args[1], expectedStart);
        assert.equal(lastCall.args[2], expectedLength);
        assert.equal(lastCall.args[3], 'range');
      });

      test('type=Both has-comment off side', () => {
        line.type = GrDiffLine.Type.BOTH;
        line.beforeNumber = 36;
        el.setAttribute('data-side', 'right');

        element.annotate(el, line);

        assert.isFalse(annotateElementStub.called);
      });

      test('type=Add has-comment', () => {
        line.type = GrDiffLine.Type.ADD;
        line.afterNumber = 12;
        el.setAttribute('data-side', 'right');

        const expectedStart = 0;
        const expectedLength = 22;

        element.annotate(el, line);

        assert.isTrue(annotateElementStub.called);
        const lastCall = annotateElementStub.lastCall;
        assert.equal(lastCall.args[0], el);
        assert.equal(lastCall.args[1], expectedStart);
        assert.equal(lastCall.args[2], expectedLength);
        assert.equal(lastCall.args[3], 'range');
      });
    });

    test('_handleCommentChange overwrite', () => {
      const handlerSpy = sandbox.spy(element, '_handleCommentChange');
      const mapSpy = sandbox.spy(element, '_computeCommentMap');

      element.set('comments', {left: [], right: []});

      assert.isTrue(handlerSpy.called);
      assert.equal(mapSpy.callCount, 2);

      assert.equal(Object.keys(element._commentMap.left).length, 0);
      assert.equal(Object.keys(element._commentMap.right).length, 0);
    });

    test('_handleCommentChange hovering', () => {
      const handlerSpy = sandbox.spy(element, '_handleCommentChange');
      const mapSpy = sandbox.spy(element, '_computeCommentMap');
      const notifyStub = sinon.stub();
      element.addListener(notifyStub);

      element.set(['comments', 'right', 0, '__hovering'], true);

      assert.isTrue(handlerSpy.called);
      assert.isTrue(mapSpy.called);

      assert.isTrue(notifyStub.called);
      const lastCall = notifyStub.lastCall;
      assert.equal(lastCall.args[0], 10);
      assert.equal(lastCall.args[1], 12);
      assert.equal(lastCall.args[2], 'right');
    });

    test('_handleCommentChange splice out', () => {
      const handlerSpy = sandbox.spy(element, '_handleCommentChange');
      const mapSpy = sandbox.spy(element, '_computeCommentMap');
      const notifyStub = sinon.stub();
      element.addListener(notifyStub);

      element.splice('comments.right', 0, 1);

      assert.isTrue(handlerSpy.called);
      assert.isTrue(mapSpy.called);

      assert.isTrue(notifyStub.called);
      const lastCall = notifyStub.lastCall;
      assert.equal(lastCall.args[0], 10);
      assert.equal(lastCall.args[1], 12);
      assert.equal(lastCall.args[2], 'right');
    });

    test('_handleCommentChange splice in', () => {
      const handlerSpy = sandbox.spy(element, '_handleCommentChange');
      const mapSpy = sandbox.spy(element, '_computeCommentMap');
      const notifyStub = sinon.stub();
      element.addListener(notifyStub);

      element.splice('comments.left', element.comments.left.length, 0, {
        id: '56123',
        line: 250,
        message: 'new range comment',
        range: {
          end_character: 15,
          end_line: 275,
          start_character: 5,
          start_line: 250,
        },
      });

      assert.isTrue(handlerSpy.called);
      assert.isTrue(mapSpy.called);

      assert.isTrue(notifyStub.called);
      const lastCall = notifyStub.lastCall;
      assert.equal(lastCall.args[0], 250);
      assert.equal(lastCall.args[1], 275);
      assert.equal(lastCall.args[2], 'left');
    });

    test('_computeCommentMap creates maps correctly', () => {
      // There is only one ranged comment on the left, but it spans ll.36-39.
      const leftKeys = [];
      for (let i = 36; i <= 39; i++) { leftKeys.push('' + i); }
      assert.deepEqual(Object.keys(element._commentMap.left).sort(),
          leftKeys.sort());

      assert.equal(element._commentMap.left[36].length, 1);
      assert.equal(element._commentMap.left[36][0].start, 6);
      assert.equal(element._commentMap.left[36][0].end, -1);

      assert.equal(element._commentMap.left[37].length, 1);
      assert.equal(element._commentMap.left[37][0].start, 0);
      assert.equal(element._commentMap.left[37][0].end, -1);

      assert.equal(element._commentMap.left[38].length, 1);
      assert.equal(element._commentMap.left[38][0].start, 0);
      assert.equal(element._commentMap.left[38][0].end, -1);

      assert.equal(element._commentMap.left[39].length, 1);
      assert.equal(element._commentMap.left[39][0].start, 0);
      assert.equal(element._commentMap.left[39][0].end, 9);

      // The right has two ranged comments, one spanning ll.10-12 and the other
      // on line 100.
      const rightKeys = [];
      for (let i = 10; i <= 12; i++) { rightKeys.push('' + i); }
      rightKeys.push('55', '100');
      assert.deepEqual(Object.keys(element._commentMap.right).sort(),
          rightKeys.sort());

      assert.equal(element._commentMap.right[10].length, 1);
      assert.equal(element._commentMap.right[10][0].start, 10);
      assert.equal(element._commentMap.right[10][0].end, -1);

      assert.equal(element._commentMap.right[11].length, 1);
      assert.equal(element._commentMap.right[11][0].start, 0);
      assert.equal(element._commentMap.right[11][0].end, -1);

      assert.equal(element._commentMap.right[12].length, 1);
      assert.equal(element._commentMap.right[12][0].start, 0);
      assert.equal(element._commentMap.right[12][0].end, 22);

      assert.equal(element._commentMap.right[100].length, 1);
      assert.equal(element._commentMap.right[100][0].start, 5);
      assert.equal(element._commentMap.right[100][0].end, 15);
    });

    test('_getRangesForLine normalizes invalid ranges', () => {
      const line = {
        afterNumber: 55,
        text: '_getRangesForLine normalizes invalid ranges',
      };
      const ranges = element._getRangesForLine(line, 'right');
      assert.equal(ranges.length, 1);
      const range = ranges[0];
      assert.isTrue(range.start < range.end, 'start and end are normalized');
      assert.equal(range.end, line.text.length);
    });
  });
</script>


text:
@interface R2RAgency : NSObject

@property (strong, nonatomic) NSString *code;
@property (strong, nonatomic) NSString *name;
@property (strong, nonatomic) NSURL *url;
@property (strong, nonatomic) NSString *iconPath;
@property (nonatomic) CGPoint iconOffset;
@property (nonatomic) CGSize iconSize;

@end


text:
module Rspec
  module Rails23
    module TransactionalDatabaseSupport

      module InstanceMethods

        def active_record_configured?
          defined?(::ActiveRecord) && !::ActiveRecord::Base.configurations.blank?
        end

        def transactional_protection_start
          return unless active_record_configured?

          ::ActiveRecord::Base.connection.increment_open_transactions
          ::ActiveRecord::Base.connection.begin_db_transaction
        end

        def transactional_protection_cleanup
          return unless active_record_configured?

          if ::ActiveRecord::Base.connection.open_transactions != 0
            ::ActiveRecord::Base.connection.rollback_db_transaction
            ::ActiveRecord::Base.connection.decrement_open_transactions
          end

          ::ActiveRecord::Base.clear_active_connections!
        end

      end

      def self.extended(kls)
        kls.send(:include, InstanceMethods)
        kls.before { transactional_protection_start }
        kls.after { transactional_protection_cleanup }
      end

    end
  end
end


text:
from __future__ import unicode_literals

import json
import sys

terrain_tilesets = {
  'land': ['land_grass', 'land_concrete', 'land_brick', 'land_wood'],
  'hitech': [None, None, None, 'hitech_plate']
}

door_tilesets = {
  'door': ['door']
}

wall_tilesets = {
  'walls': ['wall_ud', 'wall_ul', 'wall_uld', 'wall_uldr']
}

def merge_dicts(*dict_args):
  result = {}
  for dictionary in dict_args:
    result.update(dictionary)
  return result

def terrain_tile_to_sprite_name(tileset_name, tile_id):
  return terrain_tilesets[tileset_name][tile_id]

def entity_tile_to_entity_name(tileset_name, tile_id):
  entity_tilesets = merge_dicts(door_tilesets, wall_tilesets)
  return entity_tilesets[tileset_name][tile_id]

def id_to_tile(id, tm):
  assert id > 0
  last_tileset = None
  for tileset in tm['tilesets']:
    if id >= tileset['firstgid']:
      last_tileset = tileset
      continue
  tileset_name = last_tileset['image'].split('/')[-1].split('.')[0]
  tile_id = id - last_tileset['firstgid']
  return (tileset_name, tile_id)

def get_layer(tm, layer_name):
  for layer in tm['layers']:
    if layer['name'] == layer_name:
      return layer
  assert False

assert len(sys.argv) == 2
src = sys.argv[1]

tm = json.loads(open(src).read())

m = {}
m['width'] = tm['width']
m['height'] = tm['height']
m['block_size'] = float(tm['tilewidth'])

m['terrain'] = []
for id in get_layer(tm, 'Terrain')['data']:
  m['terrain'].append(terrain_tile_to_sprite_name(*id_to_tile(id, tm)))

m['spawns'] = []
for i, id in enumerate(get_layer(tm, 'Control')['data']):
  if id == 0:
    continue
  x = i % m['width']
  y = i / m['width']
  tileset_name, tile_id = id_to_tile(id, tm)
  assert tileset_name == 'control'
  assert tile_id == 0
  m['spawns'].append({'x': x, 'y': y})

m['kits'] = [{'entity': 'health_kit', 'x': 1, 'y': 1}]

m['doors'] = []
m['walls'] = []
for i, id in enumerate(get_layer(tm, 'Entity')['data']):
  if id == 0:
    continue

  flipped_hori = False if id & 0x80000000 == 0 else True
  flipped_vert = False if id & 0x40000000 == 0 else True
  flipped_diag = False if id & 0x20000000 == 0 else True
  # FFF => 0, TFT => 90, TTF => 180, FTT => 270
  if (flipped_hori, flipped_vert, flipped_diag) == (False, False, False):
    rotation = 0;
  elif (flipped_hori, flipped_vert, flipped_diag) == (True, False, True):
    rotation = 90
  elif (flipped_hori, flipped_vert, flipped_diag) == (True, True, False):
    rotation = 180
  elif (flipped_hori, flipped_vert, flipped_diag) == (False, True, True):
    rotation = 270
  else:
    assert False
  id &= ~(0x80000000 | 0x40000000 | 0x20000000)

  x = i % m['width']
  y = i / m['width']
  tileset_name, tile_id = id_to_tile(id, tm)
  entity_name = entity_tile_to_entity_name(tileset_name, tile_id)
  entity = {'entity': entity_name, 'x': x, 'y': y, 'rotation': rotation}

  if tileset_name in door_tilesets.keys():
    m['doors'].append(entity)
  elif tileset_name in wall_tilesets.keys():
    m['walls'].append(entity)
  else:
    assert False

print json.dumps(m, indent=4, separators=(',', ': '))


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.sheets.v4.model;

/**
 * Styles for a waterfall chart column.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Google Sheets API. For a detailed explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class WaterfallChartColumnStyle extends com.google.api.client.json.GenericJson {

  /**
   * The color of the column.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private Color color;

  /**
   * The label of the column's legend.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String label;

  /**
   * The color of the column.
   * @return value or {@code null} for none
   */
  public Color getColor() {
    return color;
  }

  /**
   * The color of the column.
   * @param color color or {@code null} for none
   */
  public WaterfallChartColumnStyle setColor(Color color) {
    this.color = color;
    return this;
  }

  /**
   * The label of the column's legend.
   * @return value or {@code null} for none
   */
  public java.lang.String getLabel() {
    return label;
  }

  /**
   * The label of the column's legend.
   * @param label label or {@code null} for none
   */
  public WaterfallChartColumnStyle setLabel(java.lang.String label) {
    this.label = label;
    return this;
  }

  @Override
  public WaterfallChartColumnStyle set(String fieldName, Object value) {
    return (WaterfallChartColumnStyle) super.set(fieldName, value);
  }

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

}


text:
%ramonify upload

%% UPLOAD PAINT

oo = OCP();
oo.setServerLocation('brainviz1.cs.jhu.edu')
oo.setAnnoToken(uploadToken);
oo.setAnnoChannel('neurons');
seg.setChannel('neurons');
oo.createAnnotation(seg)

oo.setAnnoChannel('synapses');
syn.setDataType(eRAMONChannelDataType.uint32);
syn.setChannelType(eRAMONChannelType.annotation);
oo.createAnnotation(syn);

%% Segments
oo.setAnnoToken(uploadToken);
oo.setAnnoChannel('neurons');
for i = 1:length(s)
    i
    S = RAMONSegment;
    S.setId(s(i).id);
    S.setName(s(i).name);
    S.setNeuron(s(i).neuron);
    S.setClass(s(i).segment_class);
    S.setResolution(s(i).resolution);
    S.addDynamicMetadata('segment_subtype',s(i).segment_subtype);
    S.setSynapses(unique(s(i).synapses));

    is_spine = 0;
    if isfield(s(i),'is_spine')
        is_spine = s(i).is_spine;
    end
    S.addDynamicMetadata('is_spine', is_spine);
    S.addDynamicMetadata('spine_str',num2str(is_spine));
    S.addDynamicMetadata('synapse',num2str(unique(s(i).synapses)));
    oo.createAnnotation(S);
end

%% Neurons

for i = 1:length(n)
    i
    N = RAMONNeuron;

    N.setId(n(i).id);
    N.setSegments(n(i).neuron_segment);
    oo.createAnnotation(N);
end

%% Synapses
oo.setAnnoChannel('synapses')

for i = 1:length(y)
    i
    Y = RAMONSynapse;
    Y.setId(y(i).id);
    Y.setResolution(y(i).resolution);

    Y.addSegment(y(i).presynaptic, eRAMONFlowDirection.preSynaptic);
    Y.addSegment(y(i).postsynaptic, eRAMONFlowDirection.postSynaptic);
    Y.addDynamicMetadata('psdSize',y(i).psdSize);
    Y.addDynamicMetadata('synapseLocation',y(i).synapseLocation);
    Y.addDynamicMetadata('multiSynapseBouton',y(i).multiSynapseBouton);
    Y.addDynamicMetadata('vesicleCount',y(i).vesicleCount);
    Y.addDynamicMetadata('axonSynapseType',y(i).axonSynapseType);
    Y.addDynamicMetadata('presynaptic',y(i).presynaptic);
    Y.addDynamicMetadata('postsynaptic',y(i).postsynaptic);
    Y.addDynamicMetadata('centroidx_um',num2str(y(i).centroid(1)));
    Y.addDynamicMetadata('centroidy_um',num2str(y(i).centroid(2)));
    Y.addDynamicMetadata('centroidz_um',num2str(y(i).centroid(3)));
    %Y.addDynamicMetadata('centroid_um',[num2str(y(i).centroid(1)),',',num2str(y(i).centroid(2)),',',num2str(y(i).centroid(3))]);
    oo.createAnnotation(Y);
end


text:
local R = require "rigel"
local RM = require "generators.modules"
local types = require("types")
local harness = require "generators.harness"
local harris = require "harris_core"
local C = require "generators.examplescommon"
local f = require "fixed_float"
local G = require "generators.core"

W = 256
H = 256

T = 8

FILTER_FIFO = 128
FILTER_OUTPUT_CNT = 510

----------------
local inp = f.parameter("inp16to8",types.tuple{types.uint(16),types.uint(16)})
local out = f.array2d({inp:index(0):cast(types.uint(8)),inp:index(1):cast(types.uint(8))},2,1)
out = out:disablePipelining()
local touint8pair = out:toRigelModule("touint8pair")
----------------
-- harris -> pos fn
ITYPE = types.array2d(types.uint(8),1)

local inpraw = R.input( types.rv(types.Par(types.array2d(types.bool(),1))) )
local inp = R.apply("ir0", C.index(types.array2d(types.bool(),1),0,0), inpraw)

local PS = RM.posSeq(W,H,1)
local pos = R.apply("posseq", PS, G.ValueToTrigger(inpraw) )
local pos = R.apply("idx0", C.index(PS.outputType:extractData(),0,0), pos )
local pos = R.apply("cst", touint8pair, pos)

local fsinp = R.concat("PTT",{pos,inp})
local out = R.apply("FS",RM.filterSeq(types.array2d(types.uint(8),2),W,H,{FILTER_OUTPUT_CNT,W*H},FILTER_FIFO,false,nil,false),fsinp)
local filterfn = RM.lambda( "filterfnmodule", inpraw, out )

----------------

ITYPE = types.array2d(types.uint(8),T)
OTYPE = types.array2d(types.array2d(types.uint(8),2),T/2)

local inpraw = R.input(R.Handshake(ITYPE))
local inp = R.apply("reducerate", RM.changeRate(types.uint(8),1,8,1), inpraw )
local harrisFn = harris.makeHarris(W,H,true)
local out = R.apply("harrisfilterinst", harrisFn, inp )
local out = R.apply("filt", RM.liftHandshake(RM.liftDecimate(filterfn)), out)
local out = R.apply("AO",RM.makeHandshake(C.arrayop(types.array2d(types.uint(8),2),1,1)),out)
--local out = R.apply("incrate", RM.liftHandshake(RM.changeRate(types.array2d(types.uint(8),2),1,1,4)), out )
fn = RM.lambda( "harris", inpraw, out )

--harness.axi( "harris_filterseq", fn, "box_256.raw", nil, nil, ITYPE, T,W,H, OTYPE,T/2,(W*H)/FILTER_RATE,1)
harness{ outFile="harris_filterseq", fn=fn, inFile="box_256.raw", inSize={W,H}, outSize={FILTER_OUTPUT_CNT,1} }


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mycol. eur. (Erlanga) 2: 40 (1825)

#### Original name
Boletus leucomelas Pers., 1801

### Remarks
null


text:
#include "config.h"
#include "NetscapePlugin.h"

#include "PluginController.h"
#include "WebEvent.h"
#include <WebCore/GraphicsContext.h>
#include <WebCore/LocalWindowsContext.h>
#include <WebCore/NotImplemented.h>

using namespace WebCore;

extern "C" HINSTANCE gInstance;

namespace WebKit {

static LPCWSTR windowClassName = L"org.webkit.NetscapePluginWindow";

static void registerPluginView()
{
    static bool didRegister;
    if (didRegister)
        return;
    didRegister = true;

    WNDCLASSW windowClass = {0};
    windowClass.style = CS_DBLCLKS;
    windowClass.lpfnWndProc = ::DefWindowProcW;
    windowClass.hInstance = gInstance;
    windowClass.hCursor = ::LoadCursorW(0, IDC_ARROW);
    windowClass.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_WINDOW + 1);
    windowClass.lpszClassName = windowClassName;

    ::RegisterClassW(&windowClass);
}

HWND NetscapePlugin::containingWindow() const
{
    return m_pluginController->nativeParentWindow();
}

bool NetscapePlugin::platformPostInitialize()
{
    if (!m_isWindowed) {
        m_window = 0;
        return true;
    }

    registerPluginView();

    m_window = ::CreateWindowExW(0, windowClassName, 0, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, containingWindow(), 0, 0, 0);
    if (!m_window)
        return false;

    // FIXME: Do we need to pass our window to setPlatformWidget?
    // FIXME: WebCore::PluginView sets the window proc to DefWindowProcA here for Shockwave Director.

    m_npWindow.type = NPWindowTypeWindow;
    m_npWindow.window = m_window;

    return true;
}

void NetscapePlugin::platformDestroy()
{
    if (!m_isWindowed) {
        ASSERT(!m_window);
        return;
    }

    if (!::IsWindow(m_window))
        return;
    ::DestroyWindow(m_window);
}

bool NetscapePlugin::platformInvalidate(const IntRect& invalidRect)
{
    if (!m_isWindowed)
        return false;

    RECT rect = invalidRect;
    ::InvalidateRect(m_window, &rect, FALSE);
    return true;
}

enum RedrawOrNot { DoNotRedraw, Redraw };
static void setWindowRegion(HWND window, PassOwnPtr<HRGN> popRegion, RedrawOrNot redrawOrNot)
{
    OwnPtr<HRGN> region = popRegion;

    if (!::SetWindowRgn(window, region.get(), redrawOrNot == Redraw))
        return;

    // Windows owns the region now.
    region.leakPtr();
}

void NetscapePlugin::platformGeometryDidChange()
{
    if (!m_isWindowed)
        return;

    IntRect clipRectInPluginWindowCoordinates = m_clipRect;
    clipRectInPluginWindowCoordinates.move(-m_frameRect.x(), -m_frameRect.y());

    OwnPtr<HRGN> clipRegion = adoptPtr(::CreateRectRgn(clipRectInPluginWindowCoordinates.x(), clipRectInPluginWindowCoordinates.y(), clipRectInPluginWindowCoordinates.maxX(), clipRectInPluginWindowCoordinates.maxY()));
    setWindowRegion(m_window, clipRegion.release(), Redraw);

    // FIXME: We should only update the size here and let the UI process update our position so
    // that we can keep our position in sync when scrolling, etc.
    ::MoveWindow(m_window, m_frameRect.x(), m_frameRect.y(), m_frameRect.width(), m_frameRect.height(), TRUE);
}

void NetscapePlugin::platformPaint(GraphicsContext* context, const IntRect& dirtyRect, bool)
{
    // FIXME: Call SetWindow here if we haven't called it yet (see r59904).

    if (m_isWindowed) {
        // FIXME: Paint windowed plugins into context if context->shouldIncludeChildWindows() is true.
        return;
    }

    // FIXME: Support transparent plugins.
    LocalWindowsContext windowsContext(context, dirtyRect, false);

    m_npWindow.type = NPWindowTypeDrawable;
    m_npWindow.window = windowsContext.hdc();

    WINDOWPOS windowpos = { 0, 0, 0, 0, 0, 0, 0 };

    windowpos.x = m_frameRect.x();
    windowpos.y = m_frameRect.y();
    windowpos.cx = m_frameRect.width();
    windowpos.cy = m_frameRect.height();

    NPEvent npEvent;
    npEvent.event = WM_WINDOWPOSCHANGED;
    npEvent.wParam = 0;
    npEvent.lParam = reinterpret_cast<uintptr_t>(&windowpos);

    NPP_HandleEvent(&npEvent);

    callSetWindow();

    RECT dirtyWinRect = dirtyRect;

    npEvent.event = WM_PAINT;
    npEvent.wParam = reinterpret_cast<uintptr_t>(windowsContext.hdc());
    npEvent.lParam = reinterpret_cast<uintptr_t>(&dirtyWinRect);

    NPP_HandleEvent(&npEvent);
}

NPEvent toNP(const WebMouseEvent& event)
{
    NPEvent npEvent;

    npEvent.wParam = 0;
    if (event.controlKey())
        npEvent.wParam |= MK_CONTROL;
    if (event.shiftKey())
        npEvent.wParam |= MK_SHIFT;

    npEvent.lParam = MAKELPARAM(event.position().x(), event.position().y());

    switch (event.type()) {
    case WebEvent::MouseMove:
        npEvent.event = WM_MOUSEMOVE;
        switch (event.button()) {
        case WebMouseEvent::LeftButton:
            npEvent.wParam |= MK_LBUTTON;
            break;
        case WebMouseEvent::MiddleButton:
            npEvent.wParam |= MK_MBUTTON;
            break;
        case WebMouseEvent::RightButton:
            npEvent.wParam |= MK_RBUTTON;
            break;
        case WebMouseEvent::NoButton:
            break;
        }
        break;
    case WebEvent::MouseDown:
        switch (event.button()) {
        case WebMouseEvent::LeftButton:
            npEvent.event = WM_LBUTTONDOWN;
            break;
        case WebMouseEvent::MiddleButton:
            npEvent.event = WM_MBUTTONDOWN;
            break;
        case WebMouseEvent::RightButton:
            npEvent.event = WM_RBUTTONDOWN;
            break;
        case WebMouseEvent::NoButton:
            ASSERT_NOT_REACHED();
            break;
        }
        break;
    case WebEvent::MouseUp:
        switch (event.button()) {
        case WebMouseEvent::LeftButton:
            npEvent.event = WM_LBUTTONUP;
            break;
        case WebMouseEvent::MiddleButton:
            npEvent.event = WM_MBUTTONUP;
            break;
        case WebMouseEvent::RightButton:
            npEvent.event = WM_RBUTTONUP;
            break;
        case WebMouseEvent::NoButton:
            ASSERT_NOT_REACHED();
            break;
        }
        break;
    default:
        ASSERT_NOT_REACHED();
        break;
    }

    return npEvent;
}

bool NetscapePlugin::platformHandleMouseEvent(const WebMouseEvent& event)
{
    if (m_isWindowed)
        return false;

    NPEvent npEvent = toNP(event);
    NPP_HandleEvent(&npEvent);
    return true;
}

bool NetscapePlugin::platformHandleWheelEvent(const WebWheelEvent&)
{
    notImplemented();
    return false;
}

void NetscapePlugin::platformSetFocus(bool)
{
    notImplemented();
}

bool NetscapePlugin::platformHandleMouseEnterEvent(const WebMouseEvent& event)
{
    if (m_isWindowed)
        return false;

    NPEvent npEvent = toNP(event);
    NPP_HandleEvent(&npEvent);
    return true;
}

bool NetscapePlugin::platformHandleMouseLeaveEvent(const WebMouseEvent& event)
{
    if (m_isWindowed)
        return false;

    NPEvent npEvent = toNP(event);
    NPP_HandleEvent(&npEvent);
    return true;
}

bool NetscapePlugin::platformHandleKeyboardEvent(const WebKeyboardEvent&)
{
    notImplemented();
    return false;
}

} // namespace WebKit


text:
package com.github.sbugat.samplerest.web.security;

import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;

public class NoOpAuthenticationManager implements AuthenticationManager {

	@Override
	public Authentication authenticate(final Authentication authentication) throws AuthenticationException {
		// TODO Auto-generated method stub
		return authentication;
	}

}


text:
package Nov2020Leetcode;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public class _0645SetMismatch {

	public static void main(String[] args) {
		System.out.println(Arrays.toString(findErrorNums(new int[] { 1, 2, 2, 4 })));
	}

	public static int[] findErrorNums(int[] nums) {
		Set<Integer> set = new HashSet<Integer>();
		int sum = 0;
		int repeatedNumber = 0;
		for (int i = 0; i < nums.length; i++) {
			sum += nums[i];
			if (set.contains(nums[i])) {
				repeatedNumber = nums[i];
			}
			set.add(nums[i]);
		}
		sum -= repeatedNumber;
		int totalSum = nums.length * (nums.length + 1) / 2;
		int missingNumber = totalSum - sum;
		return new int[] { repeatedNumber, missingNumber };
	}
}


text:
@interface TPSCardField () <STPPaymentCardTextFieldDelegate>
@end

@implementation TPSCardField {
    // Relates to a Deprecated API -- clean this up after RN 0.45 or lower support is dropped
    BOOL _jsRequestingFirstResponder;
    BOOL _isFirstResponder;

    STPPaymentCardTextField *_paymentCardTextField;
}

- (instancetype)initWithFrame:(CGRect)frame {
    if ((self = [super initWithFrame:frame])) {
        _isFirstResponder = NO;
        _paymentCardTextField = [[STPPaymentCardTextField alloc] initWithFrame:self.bounds];
        _paymentCardTextField.delegate = self;
        [self addSubview:_paymentCardTextField];
        self.backgroundColor = [UIColor clearColor];
    }
    return self;
}

- (void)reactSetFrame:(CGRect)frame {
    [super reactSetFrame:frame];
    _paymentCardTextField.frame = self.bounds;
}

- (void)reactFocus {
    _jsRequestingFirstResponder = YES;
    [self becomeFirstResponder];
}

- (void)reactFocusIfNeeded {
    if (!_isFirstResponder) {
        [self reactFocus];
    }
}

- (void)reactBlur {
    _jsRequestingFirstResponder = NO;
    [self resignFirstResponder];
}

- (BOOL)canBecomeFirstResponder {
    return _jsRequestingFirstResponder;
}

- (void)didMoveToWindow {
    if (_jsRequestingFirstResponder) {
        [_paymentCardTextField becomeFirstResponder];
        _jsRequestingFirstResponder = NO;
    }
}

- (void)keyboardWillShow:(NSNotification *)n {
    if (!_jsRequestingFirstResponder && !_isFirstResponder) {
        [_paymentCardTextField resignFirstResponder];
    }
}

- (BOOL)becomeFirstResponder {
    _isFirstResponder = YES;
    return [_paymentCardTextField becomeFirstResponder];
}

- (BOOL)resignFirstResponder {
    _jsRequestingFirstResponder = NO;
    _isFirstResponder = NO;
    return [_paymentCardTextField resignFirstResponder];
}

#pragma mark -

- (UIFont *)font {
    return _paymentCardTextField.font;
}

- (void)setFont:(UIFont*)font {
    _paymentCardTextField.font = font;
}

- (UIColor *)textColor {
    return _paymentCardTextField.textColor;
}

- (void)setTextColor:(UIColor *)textColor {
    _paymentCardTextField.textColor = textColor;
}

- (UIColor *)borderColor {
    return _paymentCardTextField.borderColor;
}

- (void)setBorderColor:(UIColor *)borderColor {
    _paymentCardTextField.borderColor = borderColor;
}

- (CGFloat)borderWidth {
    return _paymentCardTextField.borderWidth;
}

- (void)setBorderWidth:(CGFloat)borderWidth {
    _paymentCardTextField.borderWidth = borderWidth;
}

- (CGFloat)cornerRadius {
    return _paymentCardTextField.cornerRadius;
}

- (void)setCornerRadius:(CGFloat)cornerRadius {
    _paymentCardTextField.cornerRadius = cornerRadius;
}

- (UIColor *)cursorColor {
    return _paymentCardTextField.cursorColor;
}

- (void)setCursorColor:(UIColor *)cursorColor {
    _paymentCardTextField.cursorColor = cursorColor;
}

- (UIColor *)textErrorColor {
    return _paymentCardTextField.textErrorColor;
}

- (void)setTextErrorColor:(UIColor *)textErrorColor {
    _paymentCardTextField.textErrorColor = textErrorColor;
}

- (NSString *)numberPlaceholder {
    return _paymentCardTextField.numberPlaceholder;
}

- (void)setNumberPlaceholder:(NSString *)numberPlaceholder {
    _paymentCardTextField.numberPlaceholder = numberPlaceholder;
}

- (NSString *)expirationPlaceholder {
    return _paymentCardTextField.expirationPlaceholder;
}

- (void)setExpirationPlaceholder:(NSString *)placeholder {
    _paymentCardTextField.expirationPlaceholder = placeholder;
}

- (NSString *)cvcPlaceholder {
    return _paymentCardTextField.cvcPlaceholder;
}

- (void)setCvcPlaceholder:(NSString *)cvcPlaceholder {
    _paymentCardTextField.cvcPlaceholder = cvcPlaceholder;
}

- (UIColor *)placeholderColor {
    return _paymentCardTextField.placeholderColor;
}

- (void)setPlaceholderColor:(UIColor *)placeholderColor {
    _paymentCardTextField.placeholderColor = placeholderColor;
}

- (void)setCardParams:(STPPaymentMethodCardParams *)cardParams {
    // Remove delegate before update paymentCardTextField with prefilled card
    // for preventing call paymentCardTextFieldDidChange for every fields
    _paymentCardTextField.delegate = nil;
    [_paymentCardTextField setCardParams:cardParams];
    _paymentCardTextField.delegate = self;
    // call paymentCardTextFieldDidChange for update RN
    [self paymentCardTextFieldDidChange:_paymentCardTextField];
}

- (UIKeyboardAppearance)keyboardAppearance {
    return _paymentCardTextField.keyboardAppearance;
}

- (void)setKeyboardAppearance:(UIKeyboardAppearance)keyboardAppearance {
    _paymentCardTextField.keyboardAppearance = keyboardAppearance;
}

#pragma mark - STPPaymentCardTextFieldDelegate

- (void)paymentCardTextFieldDidChange:(STPPaymentCardTextField *)textField {
    if (!_onChange) {
        return;
    }
    _onChange(@{
                @"valid": @(_paymentCardTextField.isValid),
                @"params": @{
                        @"number": _paymentCardTextField.cardParams.number?:@"",
                        @"expMonth": _paymentCardTextField.cardParams.expMonth?:NSNull.null,
                        @"expYear": _paymentCardTextField.cardParams.expYear?:NSNull.null,
                        @"cvc": _paymentCardTextField.cardParams.cvc?:@""
                        }
                });
}

@end


text:
layout: doc
weight: 11
title: Examples
categories: getting-started
permalink: /getting-started/examples
---

We have prepared a list of common examples using Introjs for both hints and intros. You can find the links in the following section.

#### Intros

*   [Basic usage](http://introjs.com/example/hello-world/index.html "Basic usage")
*   [Basic usage with buttons](http://introjs.com/example/hello-world/withoutBullets.html "Basic usage with buttons")
*   [Basic usage with bullets](http://introjs.com/example/hello-world/withoutButtons.html "Basic usage with bullets")
*   [Basic usage with progress-bar](http://introjs.com/example/hello-world/withProgress.html "Basic usage with progress-bar")
*   [Confirm before exit](http://introjs.com/example/hello-world/exit-confirm.html "Shows a confirm before exit")
*   [Programmatic defining using JSON](http://introjs.com/example/programmatic/index.html "Programmatic defining using JSON")
*   [Multi-Page introduction](http://introjs.com/example/multi-page/index.html "Multi-Page introduction")
*   [Disabling interaction with elements](http://introjs.com/example/disable-interaction/index.html "Disabling interaction with elements")
*   [Auto-positioning](http://introjs.com/example/auto-position/index.html "Auto-positioning")
*   [RTL version](http://introjs.com/example/RTL/index.html "RTL version")
*   [HTML in tooltip](http://introjs.com/example/html-tooltip/index.html "HTML in tooltip")
*   [Custom CSS Class](http://introjs.com/example/custom-class/index.html "Custom CSS Class")
*   [Introduction without focusing on elements](http://introjs.com/example/withoutElement/index.html "Introduction without focusing on elements")
*   [Using with Bootstrap v3.0](http://introjs.com/example/bootstrap/v3/index.html "Using with Bootstrap v3.0")
*   [Using with SVG Element](http://introjs.com/example/svg/d3.htm "Using Introjs with SVG Element")

#### Hints

*   [Basic hints usage](http://introjs.com/example/hint/index.html "Basic hints usage")
*   [Programmatic defining hints using JSON](http://introjs.com/example/programmatic/hint.html "Programmatic defining hints using JSON")


text:
rm /etc/skel/.zshrc
git clone git://github.com/thoughtbot/dotfiles.git /etc/skel/.dotfiles


text:
import { Component, OnInit } from '@angular/core';
import { Http } from '@angular/http';
import { FormGroup, FormControl, Validators, FormBuilder } from '@angular/forms';

import { DataService } from '../services/data.service';
import { ToastComponent } from '../shared/toast/toast.component';

@Component({
  selector: 'app-cat',
  templateUrl: './cat.component.html',
  styleUrls: ['./cat.component.scss']
})
export class CatComponent implements OnInit {

  cats = [];
  isLoading = true;

  cat = {};
  isEditing = false;

  addCatForm: FormGroup;
  name = new FormControl('', Validators.required);
  age = new FormControl('', Validators.required);
  weight = new FormControl('', Validators.required);

  constructor(private http: Http,
              private dataService: DataService,
              public toast: ToastComponent,
              private formBuilder: FormBuilder) { }

  ngOnInit() {
    this.getCats();

    this.addCatForm = this.formBuilder.group({
      name: this.name,
      age: this.age,
      weight: this.weight
    });
  }

  getCats() {
    this.dataService.getCats().subscribe(
      data => this.cats = data,
      error => console.log(error),
      () => this.isLoading = false
    );
  }

  addCat() {
    this.dataService.addCat(this.addCatForm.value).subscribe(
      res => {
        const newCat = res.json();
        this.cats.push(newCat);
        this.addCatForm.reset();
        this.toast.setMessage('item added successfully.', 'success');
      },
      error => console.log(error)
    );
  }

  enableEditing(cat) {
    this.isEditing = true;
    this.cat = cat;
  }

  cancelEditing() {
    this.isEditing = false;
    this.cat = {};
    this.toast.setMessage('item editing cancelled.', 'warning');
    // reload the cats to reset the editing
    this.getCats();
  }

  editCat(cat) {
    this.dataService.editCat(cat).subscribe(
      res => {
        this.isEditing = false;
        this.cat = cat;
        this.toast.setMessage('item edited successfully.', 'success');
      },
      error => console.log(error)
    );
  }

  deleteCat(cat) {
    if (window.confirm('Are you sure you want to permanently delete this item?')) {
      this.dataService.deleteCat(cat).subscribe(
        res => {
          const pos = this.cats.map(elem => { return elem._id; }).indexOf(cat._id);
          this.cats.splice(pos, 1);
          this.toast.setMessage('item deleted successfully.', 'success');
        },
        error => console.log(error)
      );
    }
  }

}


text:
{{!vm.tag_transformer.name ? ' ' : vm.tag_transformer.name}}

<form class="form-horizontal" name="form">

			<input type="text" class="form-control" ng-model="vm.tag_transformer.name" name="name" required />

			<input type="text" class="form-control" ng-model="vm.tag_transformer.searchPattern" name="searchPattern" required />

			<input type="text" class="form-control" ng-model="vm.tag_transformer.replacementPattern" name="replacementPattern" required />

	<button type="submit" ng-click="vm.save()" class="btn btn-default" ng-disabled="form.$invalid"> Save</button>
</form>

			<input id="interactive_test" type="text" class="form-control" ng-model="vm.testInput" name="interactive_test" ng-change="vm.performTest()"/>


text:
using System.Threading.Tasks;
using WarsawCityGamesServer.Entities.Entities;

namespace WarsawCityGamesServer.DataAccess.DataAccessServices.Interfaces
{
    public interface IUserProfileService
    {
        Task<Player> FindPlayer(string username);
        Task<bool> TryChangePassword(string username, string oldPassword, string newPassword);
        Task<bool> TryChangeUserData(string username, string name, string email, string description);
        Task<string> GetPlayerLevelName(string username);
        Task<bool> TryUpdateProfilePicture(string file, string username);
        Task RemoveUserImage(string username);
    }
}


text: from brambling.admin.admin import *


text:
namespace gpopt
{
using namespace gpos;

//---------------------------------------------------------------------------
//	@class:
//		CConstExprEvaluatorDefaultTest
//
//	@doc:
//		Unit tests for CConstExprEvaluatorDefault
//
//---------------------------------------------------------------------------
class CConstExprEvaluatorDefaultTest
{
public:
	// run unittests
	static GPOS_RESULT EresUnittest();
};
}  // namespace gpopt

#endif	// !GPOPT_CConstExprEvaluatorDefaultTest_H

// EOF


text:
require 'spec_helper'

describe 'users/new.html.haml' do
  let(:user) { stub_model(User) }
  before {
    view.stub(:current_user).and_return(user)
    view.stub(:user).and_return(user)
  }
  it 'should have per_page option' do
    render
    expect(rendered).to match(/id="user_per_page"/)
  end

  it 'should have time_zone option' do
    render
    expect(rendered).to match(/id="user_time_zone"/)
  end
end


text:
require 'chef/knife/cloud/server/create_command'
require 'chef/knife/oraclepaas_helpers'
require 'chef/knife/cloud/oraclepaas_compute_service'
require 'chef/knife/cloud/oraclepaas_service_options'
require 'chef/knife/cloud/exceptions'

class Chef
  class Knife
    class Cloud
      class OraclepaasSecappDelete < Command
        include OraclepaasHelpers

        banner "knife oraclepaas secapp delete NAME"

        def create_service_instance
          ComputeService.new
        end

        def execute_command
        	begin
        		@secapp = service.delete_security_application(locate_config_value(:security_app_name))
        	rescue CloudExceptions::ServerCreateError => e
        		ui.fatal(e.message)
        		raise e
        	end
        	puts "Security application #{locate_config_value(:security_app_name)} deleted\n"
        end

        def validate_params!
          super
          errors = check_for_missing_config_values!(:oraclepaas_username, :oraclepaas_password, :oraclepaas_domain, :oraclepaas_compute_api)
          config[:security_app_name] = @name_args.first
          if locate_config_value(:security_app_name).nil?
          	errors << 'Security App Name'
          end
          if errors.any?
            error_message = "The following required parameters are missing: #{errors.join(', ')}"
            ui.error(error_message)
            raise CloudExceptions::ValidationError, error_message
          end
        end

      end
    end
  end
end


text:
layout: docs
title: Overview
description: Components and options for laying out your Bootstrap project, including wrapping containers, a powerful grid system, a flexible media object, and responsive utility classes.
group: layout
redirect_from: "/docs/4.5/layout/"
toc: true
---

## Containers

Containers are the most basic layout element in Bootstrap and are **required when using our default grid system**. Containers are used to contain, pad, and (sometimes) center the content within them. While containers *can* be nested, most layouts do not require a nested container.

Bootstrap comes with three different containers:

- `.container`, which sets a `max-width` at each responsive breakpoint
- `.container-fluid`, which is `width: 100%` at all breakpoints
- `.container-{breakpoint}`, which is `width: 100%` until the specified breakpoint

The table below illustrates how each container's `max-width` compares to the original `.container` and `.container-fluid` across each breakpoint.

See them in action and compare them in our [Grid example]({{ site.baseurl }}/docs/{{ site.docs_version }}/examples/grid/#containers).

        Extra small

        <576px

        Small

        ≥576px

        Medium

        ≥768px

        Large

        ≥992px

        Extra large

        ≥1200px

      .container
      100%
      540px
      720px
      960px
      1140px

      .container-sm
      100%
      540px
      720px
      960px
      1140px

      .container-md
      100%
      100%
      720px
      960px
      1140px

      .container-lg
      100%
      100%
      100%
      960px
      1140px

      .container-xl
      100%
      100%
      100%
      100%
      1140px

      .container-fluid
      100%
      100%
      100%
      100%
      100%

### All-in-one

Our default `.container` class is a responsive, fixed-width container, meaning its `max-width` changes at each breakpoint.

{% highlight html %}

{% endhighlight %}

### Fluid

Use `.container-fluid` for a full width container, spanning the entire width of the viewport.

{% highlight html %}

  ...

{% endhighlight %}

### Responsive

Responsive containers are new in Bootstrap v4.4. They allow you to specify a class that is 100% wide until the specified breakpoint is reached, after which we apply `max-width`s for each of the higher breakpoints. For example, `.container-sm` is 100% wide to start until the `sm` breakpoint is reached, where it will scale up with `md`, `lg`, and `xl`.

{% highlight html %}

100% wide until small breakpoint

100% wide until medium breakpoint

100% wide until large breakpoint

100% wide until extra large breakpoint

{% endhighlight %}

## Responsive breakpoints

Since Bootstrap is developed to be mobile first, we use a handful of [media queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries) to create sensible breakpoints for our layouts and interfaces. These breakpoints are mostly based on minimum viewport widths and allow us to scale up elements as the viewport changes.

Bootstrap primarily uses the following media query ranges—or breakpoints—in our source Sass files for our layout, grid system, and components.

{% highlight scss %}
// Extra small devices (portrait phones, less than 576px)
// No media query for `xs` since this is the default in Bootstrap

// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) { ... }

// Medium devices (tablets, 768px and up)
@media (min-width: 768px) { ... }

// Large devices (desktops, 992px and up)
@media (min-width: 992px) { ... }

// Extra large devices (large desktops, 1200px and up)
@media (min-width: 1200px) { ... }
{% endhighlight %}

Since we write our source CSS in Sass, all our media queries are available via Sass mixins:

{% highlight scss %}
// No media query necessary for xs breakpoint as it's effectively `@media (min-width: 0) { ... }`
@include media-breakpoint-up(sm) { ... }
@include media-breakpoint-up(md) { ... }
@include media-breakpoint-up(lg) { ... }
@include media-breakpoint-up(xl) { ... }

// Example: Hide starting at `min-width: 0`, and then show at the `sm` breakpoint
.custom-class {
  display: none;
}
@include media-breakpoint-up(sm) {
  .custom-class {
    display: block;
  }
}
{% endhighlight %}

We occasionally use media queries that go in the other direction (the given screen size *or smaller*):

{% highlight scss %}
// Extra small devices (portrait phones, less than 576px)
@media (max-width: 575.98px) { ... }

// Small devices (landscape phones, less than 768px)
@media (max-width: 767.98px) { ... }

// Medium devices (tablets, less than 992px)
@media (max-width: 991.98px) { ... }

// Large devices (desktops, less than 1200px)
@media (max-width: 1199.98px) { ... }

// Extra large devices (large desktops)
// No media query since the extra-large breakpoint has no upper bound on its width
{% endhighlight %}

{% include callout-info-mediaqueries-breakpoints.md %}

Once again, these media queries are also available via Sass mixins:

{% highlight scss %}
@include media-breakpoint-down(xs) { ... }
@include media-breakpoint-down(sm) { ... }
@include media-breakpoint-down(md) { ... }
@include media-breakpoint-down(lg) { ... }
// No media query necessary for xl breakpoint as it has no upper bound on its width

// Example: Style from medium breakpoint and down
@include media-breakpoint-down(md) {
  .custom-class {
    display: block;
  }
}
{% endhighlight %}

There are also media queries and mixins for targeting a single segment of screen sizes using the minimum and maximum breakpoint widths.

{% highlight scss %}
// Extra small devices (portrait phones, less than 576px)
@media (max-width: 575.98px) { ... }

// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) and (max-width: 767.98px) { ... }

// Medium devices (tablets, 768px and up)
@media (min-width: 768px) and (max-width: 991.98px) { ... }

// Large devices (desktops, 992px and up)
@media (min-width: 992px) and (max-width: 1199.98px) { ... }

// Extra large devices (large desktops, 1200px and up)
@media (min-width: 1200px) { ... }
{% endhighlight %}

These media queries are also available via Sass mixins:

{% highlight scss %}
@include media-breakpoint-only(xs) { ... }
@include media-breakpoint-only(sm) { ... }
@include media-breakpoint-only(md) { ... }
@include media-breakpoint-only(lg) { ... }
@include media-breakpoint-only(xl) { ... }
{% endhighlight %}

Similarly, media queries may span multiple breakpoint widths:

{% highlight scss %}
// Example
// Apply styles starting from medium devices and up to extra large devices
@media (min-width: 768px) and (max-width: 1199.98px) { ... }
{% endhighlight %}

The Sass mixin for targeting the same screen size range would be:

{% highlight scss %}
@include media-breakpoint-between(md, xl) { ... }
{% endhighlight %}

## Z-index

Several Bootstrap components utilize `z-index`, the CSS property that helps control layout by providing a third axis to arrange content. We utilize a default z-index scale in Bootstrap that's been designed to properly layer navigation, tooltips and popovers, modals, and more.

These higher values start at an arbitrary number, high and specific enough to ideally avoid conflicts. We need a standard set of these across our layered components—tooltips, popovers, navbars, dropdowns, modals—so we can be reasonably consistent in the behaviors. There's no reason we couldn't have used `100`+ or `500`+.

We don't encourage customization of these individual values; should you change one, you likely need to change them all.

{% highlight scss %}
$zindex-dropdown:          1000 !default;
$zindex-sticky:            1020 !default;
$zindex-fixed:             1030 !default;
$zindex-modal-backdrop:    1040 !default;
$zindex-modal:             1050 !default;
$zindex-popover:           1060 !default;
$zindex-tooltip:           1070 !default;
{% endhighlight %}

To handle overlapping borders within components (e.g., buttons and inputs in input groups), we use low single digit `z-index` values of `1`, `2`, and `3` for default, hover, and active states. On hover/focus/active, we bring a particular element to the forefront with a higher `z-index` value to show their border over the sibling elements.


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <parent>
        <artifactId>fx-inject</artifactId>
        <groupId>com.cathive.fx.inject</groupId>
        <version>2.0.1-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>fx-inject-core</artifactId>
    <description>fx-inject core module</description>

    <dependencies>

        <!-- javax.inject API -->
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <scope>compile</scope>
        </dependency>

        <!-- CDI API -->
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <scope>compile</scope>
            <optional>true</optional>
        </dependency>

        <!-- Unit tests -->
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>
</project>


text:
package kafka.console.model.topics

case class PartitionInfo(partition: Int, leader: Int, replicas: Vector[PartitionReplica])


text:
<?php
/**
 * Performs the watch and unwatch actions on a page
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 *
 * @file
 * @ingroup Actions
 */

class WatchAction extends FormAction {

	public function getName() {
		return 'watch';
	}

	public function requiresUnblock() {
		return false;
	}

	protected function getDescription() {
		return wfMsgHtml( 'addwatch' );
	}

	/**
	 * Just get an empty form with a single submit button
	 * @return array
	 */
	protected function getFormFields() {
		return array();
	}

	public function onSubmit( $data ) {
		wfProfileIn( __METHOD__ );
		self::doWatch( $this->getTitle(), $this->getUser() );
		wfProfileOut( __METHOD__ );
		return true;
	}

	/**
	 * This can be either formed or formless depending on the session token given
	 */
	public function show() {
		$this->setHeaders();

		$user = $this->getUser();
		// This will throw exceptions if there's a problem
		$this->checkCanExecute( $user );

		// Must have valid token for this action/title
		$salt = array( $this->getName(), $this->getTitle()->getDBkey() );

		if ( $user->matchEditToken( $this->getRequest()->getVal( 'token' ), $salt ) ) {
			$this->onSubmit( array() );
			$this->onSuccess();
		} else {
			$form = $this->getForm();
			if ( $form->show() ) {
				$this->onSuccess();
			}
		}
	}

	protected function checkCanExecute( User $user ) {
		// Must be logged in
		if ( $user->isAnon() ) {
			throw new ErrorPageError( 'watchnologin', 'watchnologintext' );
		}

		return parent::checkCanExecute( $user );
	}

	public static function doWatch( Title $title, User $user  ) {
		$page = WikiPage::factory( $title );

		if ( wfRunHooks( 'WatchArticle', array( &$user, &$page ) ) ) {
			$user->addWatch( $title );
			wfRunHooks( 'WatchArticleComplete', array( &$user, &$page ) );
		}
		return true;
	}

	public static function doUnwatch( Title $title, User $user  ) {
		$page = WikiPage::factory( $title );

		if ( wfRunHooks( 'UnwatchArticle', array( &$user, &$page ) ) ) {
			$user->removeWatch( $title );
			wfRunHooks( 'UnwatchArticleComplete', array( &$user, &$page ) );
		}
		return true;
	}

	/**
	 * Get token to watch (or unwatch) a page for a user
	 *
	 * @param Title $title Title object of page to watch
	 * @param User $user User for whom the action is going to be performed
	 * @param string $action Optionally override the action to 'unwatch'
	 * @return string Token
	 * @since 1.18
	 */
	public static function getWatchToken( Title $title, User $user, $action = 'watch' ) {
		if ( $action != 'unwatch' ) {
			$action = 'watch';
		}
		$salt = array( $action, $title->getDBkey() );

		// This token stronger salted and not compatible with ApiWatch
		// It's title/action specific because index.php is GET and API is POST
		return $user->getEditToken( $salt );
	}

	/**
	 * Get token to unwatch (or watch) a page for a user
	 *
	 * @param Title $title Title object of page to unwatch
	 * @param User $user User for whom the action is going to be performed
	 * @param string $action Optionally override the action to 'watch'
	 * @return string Token
	 * @since 1.18
	 */
	public static function getUnwatchToken( Title $title, User $user, $action = 'unwatch' ) {
		return self::getWatchToken( $title, $user, $action );
	}

	protected function alterForm( HTMLForm $form ) {
		$form->setSubmitText( wfMsg( 'confirm-watch-button' ) );
	}

	protected function preText() {
		return wfMessage( 'confirm-watch-top' )->parse();
	}

	public function onSuccess() {
		$this->getOutput()->addWikiMsg( 'addedwatchtext', $this->getTitle()->getPrefixedText() );
	}
}

class UnwatchAction extends WatchAction {

	public function getName() {
		return 'unwatch';
	}

	protected function getDescription() {
		return wfMsg( 'removewatch' );
	}

	public function onSubmit( $data ) {
		wfProfileIn( __METHOD__ );
		self::doUnwatch( $this->getTitle(), $this->getUser() );
		wfProfileOut( __METHOD__ );
		return true;
	}

	protected function alterForm( HTMLForm $form ) {
		$form->setSubmitText( wfMsg( 'confirm-unwatch-button' ) );
	}

	protected function preText() {
		return wfMessage( 'confirm-unwatch-top' )->parse();
	}

	public function onSuccess() {
		$this->getOutput()->addWikiMsg( 'removedwatchtext', $this->getTitle()->getPrefixedText() );
	}
}


text:
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return redirect('/home');
});

/*
|--------------------------------------------------------------------------
| API routes
|--------------------------------------------------------------------------
*/

Route::group(['prefix' => 'api', 'namespace' => 'API'], function () {
    Route::group(['prefix' => 'v1'], function () {
        require config('infyom.laravel_generator.path.api_routes');
    });
});

Route::get('/home', 'HomeController@index');

Route::get('generator_builder', '\InfyOm\GeneratorBuilder\Controllers\GeneratorBuilderController@builder');

Route::get('field_template', '\InfyOm\GeneratorBuilder\Controllers\GeneratorBuilderController@fieldTemplate');

Route::post('generator_builder/generate', '\InfyOm\GeneratorBuilder\Controllers\GeneratorBuilderController@generate');

/*
|--------------------------------------------------------------------------
| Backend routes
|--------------------------------------------------------------------------
*/
Route::group(['prefix' => 'backend', 'namespace' => 'Backend'], function () {
	// Backend Auth
	Route::get('/login', ['as' => 'backend.getLogin', 'uses' => 'AuthController@getLogin']);
    Route::post('/login', ['as' => 'backend.postLogin', 'uses' => 'AuthController@postLogin']);
    Route::get('/logout', ['as' => 'backend.getLogout', 'uses' => 'AuthController@getLogout']);

    // Password Reset Routes
    Route::get('/password/reset', '\App\Http\Controllers\Auth\PasswordController@getEmail');
    Route::post('/password/email', '\App\Http\Controllers\Auth\PasswordController@postEmail');
    Route::get('/password/reset/{token}', '\App\Http\Controllers\Auth\PasswordController@getReset');
    Route::post('/password/reset', '\App\Http\Controllers\Auth\PasswordController@postReset');

    Route::group(['middleware' => 'auth.backend'], function () {
    	// Default
    	Route::get('/', ['as' => 'backend.news.index', 'uses' => 'NewsController@index']);
        // Sort
        Route::post('/sort', ['as' => 'backend.sort', 'uses' => '\Rutorika\Sortable\SortableController@sort']);

		// News Routes
    	Route::group(['prefix' => 'news'], function () {
    		Route::get('/', ['as' => 'backend.news.index', 'uses' => 'NewsController@index']);
    		Route::get('/{id}/edit', ['as' => 'backend.news.edit', 'uses' => 'NewsController@edit']);
    		Route::get('/create', ['as' => 'backend.news.create', 'uses' => 'NewsController@create']);
    		Route::post('/', ['as' => 'backend.news.store', 'uses' => 'NewsController@store']);
    		Route::put('/{id}', ['as' => 'backend.news.update', 'uses' => 'NewsController@update']);
    		Route::delete('/{id}/delete', ['as' => 'backend.news.destroy', 'uses' => 'NewsController@destroy']);
    		Route::get('/{id}/attachment/{attachment_id}/delete', ['as' => 'backend.attachment.destroy', 'uses' => 'NewsController@destroyAttachment']);
    	});

        // Department Routes
        Route::group(['prefix' => 'department'], function () {
            Route::get('/', ['as' => 'backend.department.index', 'uses' => 'DepartmentController@index']);
            Route::get('/{id}/edit', ['as' => 'backend.department.edit', 'uses' => 'DepartmentController@edit']);
            Route::get('/create', ['as' => 'backend.department.create', 'uses' => 'DepartmentController@create']);
            Route::post('/', ['as' => 'backend.department.store', 'uses' => 'DepartmentController@store']);
            Route::put('/{id}', ['as' => 'backend.department.update', 'uses' => 'DepartmentController@update']);
            Route::delete('/{id}/delete', ['as' => 'backend.department.destroy', 'uses' => 'DepartmentController@destroy']);
        });
    });
});


text:
<!DOCTYPE html>
<html lang="en">
  <head>

    <!-- Page title -->
    <!-- build:remove -->
      <title>[Dev] Project name</title>
    <!-- /build -->
    <!-- build:template
      <title><%= title %></title>
    /build -->

    <!-- Meta tags -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="description" content="">

    <!-- Font import(s) -->
    <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:400,500,700,400italic">

    <!-- Stylesheet(s) -->
    <!-- build:css ./dist/css/styles.min.css -->
    <link rel="stylesheet" href="./css/styles.css">
    <!-- /build -->

    <!-- Favicons -->

  </head>
  <body>

    <h1>
      <!-- build:remove -->
      [Dev] Project name
      <!-- /build -->
      <!-- build:template
        <%= title %>
      /build -->
    </h1>

    <!-- More content goes here -->

    <!-- Script(s) -->
    <!-- build:remove -->
      <script src="./js/example.js"></script>
    <!-- /build -->
    <!-- build:template
      <script src="./dist/js/<%= filename %>.min.js"></script>
    /build -->

  </body>
</html>


text:
//
//  ARKCompanyStatistic.h
//  Arkio
//
//  Created by Ray Scott on 28/11/2013.
//  Copyright (c) 2013 Alien Hitcher. All rights reserved.
//

#import <Foundation/Foundation.h>

/**
 *  Represents a type of statistical grouping of company data.
 */
typedef NS_ENUM(NSInteger, ARKStatisticGroupType)
{
    /**
     *  A company department.
     */
    ARKStatisticGroupDepartment,

    /**
     *  An employee level.
     */
    ARKStatisticGroupLevel
};

/**
 *  Typically represents an aggregate value of a statistical grouping.
 */
@interface ARKCompanyStatistic : NSObject

/**
 * The group type of this statistic.
 */
@property ARKStatisticGroupType group;

/**
 *  The name associated with this statistic.
 */
@property (nonatomic, strong) NSString *name;

/**
 *  The aggregate value of this statistic.
 */
@property long count;

/**
 *  The URL for the web page where this data is viewable.
 */
@property (nonatomic, strong) NSURL *url;

#pragma mark - Creating and Initializing a Company Statistic

///----------------------------------------------------
/// @name Creating and Initializing a Company Statistic
///----------------------------------------------------

/**
 *  Creates and initializes a statistic object for the given group type.
 *
 *  @param type The type of statistical grouping.
 *
 *  @return A statistical group object.
 */
- (instancetype)initWithGroupType:(ARKStatisticGroupType)type;

@end


text:
var createScene = function () {
	var scene = new BABYLON.Scene(engine);

	//Adding a light
	var light = new BABYLON.PointLight("Omni", new BABYLON.Vector3(20, 20, 100), scene);

	//Adding an Arc Rotate Camera
	var camera = new BABYLON.ArcRotateCamera("Camera", -0.5, 2.2, 100, BABYLON.Vector3.Zero(), scene);
	camera.attachControl(canvas, false);

	// The first parameter can be used to specify which mesh to import. Here we import all meshes
	BABYLON.SceneLoader.ImportMesh("", "scenes/", "skull.babylon", scene, function (newMeshes) {
		// Set the target of the camera to the first imported mesh
		camera.target = newMeshes[0];

		newMeshes[0].material = new BABYLON.StandardMaterial("skull", scene);
		newMeshes[0].material.emissiveColor = new BABYLON.Color3(0.2, 0.2, 0.2);
	});

	// Create the "God Rays" effect (volumetric light scattering)
	var godrays = new BABYLON.VolumetricLightScatteringPostProcess('godrays', 1.0, camera, null, 100, BABYLON.Texture.BILINEAR_SAMPLINGMODE, engine, false);

	// By default it uses a billboard to render the sun, just apply the desired texture
	// position and scale
	godrays.mesh.material.diffuseTexture = new BABYLON.Texture('textures/sun.png', scene, true, false, BABYLON.Texture.BILINEAR_SAMPLINGMODE);
	godrays.mesh.material.diffuseTexture.hasAlpha = true;
	godrays.mesh.position = new BABYLON.Vector3(-150, 150, 150);
	godrays.mesh.scaling = new BABYLON.Vector3(350, 350, 350);

	light.position = godrays.mesh.position;

	return scene;
}


text:
class NotifyJob < ActiveJob::Base
  queue_as :default

  def self.perform(action, model)
    name = model.class.name.split('::').last.underscore
    Spree::WebHooks::Hook.joins(:event).where(spree_web_hooks_events: { name: "#{name}_#{action}" }).each do |e|
      e.notify(model)
    end
  end
end


text:
import {SelectCustomerAction} from '../store/teller.actions';
import {TellerStore} from '../store/index';
import {Subscription} from 'rxjs/Subscription';
import {Component, OnDestroy, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router';

@Component({
  templateUrl: './customer-index.component.html'
})
export class TellerCustomerIndexComponent implements OnInit, OnDestroy {

  private actionsSubscription: Subscription;

  constructor(private route: ActivatedRoute, private store: TellerStore) {}

  ngOnInit(): void {
    this.actionsSubscription = this.route.params
      .map(params => new SelectCustomerAction(params['id']))
      .subscribe(this.store);
  }

  ngOnDestroy(): void {
    this.actionsSubscription.unsubscribe();
  }
}


text:
import unittest

class ImportTest(unittest.TestCase):
    def test_import_everything(self):
        # Some of our modules are not otherwise tested.  Import them
        # all (unless they have external dependencies) here to at
        # least ensure that there are no syntax errors.
        import tornado.auth
        import tornado.autoreload
        # import tornado.curl_httpclient  # depends on pycurl
        # import tornado.database  # depends on MySQLdb
        import tornado.escape
        import tornado.httpclient
        import tornado.httpserver
        import tornado.httputil
        import tornado.ioloop
        import tornado.iostream
        import tornado.locale
        import tornado.options
        import tornado.simple_httpclient
        import tornado.stack_context
        import tornado.template
        import tornado.testing
        import tornado.util
        import tornado.web
        import tornado.websocket
        # import tornado.win32_support  # depends on windows
        import tornado.wsgi


text:
package com.evolveum.midpoint.wf.api.request;

import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.xml.datatype.Duration;
import javax.xml.datatype.XMLGregorianCalendar;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;

/**
 *
 */
public class DelegateWorkItemsRequest extends Request {

    @Nullable private final XMLGregorianCalendar now;       // later we might move this up to Request (when needed)

    public static class SingleDelegation {
        private final long workItemId;
        @NotNull private final WorkItemDelegationRequestType delegationRequest;
        private final WorkItemEscalationLevelType targetEscalationInfo;
        private final Duration newDuration;

        public SingleDelegation(long workItemId, @NotNull WorkItemDelegationRequestType delegationRequest,
                WorkItemEscalationLevelType targetEscalationInfo, Duration newDuration) {
            this.workItemId = workItemId;
            this.delegationRequest = delegationRequest;
            this.targetEscalationInfo = targetEscalationInfo;
            this.newDuration = newDuration;
        }

        public long getWorkItemId() {
            return workItemId;
        }

        @NotNull
        public List<ObjectReferenceType> getDelegates() {
            return delegationRequest.getDelegate();
        }

        @NotNull
        public WorkItemDelegationMethodType getMethod() {
            return defaultIfNull(delegationRequest.getMethod(), WorkItemDelegationMethodType.REPLACE_ASSIGNEES);
        }

        public String getComment() {
            return delegationRequest.getComment();
        }

        public WorkItemEscalationLevelType getTargetEscalationInfo() {
            return targetEscalationInfo;
        }

        public Duration getNewDuration() {
            return newDuration;
        }

        @Override
        public String toString() {
            return "SingleDelegation{" +
                    "workItemId=" + workItemId +
                    ", delegationRequest=" + delegationRequest +
                    ", targetEscalationInfo=" + targetEscalationInfo +
                    ", newDuration=" + newDuration +
                    '}';
        }
    }

    @NotNull private final Collection<SingleDelegation> delegations = new ArrayList<>();

    public DelegateWorkItemsRequest(@NotNull String caseOid, WorkItemEventCauseInformationType causeInformation,
            @Nullable XMLGregorianCalendar now) {
        super(caseOid, causeInformation);
        this.now = now;
    }

    @NotNull
    public Collection<SingleDelegation> getDelegations() {
        return delegations;
    }

    @Nullable
    public XMLGregorianCalendar getNow() {
        return now;
    }

    @Override
    public String toString() {
        return "DelegateWorkItemsRequest{" +
                "now=" + now +
                ", delegations=" + delegations +
                ", caseOid='" + caseOid + '\'' +
                ", causeInformation=" + causeInformation +
                '}';
    }
}


text:
package lanchonete;

import fabricas.FabricaDeIngredientes;
import sanduiche.Sanduiche;

public abstract class Lanchonete {

	protected FabricaDeIngredientes fabrica;

	public Sanduiche pedirSanduiche(){
		Sanduiche sanduiche = criarSanduiche();
		sanduiche.preparar();
		sanduiche.assar();
		sanduiche.embalar();
		return sanduiche;
	}

	protected abstract Sanduiche criarSanduiche();

}


text:
<?php

/** The documentation index */
Route::get('/doc', 'Documentation\Controller\PageController:index', ['as' => 'documentation']);
Route::get('/doc/{page}', 'Documentation\Controller\PageController:page', ['assert' => ['page' => '.*']]);


text:
<changelog>
	<changes>
		<version>1.0</version>
		<change>Initial Release</change>
	</changes>
		<changes>
		<version>2.0</version>
		<change><![CDATA[

Widget was partialy recoded.

Switched to IS2 weather info, removed weather code.

Added "Options.plist" file and removed "Config.js" file.
]]></change>
	</changes>
</changelog>


text:
{% extends 'pages/profile/client/profile_client.html' %}

{% block options_sidebar %}
{% endblock %}

{% block body_content %}
    {{ block.super }}
    {% load staticfiles %}

		Введите URL адрес вашего сайта:
		<input id="new-widget-site-url-input" type="text" value="" placeholder="http://my-site.ru" />

		ГОТОВО!
		Отмена

Виджеты

                        	Добавить виджет

                        {% for widget in client.widget_set.all %}

                                    {% if widget.site_url != None %}{{ widget.site_url }}{% else %}-{% endif %}

                                    Установить на сайт

                                    <input class="widget-toggle-activity" type="checkbox" {% if widget.is_active %} checked {% endif %}
                                            data-url="/profile/client/widget/toggle_activity?widget_id={{ widget.id }}"/>
                                        {% if widget.is_active %} Остановить {% else %} Запустить {% endif %}

                                    Редактировать

                                    Удалить

                        {% empty %}

                                Для начала создайте новый виджет прямо сейчас.

                        {% endfor %}

{% endblock %}

{% block additional_js %}

    {{ block.super }}
{% endblock %}


text:
function toNumBytes(humanReadableBytes) {
  len = humanReadableBytes.length;
  if (len <= 1) {
    return -1;
  }
  unit = humanReadableBytes[len - 1];
  val = parseFloat(humanReadableBytes.substring(0, len - 1));
  if (isNaN(val)) {
    return -1;
  }
  // Fallthrough intended throughout.
  switch (unit) {
    case 'Y': val *= 1024.0; // Enough bytes to handle any double.
    case 'Z': val *= 1024.0;
    case 'E': val *= 1024.0;
    case 'P': val *= 1024.0;
    case 'T': val *= 1024.0;
    case 'G': val *= 1024.0;
    case 'M': val *= 1024.0;
    case 'K': val *= 1024.0;
    case 'B': break;
    default:
      return -1;
  }
  return val;
}

// Converts a human-readable numeric strings like '1.23k' or '985.32M' to int.
// Returns -1 if there's some failure.
function toInt(humanReadableNum) {
  len = humanReadableNum.length;
  if (len < 1) {
    return -1;
  }
  end = humanReadableNum[len - 1];
  val = parseFloat(humanReadableNum);
  if (isNaN(val)) {
    return -1;
  }
  if (end == 'k') {
    val *= 1e3;
  } else if (end == 'M') {
    val *= 1e6;
  } else if (end == 'B') {
    val *= 1e9;
  } else if (end == 'T') {
    val *= 1e12; // Number bigger than 1E15 use scientific notation.
  } else if (isNaN(end)) {
    // Not a number.
    return -1;
  }
  if (val < 0) {
    return parseInt(val - 0.5);
  }
  return parseInt(val + 0.5);
}

// A comparison function for human-readable byte strings.
function bytesSorter(left, right) {
  if (right.length == 0 && left.length == 0) {
    return 0;
  }
  if (left.length == 0) {
    return -1;
  }
  if (right.length == 0) {
    return 1;
  }
  left_bytes = toNumBytes(left.trim());
  right_bytes = toNumBytes(right.trim());
  if (left_bytes < right_bytes) {
    return -1;
  }
  if (left_bytes > right_bytes) {
    return 1;
  }
  return 0;
}

// A comparison function for floating point numbers.
function floatsSorter(left, right) {
  left_float = parseFloat(left)
  right_float = parseFloat(right)
  if (left_float < right_float) {
    return -1;
  }
  if (left_float > right_float) {
    return 1;
  }
  return 0;
}

// Converts human-readable numeric strings to numbers and then compares them.
function numericStringsSorter(left, right) {
  left_num = toInt(left);
  right_num = toInt(right);
  if (left_num < right_num) {
    return -1;
  }
  if (left_num > right_num) {
    return 1;
  }
  return 0;
}

// A comparison function for human-readable time strings.
//
// The human-readable time format should look like this:
//   "2019-09-06 19:56:46 CST"
//
// Note: the time zones will be ignored since the masters
// should not be deployed across time zones. In addition,
// we compare the time strings unit by unit since it's
// really hard to convert them to timestamps.
function timesSorter(left, right) {
  // "2019-09-06 19:56:46".
  var expect_min_length = 19;
  if (left.length < expect_min_length && right.length < expect_min_length) {
    return 0;
  }
  if (left.length < expect_min_length) {
    return -1;
  }
  if (right.length < expect_min_length) {
    return 1;
  }

  // Year.
  var ret = numericStringsSorter(left.substr(0, 4), right.substr(0, 4));
  if (ret != 0) {
    return ret;
  }
  // Month.
  ret = numericStringsSorter(left.substr(5, 2), right.substr(5, 2));
  if (ret != 0) {
    return ret;
  }
  // Day.
  ret = numericStringsSorter(left.substr(8, 2), right.substr(8, 2));
  if (ret != 0) {
    return ret;
  }
  // Hour.
  ret = numericStringsSorter(left.substr(11, 2), right.substr(11, 2));
  if (ret != 0) {
    return ret;
  }
  // Minute.
  ret = numericStringsSorter(left.substr(14, 2), right.substr(14, 2));
  if (ret != 0) {
    return ret;
  }
  // Second.
  ret = numericStringsSorter(left.substr(17, 2), right.substr(17, 2));
  if (ret != 0) {
    return ret;
  }

  return 0;
}

// A comparison function for strings.
function stringsSorter(left, right) {
  if (left < right) {
    return -1;
  }
  if (left > right) {
    return 1;
  }
  return 0;
}