text:
package image

import (
	"archive/tar"
	"bytes"
	"context"
	"io"
	"runtime"
	"testing"

	"github.com/docker/docker/api/types"
	"github.com/docker/docker/integration/util/request"
	"github.com/docker/docker/internal/testutil"
)

// Ensure we don't regress on CVE-2017-14992.
func TestImportExtremelyLargeImageWorks(t *testing.T) {
	if runtime.GOARCH == "arm64" {
		t.Skip("effective test will be time out")
	}

	client := request.NewAPIClient(t)

	// Construct an empty tar archive with about 8GB of junk padding at the
	// end. This should not cause any crashes (the padding should be mostly
	// ignored).
	var tarBuffer bytes.Buffer

	tw := tar.NewWriter(&tarBuffer)
	if err := tw.Close(); err != nil {
		t.Fatal(err)
	}
	imageRdr := io.MultiReader(&tarBuffer, io.LimitReader(testutil.DevZero, 8*1024*1024*1024))

	_, err := client.ImageImport(context.Background(),
		types.ImageImportSource{Source: imageRdr, SourceName: "-"},
		"test1234:v42",
		types.ImageImportOptions{})
	if err != nil {
		t.Fatal(err)
	}
}


text:
<?php

namespace App\LanguageBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use App\LanguageBundle\Entity\Country;
use App\LanguageBundle\Form\CountryType;
use Symfony\Component\HttpFoundation\JsonResponse;

/**
 * Country controller.
 *
 * @Route("/country")
 */
class CountryController extends Controller
{

    /**
     * Lists all Country entities.
     *
     * @Route("/", name="country")
     * @Method("GET")
     * @Template()
     */
    public function indexAction(Request $request)
    {
        $em = $this->getDoctrine()->getManager();

        if ($request->isXmlHttpRequest()) {

            /* DataTable Parameters*/
            $filters = $request->get('filters');
            $lang = $request->get('lang');
            if(empty($lang)){$lang = $this->container->getParameter('locale');}
            $sortCol = $request->get('iSortCol_0');
            $sortDir = $request->get('iSortDir_0');
            $start = $request->get('iDisplayStart');
            $limit = $request->get('iDisplayLength');

            /* Columns */
            $columns = array();
            $columns[0] = 'id';
            $columns[1] = 'position';
            $columns[2] = 'isoCode';
            $columns[3] = 'isoCode';
            $columns[4] = 'enabled';

            /* Query Result */
            $qb = $em->getRepository('AppLanguageBundle:Country')->createQueryBuilder('a');
            $qb->select('a');
            if(!empty($filters)) {
                (isset($filters[$columns[4]])) ? $qb->where('a.'.$columns[4].' = 1') : $qb->where('a.'.$columns[4].' = 0');
                $andModule = $qb->expr()->andx();
                if(isset($filters[$columns[2]]) && !empty($filters[$columns[2]])) {
                    $andModule->add($qb->expr()->like('LOWER(a.'.$filters[$columns[2]].')',  $qb->expr()->literal('%'.strtolower(addslashes($filters[$columns[2]])).'%')));
                }
                $qb->andWhere($andModule);
            }
            $qb_count = clone $qb;
            $qb->setFirstResult($start);
            $qb->setMaxResults($limit);
            $qb->orderBy('a.'.$columns[$sortCol], $sortDir);
            $result =  $qb->getQuery()->getResult();

            /* Query Count */
            $qb_count->select('COUNT(a)');
            $total =  $qb_count->getQuery()->getSingleScalarResult();

            $output = array(
                "sEcho" => intval($request->get('sEcho')),
                "iTotalRecords" => intval($total),
                "iTotalDisplayRecords" => intval($total),
                "aaData" => array()
            );

            /* Parse Result */
            foreach ($result as $e) {
                $row = array();
                $row[] = (string) $e->getId();
                $row[] = (string) $e->getPosition();
                $row[] = (string) $this->container->get('app.language.twig')->country($e->getIsoCode(), $lang);
                $row[] = (string) $e->getIsoCode();
                ($e->getEnabled()==0) ? $row[] = '' : $row[] = '';
                $row[] = 'generateUrl("country_edit", array('id' => $e->getId())).'">
                          ';
                $output['aaData'][] = $row ;

            }
            $response = new JsonResponse();
            $response->setData($output);

            return $response;
        }
    }
    /**
     * Creates a new Country entity.
     *
     * @Route("/", name="country_create")
     * @Method("POST")
     * @Template("AppLanguageBundle:Country:new.html.twig")
     */
    public function createAction(Request $request)
    {
        $entity = new Country();
        $form = $this->createCreateForm($entity);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($entity);
            $em->flush();

            return $this->redirect($this->generateUrl('country'));
        }

        return array(
            'entity' => $entity,
            'form'   => $form->createView(),
        );
    }

    /**
     * Creates a form to create a Country entity.
     *
     * @param Country $entity The entity
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createCreateForm(Country $entity)
    {
        $form = $this->createForm(new CountryType(), $entity, array(
            'action' => $this->generateUrl('country_create'),
            'method' => 'POST',
        ));

        $form->add('submit', 'submit', array('label' => 'Create'));

        return $form;
    }

    /**
     * Displays a form to create a new Country entity.
     *
     * @Route("/new", name="country_new")
     * @Method("GET")
     * @Template()
     */
    public function newAction()
    {
        $entity = new Country();
        $form   = $this->createCreateForm($entity);

        return array(
            'entity' => $entity,
            'form'   => $form->createView(),
        );
    }

    /**
     * Finds and displays a Country entity.
     *
     * @Route("/{id}", name="country_show")
     * @Method("GET")
     * @Template()
     */
    public function showAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('AppLanguageBundle:Country')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Country entity.');
        }

        $deleteForm = $this->createDeleteForm($id);

        return array(
            'entity'      => $entity,
            'delete_form' => $deleteForm->createView(),
        );
    }

    /**
     * Displays a form to edit an existing Country entity.
     *
     * @Route("/{id}/edit", name="country_edit")
     * @Method("GET")
     * @Template()
     */
    public function editAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('AppLanguageBundle:Country')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Country entity.');
        }

        $editForm = $this->createEditForm($entity);
        $deleteForm = $this->createDeleteForm($id);

        return array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }

    /**
    * Creates a form to edit a Country entity.
    *
    * @param Country $entity The entity
    *
    * @return \Symfony\Component\Form\Form The form
    */
    private function createEditForm(Country $entity)
    {
        $form = $this->createForm(new CountryType(), $entity, array(
            'action' => $this->generateUrl('country_update', array('id' => $entity->getId())),
            'method' => 'PUT',
        ));

        $form->add('submit', 'submit', array('label' => 'Update'));

        return $form;
    }
    /**
     * Edits an existing Country entity.
     *
     * @Route("/{id}", name="country_update")
     * @Method("PUT")
     * @Template("AppLanguageBundle:Country:edit.html.twig")
     */
    public function updateAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('AppLanguageBundle:Country')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Country entity.');
        }

        $deleteForm = $this->createDeleteForm($id);
        $editForm = $this->createEditForm($entity);
        $editForm->handleRequest($request);

        if ($editForm->isValid()) {
            $em->flush();

            return $this->redirect($this->generateUrl('country'));
        }

        return array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }
    /**
     * Deletes a Country entity.
     *
     * @Route("/{id}", name="country_delete")
     * @Method("DELETE")
     */
    public function deleteAction(Request $request, $id)
    {
        $form = $this->createDeleteForm($id);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $entity = $em->getRepository('AppLanguageBundle:Country')->find($id);

            if (!$entity) {
                throw $this->createNotFoundException('Unable to find Country entity.');
            }

            $em->remove($entity);
            $em->flush();
        }

        return $this->redirect($this->generateUrl('country'));
    }

    /**
     * Creates a form to delete a Country entity by id.
     *
     * @param mixed $id The entity id
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createDeleteForm($id)
    {
        return $this->createFormBuilder()
            ->setAction($this->generateUrl('country_delete', array('id' => $id)))
            ->setMethod('DELETE')
            ->add('submit', 'submit', array('label' => 'Delete'))
            ->getForm()
        ;
    }
}

redpajama_set_name: RedPajamaGithub


text:
@interface MOBProjectionEPSG22183 : MOBProjection

@end


text:
package org.springframework.security.web.util;

import static org.assertj.core.api.Assertions.*;

import org.junit.Test;
import org.springframework.security.web.util.TextEscapeUtils;

public class TextEscapeUtilsTests {

	/**
	 * &, <, >, ", &#39 and (space) escaping
	 */
	@Test
	public void charactersAreEscapedCorrectly() {
		assertThat(TextEscapeUtils.escapeEntities("& a<script>\"'")).isEqualTo(
				"& a<script>"'");
	}

	@Test
	public void nullOrEmptyStringIsHandled() throws Exception {
		assertThat(TextEscapeUtils.escapeEntities("")).isEqualTo("");
		assertThat(TextEscapeUtils.escapeEntities(null)).isNull();
	}

	@Test(expected = IllegalArgumentException.class)
	public void invalidLowSurrogateIsDetected() throws Exception {
		TextEscapeUtils.escapeEntities("abc\uDCCCdef");
	}

	@Test(expected = IllegalArgumentException.class)
	public void missingLowSurrogateIsDetected() throws Exception {
		TextEscapeUtils.escapeEntities("abc\uD888a");
	}

	@Test(expected = IllegalArgumentException.class)
	public void highSurrogateAtEndOfStringIsRejected() throws Exception {
		TextEscapeUtils.escapeEntities("abc\uD888");
	}

	/**
	 * Delta char: 𐐀
	 */
	@Test
	public void validSurrogatePairIsAccepted() throws Exception {
		assertThat(TextEscapeUtils.escapeEntities("abc\uD801\uDC00a")).isEqualTo("abc𐐀a");
	}

	@Test
	public void undefinedSurrogatePairIsIgnored() throws Exception {
		assertThat(TextEscapeUtils.escapeEntities("abc\uD888\uDC00a")).isEqualTo("abca");
	}
}


