text:
use strict;
use Migrate;

my %mailboxes = getBadMailboxes();

foreach my $mboxId (sort(keys %mailboxes)) {
    my $gid = $mailboxes{$mboxId};
    Migrate::log("Bad item_id_checkpoint in mailbox $mboxId in group $gid");
    #find largest id < 1073741824
    my @newChkptRes = Migrate::runSql("SELECT max(id)+1000 from mboxgroup$gid.mail_item where mailbox_id = $mboxId and id < 1073741824");
    my $newChkpt = @newChkptRes[0];
	if ($newChkpt >= 1063741824) {
		#not enough room between new checkpoint and upper limit; mbox is in really bad shape
        Migrate::log("New checkpoint ($newChkpt) too close to upper limit; mailbox may have naturally exceeded limit. Please manually export, delete, recreate, and then import this mailbox");
	} else {
        Migrate::log("Updating to new checkpoint $newChkpt");
		Migrate::runSql("UPDATE mailbox set item_id_checkpoint=$newChkpt where id=$mboxId");
        Migrate::log("Fixed mailbox $mboxId in group $gid");
	}
}

exit(0);

########################################################################################################################

sub getBadMailboxes() {
  my @rows = Migrate::runSql("SELECT id,group_id from mailbox where item_id_checkpoint >= 1073741824");
  my %toRet;
  foreach my $row (@rows) {
    if ($row =~ /([^\t\s]+)\t+([^\t\s]+)/) {
      $toRet{$1} = $2;
    }
  }
  return %toRet;
}


text:
namespace feature_guide {

ScopedJavaLocalRef<jobject> FeatureNotificationGuideBridge::GetJavaObj() {
  return ScopedJavaLocalRef<jobject>(java_obj_);
}

FeatureNotificationGuideBridge::FeatureNotificationGuideBridge() {
  JNIEnv* env = base::android::AttachCurrentThread();
  java_obj_.Reset(env, Java_FeatureNotificationGuideBridge_create(
                           env, reinterpret_cast<int64_t>(this))
                           .obj());
}

FeatureNotificationGuideBridge::~FeatureNotificationGuideBridge() {
  JNIEnv* env = base::android::AttachCurrentThread();
  Java_FeatureNotificationGuideBridge_clearNativePtr(env, java_obj_);
}

std::u16string FeatureNotificationGuideBridge::GetNotificationTitle(
    FeatureType feature) {
  JNIEnv* env = base::android::AttachCurrentThread();
  std::u16string title;
  base::android::ConvertJavaStringToUTF16(
      env,
      Java_FeatureNotificationGuideBridge_getNotificationTitle(
          env, java_obj_, static_cast<int>(feature))
          .obj(),
      &title);
  return title;
}

std::u16string FeatureNotificationGuideBridge::GetNotificationMessage(
    FeatureType feature) {
  JNIEnv* env = base::android::AttachCurrentThread();
  std::u16string message;
  base::android::ConvertJavaStringToUTF16(
      env,
      Java_FeatureNotificationGuideBridge_getNotificationMessage(
          env, java_obj_, static_cast<int>(feature))
          .obj(),
      &message);
  return message;
}

void FeatureNotificationGuideBridge::OnNotificationClick(FeatureType feature) {
  JNIEnv* env = base::android::AttachCurrentThread();
  Java_FeatureNotificationGuideBridge_onNotificationClick(
      env, java_obj_, static_cast<int>(feature));
}

}  // namespace feature_guide

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Devy\UkrBookBundle\Entity;

use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Constraints\Email;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Component\Validator\Mapping\ClassMetadata;

/**
 * Order
 */
class Order
{
    const STATUS_NEW = 1;
    const STATUS_PENDING = 2;
    const STATUS_COMPLETED = 3;
    const STATUS_UNKNOWN = 1000;
    const STATUS_ABANDONED = 9999;

    /**
     * @return array
     */
    public static function getStatusChoicesArray()
    {
        return [
            self::STATUS_NEW => self::getStringForStatus(self::STATUS_NEW),
            self::STATUS_PENDING => self::getStringForStatus(self::STATUS_PENDING),
            self::STATUS_COMPLETED => self::getStringForStatus(self::STATUS_COMPLETED),
            self::STATUS_UNKNOWN => self::getStringForStatus(self::STATUS_UNKNOWN),
            self::STATUS_ABANDONED => self::getStringForStatus(self::STATUS_ABANDONED),
        ];
    }

    /**
     * @var integer
     */
    private $id;

    /**
     * @var string
     */
    private $name;

    /**
     * @var string
     */
    private $email;

    /**
     * @var string
     */
    private $shipping_address_city;

    /**
     * @var string
     */
    private $shipping_address_details;

    /**
     * @var string
     */
    private $phone;

    /**
     * @var integer
     */
    private $status;

    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $OrderProduct;

    /**
     * @var \DateTime
     */
    private $created_at;

    /**
     * @var \DateTime
     */
    private $updated_at;

    /**
     * @var \Devy\UkrBookBundle\Entity\User
     */
    private $User;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->OrderProduct = new ArrayCollection();
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     * @return Order
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get name
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set email
     *
     * @param string $email
     * @return Order
     */
    public function setEmail($email)
    {
        $this->email = $email;

        return $this;
    }

    /**
     * Get email
     *
     * @return string
     */
    public function getEmail()
    {
        return $this->email;
    }

    /**
     * Set shipping_address_city
     *
     * @param string $shippingAddressCity
     * @return Order
     */
    public function setShippingAddressCity($shippingAddressCity)
    {
        $this->shipping_address_city = $shippingAddressCity;

        return $this;
    }

    /**
     * Get shipping_address_city
     *
     * @return string
     */
    public function getShippingAddressCity()
    {
        return $this->shipping_address_city;
    }

    /**
     * Set shipping_address_details
     *
     * @param string $shippingAddressDetails
     * @return Order
     */
    public function setShippingAddressDetails($shippingAddressDetails)
    {
        $this->shipping_address_details = $shippingAddressDetails;

        return $this;
    }

    /**
     * Get shipping_address_details
     *
     * @return string
     */
    public function getShippingAddressDetails()
    {
        return $this->shipping_address_details;
    }

    /**
     * Set status
     *
     * @param integer $status
     * @return Order
     * @throws \Exception
     */
    public function setStatus($status)
    {
        $this->status = $status;

        return $this;
    }

    /**
     * @param int $status
     * @return bool
     */
    public static function isAllowedStatus($status)
    {
        $allowedStatuses = [
            self::STATUS_NEW,
            self::STATUS_PENDING,
            self::STATUS_COMPLETED,
            self::STATUS_ABANDONED,
            self::STATUS_UNKNOWN,
        ];
        return in_array($status, $allowedStatuses);
    }

    /**
     * Get status
     *
     * @return integer
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * @return string
     */
    public function getStatusString()
    {
        return self::getStringForStatus($this->status);
    }

    /**
     * @param int $status
     * @return string
     */
    public static function getStringForStatus($status)
    {
        switch($status) {
            case self::STATUS_NEW:
                return 'New';
            case self::STATUS_PENDING:
                return 'Pending';
            case self::STATUS_COMPLETED:
                return 'Completed';
            case self::STATUS_ABANDONED:
                return 'Abandoned';
            case self::STATUS_UNKNOWN:
            default:
                return 'Unknown';
        }
    }

    /**
     * Set created_at
     *
     * @param \DateTime $createdAt
     * @return Order
     */
    public function setCreatedAt($createdAt)
    {
        $this->created_at = $createdAt;

        return $this;
    }

    /**
     * Get created_at
     *
     * @return \DateTime
     */
    public function getCreatedAt()
    {
        return $this->created_at;
    }

    /**
     * Set updated_at
     *
     * @param \DateTime $updatedAt
     * @return Order
     */
    public function setUpdatedAt($updatedAt)
    {
        $this->updated_at = $updatedAt;

        return $this;
    }

    /**
     * Get updated_at
     *
     * @return \DateTime
     */
    public function getUpdatedAt()
    {
        return $this->updated_at;
    }

    /**
     * Set User
     *
     * @param \Devy\UkrBookBundle\Entity\User $user
     * @return Order
     */
    public function setUser(\Devy\UkrBookBundle\Entity\User $user = null)
    {
        $this->User = $user;

        return $this;
    }

    /**
     * Get User
     *
     * @return \Devy\UkrBookBundle\Entity\User
     */
    public function getUser()
    {
        return $this->User;
    }

    /**
     * Add OrderProduct
     *
     * @param \Devy\UkrBookBundle\Entity\OrderProduct $orderProduct
     * @return Order
     */
    public function addOrderProduct(\Devy\UkrBookBundle\Entity\OrderProduct $orderProduct)
    {
        $this->OrderProduct[] = $orderProduct;
        $orderProduct->setOrder($this);

        return $this;
    }

