text:
package org.apache.hadoop.hdds.scm.node;

import org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.NodeReportProto;
import org.apache.hadoop.hdds.scm.container.ContainerID;
import org.apache.hadoop.hdds.scm.container.common.helpers.Pipeline;
import org.apache.hadoop.hdds.scm.container.common.helpers.PipelineID;
import org.apache.hadoop.hdds.scm.container.placement.metrics.SCMNodeMetric;
import org.apache.hadoop.hdds.scm.container.placement.metrics.SCMNodeStat;
import org.apache.hadoop.hdds.scm.exceptions.SCMException;
import org.apache.hadoop.hdds.scm.node.states.NodeNotFoundException;
import org.apache.hadoop.hdds.protocol.DatanodeDetails;
import org.apache.hadoop.hdds.protocol.proto.HddsProtos.NodeState;
import org.apache.hadoop.hdds.scm.node.states.ReportResult;
import org.apache.hadoop.hdds.server.events.EventHandler;
import org.apache.hadoop.ozone.protocol.StorageContainerNodeProtocol;
import org.apache.hadoop.ozone.protocol.commands.CommandForDatanode;
import org.apache.hadoop.ozone.protocol.commands.SCMCommand;

import java.io.Closeable;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;

/**
 * A node manager supports a simple interface for managing a datanode.
 *

 * 1. A datanode registers with the NodeManager.
 *

 * 2. If the node is allowed to register, we add that to the nodes that we need
 * to keep track of.
 *

 * 3. A heartbeat is made by the node at a fixed frequency.
 *

 * 4. A node can be in any of these 4 states: {HEALTHY, STALE, DEAD,
 * DECOMMISSIONED}
 *

 * HEALTHY - It is a datanode that is regularly heartbeating us.
 *
 * STALE - A datanode for which we have missed few heart beats.
 *
 * DEAD - A datanode that we have not heard from for a while.
 *
 * DECOMMISSIONED - Someone told us to remove this node from the tracking
 * list, by calling removeNode. We will throw away this nodes info soon.
 */
public interface NodeManager extends StorageContainerNodeProtocol,
    EventHandler<CommandForDatanode>, NodeManagerMXBean, Closeable {
  /**
   * Removes a data node from the management of this Node Manager.
   *
   * @param node - DataNode.
   * @throws NodeNotFoundException
   */
  void removeNode(DatanodeDetails node) throws NodeNotFoundException;

  /**
   * Gets all Live Datanodes that is currently communicating with SCM.
   * @param nodeState - State of the node
   * @return List of Datanodes that are Heartbeating SCM.
   */
  List<DatanodeDetails> getNodes(NodeState nodeState);

  /**
   * Returns the Number of Datanodes that are communicating with SCM.
   * @param nodeState - State of the node
   * @return int -- count
   */
  int getNodeCount(NodeState nodeState);

  /**
   * Get all datanodes known to SCM.
   *
   * @return List of DatanodeDetails known to SCM.
   */
  List<DatanodeDetails> getAllNodes();

  /**
   * Returns the aggregated node stats.
   * @return the aggregated node stats.
   */
  SCMNodeStat getStats();

  /**
   * Return a map of node stats.
   * @return a map of individual node stats (live/stale but not dead).
   */
  Map<UUID, SCMNodeStat> getNodeStats();

  /**
   * Return the node stat of the specified datanode.
   * @param datanodeDetails DatanodeDetails.
   * @return node stat if it is live/stale, null if it is decommissioned or
   * doesn't exist.
   */
  SCMNodeMetric getNodeStat(DatanodeDetails datanodeDetails);

  /**
   * Returns the node state of a specific node.
   * @param datanodeDetails DatanodeDetails
   * @return Healthy/Stale/Dead.
   */
  NodeState getNodeState(DatanodeDetails datanodeDetails);

  /**
   * Get set of pipelines a datanode is part of.
   * @param dnId - datanodeID
   * @return Set of PipelineID
   */
  Set<PipelineID> getPipelineByDnID(UUID dnId);

  /**
   * Add pipeline information in the NodeManager.
   * @param pipeline - Pipeline to be added
   */
  void addPipeline(Pipeline pipeline);

  /**
   * Remove a pipeline information from the NodeManager.
   * @param pipeline - Pipeline to be removed
   */
  void removePipeline(Pipeline pipeline);

  /**
   * Update set of containers available on a datanode.
   * @param uuid - DatanodeID
   * @param containerIds - Set of containerIDs
   * @throws SCMException - if datanode is not known. For new datanode use
   *                        addDatanodeInContainerMap call.
   */
  void setContainersForDatanode(UUID uuid, Set<ContainerID> containerIds)
      throws SCMException;

  /**
   * Process containerReport received from datanode.
   * @param uuid - DataonodeID
   * @param containerIds - Set of containerIDs
   * @return The result after processing containerReport
   */
  ReportResult<ContainerID> processContainerReport(UUID uuid,
      Set<ContainerID> containerIds);

  /**
   * Return set of containerIDs available on a datanode.
   * @param uuid - DatanodeID
   * @return - set of containerIDs
   */
  Set<ContainerID> getContainers(UUID uuid);

  /**
   * Insert a new datanode with set of containerIDs for containers available
   * on it.
   * @param uuid - DatanodeID
   * @param containerIDs - Set of ContainerIDs
   * @throws SCMException - if datanode already exists
   */
  void addDatanodeInContainerMap(UUID uuid, Set<ContainerID> containerIDs)
      throws SCMException;

  /**
   * Add a {@link SCMCommand} to the command queue, which are
   * handled by HB thread asynchronously.
   * @param dnId datanode uuid
   * @param command
   */
  void addDatanodeCommand(UUID dnId, SCMCommand command);

  /**
   * Process node report.
   *
   * @param dnUuid
   * @param nodeReport
   */
  void processNodeReport(UUID dnUuid, NodeReportProto nodeReport);

  /**
   * Process a dead node event in this Node Manager.
   *
   * @param dnUuid datanode uuid.
   */
  void processDeadNode(UUID dnUuid);

  /**
   * Get list of SCMCommands in the Command Queue for a particular Datanode.
   * @param dnID - Datanode uuid.
   * @return list of commands
   */
  List<SCMCommand> getCommandQueue(UUID dnID);
}


text:
<?php

namespace Centreon\Test\Api\Context;

use Centreon\Test\Behat\Api\Context\ApiContext;

class HostGroupContext extends ApiContext
{
}

redpajama_set_name: RedPajamaGithub


text:
#include "StdAfx.h"

#include "utf8/utf8.h"

#include "Conversation.h"
#include "FmtTextDecor.h"
#include "Level.h"
#include "LevelDecor.h"
#include "PagedTextDecor.h"
#include "Player.h"
#include "ResStr.h"
#include "SpriteMap.h"

#include "TextInputScene.h"

namespace AISDL {

TextInputScene::TextInputScene(Director &director, Display &display) :
	SUPER(director, display, "Introduction")
{
}

TextInputScene::~TextInputScene()
{
}

void TextInputScene::UpdatePlayerName()
{
	playerNameTxt->SetText(playerName);

	// Note when the last input event occurred so we can keep the cursor
	// visible.
	lastInputTs = SDL_GetTicks();
}

void TextInputScene::OnKeyDown(SDL_KeyboardEvent &evt)
{
	if (evt.keysym.sym == SDLK_BACKSPACE) {
		if (!playerName.empty()) {
			// Find the last UTF-8 character sequence and remove it.
			auto iter = playerName.end();
			utf8::prior(iter, playerName.begin());
			playerName.erase(iter, playerName.end());

			UpdatePlayerName();
		}
	}
}

/**
 * Handle when the OS-native text input appends text.
 * @param evt The event.
 */
void TextInputScene::OnTextInput(SDL_TextInputEvent &evt)
{
	playerName += evt.text;
	UpdatePlayerName();
}

/**
 * Handle when the OS-native composition system changes.
 * @param evt The event.
 */
void TextInputScene::OnTextEditing(SDL_TextEditingEvent &evt)
{
	//TODO
	// This can get a bit... interesting, so we're leaving it out for now.
	// See: http://wiki.libsdl.org/Tutorials/TextInput
}

void TextInputScene::OnWalkOffEdgeLeft(std::shared_ptr<Player> player)
{
	player->SetPos(511, player->GetPosY());
}

void TextInputScene::OnWalkOffEdgeRight(std::shared_ptr<Player> player)
{
	player->SetPos(-31, player->GetPosY());
}

void TextInputScene::OnInteract()
{
	if (phase == 0) {
		convo->Next();
	}
}

void TextInputScene::OnAction()
{
	switch (phase) {
	case 0:
		if (!inputTxt->NextPage(PagedTextDecor::Anim::FLING_UP)) {
			phase++;

			fadeTs = SDL_GetTicks();

			introTxt->FirstPage(PagedTextDecor::Anim::TYPEWRITER);

			auto player = director.GetMainPlayer();
			player->Silence();
			player->SetDirection(Player::Direction::DOWN);
			player->SetPos(256 - 16, 384 / 3);  // Centered on the screen.

			SDL_Log("Starting Unicode text input.");
			SDL_StartTextInput();
		}
		break;
	case 1:
		director.RequestNextScene();
		break;
	}
}

void TextInputScene::Preload()
{
	SUPER::Preload();

	level = Level::Load(display.res.resDir + "/levels/intro");
	levelDecor.reset(new LevelDecor(display, level, display.res.interiorTile));

	const std::string dir = display.res.resDir + "/text/textinput/";
	convo.reset(new Conversation(ResStr::Load(dir + "dialog.txt")));
	inputTxt.reset(new PagedTextDecor(display, display.res.bodyFont,
		ResStr::Load(dir + "input.txt"), 864));
	introTxt.reset(new PagedTextDecor(display, display.res.pixelFont,
		ResStr::Load(dir + "intro.txt"), 432));
}

void TextInputScene::Reload()
{
	SUPER::Reload();

	level->Reload();
}

void TextInputScene::Reset()
{
	SUPER::Reset();

	phase = 0;

	//FIXME: The current pixelFont does not have some of the Unicode characters
	//       we'd like to have.
	playerName = "Ulric of Cogito";
	playerNameTxt.reset(new FmtTextDecor(display, display.res.bodyFont,
		playerName, 512));
	UpdatePlayerName();

	inputTxt->FirstPage(PagedTextDecor::Anim::FLING_UP);

	auto player = director.GetMainPlayer();
	player->SetPos(40, 320);
	convo->Start(player);
}

void TextInputScene::Cleanup()
{
	playerNameTxt.reset();

	SDL_Log("Stopping Unicode text input.");
	SDL_StopTextInput();
}

void TextInputScene::HandleEvent(SDL_Event &evt)
{
	switch (evt.type) {
	case SDL_KEYDOWN:
		OnKeyDown(evt.key);
		break;
	case SDL_TEXTINPUT:
		OnTextInput(evt.text);
		break;
	case SDL_TEXTEDITING:
		OnTextEditing(evt.edit);
		break;
	}
}

void TextInputScene::Advance(Uint32 lastTick, Uint32 tick)
{
	SUPER::Advance(lastTick, tick);

	switch (phase) {
	case 0:
		inputTxt->Advance(tick);
		break;
	case 1:
		{
			Uint32 timeDiff = tick - fadeTs;
			if (timeDiff <= 1000) {
				fadeAlpha = timeDiff * 127 / 1000;
			}
		}
		introTxt->Advance(tick);
		playerNameCursor = ((lastInputTs - tick) % 1000) < 500;
		break;
	}
}

void TextInputScene::RenderContent()
{
	SDL_SetRenderDrawColor(display.renderer, 0x00, 0x00, 0x00, 0xff);
	SDL_RenderClear(display.renderer);

	display.SetLowRes();
	levelDecor->Render();

	if (phase == 1) {
		SDL_SetRenderDrawBlendMode(display.renderer, SDL_BLENDMODE_BLEND);
		SDL_SetRenderDrawColor(display.renderer, 0, 0, 0, fadeAlpha);
		SDL_Rect fillRect = { 0, 0, 512, 384 };
		SDL_RenderFillRect(display.renderer, &fillRect);
	}

	SUPER::RenderContent();

	display.SetLowRes();

	switch (phase) {
	case 0:
		display.SetHighRes();
		inputTxt->Render(80, 40);
		break;
	case 1:
		{
			int introTxtWidth = introTxt->MeasureWidth();
			introTxt->Render(256 - (introTxtWidth / 2), 40);

			// Draw the text input area.
			display.SetHighRes();
			int playerNameTxtWidth = playerNameTxt->MeasureWidth();
			playerNameTxt->Render(512 - (playerNameTxtWidth / 2), 160, 255,
				playerNameCursor);
		}
		break;
	}

}

}  // namespace AISDL