text:
package com.belatrixsf.connect.ui.skills.Add;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;

import com.belatrixsf.connect.R;
import com.belatrixsf.connect.ui.common.BelatrixConnectActivity;
import com.belatrixsf.connect.ui.skills.SkillsListFragment;

import butterknife.Bind;

/**
 * Created by echuquilin on 9/08/16.
 */
public class AddSkillActivity extends BelatrixConnectActivity{

    @Nullable @Bind(R.id.toolbar) protected Toolbar toolbar;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_base);
        setNavigationToolbar();
        if (savedInstanceState == null) {
            replaceFragment(AddSkillFragment.newInstance(), false);
        }
    }

    @Override
    protected void navigateBack() {
        SkillsListFragment.refreshFromAddSkill();
        finish();
    }

    @Override
    public void onBackPressed() {
        SkillsListFragment.refreshFromAddSkill();
        finish();
    }

    public static Intent makeIntent(Context context) {
        return new Intent(context, AddSkillActivity.class);
    }

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycologia 42(4): 537 (1950)

#### Original name
Ascochyta brachypodii var. brachypodii (Syd.) R. Sprague & Aar.G. Johnson

### Remarks
null


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package streaming.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;

/**
 *
 * @author ETY
 */
@Entity
public class Personne implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    private String nom;

    private String prenom;

    @ManyToMany(mappedBy = "listerealisateurs")
    private List<Film> realisateurs = new ArrayList<Film>();

    @ManyToMany(mappedBy = "listeacteurs")
    private List<Film> acteurs = new ArrayList<Film>();

    public Personne (){

    }

    public Personne(Long id, String nom, String prenom) {
        this.id = id;
        this.nom = nom;
        this.prenom = prenom;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getPrenom() {
        return prenom;
    }

    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }

    public List<Film> getRealisateurs() {
        return realisateurs;
    }

    public void setRealisateurs(List<Film> realisateurs) {
        this.realisateurs = realisateurs;
    }

    public List<Film> getActeurs() {
        return acteurs;
    }

    public void setActeurs(List<Film> acteurs) {
        this.acteurs = acteurs;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Personne)) {
            return false;
        }
        Personne other = (Personne) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "streaming.entity.Personne[ id=" + id + " ]";
    }

}


text:
//#define USE_DEBUG_WINDOW
using UnityEditor;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine.SceneManagement;
using UnityEditor.SceneManagement;

namespace RealtimeCSG
{
#if USE_DEBUG_WINDOW
	[System.Reflection.Obfuscation(Exclude = true)]
	internal sealed class DebugEditorWindow : EditorWindow
    {
	#region GetWindow
	    static DebugEditorWindow GetWindow(bool generate)
	    {
		    if (!generate)
		    {
			    var items = Resources.FindObjectsOfTypeAll<DebugEditorWindow>();
			    if (items.Length == 0)	// NOTE: if we use the item we've found somehow unity
									    // won't let it be flagged as dirty?
				    return null;
		    }
		    var window = (DebugEditorWindow)EditorWindow.GetWindow<DebugEditorWindow>("Debug Window");
		    return window;
	    }
	#endregion

	#region SetEditorDirty
	    public static void SetEditorDirty()
	    {
			var prevFocus = EditorWindow.focusedWindow;
			var window = GetWindow(generate: false);
			if (window == null)
				return;
		    EditorUtility.SetDirty(window);
			if (prevFocus != null)
				prevFocus.Focus();
		}
	#endregion

		[MenuItem( "Window/CSG Debug Editor")] static void ShowCSGEditorWindow()
		{
			var window = GetWindow(generate: true); window.Show();
		}

		#region OnGUI
		void OnGUI()
	    {
		    EditorGUILayout.Space();
		    EditorGUILayout.Space();
            if (GUILayout.Button("Log Diagnostics"))
			{
				Debug.Log("--[C++ side]--\n");
				CSGBindings.LogDiagnostics();

				Debug.Log("--[C# side (registered)]--\n");
				Debug.Log(string.Format("models {0} brushes {1} operations {2}\n", InternalCSGModelManager.models.Length, InternalCSGModelManager.brushes.Length, InternalCSGModelManager.operations.Length));
				foreach(var model in InternalCSGModelManager.models)
				{
					Debug.Log(string.Format("\tmodel \"{0}\" node-id: {1} model-id: {2} \n", model.name, model.nodeID, model.modelID));
				}
				foreach (var operation in InternalCSGModelManager.operations)
				{
					Debug.Log(string.Format("\toperation \"{0}\" node-id: {1} operation-id: {2} \n", operation.name, operation.nodeID, operation.operationID));
				}
				foreach (var brush in InternalCSGModelManager.brushes)
				{
					Debug.Log(string.Format("\tbrush \"{0}\" node-id: {1} brush-id: {2} \n", brush.name, brush.nodeID, brush.brushID));
				}

				Debug.Log("--[C# side (unregistered)]--\n");

				var nodes		= CSGSceneUtility.FindComponentsInScene<CSGNode>(EditorSceneManager.GetActiveScene());
				var models		= (from node in nodes where node is CSGModel select node as CSGModel).ToArray();
				var operations	= (from node in nodes where node is CSGOperation select node as CSGOperation).ToArray();
				var brushes		= (from node in nodes where node is CSGBrush select node as CSGBrush).ToArray();

				Debug.Log(string.Format("models {0} brushes {1} operations {2}\n", models.Length, brushes.Length, operations.Length));
				foreach (var model in models)
				{
					if (InternalCSGModelManager.models.Contains(model))
						continue;
					Debug.Log(string.Format("\tmodel \"{0}\" node-id: {1} model-id: {2} \n", model.name, model.nodeID, model.modelID));
				}
				foreach (var operation in operations)
				{
					if (InternalCSGModelManager.operations.Contains(operation))
						continue;
					Debug.Log(string.Format("\toperation \"{0}\" node-id: {1} operation-id: {2} \n", operation.name, operation.nodeID, operation.operationID));
				}
				foreach (var brush in brushes)
				{
					if (InternalCSGModelManager.brushes.Contains(brush))
						continue;
					Debug.Log(string.Format("\tbrush \"{0}\" node-id: {1} brush-id: {2} \n", brush.name, brush.nodeID, brush.brushID));
				}

			}
		}
		#endregion
	}
#endif
}


text:
package userinterface;

import org.junit.jupiter.api.Test;
import structs.LcrState;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

/**
 * Tests for methods and encodings of the Location Civic subelement.
 */
public class LcrTest {
    // Constants
    private static final String UNITED_STATES = "United States of America";
    private static final String GERMANY = "Germany";

    // Default state with no address elements.
    private static final LcrState STATE_DEFAULT = buildLcrState(
        UNITED_STATES,
        new String[0][0]);
    private static final String BUFFER_DEFAULT = "00025553";

    // An example address in Munich, with multiple languages.
    private static final LcrState STATE_MUNICH = buildLcrState(
        GERMANY,
        new String[][] {
            {"Oberbayern", "German", "County"},
            {"München", "German", "City"},
            {"Munich", "English", "City"},
            {"Bayern", "German", "State"},
            {"Marienplatz", "German", "Group of Streets"},
            {"8", "German", "House Number"}
        }
    );
    private static final String BUFFER_MUNICH = "0040"
        + "4445" // Germany
        + "00026465" // German language
        + "010642617965726e" // State
        + "020a4f62657262617965726e" // County
        + "03084dc3bc6e6368656e" // City
        + "060b4d617269656e706c61747a" // Group of Streets
        + "130138" // House Number
        + "0002656e" // English language
        + "03064d756e696368"; // City

    // An example address in Mountain View, with a normal set of parameters.
    private static final LcrState STATE_MOUNTAIN_VIEW = buildLcrState(
        UNITED_STATES,
        new String[][] {
            {"CA", "English", "State"},
            {"Mtn View", "English", "City"},
            {"Alta Road", "English", "Street Suffix or Type"},
            {"15", "English", "House Number"},
            {"Floor 8", "English", "Floor"},
            {"Room 2", "English", "Room"},
            {"Pole 3", "English", "Type of Place"},
        }
    );
    private static final String BUFFER_MOUNTAIN_VIEW = "003c"
        + "5553" // Country code
        + "0002656e" // English language
        + "01024341" // State
        + "03084d746e2056696577" // City
        + "1209416c746120526f6164" // Street Suffix or Type
        + "13023135" // House Number
        + "1b07466c6f6f722038" // Floor
        + "1c06526f6f6d2032" // Room
        + "1d06506f6c652033"; // Type of Place

