text:
$CommandName = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "")
Write-Host -Object "Running $PSCommandpath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"

Describe "$commandname Unit Test" -Tags Unittest {
    $ModuleBase = (Get-Module -Name dbatools).ModuleBase
    $idxfile = "$ModuleBase\bin\dbatools-buildref-index.json"
    Context 'Validate data in json is correct' {
        It "the json file is there" {
            $result = Test-Path $idxfile
            $result | Should Be $true
        }
        It "the json can be parsed" {
            $IdxRef = Get-Content $idxfile -raw | ConvertFrom-Json
            $IdxRef | Should BeOfType System.Object
        }
    }
    Context 'Validate LastUpdated property' {
        $IdxRef = Get-Content $idxfile -raw | ConvertFrom-Json
        It "Has a proper LastUpdated property" {
            $lastupdate = Get-Date -Date $IdxRef.LastUpdated
            $lastupdate | Should BeOfType System.DateTime
        }
        It "LastUpdated is updated regularly (keeps everybody on their toes)" {
            $lastupdate = Get-Date -Date $IdxRef.LastUpdated
            $lastupdate | Should BeGreaterThan (Get-Date).AddDays(-90)
        }
        It "LastUpdated is not in the future" {
            $lastupdate = Get-Date -Date $IdxRef.LastUpdated
            $lastupdate | Should BeLessThan (Get-Date)
        }
    }
    Context 'Validate Data property' {
        $IdxRef = Get-Content $idxfile -raw | ConvertFrom-Json
        It "Data is a proper array" {
            $IdxRef.Data.Length | Should BeGreaterThan 100
        }
        It "Each Datum has a Version property" {
            $DataLength = $IdxRef.Data.Length
            $DataWithVersion = ($IdxRef.Data.Version | Where-Object { $_ }).Length
            $DataLength | Should Be $DataWithVersion
        }
        It "Each version is correctly parsable" {
            $Versions = $IdxRef.Data.Version | Where-Object { $_ }
            foreach ($ver in $Versions) {
                $splitted = $ver.split('.')
                $dots = $ver.split('.').Length - 1
                if ($dots -ne 2) {
                    $dots | Should Be 2
                }
                try {
                    $splitted | Foreach-Object { [convert]::ToInt32($_) }
                }
                catch {
                    # I know. But someone can find a method to output a custom message ?
                    $splitted -join '.' | Should Be "Composed by integers"
                }
            }
        }
        It "Versions are ordered, the way versions are ordered" {
            $Versions = $IdxRef.Data.Version | Where-Object { $_ }
            $Naturalized = $Versions | Foreach-Object {
                $splitted = $_.split('.') | Foreach-Object { [convert]::ToInt32($_) }
                "$($splitted[0].toString('00'))$($splitted[1].toString('00'))$($splitted[2].toString('0000'))"
            }
            $SortedVersions = $Naturalized | Sort-Object
            ($SortedVersions -join ",") | Should Be ($Naturalized -join ",")
        }
        It "Names are at least 8" {
            $Names = $IdxRef.Data.Name | Where-Object { $_ }
            $Names.Length | Should BeGreaterThan 7
        }
    }
    # These are groups by major release (aka "Name")
    $IdxRef = Get-Content $idxfile -raw | ConvertFrom-Json
    $Groups = @{ }
    $OrderedKeys = @()
    foreach ($el in $IdxRef.Data) {
        $ver = $el.Version.split('.')[0 .. 1] -join '.'
        if (!($Groups.ContainsKey($ver))) {
            $Groups[$ver] = New-Object System.Collections.ArrayList
            $OrderedKeys += $ver
        }
        $null = $Groups[$ver].Add($el)
    }
    foreach ($g in $OrderedKeys) {
        $Versions = $Groups[$g]
        Context "Properties Check, for major release $g" {
            It "has the first element with a Name" {
                $Versions[0].Name | Should BeLike "20*"
            }
            It "No multiple Names around" {
                ($Versions.Name | Where-Object { $_ }).Count | Should Be 1
            }
            It "has a single version tagged as RTM" {
                ($Versions.SP -eq 'RTM').Count | Should Be 1
            }
            It "has a single version tagged as LATEST" {
                ($Versions.SP -eq 'LATEST').Count | Should Be 1
            }
            It "SP Property is formatted correctly" {
                $Versions.SP | Where-Object { $_ } | Should Match '^RTM$|^LATEST$|^SP[\d]+$'
            }
            It "CU Property is formatted correctly" {
                $CUMatch = $Versions.CU | Where-Object { $_ }
                if ($CUMatch) {
                    $CUMatch | Should Match '^CU[\d]+$'
                }
            }
            It "SPs are ordered correctly" {
                $SPs = $Versions.SP | Where-Object { $_ }
                $SPs[0] | Should Be 'RTM'
                $SPs[-1] | Should Be 'LATEST'
                $ActualSPs = $SPs | Where-Object { $_ -match '^SP[\d]+$' }
                $OrderedActualSPs = $ActualSPs | Sort-Object
                ($ActualSPs -join ',') | Should Be ($OrderedActualSPs -join ',')
            }
            It "LATEST is on PAR with a SP" {
                $LATEST = $Versions | Where-Object SP -contains "LATEST"
                $LATEST.SP.Count | Should Be 2
            }
            # see https://github.com/sqlcollaborative/dbatools/pull/2466
            It "KBList has only numbers on it" {
                $NotNumbers = $Versions.KBList | Where-Object { $_ } | Where-Object { $_ -notmatch '^[\d]+$' }
                if ($NotNumbers.Count -ne 0) {
                    foreach ($Nn in $NotNumbers) {
                        $Nn | Should Be "Composed by integers"
                    }
                }
            }
        }
    }
}

Describe "$commandname Integration Tests" -Tags IntegrationTests {
    Context "Test retrieving version from instances" {
        $results = Get-DbaSqlBuildReference -SqlInstance $script:instance1, $script:instance2
        It "Should return an exact match" {
            foreach ($r in $results) {
                $r.MatchType | Should Be "Exact"
            }
        }
    }
}


text:
import Vue from 'vue';
import VueRouter from 'vue-router';
import App from './App';
import List from './components/List';

Vue.use(VueRouter);