text:
@implementation RxQueue {
    NSMutableArray *__nonnull _storage;
    NSUInteger _initialCapacity;
    NSUInteger _resizeFactor;
    NSUInteger _pushNextIndex;
    NSUInteger _count;
}

- (nonnull instancetype)init {
    return [self initWithCapacity:0];
}

- (nonnull instancetype)initWithCapacity:(NSUInteger)capacity {
    self = [super init];
    if (self) {
        _count = 0;
        _resizeFactor = 2;
        _pushNextIndex = 0;
        _initialCapacity = capacity;
        _storage = [NSMutableArray arrayWithCapacity:capacity];
        for (NSUInteger i = 0; i < capacity; i++) {
            [_storage addObject:[RxNil null]];
        }
    }
    return self;
}

- (NSUInteger)dequeueIndex {
    NSInteger index = _pushNextIndex - _count;
    return index < 0 ? index + _storage.count
                     : (NSUInteger) index;
}

- (BOOL)isEmpty {
    return _storage.count == 0;
}

- (NSUInteger)count {
    return _count;
}

- (nullable id)peek {
    return _storage[self.dequeueIndex];
}

- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id __unsafe_unretained[])buffer count:(NSUInteger)len {
    return [_storage countByEnumeratingWithState:state objects:buffer count:len];
}

- (void)resizeTo:(NSUInteger)size {
    NSMutableArray<id> *newStorage = [NSMutableArray arrayWithCapacity:size];
    for (NSUInteger i = 0; i < size; i++) {
        [newStorage addObject:[RxNil null]];
    }

    NSUInteger count = _count;

    NSUInteger dequeueIndex = self.dequeueIndex;
    NSUInteger spaceToEndOfQueue = _storage.count - dequeueIndex;

    // first batch is from dequeue index to end of array
    NSUInteger countElementsInFirstBatch = MIN(count, spaceToEndOfQueue);
    // second batch is wrapped from start of array to end of queue
    NSUInteger numberOfElementsInSecondBatch = count - countElementsInFirstBatch;

    for (NSUInteger i = 0, dequeueIndexIt = dequeueIndex;
         i < countElementsInFirstBatch && dequeueIndexIt < (dequeueIndex + countElementsInFirstBatch);
         i++, dequeueIndexIt++) {
        newStorage[i] = _storage[dequeueIndexIt];
    }
    for (NSUInteger countElementsInFirstBatchIt = countElementsInFirstBatch, i = 0;
         countElementsInFirstBatchIt < (countElementsInFirstBatch + numberOfElementsInSecondBatch) && i < numberOfElementsInSecondBatch;
         countElementsInFirstBatchIt++, i++) {
        newStorage[countElementsInFirstBatchIt] = _storage[i];
    }

    @synchronized (self) {
        _count = count;
        _pushNextIndex = count;
        _storage = newStorage;
    }
}

- (void)enqueue:(nonnull id)element {
    if (self.count == _storage.count) {
        [self resizeTo:MAX(_storage.count, 1) * _resizeFactor];
    }

    @synchronized (self) {
        _storage[_pushNextIndex] = element;
        _pushNextIndex += 1;
        _count += 1;
    }

    if (_pushNextIndex >= _storage.count) {
        _pushNextIndex -= _storage.count;
    }
}

- (nonnull id)dequeueElementOnly {
    NSUInteger index = [self dequeueIndex];
    id element = _storage[index];
    @synchronized (self) {
        _storage[index] = [RxNil null];
        _count -= 1;
    }
    return element;
}

- (nullable id)dequeue {
    if (self.count == 0) {
        return nil;
    }

    id element = [self dequeueElementOnly];

    float downsizeLimit = _storage.count / (_resizeFactor * _resizeFactor);
    if (_count < downsizeLimit && downsizeLimit >= _initialCapacity) {
        [self resizeTo:_storage.count / _resizeFactor];
    }

    return element;
}

- (nonnull NSArray<id> *)array {
    NSMutableArray<id> *array = [NSMutableArray arrayWithCapacity:_count];
    for (NSUInteger i = [self dequeueIndex], count = _count; count > 0; i++, count--) {
        if (i >= _storage.count) {
            i -= _storage.count;
        }
        [array addObject:_storage[i]];
    }
    return [array copy];
}

@end


