text:
package com.consol.citrus.dsl.design;

import com.consol.citrus.TestCase;
import com.consol.citrus.actions.SendMessageAction;
import com.consol.citrus.container.SequenceAfterTest;
import com.consol.citrus.container.SequenceBeforeTest;
import com.consol.citrus.dsl.actions.DelegatingTestAction;
import com.consol.citrus.exceptions.CitrusRuntimeException;
import com.consol.citrus.message.DefaultMessage;
import com.consol.citrus.message.MessageType;
import com.consol.citrus.report.TestActionListeners;
import com.consol.citrus.testng.AbstractTestNGUnitTest;
import com.consol.citrus.validation.builder.PayloadTemplateMessageBuilder;
import com.consol.citrus.validation.builder.StaticMessageContentBuilder;
import com.consol.citrus.ws.actions.SendSoapMessageAction;
import com.consol.citrus.ws.client.WebServiceClient;
import com.consol.citrus.ws.message.SoapAttachment;
import com.consol.citrus.ws.message.SoapMessageHeaders;
import org.mockito.Mockito;
import org.springframework.context.ApplicationContext;
import org.springframework.core.io.Resource;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.HashMap;

import static org.mockito.Mockito.*;

/**
 * @author Christoph Deppisch
 */
public class SendSoapMessageTestDesignerTest extends AbstractTestNGUnitTest {

    private WebServiceClient soapClient = Mockito.mock(WebServiceClient.class);

    private ApplicationContext applicationContextMock = Mockito.mock(ApplicationContext.class);
    private Resource resource = Mockito.mock(Resource.class);

    private SoapAttachment testAttachment = new SoapAttachment();

    /**
     * Setup test attachment.
     */
    @BeforeClass
    public void setup() {
        testAttachment.setContentId("attachment01");
        testAttachment.setContent("This is an attachment");
        testAttachment.setContentType("text/plain");
        testAttachment.setCharsetName("UTF-8");
    }

    @Test
    public void testFork() {
        MockTestDesigner builder = new MockTestDesigner(applicationContext, context) {
            @Override
            public void configure() {
                send(soapClient)
                    .message(new DefaultMessage("Foo").setHeader("operation", "foo"))
                        .header("additional", "additionalValue");

                send(soapClient)
                    .message(new DefaultMessage("Foo").setHeader("operation", "foo"))
                    .fork(true);
            }
        };

        builder.configure();

        TestCase test = builder.getTestCase();
        Assert.assertEquals(test.getActionCount(), 2);
        Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);
        Assert.assertEquals(((DelegatingTestAction)test.getActions().get(0)).getDelegate().getClass(), SendMessageAction.class);
        Assert.assertEquals(test.getActions().get(1).getClass(), DelegatingTestAction.class);
        Assert.assertEquals(((DelegatingTestAction)test.getActions().get(1)).getDelegate().getClass(), SendMessageAction.class);

        SendMessageAction action = (SendMessageAction) ((DelegatingTestAction)test.getActions().get(0)).getDelegate();
        Assert.assertEquals(action.getName(), "send");

        Assert.assertEquals(action.getEndpoint(), soapClient);
        Assert.assertEquals(action.getMessageBuilder().getClass(), StaticMessageContentBuilder.class);

