text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using Accounts;
using CoreGraphics;
using Foundation;
using Social;
using Newtonsoft.Json.Linq;

namespace TwitterImagePipelineDemo
{
	public class TwitterApi
	{
		private static Lazy<TwitterApi> sharedInstance = new Lazy<TwitterApi>(() => new TwitterApi());

		private ACAccount account;
		private ACAccountStore accountStore;
		private Task loadingAccount;

		private TwitterApi()
		{
			accountStore = new ACAccountStore();

			loadingAccount = LoadAccountAsync();
		}

		public static TwitterApi SharedInstance => sharedInstance.Value;

		public async Task<List<TweetInfo>> SearchAsync(string term, int count)
		{
			await LoadAccountAsync();

			Debug.WriteLine($"Searching for '{term}'");

			if (account == null)
				throw new Exception("Couldn't open Twitter account!");
			if (term == null)
				throw new Exception("Null search term!");

			// create the Twitter search request
			var requestUrl = new NSUrl($"https://api.twitter.com/1.1/search/tweets.json?count={count}&q={Uri.EscapeUriString(term)}");
			var request = SLRequest.Create(SLServiceKind.Twitter, SLRequestMethod.Get, requestUrl, new NSDictionary());
			request.Account = account;
			var preparedRequest = request.GetPreparedUrlRequest();

			if (preparedRequest == null)
				throw new Exception("Couldn't construct request!");

			var taskRequest = await NSUrlSession.SharedSession.CreateDataTaskAsync(preparedRequest);

			var statusCode = ((NSHttpUrlResponse)taskRequest.Response).StatusCode;
			if (statusCode != 200)
				throw new Exception($"HTTP Code {statusCode}");

			var parsedResponse = ParseResponse(taskRequest.Data);
			if (parsedResponse == null)
				throw new Exception("Failed to parse response!");

			Debug.WriteLine("Search completed!");

			return parsedResponse;
		}

		private List<TweetInfo> ParseResponse(NSData data)
		{
			var tweets = new List<TweetInfo>();

			var json = JObject.Parse(data.ToString());
			foreach (var status in json["statuses"])
			{
				var user = status["user"];
				var handle = (string)user["screen_name"];
				if (!string.IsNullOrEmpty(handle))
				{
					var tweet = new TweetInfo
					{
						Text = (string)status["text"],
						Handle = handle
					};
					tweets.Add(tweet);

					var sensitive = (bool?)status["possibly_sensitive"];
					if (!sensitive.HasValue || !sensitive.Value)
					{
						var entities = status["entities"];
						if (entities != null)
						{
							var media = entities["media"];
							if (media != null)
							{
								foreach (var mediaItem in media)
								{
									var type = (string)mediaItem["type"];
									if (type == "photo")
									{
										var imageUrlString = (string)mediaItem["media_url_https"];
										var format = Path.GetExtension(imageUrlString).Substring(1);
										var sizes = mediaItem["sizes"];
										var largeVariant = sizes["large"];
										var w = (int)largeVariant["w"];
										var h = (int)largeVariant["h"];

										var imageInfo = new TweetImageInfo
										{
											Format = format,
											MediaUrl = imageUrlString,
											MediaUrlWithoutExtension = imageUrlString.Substring(0, imageUrlString.Length - format.Length - 1),
											OriginalDimensions = new CGSize(w, h)
										};
										tweet.Images.Add(imageInfo);
									}
								}
							}
						}
					}
				}
			}

			return (tweets.Count > 0) ? tweets : null;
		}

		private async Task LoadAccountAsync()
		{
			if (account != null)
			{
				return;
			}

			if (loadingAccount != null)
			{
				await Task.WhenAny(loadingAccount);
				return;
			}

			Debug.WriteLine("Accessing Twitter Account...");
			WorkStarted?.Invoke(this, EventArgs.Empty);

			var type = accountStore.FindAccountType(ACAccountType.Twitter);
			var result = await accountStore.RequestAccessAsync(type, null);

			if (result.Item1)
			{
				account = accountStore.Accounts[0];
				Debug.WriteLine($"Access granted: {account.Username}");
			}
			else
			{
				Debug.WriteLine("Access denied!");
			}

			WorkFinished?.Invoke(this, EventArgs.Empty);

			loadingAccount = null;
		}

		public event EventHandler WorkStarted;
		public event EventHandler WorkFinished;
	}

	public class TweetImageInfo
	{
		public string MediaUrl { get; set; }
		public string MediaUrlWithoutExtension { get; set; }
		public string Format { get; set; }
		public CGSize OriginalDimensions { get; set; }
	}

	public class TweetInfo
	{
		public string Handle { get; set; }
		public string Text { get; set; }
		public List<TweetImageInfo> Images { get; set; } = new List<TweetImageInfo>();
	}
}


text:
class UserAction::Favorite < UserAction::Base
  include Mongoid::Document
end

redpajama_set_name: RedPajamaGithub


text:
package com.vmware.vim25;

/**
@author Steve Jin (sjin@vmware.com)
*/

public class HostSyncFailedEvent extends HostEvent
{
  public LocalizedMethodFault reason;

  public LocalizedMethodFault getReason()
  {
    return this.reason;
  }

  public void setReason(LocalizedMethodFault reason)
  {
    this.reason=reason;
  }
}