    /**
     * Remove OrderProduct
     *
     * @param \Devy\UkrBookBundle\Entity\OrderProduct $orderProduct
     */
    public function removeOrderProduct(\Devy\UkrBookBundle\Entity\OrderProduct $orderProduct)
    {
        $this->OrderProduct->removeElement($orderProduct);
    }

    /**
     * Get OrderProduct
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getOrderProduct()
    {
        return $this->OrderProduct;
    }

    /**
     * Set phone
     *
     * @param string $phone
     * @return Order
     */
    public function setPhone($phone)
    {
        $this->phone = $phone;

        return $this;
    }

    /**
     * Get phone
     *
     * @return string
     */
    public function getPhone()
    {
        return $this->phone;
    }

    /**
     * @return float
     */
    public function getTotal()
    {
        $total = 0;
        /** @var OrderProduct $orderProduct */
        foreach ($this->getOrderProduct() as $orderProduct) {
            $total += $orderProduct->getProduct()->getPrice() * $orderProduct->getAmount();
        }
        return $total;
    }

    /**
     * @ORM\PrePersist
     */
    public function prePersist()
    {
        $datetime = new DateTime();
        $this->setCreatedAt($datetime);
        $this->setUpdatedAt($datetime);
    }

    /**
     * @ORM\PreUpdate
     */
    public function preUpdate()
    {
        $this->setUpdatedAt(new DateTime());
    }

    /**
     * Entity validation function
     *
     * @param ClassMetadata $metadata
     */
    public static function loadValidatorMetadata(ClassMetadata $metadata)
    {
        $metadata->addPropertyConstraint('name', new NotBlank())
            ->addPropertyConstraints('email', [
                new NotBlank(),
                new Email(),
            ])
            ->addPropertyConstraint('phone', new NotBlank())
            ->addConstraint(new Callback('validate'));
    }

    /**
     * @param Order $object
     * @param ExecutionContextInterface $context
     */
    public static function validate(Order $object, ExecutionContextInterface $context)
    {
        if (!self::isAllowedStatus($object->getStatus())) {
            $context->buildViolation('This status "%string%" is not allowed!')
                ->setParameter('%string%', $object->getStatus())
                ->atPath('Status')
                ->addViolation();
        }

        if ($object->getOrderProduct()->isEmpty()) {
            $context->buildViolation('Order should have at least one product')
                ->atPath('OrderProduct')
                ->addViolation();
        }
    }
}


text:
namespace Google.Cloud.Logging.V2.Snippets
{
    // [START logging_v2_generated_LoggingServiceV2_ListLogEntries_sync_flattened_resourceNames2]
    using Google.Api.Gax;
    using Google.Api.Gax.ResourceNames;
    using Google.Cloud.Logging.V2;
    using System;
    using System.Collections.Generic;

    public sealed partial class GeneratedLoggingServiceV2ClientSnippets
    {
        /// <summary>Snippet for ListLogEntries</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void ListLogEntriesResourceNames2()
        {
            // Create client
            LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.Create();
            // Initialize request argument(s)
            IEnumerable<OrganizationName> resourceNames = new OrganizationName[]
            {
                OrganizationName.FromOrganization("[ORGANIZATION]"),
            };
            string filter = "";
            string orderBy = "";
            // Make the request
            PagedEnumerable<ListLogEntriesResponse, LogEntry> response = loggingServiceV2Client.ListLogEntries(resourceNames, filter, orderBy);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (LogEntry item in response)
            {
                // Do something with each item
                Console.WriteLine(item);
            }

            // Or iterate over pages (of server-defined size), performing one RPC per page
            foreach (ListLogEntriesResponse page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (LogEntry item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            }

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int pageSize = 10;
            Page<LogEntry> singlePage = response.ReadPage(pageSize);
            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (LogEntry item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
        }
    }
    // [END logging_v2_generated_LoggingServiceV2_ListLogEntries_sync_flattened_resourceNames2]
}


text:
package com.asakusafw.dag.api.processor;

import java.util.List;
import java.util.OptionalInt;

/**
 * Represents a custom task schedule.
 * @since 0.4.0
 * @version 0.4.2
 */
@FunctionalInterface
public interface TaskSchedule {

    /**
     * Returns the custom tasks schedule.
     * @return the custom tasks schedule
     */
    List<? extends TaskInfo> getTasks();

    /**
     * Returns the number of max concurrency.
     * @return the number of max concurrency, or empty if it is not limited
     * @since 0.4.2
     */
    default OptionalInt getMaxConcurrency() {
        return OptionalInt.empty();
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<project>
  <triggers class="vector">
    <org.jenkinsci.plugins.ghprb.GhprbTrigger>
      <spec>* * * * *</spec>
      <adminlist>user1
user2</adminlist>
      <allowMembersOfWhitelistedOrgsAsAdmin>true</allowMembersOfWhitelistedOrgsAsAdmin>
      <whitelist>user3
user4</whitelist>
      <orgslist>org1
org2</orgslist>
      <cron>* * * * *</cron>
      <triggerPhrase>retest this please</triggerPhrase>
      <onlyTriggerPhrase>true</onlyTriggerPhrase>
      <useGitHubHooks>true</useGitHubHooks>
      <permitAll>false</permitAll>
      <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
      <extensions>
        <org.jenkinsci.plugins.ghprb.extensions.comments.GhprbBuildStatus>
          <messages>
            <org.jenkinsci.plugins.ghprb.extensions.comments.GhprbBuildResultMessage>
              <message>success comment</message>
              <result>SUCCESS</result>
            </org.jenkinsci.plugins.ghprb.extensions.comments.GhprbBuildResultMessage>
            <org.jenkinsci.plugins.ghprb.extensions.comments.GhprbBuildResultMessage>
              <message>failure comment</message>
              <result>FAILURE</result>
            </org.jenkinsci.plugins.ghprb.extensions.comments.GhprbBuildResultMessage>
            <org.jenkinsci.plugins.ghprb.extensions.comments.GhprbBuildResultMessage>
              <message>error comment</message>
              <result>ERROR</result>
            </org.jenkinsci.plugins.ghprb.extensions.comments.GhprbBuildResultMessage>
          </messages>
        </org.jenkinsci.plugins.ghprb.extensions.comments.GhprbBuildStatus>
        <org.jenkinsci.plugins.ghprb.extensions.build.GhprbCancelBuildsOnUpdate/>
      </extensions>
    </org.jenkinsci.plugins.ghprb.GhprbTrigger>
  </triggers>
</project>


text:
package com.example.test3;

import com.nineoldandroids.animation.AnimatorSet;
import com.nineoldandroids.animation.ObjectAnimator;

import android.content.Context;
import android.graphics.Matrix;
import android.graphics.Point;
import android.util.AttributeSet;
import android.util.Log;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.RelativeLayout;

public class FeatherRevealView extends RelativeLayout implements OnTouchListener {
	ImageView fadeImage, frame, leftImage, rightImage;
	float diffrence;
	int preConeL =0;
	int preConeR=0;
	float preAlpha = 1;

	private int width;
	private int height;

	private Context mContext;
	private Matrix transform = new Matrix();

	private Vector2D position = new Vector2D();
	private float scale = 1;
	private float angle = 0;

	private TouchManager touchManager = new TouchManager(2);
	private boolean isInitialized = false;

	// Debug helpers to draw lines between the two touch points
	private Vector2D vca = null;
	private Vector2D vcb = null;
	private Vector2D vpa = null;
	private Vector2D vpb = null;

	public FeatherRevealView(Context context) {
		super(context);
		init(context);
	}

	/**
	 * @param context
	 * @param attrs
	 */
	public FeatherRevealView(Context context, AttributeSet attrs) {
		super(context, attrs);
		init(context);
	}

	public FeatherRevealView(Context context, AttributeSet attrs, int defStyleAttr) {
		super(context, attrs, defStyleAttr);
		init(context);
	}

	private void init(Context context) {
		 mContext = context;
		 setWillNotDraw(false);
		 setOnTouchListener(this);
		View inflater = LayoutInflater.from(context).inflate(R.layout.activity_main, this, true);

		leftImage = (ImageView) inflater.findViewById(R.id.leftImage);
	    rightImage = (ImageView) inflater.findViewById(R.id.rightImage);
		fadeImage = (ImageView) inflater.findViewById(R.id.fadeImg);
		frame = (ImageView) inflater.findViewById(R.id.frame);

		WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);

		Display display = windowManager.getDefaultDisplay();
		Point size = new Point();
		display.getSize(size);
		int width = size.x;
		int height = size.y;

		this.width = width;
		this.height = height;

		// leftImage.setX(width);
		leftImage.setX(-100);
		leftImage.setY(height - 1200);

		rightImage.setX(200);
		rightImage.setY(height -1200);

//		animateR();
	}

	@Override
	public boolean onTouch(View v, MotionEvent event) {
		vca = null;
		vcb = null;
		vpa = null;
		vpb = null;

		try {
			touchManager.update(event);

			Log.v("TAG", String.valueOf("Touches >>>>>>" + touchManager.getPressCount()));

				if (touchManager.getPressCount() == 2) {
					vca = touchManager.getPoint(0);
					vpa = touchManager.getPreviousPoint(0);
					vcb = touchManager.getPoint(1);
					vpb = touchManager.getPreviousPoint(1);

					Vector2D current = touchManager.getVector(0, 1);
					Vector2D previous = touchManager.getPreviousVector(0, 1);
					float currentDistance = current.getLength();
					float previousDistance = previous.getLength();

					if (previousDistance != 0) {
						scale *= currentDistance / previousDistance;
					}

					angle -= Vector2D.getSignedAngleBetween(current, previous);
				}

//			invalidate();
//			animateR();

			revealFeather(scale);

		} catch (Throwable t) {
			// So lazy...
		}
		return true;
	}

	public void revealFeather(float diff) {
		// AnimatorProxy.wrap(leftImage).setPivotX(100);
		// AnimatorProxy.wrap(leftImage).setPivotY(100);

		WindowManager windowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);

		Display display = windowManager.getDefaultDisplay();
		Point size = new Point();
		display.getSize(size);
		int width = size.x;
		int height = size.y;

		leftImage.setPivotX(width / 2);
		leftImage.setPivotY(height - 100);

		rightImage.setPivotX(width / 2);
		rightImage.setPivotY(height - 100);
		Log.v("TAF", "******* > " + diff);

//		boolean flag = animateOnRange(diff);
//		if (flag == true)
			moveOnSpecifix(diff);

	}