const Foo = { template: '
foo
' }
const Bar = { template: '
bar
' }

const routes = [
  { path: '/', component: List },
  { path: '/foo', component: Foo },
  { path: '/bar', component: Bar },
  { path: '*', component: List },
]

const router = new VueRouter({
  routes,
  hashbang: false,
  history: true,
  mode: 'history',
})

/* eslint-disable no-new */
new Vue({
  router,
  el: '#app',
  template: '<App/>',
  components: { App },
  data: {
    singleItem: {
      location: {},
    },
    items: null,
    locationImage: '',
  },
});

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>MegaMeta2048</title>
    <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
    <link rel="stylesheet" href="style.css">
    <link href="https://fonts.googleapis.com/css?family=Open+Sans:700" rel="stylesheet" type="text/css">

    Score: 0


text:
using RunTests

@testmodule TestModuleWithNoTests begin
end


text:
export default {

	//equal to
	"=":function(filterVal, rowVal, rowData, filterParams){
		return rowVal == filterVal ? true : false;
	},

	//less than
	"<":function(filterVal, rowVal, rowData, filterParams){
		return rowVal < filterVal ? true : false;
	},

	//less than or equal to
	"<=":function(filterVal, rowVal, rowData, filterParams){
		return rowVal <= filterVal ? true : false;
	},

	//greater than
	">":function(filterVal, rowVal, rowData, filterParams){
		return rowVal > filterVal ? true : false;
	},

	//greater than or equal to
	">=":function(filterVal, rowVal, rowData, filterParams){
		return rowVal >= filterVal ? true : false;
	},

	//not equal to
	"!=":function(filterVal, rowVal, rowData, filterParams){
		return rowVal != filterVal ? true : false;
	},

	"regex":function(filterVal, rowVal, rowData, filterParams){

		if(typeof filterVal == "string"){
			filterVal = new RegExp(filterVal);
		}

		return filterVal.test(rowVal);
	},

	//contains the string
	"like":function(filterVal, rowVal, rowData, filterParams){
		if(filterVal === null || typeof filterVal === "undefined"){
			return rowVal === filterVal ? true : false;
		}else{
			if(typeof rowVal !== 'undefined' && rowVal !== null){
				return String(rowVal).toLowerCase().indexOf(filterVal.toLowerCase()) > -1;
			}
			else{
				return false;
			}
		}
	},

	//contains the keywords
	"keywords":function(filterVal, rowVal, rowData, filterParams){
		var keywords = filterVal.toLowerCase().split(typeof filterParams.separator === "undefined" ? " " : filterParams.separator),
		value = String(rowVal === null || typeof rowVal === "undefined" ? "" : rowVal).toLowerCase(),
		matches = [];

		keywords.forEach((keyword) =>{
			if(value.includes(keyword)){
				matches.push(true);
			}
		});

		return filterParams.matchAll ? matches.length === keywords.length : !!matches.length;
	},

	//starts with the string
	"starts":function(filterVal, rowVal, rowData, filterParams){
		if(filterVal === null || typeof filterVal === "undefined"){
			return rowVal === filterVal ? true : false;
		}else{
			if(typeof rowVal !== 'undefined' && rowVal !== null){
				return String(rowVal).toLowerCase().startsWith(filterVal.toLowerCase());
			}
			else{
				return false;
			}
		}
	},

	//ends with the string
	"ends":function(filterVal, rowVal, rowData, filterParams){
		if(filterVal === null || typeof filterVal === "undefined"){
			return rowVal === filterVal ? true : false;
		}else{
			if(typeof rowVal !== 'undefined' && rowVal !== null){
				return String(rowVal).toLowerCase().endsWith(filterVal.toLowerCase());
			}
			else{
				return false;
			}
		}
	},

	//in array
	"in":function(filterVal, rowVal, rowData, filterParams){
		if(Array.isArray(filterVal)){
			return filterVal.length ? filterVal.indexOf(rowVal) > -1 : true;
		}else{
			console.warn("Filter Error - filter value is not an array:", filterVal);
			return false;
		}
	},
};


text:
use strict;
use CoGe::Genome;
use Data::Dumper;
use Getopt::Long;

my ($file, $verbose, $help, $version);

GetOptions('file|f=s'=>\$file,
	   'verboes|debug'=>\$verbose,
	   'help|h'=>\$help,
	   'version|ver|v=i'=>\$version,
	  );

$help = 1 unless $file && $version;
show_help() if $help;

my $db = CoGe::Genome->new;
my ($data_source) = $db->get_data_source_obj->search({data_source_id=>1});
my ($org) = $db->get_org_obj->search({organism_id=>1});
my $data_info = $db->get_data_info_obj->find_or_create({data_source_id=>$data_source->id, organism_id=>$org->id, name=>"all.domains.txt", description=>"TAIR version 6 list of protein domains determined by a variety of algorithms.", version=>6, link=>"ftp://ftp.arabidopsis.org/home/tair/Proteins/Domains/all.domains.txt"});
my $data = process_file($file);
my $feat_type = $db->get_feature_type_obj->find_or_create({name=>"Functional Domains", description=>"Protein domains detected by a variety of algorithms"});
process_data($data);
#$feat_type->delete;
sub process_domains
  {
    my %opts = @_;
    my $feat = $opts{feat};
    my $doms = $opts{doms};
    foreach my $dom_id (keys %$doms)
      {
	my @locs;
	my ($app, $d_id, $d_name, $ip_id, $ip_name, $eval);
	foreach my $dom (@{$doms->{$dom_id}})
	  {
	    $app = $dom->{application};
	    $d_id = $dom->{domain_id};
	    $d_name = $dom->{domain_desc};
	    $eval = $dom->{eval};
	    $ip_id = $dom->{interpro_id};
	    $ip_name = $dom->{interpro_name};
	    foreach my $seq ($feat->sequences)
	      {
		my $dstart = $seq->get_genomic_position($dom->{start});
		my $dstop = $seq->get_genomic_position($dom->{stop});
		push @locs, $seq->get_genomic_locations(start=>$dom->{start}, stop=>$dom->{stop});
	      }
	  }
	my $new_feat = $db->get_feat_obj->create({feature_type_id=>$feat_type->id(), data_information_id=>$data_info->id});
	my $atg = $db->get_anno_type_group_obj->find_or_create({name=>$app, description=>"Domain finding algorithm"});
	my $at = $db->get_anno_type_obj->find_or_create({annotation_type_group_id=>$atg->id, name=>$ip_id, description=>$ip_name});
	my $a = $db->get_anno_obj->find_or_create({annotation_type_id=>$at->id, feature_id=>$new_feat->id, annotation=>$ip_name." ($d_id, eval: $eval)"});
	$db->get_feat_name_obj->find_or_create({feature_id=>$new_feat->id, name=>$ip_name, description=>$ip_id});
	$db->get_feat_name_obj->find_or_create({feature_id=>$new_feat->id, name=>$ip_id, description=>$ip_name});
	$db->get_feat_name_obj->find_or_create({feature_id=>$new_feat->id, name=>$d_name, description=>$d_id});
	$db->get_feat_name_obj->find_or_create({feature_id=>$new_feat->id, name=>$d_id, description=>$d_name});
	foreach my $loc (@locs)
	  {
	    $db->get_loc_obj->create({feature_id=>$new_feat->id,
				      start => $loc->start,
				      stop => $loc->stop,
				      strand => $loc->strand,
				      chromosome=> $loc->chr,
				     });
	    delete $loc->{__Changed};
	  }

      }
  }

sub process_data
  {
    my $data = shift;
    my $total = scalar keys %$data;
    my $i = 0;
    foreach my $accn (keys %$data)
      {
	$i++;
	print $i,"/",$total,":\t", $accn,"\n";
	foreach my $feat ($db->get_features_by_name_and_version(name=>$accn, version=>$version))
	  {
	    next unless $feat->type->name =~ /CDS/i;
	    process_domains(feat=>$feat, doms=>$data->{$accn});
	  }
      }
  }

sub process_file
  {
    my $file = shift;
    my %data;
    open (IN, $file) || die "Can't open $file for reading: $!";
    while (<IN>)
      {
	chomp;
	my @line = split /\t/;
	next unless $line[10];
	next if $line[10] =~ /NULL/;
#	next unless $line[2] =~ /HMM/;
	push @{$data{$line[0]}{$line[3]}}, {
				  application=>$line[2],
				  domain_id=>$line[3],
				  domain_desc=>$line[4],
				  start=>$line[5],
				  stop=>$line[6],
				  eval=>$line[7],
				  interpro_id=>$line[9],
				  interpro_name=>$line[10],
				 }
      }
    close IN;
    return \%data;
  }

sub show_help
  {
    print qq{
Welcome to $0!

This program loads tab-delimited domain information.  It was originally designed for the domain information file from arabidopsis.org for version 6 of the arabidopsis genome.

--file|f          Name of tab delimited file with domain data

--verbose|debug   Verbose and debugging mode

--version|ver|v   Version of the data which to add the domain features

--help            prints this page
};
    exit;
  }


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
org.gradle.nativebinaries.test
</TITLE>

<META NAME="keywords" CONTENT="org/gradle/nativebinaries/test package">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

org.gradle.nativebinaries.test

Interfaces

ProjectComponentTestSuite
TestSuite
TestSuiteContainer
TestSuiteExecutableBinary


text:
using CSharpGuidelinesAnalyzer.Rules.Maintainability;
using CSharpGuidelinesAnalyzer.Test.TestDataBuilders;
using Microsoft.CodeAnalysis.Diagnostics;
using Xunit;

// @formatter:keep_existing_linebreaks true

namespace CSharpGuidelinesAnalyzer.Test.Specs.Maintainability;

public sealed class FileShouldBeNamedCorrectlySpecs : CSharpGuidelinesAnalysisTestFixture
{
    protected override string DiagnosticId => FileShouldBeNamedCorrectlyAnalyzer.DiagnosticId;

    [Fact]
    internal async Task When_file_name_matches_rules_it_must_be_skipped()
    {
        // Arrange
        ParsedSourceCode source = new EmptySourceCodeBuilder()
            .InFileNamed("MainForm.cs")
            .Build();

        // Act and assert
        await VerifyGuidelineDiagnosticAsync(source);
    }

    [Fact]
    internal async Task When_file_name_starts_with_lowercase_it_must_be_reported()
    {
        // Arrange
        ParsedSourceCode source = new EmptySourceCodeBuilder()
            .InFileNamed("mainForm.cs")
            .WithCode("[||]")
            .Build();

        // Act and assert
        await VerifyGuidelineDiagnosticAsync(source,
            "File 'mainForm.cs' should be named using Pascal casing");
    }

    [Fact]
    internal async Task When_file_name_contains_underscore_it_must_be_reported()
    {
        // Arrange
        ParsedSourceCode source = new EmptySourceCodeBuilder()
            .InFileNamed("Main_Form.cs")
            .WithCode("[||]")
            .Build();

        // Act and assert
        await VerifyGuidelineDiagnosticAsync(source,
            "File 'Main_Form.cs' should be named without underscores");
    }

    [Fact]
    internal async Task When_file_name_contains_generic_arity_it_must_be_reported()
    {
        // Arrange
        ParsedSourceCode source = new EmptySourceCodeBuilder()
            .InFileNamed("ValueContainer`1.cs")
            .WithCode("[||]")
            .Build();

        // Act and assert
        await VerifyGuidelineDiagnosticAsync(source,
            "File 'ValueContainer`1.cs' should be named without generic arity");
    }

    protected override DiagnosticAnalyzer CreateAnalyzer()
    {
        return new FileShouldBeNamedCorrectlyAnalyzer();
    }
}


text:
NS_ASSUME_NONNULL_BEGIN

@interface SPTrackerEvent : NSObject <SPInspectableEvent>

@property (nonatomic) NSMutableDictionary<NSString *, NSObject *> *payload;
@property (nonatomic) NSString *schema;
@property (nonatomic) NSString *eventName;
@property (nonatomic) NSUUID *eventId;
@property (nonatomic) long long timestamp;
@property (nonatomic, nullable) NSDate *trueTimestamp;
@property (nonatomic) NSMutableArray<SPSelfDescribingJson *> *contexts;
@property (nonatomic) id<SPTrackerStateSnapshot> state;

@property (nonatomic) BOOL isPrimitive;
@property (nonatomic) BOOL isService;

+ (instancetype) new NS_UNAVAILABLE;
- (instancetype) init NS_UNAVAILABLE;

- (instancetype)initWithEvent:(SPEvent *)event;
- (instancetype)initWithEvent:(SPEvent *)event state:(nullable id<SPTrackerStateSnapshot>)state;

@end

NS_ASSUME_NONNULL_END


text:
package org.apache.xml.security.test.dom.secure_val;

import java.io.File;
import java.io.FileInputStream;

import org.apache.xml.security.signature.Manifest;
import org.apache.xml.security.signature.MissingResourceFailureException;
import org.apache.xml.security.test.dom.interop.InteropTestBase;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
import org.apache.xml.security.utils.resolver.ResourceResolver;
import org.apache.xml.security.utils.resolver.implementations.ResolverLocalFilesystem;
import org.w3c.dom.Element;

import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;

/**
 * This is a test for a forbidden Reference algorithm
 */
public class ForbiddenReferenceTest extends InteropTestBase {

    static org.slf4j.Logger LOG =
        org.slf4j.LoggerFactory.getLogger(ForbiddenReferenceTest.class);

    static {
        org.apache.xml.security.Init.init();
    }

    public ForbiddenReferenceTest() {
        super();
    }

    @org.junit.jupiter.api.Test
    public void testLocalFilesystem() throws Exception {
        try {
            readAndVerifyManifest("src/test/resources/interop/c14n/Y3", "signature.xml");
            fail("Failure expected when secure validation is enabled");
        } catch (MissingResourceFailureException ex) {
            assertTrue(ex.getMessage().contains("The Reference for URI"));
        }

        // Now it should work as we have added the local file resolver
        ResourceResolver.register(new ResolverLocalFilesystem(), false);
        boolean success =
                readAndVerifyManifest("src/test/resources/interop/c14n/Y3", "signature.xml");
        assertTrue(success);
    }

    private boolean readAndVerifyManifest(
        String directory, String file
    ) throws Exception {
        String basedir = System.getProperty("basedir");
        if (basedir != null && basedir.length() != 0) {
            directory = basedir + "/" + directory;
        }

        File f = new File(directory + "/" + file);

        org.w3c.dom.Document doc = XMLUtils.read(new FileInputStream(f), false);

        Element manifestElement =
            (Element) doc.getElementsByTagNameNS(Constants.SignatureSpecNS,
                                                 Constants._TAG_SIGNEDINFO).item(0);
        Manifest manifest = new Manifest(manifestElement, f.toURI().toURL().toString(), true);
        return manifest.verifyReferences();
    }

}


text:
package org.apache.spark.rpc

import java.io.File
import java.net.URI
import java.nio.channels.ReadableByteChannel

import scala.concurrent.Future

import org.apache.spark.{SecurityManager, SparkConf}
import org.apache.spark.rpc.netty.NettyRpcEnvFactory
import org.apache.spark.util.RpcUtils

/**
 * A RpcEnv implementation must have a [[RpcEnvFactory]] implementation with an empty constructor
 * so that it can be created via Reflection.
 */
private[spark] object RpcEnv {

  def create(
      name: String,
      host: String,
      port: Int,
      conf: SparkConf,
      securityManager: SecurityManager,
      clientMode: Boolean = false): RpcEnv = {
    create(name, host, host, port, conf, securityManager, 0, clientMode)
  }

  def create(
      name: String,
      bindAddress: String,
      advertiseAddress: String,
      port: Int,
      conf: SparkConf,
      securityManager: SecurityManager,
      numUsableCores: Int,
      clientMode: Boolean): RpcEnv = {
    val config = RpcEnvConfig(conf, name, bindAddress, advertiseAddress, port, securityManager,
      numUsableCores, clientMode)
    new NettyRpcEnvFactory().create(config)
  }
}

/**
 * An RPC environment. [[RpcEndpoint]]s need to register itself with a name to [[RpcEnv]] to
 * receives messages. Then [[RpcEnv]] will process messages sent from [[RpcEndpointRef]] or remote
 * nodes, and deliver them to corresponding [[RpcEndpoint]]s. For uncaught exceptions caught by
 * [[RpcEnv]], [[RpcEnv]] will use [[RpcCallContext.sendFailure]] to send exceptions back to the
 * sender, or logging them if no such sender or `NotSerializableException`.
 *
 * [[RpcEnv]] also provides some methods to retrieve [[RpcEndpointRef]]s given name or uri.
 */
private[spark] abstract class RpcEnv(conf: SparkConf) {

  private[spark] val defaultLookupTimeout = RpcUtils.lookupRpcTimeout(conf)

  /**
   * Return RpcEndpointRef of the registered [[RpcEndpoint]]. Will be used to implement
   * [[RpcEndpoint.self]]. Return `null` if the corresponding [[RpcEndpointRef]] does not exist.
   */
  private[rpc] def endpointRef(endpoint: RpcEndpoint): RpcEndpointRef

  /**
   * Return the address that [[RpcEnv]] is listening to.
   */
  def address: RpcAddress

  /**
   * Register a [[RpcEndpoint]] with a name and return its [[RpcEndpointRef]]. [[RpcEnv]] does not
   * guarantee thread-safety.
   */
  def setupEndpoint(name: String, endpoint: RpcEndpoint): RpcEndpointRef

  /**
   * Retrieve the [[RpcEndpointRef]] represented by `uri` asynchronously.
   */
  def asyncSetupEndpointRefByURI(uri: String): Future[RpcEndpointRef]

  /**
   * Retrieve the [[RpcEndpointRef]] represented by `uri`. This is a blocking action.
   */
  def setupEndpointRefByURI(uri: String): RpcEndpointRef = {
    defaultLookupTimeout.awaitResult(asyncSetupEndpointRefByURI(uri))
  }

  /**
   * Retrieve the [[RpcEndpointRef]] represented by `address` and `endpointName`.
   * This is a blocking action.
   */
  def setupEndpointRef(address: RpcAddress, endpointName: String): RpcEndpointRef = {
    setupEndpointRefByURI(RpcEndpointAddress(address, endpointName).toString)
  }

  /**
   * Stop [[RpcEndpoint]] specified by `endpoint`.
   */
  def stop(endpoint: RpcEndpointRef): Unit

  /**
   * Shutdown this [[RpcEnv]] asynchronously. If need to make sure [[RpcEnv]] exits successfully,
   * call [[awaitTermination()]] straight after [[shutdown()]].
   */
  def shutdown(): Unit

  /**
   * Wait until [[RpcEnv]] exits.
   *
   * TODO do we need a timeout parameter?
   */
  def awaitTermination(): Unit

  /**
   * [[RpcEndpointRef]] cannot be deserialized without [[RpcEnv]]. So when deserializing any object
   * that contains [[RpcEndpointRef]]s, the deserialization codes should be wrapped by this method.
   */
  def deserialize[T](deserializationAction: () => T): T

  /**
   * Return the instance of the file server used to serve files. This may be `null` if the
   * RpcEnv is not operating in server mode.
   */
  def fileServer: RpcEnvFileServer

  /**
   * Open a channel to download a file from the given URI. If the URIs returned by the
   * RpcEnvFileServer use the "spark" scheme, this method will be called by the Utils class to
   * retrieve the files.
   *
   * @param uri URI with location of the file.
   */
  def openChannel(uri: String): ReadableByteChannel
}

/**
 * A server used by the RpcEnv to server files to other processes owned by the application.
 *
 * The file server can return URIs handled by common libraries (such as "http" or "hdfs"), or
 * it can return "spark" URIs which will be handled by `RpcEnv#fetchFile`.
 */
private[spark] trait RpcEnvFileServer {

  /**
   * Adds a file to be served by this RpcEnv. This is used to serve files from the driver
   * to executors when they're stored on the driver's local file system.
   *
   * @param file Local file to serve.
   * @return A URI for the location of the file.
   */
  def addFile(file: File): String

  /**
   * Adds a jar to be served by this RpcEnv. Similar to `addFile` but for jars added using
   * `SparkContext.addJar`.
   *
   * @param file Local file to serve.
   * @return A URI for the location of the file.
   */
  def addJar(file: File): String

  /**
   * Adds a local directory to be served via this file server.
   *
   * @param baseUri Leading URI path (files can be retrieved by appending their relative
   *                path to this base URI). This cannot be "files" nor "jars".
   * @param path Path to the local directory.
   * @return URI for the root of the directory in the file server.
   */
  def addDirectory(baseUri: String, path: File): String

  /** Validates and normalizes the base URI for directories. */
  protected def validateDirectoryUri(baseUri: String): String = {
    val baseCanonicalUri = new URI(baseUri).normalize().getPath
    val fixedBaseUri = "/" + baseCanonicalUri.stripPrefix("/").stripSuffix("/")
    require(fixedBaseUri != "/files" && fixedBaseUri != "/jars",
      "Directory URI cannot be /files nor /jars.")
    fixedBaseUri
  }

}

private[spark] case class RpcEnvConfig(
    conf: SparkConf,
    name: String,
    bindAddress: String,
    advertiseAddress: String,
    port: Int,
    securityManager: SecurityManager,
    numUsableCores: Int,
    clientMode: Boolean)


text:
package com.pivotal.gemfirexd.internal.iapi.error;

import java.sql.SQLWarning;

// for javadoc
import com.pivotal.gemfirexd.internal.iapi.services.i18n.MessageService;
import com.pivotal.gemfirexd.internal.shared.common.reference.SQLState;

/**
 * This class generates SQLWarning instances. It has an understanding of Derby's
 * internal error/warning message Ids, and transforms these to localised error
 * messages and appropriate SQLState.
 */
public class SQLWarningFactory {

	/**
	 * Generates a SQLWarning instance based on the supplied messageId. It looks
	 * up the messageId to generate a localised warning message. Also, SQLState
	 * is set correctly based on the messageId.
	 *
	 * @param messageId
	 *            A Derby messageId as defined in
	 *            {@link SQLState com.pivotal.gemfirexd.internal.shared.common.reference.SQLState}.
	 * @return Properly initialized SQLWarning instance.
	 * @see com.pivotal.gemfirexd.internal.shared.common.reference.SQLState
	 */
	public static SQLWarning newSQLWarning(String messageId) {
		return newSQLWarning(messageId, null);
	}

	/**
	 * Generates a SQLWarning instance based on the supplied messageId and
	 * argument. It looks up the messageId to generate a localised warning
	 * message. Also, SQLState is set correctly based on the messageId.
	 *
	 * @param messageId
	 *            A Derby messageId as defined in
	 *            {@link SQLState com.pivotal.gemfirexd.internal.shared.common.reference.SQLState}.
	 * @param arg
	 *            An argument for the warning message
	 * @return Properly initialized SQLWarning instance.
	 * @see com.pivotal.gemfirexd.internal.shared.common.reference.SQLState
	 */
	public static SQLWarning newSQLWarning(String messageId, Object arg) {
		return new SQLWarning(MessageService.getCompleteMessage(messageId,
				new Object[] { arg }), StandardException
				.getSQLStateFromIdentifier(messageId), ExceptionSeverity.WARNING_SEVERITY);
	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definitions"
  xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:camunda="http://camunda.org/schema/1.0/bpmn"
  targetNamespace="Examples">

  <process id="process">

    <startEvent id="theStart" />

    <sequenceFlow id="flow1" sourceRef="theStart" targetRef="subProcess" />

    <subProcess id="subProcess">

      <startEvent id="theInnterStart" />

      <sequenceFlow id="innerFlow1" sourceRef="theInnterStart" targetRef="serviceTask" />

      <serviceTask id="serviceTask" camunda:async="true" camunda:class="org.camunda.bpm.engine.test.api.runtime.FailingDelegate" />

      <sequenceFlow id="innerFlow2" sourceRef="serviceTask" targetRef="theInnerEnd" />

      <endEvent id="theInnerEnd" />

    </subProcess>

    <sequenceFlow id="flow2" sourceRef="subProcess" targetRef="theEnd" />

    <endEvent id="theEnd" />

  </process>

</definitions>


text:
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <sys/types.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include <errno.h>
#include <stdio.h>
#include <fcntl.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#include "ansidecl.h"

/* We need to provide a type for gcc_uint64_t.  */
#ifdef __GNUC__
__extension__ typedef unsigned long long gcc_uint64_t;
#else
typedef unsigned long gcc_uint64_t;
#endif

#ifndef TMP_MAX
#define TMP_MAX 16384
#endif

#ifndef O_BINARY
# define O_BINARY 0
#endif

/*

@deftypefn Replacement int mkstemps (char *@var{pattern}, int @var{suffix_len})

Generate a unique temporary file name from @var{pattern}.
@var{pattern} has the form:

@example
   @var{path}/ccXXXXXX@var{suffix}
@end example

@var{suffix_len} tells us how long @var{suffix} is (it can be zero
length).  The last six characters of @var{pattern} before @var{suffix}
must be @samp{XXXXXX}; they are replaced with a string that makes the
filename unique.  Returns a file descriptor open on the file for
reading and writing.

@end deftypefn

*/

int
mkstemps (char *pattern, int suffix_len)
{
  static const char letters[]
    = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
  static gcc_uint64_t value;
#ifdef HAVE_GETTIMEOFDAY
  struct timeval tv;
#endif
  char *XXXXXX;
  size_t len;
  int count;

  len = strlen (pattern);

  if ((int) len < 6 + suffix_len
      || strncmp (&pattern[len - 6 - suffix_len], "XXXXXX", 6))
    {
      return -1;
    }

  XXXXXX = &pattern[len - 6 - suffix_len];

#ifdef HAVE_GETTIMEOFDAY
  /* Get some more or less random data.  */
  gettimeofday (&tv, NULL);
  value += ((gcc_uint64_t) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid ();
#else
  value += getpid ();
#endif

  for (count = 0; count < TMP_MAX; ++count)
    {
      gcc_uint64_t v = value;
      int fd;

      /* Fill in the random bits.  */
      XXXXXX[0] = letters[v % 62];
      v /= 62;
      XXXXXX[1] = letters[v % 62];
      v /= 62;
      XXXXXX[2] = letters[v % 62];
      v /= 62;
      XXXXXX[3] = letters[v % 62];
      v /= 62;
      XXXXXX[4] = letters[v % 62];
      v /= 62;
      XXXXXX[5] = letters[v % 62];

      fd = open (pattern, O_BINARY|O_RDWR|O_CREAT|O_EXCL, 0600);
      if (fd >= 0)
	/* The file does not exist.  */
	return fd;

      /* This is a random value.  It is only necessary that the next
	 TMP_MAX values generated by adding 7777 to VALUE are different
	 with (module 2^32).  */
      value += 7777;
    }

  /* We return the null string if we can't find a unique file name.  */
  pattern[0] = '\0';
  return -1;
}


text:
[![The Open Source Phasor Data Concentrator](openPDC_Logo.png)](openPDC_Home.md "The Open Source Phasor Data Concentrator")

|   |   |   |   |   |
|---|---|---|---|---|
| **[Grid Protection Alliance](http://www.gridprotectionalliance.org "Grid Protection Alliance Home Page")** | **[openPDC Project](https://github.com/GridProtectionAlliance/openPDC "openPDC Project on GitHub")** | **[openPDC Wiki](https://github.com/GridProtectionAlliance/openPDC/wiki)** | **[Documentation](https://github.com/GridProtectionAlliance/openPDC/wiki/Documentation)** | **[Latest Release](https://github.com/GridProtectionAlliance/openPDC/releases "openPDC Releases Home Page")** |

# Remote Console Security

*As of version 2.0.131, the permissions for commands has changed. To see the original list, see [version 3](Remote_Console_Security.files/Remote_Console_Security_Version_3.md) of this page.*

As of version 1.5.190 of the openPDC, remote console security has been enabled by default. These security features will be available in the final release of v1.5 SP1. This page details the changes that have been made to the security features in this version of the openPDC.

## Config file settings
The following settings were modified to enable security. These are the new defaults, but if you are upgrading from a previous version, they will not override your security settings. Apply these changes manually to enable the new security features.

## openPDC.exe.config settings

- The `categorizedSettings/serviceHelper/SecureRemoteInteractions` value has been set to `True`.
- The `categorizedSettings/remotingServer/IntegratedSecurity` value been set to `True`.
- The `categorizedSettings/securityProvider` section has been copied from `openPDCManager.exe.config` with the following changes.
    - The `ApplicationName` value has been set to `openPDC`.
    - The `IncludedResources` value has been set to `UpdateSettings,UpdateConfigFile=Special;Settings,Schedules,Help,Status,Version,Time,Health,List,Invoke,ListCommands,ListReports,GetReport=*;Processes,Start,ReloadCryptoCache,ReloadSettings,Reschedule,Unschedule,SaveSchedules,LoadSchedules,ResetHealthMonitor,Connect,Disconnect,Initialize,ReloadConfig,Authenticate,RefreshRoutes,TemporalSupport,LogEvent,GenerateReport,ReportingConfig=Administrator,Editor; *=Administrator`. (More on this below.)

## openPDCConsole.exe.config settings

- The `categorizedSettings/remotingClient/IntegratedSecurity` value has been set to `True`.

## Database settings

Database scripts have been updated to allow the openPDC Manager to properly connect to the service as well. Again, if you are upgrading from a previous version, apply this change manually.

- In the Node table of the database (Manage > Nodes in the openPDC Manager):
    - The `Settings` field, `RemoteStatusServerConnectionString={server=localhost:8500}` has been changed to `RemoteStatusServerConnectionString={server=localhost:8500;integratedSecurity=true}`.

## Console permissions

In much the same way that the Manager handles permissions based on roles defined in the database, now the openPDC does as well. Certain commands are restricted such that editors or viewers will not be able to enter them into the console. This is handled by the `IncludedResources` setting in openPDC.exe.config (mentioned above). The following gives a breakdown of all possible commands in the system and the permissions associated with them.

```
ADMINISTRATOR, EDITOR, VIEWER
-----------------------------
Settings
Schedules
Help
Status
Version
Time
Health
List
Invoke
ListCommands
ListReports
GetReport
ADMINISTRATOR, EDITOR
---------------------
Processes
Start
ReloadCrytpoCache
ReloadSettings
Reschedule
Unschedule
SaveSchedules
LoadSchedules
ResetHealthMonitor
Connect
Disconnect
Initialize
ReloadConfig
Authenticate
RefreshRoutes
TemporalSupport
LogEvent
GenerateReport
ReportingConfig
ADMINISTRATOR
-------------
Clients
History
Abort
Restart
```

The `IncludedResources` setting can be used to modify these permissions. It is defined as a semicolon-separated list of permissions. Each permission record in the semicolon-separated list consists of two comma-separated lists, one on each side of an equals sign. The list on the left-hand side of the equals sign defines the list of commands. The list on the right-hand side of the equals sign defines the roles which are allowed to use those commands. An asterisk can be placed on either side of the equals sign to indicate "all commands" or "all roles". The breakdown below should help in understanding it.

`UpdateSettings,UpdateConfigFile=Special;`

> The UpdateSettings and UpdateConfigFile commands are not available to any roles.

`Settings,Schedules,Help,Status,Version,Time,Health,List,Invoke,ListCommands,ListReports,GetReport=*;`

> The Settings, Schedules, Help, Status, Version, Time, Health, and List commands are available to all roles (Administrator, Editor, Viewer).

`Processes,Start,ReloadCryptoCache,ReloadSettings,Reschedule,Unschedule,SaveSchedules,LoadSchedules,ResetHealthMonitor,Connect,Disconnect,Initialize,ReloadConfig,Authenticate,RefreshRoutes,TemporalSupport,LogEvent,GenerateReport,ReportingConfig=Administrator,Editor;`

> The long list of commands on the left are available only to Administrators and Editors.

`*=Administrator`

> All commands are available to Administrators.

Also note that the semicolon-separated list is traversed only until a rule is matched, and that one rule will be used to determine whether a role has permission to use that command. For instance, the following ruleset would actually restrict the List command so that Administrators and Editors would not be able to use it.

`List=Viewer; *=Administrator,Editor`

Likewise, the following ruleset would restrict the system so that only Administrators could use commands.

`*=Administrator; List=Editor,Viewer`

---

Mar 27, 2014 7:21 PM - Last edited by [staphen](http://www.codeplex.com/site/users/view/staphen), version 4
Oct 4, 2015 - Migrated from [CodePlex] (http://openpdc.codeplex.com/wikipage?title=Remote%20Console%20Security) by [aj](https://github.com/ajstadlin)

---

Copyright 2016 [Grid Protection Alliance](http://www.gridprotectionalliance.org)


text:
<?php

namespace Mvc\Libs\Session;

use Codeception\Util\Stub;
use Slick\Configuration\Configuration;
use Slick\Mvc\Libs\Session\FlashMessages;

/**
 * Controller test case
 *
 * @package   Test\Mvc\Libs\Session
 * @author    Filipe Silva <silvam.filipe@gmail.com>
 */
class FlashMessagesTest extends \Codeception\TestCase\Test
{
   /**
    * @var \CodeGuy
    */
    protected $codeGuy;

    protected function _before()
    {
        parent::_before();
        $path = getcwd() . '/tests/app/Configuration';
        Configuration::addPath($path);
    }

    protected function _after()
    {
        FlashMessages::getMessages();
        parent::_after();
    }

    /**
     * Create Flash messages object
     * @test
     */
    public function createFlashMessagesObject()
    {
        $fm = new FlashMessages();
        $fmStatic = FlashMessages::getInstance();
        //$this->assertEquals($fm, $fmStatic);
        $this->assertNotSame($fm, $fmStatic);

        $this->assertSame($fm->getSession(), $fmStatic->getSession());
    }

    /**
     * Setting messages
     * @test
     */
    public function settingFlashMessages()
    {
        $fm = FlashMessages::setMessage(FlashMessages::TYPE_INFO, 'test');
        $this->assertInstanceOf('Slick\Mvc\Libs\Session\FlashMessages', $fm);
        $fm->set(5, 'other');
        $expected = [
            FlashMessages::TYPE_INFO => [
                'test', 'other'
            ]
        ];
        $this->assertEquals($expected, $fm->get());
        $this->assertEquals([], $fm->get());
    }

}


text:
import Validator from './Validator';

/**
 * Get the validator for a particular metric type
 * @param {string} metricType - metric type (e.g., 'buckets', 'accounts')
 * @param {object} dict - Input fields for route
 * @param {boolean} [isRecentListing] - `true` if the route is for listing
 * recent metrics (i.e., list the metrics starting from the second most recent
 * fifteen minute timestamp), otherwise `undefined`
 * @return {Validator} Return the created validator
 */
function getValidator(metricType, dict, isRecentListing) {
    // Do not validate time ranges for recent listings because we create the
    // recent listing timerange in ListMetrics::getRecentTypesMetrics
    const obj = isRecentListing ? {} : { timeRange: true };
    obj[metricType] = true;
    return new Validator(obj, dict);
}

/**
 * Function to create a validator for route POST /buckets?Action=ListMetrics
 * @param {object} dict - Input fields for route
 * @return {function} the return value of `getValidator`
 */
export function validateBucketsListMetrics(dict) {
    return getValidator('buckets', dict);
}

/**
 * Function to create a validator for route POST
 * /buckets?Action=ListRecentMetrics
 * @param {object} dict - Input fields for route
 * @return {function} the return value of `getValidator`
 */
export function validateBucketsListRecentMetrics(dict) {
    return getValidator('buckets', dict, true);
}

/**
 * Function to create a validator for route POST /accounts?Action=ListMetrics
 * @param {object} dict - Input fields for route
 * @return {function} the return value of `getValidator`
 */
export function validateAccountsListMetrics(dict) {
    return getValidator('accounts', dict);
}

/**
 * Function to create a validator for route POST
 * /accounts?Action=ListRecentMetrics
 * @param {object} dict - Input fields for route
 * @return {function} the return value of `getValidator`
 */
export function validateAccountsListRecentMetrics(dict) {
    return getValidator('accounts', dict, true);
}

/**
 * Function to create a validator for route POST /users?Action=ListMetrics
 * @param {object} dict - Input fields for route
 * @return {function} the return value of `getValidator`
 */
export function validateUsersListMetrics(dict) {
    return getValidator('users', dict);
}

/**
 * Function to create a validator for route POST
 * /users?Action=ListRecentMetrics
 * @param {object} dict - Input fields for route
 * @return {function} the return value of `getValidator`
 */
export function validateUsersListRecentMetrics(dict) {
    return getValidator('users', dict, true);
}

/**
 * Function to create a validator for route POST /service?Action=ListMetrics
 * @param {object} dict - Input fields for route
 * @return {function} the return value of `getValidator`
 */
export function validateServiceListMetrics(dict) {
    return getValidator('service', dict);
}

/**
 * Function to create a validator for route POST
 * /service?Action=ListRecentMetrics
 * @param {object} dict - Input fields for route
 * @return {function} the return value of `getValidator`
 */
export function validateServiceListRecentMetrics(dict) {
    return getValidator('service', dict, true);
}


text:
import imp
import os
import sys
import unittest

PATH = None
EXT = None
FILENAME = None
NAME = '_testcapi'
_file_exts = [x[0] for x in imp.get_suffixes() if x[2] == imp.C_EXTENSION]
try:
    for PATH in sys.path:
        for EXT in _file_exts:
            FILENAME = NAME + EXT
            FILEPATH = os.path.join(PATH, FILENAME)
            if os.path.exists(os.path.join(PATH, FILENAME)):
                raise StopIteration
    else:
        # Try a direct import
        try:
            import _testcapi
        except ImportError:
            PATH = EXT = FILENAME = FILEPATH = None
        else:
            FILEPATH = _testcapi.__file__
            PATH, FILENAME = os.path.split(FILEPATH)
            _, EXT = os.path.splitext(FILEPATH)
except StopIteration:
    pass
del _file_exts

def skip_unless__testcapi(func):
    msg = "Requires the CPython C Extension API ({!r} module)".format(NAME)
    return unittest.skipUnless(PATH, msg)(func)


text:
package org.springframework.tenancy.web;

import javax.servlet.http.HttpServletRequest;

/**
 * A {@link TenantIdentificationStrategy strategy} which looks for tenant identity from a given request header.
 *
 * @author Clint Morgan (Tasktop Technologies Inc.)
 *
 */
public class HeaderTenantIdentificationStrategy implements TenantIdentificationStrategy {

	private String headerName;

	@Override
	public Object identifyTenant(HttpServletRequest request) {
		return request.getHeader(headerName);
	}

	public void setHeaderName(String headerName) {
		this.headerName = headerName;
	}

}


text:
<?xml version="1.0" encoding="utf-8" ?>
<View xmlns="http://schemas.mediachase.com/ecf/view">
	<ViewConfig>
		<setAttributes id="Variation-Edit" controlUrl="catalog/CatalogEntryEdit.ascx" permissions="catalog:ctlg:entries:mng:edit" help="Catalog+Management"></setAttributes>
		<add>
			<Tabs>
				<Tab name="{SharedStrings:Overview}" controlUrl="catalog/tabs/EntryOverviewEditTab.ascx"></Tab>
        <Tab name="{CatalogStrings:Entry_Market}" controlUrl="catalog/tabs/EntryMarketEditTab.ascx"></Tab>
        <Tab name="{CatalogStrings:Entry_Pricing}" controlUrl="catalog/tabs/EntryPricingEditTab.ascx"></Tab>
        <Tab name="{CatalogStrings:Warehouse_Inventory}" controlUrl="catalog/tabs/WarehouseInventoryEditTab.ascx"></Tab>
				<Tab name="{SharedStrings:SEO}" controlUrl="catalog/tabs/EntrySeoTab.ascx"></Tab>
				<Tab name="{CatalogStrings:Catalog_Associations}" controlUrl="catalog/tabs/EntryAssociationEditTab.ascx"></Tab>
				<Tab name="{SharedStrings:Assets}" controlUrl="catalog/tabs/ItemAssetsEditTab.ascx"></Tab>
        <Tab name="{SharedStrings:Product_Relations_Tab_Label}" controlUrl="catalog/tabs/EditProductRelationTab.ascx"></Tab>
      </Tabs>
		</add>
	</ViewConfig>
</View>


text:
<?php
namespace Utility\DDL\Hosts\API;

class WUpload extends Internal\FSapi {
	const URL = 'api.wupload.com';
}


text:
package org.apache.ignite.internal.processors.query.h2.index.client;

import java.util.UUID;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
import org.apache.ignite.internal.cache.query.index.Index;
import org.apache.ignite.internal.cache.query.index.sorted.IndexRow;
import org.apache.ignite.internal.cache.query.index.sorted.inline.IndexQueryContext;
import org.apache.ignite.internal.cache.query.index.sorted.inline.InlineIndex;
import org.apache.ignite.internal.cache.query.index.sorted.inline.InlineIndexTree;
import org.apache.ignite.internal.processors.cache.persistence.CacheDataRow;
import org.apache.ignite.internal.processors.query.IgniteSQLException;
import org.apache.ignite.internal.util.lang.GridCursor;
import org.jetbrains.annotations.Nullable;

/**
 * We need indexes on an not affinity nodes. The index shouldn't contains any data.
 */
public class ClientInlineIndex implements InlineIndex {
    /** */
    private final int inlineSize;

    /** Index name. */
    private final String name;

    /** Index id. */
    private final UUID id = UUID.randomUUID();

    /** */
    public ClientInlineIndex(String idxName, int inlineSize) {
        name = idxName;
        this.inlineSize = inlineSize;
    }

    /** {@inheritDoc} */
    @Override public int inlineSize() {
        return inlineSize;
    }

    /** {@inheritDoc} */
    @Override public boolean created() {
        throw unsupported();
    }

    /** {@inheritDoc} */
    @Override public InlineIndexTree segment(int segment) {
        throw unsupported();
    }

    /** {@inheritDoc} */
    @Override public GridCursor<IndexRow> find(IndexRow lower, IndexRow upper, int segment) throws IgniteCheckedException {
        throw unsupported();
    }

    /** {@inheritDoc} */
    @Override public GridCursor<IndexRow> find(IndexRow lower, IndexRow upper, int segment,
        IndexQueryContext qryCtx) throws IgniteCheckedException {
        throw unsupported();
    }

    /** {@inheritDoc} */
    @Override public GridCursor<IndexRow> findFirst(int segment, IndexQueryContext qryCtx) throws IgniteCheckedException {
        throw unsupported();
    }

    /** {@inheritDoc} */
    @Override public GridCursor<IndexRow> findLast(int segment, IndexQueryContext qryCtx) throws IgniteCheckedException {
        throw unsupported();
    }

    /** {@inheritDoc} */
    @Override public long count(int segment) throws IgniteCheckedException {
        throw unsupported();
    }

    /** {@inheritDoc} */
    @Override public long totalCount() throws IgniteCheckedException {
        throw unsupported();
    }

    /** {@inheritDoc} */
    @Override public long count(int segment, IndexQueryContext qryCtx) throws IgniteCheckedException {
        throw unsupported();
    }

    /** {@inheritDoc} */
    @Override public int segmentsCount() {
        throw unsupported();
    }

    /** {@inheritDoc} */
    @Override public UUID id() {
        return id;
    }

    /** {@inheritDoc} */
    @Override public String name() {
        return name;
    }

    /** {@inheritDoc} */
    @Override public boolean canHandle(CacheDataRow row) throws IgniteCheckedException {
        throw unsupported();
    }

    /** {@inheritDoc} */
    @Override public void onUpdate(@Nullable CacheDataRow oldRow, @Nullable CacheDataRow newRow,
        boolean prevRowAvailable) throws IgniteCheckedException {
        throw unsupported();
    }

    /** {@inheritDoc} */
    @Override public <T extends Index> T unwrap(Class<T> clazz) {
        if (clazz == null)
            return null;

        if (clazz.isAssignableFrom(getClass()))
            return clazz.cast(this);

        throw new IllegalArgumentException(
            String.format("Cannot unwrap [%s] to [%s]", getClass().getName(), clazz.getName())
        );
    }

    /** {@inheritDoc} */
    @Override public void destroy(boolean softDelete) {
        // No-op.
    }

    /**
     * @return Exception about unsupported operation.
     */
    private static IgniteException unsupported() {
        return new IgniteSQLException("Shouldn't be invoked on non-affinity node.");
    }
}


text:
#include <aws/core/utils/Outcome.h>
#include <aws/core/auth/AWSAuthSigner.h>
#include <aws/core/client/CoreErrors.h>
#include <aws/core/client/RetryStrategy.h>
#include <aws/core/http/HttpClient.h>
#include <aws/core/http/HttpResponse.h>
#include <aws/core/http/HttpClientFactory.h>
#include <aws/core/auth/AWSCredentialsProviderChain.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <aws/core/utils/threading/Executor.h>
#include <aws/core/utils/DNS.h>
#include <aws/core/utils/logging/LogMacros.h>
#include <aws/core/utils/logging/ErrorMacros.h>

#include <aws/serverlessrepo/ServerlessApplicationRepositoryClient.h>
#include <aws/serverlessrepo/ServerlessApplicationRepositoryErrorMarshaller.h>
#include <aws/serverlessrepo/ServerlessApplicationRepositoryEndpointProvider.h>
#include <aws/serverlessrepo/model/CreateApplicationRequest.h>
#include <aws/serverlessrepo/model/CreateApplicationVersionRequest.h>
#include <aws/serverlessrepo/model/CreateCloudFormationChangeSetRequest.h>
#include <aws/serverlessrepo/model/CreateCloudFormationTemplateRequest.h>
#include <aws/serverlessrepo/model/DeleteApplicationRequest.h>
#include <aws/serverlessrepo/model/GetApplicationRequest.h>
#include <aws/serverlessrepo/model/GetApplicationPolicyRequest.h>
#include <aws/serverlessrepo/model/GetCloudFormationTemplateRequest.h>
#include <aws/serverlessrepo/model/ListApplicationDependenciesRequest.h>
#include <aws/serverlessrepo/model/ListApplicationVersionsRequest.h>
#include <aws/serverlessrepo/model/ListApplicationsRequest.h>
#include <aws/serverlessrepo/model/PutApplicationPolicyRequest.h>
#include <aws/serverlessrepo/model/UnshareApplicationRequest.h>
#include <aws/serverlessrepo/model/UpdateApplicationRequest.h>

using namespace Aws;
using namespace Aws::Auth;
using namespace Aws::Client;
using namespace Aws::ServerlessApplicationRepository;
using namespace Aws::ServerlessApplicationRepository::Model;
using namespace Aws::Http;
using namespace Aws::Utils::Json;
using ResolveEndpointOutcome = Aws::Endpoint::ResolveEndpointOutcome;

const char* ServerlessApplicationRepositoryClient::SERVICE_NAME = "serverlessrepo";
const char* ServerlessApplicationRepositoryClient::ALLOCATION_TAG = "ServerlessApplicationRepositoryClient";

ServerlessApplicationRepositoryClient::ServerlessApplicationRepositoryClient(const ServerlessApplicationRepository::ServerlessApplicationRepositoryClientConfiguration& clientConfiguration,
                                                                             std::shared_ptr<ServerlessApplicationRepositoryEndpointProviderBase> endpointProvider) :
  BASECLASS(clientConfiguration,
            Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG,
                                             Aws::MakeShared<DefaultAWSCredentialsProviderChain>(ALLOCATION_TAG),
                                             SERVICE_NAME,
                                             Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
            Aws::MakeShared<ServerlessApplicationRepositoryErrorMarshaller>(ALLOCATION_TAG)),
  m_clientConfiguration(clientConfiguration),
  m_executor(clientConfiguration.executor),
  m_endpointProvider(std::move(endpointProvider))
{
  init(m_clientConfiguration);
}

ServerlessApplicationRepositoryClient::ServerlessApplicationRepositoryClient(const AWSCredentials& credentials,
                                                                             std::shared_ptr<ServerlessApplicationRepositoryEndpointProviderBase> endpointProvider,
                                                                             const ServerlessApplicationRepository::ServerlessApplicationRepositoryClientConfiguration& clientConfiguration) :
  BASECLASS(clientConfiguration,
            Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG,
                                             Aws::MakeShared<SimpleAWSCredentialsProvider>(ALLOCATION_TAG, credentials),
                                             SERVICE_NAME,
                                             Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
            Aws::MakeShared<ServerlessApplicationRepositoryErrorMarshaller>(ALLOCATION_TAG)),
    m_clientConfiguration(clientConfiguration),
    m_executor(clientConfiguration.executor),
    m_endpointProvider(std::move(endpointProvider))
{
  init(m_clientConfiguration);
}

ServerlessApplicationRepositoryClient::ServerlessApplicationRepositoryClient(const std::shared_ptr<AWSCredentialsProvider>& credentialsProvider,
                                                                             std::shared_ptr<ServerlessApplicationRepositoryEndpointProviderBase> endpointProvider,
                                                                             const ServerlessApplicationRepository::ServerlessApplicationRepositoryClientConfiguration& clientConfiguration) :
  BASECLASS(clientConfiguration,
            Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG,
                                             credentialsProvider,
                                             SERVICE_NAME,
                                             Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
            Aws::MakeShared<ServerlessApplicationRepositoryErrorMarshaller>(ALLOCATION_TAG)),
    m_clientConfiguration(clientConfiguration),
    m_executor(clientConfiguration.executor),
    m_endpointProvider(std::move(endpointProvider))
{
  init(m_clientConfiguration);
}

    /* Legacy constructors due deprecation */
  ServerlessApplicationRepositoryClient::ServerlessApplicationRepositoryClient(const Client::ClientConfiguration& clientConfiguration) :
  BASECLASS(clientConfiguration,
            Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG,
                                             Aws::MakeShared<DefaultAWSCredentialsProviderChain>(ALLOCATION_TAG),
                                             SERVICE_NAME,
                                             Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
            Aws::MakeShared<ServerlessApplicationRepositoryErrorMarshaller>(ALLOCATION_TAG)),
  m_clientConfiguration(clientConfiguration),
  m_executor(clientConfiguration.executor),
  m_endpointProvider(Aws::MakeShared<ServerlessApplicationRepositoryEndpointProvider>(ALLOCATION_TAG))
{
  init(m_clientConfiguration);
}

ServerlessApplicationRepositoryClient::ServerlessApplicationRepositoryClient(const AWSCredentials& credentials,
                                                                             const Client::ClientConfiguration& clientConfiguration) :
  BASECLASS(clientConfiguration,
            Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG,
                                             Aws::MakeShared<SimpleAWSCredentialsProvider>(ALLOCATION_TAG, credentials),
                                             SERVICE_NAME,
                                             Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
            Aws::MakeShared<ServerlessApplicationRepositoryErrorMarshaller>(ALLOCATION_TAG)),
    m_clientConfiguration(clientConfiguration),
    m_executor(clientConfiguration.executor),
    m_endpointProvider(Aws::MakeShared<ServerlessApplicationRepositoryEndpointProvider>(ALLOCATION_TAG))
{
  init(m_clientConfiguration);
}

ServerlessApplicationRepositoryClient::ServerlessApplicationRepositoryClient(const std::shared_ptr<AWSCredentialsProvider>& credentialsProvider,
                                                                             const Client::ClientConfiguration& clientConfiguration) :
  BASECLASS(clientConfiguration,
            Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG,
                                             credentialsProvider,
                                             SERVICE_NAME,
                                             Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
            Aws::MakeShared<ServerlessApplicationRepositoryErrorMarshaller>(ALLOCATION_TAG)),
    m_clientConfiguration(clientConfiguration),
    m_executor(clientConfiguration.executor),
    m_endpointProvider(Aws::MakeShared<ServerlessApplicationRepositoryEndpointProvider>(ALLOCATION_TAG))
{
  init(m_clientConfiguration);
}

    /* End of legacy constructors due deprecation */
ServerlessApplicationRepositoryClient::~ServerlessApplicationRepositoryClient()
{
}

std::shared_ptr<ServerlessApplicationRepositoryEndpointProviderBase>& ServerlessApplicationRepositoryClient::accessEndpointProvider()
{
  return m_endpointProvider;
}

void ServerlessApplicationRepositoryClient::init(const ServerlessApplicationRepository::ServerlessApplicationRepositoryClientConfiguration& config)
{
  AWSClient::SetServiceClientName("ServerlessApplicationRepository");
  AWS_CHECK_PTR(SERVICE_NAME, m_endpointProvider);
  m_endpointProvider->InitBuiltInParameters(config);
}

void ServerlessApplicationRepositoryClient::OverrideEndpoint(const Aws::String& endpoint)
{
  AWS_CHECK_PTR(SERVICE_NAME, m_endpointProvider);
  m_endpointProvider->OverrideEndpoint(endpoint);
}

CreateApplicationOutcome ServerlessApplicationRepositoryClient::CreateApplication(const CreateApplicationRequest& request) const
{
  AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateApplication, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE);
  ResolveEndpointOutcome endpointResolutionOutcome = m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams());
  AWS_OPERATION_CHECK_SUCCESS(endpointResolutionOutcome, CreateApplication, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE, endpointResolutionOutcome.GetError().GetMessage());
  endpointResolutionOutcome.GetResult().AddPathSegments("/applications");
  return CreateApplicationOutcome(MakeRequest(request, endpointResolutionOutcome.GetResult(), Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}

CreateApplicationOutcomeCallable ServerlessApplicationRepositoryClient::CreateApplicationCallable(const CreateApplicationRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< CreateApplicationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->CreateApplication(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void ServerlessApplicationRepositoryClient::CreateApplicationAsync(const CreateApplicationRequest& request, const CreateApplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context]()
    {
      handler(this, request, CreateApplication(request), context);
    } );
}

CreateApplicationVersionOutcome ServerlessApplicationRepositoryClient::CreateApplicationVersion(const CreateApplicationVersionRequest& request) const
{
  AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateApplicationVersion, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE);
  if (!request.ApplicationIdHasBeenSet())
  {
    AWS_LOGSTREAM_ERROR("CreateApplicationVersion", "Required field: ApplicationId, is not set");
    return CreateApplicationVersionOutcome(Aws::Client::AWSError<ServerlessApplicationRepositoryErrors>(ServerlessApplicationRepositoryErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ApplicationId]", false));
  }
  if (!request.SemanticVersionHasBeenSet())
  {
    AWS_LOGSTREAM_ERROR("CreateApplicationVersion", "Required field: SemanticVersion, is not set");
    return CreateApplicationVersionOutcome(Aws::Client::AWSError<ServerlessApplicationRepositoryErrors>(ServerlessApplicationRepositoryErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [SemanticVersion]", false));
  }
  ResolveEndpointOutcome endpointResolutionOutcome = m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams());
  AWS_OPERATION_CHECK_SUCCESS(endpointResolutionOutcome, CreateApplicationVersion, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE, endpointResolutionOutcome.GetError().GetMessage());
  endpointResolutionOutcome.GetResult().AddPathSegments("/applications/");
  endpointResolutionOutcome.GetResult().AddPathSegment(request.GetApplicationId());
  endpointResolutionOutcome.GetResult().AddPathSegments("/versions/");
  endpointResolutionOutcome.GetResult().AddPathSegment(request.GetSemanticVersion());
  return CreateApplicationVersionOutcome(MakeRequest(request, endpointResolutionOutcome.GetResult(), Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER));
}

CreateApplicationVersionOutcomeCallable ServerlessApplicationRepositoryClient::CreateApplicationVersionCallable(const CreateApplicationVersionRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< CreateApplicationVersionOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->CreateApplicationVersion(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void ServerlessApplicationRepositoryClient::CreateApplicationVersionAsync(const CreateApplicationVersionRequest& request, const CreateApplicationVersionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context]()
    {
      handler(this, request, CreateApplicationVersion(request), context);
    } );
}

CreateCloudFormationChangeSetOutcome ServerlessApplicationRepositoryClient::CreateCloudFormationChangeSet(const CreateCloudFormationChangeSetRequest& request) const
{
  AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateCloudFormationChangeSet, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE);
  if (!request.ApplicationIdHasBeenSet())
  {
    AWS_LOGSTREAM_ERROR("CreateCloudFormationChangeSet", "Required field: ApplicationId, is not set");
    return CreateCloudFormationChangeSetOutcome(Aws::Client::AWSError<ServerlessApplicationRepositoryErrors>(ServerlessApplicationRepositoryErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ApplicationId]", false));
  }
  ResolveEndpointOutcome endpointResolutionOutcome = m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams());
  AWS_OPERATION_CHECK_SUCCESS(endpointResolutionOutcome, CreateCloudFormationChangeSet, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE, endpointResolutionOutcome.GetError().GetMessage());
  endpointResolutionOutcome.GetResult().AddPathSegments("/applications/");
  endpointResolutionOutcome.GetResult().AddPathSegment(request.GetApplicationId());
  endpointResolutionOutcome.GetResult().AddPathSegments("/changesets");
  return CreateCloudFormationChangeSetOutcome(MakeRequest(request, endpointResolutionOutcome.GetResult(), Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}

CreateCloudFormationChangeSetOutcomeCallable ServerlessApplicationRepositoryClient::CreateCloudFormationChangeSetCallable(const CreateCloudFormationChangeSetRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< CreateCloudFormationChangeSetOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->CreateCloudFormationChangeSet(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void ServerlessApplicationRepositoryClient::CreateCloudFormationChangeSetAsync(const CreateCloudFormationChangeSetRequest& request, const CreateCloudFormationChangeSetResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context]()
    {
      handler(this, request, CreateCloudFormationChangeSet(request), context);
    } );
}

CreateCloudFormationTemplateOutcome ServerlessApplicationRepositoryClient::CreateCloudFormationTemplate(const CreateCloudFormationTemplateRequest& request) const
{
  AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateCloudFormationTemplate, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE);
  if (!request.ApplicationIdHasBeenSet())
  {
    AWS_LOGSTREAM_ERROR("CreateCloudFormationTemplate", "Required field: ApplicationId, is not set");
    return CreateCloudFormationTemplateOutcome(Aws::Client::AWSError<ServerlessApplicationRepositoryErrors>(ServerlessApplicationRepositoryErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ApplicationId]", false));
  }
  ResolveEndpointOutcome endpointResolutionOutcome = m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams());
  AWS_OPERATION_CHECK_SUCCESS(endpointResolutionOutcome, CreateCloudFormationTemplate, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE, endpointResolutionOutcome.GetError().GetMessage());
  endpointResolutionOutcome.GetResult().AddPathSegments("/applications/");
  endpointResolutionOutcome.GetResult().AddPathSegment(request.GetApplicationId());
  endpointResolutionOutcome.GetResult().AddPathSegments("/templates");
  return CreateCloudFormationTemplateOutcome(MakeRequest(request, endpointResolutionOutcome.GetResult(), Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}

CreateCloudFormationTemplateOutcomeCallable ServerlessApplicationRepositoryClient::CreateCloudFormationTemplateCallable(const CreateCloudFormationTemplateRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< CreateCloudFormationTemplateOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->CreateCloudFormationTemplate(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void ServerlessApplicationRepositoryClient::CreateCloudFormationTemplateAsync(const CreateCloudFormationTemplateRequest& request, const CreateCloudFormationTemplateResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context]()
    {
      handler(this, request, CreateCloudFormationTemplate(request), context);
    } );
}

DeleteApplicationOutcome ServerlessApplicationRepositoryClient::DeleteApplication(const DeleteApplicationRequest& request) const
{
  AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteApplication, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE);
  if (!request.ApplicationIdHasBeenSet())
  {
    AWS_LOGSTREAM_ERROR("DeleteApplication", "Required field: ApplicationId, is not set");
    return DeleteApplicationOutcome(Aws::Client::AWSError<ServerlessApplicationRepositoryErrors>(ServerlessApplicationRepositoryErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ApplicationId]", false));
  }
  ResolveEndpointOutcome endpointResolutionOutcome = m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams());
  AWS_OPERATION_CHECK_SUCCESS(endpointResolutionOutcome, DeleteApplication, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE, endpointResolutionOutcome.GetError().GetMessage());
  endpointResolutionOutcome.GetResult().AddPathSegments("/applications/");
  endpointResolutionOutcome.GetResult().AddPathSegment(request.GetApplicationId());
  return DeleteApplicationOutcome(MakeRequest(request, endpointResolutionOutcome.GetResult(), Aws::Http::HttpMethod::HTTP_DELETE, Aws::Auth::SIGV4_SIGNER));
}

DeleteApplicationOutcomeCallable ServerlessApplicationRepositoryClient::DeleteApplicationCallable(const DeleteApplicationRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< DeleteApplicationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeleteApplication(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void ServerlessApplicationRepositoryClient::DeleteApplicationAsync(const DeleteApplicationRequest& request, const DeleteApplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context]()
    {
      handler(this, request, DeleteApplication(request), context);
    } );
}

GetApplicationOutcome ServerlessApplicationRepositoryClient::GetApplication(const GetApplicationRequest& request) const
{
  AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetApplication, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE);
  if (!request.ApplicationIdHasBeenSet())
  {
    AWS_LOGSTREAM_ERROR("GetApplication", "Required field: ApplicationId, is not set");
    return GetApplicationOutcome(Aws::Client::AWSError<ServerlessApplicationRepositoryErrors>(ServerlessApplicationRepositoryErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ApplicationId]", false));
  }
  ResolveEndpointOutcome endpointResolutionOutcome = m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams());
  AWS_OPERATION_CHECK_SUCCESS(endpointResolutionOutcome, GetApplication, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE, endpointResolutionOutcome.GetError().GetMessage());
  endpointResolutionOutcome.GetResult().AddPathSegments("/applications/");
  endpointResolutionOutcome.GetResult().AddPathSegment(request.GetApplicationId());
  return GetApplicationOutcome(MakeRequest(request, endpointResolutionOutcome.GetResult(), Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
}

GetApplicationOutcomeCallable ServerlessApplicationRepositoryClient::GetApplicationCallable(const GetApplicationRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< GetApplicationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetApplication(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void ServerlessApplicationRepositoryClient::GetApplicationAsync(const GetApplicationRequest& request, const GetApplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context]()
    {
      handler(this, request, GetApplication(request), context);
    } );
}

GetApplicationPolicyOutcome ServerlessApplicationRepositoryClient::GetApplicationPolicy(const GetApplicationPolicyRequest& request) const
{
  AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetApplicationPolicy, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE);
  if (!request.ApplicationIdHasBeenSet())
  {
    AWS_LOGSTREAM_ERROR("GetApplicationPolicy", "Required field: ApplicationId, is not set");
    return GetApplicationPolicyOutcome(Aws::Client::AWSError<ServerlessApplicationRepositoryErrors>(ServerlessApplicationRepositoryErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ApplicationId]", false));
  }
  ResolveEndpointOutcome endpointResolutionOutcome = m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams());
  AWS_OPERATION_CHECK_SUCCESS(endpointResolutionOutcome, GetApplicationPolicy, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE, endpointResolutionOutcome.GetError().GetMessage());
  endpointResolutionOutcome.GetResult().AddPathSegments("/applications/");
  endpointResolutionOutcome.GetResult().AddPathSegment(request.GetApplicationId());
  endpointResolutionOutcome.GetResult().AddPathSegments("/policy");
  return GetApplicationPolicyOutcome(MakeRequest(request, endpointResolutionOutcome.GetResult(), Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
}

GetApplicationPolicyOutcomeCallable ServerlessApplicationRepositoryClient::GetApplicationPolicyCallable(const GetApplicationPolicyRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< GetApplicationPolicyOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetApplicationPolicy(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void ServerlessApplicationRepositoryClient::GetApplicationPolicyAsync(const GetApplicationPolicyRequest& request, const GetApplicationPolicyResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context]()
    {
      handler(this, request, GetApplicationPolicy(request), context);
    } );
}

GetCloudFormationTemplateOutcome ServerlessApplicationRepositoryClient::GetCloudFormationTemplate(const GetCloudFormationTemplateRequest& request) const
{
  AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetCloudFormationTemplate, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE);
  if (!request.ApplicationIdHasBeenSet())
  {
    AWS_LOGSTREAM_ERROR("GetCloudFormationTemplate", "Required field: ApplicationId, is not set");
    return GetCloudFormationTemplateOutcome(Aws::Client::AWSError<ServerlessApplicationRepositoryErrors>(ServerlessApplicationRepositoryErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ApplicationId]", false));
  }
  if (!request.TemplateIdHasBeenSet())
  {
    AWS_LOGSTREAM_ERROR("GetCloudFormationTemplate", "Required field: TemplateId, is not set");
    return GetCloudFormationTemplateOutcome(Aws::Client::AWSError<ServerlessApplicationRepositoryErrors>(ServerlessApplicationRepositoryErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [TemplateId]", false));
  }
  ResolveEndpointOutcome endpointResolutionOutcome = m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams());
  AWS_OPERATION_CHECK_SUCCESS(endpointResolutionOutcome, GetCloudFormationTemplate, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE, endpointResolutionOutcome.GetError().GetMessage());
  endpointResolutionOutcome.GetResult().AddPathSegments("/applications/");
  endpointResolutionOutcome.GetResult().AddPathSegment(request.GetApplicationId());
  endpointResolutionOutcome.GetResult().AddPathSegments("/templates/");
  endpointResolutionOutcome.GetResult().AddPathSegment(request.GetTemplateId());
  return GetCloudFormationTemplateOutcome(MakeRequest(request, endpointResolutionOutcome.GetResult(), Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
}

GetCloudFormationTemplateOutcomeCallable ServerlessApplicationRepositoryClient::GetCloudFormationTemplateCallable(const GetCloudFormationTemplateRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< GetCloudFormationTemplateOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetCloudFormationTemplate(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void ServerlessApplicationRepositoryClient::GetCloudFormationTemplateAsync(const GetCloudFormationTemplateRequest& request, const GetCloudFormationTemplateResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context]()
    {
      handler(this, request, GetCloudFormationTemplate(request), context);
    } );
}

ListApplicationDependenciesOutcome ServerlessApplicationRepositoryClient::ListApplicationDependencies(const ListApplicationDependenciesRequest& request) const
{
  AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListApplicationDependencies, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE);
  if (!request.ApplicationIdHasBeenSet())
  {
    AWS_LOGSTREAM_ERROR("ListApplicationDependencies", "Required field: ApplicationId, is not set");
    return ListApplicationDependenciesOutcome(Aws::Client::AWSError<ServerlessApplicationRepositoryErrors>(ServerlessApplicationRepositoryErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ApplicationId]", false));
  }
  ResolveEndpointOutcome endpointResolutionOutcome = m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams());
  AWS_OPERATION_CHECK_SUCCESS(endpointResolutionOutcome, ListApplicationDependencies, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE, endpointResolutionOutcome.GetError().GetMessage());
  endpointResolutionOutcome.GetResult().AddPathSegments("/applications/");
  endpointResolutionOutcome.GetResult().AddPathSegment(request.GetApplicationId());
  endpointResolutionOutcome.GetResult().AddPathSegments("/dependencies");
  return ListApplicationDependenciesOutcome(MakeRequest(request, endpointResolutionOutcome.GetResult(), Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
}

ListApplicationDependenciesOutcomeCallable ServerlessApplicationRepositoryClient::ListApplicationDependenciesCallable(const ListApplicationDependenciesRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< ListApplicationDependenciesOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListApplicationDependencies(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void ServerlessApplicationRepositoryClient::ListApplicationDependenciesAsync(const ListApplicationDependenciesRequest& request, const ListApplicationDependenciesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context]()
    {
      handler(this, request, ListApplicationDependencies(request), context);
    } );
}

ListApplicationVersionsOutcome ServerlessApplicationRepositoryClient::ListApplicationVersions(const ListApplicationVersionsRequest& request) const
{
  AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListApplicationVersions, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE);
  if (!request.ApplicationIdHasBeenSet())
  {
    AWS_LOGSTREAM_ERROR("ListApplicationVersions", "Required field: ApplicationId, is not set");
    return ListApplicationVersionsOutcome(Aws::Client::AWSError<ServerlessApplicationRepositoryErrors>(ServerlessApplicationRepositoryErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ApplicationId]", false));
  }
  ResolveEndpointOutcome endpointResolutionOutcome = m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams());
  AWS_OPERATION_CHECK_SUCCESS(endpointResolutionOutcome, ListApplicationVersions, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE, endpointResolutionOutcome.GetError().GetMessage());
  endpointResolutionOutcome.GetResult().AddPathSegments("/applications/");
  endpointResolutionOutcome.GetResult().AddPathSegment(request.GetApplicationId());
  endpointResolutionOutcome.GetResult().AddPathSegments("/versions");
  return ListApplicationVersionsOutcome(MakeRequest(request, endpointResolutionOutcome.GetResult(), Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
}

ListApplicationVersionsOutcomeCallable ServerlessApplicationRepositoryClient::ListApplicationVersionsCallable(const ListApplicationVersionsRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< ListApplicationVersionsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListApplicationVersions(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void ServerlessApplicationRepositoryClient::ListApplicationVersionsAsync(const ListApplicationVersionsRequest& request, const ListApplicationVersionsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context]()
    {
      handler(this, request, ListApplicationVersions(request), context);
    } );
}

ListApplicationsOutcome ServerlessApplicationRepositoryClient::ListApplications(const ListApplicationsRequest& request) const
{
  AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListApplications, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE);
  ResolveEndpointOutcome endpointResolutionOutcome = m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams());
  AWS_OPERATION_CHECK_SUCCESS(endpointResolutionOutcome, ListApplications, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE, endpointResolutionOutcome.GetError().GetMessage());
  endpointResolutionOutcome.GetResult().AddPathSegments("/applications");
  return ListApplicationsOutcome(MakeRequest(request, endpointResolutionOutcome.GetResult(), Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
}

ListApplicationsOutcomeCallable ServerlessApplicationRepositoryClient::ListApplicationsCallable(const ListApplicationsRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< ListApplicationsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListApplications(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void ServerlessApplicationRepositoryClient::ListApplicationsAsync(const ListApplicationsRequest& request, const ListApplicationsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context]()
    {
      handler(this, request, ListApplications(request), context);
    } );
}

PutApplicationPolicyOutcome ServerlessApplicationRepositoryClient::PutApplicationPolicy(const PutApplicationPolicyRequest& request) const
{
  AWS_OPERATION_CHECK_PTR(m_endpointProvider, PutApplicationPolicy, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE);
  if (!request.ApplicationIdHasBeenSet())
  {
    AWS_LOGSTREAM_ERROR("PutApplicationPolicy", "Required field: ApplicationId, is not set");
    return PutApplicationPolicyOutcome(Aws::Client::AWSError<ServerlessApplicationRepositoryErrors>(ServerlessApplicationRepositoryErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ApplicationId]", false));
  }
  ResolveEndpointOutcome endpointResolutionOutcome = m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams());
  AWS_OPERATION_CHECK_SUCCESS(endpointResolutionOutcome, PutApplicationPolicy, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE, endpointResolutionOutcome.GetError().GetMessage());
  endpointResolutionOutcome.GetResult().AddPathSegments("/applications/");
  endpointResolutionOutcome.GetResult().AddPathSegment(request.GetApplicationId());
  endpointResolutionOutcome.GetResult().AddPathSegments("/policy");
  return PutApplicationPolicyOutcome(MakeRequest(request, endpointResolutionOutcome.GetResult(), Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER));
}

PutApplicationPolicyOutcomeCallable ServerlessApplicationRepositoryClient::PutApplicationPolicyCallable(const PutApplicationPolicyRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< PutApplicationPolicyOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutApplicationPolicy(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void ServerlessApplicationRepositoryClient::PutApplicationPolicyAsync(const PutApplicationPolicyRequest& request, const PutApplicationPolicyResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context]()
    {
      handler(this, request, PutApplicationPolicy(request), context);
    } );
}

UnshareApplicationOutcome ServerlessApplicationRepositoryClient::UnshareApplication(const UnshareApplicationRequest& request) const
{
  AWS_OPERATION_CHECK_PTR(m_endpointProvider, UnshareApplication, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE);
  if (!request.ApplicationIdHasBeenSet())
  {
    AWS_LOGSTREAM_ERROR("UnshareApplication", "Required field: ApplicationId, is not set");
    return UnshareApplicationOutcome(Aws::Client::AWSError<ServerlessApplicationRepositoryErrors>(ServerlessApplicationRepositoryErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ApplicationId]", false));
  }
  ResolveEndpointOutcome endpointResolutionOutcome = m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams());
  AWS_OPERATION_CHECK_SUCCESS(endpointResolutionOutcome, UnshareApplication, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE, endpointResolutionOutcome.GetError().GetMessage());
  endpointResolutionOutcome.GetResult().AddPathSegments("/applications/");
  endpointResolutionOutcome.GetResult().AddPathSegment(request.GetApplicationId());
  endpointResolutionOutcome.GetResult().AddPathSegments("/unshare");
  return UnshareApplicationOutcome(MakeRequest(request, endpointResolutionOutcome.GetResult(), Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}

UnshareApplicationOutcomeCallable ServerlessApplicationRepositoryClient::UnshareApplicationCallable(const UnshareApplicationRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< UnshareApplicationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->UnshareApplication(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void ServerlessApplicationRepositoryClient::UnshareApplicationAsync(const UnshareApplicationRequest& request, const UnshareApplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context]()
    {
      handler(this, request, UnshareApplication(request), context);
    } );
}

UpdateApplicationOutcome ServerlessApplicationRepositoryClient::UpdateApplication(const UpdateApplicationRequest& request) const
{
  AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateApplication, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE);
  if (!request.ApplicationIdHasBeenSet())
  {
    AWS_LOGSTREAM_ERROR("UpdateApplication", "Required field: ApplicationId, is not set");
    return UpdateApplicationOutcome(Aws::Client::AWSError<ServerlessApplicationRepositoryErrors>(ServerlessApplicationRepositoryErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ApplicationId]", false));
  }
  ResolveEndpointOutcome endpointResolutionOutcome = m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams());
  AWS_OPERATION_CHECK_SUCCESS(endpointResolutionOutcome, UpdateApplication, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE, endpointResolutionOutcome.GetError().GetMessage());
  endpointResolutionOutcome.GetResult().AddPathSegments("/applications/");
  endpointResolutionOutcome.GetResult().AddPathSegment(request.GetApplicationId());
  return UpdateApplicationOutcome(MakeRequest(request, endpointResolutionOutcome.GetResult(), Aws::Http::HttpMethod::HTTP_PATCH, Aws::Auth::SIGV4_SIGNER));
}

UpdateApplicationOutcomeCallable ServerlessApplicationRepositoryClient::UpdateApplicationCallable(const UpdateApplicationRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< UpdateApplicationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->UpdateApplication(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void ServerlessApplicationRepositoryClient::UpdateApplicationAsync(const UpdateApplicationRequest& request, const UpdateApplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context]()
    {
      handler(this, request, UpdateApplication(request), context);
    } );
}


text:
<?php
namespace Producer;

class FsioTest extends \PHPUnit_Framework_TestCase
{
    protected $fsio;
    protected $base;

    protected function setUp()
    {
        $this->fsio = new Fsio(__DIR__);
    }

    public function testIsDir()
    {
        $this->assertTrue($this->fsio->isDir('../' . basename(__DIR__)));
    }

    public function testMkdir()
    {
        $dir = 'tmp';
        $this->fsio->rmdir($dir);

        $this->assertFalse($this->fsio->isDir($dir));
        $this->fsio->mkdir($dir);
        $this->assertTrue($this->fsio->isDir($dir));
        $this->fsio->rmdir($dir);
        $this->assertFalse($this->fsio->isDir($dir));

        $this->setExpectedException(
            'Producer\Exception',
            'mkdir(): File exists'
        );
        $this->fsio->mkdir('../' . basename(__DIR__));
    }

    public function testPutAndGet()
    {
        $file = 'fakefile';
        $this->fsio->unlink($file);

        $expect = 'fake text';
        $this->fsio->put($file, $expect);
        $actual = $this->fsio->get($file);
        $this->assertSame($expect, $actual);
        $this->fsio->unlink($file);
    }

    public function testPut_error()
    {
        $this->setExpectedException(
            'Producer\Exception',
            'No such file or directory'
        );
        $this->fsio->put('no-such-directory/fakefile', 'fake text');
    }

    public function testGet_error()
    {
        $this->setExpectedException(
            'Producer\Exception',
            'No such file or directory'
        );
        $this->fsio->get('no-such-directory/fakefile');
    }
}


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

namespace ServiceStack.DataAccess
{
	public interface IQueryableByPredicate
	{
		IList<Extent> Query<Extent>(Predicate<Extent> match);
	}
}


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\WatchUserInfoSearch */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
    ]); ?>

    <?= $form->field($model, 'id') ?>

    <?= $form->field($model, 'uid') ?>

    <?= $form->field($model, 'weight') ?>

    <?= $form->field($model, 'height') ?>

    <?= $form->field($model, 'gender') ?>

    <?php // echo $form->field($model, 'birth') ?>

    <?php // echo $form->field($model, 'update_at') ?>

        <?= Html::submitButton(Yii::t('backend-watchuserinfo', 'Search'), ['class' => 'btn btn-primary']) ?>
        <?= Html::resetButton(Yii::t('backend-watchuserinfo', 'Reset'), ['class' => 'btn btn-default']) ?>

    <?php ActiveForm::end(); ?>


text:
module Atmosphere
  class TenantHttpMappings
    def initialize(tenant)
      @tenant = tenant
    end

    #
    # Find all http mappings registered on given tenant.
    #
    # Number of http mappings can be limited by providing
    # :protocol options (:http or :https).
    #
    def find(options = {})
      find_hsh = { tenant: @tenant }
      find_hsh[:application_protocol] = options[:protocol] if options[:protocol]

      HttpMapping.where(find_hsh)
    end
  end
end


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

{% load staticfiles %}

{% block title %}
  Login to DJAAKS
{% endblock %}

{% block body_block %}

<link href="http://getbootstrap.com/examples/signin/signin.css" rel="stylesheet">

<form class="form-signin" role="form" method="POST" action=".">
  {% csrf_token %}

Please sign in

  <input class="form-control" placeholder="Username" id="id_username" maxlength="254" name="username" type="text" required autofocus=""/>
  <input type="password" class="form-control" placeholder="Password" id="id_password" name="password" required />

  <button class="btn btn-lg btn-primary btn-block" type="submit" value="Submit">Sign in</button>
</form>

{% endblock %}


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>Oceanlau</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">

        <link rel="stylesheet" href="css/bootstrap.css">
        <link rel="stylesheet" href="css/flat-ui.css">


text:
def count_values(dictionary):
    """

    """
    seen_values = set()
    for i in dictionary:
        seen_values.add(dictionary[i])
    return len(seen_values)

print(count_values({'red': 1, 'green': 1, 'blue': 2, 'yellow': 3, 'purp': 2}))


text:
#pragma once

#include "ElementBuilder.h"

template <class ElementType>
class TElementBuilderTemplate : public CElementBuilder
{
public:
    CElement *createElement(const CXmlElement & /*elem*/) const override { return new ElementType; }
};


text:
<?php

App::uses('AppModel', 'Model');

/**
 * Blocks App Model
 *
 * PHP version 5
 *
 * @category Blocks.Model
 * @package  Croogo.Blocks.Model
 * @version  1.0
 * @author   Fahad Ibnay Heylaal <contact@fahad19.com>
 * @license  http://www.opensource.org/licenses/mit-license.php The MIT License
 * @link     http://www.croogo.org
 */
class BlocksAppModel extends AppModel {

}


text:
import {createMemoizeAction, createStore, concatReducers, concatEventReducers} from '../../src/index'

describe('Actions', () => {
  describe('Memoize', () => {
    it('should remember object value', () => {
      let
        callCounter = 0,
        action = createMemoizeAction(() => {
          callCounter++
          return {
            type: 'SOME'
          }
        })
        let result = action()
        result.should.have.property('type', 'SOME')
        callCounter.should.equal(1)
        result = action()
        result.should.have.property('type', 'SOME')
        callCounter.should.equal(1)
    })
    it('should remember value from promise and unwrap it', () => {
      let
        promise = Promise.resolve({
          type: 'SOME'
        }),
        callCounter = 0,
        action = createMemoizeAction(() => {
          callCounter++
          return promise
        })
        let result = action()(e => e)
        // result.should.be.instanceOf(Function)
        return new Promise((resolve, reject) => {
          //After promise is fullfilled action will returns needed data w/t promise
          action()(event => {
            event.should.have.property('type', 'SOME')
            callCounter.should.equal(1)
            resolve()
          })
        })
    })
  })
})


text:
package com.google.testing.security.firingrange.tests.flashinjection;

import static java.nio.charset.StandardCharsets.UTF_8;

import java.io.IOException;
import java.util.regex.Pattern;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * The servlet returns JSON and handles two endpoints one of which echoes a query parameter in the
 * beginning of the request, and the other does not.
 */
public class FlashInjection extends HttpServlet {

  private static final String CALLBACK_IS_ECHOED_BACK = "callbackIsEchoedBack";

  @Override
  public void doGet(HttpServletRequest request, HttpServletResponse response)
      throws IOException {
    String responseBody;
    String callback = request.getParameter("callback");
    if (request.getRequestURI().contains(CALLBACK_IS_ECHOED_BACK) && callback != null) {
      if (!Pattern.matches("^[a-zA-Z0-9]+$", callback)) {
        response.setStatus(500);
        return;
      }
      responseBody = callback + "({});";
    } else {
      responseBody = "func({});";
    }
    response.setContentType("application/json");
    response.setCharacterEncoding(UTF_8.name());
    response.setStatus(200);
    response.getWriter().write(responseBody);
    response.getWriter().flush();
  }
}


text:
@echo off
setlocal
set "out_file=%~dp0combined-MySQL.sql"
set "sql_dir=%~dp0MySQL"

echo -- This is an amalgamation of all MySQL scripts> %out_file%
echo.>> %out_file%
type %sql_dir%\schema.sql >> %out_file%
echo.>> %out_file%
type %sql_dir%\usp_umq_setup_service.sql >> %out_file%
echo.>> %out_file%
type %sql_dir%\usp_umq_send.sql >> %out_file%
echo.>> %out_file%
type %sql_dir%\usp_umq_wait_request.sql >> %out_file%
echo.>> %out_file%
type %sql_dir%\usp_umq_test.sql >> %out_file%