text:
class Solution(object):
    def inOrderAsc(self, root):
        stack = []
        visited = set()
        stack.append(root)
        while stack:
            cur = stack[-1]
            if cur.left and cur.left.val not in visited:
                stack.append(cur.left)
            elif cur.val not in visited:
                yield cur.val
                visited.add(cur.val)
            elif cur.right and cur.right.val not in visited:
                stack.append(cur.right)
            else:
                stack.pop()

    def inOrderDesc(self, root):
        stack = []
        visited = set()
        stack.append(root)
        while stack:
            cur = stack[-1]
            if cur.right and cur.right.val not in visited:
                stack.append(cur.right)
            elif cur.val not in visited:
                yield cur.val
                visited.add(cur.val)
            elif cur.left and cur.left.val not in visited:
                stack.append(cur.left)
            else:
                stack.pop()

    def findTarget(self, root, k):
        """
        :type root: TreeNode
        :type k: int
        :rtype: bool
        """
        if not root:
            return False
        iterAsc = self.inOrderAsc(root)
        iterDesc = self.inOrderDesc(root)

        curAsc = iterAsc.next()
        curDesc = iterDesc.next()

        while curAsc != curDesc:
            s = curAsc + curDesc
            if s < k:
                curAsc = iterAsc.next()
            elif s > k:
                curDesc = iterDesc.next()
            else:
                return True
        else:
            return False

redpajama_set_name: RedPajamaGithub


text:
package pl.edu.misztal.JImageStreamToolkit.image;

import pl.edu.uj.JImageStream.api.core.Collector;

import java.awt.image.BufferedImage;

class ImageCollector implements Collector<Image> {
    @Override
    public Image collect(BufferedImage bufferedImage) {
        logger.info(this.getClass() + " successfully collected image");
        return new Image(bufferedImage);
    }
}


text:
<!DOCTYPE html>

              <title>
              TESTING
              </title>

      <link type="text/css" rel="stylesheet" href="../stylesheets/t4-enumerable-methods.css" />

Enumerables

Enumerables can be used or "mixed-in"
  for different classes in ruby but the most notable
  ones are Arrays and Hashes. When mixing in the Enumerable
  module #each method must be defined to yield items from it.

Enumerables are methods that can iterate through the object
and perform actions listed in the code-block relative to its method
name/meaning. To see all the methods provided by Enumerable, check
the output of the #instance_methods method.

    Example:

    array = [1,2,3,4,5]
    array.map! {|i| i+=1}
    print array

    result #=> [2,3,4,5,6]

    Instead of looping through the code, Enumerables allow for a cleaner looking, more readable code.


text:
// Copyright (c) 2013 VRVis Zentrum für Virtual Reality und Visualisierung Forschungs-GmbH

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

using p.pro.Common;
using p.pro.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace p.pro.Coordinator
{
    class Program
    {
        const String ENV_P_PRO_SERVER_URL = "P_PRO_SERVER_URL";
        const String DEFAULT_SERVER_URL = "http://localhost:26679/";

        static void Main(string[] args)
        {
            var serverUrlEnvVar = Environment.GetEnvironmentVariable(ENV_P_PRO_SERVER_URL);
            String serverUrl;
            if (serverUrlEnvVar == null)
            {
                Console.WriteLine("Server URL not set via the {0} environment variable, using default ({1}).", ENV_P_PRO_SERVER_URL, DEFAULT_SERVER_URL);
                serverUrl = DEFAULT_SERVER_URL;
            }
            else
            {
                serverUrl = serverUrlEnvVar;
            }

            var random = new Random();
            var jobInstanceBlackList = new HashSet<Guid>();

            using (IRestProxy restProxy = new RestProxy(serverUrl))
            {
                while (true)
                {
                    JobInstance[] unassignedJobInstance;

                    try
                    {
                        unassignedJobInstance = restProxy.Query<JobInstance>("AgentId".Eq(Guid.Empty.ToString())).Result.ToArray();
                    }
                    catch (RestProxyException e)
                    {
                        Console.Error.WriteLine("HTTP error while trying to query for unassigned jobs: " + e.Message);
                        Console.Error.WriteLine("Trying again in a few seconds...");
                        Thread.Sleep(TimeSpan.FromSeconds(5));
                        continue;
                    }

                    foreach (var jobInstance in unassignedJobInstance)
                    {
                        if (jobInstanceBlackList.Contains(jobInstance.Id))
                            continue;

                        JobDescription jobDescription;

                        try { jobDescription = restProxy.Get<JobDescription>(jobInstance.JobDescriptionId).Result; }
                        catch (RestProxyException e)
                        {
                            if (e.StatusCode == HttpStatusCode.NotFound)
                            {
                                restProxy.Create(new JobInstanceLogEntry()
                                {
                                    Id = Guid.NewGuid(),
                                    JobInstanceId = jobInstance.Id,
                                    LocalTimeStamp = DateTime.UtcNow,
                                    Text = ""
                                });
                                Console.Error.WriteLine("Encountered invalid job instance: " + jobInstance.Id);
                                Console.Error.WriteLine("=> JobDescription not found.");
                                jobInstanceBlackList.Add(jobInstance.Id);
                            }
                            else
                            {
                                Console.Error.WriteLine("HTTP error while trying to retrieve job description for job instance: " + e.Message);
                            }

                            continue;
                        }

                        Agent[] agents = null;
                        while (agents == null)
                        {
                            try
                            {
                                agents = restProxy.GetAll<Agent>()
                                    .Result
                                    .Where(a => AgentMatchesJobRequirements(a, jobDescription))
                                    .ToArray();
                            }
                            catch (RestProxyException e)
                            {
                                Console.Error.WriteLine("HTTP error while trying to retrieve agent list: " + e.Message);
                                Console.Error.WriteLine("Retrying in a moment...");

                                Thread.Sleep(TimeSpan.FromSeconds(10));
                            }
                        }

                        var selectedAgentId = agents[random.Next(0, agents.Length)].Id;
                        jobInstance.AgentId = selectedAgentId;

                        while(true) try
                        {
                            restProxy.Update(jobInstance);
                            break;
                        }
                        catch (RestProxyException e)
                        {
                            if (e.StatusCode == HttpStatusCode.NotFound)
                            {
                                Console.Error.WriteLine("Could not find job instance with id " + jobInstance.Id + " again. May have been deleted.");
                                break;
                            }
                            else
                            {
                                Console.Error.WriteLine("HTTP error while trying to update job instance: " + e.Message);
                                Console.Error.WriteLine("Retrying in a moment...");

                                Thread.Sleep(TimeSpan.FromSeconds(10));
                            }
                        }
                    }

                    Thread.Sleep(TimeSpan.FromSeconds(5));
                }
            }
        }

        private static bool AgentMatchesJobRequirements(Agent agent, JobDescription jobDescription)
        {
            var match = jobDescription.AgentMatch ?? new Dictionary<string, string>();

            foreach (var matching in match)
            {
                switch (matching.Key)
                {
                    case Constants.FriendlyName:
                        if (agent.FriendlyName != matching.Value)
                            return false;
                        break;

                    case Constants.Id:
                        {
                            Guid matchId;

                            if (!Guid.TryParse(matching.Key, out matchId))
                                return false;

                            if (agent.Id != matchId)
                                return false;
                        }
                        break;

                    default:
                        if (agent.MachineDescription[matching.Key] != matching.Value)
                            return false;
                        break;
                }
            }

            return true;
        }
    }
}