text:
void _my_assert(const char *func, const char* file, const int line, const int abort_all, const char *string)
{
  fprintf(stderr, "%s(%s:%d) %s\n", func, file, line, string);
  if(abort_all)
    exit(1);
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

 -->

<!--  These resources are around just to allow their values to be customized
     for different hardware and product builds.  -->

<resources xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
  <string-array name="wfcOperatorErrorAlertMessages">
    <item msgid="5217754856196352581">"如要透過 Wi-Fi 撥打電話及傳送訊息,請先要求您的行動通訊業者開通這項服務,然後再到「設定」啟用 Wi-Fi 通話功能。"</item>
  </string-array>
  <string-array name="wfcOperatorErrorNotificationMessages">
    <item msgid="4688475512286389971">"向您的行動通訊業者註冊"</item>
  </string-array>
    <string name="wfcSpnFormat" msgid="5475635312889002673">"%s Wi-Fi 通話"</string>
</resources>


text:
package com.msi.tough.cf.elasticache;

import com.msi.tough.cf.CFType;

public class SecurityGroupIngressType extends CFType {
	@Override
	public Object ref() {
		return getName();
	}
}


text:
<?php

namespace Sylius\Bundle\ThemeBundle\Form\Type;

use Sylius\Bundle\ThemeBundle\Model\ThemeInterface;
use Sylius\Bundle\ThemeBundle\Repository\ThemeRepositoryInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
 * @author Kamil Kokot <kamil.kokot@lakion.com>
 */
final class ThemeChoiceType extends AbstractType
{
    /**
     * @var ThemeRepositoryInterface
     */
    private $themeRepository;

    /**
     * @param ThemeRepositoryInterface $themeRepository
     */
    public function __construct(ThemeRepositoryInterface $themeRepository)
    {
        $this->themeRepository = $themeRepository;
    }

    /**
     * {@inheritdoc}
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        // Normalizer instead of default as it should not be overwritten
        $resolver
            ->setNormalizer('choices', function () {
                return $this->themeRepository->findAll();
            })
            ->setNormalizer('choices_as_values', function () {
                return true;
            })
            ->setDefault('choice_label', function (ThemeInterface $theme) {
                return (string) $theme;
            })
        ;
    }

    /**
     * {@inheritdoc}
     */
    public function getParent()
    {
        return 'choice';
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return 'sylius_theme_choice';
    }
}


text:
package graphene.model.idlhelper;

import graphene.model.idl.G_BoundedRange;
import graphene.model.idl.G_Constraint;
import graphene.model.idl.G_ListRange;
import graphene.model.idl.G_PropertyMatchDescriptor;
import graphene.model.idl.G_PropertyType;
import graphene.model.idl.G_SingletonRange;

import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

public class PropertyMatchDescriptorHelper extends G_PropertyMatchDescriptor {

	public static PropertyMatchDescriptorHelper from(final G_PropertyMatchDescriptor descriptor) {
		if (descriptor instanceof PropertyMatchDescriptorHelper) {
			return (PropertyMatchDescriptorHelper) descriptor;
		}

		final PropertyMatchDescriptorHelper helper = new PropertyMatchDescriptorHelper();
		helper.setKey(descriptor.getKey());
		helper.setConstraint(descriptor.getConstraint());
		helper.setVariable(descriptor.getVariable());
		helper.setInclude(descriptor.getInclude());
		helper.setRange(descriptor.getRange());
		return helper;
	}

	public static G_PropertyMatchDescriptor fromJson(final String json) throws IOException {
		return SerializationHelper.fromJson(json, G_PropertyMatchDescriptor.getClassSchema());
	}

	/**
	 * Returns true if the match descriptor is exclusive, accounting for both
	 * the include property and the NOT constraint.
	 *
	 * Match descriptors have a NOT constraint which is redundant with the
	 * include boolean for searches other than pattern searches. Here we
	 * interpret "NOT exclude" as "NOT/exclude", since otherwise the criteria
	 * would have no effect at all.
	 *
	 * @param descriptor
	 *            The match specification
	 *
	 * @return true if an exclusion
	 */
	public static boolean isExclusion(final G_PropertyMatchDescriptor descriptor) {
		return G_Constraint.NOT.equals(descriptor.getConstraint()) || !descriptor.getInclude();
	}

	public static List<G_PropertyMatchDescriptor> listFromJson(final String json) throws IOException {
		return SerializationHelper.listFromJson(json, G_PropertyMatchDescriptor.getClassSchema());
	}

	public static Map<String, List<G_PropertyMatchDescriptor>> mapFromJson(final String json) throws IOException {
		return SerializationHelper.mapFromJson(json, G_PropertyMatchDescriptor.getClassSchema());
	}

	/**
	 * Returns an G_*Range Object representing a set of basic string terms
	 *
	 * @param terms
	 *            the terms to represent
	 * @return an G_*Range Object - either a singleton or list
	 */
	public static Object rangeFromBasicTerms(final String terms) {

		// if quoted, return as one term
		if (terms.charAt(0) == '"') {
			final int end = terms.length() - (terms.charAt(terms.length() - 1) == '"' ? 1 : 0);

			return G_SingletonRange.newBuilder().setType(G_PropertyType.STRING).setValue(terms.substring(1, end))
					.build();
		}

		final String tokens[] = terms.split("\\s+");

		// else break by whitespace
		switch (tokens.length) {
		case 0:
			return null;

		case 1:
			return G_SingletonRange.newBuilder().setType(G_PropertyType.STRING).setValue(tokens[0]).build();

		default:
			return G_ListRange.newBuilder().setType(G_PropertyType.STRING)
					.setValues(Arrays.asList(Arrays.copyOf(tokens, tokens.length, Object[].class))).build();
		}
	}

	public static String toJson(final G_PropertyMatchDescriptor descriptor) throws IOException {
		return SerializationHelper.toJson(descriptor);
	}

	public static String toJson(final List<G_PropertyMatchDescriptor> descriptors) throws IOException {
		return SerializationHelper.toJson(descriptors, G_PropertyMatchDescriptor.getClassSchema());
	}

	public static String toJson(final Map<String, List<G_PropertyMatchDescriptor>> map) throws IOException {
		return SerializationHelper.toJson(map, G_PropertyMatchDescriptor.getClassSchema());
	}

	public PropertyMatchDescriptorHelper() {
		// TODO Auto-generated constructor stub
	}

	public PropertyMatchDescriptorHelper(final String key, final String singletonString) {
		setKey(key);
		setRange(new SingletonRangeHelper(singletonString, G_PropertyType.STRING));
		setConstraint(G_Constraint.REQUIRED_EQUALS);
	}

	public PropertyMatchDescriptorHelper(final String key, final String... singletonString) {
		setKey(key);
		setRange(new ListRangeHelper(singletonString, G_PropertyType.STRING));
		setConstraint(G_Constraint.REQUIRED_EQUALS);
	}

	public G_PropertyType getType() {
		final Object range = getRange();
		if (range instanceof G_SingletonRange) {
			return ((G_SingletonRange) range).getType();
		} else if (range instanceof G_ListRange) {
			return ((G_ListRange) range).getType();
		} else if (range instanceof G_BoundedRange) {
			return ((G_BoundedRange) range).getType();
		}
		return null;
	}

	public Object getValue() {
		final Object range = getRange();
		if (range instanceof G_SingletonRange) {
			return ((G_SingletonRange) range).getValue();
		} else if (range instanceof G_ListRange) {
			return ((G_ListRange) range).getValues().iterator().next();
		} else if (range instanceof G_BoundedRange) {
			final G_BoundedRange bounded = (G_BoundedRange) range;
			return bounded.getStart() != null ? bounded.getStart() : bounded.getEnd();
		}
		return null;
	}

	public String toJson() throws IOException {
		return SerializationHelper.toJson(this);
	}
}


text:
@class ESJsonFormat;

static ESJsonFormat *sharedPlugin;
static ESJsonFormat *instance;

@interface ESJsonFormat : NSObject

@property (nonatomic, assign,getter=isSwift) BOOL swift;

+ (instancetype)sharedPlugin;
+ (instancetype)instance;
- (id)initWithBundle:(NSBundle *)plugin;

- (void)showInputJsonWindow:(NSMenuItem *)item;
@property (nonatomic, strong, readonly) NSBundle* bundle;
@end


text:
var express = require('express');
var router = express.Router();

router.get('/', function(req, res, next) {
  res.render("editarProducto");
});

module.exports = router;


text:
export default /* glsl */`
#ifdef USE_FOG

	fogDepth = -mvPosition.z;
	vec4 worldPos = modelMatrix * vec4( position, 1.0 );
	fogHeight = worldPos.y;

#endif
`;


text:
class RecommendationDataSource < ActiveRecord::Base
end


text:
var browserSync  = require('browser-sync'),
    exec         = require('child_process').exec,
    del          = require('del'),
    gulp         = require('gulp');

gulp.task('clean', function(cb) {
  del('_site', cb);
});

gulp.task('browser-sync', ['jekyll'], function() {
  browserSync({
    server: {
      baseDir: '_site'
    },
    notify: false
  });
});

gulp.task('browser-sync-reload', ['jekyll'], function() {
  browserSync.reload();
});

gulp.task('jekyll', function(cb) {
  exec('jekyll build', function(err) {
    if (err) return cb(err);
    cb();
  });
});

gulp.task('default', ['clean'], function() {
  gulp.start('jekyll');
});

gulp.task('dev', ['browser-sync'], function() {
  gulp.watch(['index.html',
              '404.html',
              '_includes/*',
              '_layouts/*',
              '_posts/*',
              'public/**/*'], ['browser-sync-reload']);
});


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

namespace AdvancedTask2
{
    public class Dealer
    {
        private const string CARDS = "23456789TJQKA";
        private const string SIGNS = "cdhs";
        private const int CARDS_IN_A_DECK = 52;
        private const string FULL_MESSAGE = "Full deck";
        private const string WA_MESSAGE = "Wa wa!";

        private static readonly List<string> Deck = new List<string>();

        private static long wholeDeckMask = 0;
        private static long evenMask = 0;

        public static void Main()
        {
            GenerateDeck();

            var input = ReadInput();
            var numberOfHands = ParseInt(input);

            for (var i = 0; i < numberOfHands; i++)
            {
                var currentInput = ReadInput();
                var currentHand = ParseLong(currentInput);
                wholeDeckMask = currentHand | wholeDeckMask;
                evenMask = evenMask ^ (wholeDeckMask & currentHand);
            }

            var isWholeDeck = CheckWholeDeck(wholeDeckMask);
            var maskStr = Convert.ToString(evenMask, 2);

            PrintFinalMessage(isWholeDeck);
            PrintEvenCards(maskStr);
        }

        private static void PrintFinalMessage(bool isWholeDeck)
        {
            Console.WriteLine(isWholeDeck ? FULL_MESSAGE : WA_MESSAGE);
        }

        private static long ParseLong(string input)
        {
            if (string.IsNullOrWhiteSpace(input))
            {
                throw new ArgumentException("Parse input cannot be null or empty");
            }

            try
            {
                var result = long.Parse(input);
                return result;
            }
            catch (FormatException)
            {
                Console.WriteLine("Invalid format of the input");
                throw;
            }
            catch (OverflowException)
            {
                Console.WriteLine("The number is too big");
                throw;
            }
        }

        private static int ParseInt(string input)
        {
            if (string.IsNullOrWhiteSpace(input))
            {
                throw new ArgumentException("Parse input cannot be null or empty");
            }

            try
            {
                var result = int.Parse(input);
                return result;
            }
            catch (FormatException)
            {
                Console.WriteLine("Invalid format of the input");
                throw;
            }
            catch (OverflowException)
            {
                Console.WriteLine("The number is too big");
                throw;
            }
        }

        private static string ReadInput()
        {
            string input = null;

            do
            {
                input = Console.ReadLine();
                if (string.IsNullOrWhiteSpace(input))
                {
                    Console.WriteLine("Please, enter some input value.");
                }
                else
                {
                    break;
                }
            } while (true);

            return input;
        }

        private static void PrintEvenCards(string value)
        {
            if (string.IsNullOrWhiteSpace(value))
            {
                throw new ArgumentException("Parse input cannot be null or empty");
            }

            var evenCards = new List<string>();

            for (var i = value.Length - 1; i >= 0; i--)
            {
                if (value[i] == '0')
                {
                    evenCards.Add(Deck[52 - i - 1]);
                }
            }

            Console.WriteLine(string.Join(" ", evenCards));
        }

        private static bool CheckWholeDeck(long maskWhole)
        {
            string setBits = new string('1', 52);
            return Convert.ToString(maskWhole, 2) == setBits;
        }

        private static void GenerateDeck()
        {
            int cardsLength = CARDS.Length;
            int currentCardIndex = 0;
            int currentSignIndex = 0;

            for (int i = 0; i < CARDS_IN_A_DECK; i++)
            {
                if (currentCardIndex == cardsLength)
                {
                    currentCardIndex = 0;
                    currentSignIndex++;
                }

                Deck.Add(string.Empty + CARDS[currentCardIndex] + SIGNS[currentSignIndex]);

                currentCardIndex++;
            }
        }
    }
}


text:
{% extends "base.html" %}

{% block title %}{{ title }}{% endblock %}

{% block panels %}
<link href="/static/css/stud_style.css" rel="stylesheet">

Det har skjedd en feil

        <form class="form-horizontal">

{{ message }}

        </form>

{% endblock %}


text:
  <mat-form-field class="mat-block">
    <mat-label translate>alias.filter-type</mat-label>
    <mat-select required formControlName="type">
      <mat-option *ngFor="let type of aliasFilterTypes" [value]="type">
        {{aliasFilterTypeTranslations.get(type) | translate}}
      </mat-option>
    </mat-select>
    <mat-error *ngIf="entityFilterFormGroup.get('type').hasError('required')">
      {{ 'alias.filter-type-required' | translate }}
    </mat-error>
  </mat-form-field>

    <ng-template [ngSwitchCase]="aliasFilterType.singleEntity">
      <tb-entity-select required
                        useAliasEntityTypes="true"
                        formControlName="singleEntity">
      </tb-entity-select>
    </ng-template>
    <ng-template [ngSwitchCase]="aliasFilterType.entityList">
      <tb-entity-type-select required
                             showLabel
                             [allowedEntityTypes]="allowedEntityTypes"
                             formControlName="entityType">
      </tb-entity-type-select>
      <tb-entity-list required
                      [entityType]="filterFormGroup.get('entityType').value"
                      formControlName="entityList">
      </tb-entity-list>
    </ng-template>
    <ng-template [ngSwitchCase]="aliasFilterType.entityName">
      <tb-entity-type-select required
                             showLabel
                             [allowedEntityTypes]="allowedEntityTypes"
                             formControlName="entityType">
      </tb-entity-type-select>
      <mat-form-field class="mat-block">
        <mat-label translate>entity.name-starts-with</mat-label>
        <mat-icon class="mat-primary" aria-hidden="false" aria-label="help-icon" matSuffix style="cursor:pointer;"
                  matTooltip="{{'entity.help-text' | translate }}">help</mat-icon>
        <input matInput formControlName="entityNameFilter" required>
        <mat-error *ngIf="filterFormGroup.get('entityNameFilter').hasError('required')">
          {{ 'entity.entity-name-filter-required' | translate }}
        </mat-error>
      </mat-form-field>
    </ng-template>
    <ng-template [ngSwitchCase]="aliasFilterType.entityType">
      <tb-entity-type-select required
                             showLabel
                             [allowedEntityTypes]="allowedEntityTypes"
                             formControlName="entityType">
      </tb-entity-type-select>
    </ng-template>
    <ng-template [ngSwitchCase]="aliasFilterType.stateEntity">
      <mat-form-field floatLabel="always" class="mat-block">
        <mat-label translate>alias.state-entity-parameter-name</mat-label>
        <input matInput formControlName="stateEntityParamName"
               placeholder="{{ 'alias.default-entity-parameter-name' | translate }}">
      </mat-form-field>

        {{ 'alias.default-state-entity' | translate }}
        <tb-entity-select fxFlex
                          useAliasEntityTypes="true"
                          formControlName="defaultStateEntity">
        </tb-entity-select>

    </ng-template>
    <ng-template [ngSwitchCase]="aliasFilterType.assetType">
      <tb-entity-subtype-autocomplete required
                                      formControlName="assetType"
                                      [entityType]="entityType.ASSET">
      </tb-entity-subtype-autocomplete>
      <mat-form-field class="mat-block">
        <mat-label translate>asset.name-starts-with</mat-label>
        <mat-icon class="mat-primary" aria-hidden="false" aria-label="help-icon" matSuffix style="cursor:pointer;"
                  matTooltip="{{'asset.help-text' | translate }}">help</mat-icon>
        <input matInput formControlName="assetNameFilter">
      </mat-form-field>
    </ng-template>
    <ng-template [ngSwitchCase]="aliasFilterType.deviceType">
      <tb-entity-subtype-autocomplete required
                                      formControlName="deviceType"
                                      [entityType]="entityType.DEVICE">
      </tb-entity-subtype-autocomplete>
      <mat-form-field class="mat-block">
        <mat-label translate>device.name-starts-with</mat-label>
        <mat-icon class="mat-primary" aria-hidden="false" aria-label="help-icon" matSuffix style="cursor:pointer;"
                  matTooltip="{{'device.help-text' | translate }}">help</mat-icon>
        <input matInput formControlName="deviceNameFilter">
      </mat-form-field>
    </ng-template>
    <ng-template [ngSwitchCase]="aliasFilterType.entityViewType">
      <tb-entity-subtype-autocomplete required
                                      formControlName="entityViewType"
                                      [entityType]="entityType.ENTITY_VIEW">
      </tb-entity-subtype-autocomplete>
      <mat-form-field class="mat-block">
        <mat-label translate>entity-view.name-starts-with</mat-label>
        <mat-icon class="mat-primary" aria-hidden="false" aria-label="help-icon" matSuffix style="cursor:pointer;"
                  matTooltip="{{'entity-view.help-text' | translate }}">help</mat-icon>
        <input matInput formControlName="entityViewNameFilter">
      </mat-form-field>
    </ng-template>
    <ng-template [ngSwitchCase]="aliasFilterType.edgeType">
      <tb-entity-subtype-autocomplete required
                                      formControlName="edgeType"
                                      [entityType]="entityType.EDGE">
      </tb-entity-subtype-autocomplete>
      <mat-form-field class="mat-block">
        <mat-label translate>edge.name-starts-with</mat-label>
        <input matInput formControlName="edgeNameFilter">
      </mat-form-field>
    </ng-template>
    <ng-template [ngSwitchCase]="aliasFilterType.relationsQuery">

        {{ 'alias.root-entity' | translate }}

          <mat-slide-toggle class="root-state-entity-switch"
                            formControlName="rootStateEntity">
          </mat-slide-toggle>
          alias.root-state-entity

          <tb-entity-select fxFlex
                            required
                            useAliasEntityTypes="true"
                            formControlName="rootEntity">
          </tb-entity-select>

          <mat-form-field floatLabel="always" class="mat-block" style="margin-top: 14px; padding-right: 8px;">
            <mat-label translate>alias.state-entity-parameter-name</mat-label>
            <input matInput formControlName="stateEntityParamName"
                   placeholder="{{ 'alias.default-entity-parameter-name' | translate }}">
          </mat-form-field>

            {{ 'alias.default-state-entity' | translate }}
            <tb-entity-select fxFlex
                              useAliasEntityTypes="true"
                              formControlName="defaultStateEntity">
            </tb-entity-select>

            <mat-slide-toggle class="root-state-entity-switch"
                              formControlName="fetchLastLevelOnly">
            </mat-slide-toggle>
            alias.last-level-relation

          <mat-form-field class="mat-block" style="min-width: 100px;">
            <mat-label translate>relation.direction</mat-label>
            <mat-select required formControlName="direction">
              <mat-option *ngFor="let type of directionTypes" [value]="type">
                {{ directionTypeTranslations.get(directionTypeEnum[type]) | translate }}
              </mat-option>
            </mat-select>
          </mat-form-field>
          <mat-form-field fxFlex floatLabel="always" class="mat-block">
            <mat-label translate>alias.max-relation-level</mat-label>
            <input matInput
                   type="number"
                   min="1"
                   step="1"
                   placeholder="{{ 'alias.unlimited-level' | translate }}"
                   formControlName="maxLevel">
          </mat-form-field>

relation.relation-filters

        <tb-relation-filters
          [allowedEntityTypes]="allowedEntityTypes"
          formControlName="filters">
        </tb-relation-filters>

    </ng-template>
    <ng-template [ngSwitchCase]="entityFilterFormGroup.get('type').value === aliasFilterType.assetSearchQuery ||
                                 entityFilterFormGroup.get('type').value === aliasFilterType.deviceSearchQuery ||
                                 entityFilterFormGroup.get('type').value === aliasFilterType.edgeSearchQuery ||
                                 entityFilterFormGroup.get('type').value === aliasFilterType.entityViewSearchQuery ?
                                 entityFilterFormGroup.get('type').value : ''">
      {{ 'alias.root-entity' | translate }}

        <mat-slide-toggle class="root-state-entity-switch"
                          formControlName="rootStateEntity">
        </mat-slide-toggle>
        alias.root-state-entity

        <tb-entity-select fxFlex
                          required
                          useAliasEntityTypes="true"
                          formControlName="rootEntity">
        </tb-entity-select>

        <mat-form-field floatLabel="always" class="mat-block" style="margin-top: 14px; padding-right: 8px;">
          <mat-label translate>alias.state-entity-parameter-name</mat-label>
          <input matInput formControlName="stateEntityParamName"
                 placeholder="{{ 'alias.default-entity-parameter-name' | translate }}">
        </mat-form-field>

          {{ 'alias.default-state-entity' | translate }}
          <tb-entity-select fxFlex
                            useAliasEntityTypes="true"
                            formControlName="defaultStateEntity">
          </tb-entity-select>

          <mat-slide-toggle class="root-state-entity-switch"
                            formControlName="fetchLastLevelOnly">
          </mat-slide-toggle>
          alias.last-level-relation

        <mat-form-field class="mat-block" style="min-width: 100px;">
          <mat-label translate>relation.direction</mat-label>
          <mat-select required formControlName="direction">
            <mat-option *ngFor="let type of directionTypes" [value]="type">
              {{ directionTypeTranslations.get(directionTypeEnum[type]) | translate }}
            </mat-option>
          </mat-select>
        </mat-form-field>
        <mat-form-field fxFlex floatLabel="always" class="mat-block">
          <mat-label translate>alias.max-relation-level</mat-label>
          <input matInput
                 type="number"
                 min="1"
                 step="1"
                 placeholder="{{ 'alias.unlimited-level' | translate }}"
                 formControlName="maxLevel">
        </mat-form-field>

relation.relation-type

      <tb-relation-type-autocomplete
        fxFlex
        formControlName="relationType">
      </tb-relation-type-autocomplete>
    </ng-template>
    <ng-template [ngSwitchCase]="aliasFilterType.assetSearchQuery">

asset.asset-types

      <tb-entity-subtype-list
        required
        [entityType]="entityType.ASSET"
        formControlName="assetTypes">
      </tb-entity-subtype-list>
    </ng-template>
    <ng-template [ngSwitchCase]="aliasFilterType.deviceSearchQuery">

device.device-types

      <tb-entity-subtype-list
        required
        [entityType]="entityType.DEVICE"
        formControlName="deviceTypes">
      </tb-entity-subtype-list>
    </ng-template>
    <ng-template [ngSwitchCase]="aliasFilterType.edgeSearchQuery">

edge.edge-types

      <tb-entity-subtype-list
        required
        [entityType]="entityType.EDGE"
        formControlName="edgeTypes">
      </tb-entity-subtype-list>
    </ng-template>
    <ng-template [ngSwitchCase]="aliasFilterType.entityViewSearchQuery">

entity-view.entity-view-types

      <tb-entity-subtype-list
        required
        [entityType]="entityType.ENTITY_VIEW"
        formControlName="entityViewTypes">
      </tb-entity-subtype-list>
    </ng-template>


text:
package com.intellij.codeInsight.daemon.impl.quickfix;

import com.intellij.codeInsight.FileModificationService;
import com.intellij.codeInsight.daemon.QuickFixBundle;
import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiJavaCodeReferenceElement;
import com.intellij.psi.PsiNewExpression;
import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NotNull;

/**
 * Created by IntelliJ IDEA.
 * User: cdr
 * Date: Nov 29, 2002
 * Time: 3:02:17 PM
 * To change this template use Options | File Templates.
 */
public class RemoveNewQualifierFix implements IntentionAction {
  private final PsiNewExpression expression;
  private final PsiClass aClass;

  public RemoveNewQualifierFix(PsiNewExpression expression, PsiClass aClass) {
    this.expression = expression;
    this.aClass = aClass;
  }

  @Override
  @NotNull
  public String getText() {
    return QuickFixBundle.message("remove.qualifier.fix");
  }

  @Override
  @NotNull
  public String getFamilyName() {
    return QuickFixBundle.message("remove.qualifier.fix");
  }

  @Override
  public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
    return
        expression != null
        && expression.isValid()
        && (aClass == null || aClass.isValid())
        && expression.getManager().isInProject(expression);
  }

  @Override
  public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
    if (!FileModificationService.getInstance().prepareFileForWrite(expression.getContainingFile())) return;
    PsiJavaCodeReferenceElement classReference = expression.getClassReference();
    expression.getQualifier().delete();
    if (aClass != null && classReference != null) {
      classReference.bindToElement(aClass);
    }
  }

  @Override
  public boolean startInWriteAction() {
    return true;
  }

}