	private boolean animateOnRange(float diff){
		if(1<=diff && diff < 3){
			animateFeatherParas(0, 1);
			return true;
		}
		if(3<=diff && diff < 5){
			animateFeatherParas(100, 0);
			return true;
		}
		return false;
	}

	private void moveOnSpecifix(float diff){
		diffrence = diff;
	int distanceBetweenFingers = (int) Math.round(diff);

		switch (distanceBetweenFingers) {

		case 0:
		case 1: changeFeatherParas(0, 1);
		break;
		case 2: changeFeatherParas(18, 0.8f);
		break;
		case 3: changeFeatherParas(36, 0.6f);
		break;
		case 4: changeFeatherParas(54, 0.4f);
		break;
		case 5: changeFeatherParas(72, 0.2f);
		break;
		case 6: changeFeatherParas(100, 0);
		break;

		default:
			break;
		}
	}
	private void changeFeatherParas(int angle, float alpha){
		AnimatorSet set = new AnimatorSet();
		set.playTogether(
				ObjectAnimator.ofFloat(leftImage, "rotation", preConeL, angle*-1),
				ObjectAnimator.ofFloat(rightImage, "rotation", preConeR, angle),
				ObjectAnimator.ofFloat(fadeImage, "alpha", preAlpha, alpha),
				ObjectAnimator.ofFloat(frame, "alpha", preAlpha, alpha)
		);
		set.start();
		preConeL = angle*-1;
		preConeR = angle;
		preAlpha = alpha;

		 animateOnRange(diffrence);
	}

	private void animateFeatherParas(int angle, float alpha){
		AnimatorSet set = new AnimatorSet();
		set.playTogether(
				ObjectAnimator.ofFloat(leftImage, "rotation", preConeL, angle*-1),
				ObjectAnimator.ofFloat(rightImage, "rotation", preConeR, angle),
				ObjectAnimator.ofFloat(fadeImage, "alpha", preAlpha, alpha),
				ObjectAnimator.ofFloat(frame, "alpha", preAlpha, alpha)
		);
		set.setDuration(5 * 1000).start();
		preConeL = angle*-1;
		preConeR = angle;
		preAlpha = alpha;
	}

	public void animateR() {
		// AnimatorProxy.wrap(leftImage).setPivotX(100);
		// AnimatorProxy.wrap(leftImage).setPivotY(100);

		WindowManager windowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);

		Display display = windowManager.getDefaultDisplay();
		Point size = new Point();
		display.getSize(size);
		int width = size.x;
		int height = size.y;

		leftImage.setPivotX(width / 2);
		leftImage.setPivotY(height - 100);

		rightImage.setPivotX(width / 2);
		rightImage.setPivotY(height - 100);

		AnimatorSet set = new AnimatorSet();
		set.playTogether(
				ObjectAnimator.ofFloat(leftImage, "rotation", 0, -90),
				ObjectAnimator.ofFloat(rightImage, "rotation", 0, 90),
				ObjectAnimator.ofFloat(fadeImage, "alpha", 1, 0.25f, 0)
		);
		set.setDuration(5 * 1000).start();

	}

}


text:
import { RandomInteger } from './RandomInteger';
import { RandomBoolean } from './RandomBoolean';

/**
 * Provides methods that can be used for generating random strings and chars, as well as picking at random strings/chars from a given set of strings/chars.
 */
export class RandomString {
    private static readonly _digits = "01234956789";
    private static readonly _symbols = "_,.:-/.[].{},#-!,$=%.+^.&*-() ";
    private static readonly _alphaLower = "abcdefghijklmnopqrstuvwxyz";
    private static readonly _alphaUpper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    private static readonly _alpha = RandomString._alphaUpper + RandomString._alphaLower;
    private static readonly _chars = RandomString._alpha + RandomString._digits + RandomString._symbols;

    /**
     * Picks a char at random from the string passed as 'values'
     *
     * @param values    chars to pick from.
     * @returns         randomly picked char.
     */
    public static pickChar(values: string): string {
        if (values == null || values.length == 0)
            return '';

        let index = RandomInteger.nextInteger(values.length);
        return values.charAt(index);
    }

    /**
     * Picks a string at random from the string array passed as 'values'
     *
     * @param values    strings to pick from.
     * @returns         randomly picked string.
     */
    public static pick(values: string[]): string {
        if (values == null || values.length == 0)
            return '';

        let index = RandomInteger.nextInteger(values.length);
        return values[index];
    }

    /**
     * Distorts the string passed as 'value' by making it lower case and by
     * either adding a symbol ("_,.:-/.[].{},#-!,$=%.+^.&*-() ") to the end of the string,
     * or capitalizing the first letter of the string.
     *
     * @param value    string to distort.
     * @returns        initial string with only the first letter capitalized or with a symbol added to the end.
     */
    public static distort(value: string): string {
        value = value.toLowerCase();

        //Capitalize the first letter of the string 'value'.
        if (RandomBoolean.chance(1, 5))
            value = value.substring(0, 1).toUpperCase() + value.substring(1);

        //Add a symbol to the end of the string 'value'
        if (RandomBoolean.chance(1, 3))
            value = value + RandomString.pickChar(RandomString._symbols);

        return value;
    }

    /**
     * Randomly generates a letter of the English alphabet.
     *
     * @returns a random letter of the English alphabet. Returned letter can be upper or lower case).
     */
    public static nextAlphaChar(): string {
        let index = RandomInteger.nextInteger(RandomString._alpha.length);
        return RandomString._alpha.charAt(index);
    }

    /**
     * Randomly generates a string, consisting of upper and lower case letters (of the English alphabet),
     * digits (0-9), and symbols ("_,.:-/.[].{},#-!,$=%.+^.&*-() ").
     *
     * @param minLength     minimum length of the string to be returned.
     * @param maxLength     maximum length of the string to be returned.
     * @returns             randomly generated string.
     */
    public static nextString(minLength: number, maxLength: number): string {
        let result = '';

        let length = RandomInteger.nextInteger(minLength, maxLength);
        for (let i = 0; i < length; i++) {
            let index = RandomInteger.nextInteger(RandomString._chars.length);
            result += RandomString._chars.charAt(index);
        }

        return result;
    }
}


text:
#include "VoiceStick.h"
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

	VoiceStick *w = new VoiceStick();
	w->show();

    return a.exec();
}


text:
"""
Unit tests for easyconfig/format/format.py

@author: Stijn De Weirdt (Ghent University)
"""
from easybuild.framework.easyconfig.format.format import FORMAT_VERSION_HEADER_TEMPLATE, FORMAT_VERSION_REGEXP
from test.framework.utilities import EnhancedTestCase
from unittest import TestLoader, main

from vsc.utils.fancylogger import setLogLevelDebug, logToScreen

class EasyConfigFormatTest(EnhancedTestCase):
    """Test the parser"""

    def test_parser_version_regex(self):
        """Trivial parser test"""
        version = {'major': 1, 'minor': 0}
        txt = FORMAT_VERSION_HEADER_TEMPLATE % version
        res = FORMAT_VERSION_REGEXP.search(txt).groupdict()
        self.assertEqual(version['major'], int(res['major']))
        self.assertEqual(version['minor'], int(res['minor']))

def suite():
    """ returns all the testcases in this module """
    return TestLoader().loadTestsFromTestCase(EasyConfigFormatTest)

if __name__ == '__main__':
    # logToScreen(enable=True)
    # setLogLevelDebug()
    main()