text:
class Pages < ActiveRecord::Base

   def self.search(search)
    where("primer_nombre like '%#{search}%'  or segundo_nombre like '%#{search}%'
    or primer_apellido like '%#{search}%'  or segundo_apellido like '%#{search}%'
    or email like '%#{search}%' or documento like '%#{search}%'
    or nombre_completo like '%#{search}%' ").page(params[:page]).per_page(8)

  end

end


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.Navigation;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.VisualStudio.GraphModel;
using Microsoft.VisualStudio.GraphModel.CodeSchema;
using Microsoft.VisualStudio.GraphModel.Schemas;
using Roslyn.Utilities;

namespace Microsoft.VisualStudio.LanguageServices.Implementation.Progression
{
    internal sealed class GraphNavigatorExtension : ForegroundThreadAffinitizedObject, IGraphNavigateToItem
    {
        private readonly Workspace _workspace;

        public GraphNavigatorExtension(Workspace workspace)
        {
            _workspace = workspace;
        }

        public void NavigateTo(GraphObject graphObject)
        {
            var graphNode = graphObject as GraphNode;

            if (graphNode != null)
            {
                var sourceLocation = graphNode.GetValue<SourceLocation>(CodeNodeProperties.SourceLocation);
                if (sourceLocation.FileName == null)
                {
                    return;
                }

                var projectId = graphNode.GetValue<ProjectId>(RoslynGraphProperties.ContextProjectId);
                var symbolId = graphNode.GetValue<SymbolKey?>(RoslynGraphProperties.SymbolId);

                if (projectId != null)
                {
                    var solution = _workspace.CurrentSolution;
                    var project = solution.GetProject(projectId);

                    if (project == null)
                    {
                        return;
                    }

                    var document = project.Documents.FirstOrDefault(
                        d => string.Equals(
                            d.FilePath,
                            sourceLocation.FileName.LocalPath,
                            StringComparison.OrdinalIgnoreCase));

                    if (document == null)
                    {
                        return;
                    }

                    if (IsForeground())
                    {
                        // If we are already on the UI thread, invoke NavigateOnForegroundThread
                        // directly to preserve any existing NewDocumentStateScope.
                        NavigateOnForegroundThread(sourceLocation, symbolId, project, document);
                    }
                    else
                    {
                        // Navigation must be performed on the UI thread. If we are invoked from a
                        // background thread then the current NewDocumentStateScope is unrelated to
                        // this navigation and it is safe to continue on the UI thread
                        // asynchronously.
                        Task.Factory.SafeStartNew(
                            () => NavigateOnForegroundThread(sourceLocation, symbolId, project, document),
                            CancellationToken.None,
                            ForegroundTaskScheduler);
                    }
                }
            }
        }

        private void NavigateOnForegroundThread(SourceLocation sourceLocation, SymbolKey? symbolId, Project project, Document document)
        {
            AssertIsForeground();

            // Notify of navigation so third parties can intercept the navigation
            if (symbolId != null)
            {
                var symbolNavigationService = _workspace.Services.GetService<ISymbolNavigationService>();
                var symbol = symbolId.Value.Resolve(project.GetCompilationAsync(CancellationToken.None).WaitAndGetResult(CancellationToken.None)).Symbol;

                // Do not allow third party navigation to types or constructors
                if (symbol != null &&
                    !(symbol is ITypeSymbol) &&
                    !symbol.IsConstructor() &&
                    symbolNavigationService.TrySymbolNavigationNotify(symbol, project.Solution))
                {
                    return;
                }
            }

            if (sourceLocation.IsValid)
            {
                // We must find the right document in this project. This may not be the
                // ContextDocumentId if you have a partial member that is shown under one
                // document, but only exists in the other

                if (document != null)
                {
                    var editorWorkspace = document.Project.Solution.Workspace;
                    var navigationService = editorWorkspace.Services.GetService<IDocumentNavigationService>();
                    navigationService.TryNavigateToLineAndOffset(
                        editorWorkspace,
                        document.Id,
                        sourceLocation.StartPosition.Line,
                        sourceLocation.StartPosition.Character);
                }
            }
        }

        public int GetRank(GraphObject graphObject)
        {
            var graphNode = graphObject as GraphNode;

            if (graphNode != null)
            {
                var sourceLocation = graphNode.GetValue<SourceLocation>(CodeNodeProperties.SourceLocation);
                var projectId = graphNode.GetValue<ProjectId>(RoslynGraphProperties.ContextProjectId);

                if (sourceLocation.IsValid && projectId != null)
                {
                    return GraphNavigateToItemRanks.OwnItem;
                }
            }

            return GraphNavigateToItemRanks.CanNavigateToItem;
        }
    }
}


text:
const dynamic = {
    init: () => {
        alert('dynamic named test');
    }
};

export default dynamic;


text:
package com.meancat.usefully.messaging.mapping.key;

import java.lang.reflect.Method;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.meancat.usefully.messaging.mapping.MappingException;
import com.meancat.usefully.messaging.messages.MessageHeader;

/**
 * This is the 'classic' Key format.
 *
 *
 *
 * static handler mappings come in three types:
 *      public void handleSomeCmrsThing(MessageHeader header, GetCustomGameServerIdRequest request);
 * or
 *  (deprecated form...)
 *      public void handleSomeCustomThing(MessageHeader header, CustomGameServerRequest request, MyCustomPayload payload);
 * or
 *      public void handleSomeCustomThing(MessageHeader header, Object anything, MyCustomPayload payload);
 * or
 *      public void handleSomeCustomThing(MessageHeader header, MyCustomPayload payload);
 *
 * and we want to determine the static mapping based on the type of the payload.
 *
 */
public class MessageHeaderKeyStrategy implements StaticKeyStrategy {
    private static final Logger logger = LoggerFactory.getLogger(MessageHeaderKeyStrategy.class);

    @Override
    public Class<?> determineKey(Class<?> handlerClass, Method method) throws Exception{
        Class<?>[] paramTypes = method.getParameterTypes();
        if (paramTypes.length < 2) {
            logger.error("This handler method doesn't have enough param methods! {}.{}",
                    handlerClass.getName(),  method.getName());
            throw new MappingException(
                    String.format("This handler method doesn't have correct number of parameters and seems to be broken: %s.%s",
                            handlerClass.getName(),  method.getName()));
        }

        if (!MessageHeader.class.isAssignableFrom(paramTypes[0])) {
            logger.error("This handler is broken! {}.{} does not have something implementing 'MessageHeader' type as first parameter.",
                    handlerClass.getName(), method.getName());
            throw new MappingException(
                    String.format("This handler does not have 'MessageHeader' type as first parameter: %s.%s",
                            handlerClass.getName(),  method.getName()));
        }
        if (paramTypes.length == 3) {
            return paramTypes[2];
        } else {
            return paramTypes[1];
        }
    }
}


text:
using Dotissi.AzureTable.LiteClient.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

namespace Dotissi.AzureTable.LiteClient
{
    public class AzureTableClient
    {

        string uri;
        string accountName;
        string accountKey;
        public AzureTableClient(string accountName,string accountKey)
        {
            this.accountName = accountName;
            this.accountKey = accountKey;
            this.uri = string.Format("https://{0}.table.core.windows.net", accountName);
        }
        public AzureTableClient(string uri, string accountName, string accountKey)
        {
            this.accountName = accountName;
            this.accountKey = accountKey;
            this.uri = uri;
        }
        public AzureTable GetTableReference(string tableName)
        {
            return new AzureTable(this.uri, this.accountName, this.accountKey, tableName);
        }

    }
}


text:
import SpanContext from '../span_context.js';

// startSpanOptions is used to type-check Trace.startSpan() options.
declare type startSpanOptions = {
  operationName?: string,
  childOf?: SpanContext,
  references?: Array<Reference>,
  tags?: any,
  startTime?: number,
};


text:
package org.jfw.util.log;

public class LogFactory
{
    private static String classNameForLogFactory;
	private static volatile LogFactory defaule  = new LogFactory();
	private static Logger defaultLog = new NoLogger();

	public Logger getLogger(Class<?> clazz)
	{
		return LogFactory.defaultLog;
	}

	public static Logger getLog(Class<?> clazz)
	{
		return LogFactory.defaule.getLogger(clazz);
	}
	public static void init(){
	    try {
            LogFactory lf = (LogFactory)Class.forName(classNameForLogFactory).newInstance();
            if(lf!=null) defaule = lf;
        } catch (Throwable th) {
        }
	}
}


text:
#include <SkCanvas.h>
#include <algorithm>

#include <utils/Trace.h>

#include "Debug.h"
#include "DisplayList.h"
#include "RenderNode.h"

#if HWUI_NEW_OPS
#include "RecordedOp.h"
#else
#include "DisplayListOp.h"
#endif

namespace android {
namespace uirenderer {

DisplayList::DisplayList()
        : projectionReceiveIndex(-1)
        , stdAllocator(allocator)
        , chunks(stdAllocator)
        , ops(stdAllocator)
        , children(stdAllocator)
        , bitmapResources(stdAllocator)
        , pathResources(stdAllocator)
        , patchResources(stdAllocator)
        , paints(stdAllocator)
        , regions(stdAllocator)
        , referenceHolders(stdAllocator)
        , functors(stdAllocator)
        , pushStagingFunctors(stdAllocator)
        , hasDrawOps(false) {
}

DisplayList::~DisplayList() {
    cleanupResources();
}

void DisplayList::cleanupResources() {
    if (CC_UNLIKELY(patchResources.size())) {
        ResourceCache& resourceCache = ResourceCache::getInstance();
        resourceCache.lock();

        for (size_t i = 0; i < patchResources.size(); i++) {
            resourceCache.decrementRefcountLocked(patchResources[i]);
        }

        resourceCache.unlock();
    }

    for (size_t i = 0; i < pathResources.size(); i++) {
        const SkPath* path = pathResources[i];
        if (path->unique() && Caches::hasInstance()) {
            Caches::getInstance().pathCache.removeDeferred(path);
        }
        delete path;
    }

    for (auto& iter : functors) {
        if (iter.listener) {
            iter.listener->onGlFunctorReleased(iter.functor);
        }
    }

    patchResources.clear();
    pathResources.clear();
    paints.clear();
    regions.clear();
}

size_t DisplayList::addChild(NodeOpType* op) {
    referenceHolders.push_back(op->renderNode);
    size_t index = children.size();
    children.push_back(op);
    return index;
}

}; // namespace uirenderer
}; // namespace android


text:
<?php

class Metro_Creativex_Message extends WP_Customize_Control{

    private $message = '';

    public function __construct( $manager, $id, $args = array() ) {
        parent::__construct( $manager, $id, $args );
        if(!empty($args['metro_message'])){
            $this->message = $args['metro_message'];
        }
    }

    public function render_content(){
        echo ''.$this->label.'';
        echo $this->message;
    }

}

?>


text:
require 'singleton'
require 'ostruct'
module Frank
  class Settings
    include Singleton

    attr_accessor :environment
    attr_accessor :root

    attr_accessor :server
    attr_accessor :options
    attr_accessor :static_folder
    attr_accessor :dynamic_folder
    attr_accessor :layouts_folder
    attr_accessor :export
    attr_accessor :publish
    attr_accessor :sass_options
    attr_accessor :haml_options

    def initialize
      reset
    end

    # Reset settings to the defaults
    def reset
      # reset server settings
      @server = OpenStruct.new
      @server.handler = "mongrel"
      @server.hostname = "0.0.0.0"
      @server.port = "3601"

      # reset options
      @options = OpenStruct.new

      # export settings
      @export = OpenStruct.new
      @export.path = "exported"
      @export.silent = false
      @export.force = false

      # publish options
      @publish = OpenStruct.new
      @publish.host = nil
      @publish.path = nil
      @publish.username = nil
      @publish.password = nil
      @publish.mode = nil

      # setup folders
      @static_folder = "static"
      @dynamic_folder = "dynamic"
      @layouts_folder = "layouts"

      # setup 3rd party configurations
      @sass_options = {}
      @haml_options = {}
    end

    # return the proj folder name
    def proj_name
      @root.split('/').last
    end

    # Are we serving up a raw static folder?
    def serving_static?
      @serving_static
    end

    # Mark this Frank run as serving static
    def serving_static!
      @serving_static = true
    end

    # Check to see if we're compiling
    def exporting?
      @exporting
    end

    # Mark this Frank run as compiling
    def exporting!
      @exporting = true
    end

    # Silent export if set or in test
    def silent_export?
      @environment == :test || @export.silent
    end

    # Check to see if we're in production mode
    def production?
      @production
    end

    # Mark this Frank run as production
    def production!
      @production = true
    end

    # Force overwrite export folder if it exists
    def force_export!
      @export.force = true
    end

    # Mark this Frank run as publishing
    def publishing!
      @exporting  = true
      @production = true
    end

  end
end


text:
module Selection

# Linear ranking assignment. Ranking sorts the population by the certain criteria and
# asigns the :rank value and the non-negative :proportion value to each individual.
# The best individual obtains :rank==0 and the the biggest :proportion value, the worst
# individual obtains the biggest :rank value and the smallest :proportion value.
#
# See
# http://reference.kfupm.edu.sa/content/c/o/a_comparative_analysis_of_selection_sche_73937.pdf
#
class Ranking

  # The result of ranking assignment for a single population member:
  #   original .. the original individual object
  #   rank .. Ranking. The best individuals obtain 0, the second ones 1, etc. Note that more individuals with the same
  #           (fitness) criterion value can share the same rank value.
  #   proportion = min + (max-min) * (N-rank)/N
  #   index .. index (order) in the original population.
  RankedFields = Struct.new( 'RankedFields', :original, :rank, :proportion, :index )

  # Initialize the ranker. See attributes and Ranking#rank method.
  def initialize order_by=nil, direction=nil, &block
    set_order( order_by, direction, block )
    @max = 1.1
    @min = 2.0 - @max
  end

  # The :proportion value of the best individual. Default is 1.1
  attr_accessor :max

  # The :proportion value of the worst individual. Default is 0.9
  attr_accessor :min

  # The symbol used as the sorting key. The value for ordering is retireved by calling:
  #   individual.send(order_by)
  attr_reader :order_by

  # The sorting direction. Expected values are: :maximize, :minimize.
  attr_reader :direction

  # If the block was given to the constructor, calls
  #   { |original, rank, proportion| ... }
  # for each population and returns the population container.
  #
  # Otherwise it returns the array of the RankedFields structures, one for each population member.
  def rank population
    ranked = population.map { |orig| RankedFields.new orig }
    raise "Ranking: empty population" if ranked.empty?
    ranked.each_with_index { |individual, i| individual.index = i }
    ranked.sort! { |a,b| @order.call( a.original, b.original ) }

    rank = 0
    ranked.each_with_index do |individual, index|
      individual.rank = rank
      break if index == ranked.size-1
      rank += 1 unless 0 == @order.call( individual.original, ranked[index+1].original )
    end

    min = @min.to_f
    amplitude = @max.to_f-min
    rank = rank==0 ? 1.0 : rank.to_f
    ranked.each { |individual| individual.proportion = min+amplitude*(rank-individual.rank)/rank }

    if block_given?
      ranked.each { |r| yield( population[r.index], r.rank, r.proportion ) }
      return population
    else
      return ranked
    end
  end

  # Set the order_by attribute.
  def order_by= order_by
    set_order( order_by, @direction, nil )
  end

  # Set the direction attribute.
  def direction= direction
    set_order( @order_by, direction, nil )
  end

  protected

  def set_order( order_by, direction, block )
    if block.nil?
      @order_by = order_by
      @direction = direction
      if order_by.nil?
        @order = proc {|a,b| a <=> b }
      else
        case direction
          when :maximize, nil
            @order = proc {|a,b| b.send(order_by) <=> a.send(order_by) }
            @direction = :maximize
          when :minimize
            @order = proc {|a,b| a.send(order_by) <=> b.send(order_by) }
          else
            raise "Ranking: unsupported direction argument"
        end
      end
    else
      @order = block
      @order_by = nil
      @direction = nil
    end
  end

end

end # Selection


text:
/*
    menu - quote
*/
import $ from '../../util/dom-core.js'
import { UA } from '../../util/util.js'

// 构造函数
function Quote(editor) {
    this.editor = editor
    this.$elem = $(
        `<div class="w-e-menu">
            <i class="w-e-icon-quotes-left"><i/>
        </div>`
    )
    this.type = 'click'

    // 当前是否 active 状态
    this._active = false
}

// 原型
Quote.prototype = {
    constructor: Quote,

    onClick: function (e) {
        const editor = this.editor
        if (!UA.isIE()) {
            editor.cmd.do('formatBlock', '<BLOCKQUOTE>')
            return
        }

        // IE 中不支持 formatBlock <BLOCKQUOTE> ,要用其他方式兼容

        const $selectionElem = editor.selection.getSelectionContainerElem()
        let content, $targetELem
        if ($selectionElem.getNodeName() === 'P') {
            // 将 P 转换为 quote
            content = $selectionElem.text()
            $targetELem = $(`<blockquote>${content}</blockquote>`)
            $targetELem.insertAfter($selectionElem)
            $selectionElem.remove()
            return
        }
        if ($selectionElem.getNodeName() === 'BLOCKQUOTE') {
            // 撤销 quote
            content = $selectionElem.text()
            $targetELem = $(`<p>${content}</p>`)
            $targetELem.insertAfter($selectionElem)
            $selectionElem.remove()
        }
    },

    tryChangeActive: function (e) {
        const editor = this.editor
        const $elem = this.$elem
        const reg = /^BLOCKQUOTE$/i
        const cmdValue = editor.cmd.queryCommandValue('formatBlock')
        if (reg.test(cmdValue)) {
            this._active = true
            $elem.addClass('w-e-active')
        } else {
            this._active = false
            $elem.removeClass('w-e-active')
        }
    }
}

export default Quote


text:
<?php

namespace Bankrot\SiteBundle\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
 *
 * @ORM\Table()
 * @ORM\Entity
 */
class WarningComment extends BaseEntity
{
    /**
     * @ORM\ManyToOne(targetEntity="User", inversedBy="comments")
     */
    protected $user;

    /**
     * @ORM\ManyToOne(targetEntity="Registry", inversedBy="comments")
     */
    protected $registry;

    /**
     * @ORM\ManyToOne(targetEntity="Arbitration", inversedBy="comments")
     */
    protected $arbitration;

    /**
     * @ORM\Column(type="text")
     */
    protected $body;

    /**
     * @return mixed
     */
    public function getUser()
    {
        return $this->user;
    }

    /**
     * @param mixed $user
     */
    public function setUser($user)
    {
        $this->user = $user;
    }

    /**
     * @return mixed
     */
    public function getBody()
    {
        return $this->body;
    }

    /**
     * @param mixed $body
     */
    public function setBody($body)
    {
        $this->body = $body;
    }

    /**
     * @return mixed
     */
    public function getRegistry()
    {
        return $this->registry;
    }

    /**
     * @param mixed $registry
     */
    public function setRegistry($registry)
    {
        $this->registry = $registry;
    }

    /**
     * @return mixed
     */
    public function getArbitration()
    {
        return $this->arbitration;
    }

    /**
     * @param mixed $arbitration
     */
    public function setArbitration($arbitration)
    {
        $this->arbitration = $arbitration;
    }

}


text:
package io.fabric8.kubernetes.examples;

import io.fabric8.kubernetes.api.model.Namespace;
import io.fabric8.kubernetes.api.model.NamespaceBuilder;
import io.fabric8.kubernetes.api.model.Quantity;
import io.fabric8.kubernetes.api.model.ResourceQuota;
import io.fabric8.kubernetes.api.model.ResourceQuotaBuilder;
import io.fabric8.kubernetes.client.ConfigBuilder;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClientBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class NamespaceQuotaExample {

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

  private static final String NAMESPACE = "namepsace-test";

  public static void main(String[] args) {
    final ConfigBuilder configBuilder = new ConfigBuilder();
    if (args.length > 0) {
      configBuilder.withMasterUrl(args[0]);
    }
    try (KubernetesClient client = new KubernetesClientBuilder().withConfig(configBuilder.build()).build()) {
      String namespace = NAMESPACE;
      if (args.length > 2) {
        namespace = args[2];
      }
      try {
        // Creating namespace
        Namespace ns = new NamespaceBuilder().withNewMetadata().withName(namespace).addToLabels("hello", "world").endMetadata()
            .build();
        logger.info("Created namespace: {}", client.namespaces().create(ns).getMetadata().getName());

        // Get namespace by name
        logger.info("Get namespace by name: {}", client.namespaces().withName(namespace).get());
        // Get namespace by label
        logger.info("Get namespace by label:");
        client.namespaces().withLabel("hello", "world").list().getItems()
            .forEach(n -> logger.info(" - {}", n.getMetadata().getName()));

        final ResourceQuota quota = client.resourceQuotas().inNamespace(namespace).createOrReplace(
            new ResourceQuotaBuilder()
                .withNewMetadata().withName("quota-example").endMetadata()
                .withNewSpec().addToHard("pods", new Quantity("5")).endSpec()
                .build());
        logger.info("Create resource quota: {}", quota.getMetadata().getName());

        logger.info("Listing jobs in namespace");
        client.batch().v1().jobs().inNamespace(namespace).list().getItems()
            .forEach(j -> logger.info(" - {}", j.getMetadata().getName()));
      } finally {
        // Delete namespace
        client.namespaces().withName(namespace).delete();
        logger.info("Deleted namespace: {}", namespace);
      }
    } catch (Exception e) {
      logger.error(e.getMessage(), e);
      Throwable[] suppressed = e.getSuppressed();
      if (suppressed != null) {
        for (Throwable t : suppressed) {
          logger.error(t.getMessage(), t);
        }
      }
    }
  }
}


text:
package com.dytech.edge.admin.script.basicmodel;

import com.dytech.edge.admin.script.ifmodel.Comparison;
import com.dytech.edge.admin.script.ifmodel.Equality;
import com.dytech.edge.admin.script.ifmodel.IfModel;

public class XpathComparison implements Comparison {
  protected String lhs;
  protected String rhs;
  protected Equality operator;

  public XpathComparison(Equality operator, String lhs, String rhs) {
    setLHS(lhs);
    setRHS(rhs);
    setOperator(operator);
  }

  public String getLHS() {
    return lhs;
  }

  public void setLHS(String lhs) {
    this.lhs = lhs;
  }

  public String getRHS() {
    return rhs;
  }

  public void setRHS(String rhs) {
    this.rhs = rhs;
  }

  public Equality getOperator() {
    return operator;
  }

  public void setOperator(Equality operator) {
    this.operator = operator;
  }

  @Override
  public String toScript() {
    return "xml.get('" + lhs + "') " + operator.toScript() + " '" + IfModel.encode(rhs) + "'";
  }

  @Override
  public String toEasyRead() {
    return lhs + " " + operator.toEasyRead() + " '" + rhs + "'";
  }
}


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="TestObjects.cs">
//   Copyright (c) 2013 Alexander Logger. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

using System;
using SharpTL;

namespace SharpMTProto.Tests.TestObjects
{
    [TLObject(0x100500)]
    public class TestRequest
    {
        [TLProperty(1)]
        public int TestId { get; set; }
    }

    [TLType(typeof (TestResponse), typeof (TestResponseEx))]
    public interface ITestResponse
    {
        int TestId { get; set; }
    }

    [TLObject(0x500100)]
    public class TestResponse : ITestResponse, IEquatable<TestResponse>
    {
        [TLProperty(1)]
        public int TestId { get; set; }

        [TLProperty(2)]
        public string TestText { get; set; }

        #region Equals
        public bool Equals(TestResponse other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }
            if (ReferenceEquals(this, other))
            {
                return true;
            }
            return TestId == other.TestId && string.Equals(TestText, other.TestText);
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }
            if (ReferenceEquals(this, obj))
            {
                return true;
            }
            if (obj.GetType() != GetType())
            {
                return false;
            }
            return Equals((TestResponse) obj);
        }

        public override int GetHashCode()
        {
            unchecked
            {
                return (TestId*397) ^ (TestText != null ? TestText.GetHashCode() : 0);
            }
        }

        public static bool operator ==(TestResponse left, TestResponse right)
        {
            return Equals(left, right);
        }

        public static bool operator !=(TestResponse left, TestResponse right)
        {
            return !Equals(left, right);
        }
        #endregion
    }

    [TLObject(0x500101)]
    public class TestResponseEx : ITestResponse
    {
        [TLProperty(1)]
        public int TestId { get; set; }

        [TLProperty(2)]
        public string TestText { get; set; }

        [TLProperty(3)]
        public string TestText2 { get; set; }
    }

    [TLType(typeof (TestResponse2))]
    public interface ITestResponse2
    {
        string Name { get; set; }

        string Address { get; set; }
        string City { get; set; }
    }

    [TLObject(0x600100)]
    public class TestResponse2 : ITestResponse2
    {
        [TLProperty(1)]
        public string Name { get; set; }

        [TLProperty(2)]
        public string Address { get; set; }

        [TLProperty(3)]
        public string City { get; set; }
    }
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd">

    <changeSet author="kshakir" id="summary_status_table">
        <createTable tableName="SUMMARY_STATUS">
            <column name="SUMMARY_STATUS_ID" type="INT" autoIncrement="true">
                <constraints primaryKey="true" primaryKeyName="PK_SUMMARY_STATUS"/>
            </column>
            <column name="SUMMARY_TABLE_NAME" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
            <column name="SUMMARIZED_TABLE_NAME" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
            <column name="MAXIMUM_ID" type="BIGINT">
                <constraints nullable="false"/>
            </column>
        </createTable>

        <modifySql dbms="mysql">
            <append value=" ENGINE=INNODB"/>
        </modifySql>
    </changeSet>

    <changeSet author="kshakir" id="summary_status_summarized_table_name_index">
        <addUniqueConstraint tableName="SUMMARY_STATUS"
                             columnNames="SUMMARY_TABLE_NAME, SUMMARIZED_TABLE_NAME"
                             constraintName="SUMMARY_STATUS_SUMMARY_TABLE_NAME_SUMMARIZED_TABLE_NAME_INDEX"/>
    </changeSet>