text:
import * as c from 'material-ui/styles/colors';
import {fade} from 'material-ui/utils/colorManipulator';
import spacing from 'material-ui/styles/spacing';

const themeConfiguration = {
    spacing: spacing,
    fontFamily: 'Roboto, sans-serif',
    palette: {
        primary1Color: c.blueGrey800,
        primary2Color: c.blueGrey600,
        primary3Color: c.blueGrey400,
        accent1Color: c.cyanA700,
        accent2Color: c.grey100,
        accent3Color: c.cyan400,
        textColor: c.darkBlack,
        alternateTextColor: c.white,
        canvasColor: c.white,
        borderColor: c.grey300,
        disabledColor: fade(c.darkBlack, 0.3),
        pickerHeaderColor: c.blueGrey800,
        clockCircleColor: fade(c.darkBlack, 0.07),
        shadowColor: c.fullBlack,
    },
};

export default themeConfiguration;


text:
This is an experimental feature to explore automatically deriving sharding
annotations for SPMD model-parallelism.


text:
package de.sytm.httpserver.internal.utils;

import java.awt.image.BufferedImage;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;

import javax.imageio.ImageIO;
import javax.imageio.stream.FileImageInputStream;

import de.sytm.httpserver.internal.ByteBuf;

public final class IOUtils {

	private static HashMap<String, String> custommimetypes = new HashMap<String, String>();

	static {
		custommimetypes.put("jar", "application/java-archive");
		custommimetypes.put("ogg", "audio/ogg");
		custommimetypes.put("ogv", "video/ogg");
		custommimetypes.put("opus", "audio/ogg");
		custommimetypes.put("oga", "audio/ogg");
		custommimetypes.put("ogx", "application/ogg");
		custommimetypes.put("spx", "audio/ogg");
		custommimetypes.put("flac", "audio/ogg");
		custommimetypes.put("xspf", "application/xspf+xml");
		custommimetypes.put("less", "text/css");
		custommimetypes.put("scss", "text/css");
	}

	private IOUtils() {
	}

	public static byte[] cleanBuffer(byte[] input) {
		ArrayList<Byte> result = new ArrayList<Byte>();
		boolean ignore = true;
		for (int index = input.length - 1; index >= 0; --index) {
			if (ignore) {
				if (input[index] != 0) {
					result.add(input[index]);
					ignore = false;
				}
			} else {
				result.add(input[index]);
			}
		}
		Collections.reverse(result);
		return convert(result.toArray(new Byte[result.size()]));
	}

	public static ByteBuf readFileToBuffer(File file) {
		ByteBuf buffer = new ByteBuf(file.length());
		try {
			buffer.read(new FileInputStream(file));
		} catch (IOException e) {
			e.printStackTrace();
		}
		return buffer;
	}