    // A state resulting in a 255-byte data field, the maximum length.
    private static final LcrState STATE_WITH_MAXIMUM_LENGTH_ADDRESS = buildLcrState(
        STATE_DEFAULT.getCountry(),
        new String[][] {
            {"a".repeat(247), "English", "State"}
        }
    );
    private static final String BUFFER_WITH_MAXIMUM_LENGTH_ADDRESS = "00ff"
        + "5553"
        + "0002656e"
        + "01f7" + "61".repeat(247);

    // A state with a 256-byte data field, which is above the maximum length.
    private static final LcrState STATE_WITH_TOO_LONG_ADDRESS = buildLcrState(
        STATE_DEFAULT.getCountry(),
        new String[][] {
            {"a".repeat(248), "English", "State"}
        }
    );

    private final LcrModel model = new LcrModel(new LcrState());

    /**
     * Constructs an LcrState with predetermined values.
     *
     * @param country the country where the address is located
     * @param addressElements the list of address elements, where each address element is represented
     *                        as an array of length 3: ["Name", "Language", "Type"]
     * @return an LcrState containing the given values
     */
    private static LcrState buildLcrState(String country, String[][] addressElements) {
        LcrState state = new LcrState();
        state.setCountry(country);
        for (String[] addressElement : addressElements) {
            StringBuilder addressElementName = new StringBuilder(addressElement[0]);
            StringBuilder addressElementLanguage = new StringBuilder(addressElement[1]);
            StringBuilder addressElementType = new StringBuilder(addressElement[2]);
            state.addAddressElement(addressElementName, addressElementLanguage, addressElementType);
        }
        return state;
    }

    /**
     * Test the buffer encoding for a default state.
     */
    @Test
    void testBufferDefault() {
        model.setState(STATE_DEFAULT);

        String buffer = model.toHexBuffer();

        assertEquals(BUFFER_DEFAULT, buffer);
    }

    /**
     * Test the buffer encoding for the Munich example with multiple languages.
     */
    @Test
    void testBufferMunich() {
        model.setState(STATE_MUNICH);

        String buffer = model.toHexBuffer();

        assertEquals(BUFFER_MUNICH, buffer);
    }

    /**
     * Test the buffer encoding for the Mountain View example with a normal set of parameters.
     */
    @Test
    void testBufferMountainView() {
        model.setState(STATE_MOUNTAIN_VIEW);

        String buffer = model.toHexBuffer();

        assertEquals(BUFFER_MOUNTAIN_VIEW, buffer);
    }

    /**
     * Test the buffer encoding with an address of the maximum length.
     */
    @Test
    void testBufferWithMaximumLengthAddress() {
        model.setState(STATE_WITH_MAXIMUM_LENGTH_ADDRESS);

        String buffer = model.toHexBuffer();

        assertEquals(BUFFER_WITH_MAXIMUM_LENGTH_ADDRESS, buffer);
    }

    /**
     * Test the buffer encoding with an address that is too long to be encoded.
     */
    @Test
    void testBufferWithTooLongAddress() {
        model.setState(STATE_WITH_TOO_LONG_ADDRESS);

        assertThrows(IllegalArgumentException.class, model::toHexBuffer);
    }
}


text:
require 'xmlrpc/client'
require 'gandi/zlib_parser_decorator'
require 'gandi/version'
require 'gandi/price'
require 'gandi/contact'
require 'gandi/domain'
require 'gandi/operation'

module Gandi

    class Error < StandardError; end
    class DataError < Error; end
    class ServerError < Error; end
    class ValidationError < Error; end

  class << self
    attr_writer :apikey
    attr_writer :mode

    def apikey
      @apikey || ENV['GANDI_API_KEY']
    end

    def mode
      @mode || ENV['GANDI_API_MODE']
    end

    def endpoint
      self.mode == 'live' ? 'https://rpc.gandi.net/xmlrpc/' : 'https://rpc.ote.gandi.net/xmlrpc/'
    end

    def client
      @client ||= begin
        XMLRPC::Config.module_eval do
          remove_const(:ENABLE_NIL_PARSER)
          const_set(:ENABLE_NIL_PARSER, true)
        end
        client = XMLRPC::Client.new2(self.endpoint)
        client.http_header_extra = {"Accept-Encoding" => "gzip"}
        client.set_parser ZlibParserDecorator.new(client.send(:parser))
        client
      end
    end

    def call(name, *args)
      client.call(name, self.apikey, *args)
    rescue XMLRPC::FaultException => e
      raise(e.faultCode < 500000 ? ServerError : DataError, e.faultString)
    end
  end
end


text:
package org.codehaus.xfire.spring.editors;

import java.beans.PropertyEditorSupport;

import org.codehaus.xfire.service.ServiceFactory;
import org.codehaus.xfire.spring.config.ServiceFactoryBean;
import org.codehaus.xfire.transport.TransportManager;

/**
 * @author Tomasz Sztelak
 *
 */
public class ServiceFactoryEditor
    extends PropertyEditorSupport
{
    private TransportManager transportManager;

    public TransportManager getTransportManager()
    {
        return transportManager;
    }

    public void setTransportManager(TransportManager transportManager)
    {
        this.transportManager = transportManager;
    }

    public void setAsText(String text)
        throws IllegalArgumentException
    {
    	text = text.trim();

        ServiceFactoryBean factoryBean = new ServiceFactoryBean(text);
        factoryBean.setTransportManager(transportManager);
        ServiceFactory factory;
        try
        {
            factory = (ServiceFactory) factoryBean.getObject();
        }
        catch (Exception e)
        {
            throw new IllegalArgumentException(e.getMessage());
        }
        setValue(factory);
    }

}


text:
<?xml version='1.0' encoding='UTF-8'?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.google.cloud</groupId>
  <artifactId>google-cloud-security-private-ca-bom</artifactId>
  <version>2.9.0-SNAPSHOT</version><!-- {x-version-update:google-cloud-security-private-ca:current} -->
  <packaging>pom</packaging>

  <parent>
    <groupId>com.google.cloud</groupId>
    <artifactId>google-cloud-pom-parent</artifactId>
    <version>1.1.0-SNAPSHOT</version><!-- {x-version-update:google-cloud-java:current} -->
    <relativePath>../../google-cloud-pom-parent/pom.xml</relativePath>
  </parent>

  <name>Google Certificate Authority Service BOM</name>
  <description>
    BOM for Certificate Authority Service
  </description>

  <properties>
    <maven.antrun.skip>true</maven.antrun.skip>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>google-cloud-security-private-ca</artifactId>
        <version>2.9.0-SNAPSHOT</version><!-- {x-version-update:google-cloud-security-private-ca:current} -->
      </dependency>
      <dependency>
        <groupId>com.google.api.grpc</groupId>
        <artifactId>grpc-google-cloud-security-private-ca-v1beta1</artifactId>
        <version>0.16.0-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-security-private-ca-v1beta1:current} -->
      </dependency>
      <dependency>
        <groupId>com.google.api.grpc</groupId>
        <artifactId>grpc-google-cloud-security-private-ca-v1</artifactId>
        <version>2.9.0-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-security-private-ca-v1:current} -->
      </dependency>
      <dependency>
        <groupId>com.google.api.grpc</groupId>
        <artifactId>proto-google-cloud-security-private-ca-v1beta1</artifactId>
        <version>0.16.0-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-security-private-ca-v1beta1:current} -->
      </dependency>
      <dependency>
        <groupId>com.google.api.grpc</groupId>
        <artifactId>proto-google-cloud-security-private-ca-v1</artifactId>
        <version>2.9.0-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-security-private-ca-v1:current} -->
      </dependency>
    </dependencies>
  </dependencyManagement>
</project>


text:
require "spec_helper"

describe 'Espago.subscriptions' do

  it "should get list of subscriptions" do
    VCR.use_cassette('subscriptions get') do
      response = Espago.subscriptions :get
      response.count.should eq(1)
      response.subscriptions.size.should eq(1)
    end
  end

  it "should get info abount subscriptions" do
    VCR.use_cassette('subscriptions get sub_8yYuCBKdywr7e2') do
      response = Espago.subscriptions :get,{subscription_id:'sub_8yYuCBKdywr7e2'}
      response.status.should eq(200)
      response.state.should eq('active')
      response.client.should eq('cli_90Pi6Jf0ndl_PP')
      response.plan.should eq('pl_12345')
      response.last_invoice.should be_kind_of(Hash)
    end
  end

  it "should get params from new plan" do
    VCR.use_cassette('subscriptions post') do
      response = Espago.subscriptions :post,{ plan:'pl_12345',client:'cli_90Pi6Jf0ndl_PP'}
      response.status.should eq(201)
      response.state.should eq('active')
      response.client.should eq('cli_90Pi6Jf0ndl_PP')
      response.plan.should eq('pl_12345')
      response.last_invoice.should be_kind_of(Hash)
    end
  end

  it "should get info after deleted subscription" do
    VCR.use_cassette('subscriptions delete sub_8yYuCBKdywr7e2') do
      response = Espago.subscriptions :delete,{subscription_id:'sub_8yYuCBKdywr7e2'}
      expect(response.status).to eq(204)
    end
  end