</databaseChangeLog>


text:
function gui_lc (action)
%
% This file is used by FASTICAG

% This file holds the callbacks for load-dialog

% @(#)$Id: gui_lc.m,v 1.4 2003/09/11 12:01:19 jarmo Exp $

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Global variables

% Handle to the window
global hf_FastICA_Load;

% Handles to some of the controls in window
global he_FastICA_file;

% Needed handles from the main figure
global ht_FastICA_mixedStatus;

% Needed handles from the advOpt figure
global hb_FastICA_initGuess;
global ht_FastICA_initGuess;
global hpm_FastICA_initState;

% The needed main variables
global g_FastICA_mixedsig;
global g_FastICA_mixedmean;

% What is the load type of load dialog
global g_FastICA_loadType;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This should not take long...
watchonInFigure = watchon;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
switch action
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case 'Load'

 varName = get(he_FastICA_file, 'String');      % The name of the variable to be loaded
 command=['evalin(''base'',''assignin(''''caller'''',''''data'''',' varName ')'')'];
 eval(command,'fprintf(''Variable not found in MATLAB workspace, data not loaded!\n'');data=[];');                          % Variable is copyed to 'data'
 if length (size (data)) > 2,
   fprintf (['Input data can not have more than two dimensions, data' ...
	     ' not loaded.\n']);
   data = [];
 end

 if any (any (isnan (data))),
   fprintf ('Input data contains NaN''s, data not loaded.\n');
   data = [];
 end

 if isempty(data)  % if there was no name given...
   watchoff (watchonInFigure);
   % There used to be a 'break' statement here, but it resulted in
   % errors in more recent version of Matlab -- jarmo
   return;
 end
 switch g_FastICA_loadType
  case  'data'                                % New data
   g_FastICA_mixedsig = data;
   if ~isa (g_FastICA_mixedsig, 'double')
     fprintf ('Warning: converting input data into regular (double) precision.\n');
     g_FastICA_mixedsig = double (g_FastICA_mixedsig);
   end

   set(ht_FastICA_mixedStatus, 'String', '');
   g_FastICA_mixedmean = [];                 % New data - so that means ...
   gui_cb NewData;

  case 'guess'                                % New initial guess
   set(hb_FastICA_initGuess, 'UserData', data);     % Since we loaded new initial
   set(ht_FastICA_initGuess, 'String', 'Loaded');   % guess, we wan't to use it too
   set(hpm_FastICA_initState, 'Value', 2);          % ... set initState to 'guess'
 end

 close(hf_FastICA_Load);                       % close the dialog

 % Use return to avoid reaching the watchoff statement at the end
 % (There used to be a 'break' statement here, but it resulted in
 % errors in more recent version of Matlab -- jarmo)
 return;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case 'Cancel'

 close(hf_FastICA_Load);                       % do nothing just exit

 % Use return to avoid reaching the watchoff statement at the end
 % (There used to be a 'break' statement here, but it resulted in
 % errors in more recent version of Matlab -- jarmo)
 return;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case 'Help'

 % Which help do we show?
 switch g_FastICA_loadType
  case 'data'
   gui_help('gui_lc_data');
  case 'guess'
   gui_help('gui_lc_guess');
 end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end    % switch

watchoff (watchonInFigure);


text:
#include "allegro5/allegro.h"
#include "allegro5/platform/alplatf.h"
#include "allegro5/internal/aintern.h"
#include ALLEGRO_INTERNAL_HEADER

/* Function: al_get_allegro_version
 */
uint32_t al_get_allegro_version(void)
{
   return ALLEGRO_VERSION_INT;
}

/* Function: al_run_main
 */
int al_run_main(int argc, char **argv, int (*user_main)(int, char **))
{
#ifdef ALLEGRO_MACOSX
    return _al_osx_run_main(argc, argv, user_main);
#else
    return user_main(argc, argv);
#endif
}

int _al_get_least_multiple(int val, int mul)
{
   int rem = val % mul;
   if (rem == 0)
      return val;
   else
      return val + mul - rem;
}

/* vim: set sts=3 sw=3 et: */


text:
package java.nio;

public class BufferOverflowException extends RuntimeException {
}


text:
// Package mockdiskclient implements the mock client for Disks.
package mockdiskclient // import "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/mockdiskclient"


text:
%-------------------------------------------------------------------------
% Design Project Input/Output Module Description
%-------------------------------------------------------------------------

\clearpage
\section{Force Input Module}
\label{sec-input-force}

This input module enables your IoT device to sense the amount of force
exerted on the surface of a squeeze pad. This may be useful in medical
devices, physical therapy, stress relief technology, virtual motion,
computer peripherals, touch-sensitive devices, etc. The sensor is a
variable resistor whose resistance depends on how much force is exerted
on the squeeze pad (e.g., squeezing it between two fingers); the
resistance is high (infinite) when there is no force and low when the
force is high.  The Arduino cannot directly sense resistance, but it can
sense an analog input voltage. We will use a simple circuit called a
voltage divider so that the voltage across the force sensor is
proportional to the resistance.

A sample circuit and Arduino code is shown below to get you started.
The circuit places a \wu{10}{k$\Omega$} resistor in series with the
force sensor so that voltage is divided between the two components. A
\wu{10}{k$\Omega$} resistor has brown-black-orange bands. We use a wire
to connect the node in between the resistor and the force sensor to an
analog input of the Arduino so that the Arduino can read the voltage
from one end of the \wu{10}{k$\Omega$} resistor to ground. The example
code will print the analog reading from the force sensor on the serial
monitor, similar to how we printed the analog reading from the grayscale
sensor in Lab~2. After setting up the circuit and programming the
Arduino, open the serial monitor and check how much force the sensor is
detecting. Then try squeezing the squeeze pad between two fingers. Does
the reading increase? Can you explain this behavior?

\vspace{0.1in}
\begin{minipage}[t]{0.49\tw}
  \vspace{0pt}

  \includegraphics[width=\tw]{input-force-annotated.svg.pdf}
\end{minipage}
\hfill
\begin{minipage}[t]{0.49\tw}
  \vspace{0.1in}
  \begin{Verbatim}[gobble=3,fontsize=\small]
    int pin_force = A0;

    void setup() {
      Serial.begin(9600);
      pinMode( pin_force, INPUT );
    }

    void loop() {
      int force = analogRead( pin_force );

      Serial.println( force );
      delay(1000);
    }
  \end{Verbatim}
\end{minipage}
\vspace{0.1in}

%Questions:


text:
goog.provide('epsg.io.MapPage');

goog.require('epsg.io.SRSPopup');
goog.require('goog.Timer');
goog.require('goog.Uri.QueryData');
goog.require('goog.dom');
goog.require('goog.net.Jsonp');
goog.require('kt.OsmNamesAutocomplete');
goog.require('kt.alert');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.extent');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
goog.require('ol.source.TileJSON');

/**
 * @type {string}
 * @const
 */
epsg.io.TRANS_SERVICE_URL = '/trans';

/**
 * @constructor
 */
epsg.io.MapPage = function() {

  this.srsTitleEl_ = goog.dom.getElement('crs-title');
  this.srsSearchEl_ = goog.dom.getElement('crs-search');
  this.srsDetailLinkEl_ = goog.dom.getElement('crs-detail-link');
  this.copyClipboardContainerEl_ = /** @type {!Element} */
      (goog.dom.getElement('copy-clipboard-container'));

  goog.style.setElementShown(this.copyClipboardContainerEl_, false);
  goog.style.setElementShown(this.srsDetailLinkEl_, false);

  this.srs_ = null;

  this.srsPopup_ = new epsg.io.SRSPopup();
  this.srsPopup_.listen(epsg.io.SRSPopup.EventType.SRS_SELECTED,
      function(e) {
        if (e.data) {
          this.handleSRSChange_(e.data);
        }
      }, false, this);

  this.srsChange_ = goog.dom.getElement('crs-change');
  goog.events.listen(this.srsChange_, goog.events.EventType.CLICK,
      function(e) {
        this.srsPopup_.show();
        e.preventDefault();
      }, false, this);

  /**
   * @type {number}
   * @private
   */
  this.lon_ = 0;

  /**
   * @type {number}
   * @private
  */
  this.lat_ = 0;

  // LOAD ALL THE EXPECTED ELEMENTS ON THE PAGE
  this.mapElement = /** @type {!Element} */(goog.dom.getElement('map'));
  this.mapTypeElement_ = /** @type {!HTMLSelectElement} */
                         (goog.dom.getElement('mapType'));
  this.reprojectMapElement_ = /** @type {!HTMLInputElement} */
                              (goog.dom.getElement('reproject_map'));
  this.reprojectMapContainer_ = /** @type {!HTMLInputElement} */
      (goog.dom.getElement('reproject_map_container'));

  this.geocoderElement = /** @type {!HTMLInputElement} */
      (goog.dom.getElement('geocoder'));

  this.eastingElement = goog.dom.getElement('easting');
  this.northingElement = goog.dom.getElement('northing');
  this.eastNorthFormElement = goog.dom.getElement('eastnorth_form');
  this.eastNorthCopyElement = goog.dom.getElement('eastnorth_copy');

  this.lonLatMutex = false;

  // Force preservation of user typed values on recalculation
  this.keepHash = true;
  this.keepEastNorth = false;

  /**
   * @type {?number}
   * @private
   */
  this.queryTimer_ = null;

  /**
   * @type {!goog.net.Jsonp}
   * @private
   */
  this.jsonp_ = new goog.net.Jsonp(epsg.io.TRANS_SERVICE_URL);

  /**
   * @type {!Array}
   * @private
   */
  this.viewListenKeys_ = [];

  this.map_ = new ol.Map({
    target: this.mapElement,
    view: null,
    layers: [],
    controls: [
      new ol.control.Attribution({
        collapsible: false,
        tipLabel: ''
      })]
  });

  /**
   * @type {boolean}
   * @private
   */
  this.reprojectionViewOn_ = false;

  goog.events.listen(this.reprojectMapElement_, goog.events.EventType.CHANGE,
      function(e) {
        this.updateMapView_();
        this.updateHash_();
      }, false, this);
  this.updateMapView_();

  this.updateLonLat_([this.lon_, this.lat_]);

  this.parseHash_();

  goog.events.listen(this.mapTypeElement_, goog.events.EventType.CHANGE,
      function(e) {
        this.updateMapType_();
        this.updateHash_();
      }, false, this);
  this.updateMapType_();

  this.keepHash = false;

  var zoomBtn = function(map, delta, e) {
    if (!map) return;
    var view = map.getView(), curRes = view.getResolution();
    map.beforeRender(ol.animation.zoom({
      resolution: curRes,
      duration: 250,
      easing: ol.easing.easeOut
    }));
    view.setResolution(view.constrainResolution(curRes, delta));
    e.preventDefault();
  };
  var mapPlus = goog.dom.getElement('map-plus');
  var mapMinus = goog.dom.getElement('map-minus');
  if (mapPlus && mapMinus) {
    goog.events.listen(mapPlus, goog.events.EventType.CLICK,
        function(e) {zoomBtn(this.map_, 1, e);}, false, this);
    goog.events.listen(mapMinus, goog.events.EventType.CLICK,
        function(e) {zoomBtn(this.map_, -1, e);}, false, this);
  }
  var mapSearch = goog.dom.getElement('map-search');
  var searchContainer = goog.dom.getElement('search-container');
  if (mapSearch && searchContainer) {
    goog.events.listen(mapSearch, goog.events.EventType.CLICK, function(e) {
      if (goog.dom.classlist.toggle(searchContainer, 'visible') &&
          this.geocoderElement) {
        this.geocoderElement.focus();
      }
      e.preventDefault();
      e.stopPropagation();
    }, false, this);
  }
  this.map_.on(ol.MapBrowserEvent.EventType.SINGLECLICK,
      function(e) {
        var pan = ol.animation.pan({
          duration: 150,
          source: this.view_.getCenter()
        });
        this.map_.beforeRender(pan);
        this.view_.setCenter(e.coordinate);
        e.preventDefault();
      }, this);

  // The user can type easting / northing and hit Enter
  goog.events.listen(this.eastNorthFormElement, goog.events.EventType.SUBMIT,
      function(e) {
        if (!this.srs_) return;
        var easting = goog.string.toNumber(this.eastingElement.value);
        var northing = goog.string.toNumber(this.northingElement.value);
        if (!isNaN(easting) && !isNaN(northing)) {
          // Make the query to epsg.io/trans to get new lat/lon
          this.jsonp_.send({
            'x': easting,
            'y': northing,
            's_srs': this.srs_['code']
          }, goog.bind(function(result) {
            var latitude = goog.string.toNumber(result['y']);
            var longitude = goog.string.toNumber(result['x']);
            this.keepEastNorth = true;
            this.updateLonLat_([longitude, latitude]);
            this.keepEastNorth = false;
          }, this));
        }
        e.preventDefault();
      }, false, this);

  if (this.geocoderElement) {
    var geocoder = new kt.OsmNamesAutocomplete(this.geocoderElement,
        'https://geocoder.tilehosting.com/', '7xPOpTaJNg9f5zW7LlED');
    geocoder.registerCallback(goog.bind(function(item) {
      var bbox = item['boundingbox'];
      if (bbox[0] > bbox[2]) {
        bbox[0] -= 360;
      }
      var isDegenerate = (bbox[2] - bbox[0]) * (bbox[3] - bbox[1]) <= 0;

      var size = this.map_.getSize();
      if (size && !isDegenerate) {
        this.view_.fit(ol.proj.transformExtent(bbox,
            'EPSG:4326', this.view_.getProjection()), size);
      } else {
        this.view_.setCenter(ol.proj.transform(ol.extent.getCenter(bbox),
            'EPSG:4326', this.view_.getProjection()));
        this.view_.setZoom(15);
      }
    }, this));
  }

  // ZeroClipboard initialization
  var ZeroClipboard = window['ZeroClipboard'];
  ZeroClipboard['config']({ 'moviePath': '/js/ZeroClipboard.swf' });
  this.eastNorthZeroClipboard = new ZeroClipboard(this.eastNorthCopyElement);

  this.eastNorthZeroClipboard['on']('dataRequested',
      goog.bind(function(client, args) {
        var eastNorthText = this.eastingElement.value + '\t' +
            this.northingElement.value;
        client['setText'](eastNorthText);
      }, this));
};

/**
 * @param {Object} srsData
 * @param {boolean=} opt_dontCenter
 * @private
 */
epsg.io.MapPage.prototype.handleSRSChange_ = function(srsData, opt_dontCenter) {
  var firstSRS = !this.srs_ && !!srsData;
  this.srs_ = srsData;
  if (!this.srs_) return;

  this.keepEastNorth = false;
  this.makeQuery();

  this.srsTitleEl_.innerHTML =
      this.srs_['name'] + ' <span>' + 'EPSG:' + this.srs_['code'] + '</span>';
  this.srsDetailLinkEl_.href = '/' + this.srs_['code'];
  goog.style.setElementShown(this.copyClipboardContainerEl_, true);
  goog.style.setElementShown(this.srsDetailLinkEl_, true);

  var newProj;
  var bbox = this.srs_['bbox'];
  var code = this.srs_['code'];
  if (this.srs_['proj4'].length > 0 &&
      goog.isArray(bbox) && bbox.length == 4 &&
      code != '4326' && code != '3857') {
    var newProjCode = 'EPSG:' + code;
    proj4.defs(newProjCode, this.srs_['proj4']);
    newProj = ol.proj.get(newProjCode);
    var fromLonLat = ol.proj.getTransform('EPSG:4326', newProj);

    // very approximate calculation of projection extent
    var extent = ol.extent.applyTransform(
        [bbox[1], bbox[2], bbox[3], bbox[0]], fromLonLat);
    newProj.setExtent(extent);
  }

  if (!opt_dontCenter && firstSRS && goog.isArray(bbox) && bbox.length == 4) {
    var extent = ol.proj.transformExtent(
        [bbox[1], bbox[2],
         bbox[3], bbox[0]],
        'EPSG:4326', this.view_.getProjection());
    if (extent) {
      var size = goog.style.getContentBoxSize(this.mapElement);
      size = [size.width, size.height];
      if (size) {
        this.view_.fit(
            ol.extent.getIntersection(extent,
                this.view_.getProjection().getExtent()),
            size);
      }
    }
  }

  this.handleReprojectionConditionsChange_();

  this.updateHash_();
};

/**
 * @private
 */
epsg.io.MapPage.prototype.updateMapType_ = function() {
  this.mapElement.style.backgroundColor = '';

  var newLayers = [];

  var mapType = this.mapTypeElement_.value;
  var src;
  var tilejson = this.mapTypeElement_.options[
      this.mapTypeElement_.selectedIndex].getAttribute('data-tilejson');
  if (tilejson) {
    src = new ol.source.TileJSON({url: tilejson, useXhr: true});
  } else {
    if (mapType == 'osm') {
      src = new ol.source.OSM();
      (function() {src.opaque_ = false;})();
    }
  }
  //src.setRenderReprojectionEdges(true);
  newLayers = [new ol.layer.Tile({source: src})];
  this.handleReprojectionConditionsChange_();

  this.map_.getLayerGroup().setLayers(new ol.Collection(newLayers));
  this.map_.updateSize();
};

/**
 * @private
 */
epsg.io.MapPage.prototype.handleReprojectionConditionsChange_ = function() {
  var possible = this.srs_ && ol.proj.get('EPSG:' + this.srs_['code']);
  goog.style.setElementShown(this.reprojectMapContainer_, possible);
  if (!possible) {
    this.reprojectMapElement_.checked = false;
  }
  if (this.reprojectionViewOn_) {
    this.updateMapView_();
  }
};

/**
 * @private
 */
epsg.io.MapPage.prototype.updateMapView_ = function() {
  if (this.viewListenKeys_.length) {
    goog.array.forEach(this.viewListenKeys_, ol.Observable.unByKey);
    this.viewListenKeys_ = [];
  }

  var reprojectMap =
      this.reprojectMapElement_.checked && !!this.srs_;
  var projection = ol.proj.get(reprojectMap ?
      ('EPSG:' + this.srs_['code']) : 'EPSG:3857');
  var resolution = !this.view_ ? null : (this.view_.getResolution() *
      this.view_.getProjection().getMetersPerUnit());
  this.view_ = new ol.View({
    center: ol.proj.transform([this.lon_, this.lat_], 'EPSG:4326', projection),
    projection: projection,
    extent: projection.getExtent(),
    maxZoom: 21,
    zoom: reprojectMap ? 0 : 2
  });

  this.viewListenKeys_.push(this.view_.on('change:center', function(e) {
    var pos = ol.proj.transform(
        this.view_.getCenter(), this.view_.getProjection(), 'EPSG:4326');
    this.updateLonLat_(pos);
  }, this));

  this.viewListenKeys_.push(this.view_.on('change:resolution', function(e) {
    this.updateHash_();
  }, this));

  if (resolution) {
    this.view_.setResolution(this.view_.constrainResolution(
        resolution / this.view_.getProjection().getMetersPerUnit()));
  }
  this.view_.setCenter(this.view_.constrainCenter(this.view_.getCenter()));

  this.map_.setView(this.view_);
  this.reprojectionViewOn_ = reprojectMap;
};

/**
 * The throttled call for the coordinates transformation via JSONP
 * @protected
 */
epsg.io.MapPage.prototype.makeQuery = function() {
  this.eastingElement.value = '';
  this.northingElement.value = '';

  // If the timer has a waiting query, then trash it -
  // it is obsolete, because we have a new one
  if (this.queryTimer_) {
    goog.Timer.clear(this.queryTimer_);
    this.queryTimer_ = null;
  }
  if (!this.srs_) return;
  var code = this.srs_['code'];

  var updateTransformLink = goog.bind(function() {
    goog.dom.getElement('crs-transform-link').href =
        '/transform#s_srs=' + code +
        '&x=' + this.eastingElement.value +
        '&y=' + this.northingElement.value;
  }, this);

  var localProj = ol.proj.get('EPSG:' + code);
  var localTransform = localProj &&
                       ol.proj.getTransform('EPSG:4326', localProj);
  if (localTransform) {
    if (!this.keepEastNorth) {
      var result = localTransform([this.lon_, this.lat_]);
      this.eastingElement.value = result[0].toFixed(6);
      this.northingElement.value = result[1].toFixed(6);
      updateTransformLink();
      this.updateHash_();
    }
  } else {
    // Don't proceed with the JSONP query immediatelly,
    //   but wait for 500 ms if the user doesn't make a new one.
    this.queryTimer_ = goog.Timer.callOnce(function() {
      if (!this.srs_) return;

      var data = { 'x': this.lon_, 'y': this.lat_, 't_srs': code };
      this.jsonp_.send(data, goog.bind(function(result) {
        if (!this.keepEastNorth) {
          this.eastingElement.value = result.x;
          this.northingElement.value = result.y;
          updateTransformLink();
          this.updateHash_();
        }
        this.queryTimer_ = null;
      }, this));
    }, 500, this);
  }
};

/**
 * @param {ol.Coordinate} lonlat
 * @private
 */
epsg.io.MapPage.prototype.updateLonLat_ = function(lonlat) {
  if (this.lonLatMutex) return;
  this.lonLatMutex = true;
  this.lat_ = lonlat[1];
  this.lon_ = lonlat[0];
  if (!this.keepEastNorth) {
    this.makeQuery();
  }
  this.view_.setCenter(ol.proj.transform([this.lon_, this.lat_],
      'EPSG:4326', this.view_.getProjection()));
  this.lonLatMutex = false;

  this.updateHash_();
};

/**
 * @private
 */
epsg.io.MapPage.prototype.updateHash_ = function() {
  if (this.keepHash) return;
  var qd = new goog.Uri.QueryData();

  if (this.srs_) {
    qd.set('srs', this.srs_['code']);
    qd.set('x', this.eastingElement.value);
    qd.set('y', this.northingElement.value);
  } else {
    qd.remove('srs');
  }

  qd.set('z', this.view_.getZoom());

  if (this.reprojectionViewOn_) {
    qd.set('reproject', '1');
  }

  var layer = this.mapTypeElement_.value;
  if (layer != 'gmaps-roadmap') {
    // do not include default value to shorten the url
    qd.set('layer', this.mapTypeElement_.value);
  }

  window.location.hash = qd.toString();
};

/**
 * @private
 */
epsg.io.MapPage.prototype.parseHash_ = function() {
  var qd = new goog.Uri.QueryData(window.location.hash.substr(1));

  var srs = qd.get('srs') || '4326';
  var lon = parseFloat(qd.get('lon')), lat = parseFloat(qd.get('lat'));
  var x = parseFloat(qd.get('x')), y = parseFloat(qd.get('y'));
  var z = parseInt(qd.get('z'), 10);
  var reproject = qd.get('reproject') == '1';

  var isLonLat = goog.math.isFiniteNumber(lon) && goog.math.isFiniteNumber(lat);
  var isXY = goog.math.isFiniteNumber(x) && goog.math.isFiniteNumber(y);

  this.srsPopup_.getSRS(/** @type {string} */(srs),
      goog.bind(function(data) {
        this.handleSRSChange_(data, isLonLat || isXY);
        if (reproject) {
          this.reprojectMapElement_.checked = true;
          this.updateMapView_();
          if (goog.math.isFiniteNumber(z)) {
            this.view_.setZoom(z);
          }
          this.updateHash_();
        }
        if (isXY) {
          this.jsonp_.send({
            'x': x,
            'y': y,
            's_srs': srs
          }, goog.bind(function(result) {
            var latitude = goog.string.toNumber(result['y']);
            var longitude = goog.string.toNumber(result['x']);
            this.updateLonLat_([longitude, latitude]);
          }, this));
        }
      }, this));

  if (isLonLat) {
    this.updateLonLat_([lon, lat]);
  }
  if (!reproject && goog.math.isFiniteNumber(z)) {
    this.view_.setZoom(z);
  }

  var layer = qd.get('layer');
  if (layer) {
    this.mapTypeElement_.value = /** @type {string} */(layer);
    this.updateMapType_();
  }
};

goog.exportSymbol('MapPage', epsg.io.MapPage);


text:
#ifndef MASTERNODELIST_H
#define MASTERNODELIST_H

#include "masternode.h"
#include "platformstyle.h"
#include "sync.h"
#include "util.h"

#include <QMenu>
#include <QTimer>
#include <QWidget>

#define MASTERNODELIST_UPDATE_SECONDS            5
#define MY_MASTERNODELIST_UPDATE_SECONDS        60

namespace Ui {
    class MasternodeList;
}

class ClientModel;
class WalletModel;

QT_BEGIN_NAMESPACE
class QModelIndex;
QT_END_NAMESPACE

/** Masternode Manager page widget */
class MasternodeList : public QWidget
{
    Q_OBJECT

public:
    explicit MasternodeList(const PlatformStyle *platformStyle, QWidget *parent = 0);
    ~MasternodeList();

    void setClientModel(ClientModel *clientModel);
    void setWalletModel(WalletModel *walletModel);
    void StartAlias(std::string strAlias);
    void StartAll(std::string strCommand = "start-all");

private:
    QMenu *contextMenu;

public Q_SLOTS:
    void updateMyMasternodeInfo(QString alias, QString addr, QString privkey, QString txHash, QString txIndex, CMasternode *pmn);
    void updateMyNodeList(bool reset = false);
    void updateNodeList();

Q_SIGNALS:

private:
    QTimer *timer;
    Ui::MasternodeList *ui;
    ClientModel *clientModel;
    WalletModel *walletModel;
    CCriticalSection cs_mnlistupdate;
    QString strCurrentFilter;

private Q_SLOTS:
    void showContextMenu(const QPoint &);
    void on_filterLineEdit_textChanged(const QString &filterString);
    void on_startButton_clicked();
    void on_startAllButton_clicked();
    void on_startMissingButton_clicked();
    void on_tableWidgetMyMasternodes_itemSelectionChanged();
    void on_UpdateButton_clicked();
};
#endif // MASTERNODELIST_H


text:
import '/resources/polymer/@polymer/polymer/polymer-legacy.js';
import '/resources/polymer/@polymer/iron-flex-layout/iron-flex-layout-classes.js';
import '/resources/polymer/@polymer/paper-icon-button/paper-icon-button.js';

import '/app/tg-app-config.js';

import {_momentTz} from '/resources/reflection/tg-date-utils.js'

import {Polymer} from '/resources/polymer/@polymer/polymer/lib/legacy/polymer-fn.js';
import {html} from '/resources/polymer/@polymer/polymer/lib/utils/html-tag.js';

const weekDays = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];