	public static ByteBuf readImageToBuffer(File file) {
		ByteBuf buffer = new ByteBuf(file.length());
		try {
			buffer.read(new FileImageInputStream(file));
		} catch (IOException e) {
			e.printStackTrace();
		}
		return buffer;
	}

	private static byte[] convert(Byte[] input) {
		byte[] result = new byte[input.length];
		for (int index = 0; index < input.length; ++index)
			result[index] = input[index].byteValue();
		return result;
	}

	public static String readFile(File file) {
		try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
			String linesep = System.lineSeparator();
			StringBuilder sb = new StringBuilder();
			boolean first = true;
			String line;
			while ((line = reader.readLine()) != null) {
				if (first) {
					sb.append(line);
					first = false;
				} else {
					sb.append(linesep + line);
				}
			}
			return sb.toString();
		} catch (IOException ex) {
			ex.printStackTrace();
		}
		return null;
	}

	public static byte[] readImageToBytes(File file) {
		if (file.length() > Integer.MAX_VALUE)
			return null;
		ByteArrayOutputStream out = new ByteArrayOutputStream((int) file.length());
		try {
			BufferedImage image = ImageIO.read(file);
			ImageIO.write(image, IOUtils.getImageType(file), out);
			out.close();
		} catch (IOException ex) {
			ex.printStackTrace();
		}
		return out.toByteArray();
	}

	public static byte[] readFileToBytes(File file) {
		try {
			return Files.readAllBytes(file.toPath());
		} catch (IOException ex) {
			ex.printStackTrace();
		}
		return null;
	}

	public static String getFileType(File file) {
		String extension = getExtension(file.getName());
		if (custommimetypes.containsKey(extension))
			return custommimetypes.get(extension);
		try {
			String content = Files.probeContentType(file.toPath());
			if (content != null)
				return content;
			else
				return "application/octet-stream";
		} catch (IOException e) {
			e.printStackTrace();
		}
		return "text/plain";
	}

	public static boolean isImage(File file) {
		return getFileType(file).contains("image");
	}

	public static String getImageType(File file) {
		return getFileType(file).split("/")[1];
	}

	public static boolean isBinaryFile(File file) {
		try {
			FileInputStream in = new FileInputStream(file);
			int size = in.available();
			if (size > 1024)
				size = 1024;
			byte[] data = new byte[size];
			in.read(data);
			in.close();
			int ascii = 0;
			int other = 0;
			for (int i = 0; i < data.length; i++) {
				byte b = data[i];
				if (b < 0x09) {
					return true;
				}
				if (b == 0x09 || b == 0x0A || b == 0x0C || b == 0x0D) {
					ascii++;
				} else if (b >= 0x20 && b <= 0x7E) {
					ascii++;
				} else {
					other++;
				}
			}
			if (other == 0) {
				return false;
			}
			return 100 * other / (ascii + other) > 95;
		} catch (IOException ex) {
			ex.printStackTrace();
		}
		return false;
	}

	public static String getExtension(String filename) {
		if (filename.contains(".")) {
			return filename.substring(filename.lastIndexOf(".") + 1).toLowerCase();
		} else {
			return "";
		}
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
using System.Text;

using Xamarin.Forms;

namespace GestureSample.Views.Tests
{
	public class DisposeInHandlerPage : ContentPage
	{
		public static Label Log { get; set; }

		public DisposeInHandlerPage()
		{
			var cv = new DisposeInHandlerContentView();

			Log = new Label();
			var syncLbl = new MR.Gestures.Label { Text = "Clear synchronously", HorizontalOptions = LayoutOptions.Start, BackgroundColor = Color.Silver };
#pragma warning disable CS4014
			syncLbl.Tapping += (s, e) => { Log.Text = "Sync clear from outside"; cv.ClearContentAsync(); };
#pragma warning restore CS4014
			var asyncLbl = new MR.Gestures.Label { Text = "Clear asynchronously", HorizontalOptions = LayoutOptions.CenterAndExpand, BackgroundColor = Color.Silver };
			asyncLbl.Tapping += async (s, e) => { Log.Text = "Async clear from outside"; await cv.ClearContentAsync(); };
			var fillLbl = new MR.Gestures.Label { Text = "Set Content", HorizontalOptions = LayoutOptions.End, BackgroundColor = Color.Silver };
			fillLbl.Tapping += (s, e) => { Log.Text = "Set content from outside"; cv.SetContent(); };

			Content = new StackLayout
			{
				Padding = 20,
				Children = {
					cv,
					new StackLayout
					{
						Orientation = StackOrientation.Horizontal,
						Children = {
							syncLbl,
							asyncLbl,
							fillLbl,
						}
					},
					Log,
				}
			};
		}
	}
}


text:
namespace com.esri.gpt.csw
{
    partial class CswClientDockableWindow
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CswClientDockableWindow));
            this.resultsSplitContainer = new System.Windows.Forms.SplitContainer();
            this.clearAllFootprinttoolStripButton = new System.Windows.Forms.Button();
            this.showAllFootprintToolStripButton = new System.Windows.Forms.Button();
            this.zoomtoFootprintToolStripButton = new System.Windows.Forms.Button();
            this.displayFootprinttoolStripButton = new System.Windows.Forms.Button();
            this.addToMapToolStripButton = new System.Windows.Forms.Button();
            this.downloadMetadataToolStripButton = new System.Windows.Forms.Button();
            this.viewMetadataToolStripButton = new System.Windows.Forms.Button();
            this.resultsListBox = new System.Windows.Forms.ListBox();
            this.abstractTextBox = new System.Windows.Forms.TextBox();
            this.abstractLabel = new System.Windows.Forms.Label();
            this.mainTabControl = new System.Windows.Forms.TabControl();
            this.findTabPage = new System.Windows.Forms.TabPage();
            this.maxResultsNumericUpDown = new System.Windows.Forms.NumericUpDown();
            this.dividerGroupBox = new System.Windows.Forms.GroupBox();
            this.useCurrentExtentCheckBox = new System.Windows.Forms.CheckBox();
            this.findButton = new System.Windows.Forms.Button();
            this.catalogComboBox = new System.Windows.Forms.ComboBox();
            this.inCatalogLabel = new System.Windows.Forms.Label();
            this.liveDataAndMapsOnlyCheckBox = new System.Windows.Forms.CheckBox();
            this.maximumLabel = new System.Windows.Forms.Label();
            this.searchPhraseTextBox = new System.Windows.Forms.TextBox();
            this.findLabel = new System.Windows.Forms.Label();
            this.resultsLabel = new System.Windows.Forms.Label();
            this.configureTabPage = new System.Windows.Forms.TabPage();
            this.catalogListBox = new System.Windows.Forms.ListBox();
            this.saveCatalogButton = new System.Windows.Forms.Button();
            this.deleteCatalogButton = new System.Windows.Forms.Button();
            this.newCatalogButton = new System.Windows.Forms.Button();
            this.catalogListLabel = new System.Windows.Forms.Label();
            this.catalogProfileComboBox = new System.Windows.Forms.ComboBox();
            this.catalogUrlTextBox = new System.Windows.Forms.TextBox();
            this.catalogDisplayNameTextBox = new System.Windows.Forms.TextBox();
            this.catalogProfileLabel = new System.Windows.Forms.Label();
            this.catalogDisplayNameLabel = new System.Windows.Forms.Label();
            this.catalogUrlLabel = new System.Windows.Forms.Label();
            this.helpTabPage = new System.Windows.Forms.TabPage();
            this.linkLblAbt = new System.Windows.Forms.LinkLabel();
            this.linkLblHelp = new System.Windows.Forms.LinkLabel();
            this.tooltip = new System.Windows.Forms.ToolTip(this.components);
            this.resultsSplitContainer.Panel1.SuspendLayout();
            this.resultsSplitContainer.Panel2.SuspendLayout();
            this.resultsSplitContainer.SuspendLayout();
            this.mainTabControl.SuspendLayout();
            this.findTabPage.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.maxResultsNumericUpDown)).BeginInit();
            this.configureTabPage.SuspendLayout();
            this.helpTabPage.SuspendLayout();
            this.SuspendLayout();
            //
            // resultsSplitContainer
            //
            resources.ApplyResources(this.resultsSplitContainer, "resultsSplitContainer");
            this.resultsSplitContainer.Name = "resultsSplitContainer";
            //
            // resultsSplitContainer.Panel1
            //
            this.resultsSplitContainer.Panel1.Controls.Add(this.clearAllFootprinttoolStripButton);
            this.resultsSplitContainer.Panel1.Controls.Add(this.showAllFootprintToolStripButton);
            this.resultsSplitContainer.Panel1.Controls.Add(this.zoomtoFootprintToolStripButton);
            this.resultsSplitContainer.Panel1.Controls.Add(this.displayFootprinttoolStripButton);
            this.resultsSplitContainer.Panel1.Controls.Add(this.addToMapToolStripButton);
            this.resultsSplitContainer.Panel1.Controls.Add(this.downloadMetadataToolStripButton);
            this.resultsSplitContainer.Panel1.Controls.Add(this.viewMetadataToolStripButton);
            this.resultsSplitContainer.Panel1.Controls.Add(this.resultsListBox);
            //
            // resultsSplitContainer.Panel2
            //
            this.resultsSplitContainer.Panel2.Controls.Add(this.abstractTextBox);
            this.resultsSplitContainer.Panel2.Controls.Add(this.abstractLabel);
            this.resultsSplitContainer.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ResultsSplitContainer_KeyDown);
            //
            // clearAllFootprinttoolStripButton
            //
            resources.ApplyResources(this.clearAllFootprinttoolStripButton, "clearAllFootprinttoolStripButton");
            this.clearAllFootprinttoolStripButton.Name = "clearAllFootprinttoolStripButton";
            this.tooltip.SetToolTip(this.clearAllFootprinttoolStripButton, resources.GetString("clearAllFootprinttoolStripButton.ToolTip"));
            this.clearAllFootprinttoolStripButton.UseVisualStyleBackColor = true;
            this.clearAllFootprinttoolStripButton.Click += new System.EventHandler(this.clearAllFootprinttoolStripButton_Click);
            //
            // showAllFootprintToolStripButton
            //
            resources.ApplyResources(this.showAllFootprintToolStripButton, "showAllFootprintToolStripButton");
            this.showAllFootprintToolStripButton.Image = global::com.esri.gpt.csw.StringResources.showAll;
            this.showAllFootprintToolStripButton.Name = "showAllFootprintToolStripButton";
            this.tooltip.SetToolTip(this.showAllFootprintToolStripButton, resources.GetString("showAllFootprintToolStripButton.ToolTip"));
            this.showAllFootprintToolStripButton.UseVisualStyleBackColor = true;
            this.showAllFootprintToolStripButton.Click += new System.EventHandler(this.showAllFootprint_Click);
            //
            // zoomtoFootprintToolStripButton
            //
            resources.ApplyResources(this.zoomtoFootprintToolStripButton, "zoomtoFootprintToolStripButton");
            this.zoomtoFootprintToolStripButton.Image = global::com.esri.gpt.csw.StringResources.zoom_to_footprint;
            this.zoomtoFootprintToolStripButton.Name = "zoomtoFootprintToolStripButton";
            this.tooltip.SetToolTip(this.zoomtoFootprintToolStripButton, resources.GetString("zoomtoFootprintToolStripButton.ToolTip"));
            this.zoomtoFootprintToolStripButton.UseVisualStyleBackColor = true;
            this.zoomtoFootprintToolStripButton.Click += new System.EventHandler(this.zoomtoFootprintToolStripButton_Click);
            //
            // displayFootprinttoolStripButton
            //
            resources.ApplyResources(this.displayFootprinttoolStripButton, "displayFootprinttoolStripButton");
            this.displayFootprinttoolStripButton.Image = global::com.esri.gpt.csw.StringResources.display_footprint;
            this.displayFootprinttoolStripButton.Name = "displayFootprinttoolStripButton";
            this.tooltip.SetToolTip(this.displayFootprinttoolStripButton, resources.GetString("displayFootprinttoolStripButton.ToolTip"));
            this.displayFootprinttoolStripButton.UseVisualStyleBackColor = true;
            this.displayFootprinttoolStripButton.Click += new System.EventHandler(this.displayFootprinttoolStripButton_Click);
            //
            // addToMapToolStripButton
            //
            resources.ApplyResources(this.addToMapToolStripButton, "addToMapToolStripButton");
            this.addToMapToolStripButton.Name = "addToMapToolStripButton";
            this.tooltip.SetToolTip(this.addToMapToolStripButton, resources.GetString("addToMapToolStripButton.ToolTip"));
            this.addToMapToolStripButton.UseVisualStyleBackColor = true;
            this.addToMapToolStripButton.Click += new System.EventHandler(this.AddToMapToolStripButton_Click);
            //
            // downloadMetadataToolStripButton
            //
            resources.ApplyResources(this.downloadMetadataToolStripButton, "downloadMetadataToolStripButton");
            this.downloadMetadataToolStripButton.Name = "downloadMetadataToolStripButton";
            this.tooltip.SetToolTip(this.downloadMetadataToolStripButton, resources.GetString("downloadMetadataToolStripButton.ToolTip"));
            this.downloadMetadataToolStripButton.UseVisualStyleBackColor = true;
            this.downloadMetadataToolStripButton.Click += new System.EventHandler(this.DownloadMetadataToolStripButton_Click);
            //
            // viewMetadataToolStripButton
            //
            resources.ApplyResources(this.viewMetadataToolStripButton, "viewMetadataToolStripButton");
            this.viewMetadataToolStripButton.Name = "viewMetadataToolStripButton";
            this.tooltip.SetToolTip(this.viewMetadataToolStripButton, resources.GetString("viewMetadataToolStripButton.ToolTip"));
            this.viewMetadataToolStripButton.UseVisualStyleBackColor = true;
            this.viewMetadataToolStripButton.Click += new System.EventHandler(this.ViewMetadataToolStripButton_Click);
            //
            // resultsListBox
            //
            resources.ApplyResources(this.resultsListBox, "resultsListBox");
            this.resultsListBox.FormattingEnabled = true;
            this.resultsListBox.Name = "resultsListBox";
            this.resultsListBox.SelectedIndexChanged += new System.EventHandler(this.ResultsListBox_SelectedIndexChanged);
            this.resultsListBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ResultsListBox_KeyDown);
            //
            // abstractTextBox
            //
            resources.ApplyResources(this.abstractTextBox, "abstractTextBox");
            this.abstractTextBox.BackColor = System.Drawing.SystemColors.Window;
            this.abstractTextBox.Name = "abstractTextBox";
            this.abstractTextBox.ReadOnly = true;
            //
            // abstractLabel
            //
            resources.ApplyResources(this.abstractLabel, "abstractLabel");
            this.abstractLabel.Name = "abstractLabel";
            //
            // mainTabControl
            //
            this.mainTabControl.Controls.Add(this.findTabPage);
            this.mainTabControl.Controls.Add(this.configureTabPage);
            this.mainTabControl.Controls.Add(this.helpTabPage);
            resources.ApplyResources(this.mainTabControl, "mainTabControl");
            this.mainTabControl.Name = "mainTabControl";
            this.mainTabControl.SelectedIndex = 0;
            //
            // findTabPage
            //
            this.findTabPage.Controls.Add(this.maxResultsNumericUpDown);
            this.findTabPage.Controls.Add(this.dividerGroupBox);
            this.findTabPage.Controls.Add(this.useCurrentExtentCheckBox);
            this.findTabPage.Controls.Add(this.resultsSplitContainer);
            this.findTabPage.Controls.Add(this.findButton);
            this.findTabPage.Controls.Add(this.catalogComboBox);
            this.findTabPage.Controls.Add(this.inCatalogLabel);
            this.findTabPage.Controls.Add(this.liveDataAndMapsOnlyCheckBox);
            this.findTabPage.Controls.Add(this.maximumLabel);
            this.findTabPage.Controls.Add(this.searchPhraseTextBox);
            this.findTabPage.Controls.Add(this.findLabel);
            this.findTabPage.Controls.Add(this.resultsLabel);
            resources.ApplyResources(this.findTabPage, "findTabPage");
            this.findTabPage.Name = "findTabPage";
            this.findTabPage.UseVisualStyleBackColor = true;
            this.findTabPage.Enter += new System.EventHandler(this.FindTabPage_Enter);
            //
            // maxResultsNumericUpDown
            //
            resources.ApplyResources(this.maxResultsNumericUpDown, "maxResultsNumericUpDown");
            this.maxResultsNumericUpDown.Maximum = new decimal(new int[] {
            500,
            0,
            0,
            0});
            this.maxResultsNumericUpDown.Name = "maxResultsNumericUpDown";
            this.maxResultsNumericUpDown.Value = new decimal(new int[] {
            10,
            0,
            0,
            0});
            this.maxResultsNumericUpDown.Leave += new System.EventHandler(this.MaxResultsNumericUpDown_Leave);
            //
            // dividerGroupBox
            //
            resources.ApplyResources(this.dividerGroupBox, "dividerGroupBox");
            this.dividerGroupBox.Name = "dividerGroupBox";
            this.dividerGroupBox.TabStop = false;
            //
            // useCurrentExtentCheckBox
            //
            resources.ApplyResources(this.useCurrentExtentCheckBox, "useCurrentExtentCheckBox");
            this.useCurrentExtentCheckBox.Name = "useCurrentExtentCheckBox";
            this.useCurrentExtentCheckBox.UseVisualStyleBackColor = true;
            //
            // findButton
            //
            resources.ApplyResources(this.findButton, "findButton");
            this.findButton.Name = "findButton";
            this.findButton.UseVisualStyleBackColor = true;
            this.findButton.Click += new System.EventHandler(this.FindButton_Click);
            //
            // catalogComboBox
            //
            resources.ApplyResources(this.catalogComboBox, "catalogComboBox");
            this.catalogComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.catalogComboBox.FormattingEnabled = true;
            this.catalogComboBox.Name = "catalogComboBox";
            this.catalogComboBox.Sorted = true;
            this.catalogComboBox.SelectedIndexChanged += new System.EventHandler(this.CatalogComboBox_SelectedIndexChanged);
            //
            // inCatalogLabel
            //
            resources.ApplyResources(this.inCatalogLabel, "inCatalogLabel");
            this.inCatalogLabel.Name = "inCatalogLabel";
            //
            // liveDataAndMapsOnlyCheckBox
            //
            resources.ApplyResources(this.liveDataAndMapsOnlyCheckBox, "liveDataAndMapsOnlyCheckBox");
            this.liveDataAndMapsOnlyCheckBox.Name = "liveDataAndMapsOnlyCheckBox";
            this.liveDataAndMapsOnlyCheckBox.UseVisualStyleBackColor = true;
            //
            // maximumLabel
            //
            resources.ApplyResources(this.maximumLabel, "maximumLabel");
            this.maximumLabel.Name = "maximumLabel";
            //
            // searchPhraseTextBox
            //
            resources.ApplyResources(this.searchPhraseTextBox, "searchPhraseTextBox");
            this.searchPhraseTextBox.Name = "searchPhraseTextBox";
            this.searchPhraseTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.SearchPhraseTextBox_KeyDown);
            //
            // findLabel
            //
            resources.ApplyResources(this.findLabel, "findLabel");
            this.findLabel.Name = "findLabel";
            //
            // resultsLabel
            //
            resources.ApplyResources(this.resultsLabel, "resultsLabel");
            this.resultsLabel.Name = "resultsLabel";
            //
            // configureTabPage
            //
            this.configureTabPage.Controls.Add(this.catalogListBox);
            this.configureTabPage.Controls.Add(this.saveCatalogButton);
            this.configureTabPage.Controls.Add(this.deleteCatalogButton);
            this.configureTabPage.Controls.Add(this.newCatalogButton);
            this.configureTabPage.Controls.Add(this.catalogListLabel);
            this.configureTabPage.Controls.Add(this.catalogProfileComboBox);
            this.configureTabPage.Controls.Add(this.catalogUrlTextBox);
            this.configureTabPage.Controls.Add(this.catalogDisplayNameTextBox);
            this.configureTabPage.Controls.Add(this.catalogProfileLabel);
            this.configureTabPage.Controls.Add(this.catalogDisplayNameLabel);
            this.configureTabPage.Controls.Add(this.catalogUrlLabel);
            resources.ApplyResources(this.configureTabPage, "configureTabPage");
            this.configureTabPage.Name = "configureTabPage";
            this.configureTabPage.UseVisualStyleBackColor = true;
            this.configureTabPage.Enter += new System.EventHandler(this.ConfigureTabPage_Enter);
            //
            // catalogListBox
            //
            resources.ApplyResources(this.catalogListBox, "catalogListBox");
            this.catalogListBox.FormattingEnabled = true;
            this.catalogListBox.Name = "catalogListBox";
            this.catalogListBox.Sorted = true;
            this.catalogListBox.SelectedIndexChanged += new System.EventHandler(this.CatalogListBox_SelectedIndexChanged);
            //
            // saveCatalogButton
            //
            resources.ApplyResources(this.saveCatalogButton, "saveCatalogButton");
            this.saveCatalogButton.Name = "saveCatalogButton";
            this.tooltip.SetToolTip(this.saveCatalogButton, resources.GetString("saveCatalogButton.ToolTip"));
            this.saveCatalogButton.UseVisualStyleBackColor = true;
            this.saveCatalogButton.Click += new System.EventHandler(this.SaveCatalogButton_Click);
            //
            // deleteCatalogButton
            //
            resources.ApplyResources(this.deleteCatalogButton, "deleteCatalogButton");
            this.deleteCatalogButton.Name = "deleteCatalogButton";
            this.tooltip.SetToolTip(this.deleteCatalogButton, resources.GetString("deleteCatalogButton.ToolTip"));
            this.deleteCatalogButton.UseVisualStyleBackColor = true;
            this.deleteCatalogButton.Click += new System.EventHandler(this.DeleteCatalogButton_Click);
            //
            // newCatalogButton
            //
            resources.ApplyResources(this.newCatalogButton, "newCatalogButton");
            this.newCatalogButton.Name = "newCatalogButton";
            this.tooltip.SetToolTip(this.newCatalogButton, resources.GetString("newCatalogButton.ToolTip"));
            this.newCatalogButton.UseVisualStyleBackColor = true;
            this.newCatalogButton.Click += new System.EventHandler(this.NewCatalogButton_Click);
            //
            // catalogListLabel
            //
            resources.ApplyResources(this.catalogListLabel, "catalogListLabel");
            this.catalogListLabel.Name = "catalogListLabel";
            //
            // catalogProfileComboBox
            //
            resources.ApplyResources(this.catalogProfileComboBox, "catalogProfileComboBox");
            this.catalogProfileComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.catalogProfileComboBox.FormattingEnabled = true;
            this.catalogProfileComboBox.Name = "catalogProfileComboBox";
            this.catalogProfileComboBox.Sorted = true;
            this.catalogProfileComboBox.SelectedIndexChanged += new System.EventHandler(this.CatalogProfileComboBox_SelectedIndexChanged);
            //
            // catalogUrlTextBox
            //
            resources.ApplyResources(this.catalogUrlTextBox, "catalogUrlTextBox");
            this.catalogUrlTextBox.Name = "catalogUrlTextBox";
            this.catalogUrlTextBox.TextChanged += new System.EventHandler(this.CatalogUrlTextBox_TextChanged);
            this.catalogUrlTextBox.MouseHover += new System.EventHandler(this.CatalogUrlTextBox_MouseHover);
            //
            // catalogDisplayNameTextBox
            //
            resources.ApplyResources(this.catalogDisplayNameTextBox, "catalogDisplayNameTextBox");
            this.catalogDisplayNameTextBox.Name = "catalogDisplayNameTextBox";
            this.catalogDisplayNameTextBox.TextChanged += new System.EventHandler(this.CatalogDisplayNameTextBox_TextChanged);
            //
            // catalogProfileLabel
            //
            resources.ApplyResources(this.catalogProfileLabel, "catalogProfileLabel");
            this.catalogProfileLabel.Name = "catalogProfileLabel";
            //
            // catalogDisplayNameLabel
            //
            resources.ApplyResources(this.catalogDisplayNameLabel, "catalogDisplayNameLabel");
            this.catalogDisplayNameLabel.Name = "catalogDisplayNameLabel";
            //
            // catalogUrlLabel
            //
            resources.ApplyResources(this.catalogUrlLabel, "catalogUrlLabel");
            this.catalogUrlLabel.Name = "catalogUrlLabel";
            //
            // helpTabPage
            //
            this.helpTabPage.Controls.Add(this.linkLblAbt);
            this.helpTabPage.Controls.Add(this.linkLblHelp);
            resources.ApplyResources(this.helpTabPage, "helpTabPage");
            this.helpTabPage.Name = "helpTabPage";
            this.helpTabPage.UseVisualStyleBackColor = true;
            //
            // linkLblAbt
            //
            resources.ApplyResources(this.linkLblAbt, "linkLblAbt");
            this.linkLblAbt.Name = "linkLblAbt";
            this.linkLblAbt.TabStop = true;
            this.tooltip.SetToolTip(this.linkLblAbt, resources.GetString("linkLblAbt.ToolTip"));
            this.linkLblAbt.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLblAbt_LinkClicked);
            //
            // linkLblHelp
            //
            resources.ApplyResources(this.linkLblHelp, "linkLblHelp");
            this.linkLblHelp.Name = "linkLblHelp";
            this.linkLblHelp.TabStop = true;
            this.tooltip.SetToolTip(this.linkLblHelp, resources.GetString("linkLblHelp.ToolTip"));
            this.linkLblHelp.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLblHelp_LinkClicked);
            //
            // CswClientDockableWindow
            //
            resources.ApplyResources(this, "$this");
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.mainTabControl);
            this.Name = "CswClientDockableWindow";
            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.CswSearchForm_KeyDown);
            this.resultsSplitContainer.Panel1.ResumeLayout(false);
            this.resultsSplitContainer.Panel2.ResumeLayout(false);
            this.resultsSplitContainer.Panel2.PerformLayout();
            this.resultsSplitContainer.ResumeLayout(false);
            this.mainTabControl.ResumeLayout(false);
            this.findTabPage.ResumeLayout(false);
            this.findTabPage.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.maxResultsNumericUpDown)).EndInit();
            this.configureTabPage.ResumeLayout(false);
            this.configureTabPage.PerformLayout();
            this.helpTabPage.ResumeLayout(false);
            this.helpTabPage.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.ListBox resultsListBox;
        private System.Windows.Forms.TabControl mainTabControl;
        private System.Windows.Forms.TabPage findTabPage;
        private System.Windows.Forms.NumericUpDown maxResultsNumericUpDown;
        private System.Windows.Forms.GroupBox dividerGroupBox;
        private System.Windows.Forms.CheckBox useCurrentExtentCheckBox;
        private System.Windows.Forms.SplitContainer resultsSplitContainer;
        private System.Windows.Forms.Button clearAllFootprinttoolStripButton;
        private System.Windows.Forms.ToolTip tooltip;
        private System.Windows.Forms.Button showAllFootprintToolStripButton;
        private System.Windows.Forms.Button zoomtoFootprintToolStripButton;
        private System.Windows.Forms.Button displayFootprinttoolStripButton;
        private System.Windows.Forms.Button addToMapToolStripButton;
        private System.Windows.Forms.Button downloadMetadataToolStripButton;
        private System.Windows.Forms.Button viewMetadataToolStripButton;
        private System.Windows.Forms.TextBox abstractTextBox;
        private System.Windows.Forms.Label abstractLabel;
        private System.Windows.Forms.Button findButton;
        private System.Windows.Forms.ComboBox catalogComboBox;
        private System.Windows.Forms.Label inCatalogLabel;
        private System.Windows.Forms.CheckBox liveDataAndMapsOnlyCheckBox;
        private System.Windows.Forms.Label maximumLabel;
        private System.Windows.Forms.TextBox searchPhraseTextBox;
        private System.Windows.Forms.Label findLabel;
        private System.Windows.Forms.Label resultsLabel;
        private System.Windows.Forms.TabPage configureTabPage;
        private System.Windows.Forms.ListBox catalogListBox;
        private System.Windows.Forms.Button saveCatalogButton;
        private System.Windows.Forms.Button deleteCatalogButton;
        private System.Windows.Forms.Button newCatalogButton;
        private System.Windows.Forms.Label catalogListLabel;
        private System.Windows.Forms.ComboBox catalogProfileComboBox;
        private System.Windows.Forms.TextBox catalogUrlTextBox;
        private System.Windows.Forms.TextBox catalogDisplayNameTextBox;
        private System.Windows.Forms.Label catalogProfileLabel;
        private System.Windows.Forms.Label catalogDisplayNameLabel;
        private System.Windows.Forms.Label catalogUrlLabel;
        private System.Windows.Forms.TabPage helpTabPage;
        private System.Windows.Forms.LinkLabel linkLblAbt;
        private System.Windows.Forms.LinkLabel linkLblHelp;

    }
}