text:
`msbuild` now supports sourcelink natively - [read the guide for enabling sourcelink in msbuild](https://github.com/dotnet/sourcelink/blob/master/README.md) to existing projects.

# Gradle PdbIndex Plugin [![Build status](https://ci.appveyor.com/api/projects/status/mn98qsdh8c8lq9gn/branch/master?svg=true)](https://ci.appveyor.com/project/gluck/gradle-pdbindex-plugin/branch/master) [![Build Status](https://travis-ci.org/Ullink/gradle-pdbindex-plugin.svg?branch=master)](https://travis-ci.org/Ullink/gradle-pdbindex-plugin)

This plugin aims at working things around PDBs, mainly source indexing.

Below tasks are provided by the plugin:

## sourceLink

Sample usage:

    buildscript {
        repositories {
          mavenCentral()
        }

        dependencies {
            classpath "com.ullink.gradle:gradle-pdbindex-plugin:0.9"
        }
    }

    apply plugin:'pdbindex'

    // this task will execute SourceLink on the generated asembly, for PDB indexing
    sourceLinkIndexing {
      // directory where SourceLink.exe can be found
      // Note that you may use gradle nuget plugin together with a nuget install task to download it
      // You may also add it to your project nuget dependencies, and reference it from there
      sourcelinkDir = "${sourcelinkNugetInstall.outputDirectory}/SourceLink/tools"

      // project (e.g. csproj) to pass to SourceLink, defaults to pdbindex.mainProject if not set
      projectFile = msbuild.mainProject?.projectFile

      // git viewer raw URL, use '{0}' placeholder for GIT commit (SHA1) and '%var2%' for file path
      // Note that because of SRCSRV limitations, the url may not contain non-valid-windows-path characters (e.g. '?' won't work)
      url = "http://my-git-server/${project.name}/%var2%/raw/{0}"

      // some other defaults, overwrite if needed, look for the param meaning in SourceLink
      verifyGit = false
      verifyPdb = true
      repo = project.rootDir
    }

# See also

[Gradle Msbuild plugin](https://github.com/Ullink/gradle-msbuild-plugin) - Allows to build VS projects & solutions.

[Gradle NuGet plugin](https://github.com/Ullink/gradle-nuget-plugin) - Allows to restore NuGet packages prior to building the projects with this plugin, and to pack&push nuget packages.

[Gradle NUnit plugin](https://github.com/Ullink/gradle-nunit-plugin) - Allows to execute NUnit tests from CI (used with this plugin to build the projects prior to UT execution)

[Gradle OpenCover plugin](https://github.com/Ullink/gradle-opencover-plugin) - Allows to execute the UTs through OpenCover for coverage reports.

You can see all these plugins in use on [ILRepack](https://github.com/gluck/il-repack) project ([build.gradle](https://github.com/gluck/il-repack/blob/master/build.gradle)).

# License

All these plugins are licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) with no warranty (expressed or implied) for any purpose.


text:
.include <bsd.own.mk>

LIB=	llvminterpreter

SRCDIR=	lib/ExecutionEngine/Interpreter
SRCS=	Execution.cpp \
	ExternalFunctions.cpp \
	Interpreter.cpp \

TGHDRS=	Intrinsics

.include "../clang.lib.mk"


text:
echo
[[ "$PWD" =~ "update-scripts" ]] && cd ..
echo "[GIT] Working dir: $PWD"
now=$(date +'%m/%d/%Y')
branchname=data
echo "[GIT] Date: $now"
echo "[GIT] Setup for branch '$branchname'"
echo
if [[ $(git rev-parse --abbrev-ref HEAD) = $branchname ]]
then
  echo "[GIT] Currently on branch $branchname"
  if [[ $(git status | grep 'nothing to commit') ]]
  then
    echo "[GIT] ERROR: Nothing to commit!"
  else
    git add .
    if [[ $(git log -1 --pretty=%B | grep 'Data update') ]]
    then
      echo "[GIT] Latest commit was a data update, amending"
      git commit --quiet --amend -m "Data update from $now"
      echo "[GIT] Commited successfully"
      git push --quiet -f
      echo "[GIT] Pushed data (-f) to branch '$branchname' successfully"
    else
      echo "[GIT] Latest commit not a data update, creating new commit"
      git commit -m "Data update from $now"
      echo "[GIT] Commited"
      git push
      echo "[GIT] Pushed data to branch '$branchname'"
    fi
  fi
else
  echo "[GIT] ERROR: Not on branch $branchname - current branch is $(git rev-parse --abbrev-ref HEAD)"
fi


text:
import React from 'react';
import { findById } from 'util/helpers';

import { QuestionCard } from 'Questions/ui/dynamicRoutes';

export const Question = ({
  match: {
    params: { questionId }
  },
  questionairre: { questions: list }
}) => {
  console.debug('Question Card', list);
  return <QuestionCard {...findById(list, questionId)} />;
};


text:
<?php

class Connection
{
    private $db;
    public function __construct($host = 'localhost', $database, $username, $password)
    {
        $this->db = new PDO('mysql:host='.$host.';dbname='.$database, $username, $password);
        session_start();
    }

    public function getDb()
    {
        return $this->db;
    }
}


text:
<?php

namespace Oro\Bundle\FormBundle\Form\Type;

use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
 * FormType mapping for array on HiddenType
 *
 * @see https://github.com/symfony/symfony/issues/29809
 */
class OroUnstructuredHiddenType extends HiddenType
{
    /**
     * {@inheritdoc}
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        parent::configureOptions($resolver);

        $resolver->setDefaults([
            'multiple' => true,
        ]);
    }
}


text:
package com.vladsch.flexmark.ext.yaml.front.matter;

import com.vladsch.flexmark.util.ast.VisitHandler;

public class YamlFrontMatterVisitorExt {
    public static <V extends YamlFrontMatterVisitor> VisitHandler<?>[] VISIT_HANDLERS(V visitor) {
        return new VisitHandler<?>[] {
                new VisitHandler<>(YamlFrontMatterNode.class, visitor::visit),
                new VisitHandler<>(YamlFrontMatterBlock.class, visitor::visit),
        };
    }
}


text:
<?php namespace Tests\Configuration;

use Mitch\LaravelDoctrine\Configuration\OCIMapper;
use Mockery as m;

class OCIMapperTest extends \PHPUnit_Framework_TestCase
{
	private $sqlMapper;

	public function setUp()
	{
		$this->sqlMapper = new OCIMapper;
	}

	public function testAppropriation()
	{
		$this->assertTrue($this->sqlMapper->isAppropriateFor(['driver' => 'oci8']));
		$this->assertTrue($this->sqlMapper->isAppropriateFor(['driver' => 'pdo_oci']));
	}

	public function testMapping()
	{
		$configuration = [
			'driver'   => 'oracle',
			'host'     => 'localhost',
			'database' => 'db',
			'username' => 'somedude',
			'password' => 'not safe',
			'prefix'   => 'mitch_',
			'charset'  => 'whatevs',
			'servicename' => 'SID'
		];

		$expected = [
			'pooled'   => false,
			'servicename' => 'SID',
            'port' => 1521,
			'driver'   => 'oci8',
			'host'     => $configuration['host'],
			'dbname'   => $configuration['database'],
			'user'     => $configuration['username'],
			'password' => $configuration['password'],
            'charset'  => $configuration['charset'],
            'prefix'   => $configuration['prefix']
		];

		$actual = $this->sqlMapper->map($configuration);

		$this->assertEquals($expected, $actual);
	}
}


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

namespace Mysoft.Core
{
    public interface IEngine
    {

        ContainerManager ContainerManager { get; }
        void Initialize();

        T Resolve<T>() where T : class;

        object Resolve(Type type);
        //IEnumerable<T> ResolveAll<T>();
    }
}


text:
<?php

namespace WiderFunnel\OptimizelyX\Collections;

use Illuminate\Support\Collection;

/**
 * Class CollectionAbstract
 * @package WiderFunnel\Collections
 */
abstract class CollectionAbstract extends Collection
{
    public abstract static function createFromJson($json);
}


text:
import { Component, forwardRef, Input, OnInit } from '@angular/core';
import {
  ControlValueAccessor,
  FormBuilder,
  FormGroup,
  NG_VALIDATORS,
  NG_VALUE_ACCESSOR,
  ValidationErrors,
  Validator,
  Validators
} from '@angular/forms';
import {
  EntityKeyValueType,
  FilterPredicateType,
  StringFilterPredicate,
  StringOperation,
  stringOperationTranslationMap
} from '@shared/models/query/query.models';

@Component({
  selector: 'tb-string-filter-predicate',
  templateUrl: './string-filter-predicate.component.html',
  styleUrls: ['./filter-predicate.scss'],
  providers: [
    {
      provide: NG_VALUE_ACCESSOR,
      useExisting: forwardRef(() => StringFilterPredicateComponent),
      multi: true
    },
    {
      provide: NG_VALIDATORS,
      useExisting: forwardRef(() => StringFilterPredicateComponent),
      multi: true
    }
  ]
})
export class StringFilterPredicateComponent implements ControlValueAccessor, Validator, OnInit {

  @Input() disabled: boolean;

  @Input() allowUserDynamicSource = true;

  @Input() onlyUserDynamicSource = false;

  valueTypeEnum = EntityKeyValueType;

  stringFilterPredicateFormGroup: FormGroup;

  stringOperations = Object.keys(StringOperation);
  stringOperationEnum = StringOperation;
  stringOperationTranslations = stringOperationTranslationMap;

  private propagateChange = null;

  constructor(private fb: FormBuilder) {
  }

  ngOnInit(): void {
    this.stringFilterPredicateFormGroup = this.fb.group({
      operation: [StringOperation.STARTS_WITH, [Validators.required]],
      value: [null, [Validators.required]],
      ignoreCase: [false]
    });
    this.stringFilterPredicateFormGroup.valueChanges.subscribe(() => {
      this.updateModel();
    });
  }

  registerOnChange(fn: any): void {
    this.propagateChange = fn;
  }

  registerOnTouched(fn: any): void {
  }

  setDisabledState?(isDisabled: boolean): void {
    this.disabled = isDisabled;
    if (this.disabled) {
      this.stringFilterPredicateFormGroup.disable({emitEvent: false});
    } else {
      this.stringFilterPredicateFormGroup.enable({emitEvent: false});
    }
  }

  writeValue(predicate: StringFilterPredicate): void {
    this.stringFilterPredicateFormGroup.get('operation').patchValue(predicate.operation, {emitEvent: false});
    this.stringFilterPredicateFormGroup.get('value').patchValue(predicate.value, {emitEvent: false});
    this.stringFilterPredicateFormGroup.get('ignoreCase').patchValue(predicate.ignoreCase, {emitEvent: false});
  }

  validate(c): ValidationErrors {
    return this.stringFilterPredicateFormGroup.valid ? null : {
      stringFilterPredicate: {valid: false}
    };
  }

  private updateModel() {
    const predicate: StringFilterPredicate = this.stringFilterPredicateFormGroup.getRawValue();
    predicate.type = FilterPredicateType.STRING;
    this.propagateChange(predicate);
  }

}


text:
import { _AbstractConstructor } from '@angular/material/core';
import { AbstractControl } from '@angular/forms';
import { AfterContentInit } from '@angular/core';
import { AfterViewInit } from '@angular/core';
import { AnimationEvent as AnimationEvent_2 } from '@angular/animations';
import { AnimationTriggerMetadata } from '@angular/animations';
import { CanColor } from '@angular/material/core';
import { CdkStep } from '@angular/cdk/stepper';
import { CdkStepLabel } from '@angular/cdk/stepper';
import { CdkStepper } from '@angular/cdk/stepper';
import { CdkStepperNext } from '@angular/cdk/stepper';
import { CdkStepperPrevious } from '@angular/cdk/stepper';
import { ChangeDetectorRef } from '@angular/core';
import { _Constructor } from '@angular/material/core';
import { Directionality } from '@angular/cdk/bidi';
import { ElementRef } from '@angular/core';
import { ErrorStateMatcher } from '@angular/material/core';
import { EventEmitter } from '@angular/core';
import { FocusMonitor } from '@angular/cdk/a11y';
import { FocusOrigin } from '@angular/cdk/a11y';
import { FormGroupDirective } from '@angular/forms';
import * as i0 from '@angular/core';
import * as i10 from '@angular/cdk/stepper';
import * as i11 from '@angular/material/icon';
import * as i7 from '@angular/material/core';
import * as i8 from '@angular/common';
import * as i9 from '@angular/cdk/portal';
import { NgForm } from '@angular/forms';
import { OnDestroy } from '@angular/core';
import { Optional } from '@angular/core';
import { QueryList } from '@angular/core';
import { StepperOptions } from '@angular/cdk/stepper';
import { StepperOrientation } from '@angular/cdk/stepper';
import { StepState } from '@angular/cdk/stepper';
import { Subject } from 'rxjs';
import { TemplatePortal } from '@angular/cdk/portal';
import { TemplateRef } from '@angular/core';
import { ThemePalette } from '@angular/material/core';
import { ViewContainerRef } from '@angular/core';

declare namespace i1 {
    export {
        MatStep,
        MatStepper
    }
}

declare namespace i2 {
    export {
        MatStepLabel
    }
}

declare namespace i3 {
    export {
        MatStepperNext,
        MatStepperPrevious
    }
}

declare namespace i4 {
    export {
        MatStepHeader
    }
}

declare namespace i5 {
    export {
        MatStepperIconContext,
        MatStepperIcon
    }
}

declare namespace i6 {
    export {
        MatStepContent
    }
}

/** @docs-private */
export declare const MAT_STEPPER_INTL_PROVIDER: {
    provide: typeof MatStepperIntl;
    deps: Optional[][];
    useFactory: typeof MAT_STEPPER_INTL_PROVIDER_FACTORY;
};

/** @docs-private */
export declare function MAT_STEPPER_INTL_PROVIDER_FACTORY(parentIntl: MatStepperIntl): MatStepperIntl;

export declare class MatStep extends CdkStep implements ErrorStateMatcher, AfterContentInit, OnDestroy {
    private _errorStateMatcher;
    private _viewContainerRef;
    private _isSelected;
    /** Content for step label given by `<ng-template matStepLabel>`. */
    stepLabel: MatStepLabel;
    /** Theme color for the particular step. */
    color: ThemePalette;
    /** Content that will be rendered lazily. */
    _lazyContent: MatStepContent;
    /** Currently-attached portal containing the lazy content. */
    _portal: TemplatePortal;
    constructor(stepper: MatStepper, _errorStateMatcher: ErrorStateMatcher, _viewContainerRef: ViewContainerRef, stepperOptions?: StepperOptions);
    ngAfterContentInit(): void;
    ngOnDestroy(): void;
    /** Custom error state matcher that additionally checks for validity of interacted form. */
    isErrorState(control: AbstractControl | null, form: FormGroupDirective | NgForm | null): boolean;
    static ɵfac: i0.ɵɵFactoryDeclaration<MatStep, [null, { skipSelf: true; }, null, { optional: true; }]>;
    static ɵcmp: i0.ɵɵComponentDeclaration<MatStep, "mat-step", ["matStep"], { "color": "color"; }, {}, ["stepLabel", "_lazyContent"], ["*"], false, never>;
}

/**
 * Content for a `mat-step` that will be rendered lazily.
 */
export declare class MatStepContent {
    _template: TemplateRef<any>;
    constructor(_template: TemplateRef<any>);
    static ɵfac: i0.ɵɵFactoryDeclaration<MatStepContent, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<MatStepContent, "ng-template[matStepContent]", never, {}, {}, never, never, false, never>;
}

export declare class MatStepHeader extends _MatStepHeaderBase implements AfterViewInit, OnDestroy, CanColor {
    _intl: MatStepperIntl;
    private _focusMonitor;
    private _intlSubscription;
    /** State of the given step. */
    state: StepState;
    /** Label of the given step. */
    label: MatStepLabel | string;
    /** Error message to display when there's an error. */
    errorMessage: string;
    /** Overrides for the header icons, passed in via the stepper. */
    iconOverrides: {
        [key: string]: TemplateRef<MatStepperIconContext>;
    };
    /** Index of the given step. */
    index: number;
    /** Whether the given step is selected. */
    selected: boolean;
    /** Whether the given step label is active. */
    active: boolean;
    /** Whether the given step is optional. */
    optional: boolean;
    /** Whether the ripple should be disabled. */
    disableRipple: boolean;
    constructor(_intl: MatStepperIntl, _focusMonitor: FocusMonitor, _elementRef: ElementRef<HTMLElement>, changeDetectorRef: ChangeDetectorRef);
    ngAfterViewInit(): void;
    ngOnDestroy(): void;
    /** Focuses the step header. */
    focus(origin?: FocusOrigin, options?: FocusOptions): void;
    /** Returns string label of given step if it is a text label. */
    _stringLabel(): string | null;
    /** Returns MatStepLabel if the label of given step is a template label. */
    _templateLabel(): MatStepLabel | null;
    /** Returns the host HTML element. */
    _getHostElement(): HTMLElement;
    /** Template context variables that are exposed to the `matStepperIcon` instances. */
    _getIconContext(): MatStepperIconContext;
    _getDefaultTextForState(state: StepState): string;
    static ɵfac: i0.ɵɵFactoryDeclaration<MatStepHeader, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<MatStepHeader, "mat-step-header", never, { "color": "color"; "state": "state"; "label": "label"; "errorMessage": "errorMessage"; "iconOverrides": "iconOverrides"; "index": "index"; "selected": "selected"; "active": "active"; "optional": "optional"; "disableRipple": "disableRipple"; }, {}, never, never, false, never>;
}

/** @docs-private */
declare const _MatStepHeaderBase: _Constructor<CanColor> & _AbstractConstructor<CanColor> & {
    new (elementRef: ElementRef): {
        _elementRef: ElementRef<HTMLElement>;
        focus(): void;
    };
    ɵfac: unknown;
    ɵdir: unknown;
};

export declare class MatStepLabel extends CdkStepLabel {
    static ɵfac: i0.ɵɵFactoryDeclaration<MatStepLabel, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<MatStepLabel, "[matStepLabel]", never, {}, {}, never, never, false, never>;
}

export declare class MatStepper extends CdkStepper implements AfterContentInit {
    /** The list of step headers of the steps in the stepper. */
    _stepHeader: QueryList<MatStepHeader>;
    /** Full list of steps inside the stepper, including inside nested steppers. */
    _steps: QueryList<MatStep>;
    /** Steps that belong to the current stepper, excluding ones from nested steppers. */
    readonly steps: QueryList<MatStep>;
    /** Custom icon overrides passed in by the consumer. */
    _icons: QueryList<MatStepperIcon>;
    /** Event emitted when the current step is done transitioning in. */
    readonly animationDone: EventEmitter<void>;
    /** Whether ripples should be disabled for the step headers. */
    disableRipple: boolean;
    /** Theme color for all of the steps in stepper. */
    color: ThemePalette;
    /**
     * Whether the label should display in bottom or end position.
     * Only applies in the `horizontal` orientation.
     */
    labelPosition: 'bottom' | 'end';
    /**
     * Position of the stepper's header.
     * Only applies in the `horizontal` orientation.
     */
    headerPosition: 'top' | 'bottom';
    /** Consumer-specified template-refs to be used to override the header icons. */
    _iconOverrides: Record<string, TemplateRef<MatStepperIconContext>>;
    /** Stream of animation `done` events when the body expands/collapses. */
    readonly _animationDone: Subject<AnimationEvent_2>;
    /** Duration for the animation. Will be normalized to milliseconds if no units are set. */
    get animationDuration(): string;
    set animationDuration(value: string);
    private _animationDuration;
    constructor(dir: Directionality, changeDetectorRef: ChangeDetectorRef, elementRef: ElementRef<HTMLElement>);
    ngAfterContentInit(): void;
    _stepIsNavigable(index: number, step: MatStep): boolean;
    _getAnimationDuration(): string;
    static ɵfac: i0.ɵɵFactoryDeclaration<MatStepper, [{ optional: true; }, null, null]>;
    static ɵcmp: i0.ɵɵComponentDeclaration<MatStepper, "mat-stepper, mat-vertical-stepper, mat-horizontal-stepper, [matStepper]", ["matStepper", "matVerticalStepper", "matHorizontalStepper"], { "selectedIndex": "selectedIndex"; "disableRipple": "disableRipple"; "color": "color"; "labelPosition": "labelPosition"; "headerPosition": "headerPosition"; "animationDuration": "animationDuration"; }, { "animationDone": "animationDone"; }, ["_steps", "_icons"], never, false, never>;
}

/**
 * Animations used by the Material steppers.
 * @docs-private
 */
export declare const matStepperAnimations: {
    readonly horizontalStepTransition: AnimationTriggerMetadata;
    readonly verticalStepTransition: AnimationTriggerMetadata;
};

/**
 * Template to be used to override the icons inside the step header.
 */
export declare class MatStepperIcon {
    templateRef: TemplateRef<MatStepperIconContext>;
    /** Name of the icon to be overridden. */
    name: StepState;
    constructor(templateRef: TemplateRef<MatStepperIconContext>);
    static ɵfac: i0.ɵɵFactoryDeclaration<MatStepperIcon, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<MatStepperIcon, "ng-template[matStepperIcon]", never, { "name": "matStepperIcon"; }, {}, never, never, false, never>;
}

/** Template context available to an attached `matStepperIcon`. */
export declare interface MatStepperIconContext {
    /** Index of the step. */
    index: number;
    /** Whether the step is currently active. */
    active: boolean;
    /** Whether the step is optional. */
    optional: boolean;
}

/** Stepper data that is required for internationalization. */
export declare class MatStepperIntl {
    /**
     * Stream that emits whenever the labels here are changed. Use this to notify
     * components if the labels have changed after initialization.
     */
    readonly changes: Subject<void>;
    /** Label that is rendered below optional steps. */
    optionalLabel: string;
    /** Label that is used to indicate step as completed to screen readers. */
    completedLabel: string;
    /** Label that is used to indicate step as editable to screen readers. */
    editableLabel: string;
    static ɵfac: i0.ɵɵFactoryDeclaration<MatStepperIntl, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<MatStepperIntl>;
}

export declare class MatStepperModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<MatStepperModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<MatStepperModule, [typeof i1.MatStep, typeof i2.MatStepLabel, typeof i1.MatStepper, typeof i3.MatStepperNext, typeof i3.MatStepperPrevious, typeof i4.MatStepHeader, typeof i5.MatStepperIcon, typeof i6.MatStepContent], [typeof i7.MatCommonModule, typeof i8.CommonModule, typeof i9.PortalModule, typeof i10.CdkStepperModule, typeof i11.MatIconModule, typeof i7.MatRippleModule], [typeof i7.MatCommonModule, typeof i1.MatStep, typeof i2.MatStepLabel, typeof i1.MatStepper, typeof i3.MatStepperNext, typeof i3.MatStepperPrevious, typeof i4.MatStepHeader, typeof i5.MatStepperIcon, typeof i6.MatStepContent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<MatStepperModule>;
}

/** Button that moves to the next step in a stepper workflow. */
export declare class MatStepperNext extends CdkStepperNext {
    static ɵfac: i0.ɵɵFactoryDeclaration<MatStepperNext, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<MatStepperNext, "button[matStepperNext]", never, { "type": "type"; }, {}, never, never, false, never>;
}

/** Button that moves to the previous step in a stepper workflow. */
export declare class MatStepperPrevious extends CdkStepperPrevious {
    static ɵfac: i0.ɵɵFactoryDeclaration<MatStepperPrevious, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<MatStepperPrevious, "button[matStepperPrevious]", never, { "type": "type"; }, {}, never, never, false, never>;
}

export { StepperOrientation }

export { StepState }

export { }


text:
import Vue from 'vue'
import Router from 'vue-router'

import Home from '@/views/Home'
import About from '@/views/About'
import Contact from '@/views/Contact'

Vue.use(Router)

export function createRouter() {
  return new Router({
    linkActiveClass: 'open active',
    mode: 'history',
    scrollBehavior: () => ({ y: 0 }),
    routes: [
      {
        path: '/',
        name: 'home',
        component: Home
      },
      {
        path: '/about',
        name: 'about',
        component: About
      },
      {
        path: '/contact',
        name: 'contact',
        component: Contact
      }
    ]
  })
}


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

namespace DDay.iCal
{
    public interface IEvaluator
    {
        /// <summary>
        /// The system calendar that governs the evaluation rules.
        /// </summary>
        System.Globalization.Calendar Calendar { get; }

        /// <summary>
        /// The start bounds of the evaluation.  This gives
        /// the first date/time that is covered by the evaluation.
        /// This together with EvaluationEndBounds determines
        /// what time frames have already been evaluated, so
        /// duplicate evaluation doesn't occur.
        /// </summary>
        DateTime EvaluationStartBounds { get; }

        /// <summary>
        /// The end bounds of the evaluation.
        /// See <see cref="EvaluationStartBounds"/> for more info.
        /// </summary>
        DateTime EvaluationEndBounds { get; }

        /// <summary>
        /// Gets a list of periods collected so far during
        /// the evaluation process.
        /// </summary>
        IList<IPeriod> Periods { get; }

        /// <summary>
        /// Gets the object associated with this evaluator.
        /// </summary>
        ICalendarObject AssociatedObject { get; }

        /// <summary>
        /// Clears the evaluation, eliminating all data that has
        /// been collected up to this point.  Since this data is cached
        /// as needed, this method can be useful to gather information
        /// that is guaranteed to not be out-of-date.
        /// </summary>
        void Clear();

        /// <summary>
        /// Evaluates this item to determine the dates and times for which it occurs/recurs.
        /// This method only evaluates items which occur/recur between <paramref name="fromDate"/>
        /// and <paramref name="toDate"/>; therefore, if you require a list of items which
        /// occur outside of this range, you must specify a <paramref name="fromDate"/> and
        /// <paramref name="toDate"/> which encapsulate the date(s) of interest.
        /// This method evaluates using the <paramref name="startDate" /> as the beginning
        /// point.  For example, for a WEEKLY occurrence, the <paramref name="startDate"/>
        /// determines the day of week that this item will recur on.
        /// <note type="caution">
        ///     For events with very complex recurrence rules, this method may be a bottleneck
        ///     during processing time, especially when this method is called for a large number
        ///     of items, in sequence, or for a very large time span.
        /// </note>
        /// </summary>
        /// <param name="startDate">The date to begin evaluation from.</param>
        /// <param name="fromDate">The beginning date of the range to evaluate.</param>
        /// <param name="toDate">The end date of the range to evaluate.</param>
        /// <returns>
        ///     A list of <see cref="System.DateTime"/> objects for
        ///     each date/time when this item occurs/recurs.
        /// </returns>
        IList<IPeriod> Evaluate(IDateTime referenceDate, DateTime periodStart, DateTime periodEnd, bool includeReferenceDateInResults);
    }
}


text:
package org.parboiled.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Annotation that can be used on parser methods returning {@link org.parboiled.Rule} objects.
 * Instructs parboiled to automatically label the created rules with the given label.
 * If this annotation is not present on a rule method parboiled automatically names the created rules with the
 * method name, unless a {@link DontLabel} annotation is present on the method or the parser class.
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public @interface Label {
    String value();
}


text:
package com.github.gquintana.beepbeep.http;

import com.github.gquintana.beepbeep.pipeline.LineEvent;
import org.junit.jupiter.api.Test;

import java.util.List;

import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;

public class HttpLineTest {
    @Test
    public void testRemoveUselessLines() {
        // Given
        String eol = System.lineSeparator();
        List<String> lines1 = asList(
            "#Comment" + eol,
            "" + eol,
            "  # Comment" + eol,
            "POST /url" + eol,
            "{" + eol,
            "\"body\":\"content\"" + eol,
            "}" + eol,
            "" + eol,
            " # Comment" + eol
        );
        // When
        List<String> lines = HttpLine.removeUselessLines(lines1);
        // Then
        assertThat(lines).hasSize(4);
    }

    @Test
    public void testRemoveUselessLines_Empty() {
        // Given
        String eol = System.lineSeparator();
        List<String> lines1 = asList(
            "#Comment" + eol,
            "" + eol,
            "  # Comment" + eol,
            "" + eol,
            " # Comment" + eol
        );
        // When
        List<String> lines = HttpLine.removeUselessLines(lines1);
        // Then
        assertThat(lines).isEmpty();
    }

    @Test
    public void testParsePostBody()  {
        // Given
        String eol = System.lineSeparator();
        LineEvent lineEvent = new LineEvent(null, 10,
            "#Comment" + eol +
                "" + eol +
                "  # Comment" + eol +
                "POST /url" + eol +
                "{" + eol +
                "\"body\":\"content\"" + eol +
                "}" + eol +
                "" + eol +
                " # Comment" + eol
        );
        // When
        HttpLine httpLine = HttpLine.parse(lineEvent);
        // Then
        assertThat(httpLine.getMethod()).isEqualTo("POST");
        assertThat(httpLine.getUri()).isEqualTo("/url");
        assertThat(httpLine.getBody()).isEqualTo("{" + eol +
            "\"body\":\"content\"" + eol +
            "}" + eol);
        assertThat(httpLine.getHeaders()).isEmpty();
    }

    @Test
    public void testParseGetHeaders()  {
        // Given
        String eol = System.lineSeparator();
        LineEvent lineEvent = new LineEvent(null, 10,
            "#Comment" + eol +
                "" + eol +
                "  # Comment" + eol +
                "GET /my/endpoint?is=beautiful" + eol +
                "HEADER Accept application/json" + eol +
                "# Comment" + eol
        );
        // When
        HttpLine httpLine = HttpLine.parse(lineEvent);
        // Then
        assertThat(httpLine.getMethod()).isEqualTo("GET");
        assertThat(httpLine.getUri()).isEqualTo("/my/endpoint?is=beautiful");
        assertThat(httpLine.getHeaders()).hasSize(1);
    }

    @Test
    public void testParseEmpty()  {
        // Given
        String eol = System.lineSeparator();
        LineEvent lineEvent = new LineEvent(null, 10,
            "#Comment" + eol +
                "" + eol +
                "  # Comment" + eol
        );
        // When
        HttpLine httpLine = HttpLine.parse(lineEvent);
        // Then
        assertThat(httpLine).isNull();
    }
}


text:
#ifndef HEADER_CURL_TIMEVAL_H
#define HEADER_CURL_TIMEVAL_H

/*
 * CAUTION: this header is designed to work when included by the app-side
 * as well as the library. Do not mix with library internals!
 */

#include "curl_setup.h"

struct timeval curlx_tvnow(void);

/*
 * Make sure that the first argument (t1) is the more recent time and t2 is
 * the older time, as otherwise you get a weird negative time-diff back...
 *
 * Returns: the time difference in number of milliseconds.
 */
long curlx_tvdiff(struct timeval t1, struct timeval t2);

/*
 * Same as curlx_tvdiff but with full usec resolution.
 *
 * Returns: the time difference in seconds with subsecond resolution.
 */
double curlx_tvdiff_secs(struct timeval t1, struct timeval t2);

long Curl_tvlong(struct timeval t1);

/* These two defines below exist to provide the older API for library
   internals only. */
#define Curl_tvnow() curlx_tvnow()
#define Curl_tvdiff(x,y) curlx_tvdiff(x,y)
#define Curl_tvdiff_secs(x,y) curlx_tvdiff_secs(x,y)

#endif /* HEADER_CURL_TIMEVAL_H */


text:
package voogasalad.util.paint;

public interface IPixelComparison {
	boolean checkCondition(int pixel);
}


text:
package com.puresoltechnologies.graphs.trees;

/**
 * This is a simple interface to specify a tree search criterion.
 *
 * @author Rick-Rainer Ludwig
 *
 * @param <N>
 *            is the actual tree node implementation.
 */
public interface TreeSearchCriterion<N extends TreeNode<N>> {

    /**
     * This method returns whether a node is accepted as a search result or not.
     *
     * @param node
     *            is the current node visited.
     * @return True is returned if the current node is to be added to the search
     *         result or not. False is returned otherwise.
     */
    public boolean accepted(N node);

}


text:
from django.apps import AppConfig

class AuthyMeConfig(AppConfig):
    name = 'authy_me'


text:
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Automation;
using WindowsInput;
using Golem.Core;
using Golem.Purple.PurpleCore;

namespace Golem.Purple.PurpleElements
{
    public static class PurpleWindow
    {
        private static IntPtr handle;
        private static Locator _locator;
        public static AutomationElement purpleWindow { get; private set; }

        [DllImport("user32.dll")]
        private static extern bool SetForegroundWindow(IntPtr hWnd);

        [DllImport("user32.dll")]
        private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int cx, int cy,
            uint uFlags);

        public static bool FindRunningProcess()
        {
            var processRunning = false;
            var processes = Process.GetProcessesByName(Config.settings.purpleSettings.ProcessName);
            if (processes.Length == 0)
            {
                Log.Message(string.Format("Could not find process {0}. Attempting to start process...",
                    Config.settings.purpleSettings.ProcessName));
                var startProcess = new ProcessStartInfo(Config.settings.purpleSettings.appPath);
                var app = Process.Start(startProcess);
                waitForWindow();

                //SetWindowPos(app.MainWindowHandle, new IntPtr(-1), 0, 0, 0, 0, 3); //This should bring the application to the front once it starts
                //Thread.Sleep(2000);
                //SetForegroundWindow(handle);  //this didn't bring the app to the front
            }
            else
            {
                Log.Message(
                    string.Format("Process Length is: {0}. Attempting to kill existing process and start it up again.",
                        processes.Length));
                EndProcess();
                FindRunningProcess();
            }
            //the PurpleLib will always try to find an element the first window the with name = Purple_windowTitle;
            return processRunning;
        }

        private static void waitForWindow()
        {
            _locator = new Locator();
            purpleWindow =
                _locator.WaitForElementAvailable(
                    Config.settings.purpleSettings.Purple_Delimiter + Config.settings.purpleSettings.Purple_windowTitle,
                    Config.settings.purpleSettings.Purple_windowTitle);
        }

        public static void EndProcess(String DontsaveProjectPath = "notused")
        {
            purpleWindow = null;
            var processes = Process.GetProcessesByName(Config.settings.purpleSettings.ProcessName);
            foreach (var process in processes)
            {
                process.Kill();
                Thread.Sleep(2000);
                //process.CloseMainWindow();
                //PurpleButton dontsave = new PurpleButton("Save Dialog: No", "/LifeQuest™ Pipeline/Save Project?/Save Project?/No");
                //dontsave.Invoke();
            }
        }

        private static WindowPattern GetWindowPattern(AutomationElement targetControl)
        {
            WindowPattern windowPattern = null;

            try
            {
                windowPattern = targetControl.GetCurrentPattern(WindowPattern.Pattern)
                    as WindowPattern;
            }
            catch (InvalidOperationException)
            {
                // object doesn't support the WindowPattern control pattern
                return null;
            }
            // Make sure the element is usable.
            if (false == windowPattern.WaitForInputIdle(10000))
            {
                // Object not responding in a timely manner
                return null;
            }
            return windowPattern;
        }

        public static void SetVisualState(Window_VisualStyle visualState)
        {
            var windowPattern = GetWindowPattern(purpleWindow);

            try
            {
                if (windowPattern.Current.WindowInteractionState == WindowInteractionState.ReadyForUserInteraction)
                {
                    switch (visualState)
                    {
                        case Window_VisualStyle.Maximized:
                            // Confirm that the element can be maximized
                            if ((windowPattern.Current.CanMaximize) && !(windowPattern.Current.IsModal))
                            {
                                windowPattern.SetWindowVisualState(WindowVisualState.Maximized);
                            }
                            break;
                        case Window_VisualStyle.Minimized:
                            // Confirm that the element can be minimized
                            if ((windowPattern.Current.CanMinimize) && !(windowPattern.Current.IsModal))
                            {
                                windowPattern.SetWindowVisualState(WindowVisualState.Minimized);
                            }
                            break;
                        case Window_VisualStyle.Normal:
                            windowPattern.SetWindowVisualState(WindowVisualState.Normal);
                            break;
                        default:
                            windowPattern.SetWindowVisualState(WindowVisualState.Normal);
                            break;
                    }
                }
            }
            catch (InvalidOperationException)
            {
                // object is not able to perform the requested action
            }
        }

        //These are duplicated on the PurpleElement we should pick a place
        public static void HoldKey(VirtualKeyCode key)
        {
            InputSimulator.SimulateKeyDown(key);
        }

        public static void ReleaseKey(VirtualKeyCode key)
        {
            InputSimulator.SimulateKeyUp(key);
        }

        public static void PressKey(VirtualKeyCode key)
        {
            InputSimulator.SimulateKeyPress(key);
        }
    }
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: Jan
 * Date: 2/15/16
 * Time: 2:47 PM
 */

class Model_bookmark extends CI_Model{
    public function addBookmark($data){
        $this->db->insert('bookmarks', $data);
    }

    public function getAllBookmark($id){
        return $this->db
            ->select('bookmarks.user_id, bookmarks.ad_id, bookmarks.created_at, products.title, products.author, products.description, products.price, products.img')
            ->from('bookmarks')
            ->where('bookmarks.user_id', $id)
            ->join('products', 'products.id = bookmarks.ad_id')
            ->order_by('bookmarks.created_at', 'DESC')
            ->get()
            ->result_array();
    }

    public function getAllBookmark_session($id){
        return $this->db
            ->select('ad_id')
            ->from('bookmarks')
            ->where('user_id', $id)
            ->get()
            ->result_array();
    }

    public function deleteBookmark($ad_id, $user_id){
        if($user_id == null){
            $this->db
                ->select('*')
                ->from('bookmarks')
                ->where('ad_id', $ad_id)
                ->delete();
        }else{
            $this->db
                ->select('*')
                ->from('bookmarks')
                ->where('user_id', $user_id)
                ->where('ad_id', $ad_id)
                ->delete();
        }
    }

    public function isBookmarked($ad_id){
        $counter = $this->db
            ->select('*')
            ->from('bookmarks')
            ->where('ad_id', $ad_id)
            ->count_all_results();

        if($counter > 0){
            return true;
        }else{
            return false;
        }
    }

    public function countBookmarks($userid){
        return $this->db
            ->select('*')
            ->from('bookmarks')
            ->where('user_id', $userid)
            ->count_all_results();
    }
}


text:
GraphOperations::size_t GraphOperations::degree(const Graph& graph,
												vertex_t vertex)
{
	return graph.adjacent(vertex).size();
}

GraphOperations::size_t GraphOperations::max_degree(const Graph& graph)
{
	size_t maximum = 0;

	for (vertex_t vertex = 0; vertex < graph.number_of_vertices(); ++vertex)
	{
		maximum = std::max(degree(graph, vertex), maximum);
	}

	return maximum;
}

GraphOperations::size_t GraphOperations::average_degree(const Graph& graph)
{
	return 2.0 * graph.number_of_edges() / graph.number_of_vertices();
}

GraphOperations::size_t GraphOperations::self_loops(const Graph& graph)
{
	size_t loops = 0;

	for (vertex_t vertex = 0; vertex < graph.number_of_vertices(); ++vertex)
	{
		const auto& adjacent = graph.adjacent(vertex);

		loops += std::count_if(adjacent.begin(),
							   adjacent.end(),
							   [&] (const edge_t& edge)
							   { return edge.first == vertex; });
	}

	return loops;
}

bool GraphOperations::is_connected(const Graph& graph,
								   vertex_t vertex,
								   vertex_t target)
{
	bitset_t visited(graph.number_of_vertices(), false);

	return _is_connected(graph,
						 vertex,
						 target,
						 visited);
}

GraphOperations::size_t GraphOperations::shortest_distance(const Graph& graph,
														   vertex_t vertex,
														   vertex_t target)
{
	size_t number_of_vertices = graph.number_of_vertices();

	if (vertex > number_of_vertices)
	{
		throw std::invalid_argument("Start-vertex out of range!");
	}

	else if (target > number_of_vertices)
	{
		throw std::invalid_argument("Target-vertex out of range!");
	}

	std::vector<bool> visited(number_of_vertices, false);

	std::queue<vertex_t> queue;

	queue.push(vertex);

	vertex_t last_on_level = vertex;

	size_t distance = 0;

	while (! queue.empty())
	{
		vertex = queue.front();

		queue.pop();

		if (vertex == target) break;

		visited[vertex] = true;

		for (const auto& adjacent : graph.adjacent(vertex))
		{
			if (! visited[adjacent.first])
			{
				queue.push(adjacent.first);
			}
		}

		if (vertex == last_on_level)
		{
			++distance;

			last_on_level = queue.back();
		}
	}

	return distance;
}

GraphOperations::component_t GraphOperations::shortest_path(const Graph& graph,
															vertex_t vertex,
															vertex_t target)
{
	size_t number_of_vertices = graph.number_of_vertices();

	if (vertex > number_of_vertices)
	{
		throw std::invalid_argument("Start-vertex out of range!");
	}

	else if (target > number_of_vertices)
	{
		throw std::invalid_argument("Target-vertex out of range!");
	}

	std::vector<bool> visited(number_of_vertices, false);

	visited[vertex] = true;

	std::vector<vertex_t> source(number_of_vertices, vertex);

	std::queue<vertex_t> queue;

	queue.push(vertex);

	vertex_t last_on_level = vertex;

	size_t distance = 0;

	while (! queue.empty())
	{
		vertex = queue.front();

		queue.pop();

		if (vertex == target) break;

		for (const auto& adjacent : graph.adjacent(vertex))
		{
			if (! visited[adjacent.first])
			{
				queue.push(adjacent.first);

				visited[adjacent.first] = true;

				source[adjacent.first] = vertex;
			}
		}

		if (vertex == last_on_level)
		{
			++distance;

			last_on_level = queue.back();
		}
	}

	GraphOperations::component_t path(distance + 1);

	for (int i = static_cast<int>(distance); i >= 0; --i)
	{
		path[i] = vertex;

		vertex = source[vertex];
	}

	return path;
}

bool GraphOperations::_is_connected(const Graph &graph,
									Graph::vertex_t vertex,
									Graph::vertex_t target,
									bitset_t& visited)
{
	if (visited[vertex]) return false;

	if (vertex == target) return true;

	visited[vertex] = true;

	for (const auto& adjacent : graph.adjacent(vertex))
	{
		if (_is_connected(graph, adjacent.first, target, visited))
		{
			return true;
		}
	}

	return false;
}

bool GraphOperations::is_bipartite(const Graph &graph,
								   const std::function<bool(vertex_t)>& predicate)
{
	bitset_t visited(graph.number_of_edges(), false);

	ConnectedComponents cc(graph);

	for (const auto& component : cc.components())
	{
		vertex_t vertex = component[0];

		bool is = predicate(vertex);

		if (! _is_bipartite(graph, vertex, !is, predicate, visited))
		{
			return false;
		}
	}

	return true;
}

bool GraphOperations::_is_bipartite(const Graph &graph,
									vertex_t vertex,
									bool was,
									const std::function<bool(vertex_t)>& predicate,
									bitset_t &visited)
{
	bool is = predicate(vertex);

	if (was == is) return false;

	for (const auto& adjacent : graph.adjacent(vertex))
	{
		if (! visited[adjacent.second])
		{
			visited[adjacent.second] = true;

			if (! _is_bipartite(graph, adjacent.first, is, predicate, visited))
			{
				return false;
			}
		}
	}

	return true;
}

bool GraphOperations::euler_tour_possible(const Graph &graph)
{
	ConnectedComponents cc(graph);

	if (cc.count() > 1) return false;

	for (vertex_t vertex = 0; vertex < graph.number_of_vertices(); ++vertex)
	{
		if (degree(graph, vertex) % 2 != 0) return false;
	}

	return true;
}

GraphOperations::component_t GraphOperations::euler_tour(const Graph &graph)
{
	component_t path;

	std::set<size_t> visited;

	if (_euler_tour(graph, 0, path, visited)) return path;

	throw std::invalid_argument("Euler tour not possible for this graph!");
}

bool GraphOperations::_euler_tour(const Graph &graph,
								  vertex_t vertex,
								  component_t& path,
								  std::set<size_t>& visited)
{
	if (visited.size() == graph.number_of_edges())
	{
		path.push_back(vertex);

		return true;
	}

	for (const auto& adjacent : graph.adjacent(vertex))
	{
		if (! visited.count(adjacent.second))
		{
			auto copy = visited;

			copy.insert(adjacent.second);

			if (_euler_tour(graph, adjacent.first, path, copy))
			{
				path.push_back(vertex);

				return true;
			}
		}
	}

	return false;
}


text:
#define LOC(locKey) (NSLocalizedString(locKey, nil))

#define LANG @"LANG"
#define UNSPEC @"UNSPEC"

#define ERR_SMTH_WENT_WRONG @"ERR_SMTH_WENT_WRONG"

// Recurring text

#define CANCEL @"CANCEL"
#define CLOSE @"CLOSE"

#define OKAY @"OKAY"
#define EDIT @"EDIT"
#define DONE @"DONE"
#define ERROR @"ERROR"

//SignInViewController
#define SIVC_TITLE @"SIVC_TITLE"
#define SIVC_SIGNUP @"SIVC_SIGNUP"
#define SIVC_LOGIN @"SIVC_LOGIN"
#define SIVC_USERNAME @"SIVC_USERNAME"
#define SIVC_PASSWORD @"SIVC_PASSWORD"

//TabBarController
#define TBC_PRODUCTS @"TBC_PRODUCTS"
#define TBC_QUOTE @"TBC_QUOTE"
#define TBC_ORDER @"TBC_ORDER"
#define TBC_NEW_QUOTES @"TBC_NEW_QUOTES"
#define TBC_ABOUT @"TBC_ABOUT"
#define TBC_SETTINGS @"TBC_SETTINGS"

//SettingViewController
#define SVC_CELL_TITLE_CONTACT @"SVC_CELL_TITLE_CONTACT"
#define SVC_CELL_PLACEHOLDER_CONTACT @"SVC_CELL_PLACEHOLDER_CONTACT"
#define SVC_CELL_TITLE_COMPANY @"SVC_CELL_TITLE_COMPANY"
#define SVC_CELL_PLACEHOLDER_COMPANY @"SVC_CELL_PLACEHOLDER_COMPANY"
#define SVC_CELL_TITLE_ACCOUNT_NUMBER @"SVC_CELL_TITLE_ACCOUNT_NUMBER"
#define SVC_CELL_TITLE_PHONE @"SVC_CELL_TITLE_PHONE"
#define SVC_CELL_PLACEHOLDER_PHONE @"SVC_CELL_PLACEHOLDER_PHONE"
#define SVC_CELL_TITLE_EMAIL @"SVC_CELL_TITLE_EMAIL"
#define SVC_CELL_PLACEHOLDER_EMAIL @"SVC_CELL_PLACEHOLDER_EMAIL"
#define SVC_PUSH_LABEL @"SVC_PUSH_LABEL"
#define SVC_EMAIL_CONFIRMATION_LABEL @"SVC_EMAIL_CONFIRMATION_LABEL"
#define SVC_BUTTON_LOGOUT @"SVC_BUTTON_LOGOUT"
#define SVC_NOT_VALID_EMAIL_MESSAGE @"SVC_NOT_VALID_EMAIL_MESSAGE"
#define SVC_NOT_VALID_EMAIL_MESSAGE_EDIT @"SVC_NOT_VALID_EMAIL_MESSAGE_EDIT"

//Detail View
#define DV_PRODUCT_TITLE @"DV_PRODUCT_TITLE"
#define DV_REFERENCE_NUMBER @"DV_REFERENCE_NUMBER"
#define DV_ACTIVE_USER @"DV_ACTIVE_USER"
#define DV_BUSINESS_LOGIC_SCRIPTS @"DV_BUSINESS_LOGIC_SCRIPTS"
#define DV_SCHEDULED_BUSINESS_LOGIC @"DV_SCHEDULED_BUSINESS_LOGIC"
#define DV_COLLABORATORS @"DV_COLLABORATORS"
#define DV_BACKEND_ENVIRONMENTS @"DV_BACKEND_ENVIRONMENTS"
#define DV_DATA_STORAGE @"DV_DATA_STORAGE"
#define DV_BUSINESS_EXECUTION_TIME_LIMIT @"DV_BUSINESS_EXECUTION_TIME_LIMIT"
#define DV_START_SUBSCRIPTION_DATE @"DV_START_SUBSCRIPTION_DATE"
#define DV_TOTAL_COST @"DV_TOTAL_COST"
#define DV_ORDER_TITLE @"DV_ORDER_TITLE"
#define DV_QUOTE_TITLE @"DV_QUOTE_TITLE"
#define DV_MESSAGE_ERROR_CREATE_QUOTE @"DV_MESSAGE_ERROR_CREATE_QUOTE"
#define DV_MESSAGE_ORDER_CONFIRMATION_TITLE @"DV_MESSAGE_ORDER_CONFIRMATION_TITLE"
#define DV_MESSAGE_ORDER_CONFIRMATION_TEXT @"DV_MESSAGE_ORDER_CONFIRMATION_TEXT"
#define DV_MESSAGE_ERROR_CREATE_ORDER @"DV_MESSAGE_ERROR_CREATE_ORDER"
#define DV_BUTTON_RECREATE_ORDER @"DV_BUTTON_RECREATE_ORDER"
#define DV_BUTTON_SUBMIT_ORDER @"DV_BUTTON_SUBMIT_ORDER"

//New Quote View Contoller
#define NQV_PLACEHOLDER_PRODUCT @"NQV_PLACEHOLDER_PRODUCT"
#define NQV_PLACEHOLDER_ACTIVE_USER @"NQV_PLACEHOLDER_ACTIVE_USER"
#define NQV_PLACEHOLDER_BUSINESS_LOGIC_SCRIPTS @"NQV_PLACEHOLDER_BUSINESS_LOGIC_SCRIPTS"
#define NQV_PLACEHOLDER_SCHEDULED_BUSINESS_LOGIC @"NQV_PLACEHOLDER_SCHEDULED_BUSINESS_LOGIC"
#define NQV_PLACEHOLDER_COLLABORATORS @"NQV_PLACEHOLDER_COLLABORATORS"
#define NQV_PLACEHOLDER_BACKEND_ENVIROMENTS @"NQV_PLACEHOLDER_BACKEND_ENVIROMENTS"
#define NQV_PLACEHOLDER_DATA_STOREGE @"NQV_PLACEHOLDER_DATA_STOREGE"
#define NQV_PLACEHOLDER_BUSINESS_LOGIC_EXECUTION_TIME_LIMIT @"NQV_PLACEHOLDER_BUSINESS_LOGIC_EXECUTION_TIME_LIMIT"
#define NQV_PLACEHOLDER_START_SUBSCRIPTION_DATE @"NQV_PLACEHOLDER_START_SUBSCRIPTION_DATE"
#define NQV_BUTTON_SUBMIT @"NQV_BUTTON_SUBMIT"
#define NQV_TITLE @"NQV_TITLE"
#define NQV_TOP_BAR_TITLE @"NQV_TOP_BAR_TITLE"

//Main Table View Header
#define MTVH_DATE_ORDER @"MTVH_DATE_ORDER"
#define MTVH_NO_ORDER @"MTVH_NO_ORDER"
#define MTVH_START_SUBSCRIPTION_DATE @"MTVH_START_SUBSCRIPTION_DATE"
#define MTVH_STATUS_ORDER @"MTVH_STATUS_ORDER"
#define MTVH_MORE_ORDER @"MTVH_MORE_ORDER"
#define MTVH_DATE_QUOTE @"MTVH_DATE_QUOTE"
#define MTVH_NO_QUOTE @"MTVH_NO_QUOTE"
#define MTVH_PRICE_QUOTE @"MTVH_PRICE_QUOTE"
#define MTVH_MORE_QUOTE @"MTVH_MORE_QUOTE"

//Home and Search View Controller
#define HaSVC_LEBEL_COUNT_RESULT @"HaSVC_LEBEL_COUNT_RESULT"

//Quote Home View Controller
#define QHVC_CELL_NO_QUOTE @"QHVC_CELL_NO_QUOTE"
#define QHVC_REFRESH_CONTROL_TITLE @"QHVC_REFRESH_CONTROL_TITLE"
#define QHVC_TITLE @"QHVC_TITLE"

//Order Home View Controller
#define OHVC_CELL_NO_ORDER @"OHVC_CELL_NO_ORDER"
#define OHVC_REFRESH_CONTROL_TITLE @"OHVC_REFRESH_CONTROL_TITLE"
#define OHVC_TITLE @"OHVC_TITLE"

//Product Home View Controller
#define PHVC_CELL_NO_PRODUCTS @"PHVC_CELL_NO_PRODUCTS"
#define PHVC_REFRESH_CONTROL_TITLE @"PHVC_REFRESH_CONTROL_TITLE"
#define PHVC_TITLE @"PHVC_TITLE"
#define PHVC_BUTTON_NEW_QUOTE @"PHVC_BUTTON_NEW_QUOTE"

//About View Controller
#define AVC_TITLE @"AVC_TITLE"


text:
            <input type="checkbox" ng-model="gid.checkAllVal" ng-click="gid.checkAll()">
            {{column.headtext}}

            <input type="checkbox" ng-model="item.checked" ng-click="gid.checkItem(item.checked)">


text:
package org.diorite.plugin;

import org.slf4j.Logger;

public interface BasePlugin
{
    /**
     * Invoked on load of plugin.
     */
    void onLoad();

    /**
     * Invoked when enabling plugin, always after {@link #onLoad()}
     */
    void onEnable();

    /**
     * Invoked when disabling plugin.
     */
    void onDisable();

    /**
     * Returns name and version of plugin and parent, can't be null.
     *
     * @return name and version of plugin.
     */
    default String getFullName()
    {
        return this.getName() + " v" + this.getVersion();
    }

    /**
     * Returns name of plugin, can't be null.
     *
     * @return name of plugin.
     */
    String getName();

    /**
     * Returns version of plugin, can't be null.
     *
     * @return version of plugin.
     */
    String getVersion();

    /**
     * Returns prefix of plugin, can't be null.
     *
     * @return prefix of plugin.
     */
    String getPrefix();

    /**
     * Returns author/s of plugin, can't be null, may contains custom text.
     *
     * @return author.s of plugin.
     */
    String getAuthor();

    /**
     * Returns description of plugin, can't be null.
     *
     * @return description of plugin.
     */
    String getDescription();

    /**
     * Returns website of plugin, can't be null.
     *
     * @return website of plugin.
     */
    String getWebsite();

    /**
     * Returns Logger for this plugin.
     *
     * @return Logger for this plugin.
     */
    Logger getLogger();

    /**
     * Returns PluginLoaded for this plugin.
     *
     * @return PluginLoaded for this plugin.
     */
    PluginLoader getPluginLoader();

    /**
     * Method invoked on plugin init, do not override.
     *
     * @param classLoader  used class loader.
     * @param pluginLoader used plugin loader.
     * @param name         name of plugin.
     * @param name         prefix used in logger.
     * @param version      version of plugin.
     * @param author       author/s of plugin.
     * @param description  description of plugin.
     * @param website      webiste of plugin.
     */
    void init(final PluginClassLoader classLoader, final PluginLoader pluginLoader, final PluginDataBuilder pluginData);

    /**
     * Set if plugin is enabled.
     *
     * @param enabled if plugin should be enabled.
     */
    void setEnabled(boolean enabled);

    /**
     * Returns true if plugin is already initialised.
     *
     * @return true if plugin is already initialised.
     */
    boolean isInitialised();

    /**
     * Returns true if plugin is already enabled.
     *
     * @return true if plugin is already enabled.
     */
    boolean isEnabled();

    /**
     * Return true if this is core mod for diorite.
     *
     * @return true if this is core mod for diorite.
     */
    default boolean isCoreMod()
    {
        return false;
    }
}


text:
Gitman is a language-agnostic dependency manager using Git. It aims to serve as a submodules replacement and provides advanced options for managing versions of nested Git repositories.

[![Demo](https://raw.githubusercontent.com/jacebrowning/gitman/main/docs/demo.gif)](https://asciinema.org/a/3DLos4HIU84P0AfFlZMYcgPus)

[![Unix Build Status](https://img.shields.io/travis/com/jacebrowning/gitman/main.svg?label=unix)](https://travis-ci.com/jacebrowning/gitman)
[![Windows Build Status](https://img.shields.io/appveyor/ci/jacebrowning/gitman/main.svg?label=window)](https://ci.appveyor.com/project/jacebrowning/gitman)
[![Coverage Status](https://img.shields.io/coveralls/jacebrowning/gitman/main.svg)](https://coveralls.io/r/jacebrowning/gitman)
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/jacebrowning/gitman.svg)](https://scrutinizer-ci.com/g/jacebrowning/gitman/?branch=main)
[![PyPI License](https://img.shields.io/pypi/l/gitman.svg)](https://pypi.org/project/gitman)
[![PyPI Version](https://img.shields.io/pypi/v/gitman.svg)](https://pypi.org/project/gitman)
[![PyPI Downloads](https://img.shields.io/pypi/dm/gitman.svg?color=orange)](https://pypistats.org/packages/gitman)

## Setup

### Requirements

- Python 3.8+
- Git 2.8+ (with [stored credentials](http://gitman.readthedocs.io/en/latest/setup/git/))

### Installation

Install this tool globally with [pipx](https://pipxproject.github.io/pipx/) (or pip):

```sh
$ pipx install gitman
```
or add it to your [Poetry](https://python-poetry.org/docs/) project:

```sh
$ poetry add gitman
```

### Configuration

Generate a sample config file:

```sh
$ gitman init
```

or manually create one (`gitman.yml` or `.gitman.yml`) in the root of your working tree:

```yaml
location: vendor/gitman

sources:
  - repo: "https://github.com/kstenerud/iOS-Universal-Framework"
    name: framework
    rev: Mk5-end-of-life
  - repo: "https://github.com/jonreid/XcodeCoverage"
    name: coverage
    links:
      - target: Tools/XcodeCoverage
  - repo: "https://github.com/dxa4481/truffleHog"
    name: trufflehog
    rev: master
    scripts:
      - chmod a+x truffleHog/truffleHog.py
  - repo: "https://github.com/FortAwesome/Font-Awesome"
    name: fontawesome
    rev: master
    sparse_paths:
      - "webfonts/*"
  - repo: "https://github.com/google/material-design-icons"
    name: material-design-icons
    rev: master

groups:
  - name: code
    members:
      - framework
      - trufflehog
  - name: resources
    members:
      - fontawesome
      - material-design-icons

default_group: code
```

Ignore the dependency storage location:

```sh
$ echo vendor/gitman >> .gitignore
```

## Usage

See the available commands:

```sh
$ gitman --help
```

### Updating Dependencies

Get the latest versions of all dependencies:

```sh
$ gitman update
```

which will essentially:

1. Create a working tree at `<root>`/`<location>`/`<name>`
2. Fetch from `repo` and checkout the specified `rev`
3. Symbolically link each `<location>`/`<name>` from `<root>`/`<link>` (if specified)
4. Repeat for all nested working trees containing a config file
5. Record the actual commit SHAs that were checked out (with `--lock` option)
6. Run optional post-install scripts for each dependency

where `rev` can be:

- all or part of a commit SHA: `123def`
- a tag: `v1.0`
- a branch: `main`
- a `rev-parse` date: `'main@{2015-06-18 10:30:59}'`

Alternatively, get the latest versions of specific dependencies:

```sh
$ gitman update framework
```

or named groups:

```sh
$ gitman update resources
```

### Restoring Previous Versions

Display the versions that are currently installed:

```sh
$ gitman list
```

Reinstall these specific versions at a later time:

```sh
$ gitman install
```

### Deleting Dependencies

Remove all installed dependencies:

```sh
$ gitman uninstall
```

## Resources

- [Source code](https://github.com/jacebrowning/gitman)
- [Issue tracker](https://github.com/jacebrowning/gitman/issues)
- [Release history](https://github.com/jacebrowning/gitman/blob/main/CHANGELOG.md)


text:
@interface XRBorrowRecordCell ()

@property (weak, nonatomic) IBOutlet UIImageView *bookCover;
@property (weak, nonatomic) IBOutlet UILabel *title;
@property (weak, nonatomic) IBOutlet UILabel *publisher;
@property (weak, nonatomic) IBOutlet UILabel *address;
@property (weak, nonatomic) IBOutlet UIButton *bookStatus;
@property (weak, nonatomic) IBOutlet UIView *whiteBackground;

@end

@implementation XRBorrowRecordCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.whiteBackground.layer.masksToBounds = NO;
    self.whiteBackground.layer.shadowColor = RGBCOLOR(218,218,218).CGColor;
//    self.whiteBackground.layer.shadowColor = RGBCOLOR(0,0,0).CGColor;
    self.whiteBackground.layer.shadowOffset = CGSizeMake(0,1);
}

- (void)updateUI {
    [super updateUI];
    XRBookDetailEntity *detailEntity = (XRBookDetailEntity *)self.data;
    [self.bookCover sd_setImageWithURL:[NSURL URLWithString:detailEntity.book.imgURL]];
    self.title.text = detailEntity.book.title;
    self.publisher.text = detailEntity.book.publisher;
    self.address.text = [NSString stringWithFormat:@"%@",detailEntity.onOffStockRecord.location];
    [self updateStatusButtonWithStatus:detailEntity.onOffStockRecord.borrowStatus];
}

- (void)updateStatusButtonWithStatus:(BookStatus)status {
    self.bookStatus.hidden = NO;
    if (status == kBookStatusBorrowed) {
        self.bookStatus.backgroundColor = RGBCOLOR(235,97,0);
        [self.bookStatus setTitle:LOCALSTRING(@"未还") forState:UIControlStateNormal];
    }
    else if (status == kBookStatusAvaliable) {
        self.bookStatus.backgroundColor = RGBCOLOR(89,195,24);
        [self.bookStatus setTitle:LOCALSTRING(@"已还") forState:UIControlStateNormal];
    }
    else {
        self.bookStatus.hidden = YES;
    }
}

@end


text:
require_relative '../../../puppet_x/puppetlabs/kubernetes/provider'

Puppet::Type.type(:kubernetes_node_daemon_endpoints).provide(:swagger, :parent => PuppetX::Puppetlabs::Kubernetes::Provider) do

  mk_resource_methods

  def self.instance_to_hash(instance)
    {
    ensure: :present,
    name: instance.metadata.name,

        kubeletEndpoint: instance.kubeletEndpoint.respond_to?(:to_hash) ? instance.kubeletEndpoint.to_hash : instance.kubeletEndpoint,

    object: instance,
    }
  end

  def create
    Puppet.info("Creating kubernetes_node_daemon_endpoints #{name}")
    create_instance_of('node_daemon_endpoints', name, build_params)
  end

  def flush
   unless @property_hash.empty?
     unless resource[:ensure] == :absent
        flush_instance_of('node_daemon_endpoints', name, @property_hash[:object], build_params)
      end
    end
  end

  def destroy
    Puppet.info("Deleting kubernetes_node_daemon_endpoints #{name}")
    destroy_instance_of('node_daemon_endpoints', name)
    @property_hash[:ensure] = :absent
  end

  private
  def self.list_instances
    list_instances_of('node_daemon_endpoints')
  end

  def build_params
    params = {

        kubeletEndpoint: resource[:kubeletEndpoint],

    }
    params.delete_if { |key, value| value.nil? }
    params
  end
end


text:
<?php
use PayPal\Exception\PayPalConnectionException;

/**
 * Test class for PayPalConnectionException.
 *
 */
class PayPalConnectionExceptionTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var PayPalConnectionException
     */
    protected $object;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp()
    {
        $this->object = new PayPalConnectionException('http://testURL', 'test message');
        $this->object->setData('response payload for connection');
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown()
    {
    }

    /**
     * @test
     */
    public function testGetUrl()
    {
        $this->assertEquals('http://testURL', $this->object->getUrl());
    }

    /**
     * @test
     */
    public function testGetData()
    {
        $this->assertEquals('response payload for connection', $this->object->getData());
    }
}


text:
<<<<<<< HEAD
package maven_webapp_sample;

import java.util.ArrayList;
import java.util.Date;
import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

import javax.swing.plaf.synth.SynthSeparatorUI;

import org.joda.time.DateTime;
import org.junit.Test;

import com.kkdm.worker.service.WorkService;
import com.kkdm.worker.service.workers.GetInfoWorker;
import com.quya.core.utils.DateTimeUtils;
import com.quya.core.utils.MysqlUtils;

public class WorkServiceTest {

	@Test
	public void checkWorkTest(){
		WorkService workService = new WorkService();
		workService.checkWork();
	}

	@Test
	public void getInfoWorkerTest(){
		GetInfoWorker.getInstance().getInfo(null);

	}
	@Test
	public void timerTest(){
		System.out.println(DateTimeUtils.getYestoday());
//		MysqlUtils.truncate("tbTopicTags");
	}

	@Test
	public void brunchTest(){
		System.out.println("dev brunch");
		System.out.println("dev brunch 2");
	}

}
=======
package maven_webapp_sample;

import java.util.ArrayList;
import java.util.Date;
import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

import javax.swing.plaf.synth.SynthSeparatorUI;

import org.joda.time.DateTime;
import org.junit.Test;

import com.kkdm.worker.service.WorkService;
import com.kkdm.worker.service.workers.GetInfoWorker;
import com.quya.core.utils.DateTimeUtils;
import com.quya.core.utils.MysqlUtils;

public class WorkServiceTest {

	@Test
	public void checkWorkTest(){
		WorkService workService = new WorkService();
		workService.checkWork();
	}

	@Test
	public void getInfoWorkerTest(){
		GetInfoWorker.getInstance().getInfo(null);

	}
	@Test
	public void timerTest(){
		System.out.println(DateTimeUtils.getYestoday());
//		MysqlUtils.truncate("tbTopicTags");
	}
}
>>>>>>> branch 'master' of https://github.com/gamedos/first-spring-kkdemo.git


text:
<?php

namespace App\Http\Controllers\Frontend;

use App\Http\Controllers\Controller;
use Inertia\Inertia;

class IndexController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Inertia\Response
     */
    public function index()
    {
        return Inertia::render('Frontend/Index');
    }
}


text:
include ../../../Makefile.defs
include ../../../Makefile.quiet

DEFAULT_OUT := connectivity-check.yaml
# Same as connectivity-check.yaml, but internal traffic only (i.e. without external traffic to 1.1.1.1 or www.google.com)
INTERNAL_TRAFFIC_OUT := connectivity-check-internal.yaml
HOSTPORT_OUT := connectivity-check-hostport.yaml
SINGLE_OUT := connectivity-check-single-node.yaml
PROXY_OUT := connectivity-check-proxy.yaml
QUARANTINE_OUT := connectivity-check-quarantine.yaml
TOOLS_OUT := connectivity-debug-tools.yaml

SERVERS_NAME := echo-a echo-b echo-b-host echo-b-host-headless echo-c echo-c-host echo-c-host-headless
SERVERS_OUT := servers.yaml

SRC := $(wildcard *.cue)
ALL_TARGETS := $(DEFAULT_OUT) $(INTERNAL_TRAFFIC_OUT) $(HOSTPORT_OUT) $(SINGLE_OUT) $(PROXY_OUT) $(QUARANTINE_OUT) $(TOOLS_OUT)

DOCKER_RUN := $(CONTAINER_ENGINE) container run --rm \
	--workdir /src/examples/kubernetes/connectivity-check \
	--volume $(CURDIR)/../../..:/src \
	--user "$(shell id -u):$(shell id -g)"

CUE_VERSION := "v0.2.2"
CUE_SHA := "2ea932c771212db140c9996c6fff1d236f3f84ae82add914374cee553b6fc60c"
CUE_IMAGE := "docker.io/cuelang/cue:$(CUE_VERSION)@sha256:$(CUE_SHA)"
CUE := $(DOCKER_RUN) $(CUE_IMAGE)

all: $(ALL_TARGETS)

$(DEFAULT_OUT): $(SRC)
	@echo '# Automatically generated by Makefile. DO NOT EDIT' > $@
	$(QUIET)$(CUE) dump >> $@

$(INTERNAL_TRAFFIC_OUT): $(SRC)
	@echo '# Automatically generated by Makefile. DO NOT EDIT' > $@
	$(QUIET)$(CUE) -t traffic=internal dump >> $@

$(HOSTPORT_OUT): $(SRC)
	@echo '# Automatically generated by Makefile. DO NOT EDIT' > $@
	$(QUIET)$(CUE) -t component=all dump >> $@

$(SINGLE_OUT): $(SRC)
	@echo '# Automatically generated by Makefile. DO NOT EDIT' > $@
	$(QUIET)$(CUE) -t topology=single-node dump >> $@

$(PROXY_OUT): $(SRC) $(SERVERS_OUT)
	@echo '# Automatically generated by Makefile. DO NOT EDIT' > $@
	$(QUIET)$(CUE) -t component=proxy dump >> $@
	@cat $(SERVERS_OUT) >> $@

$(QUARANTINE_OUT): $(SRC) $(SERVERS_OUT)
	@echo '# Automatically generated by Makefile. DO NOT EDIT' > $@
	$(QUIET)$(CUE) -t component=all -t quarantine=true dump >> $@
	@cat $(SERVERS_OUT) >> $@

$(TOOLS_OUT): $(SRC) $(SERVERS_OUT)
	@echo '# Automatically generated by Makefile. DO NOT EDIT' > $@
	$(QUIET)$(CUE) -t component=all -t type=tool dump >> $@

clean:
	@rm -f $(ALL_TARGETS)
	@rm -f *.new
	@rm -f *.diff
	@rm -f *.yaml

deploy:
	$(QUIET)kubectl apply -f connectivity-check-hostport.yaml

eval:
	$(QUIET)$(CUE) eval -c ./...

# To easier inspect individual yamls for specific checks, generate all YAMLs from *.cue
generate_all: $(SRC)
	# TODO: Don't run docker for every command
	@for deployment in $(shell $(CUE) -t component=all ls | tail -n+2 | awk '{ print $$4 }' | sort | uniq); do \
		$(CUE) -t component=all -t name=$$deployment dump > $$deployment.yaml; \
	done

inspect:
	@echo "Comparing latest cue declarations against cluster deployment from "make deploy"..."
	$(QUIET)$(CUE) -t component=all dump > connectivity-check-hostport.yaml.new
	-@kubectl diff -f connectivity-check-hostport.yaml.new > connectivity-check-hostport.yaml.diff
	@cat connectivity-check-hostport.yaml.diff
	@echo
	@echo "The full diff is available in connectivity-check-hostport.yaml.diff."

help:
	$(QUIET)$(CUE) cmd help
	@echo "The cue CLI may be installed via the following command:"
	@echo "$$ go get cuelang.org/go@$(CUE_VERSION)"

list:
	$(QUIET)$(CUE) cmd ls

fmt:
	$(QUIET)$(CUE) fmt

$(SERVERS_OUT): $(SRC)
	@echo > $(SERVERS_OUT)
	@for name in $(SERVERS_NAME); do \
		$(CUE) cmd -t component=all -t name=$$name dump >> $@; \
	done

.PHONY: all clean deploy eval fmt generate_all help inspect list $(ALL_TARGETS)


text:
package schema

import "fmt"

type Uint16 struct {
}

var _ SlotType = Uint16{}
var _ FieldType = Uint16{}

func (Uint16) isSlot()  {}
func (Uint16) isField() {}

func (Uint16) SlotSize() uint64 {
	return 2
}

func (Uint16) GoType() string {
	return `uint16`
}

func (Uint16) GoSlotGetter() string {
	return `return binary.BigEndian.Uint16(data)`
}

func (Uint16) GoSlotSetter() string {
	return `binary.BigEndian.PutUint16(data, v)`
}

func (Uint16) GoStateType() string { return `uint16` }

func (Uint16) GoFieldPrep(stateVar string) string {
	return fmt.Sprintf(`
	v, n := varuint.Uint64(data)
	if n < 0 {
		return nil, io.ErrUnexpectedEOF
	}
	const maxUint16 = ^uint16(0)
	if v > maxUint16 {
		return nil, errors.New("value overflows uint16")
	}
	%s = uint16(v)
	data = data[n:]
`, stateVar)
}

func (Uint16) GoFieldGetter(stateVar string) string {
	return fmt.Sprintf(`return %s`, stateVar)
}

func (Uint16) GoFieldBytes(stateVar string) string {
	return fmt.Sprintf(`
	var lb [varuint.MaxUint64Len]byte
	var ll int

	ll = varuint.PutUint64(lb[:], %s)
	data = append(data, lb[:ll]...)
`, stateVar)
}


text:
package org.apache.gobblin.capability;

import org.apache.gobblin.annotation.Alpha;

import lombok.Data;

/**
 * Represents a set of functionality a job-creator can ask for. Examples could include
 * encryption, compression, partitioning...
 *
 * Each Capability has a name and then a set of associated configuration properties. An example is
 * the encryption algorithm to use.
 */
@Alpha
@Data
public class Capability {
  /**
   * Threadsafe capability.
   */
  public static final Capability THREADSAFE = new Capability("THREADSAFE", false);

  private final String name;
  private final boolean critical;
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <artifactId>security-jwks</artifactId>
    <packaging>jar</packaging>
    <name>security-jwks</name>

    <parent>
        <groupId>io.airlift</groupId>
        <artifactId>airlift</artifactId>
        <version>218-SNAPSHOT</version>
    </parent>

    <properties>
        <air.main.basedir>${project.parent.basedir}</air.main.basedir>
    </properties>

    <dependencies>
        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>concurrent</artifactId>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>http-client</artifactId>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>json</artifactId>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>log</artifactId>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>units</artifactId>
        </dependency>

        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>

        <!-- used by tests but also needed transitively -->
        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>security</artifactId>
            <scope>runtime</scope>
        </dependency>

        <!-- for testing -->
        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>testing</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-api</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-impl</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-jackson</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>


text:
\set ECHO none
SET client_min_messages = NOTICE;
\set ECHO all

INSERT INTO utl_file.utl_file_dir(dir) VALUES(utl_file.tmpdir());

CREATE OR REPLACE FUNCTION gen_file(dir text) RETURNS void AS $$
DECLARE
  f utl_file.file_type;
BEGIN
  f := utl_file.fopen(dir, 'regress_orafce.txt', 'w');
  PERFORM utl_file.put_line(f, 'ABC');
  PERFORM utl_file.put_line(f, '123'::numeric);
  PERFORM utl_file.put_line(f, '-----');
  PERFORM utl_file.new_line(f);
  PERFORM utl_file.put_line(f, '-----');
  PERFORM utl_file.new_line(f, 0);
  PERFORM utl_file.put_line(f, '-----');
  PERFORM utl_file.new_line(f, 2);
  PERFORM utl_file.put_line(f, '-----');
  PERFORM utl_file.put(f, 'A');
  PERFORM utl_file.put(f, 'B');
  PERFORM utl_file.new_line(f);
  PERFORM utl_file.putf(f, '[1=%s, 2=%s, 3=%s, 4=%s, 5=%s]', '1', '2', '3', '4', '5');
  PERFORM utl_file.new_line(f);
  PERFORM utl_file.put_line(f, '1234567890');
  f := utl_file.fclose(f);
END;
$$ LANGUAGE plpgsql;

CREATE OR REPLACE FUNCTION read_file(dir text) RETURNS void AS $$
DECLARE
  f utl_file.file_type;
BEGIN
  f := utl_file.fopen(dir, 'regress_orafce.txt', 'r');
  FOR i IN 1..11 LOOP
    RAISE NOTICE '[%] >>%<<', i, utl_file.get_line(f);
  END LOOP;
  RAISE NOTICE '>>%<<', utl_file.get_line(f, 4);
  RAISE NOTICE '>>%<<', utl_file.get_line(f, 4);
  RAISE NOTICE '>>%<<', utl_file.get_line(f);
  RAISE NOTICE '>>%<<', utl_file.get_line(f);
  EXCEPTION
    -- WHEN no_data_found THEN,  8.1 plpgsql doesn't know no_data_found
    WHEN others THEN
      RAISE NOTICE 'finish % ', sqlerrm;
      RAISE NOTICE 'is_open = %', utl_file.is_open(f);
      PERFORM utl_file.fclose_all();
      RAISE NOTICE 'is_open = %', utl_file.is_open(f);
END;
$$ LANGUAGE plpgsql;

SELECT gen_file(utl_file.tmpdir());
SELECT fexists FROM utl_file.fgetattr(utl_file.tmpdir(), 'regress_orafce.txt');
SELECT utl_file.fcopy(utl_file.tmpdir(), 'regress_orafce.txt', utl_file.tmpdir(), 'regress_orafce2.txt');
SELECT fexists FROM utl_file.fgetattr(utl_file.tmpdir(), 'regress_orafce2.txt');
SELECT utl_file.frename(utl_file.tmpdir(), 'regress_orafce2.txt', utl_file.tmpdir(), 'regress_orafce.txt', true);
SELECT fexists FROM utl_file.fgetattr(utl_file.tmpdir(), 'regress_orafce.txt');
SELECT fexists FROM utl_file.fgetattr(utl_file.tmpdir(), 'regress_orafce2.txt');
SELECT read_file(utl_file.tmpdir());
SELECT utl_file.fremove(utl_file.tmpdir(), 'regress_orafce.txt');
SELECT fexists FROM utl_file.fgetattr(utl_file.tmpdir(), 'regress_orafce.txt');
DROP FUNCTION gen_file(text);
DROP FUNCTION read_file(text);

DELETE FROM utl_file.utl_file_dir;


text:
@class NSString;

@interface DVTPerformanceStatistic : NSObject
{
    NSString *_name;
    dispatch_block_t _checkpointBlock;
    dispatch_block_t _logBlock;
}

+ (void)freezePerformanceStatisticRegistration;
+ (id)allStatistics;
+ (id)registerStatisticWithName:(id)arg1 checkpointBlock:(dispatch_block_t)arg2 logBlock:(dispatch_block_t)arg3;
+ (void)initialize;
@property(readonly, copy) dispatch_block_t logBlock; // @synthesize logBlock=_logBlock;
@property(readonly, copy) dispatch_block_t checkpointBlock; // @synthesize checkpointBlock=_checkpointBlock;
@property(readonly, copy) NSString *name; // @synthesize name=_name;
- (id)initWithName:(id)arg1 checkpointBlock:(dispatch_block_t)arg2 logBlock:(dispatch_block_t)arg3;

@end


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.redisenterprise.models;

import com.azure.core.util.ExpandableStringEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;

/** Defines values for ResourceState. */
public final class ResourceState extends ExpandableStringEnum<ResourceState> {
    /** Static value Running for ResourceState. */
    public static final ResourceState RUNNING = fromString("Running");

    /** Static value Creating for ResourceState. */
    public static final ResourceState CREATING = fromString("Creating");

    /** Static value CreateFailed for ResourceState. */
    public static final ResourceState CREATE_FAILED = fromString("CreateFailed");

    /** Static value Updating for ResourceState. */
    public static final ResourceState UPDATING = fromString("Updating");

    /** Static value UpdateFailed for ResourceState. */
    public static final ResourceState UPDATE_FAILED = fromString("UpdateFailed");

    /** Static value Deleting for ResourceState. */
    public static final ResourceState DELETING = fromString("Deleting");

    /** Static value DeleteFailed for ResourceState. */
    public static final ResourceState DELETE_FAILED = fromString("DeleteFailed");

    /** Static value Enabling for ResourceState. */
    public static final ResourceState ENABLING = fromString("Enabling");

    /** Static value EnableFailed for ResourceState. */
    public static final ResourceState ENABLE_FAILED = fromString("EnableFailed");

    /** Static value Disabling for ResourceState. */
    public static final ResourceState DISABLING = fromString("Disabling");

    /** Static value DisableFailed for ResourceState. */
    public static final ResourceState DISABLE_FAILED = fromString("DisableFailed");

    /** Static value Disabled for ResourceState. */
    public static final ResourceState DISABLED = fromString("Disabled");

    /**
     * Creates or finds a ResourceState from its string representation.
     *
     * @param name a name to look for.
     * @return the corresponding ResourceState.
     */
    @JsonCreator
    public static ResourceState fromString(String name) {
        return fromString(name, ResourceState.class);
    }

    /** @return known ResourceState values. */
    public static Collection<ResourceState> values() {
        return values(ResourceState.class);
    }
}


text:
if [ -d ~/.git ]; then
  echo "err: home directrory already in git"
else
  pushd ~
  git init
  git config --global user.email "kikitux@gmail.com"
  git config --global user.name "Alvaro Miranda Aguilera"
  git remote add origin git@github.com:kikitux/home-kikitux
  [ -f .bashrc ] && mv .bashrc .bashrc.ori
  [ -f .bash_profile ] && mv .bash_profile .bash_profile.ori
  [ -f .gitignore ] && mv .gitignore .gitignore.ori
  [ -f .vimrc ] && mv .vimrc .vimrc.ori
  git pull origin master
fi

bash .code/vim.sh
bash .code/liquid.sh

which lsb_release &>/dev/null
if [ $? -eq 0 ] && [ "`lsb_release -i -s`" == "Ubuntu" ] ; then
  grep .bash_profile .bashrc &>/dev/null || echo '[[ $- = *i* ]] && source .bash_profile' | tee -a .bashrc
fi


text:
<?php

namespace Rhubarb\Crown\Response;

/**
 * All classes eligible for generating a response to a request must implement this interface.
 */
interface GeneratesResponse
{
    public function generateResponse($request = null);
}


text:
//
//  MPVideoPlayerView.h
//
//  Copyright 2018-2020 Twitter, Inc.
//  Licensed under the MoPub SDK License Agreement
//  http://www.mopub.com/legal/sdk-license-agreement/
//

#import <UIKit/UIKit.h>
#import "MPVideoPlayer.h"

NS_ASSUME_NONNULL_BEGIN

@protocol MPVideoPlayerViewDelegate;

/**
 @c MPVideoPlayerView only allows start playing without pause, reset, nor fast forwarding. Video is
 only paused automatically due to app life cycle events or user interactions such as click-throughs.

 Note: The actually video duration is honored as the source of truth, while the video duration
 provided by the @c MPVideoConfig is ignored.
 */
@interface MPVideoPlayerView : UIView <MPVideoPlayer>

@property (nonatomic, weak) id<MPVideoPlayerViewDelegate> delegate;
@property (nonatomic, readonly) BOOL didLoadVideo; // set to YES after `loadVideo` is called for the first time; never set back to NO again
@property (nonatomic, readonly) BOOL hasStartedPlaying; // set to YES after `play` is called for the first time; never set back to NO again
@property (nonatomic, readonly) NSTimeInterval videoDuration;
@property (nonatomic, readonly) NSTimeInterval videoProgress;

@end

#pragma mark -

@protocol MPVideoPlayerViewDelegate <NSObject>

- (void)videoPlayerViewDidLoadVideo:(MPVideoPlayerView *)videoPlayerView;

- (void)videoPlayerViewDidFailToLoadVideo:(MPVideoPlayerView *)videoPlayerView error:(NSError *)error;

- (void)videoPlayerViewDidStartVideo:(MPVideoPlayerView *)videoPlayerView duration:(NSTimeInterval)duration;

- (void)videoPlayerViewDidCompleteVideo:(MPVideoPlayerView *)videoPlayerView duration:(NSTimeInterval)duration;

- (void)videoPlayerView:(MPVideoPlayerView *)videoPlayerView
videoDidReachProgressTime:(NSTimeInterval)videoProgress
               duration:(NSTimeInterval)duration;

- (void)videoPlayerView:(MPVideoPlayerView *)videoPlayerView
        didTriggerEvent:(MPVideoPlayerEvent)event
          videoProgress:(NSTimeInterval)videoProgress;

- (void)videoPlayerView:(MPVideoPlayerView *)videoPlayerView
       showIndustryIcon:(MPVASTIndustryIcon *)icon;

- (void)videoPlayerViewHideIndustryIcon:(MPVideoPlayerView *)videoPlayerView;

@end

NS_ASSUME_NONNULL_END