text:
Register

{{errorMessage}}

  <form class="form" ng-submit="register()">

      User Key Provided by Geoshepard
      <input type="text" class="form-control" name="userkey" ng-model="registerForm.userkey" required/>

      Username
      <input type="text" class="form-control" name="username" ng-model="registerForm.username" required/>

      Password
      <input type="password" class="form-control" name="password" ng-model="registerForm.password" required/>

      <button type="submit" class="btn btn-default" ng-disabled="disabled">Register</button>

        Having Trouble?
        Send Us an E-Mail

  </form>


text:
/**
 * @file
 *
 * Represents a entity which produces a report summarizing the test outcomes for the user
 *
 * An example of a report producer is the entity which prints the outcomes of the tests in a file
 *
 * @date Oct 27, 2017
 * @author Lorenzo Nodari <lorenzo.nodari.it@ieee.org>
 */

#ifndef REPORT_PRODUCER_H_
#define REPORT_PRODUCER_H_

#include <stdio.h>

#include "test_report.h"
#include "section.h"
#include "list.h"
#include "typedefs.h"
#include "model.h"

/**
 * Struct used to contain the statistics used by @crashc to give the user additional info on the run tests
 */
struct ct_test_stats {
	/**
	 * The number of total tests @crashc have detected
	 *
	 * @definition Test
	 * It's is a single loop of a @testcase
	 */
	unsigned int total_tests;
	/**
	 * The number of passed tests
	 *
	 */
	unsigned int successful_tests;
	/**
	 * The number of  failed tests
	 *
	 */
	unsigned int failed_tests;
};

/**
 * Contains function pointers to the implementations of the function used to produce the report of the particular parts of the tests.
 *
 * @definition Report Producer
 * It's an entity which, given a in-memory representation of the outcome of the tests just performed by @crashc,
 * generates an output (e.g. json, xml, sql db) which nicely summarizes the outcomes of the tests.
 *
 * This allows for easy customization and high code maintainability. Use this struct to generate your custom test reporter.
 * For example, one may want to create a test reporter which save its data ina mysqlite database.
 */
struct ct_report_producer {

	ct_test_reporter_c test_reporter;

	ct_snapshot_tree_reporter_c snapshot_tree_reporter;

	ct_summary_reporter_c summary_producer;

	ct_assert_reporter_c assert_reporter;

	ct_reporter_c report_producer;

};

/**
 * Prints the string representation of a ::ct_snapshot_status
 *
 * @param[in] status the status to compute the string representation of
 * @return a string representation of \c status
 */
char* ct_snapshot_status_to_string(enum ct_snapshot_status status);

/**
 * Prints the string representation of a ::ct_section_type
 *
 * @param[in] type the type to compute the string representation of
 * @return a string representation of \c type
 */
char* ct_section_type_to_string(enum ct_section_type type);

//TODO in my opinion these functiosn should be placed in another header called like "default_report_producer.h"

/**
 * @addtogroup defaultReportProducer Default Report Producer
 * @brief a struct ct_report_producer which print the summary of @crashc test outcomes in a file by writing the test correctly indented
 * @{
 */

/**
 * Prints the report of the executed tests in a default format
 *
 * \note
 * The report will be printed in the file specified by struct ct_model::output_file
 *
 * @param[inout] model the model to handle
 */
void ct_default_report(struct ct_model* model);
/**
 * Prints the tests summary in a default format
 *
 * \note
 * The report will be printed in the file specified by struct ct_model::output_file
 *
 * @param[inout] model the model to handle
 */
void ct_default_report_summary(struct ct_model* model);

/**
 * Prints a the report of a single test with a default format
 *
 * \note
 * The report will be printed in the file specified by struct ct_model::output_file
 *
 * @param[inout] model the model to handle
 * @param[inout] report the test report to put in the file
 */
void ct_default_test_report(struct ct_model* model, struct ct_test_report* report);

/**
 * Prints a representation of a snapshot tree in a default format
 *
 * \note
 * The report will be printed in the file specified by struct ct_model::output_file
 *
 * @param[inout] model the model to manage
 * @param[inout] snapshot the snapshot to write into the file
 * @param[in] level the depth level \c snapshot is in the snapshot tree
 */
void ct_default_snapshot_tree_report(struct ct_model* model, struct ct_snapshot* snapshot, int level);

/**
 * Prints a default report for the assertions related to a specific snapshot
 *
 * \note
 * The report will be printed in the file specified by struct ct_model::output_file
 *
 * @param[inout] model the model to manage
 * @param[inout] snapshot the snapshot to write into the file
 * @param[in] level the depth level \c snapshot is in the snapshot tree
 *
 */
void ct_default_assertions_report(struct ct_model* model, struct ct_snapshot* snapshot, int level);

///@}

/**
 * Creates a new initialized structure in the heap
 *
 * @return a structure containing the statistics data related to the tests
 */
struct ct_test_stats* ct_init_stats();

/**
 * Creates and initializes in memory a new default report producer structure
 *
 * @return a structure representing a naive report producer
 */
struct ct_report_producer* ct_init_default_report_producer();

/**
 * Frees the memory occupied by a struct ct_test_stats
 *
 * @param[inout] stats the structure to dispose from the memory
 */
void ct_destroy_stats(struct ct_test_stats* stats);

/**
 * Frees the memory allocated for the default report producer
 *
 * @param[inout] producer the structure to dispose from the mermory
 */
void ct_destroy_default_report_producer(struct ct_report_producer* producer);

#endif /* REPORT_PRODUCER_H_ */


text:
function isValidTriangle(x, y, z) {
  // Forgetting to parseInt() took me a good hour to figure out. Lesson learned!
  x = parseInt(x)
  y = parseInt(y)
  z = parseInt(z)
  return ((x + y) > z) && ((x + z) > y) && ((y + z) > x)
}

function process(input) {
  var result = 0
  input.split("\n").forEach(function(triangle) {
    var sides = triangle.trim().split(/\s+/)
    result += isValidTriangle(sides[0], sides[1], sides[2]) ? 1 : 0
  })
  return result
}

module.exports = { isValidTriangle, process }


text:
package scala
package collection
package mutable

import scala.language.higherKinds

/** Base type of mutable Maps */
trait Map[K, V]
  extends Iterable[(K, V)]
    with collection.Map[K, V]
    with MapOps[K, V, Map, Map[K, V]]
    with Growable[(K, V)]
    with Shrinkable[K]
    with MapFactoryDefaults[K, V, Map, Iterable] {

  override def mapFactory: scala.collection.MapFactory[Map] = Map

  /*
  //TODO consider keeping `remove` because it returns the removed entry
  @deprecated("Use subtract or -= instead of remove", "2.13.0")
  def remove(key: K): Option[V] = {
    val old = get(key)
    if(old.isDefined) subtract(key)
    old
  }
  */

  /** The same map with a given default function.
    *  Note: The default is only used for `apply`. Other methods like `get`, `contains`, `iterator`, `keys`, etc.
    *  are not affected by `withDefaultValue`.
    *
    *  Invoking transformer methods (e.g. `map`) will not preserve the default value.
    *
    *  @param d     the function mapping keys to values, used for non-present keys
    *  @return      a wrapper of the map with a default value
    */
  def withDefault(d: K => V): Map[K, V] = new Map.WithDefault[K, V](this, d)

  /** The same map with a given default value.
    *  Note: The default is only used for `apply`. Other methods like `get`, `contains`, `iterator`, `keys`, etc.
    *  are not affected by `withDefaultValue`.
    *
    *  Invoking transformer methods (e.g. `map`) will not preserve the default value.
    *
    *  @param d     default value used for non-present keys
    *  @return      a wrapper of the map with a default value
    */
  def withDefaultValue(d: V): Map[K, V] = new Map.WithDefault[K, V](this, x => d)
}

/**
  * @define coll mutable map
  * @define Coll `mutable.Map`
  */