text:
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using EventSourcing.Poc.EventSourcing.Command;
using EventSourcing.Poc.EventSourcing.Event;
using EventSourcing.Poc.EventSourcing.Mutex;
using EventSourcing.Poc.Messages;
using EventSourcing.Poc.Messages.Post;

namespace EventSourcing.Poc.Domain {
    [CommandHandler]
    [EventHandler]
    public class PostHandler : ICommandHandler<CreatePost>,
        IEventHandler<PostCreated>,
        ICommandHandler<AddToCategory>,
        IEventHandler<AddedToCategory> {
        private readonly IEntityMutexFactory _entityMutexFactory;

        public PostHandler(IEntityMutexFactory entityMutexFactory) {
            _entityMutexFactory = entityMutexFactory;
        }

        public async Task<IReadOnlyCollection<IEvent>> Handle(AddToCategory command) {
            return new List<IEvent> {
                new AddedToCategory {
                    Id = command.Id,
                    Category = command.Category
                }
            };
        }

        public async Task<IReadOnlyCollection<IEvent>> Handle(CreatePost command) {
            var author = new Author {
                Id = Guid.Parse("10b7497e-6dfb-4add-a7eb-14c3b69feaad"),
                Firstname = "Anonymous",
                Lastname = "Anonymous"
            };
            await _entityMutexFactory.CreateAndLock(author);
            return new List<IEvent> {
                new PostCreated(Guid.NewGuid(), command.Title, command.Content)
            };
        }

        public async Task<IReadOnlyCollection<IAction>> Handle(AddedToCategory @event) {
            return new List<IAction>();
        }

        public async Task<IReadOnlyCollection<IAction>> Handle(PostCreated @event) {
            return new List<IAction> {
                new AddToCategory {
                    Id = @event.Id,
                    Category = "My Category"
                }
            };
        }
    }
}