const template = html`

    <tg-app-config id="appConfig" first-day-of-week="{{_firstDayOfWeek}}"></tg-app-config>

                <paper-icon-button icon="chevron-left" on-tap="_prevMonth"></paper-icon-button>

                        [[monthName]]  [[year]]

                <paper-icon-button icon="chevron-right" on-tap="_nextMonth"></paper-icon-button>

[[_weekDay(_firstDayOfWeek, 0)]]

[[_weekDay(_firstDayOfWeek, 1)]]

[[_weekDay(_firstDayOfWeek, 2)]]

[[_weekDay(_firstDayOfWeek, 3)]]

[[_weekDay(_firstDayOfWeek, 4)]]

[[_weekDay(_firstDayOfWeek, 5)]]

[[_weekDay(_firstDayOfWeek, 6)]]

            <template is="dom-repeat" items="[[weeks]]" as="week">

                    <template is="dom-repeat" items="[[week]]" as="day">

[[_absolute(day)]]

                    </template>

            </template>

`;

(function () {
    const getDaysInMonth = function (year, month) {
        const yearMonth = { year: year, month: month, day: 1 };
        return _momentTz(yearMonth, this.timeZone).daysInMonth();
    };
    const getDaysInPreviousMonth = function (year, month) {
        const yearMonth = { year: year, month: month, day: 1 };
        return _momentTz(yearMonth, this.timeZone).add(-1, 'M').daysInMonth();
    };
    const createMonth = function (year, month, firstDayOfWeek) {
        const weeks = [];
        let week = [];
        let day = 1;
        const days = getDaysInMonth.bind(this)(year, month);
        while (day > 0) {
            week = createWeek.bind(this)(year, month, day, firstDayOfWeek);
            weeks.push(week);
            day = week[week.length - 1].day > 0 && week[week.length - 1].day < days ? week[week.length - 1].day + 1 : 0;
        }
        return weeks;
    };
    const createWeek = function (year, month, day, firstDayOfWeek) {
        const yearMonthDay = { year: year, month: month, day: day };
        const firstDay = (7 - firstDayOfWeek + _momentTz(yearMonthDay, this.timeZone).day()) % 7;//Maps week day where 0 - Sunday into week where 0 - custom first day of week
        const week = [];
        const previousMonthDays = getDaysInPreviousMonth.bind(this)(year, month);
        let _i = 0;
        // In case when the first day of the month is not a sanday then add 0 to the first days of the week.
        for (; _i < firstDay; _i++) {
            week.push({monthIncrementor: -1, day: -1 * (previousMonthDays - (firstDay - (_i + 1)))});
        }
        // Add day numbers to the week.
        const days = getDaysInMonth.bind(this)(year, month);
        for (; _i < 7 && day <= days; _i++) {
            week.push({monthIncrementor: 0, day: day});
            day += 1;
        }
        // In case when the last day of the month is not saturday then add 0 to the last days of the week.
        let nextMonthDay = -1;
        for (; _i < 7; _i++) {
            week.push({monthIncrementor: 1, day: nextMonthDay});
            nextMonthDay -= 1;
        }
        return week;
    };
    Polymer({
        _template: template,

        is: "tg-month-selector",

        properties: {
            /**
             * If empty then default timezone should be used for toString and fromString conversions in 'moment()' and 'moment(...)' methods.
             * Otherwise -- the specified timezone should be used in 'moment.tz(timeZone)' and 'moment.tz(..., timeZone)' methods.
             */
            timeZone: {
                type: String
            },

            selectedDate: {
                type: Number,
                notify: true,
                observer: "_selectedDateChanged"
            },
            selectedDay: Number,
            selectedMonth: Number,
            selectedYear: Number,
            todayDay: Number,
            todayMonth: Number,
            todayYear: Number,
            monthName: String,
            month: Number,
            year: Number,

            _firstDayOfWeek: {
                type: Number,
                value: 0,
                observer: "_firstDayOfWeekChanged"
            }
        },

        ready: function () {
            var today = _momentTz(this.timeZone);
            this.todayDay = today.date();
            this.todayMonth = today.month();
            this.todayYear = today.year();
            this.selectedDay = null;
            this.selectedMonth = null;
            this.selectedYear = null;
            this.month = null;
            this.year = null;
        },

        attached: function () {
            this._firstDayOfWeekChanged(this._firstDayOfWeek);
        },

        /**
         * Updates calendar when first day of week changes.
         *
         * @param {Number} newFirstDayOfWeek - changed first day of week
         */
        _firstDayOfWeekChanged: function (newFirstDayOfWeek) {
            const momentToShow = this.selectedDate ?
                    _momentTz(this.selectedDate, this.timeZone) :
                    _momentTz(this.timeZone);
            this._adjustMonth(momentToShow, newFirstDayOfWeek);
        },

        /**
         * Goes to the previous month.
         */
        _prevMonth: function () {
            this._selectMonth(-1);
        },

        /**
         * Goes to the next month.
         */
        _nextMonth: function () {
            this._selectMonth(1);
        },

        /**
         * Selects month depending on increment (the increment might be positive or negetive).
         */
        _selectMonth: function (inc) {
            var yearMonth = { year: this.year, month: this.month, day: 1 };
            var momentToShow = _momentTz(yearMonth, this.timeZone).add(inc, 'M');
            this._adjustMonth(momentToShow, this._firstDayOfWeek);
        },

        /**
         * Updates the calendar information depending on which month was choosen and the number of the first day of week (first day of week should be valid nuber [0 .. 6]).
         */
        _adjustMonth: function (momentToShow, firstDayOfWeek) {
            if (momentToShow.isValid() && (this.month !== momentToShow.month() || this.year !== momentToShow.year()) && firstDayOfWeek >=0 && firstDayOfWeek < 7) {
                this.monthName = momentToShow.format("MMMM");
                this.month = momentToShow.month();
                this.year = momentToShow.year();
                this.weeks = createMonth.bind(this)(this.year, this.month, firstDayOfWeek);
            }
        },

        /**
         * Selects the date.
         */
        _selectDay: function (event, detail, el) {
            var yearMonthDay = { year: this.year, month: this.month, day: 1 };
            this.selectedDate = _momentTz(yearMonthDay, this.timeZone).add(event.model.day.monthIncrementor, 'M').date(Math.abs(event.model.day.day)).valueOf();
            if (event.detail.sourceEvent.detail > 1) {
                this.fire("tg-accept-date");
            }
        },

        /**
         * Listens when the selected date changes.
         */
        _selectedDateChanged: function (newValue, oldValue) {
            if (newValue !== null) {
                var newMoment = _momentTz(newValue, this.timeZone);
                if (newMoment.isValid()) {
                    this.selectedYear = newMoment.year();
                    this.selectedMonth = newMoment.month();
                    this._adjustMonth(newMoment, this._firstDayOfWeek);
                    this.selectedDay = newMoment.date();
                }
            }
        },

        /**
         * Calcualtes class names for specified day.
         */
        _calcDayClass: function (day, month, year, selectedDay, selectedMonth, selectedYear) {
            var dayClasses = "day layout vertical center-center";
            if (day.day < 0) {
                dayClasses += " outside-day";
            }
            if (day.day === this.todayDay && month === this.todayMonth && year === this.todayYear) {
                dayClasses += " today-date";
            }
            if (day.day === selectedDay && month === selectedMonth && year === selectedYear) {
                dayClasses += " selected-date";
            }
            return dayClasses;
        },

        /**
         * Returns the absolute value of the day
         */
        _absolute: function (day) {
            return Math.abs(day.day);
        },

        /**
         * Returns the first letter of the day specified with day number taking into account the specified first day of the week.
         *
         * @param {Number} firstDayOfWeek  - the number of the first day of week.
         * @param {Number} day - the number of the day for which first letter of the day should be returned
         */
        _weekDay: function (firstDayOfWeek, day) {
            return weekDays[(firstDayOfWeek + day) % 7];
        }
    });
})();