        StaticMessageContentBuilder messageBuilder = (StaticMessageContentBuilder) action.getMessageBuilder();
        Assert.assertEquals(messageBuilder.getMessage().getPayload(String.class), "Foo");
        Assert.assertEquals(messageBuilder.getMessage().getHeader("operation"), "foo");
        Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 1L);
        Assert.assertEquals(messageBuilder.getMessageHeaders().get("additional"), "additionalValue");

        Assert.assertFalse(action.isForkMode());

        action = (SendMessageAction) ((DelegatingTestAction)test.getActions().get(1)).getDelegate();
        Assert.assertEquals(action.getName(), "send");

        Assert.assertEquals(action.getEndpoint(), soapClient);
        Assert.assertEquals(action.getMessageBuilder().getClass(), StaticMessageContentBuilder.class);

        Assert.assertTrue(action.isForkMode());
    }

    @Test
    public void testSoapAction() {
        MockTestDesigner builder = new MockTestDesigner(applicationContext, context) {
            @Override
            public void configure() {
                soap().client(soapClient)
                        .send()
                        .soapAction("TestService/sayHello")
                        .payload("<TestRequest><Message>Hello World!</Message></TestRequest>");
            }
        };

        builder.configure();

        TestCase test = builder.getTestCase();
        Assert.assertEquals(test.getActionCount(), 1);
        Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);
        Assert.assertEquals(((DelegatingTestAction)test.getActions().get(0)).getDelegate().getClass(), SendSoapMessageAction.class);

        SendSoapMessageAction action = (SendSoapMessageAction) ((DelegatingTestAction)test.getActions().get(0)).getDelegate();
        Assert.assertEquals(action.getName(), "send");

        Assert.assertEquals(action.getEndpoint(), soapClient);
        Assert.assertEquals(action.getMessageBuilder().getClass(), StaticMessageContentBuilder.class);

        StaticMessageContentBuilder messageBuilder = (StaticMessageContentBuilder) action.getMessageBuilder();
        Assert.assertEquals(messageBuilder.getMessage().getPayload(), "<TestRequest><Message>Hello World!</Message></TestRequest>");
        Assert.assertEquals(messageBuilder.getMessage().getHeaders().size(), 3L);
        Assert.assertEquals(messageBuilder.getMessage().getHeaders().get(SoapMessageHeaders.SOAP_ACTION), "TestService/sayHello");
    }

    @Test
    public void testSoapActionDeprecated() {
        MockTestDesigner builder = new MockTestDesigner(applicationContext, context) {
            @Override
            public void configure() {
                send(soapClient)
                        .soap()
                        .soapAction("TestService/sayHello")
                        .payload("<TestRequest><Message>Hello World!</Message></TestRequest>");
            }
        };

        builder.configure();

        TestCase test = builder.getTestCase();
        Assert.assertEquals(test.getActionCount(), 1);
        Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);
        Assert.assertEquals(((DelegatingTestAction)test.getActions().get(0)).getDelegate().getClass(), SendSoapMessageAction.class);

        SendSoapMessageAction action = (SendSoapMessageAction) ((DelegatingTestAction)test.getActions().get(0)).getDelegate();
        Assert.assertEquals(action.getName(), "send");

        Assert.assertEquals(action.getEndpoint(), soapClient);
        Assert.assertEquals(action.getMessageBuilder().getClass(), PayloadTemplateMessageBuilder.class);

        PayloadTemplateMessageBuilder messageBuilder = (PayloadTemplateMessageBuilder) action.getMessageBuilder();
        Assert.assertEquals(messageBuilder.getPayloadData(), "<TestRequest><Message>Hello World!</Message></TestRequest>");
        Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 1L);
        Assert.assertEquals(messageBuilder.getMessageHeaders().get(SoapMessageHeaders.SOAP_ACTION), "TestService/sayHello");
    }

    @Test
    public void testSoapAttachment() {
        MockTestDesigner builder = new MockTestDesigner(applicationContext, context) {
            @Override
            public void configure() {
                soap().client(soapClient)
                    .send()
                    .payload("<TestRequest><Message>Hello World!</Message></TestRequest>")
                    .attachment(testAttachment);
            }
        };

        builder.configure();

        TestCase test = builder.getTestCase();
        Assert.assertEquals(test.getActionCount(), 1);
        Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);
        Assert.assertEquals(((DelegatingTestAction)test.getActions().get(0)).getDelegate().getClass(), SendSoapMessageAction.class);

        SendSoapMessageAction action = (SendSoapMessageAction) ((DelegatingTestAction)test.getActions().get(0)).getDelegate();
        Assert.assertEquals(action.getName(), "send");

        Assert.assertEquals(action.getEndpoint(), soapClient);
        Assert.assertEquals(action.getMessageBuilder().getClass(), StaticMessageContentBuilder.class);

        StaticMessageContentBuilder messageBuilder = (StaticMessageContentBuilder) action.getMessageBuilder();
        Assert.assertEquals(messageBuilder.getMessage().getPayload(), "<TestRequest><Message>Hello World!</Message></TestRequest>");
        Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 0L);

        Assert.assertEquals(action.getAttachments().size(), 1L);
        Assert.assertNull(action.getAttachments().get(0).getContentResourcePath());
        Assert.assertEquals(action.getAttachments().get(0).getContent(), testAttachment.getContent());
        Assert.assertEquals(action.getAttachments().get(0).getContentId(), testAttachment.getContentId());
        Assert.assertEquals(action.getAttachments().get(0).getContentType(), testAttachment.getContentType());
        Assert.assertEquals(action.getAttachments().get(0).getCharsetName(), testAttachment.getCharsetName());
    }

    @Test
    public void testSoapAttachmentData() {
        MockTestDesigner builder = new MockTestDesigner(applicationContext, context) {
            @Override
            public void configure() {
                soap().client(soapClient)
                    .send()
                    .payload("<TestRequest><Message>Hello World!</Message></TestRequest>")
                    .attachment(testAttachment.getContentId(), testAttachment.getContentType(), testAttachment.getContent());
            }
        };

        builder.configure();

        TestCase test = builder.getTestCase();
        Assert.assertEquals(test.getActionCount(), 1);
        Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);
        Assert.assertEquals(((DelegatingTestAction)test.getActions().get(0)).getDelegate().getClass(), SendSoapMessageAction.class);

        SendSoapMessageAction action = (SendSoapMessageAction) ((DelegatingTestAction)test.getActions().get(0)).getDelegate();
        Assert.assertEquals(action.getName(), "send");

        Assert.assertEquals(action.getEndpoint(), soapClient);
        Assert.assertEquals(action.getMessageBuilder().getClass(), StaticMessageContentBuilder.class);

        StaticMessageContentBuilder messageBuilder = (StaticMessageContentBuilder) action.getMessageBuilder();
        Assert.assertEquals(messageBuilder.getMessage().getPayload(), "<TestRequest><Message>Hello World!</Message></TestRequest>");
        Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 0L);

        Assert.assertEquals(action.getAttachments().size(), 1L);
        Assert.assertNull(action.getAttachments().get(0).getContentResourcePath());
        Assert.assertEquals(action.getAttachments().get(0).getContent(), testAttachment.getContent());
        Assert.assertEquals(action.getAttachments().get(0).getContentId(), testAttachment.getContentId());
        Assert.assertEquals(action.getAttachments().get(0).getContentType(), testAttachment.getContentType());
        Assert.assertEquals(action.getAttachments().get(0).getCharsetName(), testAttachment.getCharsetName());
    }

    @Test
    public void testMultipleSoapAttachmentData() {
        MockTestDesigner builder = new MockTestDesigner(applicationContext, context) {
            @Override
            public void configure() {
                soap().client(soapClient)
                        .send()
                        .payload("<TestRequest><Message>Hello World!</Message></TestRequest>")
                        .attachment(testAttachment.getContentId() + 1, testAttachment.getContentType(), testAttachment.getContent() + 1)
                        .attachment(testAttachment.getContentId() + 2, testAttachment.getContentType(), testAttachment.getContent() + 2);
            }
        };

        builder.configure();

        TestCase test = builder.getTestCase();
        Assert.assertEquals(test.getActionCount(), 1);
        Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);
        Assert.assertEquals(((DelegatingTestAction)test.getActions().get(0)).getDelegate().getClass(), SendSoapMessageAction.class);

        SendSoapMessageAction action = (SendSoapMessageAction) ((DelegatingTestAction)test.getActions().get(0)).getDelegate();
        Assert.assertEquals(action.getName(), "send");

        Assert.assertEquals(action.getEndpoint(), soapClient);
        Assert.assertEquals(action.getMessageBuilder().getClass(), StaticMessageContentBuilder.class);

        StaticMessageContentBuilder messageBuilder = (StaticMessageContentBuilder) action.getMessageBuilder();
        Assert.assertEquals(messageBuilder.getMessage().getPayload(), "<TestRequest><Message>Hello World!</Message></TestRequest>");
        Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 0L);

        Assert.assertEquals(action.getAttachments().size(), 2L);
        Assert.assertNull(action.getAttachments().get(0).getContentResourcePath());
        Assert.assertEquals(action.getAttachments().get(0).getContent(), testAttachment.getContent() + 1);
        Assert.assertEquals(action.getAttachments().get(0).getContentId(), testAttachment.getContentId() + 1);
        Assert.assertEquals(action.getAttachments().get(0).getContentType(), testAttachment.getContentType());
        Assert.assertEquals(action.getAttachments().get(0).getCharsetName(), testAttachment.getCharsetName());
        Assert.assertNull(action.getAttachments().get(1).getContentResourcePath());
        Assert.assertEquals(action.getAttachments().get(1).getContent(), testAttachment.getContent() + 2);
        Assert.assertEquals(action.getAttachments().get(1).getContentId(), testAttachment.getContentId() + 2);
        Assert.assertEquals(action.getAttachments().get(1).getContentType(), testAttachment.getContentType());
        Assert.assertEquals(action.getAttachments().get(1).getCharsetName(), testAttachment.getCharsetName());
    }

    @Test
    public void testSoapAttachmentResource() throws IOException {
        MockTestDesigner builder = new MockTestDesigner(applicationContext, context) {
            @Override
            public void configure() {
                soap().client(soapClient)
                    .send()
                    .payload("<TestRequest><Message>Hello World!</Message></TestRequest>")
                    .attachment(testAttachment.getContentId(), testAttachment.getContentType(), resource);
            }
        };

        reset(resource);
        when(resource.getInputStream()).thenReturn(new ByteArrayInputStream("someAttachmentData".getBytes()));
        builder.configure();

        TestCase test = builder.getTestCase();
        Assert.assertEquals(test.getActionCount(), 1);
        Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);
        Assert.assertEquals(((DelegatingTestAction)test.getActions().get(0)).getDelegate().getClass(), SendSoapMessageAction.class);

        SendSoapMessageAction action = (SendSoapMessageAction) ((DelegatingTestAction)test.getActions().get(0)).getDelegate();
        Assert.assertEquals(action.getName(), "send");

        Assert.assertEquals(action.getEndpoint(), soapClient);
        Assert.assertEquals(action.getMessageBuilder().getClass(), StaticMessageContentBuilder.class);

        StaticMessageContentBuilder messageBuilder = (StaticMessageContentBuilder) action.getMessageBuilder();
        Assert.assertEquals(messageBuilder.getMessage().getPayload(), "<TestRequest><Message>Hello World!</Message></TestRequest>");
        Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 0L);

        Assert.assertEquals(action.getAttachments().get(0).getContent(), "someAttachmentData");
        Assert.assertEquals(action.getAttachments().get(0).getContentId(), testAttachment.getContentId());
        Assert.assertEquals(action.getAttachments().get(0).getContentType(), testAttachment.getContentType());
        Assert.assertEquals(action.getAttachments().get(0).getCharsetName(), testAttachment.getCharsetName());
    }

    @Test
    public void testSendBuilderWithEndpointName() {
        reset(applicationContextMock);
        when(applicationContextMock.getBean(TestActionListeners.class)).thenReturn(new TestActionListeners());
        when(applicationContextMock.getBeansOfType(SequenceBeforeTest.class)).thenReturn(new HashMap<String, SequenceBeforeTest>());
        when(applicationContextMock.getBeansOfType(SequenceAfterTest.class)).thenReturn(new HashMap<String, SequenceAfterTest>());
        MockTestDesigner builder = new MockTestDesigner(applicationContextMock, context) {
            @Override
            public void configure() {
                soap().client("soapClient")
                    .send()
                    .payload("<TestRequest><Message>Hello World!</Message></TestRequest>")
                    .header("operation", "soapOperation")
                    .attachment(testAttachment);

                send("otherClient")
                    .payload("<TestRequest><Message>Hello World!</Message></TestRequest>");
            }
        };

        builder.configure();

        TestCase test = builder.getTestCase();
        Assert.assertEquals(test.getActionCount(), 2);
        Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);
        Assert.assertEquals(((DelegatingTestAction)test.getActions().get(0)).getDelegate().getClass(), SendSoapMessageAction.class);
        Assert.assertEquals(test.getActions().get(1).getClass(), DelegatingTestAction.class);
        Assert.assertEquals(((DelegatingTestAction)test.getActions().get(1)).getDelegate().getClass(), SendMessageAction.class);

        SendMessageAction action = (SendSoapMessageAction) ((DelegatingTestAction)test.getActions().get(0)).getDelegate();
        Assert.assertEquals(action.getName(), "send");
        Assert.assertEquals(action.getEndpointUri(), "soapClient");

        StaticMessageContentBuilder messageBuilder = (StaticMessageContentBuilder) action.getMessageBuilder();
        Assert.assertEquals(messageBuilder.getMessage().getPayload(), "<TestRequest><Message>Hello World!</Message></TestRequest>");
        Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 1L);
        Assert.assertTrue(messageBuilder.getMessageHeaders().containsKey("operation"));

        action = (SendMessageAction) ((DelegatingTestAction)test.getActions().get(1)).getDelegate();
        Assert.assertEquals(action.getName(), "send");
        Assert.assertEquals(action.getEndpointUri(), "otherClient");
    }

    @Test
    public void testSendBuilderWithEndpointNameDeprecated() {
        reset(applicationContextMock);
        when(applicationContextMock.getBean(TestActionListeners.class)).thenReturn(new TestActionListeners());
        when(applicationContextMock.getBeansOfType(SequenceBeforeTest.class)).thenReturn(new HashMap<String, SequenceBeforeTest>());
        when(applicationContextMock.getBeansOfType(SequenceAfterTest.class)).thenReturn(new HashMap<String, SequenceAfterTest>());
        MockTestDesigner builder = new MockTestDesigner(applicationContextMock, context) {
            @Override
            public void configure() {
                send("soapClient")
                    .payload("<TestRequest><Message>Hello World!</Message></TestRequest>")
                    .header("operation", "soapOperation")
                    .soap()
                    .attachment(testAttachment);

                send("otherClient")
                    .payload("<TestRequest><Message>Hello World!</Message></TestRequest>");
            }
        };

        builder.configure();

        TestCase test = builder.getTestCase();
        Assert.assertEquals(test.getActionCount(), 2);
        Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);
        Assert.assertEquals(((DelegatingTestAction)test.getActions().get(0)).getDelegate().getClass(), SendSoapMessageAction.class);
        Assert.assertEquals(test.getActions().get(1).getClass(), DelegatingTestAction.class);
        Assert.assertEquals(((DelegatingTestAction)test.getActions().get(1)).getDelegate().getClass(), SendMessageAction.class);

        SendMessageAction action = (SendSoapMessageAction) ((DelegatingTestAction)test.getActions().get(0)).getDelegate();
        Assert.assertEquals(action.getName(), "send");
        Assert.assertEquals(action.getEndpointUri(), "soapClient");

        PayloadTemplateMessageBuilder messageBuilder = (PayloadTemplateMessageBuilder) action.getMessageBuilder();
        Assert.assertEquals(messageBuilder.getPayloadData(), "<TestRequest><Message>Hello World!</Message></TestRequest>");
        Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 1L);
        Assert.assertTrue(messageBuilder.getMessageHeaders().containsKey("operation"));

        action = (SendMessageAction) ((DelegatingTestAction)test.getActions().get(1)).getDelegate();
        Assert.assertEquals(action.getName(), "send");
        Assert.assertEquals(action.getEndpointUri(), "otherClient");
    }

    @Test(expectedExceptions = CitrusRuntimeException.class,
          expectedExceptionsMessageRegExp = "Invalid use of http and soap action builder")
    public void testSendBuilderWithSoapAndHttpMixed() {
        reset(applicationContextMock);
        when(applicationContextMock.getBean(TestActionListeners.class)).thenReturn(new TestActionListeners());
        when(applicationContextMock.getBeansOfType(SequenceBeforeTest.class)).thenReturn(new HashMap<String, SequenceBeforeTest>());
        when(applicationContextMock.getBeansOfType(SequenceAfterTest.class)).thenReturn(new HashMap<String, SequenceAfterTest>());
        MockTestDesigner builder = new MockTestDesigner(applicationContextMock, context) {
            @Override
            public void configure() {
                send("soapClient")
                        .payload("<TestRequest><Message>Hello World!</Message></TestRequest>")
                        .header("operation", "soapOperation")
                        .soap()
                        .attachment(testAttachment)
                        .http();
            }
        };

        builder.configure();

        TestCase test = builder.getTestCase();
        Assert.assertEquals(test.getActionCount(), 1);
        Assert.assertEquals(test.getActions().get(0).getClass(), SendMessageAction.class);

        SendMessageAction action = ((SendMessageAction)test.getActions().get(0));
        Assert.assertEquals(action.getName(), "send");
        Assert.assertEquals(action.getEndpointUri(), "soapClient");
        Assert.assertEquals(action.getMessageType(), MessageType.XML.name());

    }

}


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