text:
To schedule the "immediate" execution of `callback` after I/O events
callbacks and before `setTimeout` and `setInterval` . Returns an
`immediateObject` for possible use with `clearImmediate()`. Optionally you
can also pass arguments to the callback.

Callbacks for immediates are queued in the order in which they were created.
The entire callback queue is processed every event loop iteration. If you queue
an immediate from inside an executing callback, that immediate won't fire
until the next event loop iteration.


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="canonical" href="http://maxwirt.com/contact/">
    <link rel="stylesheet" href="/assets/main-f2d84b2383227c9ca7feb82468ac3a3d.css">
    <title>Contact | Max Wirt!</title>
    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
    <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
    <link rel="manifest" href="/manifest.json">
    <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#ffc40d">
    <meta name="theme-color" content="#ffffff">

Max Wirt

Work

CV

Contact

Sent! I will get back to you soon.

<form id="gform" method="POST" action="https://script.google.com/a/sincerely.tv/macros/s/AKfycbxkUifMwDCeQCnnMGE-ztMSBS9_sZazUk-BGpkpkv_4NexeQFnc/exec">

Say hello!

  <input id="name" type="text" name="name" placeholder="name" class="form-name" autofocus/>
  <input id="email" type="text" name="email" placeholder="email" class="form-email"/>
  <textarea id="message" type="text" name="message" placeholder="message" class="form-message" rows=5></textarea>

                <button id="contact-btn" type='submit'>send</button>

please enter a valid email address

</form>


text:
package no.ntnu.assignmentsystem.editor.akka.messages;

import java.io.Serializable;

public class PluginUpdateSourceCode implements Serializable {
	private static final long serialVersionUID = 1L;

	public final String packageName;
	public final String fileName;
	public final String sourceCode;

	public PluginUpdateSourceCode(String packageName, String fileName, String sourceCode) {
		this.packageName = packageName;
		this.fileName = fileName;
		this.sourceCode = sourceCode;
	}
}


text:
import {
  SET_CURRENT_USER,
  GET_USER,
  EDIT_PROFILE,
  SAVE_PROFILE_IMAGE
} from '../actions/types';

const INITIAL_STATE = {
  userExist: '',
  user: {},
  userProfile: {},
  imageDetails: ''
};

/**
 * reducer - contains the reducer
 *
 * @param  {object} state the initial state
 *
 * @param  {object} action the action
 *
 * @return {Object} returns an Object
 *
 */
const authReducer = (state = INITIAL_STATE, action) => {
  switch (action.type) {
  case SET_CURRENT_USER:
    return {
      ...state,
      user: action.user,
      authenticated: true
    };
  case SAVE_PROFILE_IMAGE:
    return {
      ...state,
      imageDetails: action.payload
    };
  case GET_USER:
    return {
      ...state,
      userProfile: action.user.data
    };
  case EDIT_PROFILE:
    return {
      ...state,
      userProfile: action.user.data
    };
  default:
    return state;
  }
};