text:
/*
 * JavaIKAnimationCallback.java
 *
 * Created on April 25, 2007, 5:48 PM
 *
 */

package org.opensim.tracking;

import org.openide.DialogDescriptor;
import org.openide.DialogDisplayer;
import org.opensim.modeling.AnalysisWrapperWithTimer;
import org.opensim.modeling.ArrayStr;
import org.opensim.modeling.CMCTool;
import org.opensim.modeling.Model;
import org.opensim.modeling.State;
import org.opensim.modeling.Storage;
import org.opensim.plotter.JPlotterPanel;
import org.opensim.plotter.PlotCurve;

/**
 *
 * @author Ayman Habib.
 *
 * An acallback that can be can be invoked while running RRA or CMC
 * It should figure out the mode from the tool which mode is it in and based on that
 * - In RRA1 should display the residuals
 * - In CMC should probably show pre and post tracking quantities
 */
public class JavaPlottingCallback extends AnalysisWrapperWithTimer{

    CMCTool cmcRraTool;
    JPlotterPanel plotter;
    PlotCurve[] cvs;
    Storage s;
    int timeIndex=-1;
    int lastIndex;
    int errorsIndexInStorage=-1;
    private String[] qtyNames=null;
    int[] qtyIndices=null;   // Keep indices to qtys for quick access in step
    //OpenSimContext context=null;