namespace l8
{
    class Program
    {
        static void TestCar()
        {
            //Collection initializer fordi vi har Add() metode
            var msl = new SortedList<int> {5, 2, 9, 8, 10, 3, 4, 7};

            //Operator overloading
            msl = msl + 1;
            msl += 6;

            //Her bruges indexeren:
            for (int i = 0; i < msl.Count; i++)
                Console.WriteLine("Element på plads nr. {0} er {1}", i, msl[i]);

            //De tre iteratorer:
            Console.WriteLine("Forward order:");
            foreach (int i in msl)
                Console.WriteLine(i);
            Console.WriteLine("Reverse order:");
            foreach (int i in msl.GetElementsReversed())
                Console.WriteLine(i);
            Console.WriteLine("Even elements, forward order:");
            foreach (int i in msl.GetElements(x => x % 2 == 0))
                Console.WriteLine(i);
            msl.Remove(6);

            //Mere operator overloading
            msl = msl - 9;
            msl -= 2;
            Console.WriteLine("MySortedList after removal:");
            foreach (int i in msl)
                Console.WriteLine(i);

            //Test om det virker med biler (IComparable og IComparer)
            var mySortedCars = new SortedList<Car>
            {
                new Car("Mazda 6", 2005, 110, 950, 264999.95M),
                new Car("Mazda 3", 2007, 90, 700, 185000),
                //new Car("Mazda 0", 2014, 130, 0, 20000M),
                new Car("VW Golf 6", 2009, 150, 1050, 285000),
                new Car("Bugatti Veyron", 2008, 1001, 1000, 22265000),
                new Car("Renault Twingo", 2011, 55, 700, 85000),
                new Car("VW Polo BlueMotion", 2011, 90, 800, 195000),
                new Car("Ford Mondeo", 207, 150, 1105, 365000)
            };
            mySortedCars += new Car("Mazda 3", 2006, 90, 798, 165000);

            //forudsætter implementation af IComparable
            foreach (Car c in mySortedCars)
                Console.WriteLine(c);
            var myUnsortedCars = new List<Car>(mySortedCars);
            Console.WriteLine("Cars sorted according to their power-to-weight ratio:");

            //forudsætter implementation af IComparer
            myUnsortedCars.Sort(new Car.PowerToWeightRatioComparer());
            foreach (Car c in myUnsortedCars)
                Console.WriteLine(c);
        }