export default authReducer;


text:
/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author Tobias Koppers @sokra
*/

"use strict";

const WebpackError = require("../WebpackError");
const {
	evaluateToString,
	toConstantDependency
} = require("../javascript/JavascriptParserHelpers");
const makeSerializable = require("../util/makeSerializable");
const RequireIncludeDependency = require("./RequireIncludeDependency");

module.exports = class RequireIncludeDependencyParserPlugin {
	constructor(warn) {
		this.warn = warn;
	}
	apply(parser) {
		const { warn } = this;
		parser.hooks.call
			.for("require.include")
			.tap("RequireIncludeDependencyParserPlugin", expr => {
				if (expr.arguments.length !== 1) return;
				const param = parser.evaluateExpression(expr.arguments[0]);
				if (!param.isString()) return;

				if (warn) {
					parser.state.module.addWarning(
						new RequireIncludeDeprecationWarning(expr.loc)
					);
				}

				const dep = new RequireIncludeDependency(param.string, expr.range);
				dep.loc = expr.loc;
				parser.state.current.addDependency(dep);
				return true;
			});
		parser.hooks.evaluateTypeof
			.for("require.include")
			.tap("RequireIncludePlugin", expr => {
				if (warn) {
					parser.state.module.addWarning(
						new RequireIncludeDeprecationWarning(expr.loc)
					);
				}
				return evaluateToString("function")(expr);
			});
		parser.hooks.typeof
			.for("require.include")
			.tap("RequireIncludePlugin", expr => {
				if (warn) {
					parser.state.module.addWarning(
						new RequireIncludeDeprecationWarning(expr.loc)
					);
				}
				return toConstantDependency(parser, JSON.stringify("function"))(expr);
			});
	}
};

class RequireIncludeDeprecationWarning extends WebpackError {
	constructor(loc) {
		super("require.include() is deprecated and will be removed soon.");

		this.name = "RequireIncludeDeprecationWarning";

		this.loc = loc;
	}
}

makeSerializable(
	RequireIncludeDeprecationWarning,
	"webpack/lib/dependencies/RequireIncludeDependencyParserPlugin",
	"RequireIncludeDeprecationWarning"
);


text:
<!doctype html>
<html ng-app="app" lang="es">

<head>
    <meta charset="UTF-8">
    <title>Spotisearch</title>
    <link rel="icon" type="image/x-icon" href="/img/favicon.ico">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="https://fonts.googleapis.com/css?family=Roboto:400,500,700" rel="stylesheet">
    <base href="/">
</head>

<body>
    <app-auth></app-auth>
    <div ui-view></div>
    <web-player></web-player>
</body>

</html>


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#ffffff"
    android:orientation="vertical" >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp" >

        <ImageView
            android:id="@+id/frienditem_head"
            android:layout_width="45dp"
            android:layout_height="45dp"
            android:layout_alignParentLeft="true"
            android:layout_centerVertical="true"
            android:src="@drawable/head_default" />

        <TextView
            android:id="@+id/frienditem_msg"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_marginLeft="10dp"
            android:layout_toRightOf="@id/frienditem_head"
            android:gravity="center_vertical"
            android:paddingLeft="10dp"
            android:textColor="#000000"
            android:textSize="18sp" />

        <ImageView
            android:id="@+id/frienditem_arrow"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:layout_marginRight="18dp"
            android:src="@drawable/arrow" />
    </RelativeLayout>

</LinearLayout>


text:
package com.icegreen.greenmail.util;

/**
 * Generic lifecycle handling of a service.
 *

 * Used by email protocol specific services, such as SmtpServer.
 *
 * @author Wael Chatila
 * @version $id: $
 * @since 2005
 */
public interface Service {
    /**
     * Starts the service in the background as a new thread.
     *

     * You can use {@link #isRunning()}  and {@link #waitTillRunning(long)} to check if service is up.
     */
    void startService();

    /**
     * Stops the service.
     *

     * Blocks till the service stopped.
     */
    void stopService();

    /**
     * Stops the service.
     *

     * Blocks till the service stopped.
     *

     * If a timeout is given and the service has still not
     * gracefully been stopped after timeout ms the service is stopped by force.
     *
     * @param timeoutInMs the timeout in milliseconds
     */
    void stopService(long timeoutInMs);

    /**
     * Checks if service is up and running.
     *
     * @return true, if running.
     */
    boolean isRunning();

    /**
     * Waits till service is up or timeout was reached.
     *
     * @param timeoutInMs the timeout in milliseconds
     * @throws InterruptedException if interrupted while waiting.
     * @return true, if running otherwise false if timeout was reached.
     */
    boolean waitTillRunning(long timeoutInMs) throws InterruptedException;
}


text:
<?php

final class PhabricatorObjectQuery
  extends PhabricatorCursorPagedPolicyAwareQuery {

  private $phids = array();
  private $names = array();
  private $types;

  private $namedResults;

  public function withPHIDs(array $phids) {
    $this->phids = $phids;
    return $this;
  }

  public function withNames(array $names) {
    $this->names = $names;
    return $this;
  }

  public function withTypes(array $types) {
    $this->types = $types;
    return $this;
  }

  protected function loadPage() {
    if ($this->namedResults === null) {
      $this->namedResults = array();
    }

    $types = PhabricatorPHIDType::getAllTypes();
    if ($this->types) {
      $types = array_select_keys($types, $this->types);
    }

    $names = array_unique($this->names);
    $phids = $this->phids;

    // We allow objects to be named by their PHID in addition to their normal
    // name so that, e.g., CLI tools which accept object names can also accept
    // PHIDs and work as users expect.
    $actually_phids = array();
    if ($names) {
      foreach ($names as $key => $name) {
        if (!strncmp($name, 'PHID-', 5)) {
          $actually_phids[] = $name;
          $phids[] = $name;
          unset($names[$key]);
        }
      }
    }

    $phids = array_unique($phids);

    if ($names) {
      $name_results = $this->loadObjectsByName($types, $names);
    } else {
      $name_results = array();
    }

    if ($phids) {
      $phid_results = $this->loadObjectsByPHID($types, $phids);
    } else {
      $phid_results = array();
    }

    foreach ($actually_phids as $phid) {
      if (isset($phid_results[$phid])) {
        $name_results[$phid] = $phid_results[$phid];
      }
    }

    $this->namedResults += $name_results;

    return $phid_results + mpull($name_results, null, 'getPHID');
  }

  public function getNamedResults() {
    if ($this->namedResults === null) {
      throw new PhutilInvalidStateException('execute');
    }
    return $this->namedResults;
  }

  private function loadObjectsByName(array $types, array $names) {
    $groups = array();
    foreach ($names as $name) {
      foreach ($types as $type => $type_impl) {
        if (!$type_impl->canLoadNamedObject($name)) {
          continue;
        }
        $groups[$type][] = $name;
        break;
      }
    }

    $results = array();
    foreach ($groups as $type => $group) {
      $results += $types[$type]->loadNamedObjects($this, $group);
    }

    return $results;
  }

  private function loadObjectsByPHID(array $types, array $phids) {
    $results = array();

    $groups = array();
    foreach ($phids as $phid) {
      $type = phid_get_type($phid);
      $groups[$type][] = $phid;
    }

    $in_flight = $this->getPHIDsInFlight();
    foreach ($groups as $type => $group) {
      // We check the workspace for each group, because some groups may trigger
      // other groups to load (for example, transactions load their objects).
      $workspace = $this->getObjectsFromWorkspace($group);

      foreach ($group as $key => $phid) {
        if (isset($workspace[$phid])) {
          $results[$phid] = $workspace[$phid];
          unset($group[$key]);
        }
      }

      if (!$group) {
        continue;
      }

      // Don't try to load PHIDs which are already "in flight"; this prevents
      // us from recursing indefinitely if policy checks or edges form a loop.
      // We will decline to load the corresponding objects.
      foreach ($group as $key => $phid) {
        if (isset($in_flight[$phid])) {
          unset($group[$key]);
        }
      }

      if ($group && isset($types[$type])) {
        $this->putPHIDsInFlight($group);
        $objects = $types[$type]->loadObjects($this, $group);

        $map = mpull($objects, null, 'getPHID');
        $this->putObjectsInWorkspace($map);
        $results += $map;
      }
    }

    return $results;
  }

  protected function didFilterResults(array $filtered) {
    foreach ($this->namedResults as $name => $result) {
      if (isset($filtered[$result->getPHID()])) {
        unset($this->namedResults[$name]);
      }
    }
  }

  /**
   * This query disables policy filtering if the only required capability is
   * the view capability.
   *
   * The view capability is always checked in the subqueries, so we do not need
   * to re-filter results. For any other set of required capabilities, we do.
   */
  protected function shouldDisablePolicyFiltering() {
    $view_capability = PhabricatorPolicyCapability::CAN_VIEW;
    if ($this->getRequiredCapabilities() === array($view_capability)) {
      return true;
    }
    return false;
  }

  public function getQueryApplicationClass() {
    return null;
  }

  /**
   * Select invalid or restricted PHIDs from a list.
   *
   * PHIDs are invalid if their objects do not exist or can not be seen by the
   * viewer. This method is generally used to validate that PHIDs affected by
   * a transaction are valid.
   *
   * @param PhabricatorUser Viewer.
   * @param list<phid> List of ostensibly valid PHIDs.
   * @return list<phid> List of invalid or restricted PHIDs.
   */
  public static function loadInvalidPHIDsForViewer(
    PhabricatorUser $viewer,
    array $phids) {

    if (!$phids) {
      return array();
    }

    $objects = id(new PhabricatorObjectQuery())
      ->setViewer($viewer)
      ->withPHIDs($phids)
      ->execute();
    $objects = mpull($objects, null, 'getPHID');

    $invalid = array();
    foreach ($phids as $phid) {
      if (empty($objects[$phid])) {
        $invalid[] = $phid;
      }
    }

    return $invalid;
  }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<lint>
    <issue id="InlinedApi">
        <ignore path="src/com/example/mysql_tester/DetailItem.java" />
    </issue>
    <issue id="NewApi">
        <ignore path="src/com/example/mysql_tester/DetailItem.java" />
    </issue>
</lint>


text:
<!DOCTYPE html>

	<meta charset="UTF-8">
	<title>fSelector</title>
	<link type="text/css" rel="stylesheet" href="./other/bootstrap.css">
	<link type="text/css" rel="stylesheet" href="./css/fSelect.css">

				<select name="project" multiple>
					<option>Please Choose</option>
					<option value="1">Team A</option>
					<option value="2">Team B</option>
					<option value="3">Team C</option>
					<option value="4">Team D</option>
					<option value="5">Team E</option>
					<option value="6">Team F</option>
					<option value="7">Team G</option>
					<option value="8">Team H</option>
					<option value="9">Team I</option>
					<option value="10" data-parent='1'>Project 1</option>
					<option value="11" data-parent='1'>Project 2</option>
					<option value="12" data-parent='1'>Project 3</option>
					<option value="13" data-parent='2'>Project 1</option>
					<option value="14" data-parent='2'>Project 2</option>
					<option value="15" data-parent='3'>Project 1</option>
					<option value="16" data-parent='3'>Project 2</option>
					<option value="17" data-parent='4'>Project X</option>
					<option value="18" data-parent='17'>Project Y</option>
					<option value="19" data-parent='17'>Project Z</option>
				</select>