    /** Creates a new instance of JavaPlottingCallback */
    public JavaPlottingCallback(Model model, Model aModelForDisplay) {
        super(model);
        //context = OpenSimDB.getInstance().getContext(aModelForDisplay);
    }

  public int step(State s, int i) {
      super.step(s, i);
      processStep(getSimulationTime());
      return 0;
   }

   private void processStep(final double aT) {
       // begin should have been called first but actully it is not!
       synchronized(this){ // Make sure nothing happens to this object until we're done.
           if (!isInitialized()){
               setupPlotter();
               initializeTimer();
           }
           if (isUpdateDisplay()){
               // update Plotter if it's up'
               timeIndex = s.findIndex(aT);
               System.out.println("JavaPlottingCallback:time="+aT+" index="+timeIndex);
               if (timeIndex>=0 && lastIndex!=timeIndex){
                   for(int i=0; i<getQtyNames().length; i++){
                       double value = s.getStateVector(timeIndex).getData().getitem(qtyIndices[i]);
                       cvs[i].addDataPoint((double)aT, value);
                   }
                   lastIndex=timeIndex;
               }
           }
       }
   }

 public int begin(State s) {
        int retValue=0;

        //retValue = super.begin(aStep, aDT, aT, aX, aY);
        setupPlotter();

        return retValue;
    }