end


text:
<?php
namespace Concrete\Core\Updater\Migrations\Migrations;

use Concrete\Core\Permission\Access\Entity\Type;
use Concrete\Core\Permission\Category;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use \Concrete\Core\Conversation\FlagType\FlagType;
use Concrete\Core\Block\BlockType\BlockType;
use AuthenticationType;
use Exception;
use Page;
use SinglePage;
use Concrete\Core\Permission\Key\Key as PermissionKey;

class Version573 extends AbstractMigration
{

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

    public function up(Schema $schema)
    {
        $ft = FlagType::getByhandle('spam');
        if (!is_object($ft)) {
            FlagType::add('spam');
        }

        $bt = BlockType::getByHandle('image_slider');
        $bt->refresh();

        $types = array(Type::getByHandle('group'), Type::getByHandle('user'), Type::getByHandle('group_set'), Type::getByHandle('group_combination'));
        $categories = array(Category::getByHandle('conversation'), Category::getByHandle('conversation_message'));
        foreach($categories as $category) {
            foreach($types as $pe) {
                if (is_object($category) && is_object($pe)) {
                    $category->associateAccessEntityType($pe);
                }
            }
        }

        try {
            $gat = AuthenticationType::getByHandle('google');
        } catch(Exception $e) {
            $gat = AuthenticationType::add('google', 'Google');
            if (is_object($gat)) {
                $gat->disable();
            }
        }

        // fix register page permissions
		$g1 = \Group::getByID(GUEST_GROUP_ID);
        $register = \Page::getByPath('/register', "RECENT");
        $register->assignPermissions($g1, array('view_page'));

        // add new permissions, set it to the same value as edit page permissions on all pages.
        $epk = PermissionKey::getByHandle('edit_page_permissions');
        $msk = PermissionKey::getByHandle('edit_page_multilingual_settings');
        $ptk = PermissionKey::getByHandle('edit_page_page_type');
        if (!is_object($msk)) {
            $msk = PermissionKey::add('page', 'edit_page_multilingual_settings', 'Edit Multilingual Settings', 'Controls whether a user can see the multilingual settings menu, re-map a page or set a page as ignored in multilingual settings.', false, false);
        }
        if (!is_object($ptk)) {
            $ptk = PermissionKey::add('page', 'edit_page_page_type', 'Edit Page Type', 'Change the type of an existing page.', false, false);
        }
        $db = \Database::get();
        $r = $db->Execute('select cID from Pages where cInheritPermissionsFrom = "OVERRIDE" order by cID asc');
        while ($row = $r->FetchRow()) {
            $c = Page::getByID($row['cID']);
            if (is_object($c) && !$c->isError()) {
                $epk->setPermissionObject($c);
                $msk->setPermissionObject($c);
                $ptk->setPermissionObject($c);
                $rpa = $epk->getPermissionAccessObject();
                if (is_object($rpa)) {
                    $pt = $msk->getPermissionAssignmentObject();
                    if (is_object($pt)) {
                        $pt->clearPermissionAssignment();
                        $pt->assignPermissionAccess($rpa);
                    }
                    $pt = $ptk->getPermissionAssignmentObject();
                    if (is_object($pt)) {
                        $pt->clearPermissionAssignment();
                        $pt->assignPermissionAccess($rpa);
                    }
                }
            }
        }

        // add new page type permissions
        $epk = PermissionKey::getByHandle('edit_page_type_permissions');
        $msk = PermissionKey::getByHandle('edit_page_type');
        $dsk = PermissionKey::getByHandle('delete_page_type');
        if (!is_object($msk)) {
            $msk = PermissionKey::add('page_type', 'edit_page_type', 'Edit Page Type', '', false, false);
        }
        if (!is_object($dsk)) {
            $dsk = PermissionKey::add('page_type', 'delete_page_type', 'Delete Page Type', '', false, false);
        }
        $list = \Concrete\Core\Page\Type\Type::getList();
        foreach($list as $pagetype) {
            $epk->setPermissionObject($pagetype);
            $msk->setPermissionObject($pagetype);
            $dsk->setPermissionObject($pagetype);
            $rpa = $epk->getPermissionAccessObject();
            if (is_object($rpa)) {
                $pt = $msk->getPermissionAssignmentObject();
                if (is_object($pt)) {
                    $pt->clearPermissionAssignment();
                    $pt->assignPermissionAccess($rpa);
                }
                $pt = $dsk->getPermissionAssignmentObject();
                if (is_object($pt)) {
                    $pt->clearPermissionAssignment();
                    $pt->assignPermissionAccess($rpa);
                }
            }
        }

        // add new multilingual tables.
        $sm = $db->getSchemaManager();
        $schemaTables = $sm->listTableNames();
        if (!in_array('MultilingualPageRelations', $schemaTables)) {
            $mpr = $schema->createTable('MultilingualPageRelations');
            $mpr->addColumn('mpRelationID', 'integer', array('notnull' => true, 'unsigned' => true, 'default' => 0));
            $mpr->addColumn('cID', 'integer', array('notnull' => true, 'unsigned' => true, 'default' => 0));
            $mpr->addColumn('mpLanguage', 'string', array('notnull' => true, 'default' => ''));
            $mpr->addColumn('mpLocale', 'string', array('notnull' => true));
            $mpr->setPrimaryKey(array('mpRelationID', 'cID', 'mpLocale'));
        }
        if (!in_array('MultilingualSections', $schemaTables)) {
            $mus = $schema->createTable('MultilingualSections');
            $mus->addColumn('cID', 'integer', array('notnull' => true, 'unsigned' => true, 'default' => 0));
            $mus->addColumn('msLanguage', 'string', array('notnull' => true, 'default' => ''));
            $mus->addColumn('msCountry', 'string', array('notnull' => true, 'default' => ''));
            $mus->setPrimaryKey(array('cID'));
        }
        if (!in_array('MultilingualTranslations', $schemaTables)) {
            $mts = $schema->createTable('MultilingualTranslations');
            $mts->addColumn('mtID', 'integer', array('autoincrement' => true, 'unsigned' => true));
            $mts->addColumn('mtSectionID', 'integer', array('unsigned' => true, 'notnull' => true, 'default' => 0));
            $mts->addColumn('msgid', 'text', array('notnull' => false));
            $mts->addColumn('msgstr', 'text', array('notnull' => false));
            $mts->addColumn('context', 'text', array('notnull' => false));
            $mts->addColumn('comments', 'text', array('notnull' => false));
            $mts->addColumn('reference', 'text', array('notnull' => false));
            $mts->addColumn('flags', 'text', array('notnull' => false));
            $mts->addColumn('updated', 'datetime', array('notnull' => false));
            $mts->setPrimaryKey(array('mtID'));
        }

        // block type
        $bt = BlockType::getByHandle('switch_language');
        if (!is_object($bt)) {
            $bt = BlockType::installBlockType('switch_language');
        }

        // single pages
        $sp = Page::getByPath('/dashboard/system/multilingual');
        if (!is_object($sp) || $sp->isError()) {
            $sp = SinglePage::add('/dashboard/system/multilingual');
            $sp->update(array('cName' => 'Multilingual'));
            $sp->setAttribute('meta_keywords', 'multilingual, localization, internationalization, i18n');
        }
        $sp = Page::getByPath('/dashboard/system/multilingual/setup');
        if (!is_object($sp) || $sp->isError()) {
            $sp = SinglePage::add('/dashboard/system/multilingual/setup');
            $sp->update(array('cName' => 'Multilingual Setup'));
        }
        $sp = Page::getByPath('/dashboard/system/multilingual/page_report');
        if (!is_object($sp) || $sp->isError()) {
            $sp = SinglePage::add('/dashboard/system/multilingual/page_report');
            $sp->update(array('cName' => 'Page Report'));
        }
        $sp = Page::getByPath('/dashboard/system/multilingual/translate_interface');
        if (!is_object($sp) || $sp->isError()) {
            $sp = SinglePage::add('/dashboard/system/multilingual/translate_interface');
            $sp->update(array('cName' => 'Translate Interface'));
        }
        $sp = Page::getByPath('/dashboard/pages/types/attributes');
        if (!is_object($sp) || $sp->isError()) {
            $sp = SinglePage::add('/dashboard/pages/types/attributes');
            $sp->update(array('cName' => 'Page Type Attributes'));
        }

    }

    public function down(Schema $schema)
    {
    }
}


text:
from django.forms import TextInput
from django.template import Template, Context

class AddressWithMapWidget(TextInput):
    def render(self, name, value, attrs=None):
        default_html = super(AddressWithMapWidget, self).render(name, value, attrs)
        map_template = Template("{% load easy_maps_tags %}{% easy_map address 700 200 16 %}")
        context = Context({'address': value})
        return default_html + map_template.render(context)