trait MapOps[K, V, +CC[X, Y] <: MapOps[X, Y, CC, _], +C <: MapOps[K, V, CC, C]]
  extends IterableOps[(K, V), Iterable, C]
    with collection.MapOps[K, V, CC, C]
    with Cloneable[C]
    with Builder[(K, V), C]
    with Growable[(K, V)]
    with Shrinkable[K] {

  def result(): C = coll

  @deprecated("Use - or remove on an immutable Map", "2.13.0")
  final def - (key: K): C = clone() -= key

  @deprecated("Use -- or removeAll on an immutable Map", "2.13.0")
  final def - (key1: K, key2: K, keys: K*): C = clone() -= key1 -= key2 --= keys

  /** Adds a new key/value pair to this map and optionally returns previously bound value.
    *  If the map already contains a
    *  mapping for the key, it will be overridden by the new value.
    *
    * @param key    the key to update
    * @param value  the new value
    * @return an option value containing the value associated with the key
    *         before the `put` operation was executed, or `None` if `key`
    *         was not defined in the map before.
    */
  def put(key: K, value: V): Option[V] = {
    val r = get(key)
    update(key, value)
    r
  }

  /** Adds a new key/value pair to this map.
    *  If the map already contains a
    *  mapping for the key, it will be overridden by the new value.
    *
    *  @param key    The key to update
    *  @param value  The new value
    */
  def update(key: K, value: V): Unit = { coll += ((key, value)) }

  /**
   * Update a mapping for the specified key and its current optionally-mapped value
   * (`Some` if there is current mapping, `None` if not).
   *
   * If the remapping function returns `Some(v)`, the mapping is updated with the new value `v`.
   * If the remapping function returns `None`, the mapping is removed (or remains absent if initially absent).
   * If the function itself throws an exception, the exception is rethrown, and the current mapping is left unchanged.
   *
   * @param key the key value
   * @param remappingFunction a partial function that receives current optionally-mapped value and return a new mapping
   * @return the new value associated with the specified key
   */
  def updateWith(key: K)(remappingFunction: Option[V] => Option[V]): Option[V] = {
    val previousValue = this.get(key)
    val nextValue = remappingFunction(previousValue)
    (previousValue, nextValue) match {
      case (None, None) => // do nothing
      case (Some(_), None) => this.remove(key)
      case (_, Some(v)) => this.update(key,v)
    }
    nextValue
  }

  /** If given key is already in this map, returns associated value.
   *
   *  Otherwise, computes value from given expression `op`, stores with key
   *  in map and returns that value.
   *
   *  Concurrent map implementations may evaluate the expression `op`
   *  multiple times, or may evaluate `op` without inserting the result.
   *
   *  @param  key the key to test
   *  @param  op  the computation yielding the value to associate with `key`, if
   *              `key` is previously unbound.
   *  @return     the value associated with key (either previously or as a result
   *              of executing the method).
   */
  def getOrElseUpdate(key: K, op: => V): V =
    get(key) match {
      case Some(v) => v
      case None => val d = op; this(key) = d; d
    }

  /** Removes a key from this map, returning the value associated previously
    *  with that key as an option.
    *  @param    key the key to be removed
    *  @return   an option value containing the value associated previously with `key`,
    *            or `None` if `key` was not defined in the map before.
    */
  def remove(key: K): Option[V] = {
    val r = get(key)
    if (r.isDefined) this -= key
    r
  }

  def clear(): Unit = { keysIterator foreach -= }

  override def clone(): C = empty ++= toIterable

  @deprecated("Use filterInPlace instead", "2.13.0")
  @inline final def retain(p: (K, V) => Boolean): this.type = filterInPlace(p)

  /** Retains only those mappings for which the predicate
    *  `p` returns `true`.
    *
    * @param p  The test predicate
    */
  def filterInPlace(p: (K, V) => Boolean): this.type = {
    if (nonEmpty) {
      val array = this.toArray[Any] // scala/bug#7269 toArray avoids ConcurrentModificationException
      val arrayLength = array.length
      var i = 0
      while (i < arrayLength) {
        val (k, v) = array(i).asInstanceOf[(K, V)]
        if (!p(k, v)) {
          this -= k
        }
        i += 1
      }
    }
    this
  }

  @deprecated("Use mapValuesInPlace instead", "2.13.0")
  @inline final def transform(f: (K, V) => V): this.type = mapValuesInPlace(f)

  /** Applies a transformation function to all values contained in this map.
    * The transformation function produces new values from existing keys
    * associated values.
    *
    * @param f  the transformation to apply
    * @return   the map itself.
    */
  def mapValuesInPlace(f: (K, V) => V): this.type = {
    iterator foreach {
      case (key, value) => update(key, f(key, value))
    }
    this
  }

  @deprecated("Use m.clone().addOne((k,v)) instead of m.updated(k, v)", "2.13.0")
  def updated[V1 >: V](key: K, value: V1): CC[K, V1] =
    clone().asInstanceOf[CC[K, V1]].addOne((key, value))

  override def knownSize: Int = super[IterableOps].knownSize
}

/**
  * $factoryInfo
  * @define coll mutable map
  * @define Coll `mutable.Map`
  */
@SerialVersionUID(3L)
object Map extends MapFactory.Delegate[Map](HashMap) {

  @SerialVersionUID(3L)
  class WithDefault[K, V](val underlying: Map[K, V], val defaultValue: K => V)
    extends AbstractMap[K, V]
      with MapOps[K, V, Map, WithDefault[K, V]] with Serializable {

    override def default(key: K): V = defaultValue(key)

    def iterator: scala.collection.Iterator[(K, V)] = underlying.iterator
    override def isEmpty: Boolean = underlying.isEmpty
    override def knownSize: Int = underlying.knownSize
    override def mapFactory: MapFactory[Map] = underlying.mapFactory

    override def clear(): Unit = underlying.clear()

    def get(key: K): Option[V] = underlying.get(key)

    def subtractOne(elem: K): WithDefault.this.type = { underlying.subtractOne(elem); this }

    def addOne(elem: (K, V)): WithDefault.this.type = { underlying.addOne(elem); this }

    override def concat[V2 >: V](suffix: collection.IterableOnce[(K, V2)]): Map[K, V2] =
      underlying.concat(suffix).withDefault(defaultValue)

    override def empty: WithDefault[K, V] = new WithDefault[K, V](underlying.empty, defaultValue)

    override protected def fromSpecific(coll: scala.collection.IterableOnce[(K, V)]): WithDefault[K, V] =
      new WithDefault[K, V](mapFactory.from(coll), defaultValue)

    override protected def newSpecificBuilder: Builder[(K, V), WithDefault[K, V]] =
      Map.newBuilder.mapResult((p: Map[K, V]) => new WithDefault[K, V](p, defaultValue))
  }

}

/** Explicit instantiation of the `Map` trait to reduce class file size in subclasses. */
@SerialVersionUID(3L)
abstract class AbstractMap[K, V] extends scala.collection.AbstractMap[K, V] with Map[K, V]


text:
<?php

    include 'settings.php';
    include 'functions.php';

    // get store id
    $store_id = $_GET['store_id'];

    // get store object by id
    $store_json = download_page(API_URL . "/stores/$store_id");
    $store = json_decode($store_json);


text:
vagrant-fs-cooker
===