    private void setupPlotter() {
        // Launch plotter
        s = findForceStorage(cmcRraTool);
        if (s == null)
            return;

        System.out.println("=====");
        ArrayStr residuals = s.getColumnLabels();
        for(int i=0; i< residuals.getSize(); i++)
            System.out.println(residuals.getitem(i));
        System.out.println("=====");
        // Create plotter dialog and display s, column for markerError
        plotter = new JPlotterPanel();
        plotter.setName("Forces");
        DialogDescriptor dlg = new DialogDescriptor(plotter,"Plotter Dialog");
        dlg.setModal(false);
        DialogDisplayer.getDefault().createDialog(dlg).setVisible(true);
        dlg.setTitle("Live Plot: Forces");
        cvs = new PlotCurve[getQtyNames().length];

        for(int i=0; i<getQtyNames().length; i++){
                cvs[i]=plotter.showAnalysisCurveAgainstTime(get_model(), s, "Residual Forces",
                         getQtyNames()[i], getQtyNames()[i], "xlabel-to-fill", "y-label-to-fill"
                         );
            qtyIndices[i]=s.getStateIndex(getQtyNames()[i]);
        }

    }

    protected void finalize() {
        super.finalize();
    }

    void setTool(CMCTool cMCTool) {
        cmcRraTool = cMCTool;
    }

    private Storage findForceStorage(CMCTool cmcRraTool) {
        Storage residualsStorage= cmcRraTool.getForceStorage();
        return residualsStorage;
    }

    public String[] getQtyNames() {
        return qtyNames;
    }

    public void setQtyNames(String[] qtyNames) {
        this.qtyNames = qtyNames;
        qtyIndices = new int[getQtyNames().length];
    }

}


text:
#pragma once
#include <aws/cloudfront/CloudFront_EXPORTS.h>
#include <aws/cloudfront/CloudFrontRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace Http
{
    class URI;
} //namespace Http
namespace CloudFront
{
namespace Model
{

  /**
   *
The request to list origin access identities.

See Also:
   AWS
   * API Reference

   */
  class AWS_CLOUDFRONT_API ListCloudFrontOriginAccessIdentities2020_05_31Request : public CloudFrontRequest
  {
  public:
    ListCloudFrontOriginAccessIdentities2020_05_31Request();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "ListCloudFrontOriginAccessIdentities"; }

    Aws::String SerializePayload() const override;

    void AddQueryStringParameters(Aws::Http::URI& uri) const override;

    /**
     *
Use this when paginating results to indicate where to begin in your list of
     * origin access identities. The results include identities in the list that occur
     * after the marker. To get the next page of results, set the Marker
     * to the value of the NextMarker from the current page's response
     * (which is also the ID of the last identity on that page).

     */
    inline const Aws::String& GetMarker() const{ return m_marker; }

    /**
     *
Use this when paginating results to indicate where to begin in your list of
     * origin access identities. The results include identities in the list that occur
     * after the marker. To get the next page of results, set the Marker
     * to the value of the NextMarker from the current page's response
     * (which is also the ID of the last identity on that page).

     */
    inline bool MarkerHasBeenSet() const { return m_markerHasBeenSet; }

    /**
     *
Use this when paginating results to indicate where to begin in your list of
     * origin access identities. The results include identities in the list that occur
     * after the marker. To get the next page of results, set the Marker
     * to the value of the NextMarker from the current page's response
     * (which is also the ID of the last identity on that page).

     */
    inline void SetMarker(const Aws::String& value) { m_markerHasBeenSet = true; m_marker = value; }

    /**
     *
Use this when paginating results to indicate where to begin in your list of
     * origin access identities. The results include identities in the list that occur
     * after the marker. To get the next page of results, set the Marker
     * to the value of the NextMarker from the current page's response
     * (which is also the ID of the last identity on that page).

     */
    inline void SetMarker(Aws::String&& value) { m_markerHasBeenSet = true; m_marker = std::move(value); }

    /**
     *
Use this when paginating results to indicate where to begin in your list of
     * origin access identities. The results include identities in the list that occur
     * after the marker. To get the next page of results, set the Marker
     * to the value of the NextMarker from the current page's response
     * (which is also the ID of the last identity on that page).

     */
    inline void SetMarker(const char* value) { m_markerHasBeenSet = true; m_marker.assign(value); }

    /**
     *
Use this when paginating results to indicate where to begin in your list of
     * origin access identities. The results include identities in the list that occur
     * after the marker. To get the next page of results, set the Marker
     * to the value of the NextMarker from the current page's response
     * (which is also the ID of the last identity on that page).

     */
    inline ListCloudFrontOriginAccessIdentities2020_05_31Request& WithMarker(const Aws::String& value) { SetMarker(value); return *this;}

    /**
     *
Use this when paginating results to indicate where to begin in your list of
     * origin access identities. The results include identities in the list that occur
     * after the marker. To get the next page of results, set the Marker
     * to the value of the NextMarker from the current page's response
     * (which is also the ID of the last identity on that page).

     */
    inline ListCloudFrontOriginAccessIdentities2020_05_31Request& WithMarker(Aws::String&& value) { SetMarker(std::move(value)); return *this;}

    /**
     *
Use this when paginating results to indicate where to begin in your list of
     * origin access identities. The results include identities in the list that occur
     * after the marker. To get the next page of results, set the Marker
     * to the value of the NextMarker from the current page's response
     * (which is also the ID of the last identity on that page).

     */
    inline ListCloudFrontOriginAccessIdentities2020_05_31Request& WithMarker(const char* value) { SetMarker(value); return *this;}

    /**
     *
The maximum number of origin access identities you want in the response body.
     *

     */
    inline const Aws::String& GetMaxItems() const{ return m_maxItems; }

    /**
     *
The maximum number of origin access identities you want in the response body.
     *

     */
    inline bool MaxItemsHasBeenSet() const { return m_maxItemsHasBeenSet; }

    /**
     *
The maximum number of origin access identities you want in the response body.
     *

     */
    inline void SetMaxItems(const Aws::String& value) { m_maxItemsHasBeenSet = true; m_maxItems = value; }

    /**
     *
The maximum number of origin access identities you want in the response body.
     *

     */
    inline void SetMaxItems(Aws::String&& value) { m_maxItemsHasBeenSet = true; m_maxItems = std::move(value); }

    /**
     *
The maximum number of origin access identities you want in the response body.
     *

     */
    inline void SetMaxItems(const char* value) { m_maxItemsHasBeenSet = true; m_maxItems.assign(value); }

    /**
     *
The maximum number of origin access identities you want in the response body.
     *

     */
    inline ListCloudFrontOriginAccessIdentities2020_05_31Request& WithMaxItems(const Aws::String& value) { SetMaxItems(value); return *this;}

    /**
     *
The maximum number of origin access identities you want in the response body.
     *

     */
    inline ListCloudFrontOriginAccessIdentities2020_05_31Request& WithMaxItems(Aws::String&& value) { SetMaxItems(std::move(value)); return *this;}

    /**
     *
The maximum number of origin access identities you want in the response body.
     *

     */
    inline ListCloudFrontOriginAccessIdentities2020_05_31Request& WithMaxItems(const char* value) { SetMaxItems(value); return *this;}

  private:

    Aws::String m_marker;
    bool m_markerHasBeenSet;

    Aws::String m_maxItems;
    bool m_maxItemsHasBeenSet;
  };

} // namespace Model
} // namespace CloudFront
} // namespace Aws