        static void Main()
        {
            var test = new SortedList<int> {3, 2, 8, 1, 2, 9, 7};
            test = test + 12;
            test += 13;
            test = test - 8;
            test -= 13;

            test.Add(47);

            foreach (var item in test)
            {
                Console.WriteLine(item);
            }

            Console.WriteLine(test[0]);

            TestCar();
            Console.ReadLine();
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!doctype html>
<title>ember.js + require.js • TodoMVC</title>
<meta http-equiv="refresh" content="0;URL=readme.md">


text:
function input_init_pre() {
  prop.input={};

  prop.input.command  = "";
  prop.input.callsign = "";
  prop.input.data     = "";

  prop.input.history      = [];
  prop.input.history_item = null;

  prop.input.click    = [0, 0];

  prop.input.positions = "";

  prop.input.tab_compl = {};

  prop.input.mouseDelta = [0, 0];
  prop.input.mouseDown = [0, 0];
  prop.input.isMouseDown = false;
}

function input_init() {
  // For firefox see: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode
  var is_firefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
  $(window).keydown(function(e) {
    if(e.which == 27) {
      if(prop.tutorial.open) tutorial_close();
      else if($("#airport-switch").hasClass("open")) ui_airport_close();
    }
    // Minus key to zoom out, plus to zoom in
    if(e.which == 189 || (is_firefox && e.which == 173)) {
      ui_zoom_out();
      return false;
    } else if(e.which == 187 || (is_firefox && e.which == 61)) {
      if(e.shiftKey) {
        ui_zoom_in();
      } else {
        ui_zoom_reset();
      }
      return false;
    }
    if(!prop.tutorial.open) return;
    if(e.which == 33) {
      tutorial_prev()
      e.preventDefault();
    } else if(e.which == 34) {
      tutorial_next()
      e.preventDefault();
    }
  });

  $("#canvases").bind("DOMMouseScroll mousewheel", function(e) {
    if (e.originalEvent.wheelDelta > 0 || e.originalEvent.detail < 0) {
      ui_zoom_in();
    } else {
      ui_zoom_out();
    }
  });

  $("#canvases").mousemove(function(e) {
    if(prop.input.isMouseDown){
      prop.input.mouseDelta = [e.pageX - prop.input.mouseDown[0], e.pageY - prop.input.mouseDown[1]];
      prop.canvas.panX = prop.input.mouseDelta[0];
      prop.canvas.panY = prop.input.mouseDelta[1];
      prop.canvas.dirty = true;
    }
  });

  $("#canvases").mouseup(function(e) {
    prop.input.isMouseDown = false;
  });

  $("#canvases").mousedown(function(e) {
    if(e.which  == 2) {
      e.preventDefault();
      ui_zoom_reset();
    } else if(e.which ==1){
      // Record mouse down position for panning
      prop.input.mouseDown = [e.pageX - prop.canvas.panX, e.pageY - prop.canvas.panY];
      prop.input.isMouseDown = true;

      // Aircraft label selection
      var position = [e.pageX, -e.pageY];
      position[0] -= prop.canvas.size.width / 2;
      position[1] += prop.canvas.size.height / 2;
      var nearest = aircraft_get_nearest([px_to_km(position[0] - prop.canvas.panX), px_to_km(position[1] + prop.canvas.panY)]);
      if(nearest[0]) {
        if(nearest[1] < px_to_km(80)) {
          input_select(nearest[0].getCallsign().toUpperCase());
        } else {
          input_select();
        }
      }
      position = [px_to_km(position[0]), px_to_km(position[1])];
      position[0] = parseFloat(position[0].toFixed(2));
      position[1] = parseFloat(position[1].toFixed(2));
      prop.input.positions += "["+position.join(",")+"]";
      e.preventDefault();
      return(false);
    }
  });

  $(window).keydown(function() {
    if(!game_paused())
      $("#command").focus();
  });

  $("#command").keydown(input_keydown);
  $("#command").on("input", input_change);
}

function input_select(callsign) {
  if(callsign) $("#command").val(callsign + " ");
  else $("#command").val("");
  $("#command").focus();
  input_change();
}

function input_change() {
  tab_completion_reset();
  var value = $("#command").val();
  prop.input.command = value;
  input_parse();
}

function input_parse() {
  $(".strip").removeClass("active");
  prop.input.callsign = "";
  prop.input.data     = "";

  var c = prop.input.command;
  var i;
  var skip=false;
  var data=false;

  for(i=0;i<c.length;i++) {
    if(c[i] == " " && prop.input.data.length == 0 && prop.input.callsign.length != 0) {
      skip=true;
    }
    if(skip && c[i] != " ") {
      skip=false;
      data=true;
    }
    if(!skip) {
      if(data) prop.input.data += c[i].toLowerCase();
      else prop.input.callsign += c[i].toLowerCase();
    }
  }

  if(prop.input.callsign.length == 0) return;

  var number = 0;
  var match  = null;

  prop.canvas.dirty = true;

  for(var i=0;i<prop.aircraft.list.length;i++) {
    var aircraft=prop.aircraft.list[i];
    if(aircraft.matchCallsign(prop.input.callsign)) {
      number += 1;
      match = aircraft;
      aircraft.html.addClass("active");
    }
  }

  var sidebar = $('#sidebar');

  if ((number == 1) &&
      ((match.html.offset().top < 0) ||
       ((match.html.offset().top
         + match.html.height()
         - sidebar.offset().top)
        > sidebar.height())))
  {
    sidebar.scrollTop(sidebar.scrollTop()
                      + match.html.offset().top
                      - (sidebar.height() / 2));
  }
}

function input_keydown(e) {
  switch(e.which) {
    case 13:  // enter
      input_parse();
      if(input_run()) {
        prop.input.history.unshift(prop.input.callsign);
        $("#command").val("");
        prop.input.command = "";
        tab_completion_reset();
        input_parse();
      }
      prop.input.history_item = null;
      break;

    case 33:  // Page Up
      input_history_prev(); // recall previous callsign
      e.preventDefault();
      break;

    case 34:  // Page Down
      input_history_next(); // recall subsequent callsign
      e.preventDefault();
      break;

    case 37:  // left arrow
      if(prop.game.option.get('controlMethod') == 'arrows') { //shortKeys in use
        $("#command").val($("#command").val() + " \u2BA2");
        e.preventDefault();
        input_change();
      }
      break;

    case 38:  // up arrow
      if(prop.game.option.get('controlMethod') == 'arrows') { //shortKeys in use
        $("#command").val($("#command").val() + " \u2B61");
        e.preventDefault();
        input_change();
      }
      else {
        input_history_prev(); // recall previous callsign
        e.preventDefault();
      }
      break;

    case 39:  // right arrow
      if(prop.game.option.get('controlMethod') == 'arrows') { //shortKeys in use
        $("#command").val($("#command").val() + " \u2BA3");
        e.preventDefault();
        input_change();
      }
      break;

    case 40:  //down arrow
      if(prop.game.option.get('controlMethod') == 'arrows') { //shortKeys in use
        $("#command").val($("#command").val() + " \u2B63");
        e.preventDefault();
        input_change();
      }
      else {
        input_history_prev(); // recall previous callsign
        e.preventDefault();
      }
      break;

    case 106: //numpad *
      $("#command").val($("#command").val() + " \u2B50");
      e.preventDefault();
      input_change();
      break;

    case 107: //numpad +
      $("#command").val($("#command").val() + " +");
      e.preventDefault();
      input_change();
      break;

    case 109: //numpad -
      $("#command").val($("#command").val() + " -");
      e.preventDefault();
      input_change();
      break;

    case 111: //numpad /
      $("#command").val($("#command").val() + " takeoff");
      e.preventDefault();
      input_change();
      break;

    case 9: // tab
      if(!prop.input.tab_compl.matches) {
        tab_completion_match();
      }
      tab_completion_cycle({backwards: e.shiftKey});
      e.preventDefault();
      break;

    case 27:  // esc
      $("#command").val("");
      e.preventDefault();
      break;
  }
}

function tab_completion_cycle(opt) {
  var matches = prop.input.tab_compl.matches;
  if(!matches || matches.length === 0) {
    return;
  }
  var i = prop.input.tab_compl.cycle_item;
  if(opt.backwards) {
    i = (i <= 0) ? matches.length-1 : i-1;
  } else {
    i = (i >= matches.length-1) ? 0 : i+1;
  }
  $("#command").val(matches[i] + " ");
  prop.input.command = matches[i];
  prop.input.tab_compl.cycle_item = i;
  input_parse();
}

function tab_completion_match() {
  var val = $("#command").val();
  var matches;
  var aircrafts = prop.aircraft.list;
  if(prop.input.callsign) {
    aircrafts = aircrafts.filter(function(a) {
      return a.matchCallsign(prop.input.callsign);
    });
  }
  matches = aircrafts.map(function(a) {
    return a.getCallsign();
  });
  if(aircrafts.length === 1 && (prop.input.data || val[val.length-1] === ' ')){
    matches = aircrafts[0].COMMANDS.filter(function(c) {
      return c.toLowerCase().indexOf(prop.input.data.toLowerCase()) === 0;
    }).map(function(c) {
      return val.substring(0, prop.input.callsign.length+1) + c;
    });
  }
  tab_completion_reset();
  prop.input.tab_compl.matches = matches;
  prop.input.tab_compl.cycle_item = -1;
}

function tab_completion_reset() {
  prop.input.tab_compl = {};
}

function input_history_clamp() {
  prop.input.history_item = clamp(0, prop.input.history_item, prop.input.history.length-1);
}

function input_history_prev() {
  if(prop.input.history.length == 0) return;
  if(prop.input.history_item == null) {
    prop.input.history.unshift(prop.input.command);
    prop.input.history_item = 0;
  }

  prop.input.history_item += 1;
  input_history_clamp();

  var command = prop.input.history[prop.input.history_item] + ' ';
  $("#command").val(command.toUpperCase());
  input_change();
}

function input_history_next() {
  if(prop.input.history.length == 0) return;
  if(prop.input.history_item == null) return;

  prop.input.history_item -= 1;

  if(prop.input.history_item <= 0){
    $("#command").val(prop.input.history[0]);
    input_change();
    prop.input.history.splice(0, 1);
    prop.input.history_item = null;
    return;
  }

  input_history_clamp();

  var command = prop.input.history[prop.input.history_item] + ' ';
  $("#command").val(command.toUpperCase());
  input_change();
}

function input_run() {
  if(prop.input.callsign == "version") {
    ui_log("Air Traffic Control simulator version " + prop.version.join("."));
    return true;
  } else if(prop.input.callsign == "tutorial") {
    tutorial_toggle();
    return true;
  } else if(prop.input.callsign == "auto") {
    aircraft_toggle_auto();
    if(prop.aircraft.auto.enabled) {
      ui_log('automatic controller ENGAGED');
    } else {
      ui_log('automatic controller OFF');
    }
    return true;
  } else if(prop.input.callsign == "pause") {
    game_pause_toggle();
    return true;
  } else if(prop.input.callsign == "timewarp" ||
            prop.input.callsign == "speedup" ||
            prop.input.callsign == "timescale" ||
            prop.input.callsign == "slowmo") {
    if(prop.input.data) {
      prop.game.speedup = parseInt(prop.input.data);
    } else {
      game_timewarp_toggle();
    }
    return true;
  } else if(prop.input.callsign == "clear") {
    localStorage.clear();
    location.reload();
  } else if(prop.input.callsign == "airport") {
    if(prop.input.data) {
      if(prop.input.data.toLowerCase() in prop.airport.airports) {
        airport_set(prop.input.data);
      } else {
        ui_airport_toggle();
      }
    } else {
      ui_airport_toggle();
    }
    return true;
  } else if(prop.input.callsign == "rate") {
    if (prop.input.data) {
      var freq = parseFloat(prop.input.data);
      if (freq && freq > 0) {
        prop.game.frequency = freq;
      }
    }
    return true;
  }

  var matches = 0;
  var match   = -1;

  for(var i=0;i<prop.aircraft.list.length;i++) {
    var aircraft=prop.aircraft.list[i];
    if(aircraft.matchCallsign(prop.input.callsign)) {
      matches += 1;
      match    = i;
    }
  }

  if(matches > 1) {
    ui_log("multiple aircraft match the callsign, say again");
    return true;
  }
  if(match == -1) {
    ui_log("no such aircraft, say again");
    return true;
  }

  var aircraft = prop.aircraft.list[match];
  return aircraft.runCommand(prop.input.data);
}


text:
<?php

class Uris_Canonization extends Uris_Uris {

	private $_uri;
	private $_currentUri;
	private $_baseUri;
	private $_parseUri;
	private $_parseCurrentUri;

	public function canonization($uri, $currentUri = '', $baseUri = null) {
		$this->_uri = trim($uri);
		$this->_parseUri = parse_url($this->_uri);
		$this->_currentUri = $currentUri;
		$this->_baseUri = $baseUri;
		$this->_parseCurrentUri = parse_url($currentUri);

		$_parseUri = parse_url($this->_fetchAbsoluteUri());
		$_parseUri['path'] = isset($_parseUri['path']) ? $this->_getCanonizedPath($_parseUri['path']) : '';

		return $this->_pasteUri($_parseUri);
	}

	private function _fetchAbsoluteUri() {
		if (isset($this->_parseUri['host']) && !empty($this->_parseUri['host'])) {
			if (isset($this->_parseUri['scheme']) && !empty($this->_parseUri['scheme'])) {
				return $this->_uri;
			} else {
				return $this->_parseCurrentUri['scheme'] . ':' . $this->_uri;
			}
		} else {
			if (empty($this->_uri)) {
				return $this->_currentUri;
			} else {
				if ($this->_uri[0] == '/') {
					if (isset($this->_uri[1]) && $this->_uri[1] == '/') {
						exit;
						return $this->_parseCurrentUri['scheme'] . ':' . $this->_uri;
					} else {
						return $this->_targetUri . $this->_uri;
					}
				} else {
					if ($this->_baseUri != null) {
						return $this->_baseUri . $this->_uri;
					} else {

						if (!isset($this->_parseCurrentUri['path']) || $this->_currentUri[mb_strlen($this->_currentUri, self::ENCODING) - 1] == '/') {
							return $this->_pasteUri($this->_currentUri, true, false) . '/' . $this->_uri;
						} else {
							$parsePath = mb_split('[/]', $this->_parseCurrentUri['path']);
							unset($parsePath[count($parsePath) - 1]);
							$this->_parseCurrentUri['path'] = $this->_pastePath($parsePath);
							return $this->_pasteUri($this->_pasteUri($this->_parseCurrentUri), true, false) . $this->_uri;
						}
					}
				}
			}
		}
	}

	private function _getCanonizedPath($path) {
		$path = mb_substr($path, 1, mb_strlen($path, self::ENCODING));
		while (mb_strlen($path, self::ENCODING) >= 2) {
			if ((mb_strlen($path, self::ENCODING) >= 3) && ($path[0] == '.' && $path[1] == '.' && $path[2] == '/')) {
				$path = mb_substr($path, 3, mb_strlen($path, self::ENCODING), self::ENCODING);
			} else {
				if ($path[0] == '.' && $path[1] == '/') {
					$path = mb_substr($path, 2, mb_strlen($path, self::ENCODING), self::ENCODING);
				}
			}
			break;
		}
		$parsePath = $this->_clearArrayOfEmptyElements(mb_split('[/]', $path));
		foreach ($parsePath as $key => $value) {
			if ($parsePath[$key] == '.') {
				unset($parsePath[$key]);
			}
		}
		foreach ($parsePath as $key => $value) {
			if ($parsePath[$key] == '..') {
				unset($parsePath[$key]);
				for ($m = 1; $key - $m >= 0; $m++) {
					if (isset($parsePath[$key - $m])) {
						unset($parsePath[$key - $m]);
						break;
					}
				}
			}
		}
		$canonization = '/';
		foreach ($parsePath as $value) {
			$canonization.=$value . '/';
		}

		if ($this->_isPathToFile($path)) {
			return mb_substr($canonization, 0, mb_strlen($canonization, self::ENCODING) - 1, self::ENCODING);
		} else {
			return $canonization;
		}
	}

	private function _isPathToFile($path) {
		if (!empty($path)) {
			$parsePath = mb_split('[/]', $path);
			if (mb_strpos($parsePath[count($parsePath) - 1], '.', 0, self::ENCODING)) {
				return true;
			}
		}
		return false;
	}

	private function _pastePath($parsePath) {
		$canonization = '/';
		foreach ($parsePath as $value) {
			$canonization.=$value . '/';
		}
		return $canonization;
	}

}


text:
import $ from 'jquery';

/* Icon Picker by QueryLoop
 * Author: @eliorivero
 * URL: http://queryloop.com/
 * License: GPLv2
 */

var defaults = {
    'mode': 'dialog', // show overlay 'dialog' panel or slide down 'inline' panel
    'closeOnPick': true, // whether to close panel after picking or 'no'
    'save': 'class', // save icon 'class' or 'code'
    'size': '',
    'classes': {
        'launcher': '', // extra classes for launcher buttons
        'clear': 'remove-times', // extra classes for button that removes preview and clears field
        'highlight': '', // extra classes when highlighting an icon
        'close': '' // extra classes for close button
    },
    'iconSets': { // example data structure. Used to specify which launchers will be created
        'genericon': 'Genericon', // create a launcher to pick genericon icons
        'fa': 'FontAwesome' // create a launcher to pick fontawesome icons
    }
};

class QL_Icon_Picker {

    constructor(element, options) {
        this.iconSet = '';
        this.iconSetName = '';
        this.$field = '';
        this.element = element;
        this.settings = $.extend({}, defaults, options);
        this._defaults = defaults;
        this.init();
    }

    init() {
        var $brick = $(this.element);
        var pickerId = $brick.data('pickerid');
        var $preview = $('
');

        this.$field = $brick.find('input');

        // Add preview area
        this.makePreview($brick, pickerId, $preview);

        // Make button to clear field and remove preview
        this.makeClear(pickerId, $preview);

        // Make buttons that open the panel of icons
        this.makeLaunchers($brick, pickerId);

        // Prepare display styles, inline and dialog
        this.makeDisplay($brick);
    }

    makePreview($brick, pickerId, $preview) {
        var $icon = $('');
        var iconValue = this.$field.val();

        $preview.prependTo($brick);
        $icon.prependTo($preview);
        if (iconValue !== '') {
            $preview.addClass('icon-preview-on');
            $icon.addClass(iconValue);
        }
    }

    makeClear(pickerId, $preview) {
        var base = this;
        var $clear = $('');

        // Hide button to remove icon and preview and append it to preview area
        $clear.hide().prependTo($preview);
        // If there's a icon saved in the field, show remove icon button
        if (base.$field.val() !== '') {
            $clear.show();
        }

        $preview.on('click', '.remove-icon', function(e) {
            e.preventDefault();
            base.$field.val('');
            $preview.removeClass('icon-preview-on').find('i').removeClass();
            $(this).hide();
        });
    }

    makeDisplay($brick) {
        var base = this;
        var close = base.settings.classes.close;
        var $body = $('body');

        var $close = $('');

        if (base.settings.mode === 'inline') {
            $brick.find('.icon-set').append($close).removeClass('dialog').addClass('ip-inline ' + base.settings.size).parent().addClass('icon-set-wrap');
        } else if (base.settings.mode === 'dialog') {
            $('.icon-set').addClass('dialog ' + base.settings.size);
            if ($('.icon-picker-overlay').length <= 0) {
                $body.append('
').append($close);
            }
        }
        $body
            .on('click', '.icon-picker-close, .icon-picker-overlay', function(e) {
                e.preventDefault();
                base.closePicker($brick, $(base.iconSet), base.settings.mode);
            })
            .on('mouseenter mouseleave', '.icon-picker-close', function(e) {
                if (e.type === 'mouseenter') {
                    $(this).addClass(close);
                } else {
                    $(this).removeClass(close);
                }
            });
    }

    makeLaunchers($brick) {
        var base = this;
        var dataIconSets = $brick.data('iconsets');
        var iconSet;

        if (typeof dataIconSets === 'undefined') {
            dataIconSets = base.settings.iconSets;
        }
        for (iconSet in dataIconSets) {
            if (dataIconSets.hasOwnProperty(iconSet)) {
                $brick.append('' + dataIconSets[iconSet] + '');
            }
        }

        $brick.find('.launch-icons').on('click', function(e) {
            e.preventDefault();
            var $self = $(this);
            var theseIcons = $self.data('icons');

            base.iconSetName = theseIcons;
            base.iconSet = '.' + theseIcons + '-set';

            // Initialize picker
            base.iconPick($brick);

            // Show icon picker
            base.showPicker($brick, $(base.iconSet), base.settings.mode);
        });
    }

    iconPick($brick) {
        var base = this;
        var highlight = 'icon-highlight ' + base.settings.classes.highlight;

        $(base.iconSet).on('click', 'li', function(e) {
            e.preventDefault();
            var $icon = $(this);
            var icon = $icon.data(base.settings.save);

            // Mark as selected
            $('.icon-selected').removeClass('icon-selected');
            $icon.addClass('icon-selected');
            if (base.$field.data('format') === 'short') {
                icon = icon.slice(6);
            }

            // Save icon value to field
            base.$field.val(icon);

            // Close icon picker
            if (base.settings.closeOnPick) {
                base.closePicker($brick, $icon.closest(base.iconSet), base.settings.mode);
            }

            // Set preview
            base.setPreview($icon.data('class'));

            // Broadcast event passing the selected icon.
            $('body').trigger('iconselected.queryloop', icon);
        });
        $(base.iconSet).on('mouseenter mouseleave', 'li', function(e) {
            if (e.type === 'mouseenter') {
                $(this).addClass(highlight);
            } else {
                $(this).removeClass(highlight);
            }
        });
    }

    showPicker($brick, $icons, mode) {
        if (mode === 'inline') {
            $('.icon-set').removeClass('ip-inline-open');
            $brick.find($icons).toggleClass('ip-inline-open');
        } else if (mode === 'dialog') {
            $brick.find('.icon-picker-close').addClass('make-visible');
            $brick.find('.icon-picker-overlay').addClass('make-visible');
            $icons.addClass('dialog-open');
        }

        $icons.find('.icon-selected').removeClass('icon-selected');
        var selectedIcon = this.$field.val().replace(' ', '.');
        if (selectedIcon !== '') {
            if (this.settings.save === 'class') {
                $icons.find('.' + selectedIcon).addClass('icon-selected');
            } else {
                $icons.find('[data-code="' + selectedIcon + '"]').addClass('icon-selected');
            }
        }
        // Broadcast event when the picker is shown passing the picker mode.
        $('body').trigger('iconpickershow.queryloop', mode);
    }

    closePicker($brick, $icons, mode) {
        // Remove event so they don't fire from a different picker
        $(this.iconSet).off('click', 'li');

        if (mode === 'inline') {
            $brick.find($icons).removeClass('ip-inline-open');
        } else if (mode === 'dialog') {
            $('.icon-picker-close, .icon-picker-overlay').removeClass('make-visible');
        }
        // Broadcast event when the picker is closed passing the picker mode.
        $('body').trigger('iconpickerclose.queryloop', mode);
        $('.icon-set').removeClass('dialog-open');
    }

    setPreview(preview) {
        var $preview = $(this.element).find('.icon-preview');

        $preview.addClass('icon-preview-on').find('i').removeClass()
            .addClass(this.iconSetName)
            .addClass(preview);
        $preview.find('a').show();
    }
}

/* Grav */
// extend $ with 3rd party QL Icon Picker
$.fn.qlIconPicker = function(options) {
    this.each(function() {
        if (!$.data(this, 'plugin_qlIconPicker')) {
            $.data(this, 'plugin_qlIconPicker', new QL_Icon_Picker(this, options));
        }
    });

    return this;
};

export default class IconpickerField {

    constructor(options) {
        this.items = $();
        this.options = Object.assign({}, this.defaults, options);

        $('[data-grav-iconpicker]').each((index, element) => this.addItem(element));
        $('body').on('mutation._grav', this._onAddedNodes.bind(this));
    }

    _onAddedNodes(event, target/* , record, instance */) {
        let fields = $(target).find('[data-grav-iconpicker]');
        if (!fields.length) { return; }

        fields.each((index, field) => {
            field = $(field);
            if (!~this.items.index(field)) {
                this.addItem(field);
            }
        });
    }

    addItem(element) {
        element = $(element);
        this.items = this.items.add(element);
        element.find('.icon-picker').qlIconPicker({
            'save': 'class'
        });

        // hack to remove extra icon sets that are just copies
        $('.icon-set:not(:first)').remove();
    }
}

export let Instance = new IconpickerField();

// Fix to close the dialog when clicking outside
$(document).on('click', (event) => {
    const target = $(event.target);
    const match = '.icon-set.dialog-open, .launch-icons[data-icons]';
    if (!target.is(match) && !target.closest(match).length) {
        const dialogs = $('.icon-set.dialog-open');

        // skip if there's no dialog open
        if (dialogs.length) {
            dialogs.each((index, dialog) => {
                const picker = $(dialog).siblings('.icon-picker');
                const data = picker.data('plugin_qlIconPicker');
                data.closePicker(picker, $(data.iconSet), data.settings.mode);
            });
        }
    }
});


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http.Filters;

namespace Engine.API.Filters
{
    public class HttpOperationExceptionFilterAttribute : ExceptionFilterAttribute
    {
        public override void OnException(HttpActionExecutedContext context)
        {
            if (context.Exception is Microsoft.Rest.HttpOperationException)
            {
                var ex = (Microsoft.Rest.HttpOperationException)context.Exception;
                context.Response = ex.Response;
            }
        }
    }
}


text:
<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/maven-v4_0_0.xsd">

    <parent>
        <groupId>org.openksavi.sponge</groupId>
        <artifactId>sponge-parent</artifactId>
        <version>1.18.1-SNAPSHOT</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>sponge-examples-project-standalone-camel-groovy</artifactId>
    <name>Sponge - Examples - Project - Standalone - Camel Groovy</name>

    <properties>
        <sponge.root>${basedir}/../..</sponge.root>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.openksavi.sponge</groupId>
            <artifactId>sponge-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.openksavi.sponge</groupId>
            <artifactId>sponge-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.openksavi.sponge</groupId>
            <artifactId>sponge-standalone-app</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-stream</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.openksavi.sponge</groupId>
                <artifactId>sponge-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
</project>


text:
<meta charset="utf-8">
(#) FontValidationError

This issue id is an alias for [FontValidation](FontValidation.md.html).

(Additional metadata not available.)
<!-- Markdeep: --><style class="fallback">body{visibility:hidden;white-space:pre;font-family:monospace}</style><script src="markdeep.min.js" charset="utf-8"></script><script src="https://morgan3d.github.io/markdeep/latest/markdeep.min.js" charset="utf-8"></script><script>window.alreadyProcessedMarkdeep||(document.body.style.visibility="visible")</script>


text:
<?php

namespace Teknoo\Tests\States\LifeCycle\StatedClass\Automated\Assertion\Property;

use Teknoo\States\LifeCycle\StatedClass\Automated\Assertion\Property\IsSame;

/**
 * Class IsSameTest.
 *
 * @covers \Teknoo\States\LifeCycle\StatedClass\Automated\Assertion\Property\IsSame
 *
 * @copyright   Copyright (c) 2009-2017 Richard Déloge (richarddeloge@gmail.com)
 *
 * @link        http://teknoo.software/states Project website
 *
 * @license     http://teknoo.software/license/mit         MIT License
 * @author      Richard Déloge <richarddeloge@gmail.com>
 */
class IsSameTest extends \PHPUnit\Framework\TestCase
{
    /**
     * @return IsSame
     */
    public function buildInstance()
    {
        return new IsSame(10);
    }

    public function testSameProperty()
    {
        self::assertTrue($this->buildInstance()(10));
    }

    public function testNotSameProperty()
    {
        self::assertFalse($this->buildInstance()('10'));
    }
}


text:
class UploadTasks < Volt::Task
  def upload(data)
    store._uploads << {data: data}
    store._uploads.last.id
  end
end


text:
layout: docs
title: Cards
group: components
---

A **card** is a flexible and extensible content container. It includes options for headers and footers, a wide variety of content, contextual background colors, and powerful display options.

If you're familiar with Bootstrap 3, cards replace our old panels, wells, and thumbnails. Similar functionality to those components is available as modifier classes for cards.

## Contents

* Will be replaced with the ToC, excluding the "Contents" header
{:toc}

## Example

Cards require a small amount of markup and classes to provide you with as much control as possible. These classes and markup are flexible though and can typically be remixed and extended with ease. For example, if your card has no flush content like images, feel free to put the `.card-block` class on the `.card` element to consolidate your markup.

{% example html %}

Card title

Some quick example text to build on the card title and make up the bulk of the card's content.

    Go somewhere

{% endexample %}

## Content types

Cards support a wide variety of content, including images, text, list groups, links, and more. Mix and match multiple content types to create the card you need.

{% example html %}

Card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Cras justo odio

Dapibus ac facilisis in

Vestibulum at eros

    Card link
    Another link

{% endexample %}

{% example html %}

Cras justo odio

Dapibus ac facilisis in

Vestibulum at eros

{% endexample %}

{% example html %}

Some quick example text to build on the card title and make up the bulk of the card's content.

{% endexample %}

{% example html %}

Card title

Some quick example text to build on the card title and make up the bulk of the card's content.

  Card link
  Another link

{% endexample %}

{% example html %}

Card title

Support card subtitle

Some quick example text to build on the card title and make up the bulk of the card's content.

    Card link
    Another link

{% endexample %}

## Sizing

Constrain the width of cards via custom CSS, our predefined grid classes, or with custom styles using our grid mixins.

Using the grid:

{% example html %}

Special title treatment

With supporting text below as a natural lead-in to additional content.

      Go somewhere

Special title treatment

With supporting text below as a natural lead-in to additional content.

      Go somewhere

{% endexample %}

Using custom widths:

{% example html %}

Special title treatment

With supporting text below as a natural lead-in to additional content.

  Go somewhere

{% endexample %}

## Text alignment

You can quickly change the text alignment of any card—in its entirety or specific parts—with our [text align classes]({{ site.baseurl }}/components/utilities/#text-alignment).

{% example html %}

Special title treatment

With supporting text below as a natural lead-in to additional content.

  Go somewhere

Special title treatment

With supporting text below as a natural lead-in to additional content.

  Go somewhere

Special title treatment

With supporting text below as a natural lead-in to additional content.

  Go somewhere

{% endexample %}

## Header and footer

Add an optional header and/or footer within a card.

{% example html %}

    Featured

Special title treatment

With supporting text below as a natural lead-in to additional content.

    Go somewhere

{% endexample %}

{% example html %}

Featured

Special title treatment

With supporting text below as a natural lead-in to additional content.

    Go somewhere

{% endexample %}

{% example html %}

    Quote

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

      Someone famous in Source Title

{% endexample %}

{% example html %}

    Featured

Special title treatment

With supporting text below as a natural lead-in to additional content.

    Go somewhere

    2 days ago

{% endexample %}

## Header nav

Use Bootstrap's nav pills or tabs within a card header. Be sure to always include a `.pull-*-*` utility class for proper alignment.

{% example html %}

        Active

        Link

        Disabled

Special title treatment

With supporting text below as a natural lead-in to additional content.

    Go somewhere

{% endexample %}

{% example html %}

        Active

        Link

        Disabled

Special title treatment

With supporting text below as a natural lead-in to additional content.

    Go somewhere

{% endexample %}

## Image caps

Similar to headers and footers, cards include top and bottom image caps.

{% example html %}

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

Last updated 3 mins ago

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

Last updated 3 mins ago

{% endexample %}

## Image overlays

Turn an image into a card background and overlay your card's text. Depending on the image, you may or may not need `.card-inverse` (see below).

{% example html %}

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

Last updated 3 mins ago

{% endexample %}

## Inverted text

Cards include a class for quickly toggling **the text color**. By default, cards use dark text and assume a light background. **Add `.card-inverse` for white text** and specify the `background-color` and `border-color` to go with it.

You can also use `.card-inverse` with the [contextual backgrounds variants](#background-variants).

{% example html %}

Special title treatment

With supporting text below as a natural lead-in to additional content.

    Go somewhere

{% endexample %}

## Background variants

Cards include their own variant classes for quickly changing the `background-color` and `border-color` of a card. **Darker colors require the use of `.card-inverse`.**

{% example html %}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

      Someone famous in Source Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

      Someone famous in Source Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

      Someone famous in Source Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

      Someone famous in Source Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

      Someone famous in Source Title

{% endexample %}

## Outline variants

In need of a colored card, but not the hefty background colors they bring? Replace the default modifier classes with the `.card-outline-*` ones to style just the `border-color` of a card.

{% example html %}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

      Someone famous in Source Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

      Someone famous in Source Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

      Someone famous in Source Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

      Someone famous in Source Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

      Someone famous in Source Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

      Someone famous in Source Title

{% endexample %}

## Groups

Use card groups to render cards as a single, attached element with equal width and height columns. By default, card groups use `display: table;` and `table-layout: fixed;` to achieve their uniform sizing. However, enabling [flexbox mode]({{ site.baseurl }}/getting-started/flexbox) can switch that to use `display: flex;` and provide the same effect.

Only applies to small devices and above.

{% example html %}

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

Last updated 3 mins ago

Card title

This card has supporting text below as a natural lead-in to additional content.

Last updated 3 mins ago

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.

Last updated 3 mins ago

{% endexample %}

## Decks

Need a set of equal width and height cards that aren't attached to one another? Use card decks. By default, card decks require two wrapping elements: `.card-deck-wrapper` and a `.card-deck`. We use table styles for the sizing and the gutters on `.card-deck`. The `.card-deck-wrapper` is used to negative margin out the `border-spacing` on the `.card-deck`.

Only applies to small devices and above.

**ProTip!** If you enable [flexbox mode]({{ site.baseurl }}/getting-started/flexbox/), you can remove the `.card-deck-wrapper`.

{% example html %}

Card title

This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

Last updated 3 mins ago

Card title

This card has supporting text below as a natural lead-in to additional content.

Last updated 3 mins ago

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.

Last updated 3 mins ago

{% endexample %}

## Columns

Cards can be organized into [Masonry](http://masonry.desandro.com)-like columns with just CSS by wrapping them in `.card-columns`. Only applies to small devices and above.

**Heads up!** This is **not available in IE9 and below** as they have no support for the [`column-*` CSS properties](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using_multi-column_layouts).

{% example html %}

Card title that wraps to a new line

This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

          Someone famous in Source Title

Card title

This card has supporting text below as a natural lead-in to additional content.

Last updated 3 mins ago

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat.

          Someone famous in Source Title

Card title

This card has supporting text below as a natural lead-in to additional content.

Last updated 3 mins ago

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

          Someone famous in Source Title

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.

Last updated 3 mins ago

{% endexample %}


text:
module.exports = function(grunt) {

    /* Projectile project configuration */
    grunt.initConfig({
            pkg: grunt.file.readJSON('package.json'),
            uglify: {
                options: {
                    banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
                },
                build: {
                    src: '<%= pkg.name %>.js',
                    dest: 'build/<%= pkg.name %>.min.js'
                }
            },
            cssmin: {
                dist: {
                    src: '<%= pkg.name %>.css',
                    dest: 'build/<%= pkg.name %>.min.css'
                }
            }
        });
    /* Loads the plugins that provides the tasks */
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-cssmin');

    /* Default tasks */
    grunt.registerTask('default', ['uglify', 'cssmin']);
};


text:
package org.apache.usergrid.mongo;

import java.util.Map;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.usergrid.management.ManagementService;
import org.apache.usergrid.mq.QueueManagerFactory;
import org.apache.usergrid.persistence.EntityManagerFactory;
import org.apache.usergrid.services.ServiceManagerFactory;

public class DatabaseInitializer {

    private static final Logger logger = LoggerFactory.getLogger( DatabaseInitializer.class );

    protected EntityManagerFactory emf;

    protected ServiceManagerFactory smf;

    protected ManagementService management;

    protected Properties properties;

    protected QueueManagerFactory qmf;

    public DatabaseInitializer() {

    }

    public EntityManagerFactory getEntityManagerFactory() {
        return emf;
    }

    @Autowired
    public void setEntityManagerFactory( EntityManagerFactory emf ) {
        this.emf = emf;
    }

    public ServiceManagerFactory getServiceManagerFactory() {
        return smf;
    }

    @Autowired
    public void setServiceManagerFactory( ServiceManagerFactory smf ) {
        this.smf = smf;
    }

    public ManagementService getManagementService() {
        return management;
    }

    @Autowired
    public void setManagementService( ManagementService management ) {
        this.management = management;
    }

    public Properties getProperties() {
        return properties;
    }

    @Autowired
    public void setProperties( Properties properties ) {
        this.properties = properties;
    }

    public QueueManagerFactory getQueueManagerFactory() {
        return qmf;
    }

    @Autowired
    public void setQueueManagerFactory( QueueManagerFactory qmf ) {
        this.qmf = qmf;
    }

    boolean databaseInitializationPerformed = false;

    public void init() {
        logger.info( "Initializing server with Spring" );

        // If we're running an embedded Cassandra, we always need to initialize
        // it since Hector wipes the data on startup.
        //

        if ( databaseInitializationPerformed ) {
            logger.info( "Can only attempt to initialized database once per JVM process" );
            return;
        }
        databaseInitializationPerformed = true;

        logger.info( "Initializing Cassandra database" );
        Map<String, String> properties = emf.getServiceProperties();
        if ( properties != null ) {
            logger.error( "System properties are initialized, database is set up already." );
            return;
        }

        try {
            emf.setup();
        }
        catch ( Exception e ) {
            logger.error( "Unable to complete core database setup, possibly due to it being setup already", e );
        }

        try {
            management.setup();
        }
        catch ( Exception e ) {
            logger.error( "Unable to complete management database setup, possibly due to it being setup already", e );
        }

        logger.info( "Usergrid schema setup" );
    }
}


text:
/* stdio.h */

/*
 * Copyright (c) 2014 Wind River Systems, Inc.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef __INC_stdio_h__
#define __INC_stdio_h__

#include <toolchain.h>
#include <stdarg.h>     /* Needed to get definition of va_list */
#include <bits/restrict.h>
#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif

#if !defined(__FILE_defined)
#define __FILE_defined
typedef int  FILE;
#endif

#if !defined(EOF)
#define EOF  (-1)
#endif

#define stdin  ((FILE *) 1)
#define stdout ((FILE *) 2)
#define stderr ((FILE *) 3)

/*
 * NOTE: This libc implementation does not define the routines
 * declared below.
 */

int __printf_like(1, 2) printf(const char *_MLIBC_RESTRICT fmt, ...);
int __printf_like(3, 4) snprintf(char *_MLIBC_RESTRICT s, size_t len,
				 const char *_MLIBC_RESTRICT fmt, ...);
int __printf_like(2, 3) sprintf(char *_MLIBC_RESTRICT s,
				const char *_MLIBC_RESTRICT fmt, ...);
int __printf_like(2, 3) fprintf(FILE * _MLIBC_RESTRICT stream,
				const char *_MLIBC_RESTRICT format, ...);

int __printf_like(1, 0) vprintf(const char *_MLIBC_RESTRICT fmt, va_list list);
int __printf_like(3, 0) vsnprintf(char *_MLIBC_RESTRICT s, size_t len,
				  const char *_MLIBC_RESTRICT fmt,
				  va_list list);
int __printf_like(2, 0) vsprintf(char *_MLIBC_RESTRICT s,
				 const char *_MLIBC_RESTRICT fmt, va_list list);
int __printf_like(2, 0) vfprintf(FILE * _MLIBC_RESTRICT stream,
				 const char *_MLIBC_RESTRICT format,
				 va_list ap);

int puts(const char *s);

int fputc(int c, FILE *stream);
int fputs(const char *_MLIBC_RESTRICT s, FILE *_MLIBC_RESTRICT stream);
size_t fwrite(const void *_MLIBC_RESTRICT ptr, size_t size, size_t nitems,
	      FILE *_MLIBC_RESTRICT stream);

#ifdef __cplusplus
}
#endif

#endif /* __INC_stdio_h__ */


text:
<?php

/* SonataAdminBundle:CRUD:edit_array.html.twig */
class __TwigTemplate_018d8bb8bfac974c0dafbefa8edc04bb8558dfb546904afbb504e49e34b79d89 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->blocks = array(
            'field' => array($this, 'block_field'),
        );
    }

    protected function doGetParent(array $context)
    {
        // line 12
        return $this->loadTemplate((isset($context["base_template"]) ? $context["base_template"] : null), "SonataAdminBundle:CRUD:edit_array.html.twig", 12);
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $this->getParent($context)->display($context, array_merge($this->blocks, $blocks));
    }

    // line 14
    public function block_field($context, array $blocks = array())
    {
        // line 15
        echo "
        ";
        // line 16
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock((isset($context["field_element"]) ? $context["field_element"] : null), 'widget', array("attr" => array("class" => "title")));
        echo "

";
    }

    public function getTemplateName()
    {
        return "SonataAdminBundle:CRUD:edit_array.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  33 => 16,  30 => 15,  27 => 14,  18 => 12,);
    }
}
/* {#*/
/* */
/* This file is part of the Sonata package.*/
/* */
/* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>*/
/* */
/* For the full copyright and license information, please view the LICENSE*/
/* file that was distributed with this source code.*/
/* */
/* #}*/
/* */
/* {% extends base_template %}*/
/* */
/* {% block field %}*/
/*     */
/*         {{ form_widget(field_element, {'attr': {'class' : 'title'}}) }}*/
/*     */
/* {% endblock %}*/
/* */


text:
SYNONYM

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

#### Published in
Voy. Uranie. Bot. 5: 176 (1827)

#### Original name
Thelephora dendritica Pers., 1827

### Remarks
null


text:
/**
 * A snippet is a text block that is put into placed marked in feedback texts or hints.
 */
export class Snippet {
  /**
   * Constructs the snippet.
   * @param name The name of the snippet that is used when it is referenced in a feedbacktext (without the snippet marker @)
   * @param text The snippet itself (html)
   */
  constructor(public name: string, public text: string) {

  }
}


text:
Pedelec:
        {{pedelec.manufacturerId}}

        <button type="button" ui-sref="pedelecs" class="btn btn-default" ng-disabled="isEditing">

             Back
        </button>
        <button type="button" ng-switch-when="false" ng-click="toggleEdit()" class="btn btn-default">

            Edit Pedelec
        </button>
        <button type="button" ng-switch-when="true" ng-click="toggleEdit()" class="btn btn-warning">

            Cancel
        </button>
        <button type="button" ng-click="savePedelec()" class="btn btn-primary" ng-show="isEditing">

            Save Pedelec
        </button>
        <button type="button" class="btn btn-default" data-toggle="modal" data-target="#detailModal"
                ng-click="getConfig()">

            Change Configuration
        </button>

    <form name="form" role="form" novalidate
          class="ng-scope ng-invalid ng-invalid-required ng-dirty ng-valid-minlength form-horizontal"
          ng-submit="create()" ng-switch="isEditing">

                Manufacturer
                    ID

{{pedelec.manufacturerId}}

                State Of
                    Charge

                             {{pedelec.stateOfCharge}} %

                State

{{pedelec.state}}

                        <select name="state" type="text" class="form-control"
                                ng-model="pedelec.state">
                            <option value="OPERATIVE">OPERATIVE</option>
                            <option value="INOPERATIVE">INOPERATIVE</option>
                        </select>

                In
                    Transaction
                {{pedelec.inTransaction | occupiedFilter}}

    </form>

Transactions:

            Number of transactions to display:

    <select type="text"
            ng-model="resultSize"
            ng-options="value for value in resultSizeValues"
            class="form-control"
            ng-change="updateTransactions()">
    </select>

            Customer
            Start Time
            End Time
            From Location
            To Location

            {{transaction.customer.lastname}}, {{transaction.customer.firstname}}
            {{transaction.majorCustomerName}} ({{transaction.cardId}})
            {{transaction.fleetManagerLogin}} ({{transaction.cardId}})
            {{transaction.startDateTime | date:'medium'}}
            {{transaction.endDateTime | date:'medium'}}

            {{transaction.fromStation.name}} {{transaction.fromStation.slotPosition}}

                    {{transaction.toStation.name}}
                        {{transaction.toStation.slotPosition}}

                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Change Configuration

                <form name="form" role="from" novalidate
                      class="ng-scope ng-invalid ng-invalid-required ng-dirty ng-valid-minlength form-horizontal"
                      ng-submit="changeConfig()">

                            Max.
                                Current Value

                                <input class="form-control" type="number" name="maxCurrentValue"
                                       placeholder="{{'pedelecDetail.modal.maxCurrentValuePlaceholder' | translate }}"
                                       ng-model="pedelecConfig.maxCurrentValue" ng-minlength="1" ng-maxlength="50"
                                       required>

                            Max.
                                Battery Level

                                <input class="form-control" type="number" name="maxBatteryLevel"
                                       placeholder="{{'pedelecDetail.modal.maxBatteryLevelPlaceholder' | translate }}"
                                       ng-model="pedelecConfig.maxBatteryLevel" ng-minlength="1" ng-maxlength="50"
                                       required>

                </form>

                <button type="button" class="btn btn-default" data-dismiss="modal"
                        translate="pedelecDetail.modal.buttons.cancel">
                    Cancel
                </button>
                <button type="button" class="btn btn-info" data-dismiss="modal" ng-click="updateConfig()"
                        translate="pedelecDetail.modal.buttons.update">
                    Update
                </button>


text:
<?php

namespace cms\backend\tests\functional;

use backend\tests\FunctionalTester;
use backend\fixtures\UserFixture;

/**
 * Class LoginCest
 */
class LoginCest
{

    /**
     * Load fixtures before db transaction begin
     * Called in _before()
     * @see \Codeception\Module\Yii2::_before()
     * @see \Codeception\Module\Yii2::loadFixtures()
     * @return array
     */
    public function _fixtures()
    {
        return [
            'user' => [
                'class' => UserFixture::className(),
                'dataFile' => codecept_data_dir() . 'login_data.php'
            ]
        ];
    }

    public function _before(FunctionalTester $I)
    {
        $I->amOnRoute('site/login');
    }

    protected function formParams($login, $password)
    {
        return [
            'LoginForm[username]' => $login,
            'LoginForm[password]' => $password,
        ];
    }

    public function checkEmpty(FunctionalTester $I)
    {
        $I->submitForm('button[name=login-button]', $this->formParams('', ''));
        $I->see('用户名不能为空');
        $I->see('密码不能为空');
    }

    public function checkWrongPassword(FunctionalTester $I)
    {
        $I->submitForm('button[name=login-button]', $this->formParams('admin', 'wrong'));
        $I->see('用户名或密码错误');
    }

    public function checkValidLogin(FunctionalTester $I)
    {
        $I->submitForm('button[name=login-button]', array_merge($this->formParams('admin', 'password_0'), ['LoginForm[captcha]'=>'testme']));
        $I->see('菜单');
        $I->dontSeeLink('登陆');
        $I->dontSeeLink('注册');
    }
}


text:
'use strict';

const TrelloAPI = require('./classes/TrelloAPI'),
    classes = {};

function trelloObjects (key, token) {
    TrelloAPI.key = key;
    TrelloAPI.token = token;

    classes.Label = require('./classes/Label')(TrelloAPI);
    classes.Member = require('./classes/Member')(TrelloAPI);
    classes.CheckItem = require('./classes/CheckItem')(TrelloAPI);
    classes.Checklist = require('./classes/Checklist')(TrelloAPI, classes.CheckItem);
    classes.Card = require('./classes/Card')(TrelloAPI, classes.Checklist, classes.Member, classes.Label);
    classes.List = require('./classes/List')(TrelloAPI, classes.Card);
    classes.Board = require('./classes/Board')(TrelloAPI, classes.List, classes.Member, classes.Label);

    return classes;
}

module.exports = trelloObjects;


text:
fn main() {
    fn quux(_: &fn(&int) -> int) -> bool { true }
    for quux |_| { } //~ ERROR A `for` loop iterator should expect a
                     // closure that returns `bool`.  This iterator
                     // expects a closure that returns `int`.
}


text:
module Pohoda
  module Builders
    module Ftr
      module Groups
        module GroupFilter3
          def builder
            root = Ox::Element.new(name)
            root = add_attributes_and_namespaces(root)

            if data.key? :filter
              root << Ftr::FilterGroupStockType.new('ftr:filter', data[:filter]).builder
            end
            root << build_element('ftr:userFilterName', data[:user_filter_name], data[:user_filter_name_attributes]) if data.key? :user_filter_name

            root
          end
        end
      end
    end
  end
end


text:
require File.dirname(__FILE__) + '/../../spec_helper'

describe Admin::EditorialSpacesController do
  include AuthenticatedTestHelper
  include RolesystemTestHelper

  fixtures :all

  before(:each) do
    add_roles
    @params = {}
  end

  def do_get(action = :index, opts = {})
    get action, opts
  end

  def do_post(action, opts = {})
    post action, opts
  end

  def do_put(opts = {})
    put :update, opts
  end

  def do_delete(opts = {})
    delete :destroy, opts
  end

  it "should require admin access to view GET /admin/editorial_spaces/new" do
    should_be_admin_only('host') do
      do_get :new
    end
    response.should be_success
  end

  it "should create a new editorial space object for GET /admin/editorial_spaces/new" do
    login_as 'admin'
    do_get :new
    assigns['editorial_space'].should_not be_nil
    assigns['editorial_space'].id.should be_nil
    assigns['editorial_space'].page.should be_nil
  end

  it "should create a new editorial space object for GET /admin/editorial_spaces/new?page_type=Topic&page_id=1" do
    login_as 'admin'
    do_get :new, :page_type => "Topic", :page_id => 1
    assigns['editorial_space'].should_not be_nil
    assigns['editorial_space'].id.should be_nil
    assigns['editorial_space'].page.should == Topic.find(1)
  end

  it "should add a new editorial space for POST /admin/editorial_spaces" do
    login_as 'admin'
    lambda do
      do_post :create, { :page_type => "", :page_id => "", :editorial_space => { :name => "test 1", :show_name => 1, :position => 1 } }
    end.should change(EditorialSpace, :count).by(1)
    lambda do
      do_post :create, { :editorial_space => { :name => "test 2", :show_name => 0, :position => 2 } }
    end.should change(EditorialSpace, :count).by(1)
  end

  it "should add a new editorial space for POST /admin/editorial_spaces?page_type=Topic&page_id=1" do
    login_as 'admin'
    lambda do
      do_post :create, { :page_type => 'Topic', :page_id => 1, :editorial_space => { :name => "test", :show_name => 1, :position => 1 } }
    end.should change(EditorialSpace, :count).by(1)
	  EditorialSpace.find(:last).page.should == Topic.find(1)
  end

  it "should update existing editorial spaces for PUT /admin/editorial_spaces/<id>?<params>" do
    login_as 'admin'
    lambda do
      do_post :create, { :page_type => "", :page_id => "", :editorial_space => { :name => "test 1", :show_name => 1, :position => 1 } }
      do_post :create, { :page_type => 'Topic', :page_id => 1, :editorial_space => { :name => "test", :show_name => 1, :position => 1 } }
    end.should change(EditorialSpace, :count).by(2)
	  es_2 = EditorialSpace.find(:last)
	  es_1 = EditorialSpace.find(es_2.id-1)
    do_put({ :id => es_1.id, :editorial_space => { :name => "testing 123", :show_name => 0, :position => 1 } })
    do_put({ :id => es_2.id, :editorial_space => { :name => "testing 456", :show_name => 0, :position => 1 } })
    es_1.reload.name.should == "testing 123"
    es_1.page.should be_nil
    es_2.reload.name.should == "testing 456"
    es_2.page.should == Topic.find(1)
  end

  it "should delete an existing editorial space for DELETE /admin/editorial_spaces/1" do
    login_as 'admin'
    do_post :create, { :page_type => 'Topic', :page_id => 1, :editorial_space => { :name => "test", :show_name => 1, :position => 1 } }
	  es = EditorialSpace.find(:last)
    lambda do
      do_delete({ :id => es.id })
    end.should change(EditorialSpace, :count).by(-1)
  end
end


text:
from CIM15.IEC61970.Core.IdentifiedObject import IdentifiedObject

class BranchGroup(IdentifiedObject):
    """A group of branch terminals whose directed flow summation is to be monitored. Abranch group need not form a cutset of the network.A group of branch terminals whose directed flow summation is to be monitored. Abranch group need not form a cutset of the network.
    """

    def __init__(self, minimumReactivePower=0.0, maximumReactivePower=0.0, maximumActivePower=0.0, minimumActivePower=0.0, monitorActivePower=False, monitorReactivePower=False, BranchGroupTerminal=None, *args, **kw_args):
        """Initialises a new 'BranchGroup' instance.

        @param minimumReactivePower: The minimum reactive power flow.
        @param maximumReactivePower: The maximum reactive power flow.
        @param maximumActivePower: The maximum active power flow.
        @param minimumActivePower: The minimum active power flow.
        @param monitorActivePower: Monitor the active power flow.
        @param monitorReactivePower: Monitor the reactive power flow.
        @param BranchGroupTerminal: The directed branch group terminals to be summed.
        """
        #: The minimum reactive power flow.
        self.minimumReactivePower = minimumReactivePower

        #: The maximum reactive power flow.
        self.maximumReactivePower = maximumReactivePower

        #: The maximum active power flow.
        self.maximumActivePower = maximumActivePower

        #: The minimum active power flow.
        self.minimumActivePower = minimumActivePower

        #: Monitor the active power flow.
        self.monitorActivePower = monitorActivePower

        #: Monitor the reactive power flow.
        self.monitorReactivePower = monitorReactivePower

        self._BranchGroupTerminal = []
        self.BranchGroupTerminal = [] if BranchGroupTerminal is None else BranchGroupTerminal

        super(BranchGroup, self).__init__(*args, **kw_args)

    _attrs = ["minimumReactivePower", "maximumReactivePower", "maximumActivePower", "minimumActivePower", "monitorActivePower", "monitorReactivePower"]
    _attr_types = {"minimumReactivePower": float, "maximumReactivePower": float, "maximumActivePower": float, "minimumActivePower": float, "monitorActivePower": bool, "monitorReactivePower": bool}
    _defaults = {"minimumReactivePower": 0.0, "maximumReactivePower": 0.0, "maximumActivePower": 0.0, "minimumActivePower": 0.0, "monitorActivePower": False, "monitorReactivePower": False}
    _enums = {}
    _refs = ["BranchGroupTerminal"]
    _many_refs = ["BranchGroupTerminal"]

    def getBranchGroupTerminal(self):
        """The directed branch group terminals to be summed.
        """
        return self._BranchGroupTerminal

    def setBranchGroupTerminal(self, value):
        for x in self._BranchGroupTerminal:
            x.BranchGroup = None
        for y in value:
            y._BranchGroup = self
        self._BranchGroupTerminal = value

    BranchGroupTerminal = property(getBranchGroupTerminal, setBranchGroupTerminal)

    def addBranchGroupTerminal(self, *BranchGroupTerminal):
        for obj in BranchGroupTerminal:
            obj.BranchGroup = self

    def removeBranchGroupTerminal(self, *BranchGroupTerminal):
        for obj in BranchGroupTerminal:
            obj.BranchGroup = None


text:
> LinuxFest NorthWest 2016
> Dave Stoker, @stoker, [site](http://opensourcedba.wordpress.com)

* Hardware
* Software
* Backup, Replication
* Tools to make life easier
* Configurations

### Hardware

* they love memory, reading from memory is 100,000 times faster than from disk

* move data to separate controller/disk from logs, don't log on slow devices

* RAID to your fav level - RAID 10 minimum

* don't use consumer grade disks

* Caches, disks and controllers, write through or write back caches
> both lie, make sure they don't auto tune during prod hours

* FusionIO cards
> atomic writes, no double buffering, thus speed

#### Network

* never make public

* scrub rigourously

* keep separate net for replication/backup

* MySQL auth to use `host`, `user` and `password`.
> Configure server to use IP addresses instead of names.
> Bad DNS zone transfers shouldn't bring down database access.

#### Slave Servers

* Slave need bigger/badder hardware than maser, do more work.

* Use MySQL utilites to clone masters, set-up slaves

* Dedicated network

---

### Software

* Run latest version available

* Just MySQL on node.

* No Swapping.

* May be a caching layer but watch memory use.

---

### Backups

* as often backups as they seem too many

* restore-able instances, DBs, tables, ...

* off-site backups

* random restore tests

---

### Replication

* easy to set-up and misunderstand

* 2 types
> * Async: slave grabs a copy of changes from master and apply to self, master unaware of slave
> * Semi-sync: master waits for ACK from at least one slave before procedding

* 3 forms: Statement, Row and Mixed.

* Single-threaded before 5.6

* Multi-threaded for different DBs in 5.6

* Multi-infra-DBs threaded for 5.7

#### Replication Filters

* Don't need to replicate everything
> check churn of data, maybe 1x day backup

* Filter Tables

* Can change filters on fly with 5.7
> 'something going on in manufacturing, cab we capture it someplace'

#### Global Transaction IDs

* since `5.6` each transaction has unique GTID

* storing replication data in InnoDB tables plus adding checksums make crash safe

* row based can exploit only sending keys and changed items, not entire row of data

#### Multimaster and Multisource

* Multi-Master
> **Not Recommended**
> System.A auto\_increment odd numbers and
> System.B auto\_increment even numbers
> need to be watched

* Multi-Source
> **MySQL 5.7**
> Multiple masters send data to one slave for master backup.
> Make sure sharded data doesn't overlap.

#### Group Replication MySQL 5.7

> Galera

#### Replication for backup

* Replication uses 3 threads
> Master to Slave
> Slave to Log
> Log to Data

* On a small shop DB
> Keep master running
> shutdown log to data thread
> run backup
> restart log to data
> Slave will catch-up

---

### Tools to make life easier

* Monitoring
> VividCortex (if wanna pay)
> Nagios, InfluxDB, Prometheus

* MySQL Workbench
> help on optimizing query
> users, backup, imports
> Dashboard, SYS Schema
> Entity Relationship Mapper
> Migration Tool

* MySQL utilities
> OpenSource written in Python
> Setup replication and automatic failover
> Copy user settings
> Copy data
> Look for bad proceesed and killem
> Move binary logs
> Grep for a column name in a schema
> more...

* Percoan Toolkit

* Toad for MySQL from Dell

---

### Config Suggestions

* turn off DNS lookups, zone transfer dies
> use skip-name-resolve

* save/load stats, to help optimize feature queries
> * use `innodb_stats_persistent`
> * see `14.13.16.1 Configuring Persistent Optimizer Statistics Parameters` in MySQL manual
> * `innodb_buffer_pool_dump=ON`
> * `innodb_buffer_pool_dump_at_shutdown=ON`
> * `innodb_buffer_pool_load_at_startup=ON`

* tune log level (v5.7)
> `log_error_verbosity` - errors, errors and warnings, E&W + notes
> send to SYSLOG

* turn of Query cache (v5.7 default)
> single threaded, use memcached/redis
> free up memory

* innoDB buffer pool size
> 75-80% of RAM

#### Big.Hint.1

Be damn stingy with permissions and grants.
Easier to say no than constantly being restoring.

> `--safe-updates` or `--i-am-a-dummy`, no more oops

#### Big.Hint.2

Use `Sys_Schema`
> * Whose hogging resources
> * Indexes not being used
> * Problematic Queries
> Other routine PITAs

#### Big.Hint.3

v5.7 Security
> * Security install becomes deault, forced root password, no anonymous acount
> * Password Rotation
> * Configure Rules
> * `mysql_config_editor` (v5.6.6), stores encrypted auth-creds, use `mysql --login-path=finance`

---

**Chapter.6 of MySQL manual consists most of this.**

---
---