text:
'use strict';

function createNewsFeed(spec) {
  spec = spec || {};
  let repository = spec.repository;
  let newsList = [];

  if ( !repository ) {
    throw new Error('You need to specify the repository property: "createNewsFeed({repository: repositoryObject})"');
  }

  function find() {
    return new Promise(function findNews(resolve, reject) {

      repository
        .find()
        .then(function success(newsList) {
          resolve(newsList);
        })
        .catch(function error(result) {
          reject(result);
        });

    });
  }

  return {
    find: find
  };

}

module.exports = createNewsFeed;


text:
#include <aws/iot/model/ProvisioningHook.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace IoT
{
namespace Model
{

ProvisioningHook::ProvisioningHook() :
    m_payloadVersionHasBeenSet(false),
    m_targetArnHasBeenSet(false)
{
}

ProvisioningHook::ProvisioningHook(JsonView jsonValue) :
    m_payloadVersionHasBeenSet(false),
    m_targetArnHasBeenSet(false)
{
  *this = jsonValue;
}

ProvisioningHook& ProvisioningHook::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("payloadVersion"))
  {
    m_payloadVersion = jsonValue.GetString("payloadVersion");

    m_payloadVersionHasBeenSet = true;
  }

  if(jsonValue.ValueExists("targetArn"))
  {
    m_targetArn = jsonValue.GetString("targetArn");

    m_targetArnHasBeenSet = true;
  }

  return *this;
}

JsonValue ProvisioningHook::Jsonize() const
{
  JsonValue payload;

  if(m_payloadVersionHasBeenSet)
  {
   payload.WithString("payloadVersion", m_payloadVersion);

  }

  if(m_targetArnHasBeenSet)
  {
   payload.WithString("targetArn", m_targetArn);

  }

  return payload;
}

} // namespace Model
} // namespace IoT
} // namespace Aws


text:
layout: post-index
title: All BLOG
excerpt: "A List of Posts"
---


text:
$SourceFileUrl = "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-edit/sample.pdf"

# Search string.
$SearchString = 'Notes'

# Please NOTE: In this sample we're assuming Cloud Api Server is hosted at "https://localhost".
# If it's not then please replace this with with your hosting url.

# Prepare URL for PDF text search API call.
$queryFindText = "https://localhost/pdf/find?url=$($SourceFileURL)&searchString=$($SearchString)"
$queryFindText = [System.Uri]::EscapeUriString($queryFindText)

try {
    # Execute request
    $jsonResponseFindText = Invoke-RestMethod -Method Get  -Uri $queryFindText

    if ($jsonResponseFindText.error -eq $false) {

        # Display search information
        $itemFindText = $jsonResponseFindText.body[0];

        Write-Host "Found text at coordinates $($itemFindText.left), $($itemFindText.top)"

        #Comma-separated list of page indices (or ranges) to process. Leave empty for all pages. Example: '0,2-5,7-'.
        $Pages = ""

        # PDF document password. Leave empty for unprotected documents.
        $Password = ""

        # Destination PDF file name
        $DestinationFile = "./result.pdf"

        # Text annotation params
        $Type = "annotation";
        $X = $itemFindText.left;
        $Y = $itemFindText.top + 25;
        $Text = "Some notes will go here... Some notes will go here.... Some notes will go here.....";
        $FontName = "Times New Roman";
        $FontSize = 12;
        $Color = "FF0000";

        $resultFileName = [System.IO.Path]::GetFileName($DestinationFile)

        # * Add Text *
        # Prepare request to `PDF Edit` API endpoint
        $query = "https://localhost/pdf/edit/add?name=$($resultFileName)&password=$($Password)&pages=$($Pages)&url=$($SourceFileUrl)&type=$($Type)&x=$($X)&y=$($Y)&text=$($Text)&fontname=$($FontName)&size=$($FontSize)&color=$($Color)";
        $query = [System.Uri]::EscapeUriString($query)

        try {
            # Execute request
            $jsonResponse = Invoke-RestMethod -Method Get  -Uri $query

            if ($jsonResponse.error -eq $false) {
                # Get URL of generated barcode image file
                $resultFileUrl = $jsonResponse.url

                # Download output file
                Invoke-WebRequest -Uri $resultFileUrl -OutFile $DestinationFile

                Write-Host "Generated PDF saved to '$($DestinationFile)' file."
            }
            else {
                # Display service reported error
                Write-Host $jsonResponse.message
            }
        }
        catch {
            # Display request error
            Write-Host $_.Exception
        }
    }
    else {
        # Display service reported error
        Write-Host $jsonResponse.message
    }
}
catch {
    # Display request error
    Write-Host $_.Exception
}


text:
const recipeRoutes = require("./recipe");
const categoryRoutes = require("./category");
const userRoutes = require("./user");
const loginRoute = require("./login");
const signupRoute = require("./signup");

const constructorMethod = (app) => {
    app.use("/recipe", recipeRoutes);
    app.use("/category", categoryRoutes);
    app.use("/user", userRoutes);
    app.use("/login", loginRoute);
    app.use("/signup", signupRoute);

    app.get('/logout', function(req, res) {
        req.logout();
        res.redirect('/');
    });

    app.use("/", (req, res) => {
        res.redirect('/recipe/');
    });
};

module.exports = constructorMethod;


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.apache.abdera</groupId>
    <artifactId>abdera</artifactId>
    <version>1.2-SNAPSHOT</version>
    <relativePath>../..</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>abdera-extensions-wsse</artifactId>
  <packaging>bundle</packaging>
  <name>Abdera Extensions - WSSE</name>
  <version>1.2-SNAPSHOT</version>
  <description>Atom Specification Extensions - WSSE</description>

  <properties>
    <topDir>${basedir}/../..</topDir>
    <abdera.osgi.default.exports>
      org.apache.abdera.ext.wsse.*
    </abdera.osgi.default.exports>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.apache.abdera</groupId>
      <artifactId>abdera-client</artifactId>
      <version>1.2-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
</project>