[![GitHub release](https://img.shields.io/github/release/dbaba/vagrant-fs-cooker.svg)](https://github.com/dbaba/vagrant-fs-cooker/releases/latest)
[![License MIT](https://img.shields.io/github/license/dbaba/vagrant-fs-cooker.svg)](http://opensource.org/licenses/MIT)

A file system (e.g. ext4) image cooking tool on Vagrant box.

## Prerequisites

1. Vagrant 1.8.1+
1. VirtualBox 5+
1. Git
1. Internet Connection

## Installation

```bash
$ git clone https://github.com/dbaba/vagrant-fs-cooker.git
$ cd vagrant-fs-cooker
```

### Starting without Auto-Conf Script

```bash
$ vagrant up && vagrant ssh
```

### Starting with Auto-Conf Script

```bash
$ cp /path/to/your/auto_conf.sh .
$ vagrant up
```
The instance will be terminated automatically when the script finishes with exit code 0.

### Discarding VM

```bash
$ vagrant destroy -f
```

## Examples

 * [docker-edison-yocto](https://github.com/dbaba/docker-edison-yocto) ... A docker image building script to create a poky-yocto edison image

## Revision History
* 1.1.0
  - Update vagrant box image

* 1.0.1
  - Fix an issue where setup.sh always ignored AUTO_CONF_SCRIPT

* 1.0.0
  - Initial Release


text:
START_ATF_NAMESPACE
    struct _RENAME_POTION_USE_INFO
    {
        _STORAGE_POS_INDIV ItemInfo;
        char wszChangeName[17];
    public:
        void Init();
        _RENAME_POTION_USE_INFO();
        void ctor__RENAME_POTION_USE_INFO();
    };
    static_assert(ATF::checkSize<_RENAME_POTION_USE_INFO, 21>(), "_RENAME_POTION_USE_INFO");
END_ATF_NAMESPACE


text:
package com.shmup.hiscores.ui.score.add;

import android.support.v4.app.Fragment;

import com.shmup.hiscores.scores.model.ScoreCardItem;
import com.shmup.hiscores.ui.score.add.options.SelectDifficultyFragment;
import com.shmup.hiscores.ui.score.add.options.SelectModeFragment;
import com.shmup.hiscores.ui.score.add.options.SelectPlatformFragment;
import com.shmup.hiscores.ui.score.add.options.SelectShipFragment;
import com.shmup.hiscores.ui.score.add.options.SelectStageFragment;

public class NextItemFragmentFactory {

    public static Fragment nextFragmentOf(ItemFragment from) {
        if (from instanceof SelectPlatformFragment) {
            return nextOfSelectPlatform(from.getItem());
        }
        if (from instanceof SelectModeFragment) {
            return nextOfSelectMode(from.getItem());
        }
        if (from instanceof SelectDifficultyFragment) {
            return nextOfSelectDifficulty(from.getItem());
        }
        if (from instanceof SelectShipFragment) {
            nextOfSelectShip(from.getItem());
        }
        return nextOfSelectStage(from.getItem());
    }

    private static Fragment nextOfSelectStage(ScoreCardItem item) {
        return ItemFragment.newInstance(item, TypeScoreFragment.class);
    }

    private static Fragment nextOfSelectShip(ScoreCardItem item) {
        if (item.getGame().hasStages()) {
            return ItemFragment.newInstance(item, SelectStageFragment.class);
        }
        return nextOfSelectStage(item);
    }

    private static Fragment nextOfSelectDifficulty(ScoreCardItem item) {
        if (item.getGame().hasShips()) {
            return ItemFragment.newInstance(item, SelectShipFragment.class);
        }
        return nextOfSelectShip(item);
    }

    private static Fragment nextOfSelectMode(ScoreCardItem item) {
        if (item.getGame().hasDifficulties()) {
            return ItemFragment.newInstance(item, SelectDifficultyFragment.class);
        }
        return nextOfSelectDifficulty(item);
    }

    private static Fragment nextOfSelectPlatform(ScoreCardItem item) {
        if (item.getGame().hasModes()) {
            return ItemFragment.newInstance(item, SelectModeFragment.class);
        }
        return nextOfSelectMode(item);
    }
}


text:
<Alloy>
	<Window id="win" class="hfill wfill vert" title="Product Form" navBarHidden="false" barColor="#75d0cb">
		<ActionBar platform="android" displayHomeAsUp="true" onHomeIconItemSelected="closeWindow" />
		<TextField id="textField" borderStyle="Ti.UI.INPUT_BORDERSTYLE_ROUNDED" color="#336699" class="wfill" hintText="Product Name" />
		<Button id="button" onClick="doAdd" title="ADD" class="button"/>
	</Window>
</Alloy>


text:
package com.microsoft.azure.management.appservice.v2016_08_01;

import com.microsoft.azure.arm.model.HasInner;
import com.microsoft.azure.management.appservice.v2016_08_01.implementation.HybridConnectionInner;
import com.microsoft.azure.arm.model.Indexable;
import com.microsoft.azure.arm.model.Refreshable;
import com.microsoft.azure.arm.model.Updatable;
import com.microsoft.azure.arm.model.Appliable;
import com.microsoft.azure.arm.model.Creatable;
import com.microsoft.azure.arm.resources.models.HasManager;
import com.microsoft.azure.management.appservice.v2016_08_01.implementation.AppServiceManager;

/**
 * Type representing HybridConnection.
 */
public interface HybridConnection extends HasInner<HybridConnectionInner>, Indexable, Refreshable<HybridConnection>, Updatable<HybridConnection.Update>, HasManager<AppServiceManager> {
    /**
     * @return the hostname value.
     */
    String hostname();

    /**
     * @return the id value.
     */
    String id();

    /**
     * @return the kind value.
     */
    String kind();

    /**
     * @return the name value.
     */
    String name();

    /**
     * @return the port value.
     */
    Integer port();

    /**
     * @return the relayArmUri value.
     */
    String relayArmUri();

    /**
     * @return the relayName value.
     */
    String relayName();

    /**
     * @return the sendKeyName value.
     */
    String sendKeyName();

    /**
     * @return the sendKeyValue value.
     */
    String sendKeyValue();

    /**
     * @return the serviceBusNamespace value.
     */
    String serviceBusNamespace();

    /**
     * @return the serviceBusSuffix value.
     */
    String serviceBusSuffix();

    /**
     * @return the type value.
     */
    String type();

    /**
     * The entirety of the HybridConnection definition.
     */
    interface Definition extends DefinitionStages.Blank, DefinitionStages.WithHybridConnectionNamespace, DefinitionStages.WithCreate {
    }

    /**
     * Grouping of HybridConnection definition stages.
     */
    interface DefinitionStages {
        /**
         * The first stage of a HybridConnection definition.
         */
        interface Blank extends WithHybridConnectionNamespace {
        }

        /**
         * The stage of the hybridconnection definition allowing to specify HybridConnectionNamespace.
         */
        interface WithHybridConnectionNamespace {
           /**
            * Specifies resourceGroupName, name, namespaceName.
            */
            WithCreate withExistingHybridConnectionNamespace(String resourceGroupName, String name, String namespaceName);
        }

        /**
         * The stage of the hybridconnection definition allowing to specify Hostname.
         */
        interface WithHostname {
            /**
             * Specifies hostname.
             */
            WithCreate withHostname(String hostname);
        }

        /**
         * The stage of the hybridconnection definition allowing to specify Kind.
         */
        interface WithKind {
            /**
             * Specifies kind.
             */
            WithCreate withKind(String kind);
        }

        /**
         * The stage of the hybridconnection definition allowing to specify Port.
         */
        interface WithPort {
            /**
             * Specifies port.
             */
            WithCreate withPort(Integer port);
        }

        /**
         * The stage of the hybridconnection definition allowing to specify RelayArmUri.
         */
        interface WithRelayArmUri {
            /**
             * Specifies relayArmUri.
             */
            WithCreate withRelayArmUri(String relayArmUri);
        }

        /**
         * The stage of the hybridconnection definition allowing to specify RelayName.
         */
        interface WithRelayName {
            /**
             * Specifies relayName.
             */
            WithCreate withRelayName(String relayName);
        }

        /**
         * The stage of the hybridconnection definition allowing to specify SendKeyName.
         */
        interface WithSendKeyName {
            /**
             * Specifies sendKeyName.
             */
            WithCreate withSendKeyName(String sendKeyName);
        }

        /**
         * The stage of the hybridconnection definition allowing to specify SendKeyValue.
         */
        interface WithSendKeyValue {
            /**
             * Specifies sendKeyValue.
             */
            WithCreate withSendKeyValue(String sendKeyValue);
        }

        /**
         * The stage of the hybridconnection definition allowing to specify ServiceBusNamespace.
         */
        interface WithServiceBusNamespace {
            /**
             * Specifies serviceBusNamespace.
             */
            WithCreate withServiceBusNamespace(String serviceBusNamespace);
        }

        /**
         * The stage of the hybridconnection definition allowing to specify ServiceBusSuffix.
         */
        interface WithServiceBusSuffix {
            /**
             * Specifies serviceBusSuffix.
             */
            WithCreate withServiceBusSuffix(String serviceBusSuffix);
        }

        /**
         * The stage of the definition which contains all the minimum required inputs for
         * the resource to be created (via {@link WithCreate#create()}), but also allows
         * for any other optional settings to be specified.
         */
        interface WithCreate extends Creatable<HybridConnection>, DefinitionStages.WithHostname, DefinitionStages.WithKind, DefinitionStages.WithPort, DefinitionStages.WithRelayArmUri, DefinitionStages.WithRelayName, DefinitionStages.WithSendKeyName, DefinitionStages.WithSendKeyValue, DefinitionStages.WithServiceBusNamespace, DefinitionStages.WithServiceBusSuffix {
        }
    }
    /**
     * The template for a HybridConnection update operation, containing all the settings that can be modified.
     */
    interface Update extends Appliable<HybridConnection>, UpdateStages.WithHostname, UpdateStages.WithKind, UpdateStages.WithPort, UpdateStages.WithRelayArmUri, UpdateStages.WithRelayName, UpdateStages.WithSendKeyName, UpdateStages.WithSendKeyValue, UpdateStages.WithServiceBusNamespace, UpdateStages.WithServiceBusSuffix {
    }

    /**
     * Grouping of HybridConnection update stages.
     */
    interface UpdateStages {
        /**
         * The stage of the hybridconnection update allowing to specify Hostname.
         */
        interface WithHostname {
            /**
             * Specifies hostname.
             */
            Update withHostname(String hostname);
        }

        /**
         * The stage of the hybridconnection update allowing to specify Kind.
         */
        interface WithKind {
            /**
             * Specifies kind.
             */
            Update withKind(String kind);
        }

        /**
         * The stage of the hybridconnection update allowing to specify Port.
         */
        interface WithPort {
            /**
             * Specifies port.
             */
            Update withPort(Integer port);
        }

        /**
         * The stage of the hybridconnection update allowing to specify RelayArmUri.
         */
        interface WithRelayArmUri {
            /**
             * Specifies relayArmUri.
             */
            Update withRelayArmUri(String relayArmUri);
        }

        /**
         * The stage of the hybridconnection update allowing to specify RelayName.
         */
        interface WithRelayName {
            /**
             * Specifies relayName.
             */
            Update withRelayName(String relayName);
        }

        /**
         * The stage of the hybridconnection update allowing to specify SendKeyName.
         */
        interface WithSendKeyName {
            /**
             * Specifies sendKeyName.
             */
            Update withSendKeyName(String sendKeyName);
        }

        /**
         * The stage of the hybridconnection update allowing to specify SendKeyValue.
         */
        interface WithSendKeyValue {
            /**
             * Specifies sendKeyValue.
             */
            Update withSendKeyValue(String sendKeyValue);
        }

        /**
         * The stage of the hybridconnection update allowing to specify ServiceBusNamespace.
         */
        interface WithServiceBusNamespace {
            /**
             * Specifies serviceBusNamespace.
             */
            Update withServiceBusNamespace(String serviceBusNamespace);
        }

        /**
         * The stage of the hybridconnection update allowing to specify ServiceBusSuffix.
         */
        interface WithServiceBusSuffix {
            /**
             * Specifies serviceBusSuffix.
             */
            Update withServiceBusSuffix(String serviceBusSuffix);
        }

    }
}


text:
// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.

#pragma once

#include "afxcontrolbarutil.h"
#include "afxbasepane.h"
#include "afxrecentdocksiteinfo.h"
#include "afxdragframeimpl.h"

#ifdef _AFX_PACKING
#pragma pack(push, _AFX_PACKING)
#endif

#ifdef _AFX_MINREBUILD
#pragma component(minrebuild, off)
#endif

#pragma warning( disable : 4100 34 )

/////////////////////////////////////////////////////////////////////////////
// CPane window

class CDockSite;
class CFrameWndEx;
class CDockingPanesRow;
class CPaneFrameWnd;
class CDockingManager;

// CS - change state status
typedef enum AFX_CS_STATUS
{
	CS_NOTHING,
	CS_DOCK_IMMEDIATELY,
	CS_DELAY_DOCK,
	CS_DELAY_DOCK_TO_TAB
};

static const DWORD AFX_DEFAULT_PANE_STYLE = AFX_CBRS_FLOAT | AFX_CBRS_CLOSE;
static const int AFX_DEFAULT_TOOLBAR_STYLE = (WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_HIDE_INPLACE);

/////////////////////////////////////////////////////////////////////////////
// CPane window

class CPane : public CBasePane
{
	friend class CPaneFrameWnd;
	friend class CMultiPaneFrameWnd;

	DECLARE_DYNCREATE(CPane)

// Construction
protected:
	CPane();

// Attributes
public:

	virtual BOOL CanBeDocked(CBasePane* pDockBar) const;
	virtual BOOL IsResizable() const { return FALSE; }
	virtual BOOL IsDragMode() const { return m_bDragMode; }
	virtual void GetMinSize(CSize& size) const { size = m_sizeMin; }

	AFX_IMPORT_DATA static BOOL m_bHandleMinSize;

	void SetMinSize(const CSize& size) { m_sizeMin = size; }
	virtual int GetMinLength() const { return IsHorizontal() ? 10 : 10; }
	virtual int GetResizeStep() const { return -1; }

	CPoint GetHotSpot() const { return m_dragFrameImpl.m_ptHot; }
	CPoint GetClientHotSpot() const { return m_ptClientHotSpot; }
	void SetClientHotSpot(const CPoint& ptNew) { m_ptClientHotSpot = ptNew; }

	virtual BOOL IsInFloatingMultiPaneFrameWnd() const { return FALSE; }

	virtual int GetAvailableExpandSize() const;
	virtual int GetAvailableStretchSize() const;

	virtual BOOL DoesAllowSiblingBars() const { return !m_bExclusiveRow; }

	bool IsLeftOf(CRect rect, bool bWindowRect = true) const;
	bool IsLastPaneOnLastRow() const;

	virtual BOOL IsTabbed() const;
	virtual void CopyState(CPane* pOrgBar);

	virtual BOOL AllowShowOnPaneMenu() const { return TRUE; }
	virtual void GetPaneName(CString& strName) const;

	CDockingPanesRow* GetDockSiteRow() const { return m_pDockBarRow; }
	void GetDockSiteRow(CDockingPanesRow* pRow) { m_pDockBarRow = pRow; }

	void GetVirtualRect(CRect& rectVirtual) const;
	void SetVirtualRect(const CRect& rect, BOOL bMapToParent = TRUE);
	void UpdateVirtualRect();
	void UpdateVirtualRect(CPoint ptOffset);
	void UpdateVirtualRect(CSize sizeNew);

	bool m_bDisableMove;
	BOOL m_bFirstInGroup;
	BOOL m_bLastInGroup;
	BOOL m_bActiveInGroup;

	virtual void SetActiveInGroup(BOOL bActive);

	virtual void SetExclusiveRowMode(BOOL bExclusive = TRUE) { m_bExclusiveRow = bExclusive; }
	virtual BOOL GetExclusiveRowMode() const { return m_bExclusiveRow; }

// Operations
public:
	virtual void PrepareToDock(CDockSite* pDockBar, AFX_DOCK_METHOD dockMethod);
	virtual BOOL DockPane(CBasePane* pDockBar, LPCRECT lpRect, AFX_DOCK_METHOD dockMethod);
	virtual BOOL DockByMouse(CBasePane* pDockBar);
	virtual BOOL DockToFrameWindow(DWORD dwAlignment, LPCRECT lpRect = NULL, DWORD dwDockFlags = DT_DOCK_LAST,
		CBasePane* pRelativeBar = NULL, int nRelativeIndex = -1, BOOL bOuterEdge = FALSE)
	{
		return FALSE;
	}

	virtual BOOL FloatPane(CRect rectFloat, AFX_DOCK_METHOD dockMethod = DM_UNKNOWN, bool bShow = true);
	virtual CSize CalcSize(BOOL bVertDock) {return CSize(0, 0);}

	BOOL MoveByAlignment(DWORD dwAlignment, int nOffset);
	virtual CSize MovePane(CRect rectNew, BOOL bForceMove, HDWP& hdwp);
	virtual int  StretchPaneDeferWndPos(int nStretchSize, HDWP& hdwp);

	virtual CPane* DockPaneStandard(BOOL& bWasDocked)
	{
		bWasDocked = FALSE;
		return this;
	}
	virtual AFX_CS_STATUS IsChangeState(int nOffset, CBasePane** ppTargetBar) const;

	virtual CPaneFrameWnd* CreateDefaultMiniframe(CRect rectInitial);

	virtual BOOL LoadState(LPCTSTR lpszProfileName = NULL, int nIndex = -1, UINT uiID = (UINT) -1);
	virtual BOOL SaveState(LPCTSTR lpszProfileName = NULL, int nIndex = -1, UINT uiID = (UINT) -1);

	virtual void SetDockState(CDockingManager* pDockManager);
	virtual void OnProcessDblClk();

	virtual BOOL OnBeforeFloat(CRect& rectFloat, AFX_DOCK_METHOD dockMethod);
	virtual void OnAfterFloat();

	virtual void UndockPane(BOOL bDelay = FALSE);

// Overrides
public:
	virtual BOOL Create(LPCTSTR lpszClassName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, DWORD dwControlBarStyle = AFX_DEFAULT_PANE_STYLE, CCreateContext* pContext = NULL);
	virtual BOOL CreateEx(DWORD dwStyleEx, LPCTSTR lpszClassName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, DWORD dwControlBarStyle = AFX_DEFAULT_PANE_STYLE, CCreateContext* pContext = NULL);

	virtual void OnBeforeChangeParent(CWnd* pWndNewParent, BOOL bDelay = FALSE);
	virtual void OnAfterChangeParent(CWnd* pWndOldParent);

	virtual void RecalcLayout();
	virtual CSize CalcAvailableSize(CRect rectRequired);

	void SetMiniFrameRTC(CRuntimeClass* pClass)	{m_pMiniFrameRTC = pClass;}

	virtual void AdjustSizeImmediate(BOOL bRecalcLayout = TRUE);

	virtual void ToggleAutoHide()	{}
	virtual void OnPressCloseButton();

	virtual BOOL CanBeTabbedDocument() const;
	virtual void ConvertToTabbedDocument(BOOL bActiveTabOnly = TRUE);

public:
	virtual BOOL OnShowControlBarMenu(CPoint point);

protected:
	virtual BOOL OnBeforeShowPaneMenu(CMenu& /*menu*/) { return TRUE; }
	virtual BOOL OnAfterShowPaneMenu(int nMenuResult) { return TRUE; }

	virtual void OnContinueMoving();
	virtual void OnDrawDragRect(LPCRECT /*lprectNew*/, LPCRECT /*lprectOld*/) {}

	virtual BOOL OnBeforeDock(CBasePane** ppDockBar, LPCRECT lpRect, AFX_DOCK_METHOD dockMethod);
	virtual void OnAfterDock(CBasePane* /*pBar*/, LPCRECT /*lpRect*/, AFX_DOCK_METHOD /*dockMethod*/) {}

	virtual void OnBeforeStretch(int& /*nStretchSize*/) {}
	virtual void OnAfterStretch(int /*nStretchSize*/) {}

	virtual void RemoveFromMiniframe(CWnd* pNewParent, AFX_DOCK_METHOD dockMethod);
	virtual void SetDragMode(BOOL bOnOff);

	virtual BOOL Dock(CBasePane* pDockBar, LPCRECT lpRect, AFX_DOCK_METHOD dockMethod);

	virtual void EnterDragMode(BOOL bChangeHotPoint);
	virtual void OnRTLChanged(BOOL bIsRTL);

	// Implementation
public:
	virtual ~CPane();

	//---------------------------------------------------------------------------------------------
	// FOR COMPATIBILITY with MFC's CControlBar:
	//----------------------------------------------------------------------------------------------
	void SetBorders(int cxLeft = 0, int cyTop = 0, int cxRight = 0, int cyBottom = 0);
	void SetBorders(LPCRECT lpRect);
	CRect GetBorders() const;

	// array of elements
	int m_nCount;
	void* m_pData;        // m_nCount elements - type depends on derived class

	// info about bar (for status bar and toolbar)
	int m_cxLeftBorder, m_cxRightBorder;
	int m_cyTopBorder, m_cyBottomBorder;
	int m_cxDefaultGap;         // default gap value
	int m_nMRUWidth;

	void CalcInsideRect(CRect& rect, BOOL bHorz) const; // adjusts borders etc
	BOOL AllocElements(int nElements, int cbElement);

	//----------------------------------------------------------------------------------------------
	// Generated message map functions
protected:
	//{{AFX_MSG(CPane)
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	afx_msg void OnNcDestroy();
	afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
	afx_msg void OnCancelMode();
	afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnDestroy();
	afx_msg void OnStyleChanged(int nStyleType, LPSTYLESTRUCT lpStyleStruct);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

	CRect  m_rectVirtual;
	CRect  m_rectDragImmediate;
	CSize  m_sizeMin;
	CPoint m_ptClientHotSpot;
	bool   m_bCaptured;
	bool   m_bDisableChangeHot;
	bool   m_bDblClick;
	BOOL   m_bDragMode;
	BOOL   m_bExclusiveRow;
	BOOL   m_bPinState;
	UINT   m_nID;
	HWND   m_hwndMiniFrameToBeClosed;

	CRuntimeClass* m_pMiniFrameRTC;
	CMFCDragFrameImpl m_dragFrameImpl;

//-----------------------------------------------
//  Recent dock/float state
//-----------------------------------------------
public:
	CRecentDockSiteInfo m_recentDockInfo;
	CRect m_rectSavedDockedRect; // in client coordinates

	BOOL m_bRecentFloatingState;
	BOOL m_bWasFloatingBeforeMove;
	BOOL m_bWasFloatingBeforeTabbed;

	void SetRecentTabWindowInfo(DWORD dwFrameAlignment, const CList<UINT, UINT&>& lstSiblingBars);
	void CalcRecentDockedRect();

protected:
	virtual void StoreRecentDockSiteInfo();
//-----------------------------------------------
};

_inline BOOL CPane::CanBeDocked(CBasePane* pDockBar) const
{
	ASSERT_VALID(this);
	return ((GetEnabledAlignment() & pDockBar->GetCurrentAlignment()) != 0);
}

#pragma warning( default : 4100 34 )

#ifdef _AFX_MINREBUILD
#pragma component(minrebuild, on)
#endif

#ifdef _AFX_PACKING
#pragma pack(pop)
#endif


text:
describe("Create dialog", function() {

  var view, user;

  afterEach(function() {
    view.clean();
  });

  beforeEach(function() {
    user = TestUtil.createUser('test');

    // Create a new dialog
    view = new cdb.common.CreateDialog({
      user:   user,
      data:   {},
      tabs:   ['layer', 'file', 'gdrive', 'dropbox', 'twitter', 'scratch', 'arcgis', 'success', 'error'],
      option: 'file',
      where:  'table'
    })
  });

  it('should render properly', function() {
    view.render();
    expect(view.$('.create-dialog-content').length).toBe(1);
    expect(view.$('.create-tab').length).toBe(9);
    expect(view.$('.create-panes > .import-pane').length).toBe(2); // Gdrive, dropbox, arcgis and twitter will be disabled
    expect(view.$('.create-panes .create-success').length).toBe(1);
    expect(view.$('.create-panes .create-error').length).toBe(1);
    expect(view.$('.create-panes .create-empty').length).toBe(1);
    expect(view.$('.create-progress').length).toBe(1);
  });

  it('should enable/disable "service panes" when user changes keys', function() {
    view.render();

    // Failed tabs
    expect(view.$('.create-tab.dropbox > a').hasClass('disabled')).toBeTruthy();
    expect(view.$('.create-tab.gdrive > a').hasClass('disabled')).toBeTruthy();
    expect(view.$('.import-service-pane').length).toBe(0);

    cdb.config.set({
      oauth_dropbox: true,
      oauth_gdrive: true
    });

    view.render();

    expect(view.$('.create-tab.gdrive > a').hasClass('disabled')).toBeFalsy();
    expect(view.$('.create-tab.dropbox > a').hasClass('disabled')).toBeFalsy();
    expect(view.$('.import-service-pane').length).toBe(2);
    expect(view.$('.create-panes > .import-pane').length).toBe(4);
  });

  it('should enable/disable "twitter pane" when user does not have enough rights', function() {
    cdb.config.set('datasource_search_twitter', 'asdf');

    user.set('twitter', { enabled: false });

    view.render();

    // Show message pane when user clicks over twitter tab
    expect(view.$('.create-tab.twitter > a').hasClass('disabled')).toBeFalsy();
    expect(view.$('.import-twitter-pane').length).toBe(0);
    expect(view.$('.twitter-message-pane').length).toBe(1);

    user.set('twitter', {
      enabled: true,
      block_price: null,
      block_size: null,
      hard_limit: true,
      monthly_use: 0,
      quota: 100000
    });

    // Without this the custom date picker throws an error, since it internally has a setTimeout to initialize the
    // date picker, this breaks because some (unrelated to this test) prerequisities are not there (DOM elements).
    // See line ~60-65 in custom_datepicker.js
    spyOn(window, 'setTimeout');

    view.render();

    expect(view.$('.create-tab.twitter > a').hasClass('disabled')).toBeFalsy();
    expect(view.$('.import-twitter-pane').length).toBe(1);
  });

  it('should disable "creation panes" when user has reached the limits', function() {
    cdb.config.set({
      oauth_dropbox: true,
      oauth_gdrive: true,
      datasource_search_twitter: true
    });

    // Infinite tables and bytes quota
    user.set({
      twitter: { enabled:false },
      table_quota: null,
      remaining_table_quota: 8,
      quota_in_bytes: null,
      remaining_byte_quota: 1000
    });
    view.render();
    expect(view.$('.create-tab > a.disabled').length).toBe(0);

    // Normal quota
    user.set({
      table_quota: 10,
      remaining_table_quota: 8,
      quota_in_bytes: 1024,
      remaining_byte_quota: 1000
    });
    view.render();
    expect(view.$('.create-tab > a.disabled').length).toBe(0);

    // Reaching one limit
    user.set({
      table_quota: 10,
      remaining_table_quota: 2,
      quota_in_bytes: 1024,
      remaining_byte_quota: -100
    });
    view.render();
    expect(view.$('.create-tab > a.disabled').length).toBe(6);

    // Reaching both limits
    user.set('remaining_table_quota', 0);
    view.render();
    expect(view.$('.create-tab > a.disabled').length).toBe(6);

    // Infinite with reaching limit
    user.set({
      table_quota: null,
      remaining_table_quota: 2,
      quota_in_bytes: 909090,
      remaining_byte_quota: -100
    });
    view.render();
    expect(view.$('.create-tab > a.disabled').length).toBe(6);
  });

  it('should activate the selected tab from the beginning', function() {
    view.render();

    expect(view.$('.create-tab a.file').hasClass('selected')).toBeTruthy();
    expect(view.$('.create-tab a.selected').length).toBe(1);

    var view2 = new cdb.common.CreateDialog({
      user:   user,
      data:   {},
      tabs:   ['layer', 'file', 'gdrive', 'dropbox', 'twitter', 'scratch', 'arcgis', 'success', 'error'],
      option: 'arcgis',
      where:  'tables'
    }).render();

    expect(view2.$('.create-tab a.arcgis').hasClass('selected')).toBeTruthy();
    expect(view2.$('.create-tab a.selected').length).toBe(1);
  });

  it('should not have leaks', function() {
    expect(view).toHaveNoLeaks();
  });

});


text:
package org.carrot2.util.tests;

import java.lang.annotation.*;

import com.carrotsearch.randomizedtesting.annotations.TestGroup;

/**
 * A test group that indicates a given test uses external APIs or services (some of which
 * may not be available outside of the scope of Carrot2 build servers).
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.TYPE})
@Inherited
@TestGroup(enabled = false, sysProperty="tests.externalservices")
public @interface UsesExternalServices
{
}