text:
<?php
/**
 * OperationArtifactRepository.php
 * 2013 Petr Dvorak, petr-dvorak.cz / 16.4.13 21:51
 */

namespace ITILSimulator\Repositories\OperationArtifact;

use ITILSimulator\Entities\OperationArtifact\OperationArtifact;
use ITILSimulator\Entities\Session\ScenarioStep;
use ITILSimulator\Repositories\BaseRepository;
use ITILSimulator\Runtime\OperationArtifact\OperationArtifactPersistentUnit;
use ITILSimulator\Runtime\Simulator\EntityFilter;
use Nette\Diagnostics\Debugger;
use Nette\InvalidStateException;

/**
 * Operation artifact (event, incident, problem) repository.
 * @package ITILSimulator\Repositories\OperationArtifact
 */
abstract class OperationArtifactRepository extends BaseRepository
{
	private $objectsCache = array();

	/**
	 * Save operation artifact. If the artifact has been updated, invalidate old record and create a new one.
	 * If the artifact is new insert it as a new record.
	 * @param $artifactUnit
	 * @return OperationArtifact|void
	 * @throws \Nette\InvalidStateException
	 */
	public function save($artifactUnit) {
		if (!$artifactUnit instanceof OperationArtifactPersistentUnit)
			throw new InvalidStateException('Entities must be wrapped in OperationArtifactPersistentUnit.');

		$validTil = $artifactUnit->getScenarioStep();

		if (!$artifactUnit->getOperationArtifact()->getId()) {
			// new artifact
			return $this->create($artifactUnit, $validTil);

		} else {
			// updated artifact
			return $this->update($artifactUnit, $validTil);
		}
	}

	/**
	 * Update existing artifact. Invalidate current version of the artifact and create a new one.
	 * @param OperationArtifactPersistentUnit $artifactUnit
	 * @param $validFrom
	 * @return OperationArtifact
	 */
	protected function update(OperationArtifactPersistentUnit $artifactUnit, $validFrom) {
		// clone artifact to insert as a new record
		$originalArtifact = $artifactUnit->getOperationArtifact();
		if ($originalArtifact->getId()) {
			// update only objects already persisted in DB

			$modifiedArtifact = clone $artifactUnit->getOperationArtifact();
			//$modifiedArtifact->setTrainingStep($artifactUnit->getScenarioStep()->getTrainingStep());

			$modifiedArtifact->setOriginalId($originalArtifact->getOriginalId() ?: $originalArtifact->getId());
			$modifiedArtifact->validate($validFrom);
			$this->getEntityManager()->persist($modifiedArtifact);

			// ensure original entity was not modified and invalidate its validity
			$this->getEntityManager()->refresh($originalArtifact);
			$originalArtifact->invalidate($validFrom);
			$this->getEntityManager()->persist($originalArtifact);

		} else {
			// new objects (not yet in the DB) simply return back
			$modifiedArtifact = $originalArtifact;
		}

		$this->objectsCache[$modifiedArtifact->getOriginalId()] = $modifiedArtifact;

		return $modifiedArtifact;
	}

	/**
	 * Persist new operation artifact.
	 * @param OperationArtifactPersistentUnit $artifactUnit
	 * @param $validFrom
	 * @return OperationArtifact
	 */
	protected function create(OperationArtifactPersistentUnit $artifactUnit, $validFrom) {
		// insert a new record
		$artifact = $artifactUnit->getOperationArtifact();
		//$artifact->setTrainingStep($artifactUnit->getScenarioStep()->getTrainingStep());
		$artifact->validate($validFrom);
		$artifact->setDate(new \DateTime());
		$this->getEntityManager()->persist($artifact);

		return $artifact;
	}

	/**
	 * Undo operation artifacts up to selected scenario step.
	 * @param ScenarioStep $scenarioStep
	 * @param $className
	 */
	protected function doUndo(ScenarioStep $scenarioStep, $className) {
		// mark as undid all artifacts created "in the future" (after the scenario step we are returning to)
		$dqlUndid = 'UPDATE ' . $className . ' e SET e.isUndid = 1, e.scenarioStepTo = ?1 WHERE e.scenarioStepFrom >= ?2';

		$this->getEntityManager()->createQuery($dqlUndid)
			->setParameter(1, $scenarioStep)
			->setParameter(2, $scenarioStep)
			->execute();

		// reactive all artifacts active in the original scenario step
		$dqlNull = 'UPDATE ' . $className . ' e SET e.scenarioStepTo = NULL WHERE e.isUndid = 0 AND e.scenarioStepTo >= ?1';
		$this->getEntityManager()->createQuery($dqlNull)
			->setParameter(1, $scenarioStep)
			->execute();
	}

	/**
	 * Return available artifacts matching selected class, scenario and where condition.
	 * @param $className
	 * @param $scenarioStepId
	 * @param int $limit
	 * @param int $offset
	 * @param null $where
	 * @return \Doctrine\ORM\QueryBuilder
	 */
	protected function findAvailableArtifactsQuery($className, $scenarioStepId, $limit = 0, $offset = 0, $where = NULL) {
		$trainingId = $this->getEntityManager()->createQueryBuilder()
			->select('t.id')
			->from('ITILSimulator\Entities\Session\ScenarioStep', 's')
			->join('s.trainingStep', 't')
			->where('s.id = ?1')
			->setParameter(1, $scenarioStepId)
			->getQuery()
			->getSingleScalarResult();

		$query = $this->getEntityManager()->createQueryBuilder()
			->select('a')
			->from($className, 'a')
			->join('a.scenarioStepFrom', 's')
			->where('a.scenarioStepFrom <= ?1')
			->andWhere('a.scenarioStepTo IS NULL')
			->andWhere('a.isUndid = 0')
			->andWhere('s.trainingStep = ?2')
			->orderBy('a.date', 'DESC');

		$query->setParameter(1, $scenarioStepId);
		$query->setParameter(2, $trainingId);

		if ($limit)
			$query->setMaxResults($limit);

		if ($offset)
			$query->setFirstResult($offset);

		if ($where instanceof EntityFilter) {
			$where->apply($query, 'a');
		}

		return $query;
	}

	/**
	 * Return available artifacts matching the scenario and filter.
	 * @param $scenarioStepId
	 * @param int $limit
	 * @param int $offset
	 * @param null $filter
	 * @return array
	 */
	public function findAvailable($scenarioStepId, $limit = 0, $offset = 0, $filter = NULL) {
		/** @var OperationArtifact[] $data */
		$data = $this->findAvailableArtifactsQuery($this->_entityName, $scenarioStepId, $limit, $offset, $filter)->getQuery()->execute();
		$result = array();
		foreach ($data as $artifact) {
			if (isset($this->objectsCache[$artifact->getOriginalId() ?: $artifact->getId()])) {
				// we have modified object in memory (newer version available)
				$result[] = $this->objectsCache[$artifact->getOriginalId() ?: $artifact->getId()];

			} else {
				// untouched object from database
				$result[] = $artifact;
			}
		}

		return $result;
	}

	/**
	 * Count available artifacts matching the scenario and filter.
	 * @param $scenarioStepId
	 * @param null $filter
	 * @return mixed
	 */
	public function countAvailable($scenarioStepId, $filter = NULL) {
		return $this->findAvailableArtifactsQuery($this->_entityName, $scenarioStepId, 0, 0, $filter)
			->select('COUNT(a)')
			->getQuery()
			->getSingleScalarResult();
	}

	/**
	 * Find active version of selected operation artifact.
	 * (There can be multiple versions of the same artifact in the database. However only one of them should be active.)
	 * @param $id
	 * @return mixed|null
	 */
	public function findOneActive($id) {
		$qb = $this->getEntityManager()->createQueryBuilder();
		$qb->select('a')
			->from($this->_entityName, 'a')
			->where(
				$qb->expr()->orX(
					$qb->expr()->andX(
						$qb->expr()->eq('a.originalId', '?1'),
						$qb->expr()->isNull('a.scenarioStepTo')
					),
					$qb->expr()->andX(
						$qb->expr()->isNull('a.scenarioStepTo'),
						$qb->expr()->eq('a.id', '?1')
					)
				)
			);

		$qb->setParameter(1, $id);

		if ($result = $qb->getQuery()->execute())
			return reset($result);

		return null;
	}
}


text:
package twg2.parser.textParserUtils;

import java.util.function.Function;

/** Static decoder functions for character data such as escape sequences (i.e. {@code \t, \r, \n}, etc.)
 * @author TeamworkGuy2
 * @since 2014-9-1
 */
public final class EscapeSequences {
	public static final char newline = '\n';
	public static final char escapeStart = '\\';
	public static final char unicodeStart = 'u';
	/** the valid escape characters that can come after a '\', other than unicode escape sequences */
	public static final char[] escapeIdentifiers = new char[] { 't', 'b', 'n', 'r', 'f', '\'', '\"', '\\' };
	/** the escape characters created by the escape sequences in {@link #escapeIdentifiers} */
	public static final char[] escapeChars = new char[] { '\t', '\b', '\n', '\r', '\f', '\'', '\"', '\\' };
	public static final char[] unicodeLiterals = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
		'a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F' };
	private static final UnicodeEscapeDecoder defaultDecoderInst = new UnicodeEscapeDecoder();

	private EscapeSequences() { throw new AssertionError("cannot instantiate static class EscapeSequences"); }

	/** Returns a function that decodes unicode escape sequences and escape identifiers in a string.<br>
	 * The escape sequences (e.g. {@code \ b, \ t}) must be in the Java 8 language specification (§3.10.6) format.
	 * Note: octal escape sequences are not supported.
	 * The unicode escape sequences must be in the format ({@code \ u x x x}) specified by the
	 * Java 8 language specification (§3.3) - Unicode Escapes
	 * @return the input string with all unicode escape sequences replace with corresponding characters
	 */
	public static final Function<String, String> unicodeEscapeDecoder() {
		return defaultDecoderInst;
	}

}


text: Twitter paskyros dizainas


text:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
     android:ordering="sequentially">
  <set xmlns:android="http://schemas.android.com/apk/res/android"
       android:interpolator="@android:anim/accelerate_interpolator">
    <scale
        android:duration="2000"
        android:fromXScale="0.8"
        android:toXScale="1.2"
        android:fromYScale="0.8"
        android:toYScale="1.2"
        android:pivotX="49.566%"
        android:pivotY="66.65%"
        android:repeatCount="infinite"/>
  </set>
  <set xmlns:android="http://schemas.android.com/apk/res/android"
       android:interpolator="@android:anim/decelerate_interpolator">
    <scale
        android:duration="2000"
        android:fromXScale="1.2"
        android:toXScale="0.8"
        android:fromYScale="1.2"
        android:toYScale="0.8"
        android:pivotX="49.566%"
        android:pivotY="66.65%"
        android:repeatCount="infinite"/>
  </set>
</set>