text:
* { padding: 0; margin: 0; }
body { font-family: sans-serif; }
a { text-decoration: none; color: #00A5CC; }
li { list-style-type: none; }

header {
	width: 100%;
	height: 50px;
	margin: auto;
	border-bottom: 1px solid #000;
	background-color: black;
	background-image:url("../img/header.png");
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
}
#brand {

	line-height: 50px;
	color: #FFFFFF;
	font-size: 25px;

   	margin: 0 0 0 6px;

}
nav { width: 100%; text-align: center; }
nav a {
	display: block;
	padding: 15px 0;
	border-bottom: 1px solid #e6e6e6;
	color: #FFFFFF;
	background-image:url("../img/header.png");
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
}
nav a:hover { background: #A4A4A4; color: #000; }
nav li:last-child a { border-bottom: none; }

/*-----------------------------------------*/

.menu {
	width: 350px;
	height: 100%;
	position: absolute;
	background: #000000;
	left: -350px;
	transition: all .3s ease-in-out;
	-webkit-transition: all .3s ease-in-out;
	-moz-transition: all .3s ease-in-out;
	-ms-transition: all .3s ease-in-out;
	-o-transition: all .3s ease-in-out;
	z-index: 999;
}
.menu-icon {
	padding: 10px 20px;
	background: #cce0ff;
	color: #FFFFFF;
	cursor: pointer;
	float: left;
	margin: 6px 6px 0 0;
	border-radius: 5px;
	background-image:url("../img/menu_icon.png");
}
#menuToggle { display: none; }

#menuToggle:checked ~ .menu { position: absolute; left: 0; }

body{
		background-image: url("../img/blue.png");
		background-repeat: no-repeat;
		background-position: center center;
		background-attachment: fixed;
		background-size: cover;
}


text:
package com.blazebit.persistence.integration.hibernate.base;

import org.hibernate.ScrollableResults;

import java.io.Closeable;
import java.util.Iterator;

/**
 * Iterator over {@code ScrollableResults}.
 *
 * @author Jan-Willem Gmelig Meyling
 * @since 1.6.2
 */
public class ScrollableResultsIterator implements Iterator<Object>, Closeable {

    private final ScrollableResults scrollableResults;
    private Object[] next;

    public ScrollableResultsIterator(ScrollableResults scrollableResults) {
        this.scrollableResults = scrollableResults;
    }

    @Override
    public boolean hasNext() {
        return next != null || (scrollableResults.next() && (next = scrollableResults.get()) != null);
    }

    @Override
    public Object next() {
        Object[] next = this.next;
        this.next = null;
        if (next.length == 1) {
            return next[0];
        } else {
            return next;
        }
    }

    @Override
    public void remove() {
        throw new UnsupportedOperationException("remove");
    }

    @Override
    public void close() {
        scrollableResults.close();
    }

}


text:
package br.com.casadocodigo.livraria.site.servico;

public interface ClienteHTTP {

	String get(String url) throws ServidorIndisponivelException;
}


text:
package ru.stqa.addressbook.appmanager;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;
import org.testng.Assert;
import ru.stqa.addressbook.model.ContactData;
import ru.stqa.addressbook.model.Contacts;

import java.util.List;

/**
 * Created by Lina on 26.03.2017.
 */
public class ContactHelper extends HelperBase {

  public ContactHelper(WebDriver wd) {
    super(wd);
  }

  public void submitNewContact() {
    click(By.cssSelector("input[name='submit']"));
  }

  public void fildContactForm(ContactData contactData, boolean creation) {
    type(By.name("firstname"), contactData.getFirstname());
    type(By.name("lastname"), contactData.getLastname());
    type(By.name("middlename"), contactData.getMiddlename());
    type(By.name("nickname"), contactData.getNickname());
    type(By.name("address"), contactData.getAddress());
    type(By.name("email"), contactData.getEmail());
    type(By.name("email2"), contactData.getEmail2());
    type(By.name("email3"), contactData.getEmail3());
    type(By.name("home"), contactData.getHomePhone());
    type(By.name("mobile"), contactData.getMobilePhone());
    type(By.name("work"), contactData.getWorkPhone());
    type(By.name("title"), contactData.getTitle());
    type(By.name("company"), contactData.getCompany());

    if (creation){
      new Select(wd.findElement(By.name("new_group"))).selectByVisibleText(contactData.getGroup());
      }else {
      Assert.assertFalse(isElementPresent(By.name("new_group")));
    }
  }

  public void lookContact() {
    click(By.linkText("home"));
  }

  public void selectContactById(int id) {
    wd.findElement(By.cssSelector("input[value='" + id + "']")).click();
  }

  public void deleteContact() {
    click(By.xpath("//input[@value='Delete']"));
  }

  public void modifyContactInfo() {
    click(By.xpath("//input[@value='Modify']"));
  }

  public void editContactById(int id) {
    wd.findElement(By.xpath("//a[@href='edit.php?id="+id+"']")).click();
  }

  public void lookInfoContact(int id){
    wd.findElement(By.xpath("//a[@href='view.php?id="+id+"']")).click();
  }

  public void updateContact() {
    click(By.name("update"));
  }

  public void create(ContactData contact, boolean b) {
    click(By.linkText("add new"));
    fildContactForm(contact, true);
    submitNewContact();
    contactCache = null;
    lookContact();
  }

  public void modify(ContactData contact) {
    editContactById(contact.getId());
    fildContactForm(contact, false);
    updateContact();
    contactCache = null;
    lookContact();
  }

  public void delete(ContactData contact) {
    selectContactById(contact.getId());
    deleteContact();
    alertContact();
    contactCache = null;
    lookContact();
  }

  public boolean isThereAContact() {
    return isElementPresent(By.name("selected[]"));
  }

  public int count() {
    return wd.findElements(By.name("selected[]")).size();
  }

  private Contacts contactCache = null;

  public Contacts all() {

    if (contactCache != null) {
      return new Contacts(contactCache);
    }
    contactCache = new Contacts();
    List<WebElement> elements = wd.findElements(By.name("entry"));
    for (WebElement element : elements) {
      List<WebElement> cells = element.findElements(By.tagName("td"));
      String lastname = cells.get(1).getText();
      String firstname = cells.get(2).getText();
      String address = cells.get(3).getText();
      String allEmails = cells.get(4).getText();
      String allPhones = cells.get(5).getText();

      int id = Integer.parseInt(element.findElement(By.tagName("input")).getAttribute("value"));
      contactCache.add(new ContactData().withId(id).withFirstname(firstname).withLastname(lastname)
              .withAddress(address).withAllEmails(allEmails).withAllPhones(allPhones));
    }
    return contactCache;
  }

  public ContactData infoFromEditForm(ContactData contact) {
  editContactById(contact.getId());
  String firstname = wd.findElement(By.name("firstname")).getAttribute("value");
  String lastname = wd.findElement(By.name("lastname")).getAttribute("value");
  String home = wd.findElement(By.name("home")).getAttribute("value");
  String mobile = wd.findElement(By.name("mobile")).getAttribute("value");
  String work = wd.findElement(By.name("work")).getAttribute("value");
  String address = wd.findElement(By.name("address")).getAttribute("value");
  String email = wd.findElement(By.name("email")).getAttribute("value");
  String email2 = wd.findElement(By.name("email2")).getAttribute("value");
  String email3 = wd.findElement(By.name("email3")).getAttribute("value");
  wd.navigate().back();
  return new ContactData().withId(contact.getId()).withFirstname(firstname)
          .withLastname(lastname).withHomePhone(home)
          .withMobilePhone(mobile).withWorkPhone(work).withAddress(address).withEmail(email).withEmail2(email2)
          .withEmail3(email3);
  }

  public Contacts all1() {

    if (contactCache != null) {
      return new Contacts(contactCache);
    }
    contactCache = new Contacts();
    List<WebElement> elements = wd.findElements(By.id("content"));
    for (WebElement element : elements) {
      String allData = element.getText();

      int id = Integer.parseInt(element.findElement(By.tagName("input")).getAttribute("value"));
      contactCache.add(new ContactData().withId(id).withAllData(allData));
    }
    return contactCache;

  }

  public ContactData infoEditForm(ContactData contact) {
    modifyContactInfo();
    String firstname = wd.findElement(By.name("firstname")).getAttribute("value");
    String lastname = wd.findElement(By.name("lastname")).getAttribute("value");
    String home = wd.findElement(By.name("home")).getAttribute("value");
    String mobile = wd.findElement(By.name("mobile")).getAttribute("value");
    String work = wd.findElement(By.name("work")).getAttribute("value");
    String address = wd.findElement(By.name("address")).getAttribute("value");
    String email = wd.findElement(By.name("email")).getAttribute("value");
    String email2 = wd.findElement(By.name("email2")).getAttribute("value");
    String email3 = wd.findElement(By.name("email3")).getAttribute("value");
    String company = wd.findElement(By.name("company")).getAttribute("value");
    wd.navigate().back();
    return new ContactData().withId(contact.getId()).withFirstname(firstname)
            .withLastname(lastname).withHomePhone(home)
            .withMobilePhone(mobile).withWorkPhone(work).withAddress(address).withEmail(email).withEmail2(email2)
            .withEmail3(email3).withCompany(company);
  }

}


text:
"use strict";
var lodash = require("lodash");
var Blueprint = require('ember-cli/lib/models/blueprint');
var CommonUtils = (function () {
    function CommonUtils() {
    }
    CommonUtils.installFlexberryAddon = function (options, middlePaths) {
        var groupOptions = lodash.merge({}, options, { entity: { name: options.entity.name } });
        for (var _i = 0, middlePaths_1 = middlePaths; _i < middlePaths_1.length; _i++) {
            var middlePath = middlePaths_1[_i];
            var addonBlueprintOptions = lodash.merge({}, groupOptions, { installingAddon: true, middlePath: middlePath, originBlueprintName: middlePath });
            var flexberryAddon = Blueprint.lookup("flexberry-addon", {
                ui: undefined,
                analytics: undefined,
                project: undefined,
                paths: ["node_modules/ember-flexberry/blueprints"]
            });
            flexberryAddon["install"](addonBlueprintOptions);
        }
    };
    CommonUtils.installReexportNew = function (options, middlePaths) {
        var groupOptions = lodash.merge({}, options, { entity: { name: options.entity.name } });
        for (var _i = 0, middlePaths_2 = middlePaths; _i < middlePaths_2.length; _i++) {
            var middlePath = middlePaths_2[_i];
            var addonBlueprintOptions = lodash.merge({}, groupOptions, { installingAddon: true, middlePath: middlePath, originBlueprintName: middlePath });
            var flexberryAddon = Blueprint.lookup("flexberry-reexport-new", {
                ui: undefined,
                analytics: undefined,
                project: undefined,
                paths: ["node_modules/ember-flexberry/blueprints"]
            });
            flexberryAddon["install"](addonBlueprintOptions);
        }
    };
    CommonUtils.getFilesForGeneration = function (blueprint, exclusiveFunction) {
        if (exclusiveFunction === void 0) { exclusiveFunction = null; }
        blueprint._super._files = null;
        blueprint._super.path = blueprint.path;
        var files = blueprint._super.files.apply(blueprint);
        blueprint._super._files = null;
        if (exclusiveFunction != null) {
            lodash.remove(files, exclusiveFunction);
        }
        return files;
    };
    return CommonUtils;
}());
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = CommonUtils;
//# sourceMappingURL=CommonUtils.js.map


text:
package com.holub.hml;

/** Not used, but will be in future expansions.
 *
 * @author allen
 */

public interface VariableExpander
{
	/**
	 * Expand a macro replacement-text variable. The time-related variables
	 * are expanded in the Macro filter. There are two sorts of variables. The first
	 * set gets information about figures, tables, listings, and notes. The name is the
	 * label associated with the original element. If you apply these to marked lines
	 * within listing, you'll get information about the enclosing listing. The "scope"
	 * is one of: figure, table, listing, note
	 *
	 * %(href:scope:name)		href for a  element that will get us to the original location
	 * %(title:scope:name)		Title text
	 * %(id:scope:name)			Figure, table, listing, or note number (or note symbol).
	 *
	 * These macros apply only to marks set within listings. The scope must be "code"
	 *
	 * %(line:code:name)		The line number within the listing
	 * %(line-href:code:name)	The link to the line within the listing.
 	 * %(mark=value)			Associates a line number and listing
	 * 							information with the specified mark, and remembers it internally
	 * 							for subsequent use by %(href, etc). Does not generate a code anchor,
	 * 							but you can (in fact, must) do that in the macro expansion. For example,
	 * 							if you execute %(mark=fred) in a macro expansion, you must also create
	 * 							an anchor of the form  ...   surrounding the
	 * 							input that you want to mark. This macro evaluates recogizes a simple
	 * 							function definition in C/C++/Java, marks the line and surrounds the line with
	 * 							an anchor.
	 *
	 * code: /(^\s*(int.*([\w_]*\s*\().*$)/$1/MULTILINE
	 *
	 * @return the replacementText with any possible substitutions made
	 */

	boolean expandVariable( String replacementText );
}


text:
from django.views.generic import TemplateView

# All todos view
class Home( TemplateView ):

	# Set the view template
	template_name = 'index.html'


text:
[BitBucket Pipelines](https://confluence.atlassian.com/bitbucket/bitbucket-pipelines-792496469.html) YAML runner/parser [![Build Status](https://travis-ci.org/bivas/bitbucket-pipelines.svg?branch=master)](https://travis-ci.org/bivas/bitbucket-pipelines)

# Runner

See [Examples](examples/README.md)

# Parser

Parse pipelines to Go structs.

Using the following example:
```
image: python:2.7

pipelines:
  default:
    - step:
        script:
          - python --version
          - python myScript.py
```

Will output the following struct:
```
{Image:python:2.7 Pipelines:{Default:[{Step:{Scripts:[python --version python myScript.py]}}] Branches:[] Tags:[] Bookmarks:[]}}
```


text:
package cn.mutils.core.io.serial.primitive;

import org.w3c.dom.Document;
import org.w3c.dom.Node;

import cn.mutils.core.annotation.Primitive;
import cn.mutils.core.annotation.PrimitiveType;
import cn.mutils.core.beans.BeanField;
import cn.mutils.core.io.serial.Serial;
import cn.mutils.core.json.IJsonItem;
import cn.mutils.core.properties.IPropertyItem;
import cn.mutils.core.xml.IXmlItem;
import cn.mutils.core.xml.XmlUtil;

/**
 * Support two data types:{"n":"0"} {"n":0}
 */
@SuppressWarnings({"serial", "UnnecessaryBoxing", "unused", "UnnecessaryUnboxing"})
public class LongItem extends Serial<Long> {

    public LongItem() {
        mType = PrimitiveType.STRING_LONG;
        mValue = Long.valueOf(0L);
    }

    public LongItem(long value) {
        mType = PrimitiveType.STRING_LONG;
        mValue = Long.valueOf(value);
    }

    public LongItem(String value) {
        mType = PrimitiveType.STRING_LONG;
        mValue = Long.valueOf(value);
    }

    public long longValue() {
        return mValue.longValue();
    }

    protected void init(BeanField itemField) {
        if (itemField != null) {
            Primitive t = itemField.getAnnotation(Primitive.class);
            if (t != null) {
                mType = t.value();
            }
        }
    }

    @Override
    public IJsonItem fromJson(Object json, BeanField itemField) {
        init(itemField);
        try {
            mValue = Long.valueOf(json.toString());
        } catch (Exception e) {
            return null;
        }
        return this;
    }

    @Override
    public Object toJson(BeanField itemField) {
        init(itemField);
        if (mType == PrimitiveType.STRING_LONG) {
            return mValue.toString();
        } else {
            return mValue;
        }
    }

    @Override
    public IXmlItem fromXml(Node xml, BeanField itemField) {
        init(itemField);
        try {
            mValue = Long.valueOf(xml.getTextContent());
        } catch (Exception e) {
            return null;
        }
        return this;
    }

    @Override
    public Node toXml(Document doc, BeanField itemField) {
        init(itemField);
        Node node = XmlUtil.newNode(doc, itemField);
        node.setTextContent(mValue.toString());
        return node;
    }

    @Override
    public IPropertyItem fromProperty(String value, BeanField itemField) {
        init(itemField);
        try {
            mValue = Long.valueOf(value);
        } catch (Exception e) {
            return null;
        }
        return this;
    }

    @Override
    public String toProperty(BeanField itemField) {
        init(itemField);
        return mValue.toString();
    }

}


text:
class SharedBasket < ActiveRecord::Base
  belongs_to :user
  has_many :shared_links

  def shared_link_array
    links = []

    self.shared_links.order('created_at DESC').each do |link|
      user = User.find(link.sender_id)
      links << [link,
                user.name,
                user.image]
    end

    return links
  end

  def self.notifications(user_id)
    notifications = 0
    time = Time.now.getutc

    shared_basket = SharedBasket.find_by_user_id(user_id)
    links = shared_basket.shared_links

    links.each do |link|
      if link.created_at > shared_basket.clicked
        notifications += 1
      end
    end

    return notifications

  end
end


text:
import {
  DataSourceApi,
  PluginMeta,
  DataTransformerConfig,
  DataSourceInstanceSettings,
  DataSourceRef,
} from '@grafana/data';
import { DataSourceSrv } from '@grafana/runtime';

import { ElasticsearchQuery } from '../../plugins/datasource/elasticsearch/types';

import { getAlertingValidationMessage } from './getAlertingValidationMessage';

describe('getAlertingValidationMessage', () => {
  describe('when called with some targets containing template variables', () => {
    it('then it should return false', async () => {
      let call = 0;
      const datasource: DataSourceApi = {
        meta: { alerting: true } as any as PluginMeta,
        targetContainsTemplate: () => {
          if (call === 0) {
            call++;
            return true;
          }
          return false;
        },
        name: 'some name',
        uid: 'some uid',
      } as any as DataSourceApi;
      const getMock = jest.fn().mockResolvedValue(datasource);
      const datasourceSrv: DataSourceSrv = {
        get: (ref: DataSourceRef) => {
          return getMock(ref.uid);
        },
        getList(): DataSourceInstanceSettings[] {
          return [];
        },
        getInstanceSettings: (() => {}) as any,
        reload: () => jest.fn(),
      };
      const targets: ElasticsearchQuery[] = [
        { refId: 'A', query: '@hostname:$hostname' },
        { refId: 'B', query: '@instance:instance' },
      ];
      const transformations: DataTransformerConfig[] = [];

      const result = await getAlertingValidationMessage(transformations, targets, datasourceSrv, {
        uid: datasource.uid,
      });

      expect(result).toBe('');
      expect(getMock).toHaveBeenCalledTimes(2);
      expect(getMock).toHaveBeenCalledWith(datasource.uid);
    });
  });

  describe('when called with some targets using a datasource that does not support alerting', () => {
    it('then it should return false', async () => {
      const alertingDatasource: DataSourceApi = {
        meta: { alerting: true } as any as PluginMeta,
        targetContainsTemplate: () => false,
        name: 'alertingDatasource',
      } as any as DataSourceApi;
      const datasource: DataSourceApi = {
        meta: { alerting: false } as any as PluginMeta,
        targetContainsTemplate: () => false,
        name: 'datasource',
      } as any as DataSourceApi;

      const datasourceSrv: DataSourceSrv = {
        get: (name: string) => {
          if (name === datasource.name) {
            return Promise.resolve(datasource);
          }

          return Promise.resolve(alertingDatasource);
        },
        getInstanceSettings: (() => {}) as any,
        getList(): DataSourceInstanceSettings[] {
          return [];
        },
        reload: () => jest.fn(),
      };
      const targets: any[] = [
        { refId: 'A', query: 'some query', datasource: 'alertingDatasource' },
        { refId: 'B', query: 'some query', datasource: 'datasource' },
      ];
      const transformations: DataTransformerConfig[] = [];

      const result = await getAlertingValidationMessage(transformations, targets, datasourceSrv, {
        uid: datasource.name,
      });

      expect(result).toBe('');
    });
  });

  describe('when called with all targets containing template variables', () => {
    it('then it should return false', async () => {
      const datasource: DataSourceApi = {
        meta: { alerting: true } as any as PluginMeta,
        targetContainsTemplate: () => true,
        name: 'some name',
      } as any as DataSourceApi;
      const getMock = jest.fn().mockResolvedValue(datasource);
      const datasourceSrv: DataSourceSrv = {
        get: (ref: DataSourceRef) => {
          return getMock(ref.uid);
        },
        getInstanceSettings: (() => {}) as any,
        getList(): DataSourceInstanceSettings[] {
          return [];
        },
        reload: () => jest.fn(),
      };
      const targets: ElasticsearchQuery[] = [
        { refId: 'A', query: '@hostname:$hostname' },
        { refId: 'B', query: '@instance:$instance' },
      ];
      const transformations: DataTransformerConfig[] = [];

      const result = await getAlertingValidationMessage(transformations, targets, datasourceSrv, {
        uid: datasource.name,
      });

      expect(result).toBe('Template variables are not supported in alert queries');
      expect(getMock).toHaveBeenCalledTimes(2);
      expect(getMock).toHaveBeenCalledWith(datasource.name);
    });
  });

  describe('when called with all targets using a datasource that does not support alerting', () => {
    it('then it should return false', async () => {
      const datasource: DataSourceApi = {
        meta: { alerting: false } as any as PluginMeta,
        targetContainsTemplate: () => false,
        name: 'some name',
        uid: 'theid',
      } as any as DataSourceApi;
      const getMock = jest.fn().mockResolvedValue(datasource);
      const datasourceSrv: DataSourceSrv = {
        get: (ref: DataSourceRef) => {
          return getMock(ref.uid);
        },
        getInstanceSettings: (() => {}) as any,
        getList(): DataSourceInstanceSettings[] {
          return [];
        },
        reload: () => jest.fn(),
      };
      const targets: ElasticsearchQuery[] = [
        { refId: 'A', query: '@hostname:hostname' },
        { refId: 'B', query: '@instance:instance' },
      ];
      const transformations: DataTransformerConfig[] = [];

      const result = await getAlertingValidationMessage(transformations, targets, datasourceSrv, {
        uid: datasource.uid,
      });

      expect(result).toBe('The datasource does not support alerting queries');
      expect(getMock).toHaveBeenCalledTimes(2);
      expect(getMock).toHaveBeenCalledWith(datasource.uid);
    });
  });

  describe('when called with transformations', () => {
    it('then it should return false', async () => {
      const datasource: DataSourceApi = {
        meta: { alerting: true } as any as PluginMeta,
        targetContainsTemplate: () => false,
        name: 'some name',
      } as any as DataSourceApi;
      const getMock = jest.fn().mockResolvedValue(datasource);
      const datasourceSrv: DataSourceSrv = {
        get: (ref: DataSourceRef) => {
          return getMock(ref.uid);
        },
        getInstanceSettings: (() => {}) as any,
        getList(): DataSourceInstanceSettings[] {
          return [];
        },
        reload: () => jest.fn(),
      };
      const targets: ElasticsearchQuery[] = [
        { refId: 'A', query: '@hostname:hostname' },
        { refId: 'B', query: '@instance:instance' },
      ];
      const transformations: DataTransformerConfig[] = [{ id: 'A', options: null }];

      const result = await getAlertingValidationMessage(transformations, targets, datasourceSrv, {
        uid: datasource.uid,
      });

      expect(result).toBe('Transformations are not supported in alert queries');
      expect(getMock).toHaveBeenCalledTimes(0);
    });
  });
});


text:
layout: default
description: It is recommended to check the following list of incompatible changes before upgrading to ArangoDB 3.5
---
Incompatible changes in ArangoDB 3.5
====================================

It is recommended to check the following list of incompatible changes **before**
upgrading to ArangoDB 3.5, and adjust any client programs if necessary.

The following incompatible changes have been made in ArangoDB 3.5:

ID values in log messages
-------------------------

By default, ArangoDB and its client tools now show a 5 digit unique ID value in
any of their log messages, e.g.

    2019-03-25T21:23:19Z [8144] INFO [cf3f4] ArangoDB (version 3.5.0 enterprise [linux]) is ready for business. Have fun!.

In this message, the `cf3f4` is the message's unique ID value. ArangoDB users can
use this ID to build custom monitoring or alerting based on specific log ID values.

The presence of these ID values in log messages may confuse custom log message filtering
or routing mechanisms that parse log messages and that rely on the old log message
format.

This can be fixed adjusting any existing log message parsers and making them aware
of the ID values. The ID values are always 5 byte strings, consisting of the characters
`[0-9a-f]`. ID values are placed directly behind the log level (e.g. `INFO`) for
general log messages that do not contain a log topic, and directly behind the log
topic for messages that contain a topic, e.g.

    2019-03-25T21:23:19Z [8144] INFO [cf3f4] ArangoDB (version 3.5.0 enterprise [linux]) is ready for business. Have fun!.
    2019-03-25T21:23:16Z [8144] INFO {authentication} [3844e] Authentication is turned on (system only), authentication for unix sockets is turned on

Alternatively, the log IDs can be suppressed in all log messages by setting the startup
option `--log.ids false` when starting arangod or any of the client tools.

Startup options
---------------

The hidden startup option `--rocksdb.delayed_write_rate` was renamed to the more
consistent `--rocksdb.delayed-write-rate`. When the old option name is used, the
arangod startup will be aborted with a descriptive error message.

HTTP REST API
-------------
The following APIs have been added:

- [The new Stream Transaction API](http/transaction.html)
- [The new ArangoSearch Analyzer management API](http/analyzers.html)
- [The management of the new TTL indexes](http/indexes-ttl.html); this enhances the existing index-API
- [Query the actual shard a document lives in](http/collection-getting.html#return-responsible-shard-for-a-document)

The following APIs have been expanded:

- The [ArangoSearch management API](http/views-arangosearch.html) has the new `commitIntervalMsec` attribute in all routes
- Indexes can now have user-defined names
- The new "ttl" index type has been added to the [index creation API](http/indexes.html)
- [Collection creation API now provides the `smartJoinAttribute` parameter](data-modeling-collections-collection-methods.html)
- [`filter` foxx-tests](http/foxx-miscellaneous.html) for testing

The following documentation has been enhanced:

- the documentation for [collection creation and fetching its properties](http/collection-creating.html) has been made more precise

Web interface
-------------

### Potentially different sort order of documents

In the list of documents for a collection, the documents will now always be sorted
in lexicographical order of their `_key` values. An exception for keys representing
quasi-numerical values has been removed when doing the sorting in the web interface.

Therefore a document with a key value "10" will now be displayed before a document
with a key value of "9".

### Removal of index types "hash" and "skiplist" from the web UI (RocksDB engine)

For the RocksDB engine, the selection of index types "hash" and "skiplist"
has been removed from the web interface when creating new indexes.

The index types "hash", "skiplist" and "persistent" are just aliases of each other
when using the RocksDB engine, so there is no need to offer all of them in parallel.

We found that offering the different types of indexes while in fact they were the
same often confused end users. We opted for keeping "persistent" because from the
candidates "hash", "skiplist" and "persistent" only "persistent" is actually a valid
description of the index capabilities/implementation.

AQL
---

3.5 enforces the invalidation of variables in AQL queries after usage of an AQL
COLLECT statements as documented. The documentation for variable invalidation claims
that

    The COLLECT statement will eliminate all local variables in the current scope.
    After COLLECT only the variables introduced by COLLECT itself are available.

However, the described behavior was not enforced when a COLLECT was preceded by a
FOR loop that was itself preceded by a COLLECT. In the following query the final
RETURN statement accesses variable `key1` though the variable should have been
invalidated by the COLLECT directly before it:

    FOR x1 IN 1..2
      COLLECT key1 = x1
      FOR x2 IN 1..2
        COLLECT key2 = x2
        RETURN [key2, key1]

In previous releases, this query was
parsed ok, but the contents of variable `key1` in the final RETURN statement were
undefined.

This change is about making queries as the above fail with a parse error, as an
unknown variable `key1` is accessed here, avoiding the undefined behavior. This is
also in line with what the documentation states about variable invalidation.

HTTP Replication APIs
---------------------

### New parameter for WAL tailing API

Tailing of recent server operations via `/_api/wal/tail` gets a new parameter
`syncerId`, which helps in tracking the WAL tick of each client. If set, this
supersedes the parameter `serverId` for this purpose. The API stays backwards
compatible.

Miscellaneous
-------------

### Index creation

In previous versions of ArangoDB, if one attempted to create an index with a
specified `_id`, and that `_id` was already in use, the server would typically
return the existing index with matching `_id`. This is somewhat unintuitive, as
it would ignore if the rest of the definition did not match. This behavior has
been changed so that the server will now return a duplicate identifier error.

ArangoDB 3.5 also disallows creating indexes on the `_id` sub-attribute of an attribute,
`referredTo._id` or `documents[*]._id`. Previous versions of ArangoDB allowed creating
such indexes, but the indexes were non-functional.
Starting with ArangoDB 3.5 such indexes cannot be created anymore, and any attempts to
create them will fail.

### Version details output

The attribute key `openssl-version` in the server/client tool version details
output was renamed to `openssl-version-compile-time`.

This change affects the output produced when starting one of the ArangoDB
executables (e.g. arangod, arangosh) with the `--version` command. It also
changes the attribute name in the detailed response of the `/_api/version` REST API.

### Overcommit settings

On Linux, ArangoDB will now show a startup warning in case the kernel setting
`vm.overcommit_memory` is set to a value of 2 and the jemalloc memory allocator
is in use. This combination does not play well together, and may lead to the
kernel denying arangod's memory allocation requests in more cases than necessary.

Usage of V8
-----------

`ArangoQueryStreamCursor.id()` used to return a 32 bit number, and will now
return a string as similar places where V8 has representations of ArangoDB IDs.