text:
/**
 * Contains the server-specific base classes for simple remote services.
 *
Service Base Server

 * This package contains the server-specific base implementation the {@link net.sf.mmm.service.api service API}
 * such as {@link net.sf.mmm.service.base.server.AbstractGenericRemoteInvocationService}.

 */
package net.sf.mmm.service.base.server;


text:
set -eo pipefail

# http://stackoverflow.com/questions/9893667/is-there-a-way-to-write-a-bash-function-which-aborts-the-whole-execution-no-mat
trap "exit 1" TERM
export TOP_PID=$$

JAVA=/gapp/x64linux/opt/java/jdk/jdk1.8.0_60/bin/java
PICARD=/gscmnt/gc2802/halllab/idas/software/picard/picard.2.9.0.jar

PYTHON=$(which python) # if run inside yaps2 pipeline, then should be getting the virtualenv python
AWK=/usr/bin/awk
LN=/bin/ln
SORT=/gscmnt/gc2802/halllab/idas/software/local/bin/lh3-sort
UNIQ=/usr/bin/uniq

BGZIP=/gscmnt/gc2802/halllab/idas/software/local/bin/bgzip
TABIX=/gscmnt/gc2802/halllab/idas/software/local/bin/tabix
BCFTOOLS=/gscmnt/gc2802/halllab/idas/software/local/bin/bcftools1.4

function die {
    local timestamp=$(date +"%Y-%m-%d %T")
    echo -e "[ ${timestamp} ] ERROR: $@" >&2
    kill -s TERM ${TOP_PID}
}

function log {
    local timestamp=$(date +"%Y-%m-%d %T")
    echo "---> [ ${timestamp} ] $@" >&2
}

function run_cmd {
    local cmd=$1
    log "EXEC: ${cmd}"
    eval "${cmd}"
    if [[ $? -ne 0 ]]; then
        die "[err] Problem running command: ${cmd} !"
        exit 1;
    fi
}

function usage {
    msg="Usage: $0 -m /path/to/final-merged-file.vcf.gz <one or more /path/to/vcf-files-to-merge.vcf.gz> ..."
    echo "${msg}";
}

function parse_args {
    local final_merged_vcf;
    while getopts "m:" arg; do
        case "${arg}" in
            m)
                final_merged_vcf=${OPTARG}
                ;;
            *)
                local msg=$(usage)
                die ${msg}
                ;;
        esac
    done
    shift $((OPTIND - 1))

    if [ -z ${final_merged_vcf} ]; then
        local msg=$(usage)
        die "[err] Did not find the argument to the -m parameter:\n${msg}"
    fi
    log "final_merged_vcf is: '${final_merged_vcf}'"
    log "input vcfs are: '${@}'"
    local count=1
    for f in ${@}; do
        log "${count} : ${f}"
        count=$((count + 1))
    done

    # returning bash associative array from function trick:
    # http://notes-matthewlmcclure.blogspot.com/2009/12/return-array-from-bash-function-v-2.html
    local -A params=( [final_merged_vcf]=${final_merged_vcf} [input_vcfs]="${@}" )
    declare -p params | sed -e 's/^declare -A params=//'
}

function tabix_and_finalize_vcf {
	local tmpvcf=$1
	local finalvcf=$2
    local cmd="
    ${TABIX} -p vcf -f ${tmpvcf} \
        && mv ${tmpvcf}.tbi ${finalvcf}.tbi \
        && mv ${tmpvcf} ${finalvcf}
    "
    run_cmd "${cmd}"
}

function merge {
    local params_string=$@
    eval "local -A params=${params_string}"
    local out_vcf=${params[final_merged_vcf]}
    local tmp_vcf=${out_vcf}.tmp
    local input_vcfs=${params[input_vcfs]}

    if [[ -e "${out_vcf}" ]]; then
        log "merged vcf already exists -- shortcutting merging"
        return 0;
    fi

    if [[ ${#input_vcfs} == 0 ]]; then
        die "[err] Did not find any input vcfs to merge!"
        exit 1
    fi

    log "(merge) calling bcftools concat"
    local cmd="
    ${BCFTOOLS} concat \
        -a ${input_vcfs} \
        -O z \
        -o ${tmp_vcf}
    "
    run_cmd "${cmd}"
    log "(merge) tabix and finalizing vcf"
	tabix_and_finalize_vcf ${tmp_vcf} ${out_vcf}

    echo ${out_vcf}
}

function main {
    local params_string=$(parse_args "$@")
    echo "params_string is: ${params_string}"
    local merged_vcf=$(merge ${params_string})
    log "Got the merged vcf: ${merged_vcf}"
}

main "$@"

redpajama_set_name: RedPajamaGithub


text:
import {Model} from '../Model';
import {X, Y} from '../../channel';
import {applyColorAndOpacity, applyMarkConfig} from '../common';

export namespace line {
  export function markType() {
    return 'line';
  }

  export function properties(model: Model) {
    // TODO Use Vega's marks properties interface
    let p: any = {};

    // x
    if (model.has(X)) {
      p.x = {
        scale: model.scaleName(X),
        field: model.field(X, { binSuffix: '_mid' })
      };
    } else {
      p.x = { value: 0 };
    }

    // y
    if (model.has(Y)) {
      p.y = {
        scale: model.scaleName(Y),
        field: model.field(Y, { binSuffix: '_mid' })
      };
    } else {
      p.y = { field: { group: 'height' } };
    }

    applyColorAndOpacity(p, model);
    applyMarkConfig(p, model, ['interpolate', 'tension']);
    return p;
  }

  export function labels(model: Model) {
    // TODO(#240): fill this method
    return undefined;
  }
}


text:
package org.edx.mobile.whatsnew;

import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.NonNull;

import java.util.List;

public class WhatsNewModel implements Parcelable {
    @NonNull
    private String version;
    @NonNull
    private List<WhatsNewItemModel> messages;

    protected WhatsNewModel(Parcel in) {
        this.version = in.readString();
        this.messages = in.createTypedArrayList(WhatsNewItemModel.CREATOR);
    }

    @NonNull
    public String getVersion() {
        return version;
    }

    @NonNull
    public List<WhatsNewItemModel> getWhatsNewItems() {
        return messages;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.version);
        dest.writeTypedList(this.messages);
    }

    public static final Creator<WhatsNewModel> CREATOR = new Creator<WhatsNewModel>() {
        @Override
        public WhatsNewModel createFromParcel(Parcel source) {
            return new WhatsNewModel(source);
        }

        @Override
        public WhatsNewModel[] newArray(int size) {
            return new WhatsNewModel[size];
        }
    };
}


text:
import loginComponent from './login.component';

let loginModule = angular.module('login', [
])

.config(($stateProvider, $urlRouterProvider) => {
  "ngInject";

  $stateProvider
    .state('login', {
      url: '/login',
      template: '<login></login>'
    });
})

.component('login', loginComponent);

export default loginModule;


text:
set -eo errtrace

usage() {
  cat <<EOF
Usage:
  $0 --boot BOOT --init_boot INIT_BOOT --version {3,4} -o OUTPUT
  $0 --boot BOOT --init_boot INIT_BOOT --vendor_boot VENDOR_BOOT --version 2 -o OUTPUT

Options:
  --boot FILE
    Path to the generic boot image.
  --init_boot FILE
    Path to the generic init_boot image.
  --vendor_boot FILE
    Path to the vendor boot image.
  --version {2,3,4}
    Boot image header version to retrofit to.
  -o, --output FILE
    Path to the output boot image.
  -v, --verbose
    Show debug messages.
  -h, --help, --usage
    Show this help message.
EOF
}

die() {
  echo >&2 "ERROR:" "${@}"
  exit 1
}

file_size() {
  stat -c '%s' "$1"
}

get_arg() {
  local arg="$1"
  shift
  while [[ "$#" -gt 0 ]]; do
    if [[ "$1" == "${arg}" ]]; then
      shift
      echo "$1"
      return
    fi
    shift
  done
}

TEMP_DIR="$(mktemp -d --tmpdir retrofit_gki.XXXXXXXX)"
readonly TEMP_DIR

exit_handler() {
  readonly EXIT_CODE="$?"
  rm -rf "${TEMP_DIR}" ||:
  exit "${EXIT_CODE}"
}

trap exit_handler EXIT
trap 'die "line ${LINENO}, ${FUNCNAME:-<main>}(): \"${BASH_COMMAND}\" returned \"$?\"" ' ERR

while [[ "$1" =~ ^- ]]; do
  case "$1" in
    --boot )
      shift
      BOOT_IMAGE="$1"
      ;;
    --init_boot )
      shift
      INIT_BOOT_IMAGE="$1"
      ;;
    --vendor_boot )
      shift
      VENDOR_BOOT_IMAGE="$1"
      ;;
    --version )
      shift
      OUTPUT_BOOT_IMAGE_VERSION="$1"
      ;;
    -o | --output )
      shift
      OUTPUT_BOOT_IMAGE="$1"
      ;;
    -v | --verbose )
      VERBOSE=true
      ;;
    -- )
      shift
      break
      ;;
    -h | --help | --usage )
      usage
      exit 0
      ;;
    * )
      echo >&2 "Unexpected flag: '$1'"
      usage >&2
      exit 1
      ;;
  esac
  shift
done

declare -ir OUTPUT_BOOT_IMAGE_VERSION
readonly BOOT_IMAGE
readonly INIT_BOOT_IMAGE
readonly VENDOR_BOOT_IMAGE
readonly OUTPUT_BOOT_IMAGE
readonly VERBOSE

# Make sure the input arguments make sense.
[[ -f "${BOOT_IMAGE}" ]] ||
  die "argument '--boot': not a regular file: '${BOOT_IMAGE}'"
[[ -f "${INIT_BOOT_IMAGE}" ]] ||
  die "argument '--init_boot': not a regular file: '${INIT_BOOT_IMAGE}'"
if [[ "${OUTPUT_BOOT_IMAGE_VERSION}" -lt 2 ]] || [[ "${OUTPUT_BOOT_IMAGE_VERSION}" -gt 4 ]]; then
  die "argument '--version': valid choices are {2, 3, 4}"
elif [[ "${OUTPUT_BOOT_IMAGE_VERSION}" -eq 2 ]]; then
  [[ -f "${VENDOR_BOOT_IMAGE}" ]] ||
    die "argument '--vendor_boot': not a regular file: '${VENDOR_BOOT_IMAGE}'"
fi
[[ -z "${OUTPUT_BOOT_IMAGE}" ]] &&
  die "argument '--output': cannot be empty"

readonly BOOT_IMAGE_WITHOUT_AVB_FOOTER="${TEMP_DIR}/boot.img.without_avb_footer"
readonly BOOT_DIR="${TEMP_DIR}/boot"
readonly INIT_BOOT_DIR="${TEMP_DIR}/init_boot"
readonly VENDOR_BOOT_DIR="${TEMP_DIR}/vendor_boot"
readonly VENDOR_BOOT_MKBOOTIMG_ARGS="${TEMP_DIR}/vendor_boot.mkbootimg_args"
readonly OUTPUT_RAMDISK="${TEMP_DIR}/out.ramdisk"
readonly OUTPUT_BOOT_SIGNATURE="${TEMP_DIR}/out.boot_signature"

readonly AVBTOOL="${AVBTOOL:-avbtool}"
readonly MKBOOTIMG="${MKBOOTIMG:-mkbootimg}"
readonly UNPACK_BOOTIMG="${UNPACK_BOOTIMG:-unpack_bootimg}"

# Fixed boot signature size for easy discovery in VTS.
readonly BOOT_SIGNATURE_SIZE=$(( 16 << 10 ))

#
# Preparations are done. Now begin the actual work.
#

# Copy the boot image because `avbtool erase_footer` edits the file in-place.
cp "${BOOT_IMAGE}" "${BOOT_IMAGE_WITHOUT_AVB_FOOTER}"
( [[ -n "${VERBOSE}" ]] && set -x
  "${AVBTOOL}" erase_footer --image "${BOOT_IMAGE_WITHOUT_AVB_FOOTER}" 2>/dev/null ||:
  tail -c "${BOOT_SIGNATURE_SIZE}" "${BOOT_IMAGE_WITHOUT_AVB_FOOTER}" > "${OUTPUT_BOOT_SIGNATURE}"
  "${UNPACK_BOOTIMG}" --boot_img "${BOOT_IMAGE}" --out "${BOOT_DIR}" >/dev/null
  "${UNPACK_BOOTIMG}" --boot_img "${INIT_BOOT_IMAGE}" --out "${INIT_BOOT_DIR}" >/dev/null
)
if [[ "$(file_size "${OUTPUT_BOOT_SIGNATURE}")" -ne "${BOOT_SIGNATURE_SIZE}" ]]; then
  die "boot signature size must be equal to ${BOOT_SIGNATURE_SIZE}"
fi

declare -a mkbootimg_args=()

if [[ "${OUTPUT_BOOT_IMAGE_VERSION}" -eq 4 ]]; then
  mkbootimg_args+=( \
    --header_version 4 \
    --kernel "${BOOT_DIR}/kernel" \
    --ramdisk "${INIT_BOOT_DIR}/ramdisk" \
  )
elif [[ "${OUTPUT_BOOT_IMAGE_VERSION}" -eq 3 ]]; then
  mkbootimg_args+=( \
    --header_version 3 \
    --kernel "${BOOT_DIR}/kernel" \
    --ramdisk "${INIT_BOOT_DIR}/ramdisk" \
  )
elif [[ "${OUTPUT_BOOT_IMAGE_VERSION}" -eq 2 ]]; then
  ( [[ -n "${VERBOSE}" ]] && set -x
    "${UNPACK_BOOTIMG}" --boot_img "${VENDOR_BOOT_IMAGE}" --out "${VENDOR_BOOT_DIR}" \
      --format=mkbootimg -0 > "${VENDOR_BOOT_MKBOOTIMG_ARGS}"
    cat "${VENDOR_BOOT_DIR}/vendor_ramdisk" "${INIT_BOOT_DIR}/ramdisk" > "${OUTPUT_RAMDISK}"
  )

  declare -a vendor_boot_args=()
  while IFS= read -r -d '' ARG; do
    vendor_boot_args+=("${ARG}")
  done < "${VENDOR_BOOT_MKBOOTIMG_ARGS}"

  pagesize="$(get_arg --pagesize "${vendor_boot_args[@]}")"
  kernel_offset="$(get_arg --kernel_offset "${vendor_boot_args[@]}")"
  ramdisk_offset="$(get_arg --ramdisk_offset "${vendor_boot_args[@]}")"
  tags_offset="$(get_arg --tags_offset "${vendor_boot_args[@]}")"
  dtb_offset="$(get_arg --dtb_offset "${vendor_boot_args[@]}")"
  kernel_cmdline="$(get_arg --vendor_cmdline "${vendor_boot_args[@]}")"

  mkbootimg_args+=( \
    --header_version 2 \
    --base 0 \
    --kernel_offset "${kernel_offset}" \
    --ramdisk_offset "${ramdisk_offset}" \
    --second_offset 0 \
    --tags_offset "${tags_offset}" \
    --dtb_offset "${dtb_offset}" \
    --cmdline "${kernel_cmdline}" \
    --pagesize "${pagesize}" \
    --kernel "${BOOT_DIR}/kernel" \
    --ramdisk "${OUTPUT_RAMDISK}" \
  )
  if [[ -f "${VENDOR_BOOT_DIR}/dtb" ]]; then
    mkbootimg_args+=(--dtb "${VENDOR_BOOT_DIR}/dtb")
  fi
fi

( [[ -n "${VERBOSE}" ]] && set -x
  "${MKBOOTIMG}" "${mkbootimg_args[@]}" --output "${OUTPUT_BOOT_IMAGE}"
  cat "${OUTPUT_BOOT_SIGNATURE}" >> "${OUTPUT_BOOT_IMAGE}"
)


text:
<?php
/**
 * Synga Inheritance Finder
 * @author      Roy Pouls
 * @copytright  2016 Roy Pouls / Synga (http://www.synga.nl)
 * @license     http://www.opensource.org/licenses/mit-license.php MIT
 * @link        https://github.com/synga-nl/inheritance-finder
 */

namespace Synga\InheritanceFinder;

/**
 * Class InheritanceFinder
 * @package Synga\InheritanceFinder
 */
class InheritanceFinder implements InheritanceFinderInterface
{
    /**
     * @var CacheBuilderInterface
     */
    private $cacheBuilder;

    /**
     * @var PhpClass[]
     */
    private $localCache = [];

    /**
     * InheritanceFinder constructor.
     * @param CacheBuilderInterface $cacheBuilder
     */
    public function __construct(CacheBuilderInterface $cacheBuilder) {
        $this->cacheBuilder = $cacheBuilder;
    }

    /**
     * Finds a $class file
     *
     * @param $class
     * @return PhpClass
     */
    public function findClass($class) {
        $this->init();

        $fullQualifiedNamespace = $this->trimNamespace($class);

        foreach ($this->localCache as $phpClass) {
            if ($fullQualifiedNamespace === $phpClass->getFullQualifiedNamespace()) {
                return $phpClass;
            }
        }

        return false;
    }

    /**
     * Finds all classes which extend $class
     *
     * @param $class
     * @return PhpClass[]
     */
    public function findExtends($class) {
        $this->init();

        $fullQualifiedNamespace = $this->trimNamespace($class);

        $phpClasses = [];

        foreach ($this->localCache as $phpClass) {
            if ($fullQualifiedNamespace === $phpClass->getExtends()) {
                $phpClasses[] = $phpClass;
                $phpClasses   = array_merge($phpClasses, $this->findExtends($phpClass->getFullQualifiedNamespace()));
            }
        }

        return $this->arrayUniqueObject($phpClasses);
    }

    /**
     * Finds all classes which impelements $interface
     *
     * @param $interface
     * @return PhpClass[]
     */
    public function findImplements($interface) {
        $this->init();

        return $this->findImplementsOrTraitUse($interface, 'implements');
    }

    /**
     * Finds all classes which use $trait
     *
     * @param $trait
     * @return PhpClass[]
     */
    public function findTraitUse($trait) {
        $this->init();

        return $this->findImplementsOrTraitUse($trait, 'traits');
    }

    /**
     * Checks if $child is in the lineage of $parent
     *
     * @param $child
     * @param $parent
     * @return mixed
     */
    public function isSubclassOf($child, $parent) {
        try {
            return is_subclass_of($child, $parent);
        } catch (\Exception $e) {
            return false;
        }
    }

    /**
     * Can find multiple classes at once.
     *
     * @param array $classes
     * @param array $interfaces
     * @param array $traits
     * @return PhpClass[]
     */
    public function findMultiple($classes = [], $interfaces = [], $traits = []) {
        $this->init();

        $classes    = $this->normalizeArray($classes);
        $interfaces = $this->normalizeArray($interfaces);
        $traits     = $this->normalizeArray($traits);

        $foundClasses = [];

        if ($classes !== false) {
            foreach ($classes as $class) {
                $foundClasses = array_merge($foundClasses, $this->findExtends($class));
            }
        }

        if ($interfaces !== false) {
            foreach ($interfaces as $interface) {
                $foundClasses = array_merge($foundClasses, $this->findImplements($interface));
            }
        }

        if ($traits !== false) {
            foreach ($traits as $trait) {
                $foundClasses = array_merge($foundClasses, $this->findTraitUse($trait));
            }
        }

        return $this->arrayUniqueObject($foundClasses);
    }

    /**
     * Can find implements or detect trait use
     *
     * @param $fullQualifiedNamespace
     * @param $type
     * @return PhpClass[]
     */
    protected function findImplementsOrTraitUse($fullQualifiedNamespace, $type) {
        $fullQualifiedNamespace = $this->trimNamespace($fullQualifiedNamespace);

        $phpClasses = [];

        $method = 'get' . ucfirst($type);

        foreach ($this->localCache as $phpClass) {
            $implementsOrTrait = $phpClass->$method();
            if (is_array($implementsOrTrait) && in_array($fullQualifiedNamespace, $implementsOrTrait)) {
                $phpClasses[] = $phpClass;
                $phpClasses   = array_merge($phpClasses, $this->findExtends($phpClass->getFullQualifiedNamespace()));
            }
        }

        return $this->arrayUniqueObject($phpClasses);
    }

    /**
     * Makes an array of object unique using the spl_object_hash function
     *
     * @param $phpClasses
     * @return array
     */
    protected function arrayUniqueObject($phpClasses) {
        $hashes = [];

        foreach ($phpClasses as $key => $phpClass) {
            $hashes[$key] = spl_object_hash($phpClass);
        }

        $hashes = array_unique($hashes);

        $uniqueArray = [];

        foreach ($hashes as $key => $hash) {
            $uniqueArray[$key] = $phpClasses[$key];
        }

        return $uniqueArray;
    }

    /**
     * Chcecks if var $array is a string, if so, create an array with that string otherwise return the array. If we
     * couldn't create an array it returns false.
     *
     * @param $array
     * @return array|bool
     */
    protected function normalizeArray($array) {
        if (is_string($array)) {
            $array = [$array];
        }

        if (!is_array($array)) {
            return false;
        }

        return $array;
    }

    /**
     * Loads the cache so we can use it in all the "find" methods
     */
    protected function init() {
        if (empty($this->localCache)) {
            $this->localCache = $this->cacheBuilder->getCache();
        }
    }

    /**
     * Trims the first "\" which is copied default by PhpStorm (copy reference)
     *
     * @param $class
     * @return string
     */
    protected function trimNamespace($class) {
        return ltrim($class, '\\');
    }
}


text:
@interface KSBasicMapAnnotation : NSObject<MKAnnotation>

@property (nonatomic, assign) CLLocationCoordinate2D coordinate;
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *subtitle;

+ (instancetype)annotationWithCoordinate:(CLLocationCoordinate2D)coordinate title:(NSString *)title subtitle:(NSString *)subtitle;
- (instancetype)initWithCoordinate:(CLLocationCoordinate2D)coordinate title:(NSString *)title subtitle:(NSString *)subtitle;

@end


text:
namespace ui {
namespace test {

constexpr double kEpsilon = 0.0001;

// Base class for predictor unit tests
class InputFilterTest : public testing::Test {
 public:
  InputFilterTest();

  InputFilterTest(const InputFilterTest&) = delete;
  InputFilterTest& operator=(const InputFilterTest&) = delete;

  ~InputFilterTest() override;

  void TestCloneFilter();

  void TestResetFilter();

 protected:
  std::unique_ptr<InputFilter> filter_;
};

}  // namespace test
}  // namespace ui

#endif  // UI_BASE_PREDICTION_INPUT_FILTER_UNITTEST_HELPERS_H_


text:
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

# Check If You Are Root
if [ $(id -u) != "0" ]; then
    clear
    echo -e "\033[31m Error: You must be root to run this script! \033[0m"
    exit 1
fi

yum update -y
yum install -y epel-release
yum install -y libnet libnet-devel libpcap libpcap-devel gcc

wget https://github.com/1cswd/net-speeder/archive/master.zip&&unzip ./master.zip
rm -rf ./master.zip
cd net-speeder-master
if [ -f /proc/user_beancounters ] || [ -d /proc/bc ]; then
    sh build.sh -DCOOKED
    INTERFACE=venet0
else
    sh build.sh
    INTERFACE=eth0
fi

mkdir -p /usr/local/net_speeder
cp -Rf net_speeder /usr/local/net_speeder
rm -rf ./net-speeder-master

if [ -f /proc/user_beancounters ] || [ -d /proc/bc ]; then
    nohup /usr/local/net_speeder/net_speeder venet0 "ip" >/dev/null 2>&1 &
else
    nohup /usr/local/net_speeder/net_speeder eth0 "ip" >/dev/null 2>&1 &
fi

echo -e "\033[36m net_speeder installed. \033[0m"
echo -e "\033[36m Producted by 1cswd[1cswd.com]. \033[0m"
echo -e "\033[36m Usage: nohup /usr/local/net_speeder/net_speeder $INTERFACE \"ip\" >/dev/null 2>&1 & \033[0m"


text:
@implementation UIBarButtonItem (NNUtils)

/// アニメーションの有無を選べる setTitle
-(void)setTitle:(NSString *)title animated:(BOOL)animated{
	if( animated ){
		[self setTitle:title];
	} else {
		[UIView setAnimationsEnabled:NO];
		[self setTitle:title];
		[UIView setAnimationsEnabled:YES];
	}
}

@end


text:
<?php

namespace Symfony\Component\DependencyInjection;

/**
 * ContainerAwareInterface should be implemented by classes that depends on a Container.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 */
interface ContainerAwareInterface
{
    /**
     * Sets the container.
     */
    public function setContainer(ContainerInterface $container = null);
}


text:
SCRIPTPATH=$( cd "$(dirname "$0")" ; cd .. ; pwd -P )

# Move if exists, otherwise just silently fail
mv $HOME/.bashrc{,-$(date +%F-%T).robr3rd-dotfiles.bak} 2>/dev/null
mv $HOME/.bash_aliases{,-$(date +%F-%T).robr3rd-dotfiles.bak} 2>/dev/null
mv $HOME/.git-completion.bash{,-$(date +%F-%T).robr3rd-dotfiles.bak} 2>/dev/null
mv $HOME/.completion-wrapper.sh{,-$(date +%F-%T).robr3rd-dotfiles.bak} 2>/dev/null

mv $HOME/.tmux.conf{,-$(date +%F-%T).robr3rd-dotfiles.bak} 2>/dev/null

# Commence installation!
cp {$SCRIPTPATH/shared/,$HOME/}.bashrc
cp {$SCRIPTPATH/shared/,$HOME/}.git-completion.bash
cp {$SCRIPTPATH/shared/,$HOME/}.completion-wrapper.sh
# Concatenate for platform-specific differences
cat $SCRIPTPATH/{shared/,linux/}.bash_aliases > $HOME/.bash_aliases

cp {$SCRIPTPATH/shared/,$HOME/}.tmux.conf


text:
AFRAME.registerComponent('contentful', {
    schema: {
        spaceID: {type: 'string', required: true},
        accessToken: {type: 'string', required: true},
        container: {type: 'selector', required: true}
    },

    init: function() {

        console.log('Contentful: ',contentful);

        this.client = contentful.createClient({
            // This is the space ID. A space is like a project folder in Contentful terms
            space: this.data.spaceID,
            // This is the access token for this space. Normally you get both ID and the token in the Contentful web app
            accessToken: this.data.accessToken
        });

        console.log('Client: ',this.client);

        console.log('\nWelcome to the Contentful JS Boilerplate\n');
        console.log('This is a simplified example to demonstrate the usage of the Contentful CDA\n');

        this.runBoilerplate();

    },

    // Entry point of the boilerplate, called at the end.
    runBoilerplate: function() {
        this.displayContentTypes()
            .then(function(contentTypes){
                this.fetchBook('2oPiRg4wnSgMc8ISOWAa2Q').then(function(entry){
                    var html;

                    console.log('Book: ',entry);

                    //html += '
'+entry.fields.title+'
'+entry.fields.pages.items[0].fields.body;
                    //table.push([entry.sys.id, entry.fields[contentType.displayField] || '[empty]'])

                    console.log('Inserting html: ',html);

                    console.log('Container el: ',this.data.container);

                    this.data.container.innerHTML = html;
                }.bind(this));
            }.bind(this))
            .then(function(){
                console.log('Want to go further? Feel free to check out this guide:');
                console.log('https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/\n')
            });
            /*.catch(function(error) {
                console.info('\nError occurred:');
                if (error.stack) {
                    console.error(error.stack);
                    return
                }else{
                    console.error(error);
                }

            });*/
    },

    displayContentTypes: function() {
        console.log('Fetching and displaying Content Types ...');

        return this.fetchContentTypes()
            .then(function(contentTypes){

                // Display a table with Content Type information
                /*const table = new Table({
                    head: ['Id', 'Title', 'Fields']
                })*/
                contentTypes.forEach(function(contentType){
                    const fieldNames = contentType.fields
                        .map(function(field){ return field.name })
                        .sort();

                        //table.push([contentType.sys.id, contentType.name, fieldNames.join(', ')])
                });
                console.log(table.toString());

                return contentTypes;
            })
    },

    displayEntries: function(contentTypes) {
        console.log('Fetching and displaying Entries ...');

        console.log('This: ',this);

        return Promise.all(contentTypes.map(function(contentType){

            console.log('This2: ',this);

            return this.fetchEntriesForContentType(contentType)
                .then(function(entries){
                    console.log('\nThese are the first 100 Entries for Content Type '+contentType.name+':\n');

                    // Display a table with Entry information
                    /*const table = new Table({
                        head: ['Id', 'Title']
                    })*/

                    var html = '';

                    entries.forEach(function(entry){

                        console.log(entry);

                        console.log('Contenttype: ',contentType);

                        console.log('Fields: ',contentType);

                        html += '
'+entry.fields[contentType.displayField]+'
'+entry.fields['body'];
                        //table.push([entry.sys.id, entry.fields[contentType.displayField] || '[empty]'])
                    });

                    console.log('Inserting html: ',html);

                    console.log('Container el: ',this.data.container);

                    this.data.container.innerHTML = html;

                    //console.log(table.toString())
                }.bind(this))
        }.bind(this)));
    },

    // Load all Content Types in your space from Contentful
    fetchContentTypes: function () {
        return this.client.getContentTypes()
            .then(function(response){ return response.items })
            .catch(function(error){
                console.info('\nError occurred while fetching Content Types:');
                console.error(error)
            });
    },

    // Load all entries for a given Content Type from Contentful
    fetchEntriesForContentType: function (contentType) {
        return this.client.getEntries({
                content_type: contentType.sys.id
            })
            .then(function(response){ return response.items })
            .catch(function(error){
                console.log('\nError occurred while fetching Entries for '+contentType.name+':\n');
                console.error(error)
            });
    },

    fetchBook: function (bookID) {
        return this.client.getEntries({'sys.id': bookID})
            .then(function(response){ return response.items[0] })
            .catch(function(error){
                console.log('\nError occurred while fetching Entries for '+contentType.name+':\n');
                console.error(error)
            });
    },

    tick: function() {

    }
});


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edacc.properties;

import edacc.model.ComputationMethodDAO;
import edacc.model.ComputationMethodDoesNotExistException;
import edacc.model.DatabaseConnector;
import edacc.model.ExperimentResult;
import edacc.model.ExperimentResultDAO;
import edacc.model.ExperimentResultHasProperty;
import edacc.model.ExperimentResultHasPropertyDAO;
import edacc.model.ExperimentResultNotInDBException;
import edacc.model.InstanceDAO;
import edacc.model.InstanceHasProperty;
import edacc.model.InstanceHasPropertyDAO;
import edacc.model.InstanceNotInDBException;
import edacc.model.NoConnectionToDBException;
import edacc.model.Property;
import edacc.model.PropertyDAO;
import edacc.model.PropertyNotInDBException;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.ObjectOutputStream;
import java.io.OutputStreamWriter;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
import java.net.URLClassLoader;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author rretz
 * @author dgall
 */
public class PropertyComputationUnit implements Runnable {

    private ExperimentResultHasProperty erhp;
    private InstanceHasProperty ihp;
    private PropertyComputationController callback;
    private Property property;
    /**
     * Defines the maximum time the unit will wait for a value of an external program (in millis).
     * default: 10 sec
     */
    private static final int MAX_WAIT_TIME = 10000;

    PropertyComputationUnit(ExperimentResultHasProperty erhp, PropertyComputationController callback) {
        this.property = erhp.getProperty();
        this.erhp = erhp;
        this.callback = callback;
    }

    PropertyComputationUnit(InstanceHasProperty ihp, PropertyComputationController callback) {
        this.ihp = ihp;
        this.callback = callback;
        this.property = ihp.getProperty();
    }

    @Override
    public void run() {
        if (erhp != null) {
            try {
                Property property = erhp.getProperty();
                switch (property.getPropertySource()) {
                    case LauncherOutput:
                        compute(ExperimentResultDAO.getLauncherOutput(erhp.getExpResult()).getBinaryStream());
                        break;
                    case SolverOutput:
                        compute(ExperimentResultDAO.getSolverOutput(erhp.getExpResult()).getBinaryStream());
                        break;
                    case VerifierOutput:
                        compute(ExperimentResultDAO.getVerifierOutput(erhp.getExpResult()).getBinaryStream());
                        break;
                    case WatcherOutput:
                        compute(ExperimentResultDAO.getWatcherOutput(erhp.getExpResult()).getBinaryStream());
                        break;
                }
            } catch (NoConnectionToDBException ex) {
                Logger.getLogger(PropertyComputationUnit.class.getName()).log(Level.SEVERE, null, ex);
            } catch (FileNotFoundException ex) {
                Logger.getLogger(PropertyComputationUnit.class.getName()).log(Level.SEVERE, null, ex);
            } catch (IOException ex) {
                Logger.getLogger(PropertyComputationUnit.class.getName()).log(Level.SEVERE, null, ex);
            } catch (ExperimentResultNotInDBException ex) {
                Logger.getLogger(PropertyComputationUnit.class.getName()).log(Level.SEVERE, null, ex);
            } catch (InstanceNotInDBException ex) {
                Logger.getLogger(PropertyComputationUnit.class.getName()).log(Level.SEVERE, null, ex);
            } catch (ComputationMethodDoesNotExistException ex) {
                Logger.getLogger(PropertyComputationUnit.class.getName()).log(Level.SEVERE, null, ex);
            } catch (ErrorInExternalProgramException ex) {
                Logger.getLogger(PropertyComputationUnit.class.getName()).log(Level.SEVERE, null, ex);
            } catch (SQLException ex) {
                Logger.getLogger(PropertyComputationUnit.class.getName()).log(Level.SEVERE, null, ex);
            } catch (Exception ex) {
                Logger.getLogger(PropertyComputationUnit.class.getName()).log(Level.SEVERE, null, ex);
                callback.exceptionCausedByThread(ex);
            }
        } else if (ihp != null) {
            try {
                switch (property.getPropertySource()) {
                    case Instance:
                        try {
                            InputStream inputStream = InstanceDAO.getBinary(ihp.getInstance());
                            compute(inputStream);
                            inputStream.close();
                        } catch (InstanceNotInDBException ex) {
                            Logger.getLogger(PropertyComputationUnit.class.getName()).log(Level.SEVERE, null, ex);
                        }
                        break;
                    case InstanceName:
                        parseInstanceName();
                        break;
                    case ExperimentResults:
                        computeFromExperimentResults();
                        break;
                    case InstanceComputationMethod:
                        computeFromInstanceComputationMethod();
                        break;
                }
            } catch (NoConnectionToDBException ex) {
                Logger.getLogger(PropertyComputationUnit.class.getName()).log(Level.SEVERE, null, ex);
            } catch (FileNotFoundException ex) {
                Logger.getLogger(PropertyComputationUnit.class.getName()).log(Level.SEVERE, null, ex);
            } catch (IOException ex) {
                Logger.getLogger(PropertyComputationUnit.class.getName()).log(Level.SEVERE, null, ex);
            } catch (InstanceNotInDBException ex) {
                Logger.getLogger(PropertyComputationUnit.class.getName()).log(Level.SEVERE, null, ex);
            } catch (ComputationMethodDoesNotExistException ex) {
                Logger.getLogger(PropertyComputationUnit.class.getName()).log(Level.SEVERE, null, ex);
            } catch (ErrorInExternalProgramException ex) {
                Logger.getLogger(PropertyComputationUnit.class.getName()).log(Level.SEVERE, null, ex);
            } catch (SQLException ex) {
                Logger.getLogger(PropertyComputationUnit.class.getName()).log(Level.SEVERE, null, ex);
            } catch (Exception ex) {
                callback.exceptionCausedByThread(ex);
            }
        }
        callback.callback();
    }
    public static final Object sync = new Object();

    private void computeFromInstanceComputationMethod() throws NoConnectionToDBException, SQLException, ComputationMethodDoesNotExistException, FileNotFoundException, IOException, InstanceNotInDBException, ErrorInExternalProgramException, ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
        if (ihp == null) {
            // only instance properties can be computed from instance computation method
            return;
        }
        File classFile;
        synchronized (sync) {
            classFile = ComputationMethodDAO.getBinaryOfComputationMethod(property.getComputationMethod());
        }
        File nClassFile = new File(new File(classFile.getParentFile(), "edacc"), "properties");
        nClassFile.mkdirs();
        nClassFile = new File(nClassFile, classFile.getName());
        classFile.renameTo(nClassFile);
        ClassLoader cl = new URLClassLoader(new URL[]{classFile.getParentFile().toURI().toURL()},
                InstanceComputationMethod.class.getClassLoader());
        Class<?> clazz = cl.loadClass("edacc.properties." + classFile.getName().substring(0,
                            classFile.getName().length() - 6).replace('/', '.'));
        String[] args = property.getComputationMethodParameters().split(" ");
        InstanceComputationMethod method = (InstanceComputationMethod) clazz.getConstructor(new Class[] {String[].class}).newInstance(new Object[] {args});
        String value = "";
        try {
            value = method.calculateProperty(ihp.getInstance().getId());
        } catch (Exception ex) {
            // TODO: error
            ex.printStackTrace();
        }
        System.out.println("Value: " + value);
        // set the value and save it
        ihp.setValue(value);
        InstanceHasPropertyDAO.save(ihp);
    }

    private void computeFromExperimentResults() throws NoConnectionToDBException, SQLException, ComputationMethodDoesNotExistException, FileNotFoundException, IOException, InstanceNotInDBException, ErrorInExternalProgramException {
        if (ihp == null) {
            // only instance properties can be computed from experiment results
            return;
        }
        File bin;
        synchronized (sync) {
            bin = ComputationMethodDAO.getBinaryOfComputationMethod(property.getComputationMethod());
            bin.setExecutable(true);
        }
        System.out.println("java -jar " + bin.getAbsolutePath() + " " + property.getComputationMethodParameters());
        // only java files, we pipe objects :-)
        Process p = Runtime.getRuntime().exec("java -jar " + bin.getAbsolutePath() + " " + property.getComputationMethodParameters());

        // The std output stream of the external program (-> output of the program). We read the calculated value from this stream.
        BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
        // The error stream of the program
        BufferedReader err = new BufferedReader(new InputStreamReader(p.getErrorStream()));

        try {
            ArrayList<ExperimentResult> er = ExperimentResultDAO.getAllByInstanceId(ihp.getInstance().getId());
            System.out.println("found " + er.size() + " results for this instance");
            ObjectOutputStream os = new ObjectOutputStream(p.getOutputStream());
            os.writeUnshared(er);
            os.flush();
            os.close();
        } catch (Exception e) {
            // TODO: error
            e.printStackTrace();
        }

        // check, if already an error occured
        if (err.ready()) {
            String message = "";
            String line;
            while ((line = err.readLine()) != null) {
                message += line + '\n';
            }
            throw new ErrorInExternalProgramException(message);
        }
        // check, if program already has terminated
        try {
            int exit;
            if ((exit = p.exitValue()) != 0) {
                throw new ErrorInExternalProgramException("External program exited with errors! Exit value: " + exit);
            }
        } catch (IllegalThreadStateException e) {
            // do nothing if program is still running
        }

        long time = System.currentTimeMillis();
        while (System.currentTimeMillis() - time < MAX_WAIT_TIME && !in.ready()) {
            try {
                Thread.sleep(100);
            } catch (InterruptedException ex) {
                break;
            }
        }
        // if no value is available after waitng time, kill the program
        if (!in.ready()) {
            p.destroy();
            throw new ErrorInExternalProgramException("Time limit of external calculation exceeded! The external program has been terminated!");
        }
        // Read first line of program output
        String value = in.readLine();
        System.out.println("Value: " + value);
        // set the value and save it
        ihp.setValue(value);
        InstanceHasPropertyDAO.save(ihp);
    }

    private void compute(InputStream input) throws FileNotFoundException, IOException, SQLException, NoConnectionToDBException, InstanceNotInDBException, ComputationMethodDoesNotExistException, ErrorInExternalProgramException {
        if (input == null) {
            return;
        }
        if (property.getComputationMethod() != null) {

            // parse instance file (external program call)
            if (ihp != null) {
                File bin;
                synchronized (sync) {
                    bin = ComputationMethodDAO.getBinaryOfComputationMethod(property.getComputationMethod());
                }
                bin.setExecutable(true);
                String prefix = "";
                if (System.getProperty("os.name") != null && System.getProperty("os.name").contains("Windows")) {
                    prefix = "cmd /c ";
                }
                if (bin.getAbsolutePath().endsWith(".jar")) {
                    prefix += "java -jar ";
                }
                Process p = Runtime.getRuntime().exec(prefix + bin.getAbsolutePath() + " " + property.getComputationMethodParameters());

                InputStream is = input;
                InputStreamReader ir = new InputStreamReader(is);
                BufferedReader instanceReader = new BufferedReader(ir);
                // The std input stream of the external program. We pipe the content of the instance file into that stream
                BufferedWriter out = new BufferedWriter(new OutputStreamWriter(p.getOutputStream()));
                // The std output stream of the external program (-> output of the program). We read the calculated value from this stream.
                BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
                // The error stream of the program
                BufferedReader err = new BufferedReader(new InputStreamReader(p.getErrorStream()));

                // pipe the content of the instance file to the input of the external program
                try {
                    String s;
                    while ((s = instanceReader.readLine()) != null) {
                        out.write(s);
                        out.newLine();
                    }
                } catch (IOException e) {
                    // if a program stops reading from the stream, stop writing to it but show no error. //!Otherwise show an error message
                } finally {
                    // Close output stream, after whole instance file has been written to program input
                    try {
                        instanceReader.close();
                        ir.close();
                        is.close();
                        out.close();
                    } catch (Exception e) {
                    }
                }

                // check, if already an error occured
                if (err.ready()) {
                    in.close();
                    String error = err.readLine();
                    err.close();
                    throw new ErrorInExternalProgramException(error == null ? "unknown error" : error);
                }
                // check, if program already has terminated
                try {
                    int exit;
                    if ((exit = p.exitValue()) != 0) {
                        in.close();
                        err.close();
                        throw new ErrorInExternalProgramException("External program exited with errors! Exit value: " + exit);
                    }
                } catch (IllegalThreadStateException e) {
                    // do nothing if program is still running
                }

                /**
                 * Read the program output and save it as value of the property
                 * for the given instance.
                 * IMPORTANT!
                 * The value will be saved as a String in the DB and no
                 * conversion will be done!
                 * When loading the value from the DB, the method
                 * PropertyValueType.getJavaRepresentation(String) will be called
                 * on that value for the PropertyValueType of the property (so
                 * the String will be converted to the correct Java type).
                 */
                // wait some time till program output is available (maybe external program needs some time to calculate the property)
                long time = System.currentTimeMillis();
                while (System.currentTimeMillis() - time < MAX_WAIT_TIME && !in.ready()) {
                    try {
                        Thread.sleep(100);
                    } catch (InterruptedException ex) {
                        break;
                    }
                }
                // if no value is available after waitng time, kill the program
                if (!in.ready()) {
                    err.close();
                    in.close();
                    p.destroy();
                    throw new ErrorInExternalProgramException("Time limit of external calculation exceeded! The external program has been terminated!");
                }
                // Read first line of program output
                String value = in.readLine();

                // set the value and save it
                if (value.isEmpty()) {
                    value = null;
                }
                ihp.setValue(value);
                System.out.println(value);
                InstanceHasPropertyDAO.save(ihp);
                err.close();
                in.close();
            } else if (erhp != null) {
                File bin = ComputationMethodDAO.getBinaryOfComputationMethod(property.getComputationMethod());
                bin.setExecutable(true);
                Process p = Runtime.getRuntime().exec(bin.getAbsolutePath());
                BufferedReader outputFileReader = new BufferedReader(new InputStreamReader(input));
                // The std input stream of the external program. We pipe the content of the Blob b
                BufferedWriter out = new BufferedWriter(new OutputStreamWriter(p.getOutputStream()));
                // The std output stream of the external program (-> output of the program). We read the calculated value from this stream.
                BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));

                // pipe the content of the output file to the input of the external program
                try {
                    int i;
                    while ((i = outputFileReader.read()) != -1) {
                        out.write(i);
                    }
                } catch (IOException e) {
                    if (!e.getMessage().contains("Broken pipe")) {
                        throw e;
                    }
                }
                Vector<String> value = new Vector<String>();
                while (in.ready()) {
                    value.add(in.readLine());
                }
                erhp.setValue(value);
                ExperimentResultHasPropertyDAO.save(erhp);
            }
        } else if (property.getRegularExpression() != null) {
            Vector<String> res = new Vector<String>();
            InputStream is = input;
            InputStreamReader ir = new InputStreamReader(is);
            BufferedReader buf = new BufferedReader(ir);
            String tmp;
            Vector<String> toAdd = new Vector<String>();
            while ((tmp = buf.readLine()) != null) {
                if (!(toAdd = parse(tmp)).isEmpty()) {
                    res.addAll(toAdd);
                    if (!property.isMultiple() || ihp != null) {
                        break;
                    }
                }
            }
            if (ihp != null) {
                if (!res.isEmpty()) {
                    ihp.setValue(res.firstElement());
                    InstanceHasPropertyDAO.save(ihp);
                }

            } else if (erhp != null) {
                erhp.setValue(res);
                ExperimentResultHasPropertyDAO.save(erhp);
            }
            buf.close();
            ir.close();
            is.close();
        }
    }

    private Vector<String> parse(String toParse) {
        Vector<String> res = new Vector<String>();
        for (int i = 0; i < property.getRegularExpression().size(); i++) {
            Pattern pat = Pattern.compile(property.getRegularExpression().get(i));
            Matcher m = pat.matcher(toParse);
            while (m.find()) {
                res.add(m.group(1));
                if (!property.isMultiple() || ihp != null) {
                    return res;
                }
            }
        }
        return res;
    }

    private void parseInstanceName() {
        if (ihp != null) {
            Vector<String> res = parse(ihp.getInstance().getName());
            if (!res.isEmpty()) {
                ihp.setValue(res.firstElement());
                try {
                    InstanceHasPropertyDAO.save(ihp);
                } catch (SQLException ex) {
                    Logger.getLogger(PropertyComputationUnit.class.getName()).log(Level.SEVERE, null, ex);
                }
            }

        }

    }

    public static void main(String[] args) {
        try {
            DatabaseConnector.getInstance().connect("edacc.informatik.uni-ulm.de", 3306, "edacc", "EDACC2", "edaccteam", false, false, 1);

            PropertyComputationUnit unit = new PropertyComputationUnit(InstanceHasPropertyDAO.createInstanceHasInstanceProperty(InstanceDAO.getById(1), PropertyDAO.getById(1)), null);
            unit.compute(null);
        } catch (NoConnectionToDBException ex) {
            Logger.getLogger(PropertyComputationUnit.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(PropertyComputationUnit.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(PropertyComputationUnit.class.getName()).log(Level.SEVERE, null, ex);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}


text:
angular.module('olwLiDirective', ['ng'])

.directive('olwLi', [function() {
	return {
		replace: true,
		templateUrl: 'olwDirectives/olw-li.tpl.html'
	};
}]);


text:
using Checkout.ApiServices.Cards.ResponseModels;
using Checkout.ApiServices.Customers.RequestModels;
using Checkout.ApiServices.SharedModels;
using System;
using System.Collections.Generic;

namespace Checkout.ApiServices.Customers.ResponseModels
{
    public class Customer:BaseCustomer
    {
        public string Id { get; set; }
        public bool LiveMode { get; set; }
        public string Created { get; set; }
        public string DefaultCard { get; set; }
        public CustomerCard Cards { get; set; }

    }
}


text:
<?php

use yii\helpers\Url;
use yii\helpers\Html;

use app\components\GameBoard\assets\GameBoardAsset;

//
GameBoardAsset::register($this);

?>


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

    <title>Edit User</title>

    <form action="./edit_user" method="post">

            Name:
            <input type="text" class="form-control" id="name" placeholder="Enter Name" name="name">

            Email:
            <input type="text" class="form-control" id="email" placeholder="Enter Email" name="email">

            Country:
            <input type="text" class="form-control" id="country" placeholder="Enter Country" name="country">

            City:
            <input type="text" class="form-control" id="city" placeholder="Enter City" name="city">

        <button type="submit" class="btn btn-info">Confirm</button>

    </form>


text:
package org.apache.qpid.jms.transports.netty;

/**
 * Creates a Netty based SSL transport.
 */
public class NettySslTransportFactory extends NettyTcpTransportFactory {

    @Override
    public String getName() {
        return "SSL";
    }

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


text:
<?php

final class PHUITagExample extends PhabricatorUIExample {

  public function getName() {
    return 'Tags';
  }

  public function getDescription() {
    return hsprintf('Use <tt>PHUITagView</tt> to render various tags.');
  }

  public function renderExample() {
    $intro = array();

    $intro[] = 'Hey, ';
    $intro[] = id(new PHUITagView())
      ->setType(PHUITagView::TYPE_PERSON)
      ->setName('@alincoln')
      ->setHref('#');
    $intro[] = ' how is stuff?';
    $intro[] = hsprintf('

');

    $intro[] = 'Did you hear that ';
    $intro[] = id(new PHUITagView())
      ->setType(PHUITagView::TYPE_PERSON)
      ->setName('@gwashington')
      ->setDotColor(PHUITagView::COLOR_RED)
      ->setHref('#');
    $intro[] = ' is away, ';
    $intro[] = id(new PHUITagView())
      ->setType(PHUITagView::TYPE_PERSON)
      ->setName('@tjefferson')
      ->setDotColor(PHUITagView::COLOR_ORANGE)
      ->setHref('#');
    $intro[] = ' has some errands, and ';
    $intro[] = id(new PHUITagView())
      ->setType(PHUITagView::TYPE_PERSON)
      ->setName('@rreagan')
      ->setDotColor(PHUITagView::COLOR_GREY)
      ->setHref('#');
    $intro[] = ' is gone?';
    $intro[] = hsprintf('

');

    $intro[] = 'Take a look at ';
    $intro[] = id(new PHUITagView())
      ->setType(PHUITagView::TYPE_OBJECT)
      ->setName('D123')
      ->setHref('#');
    $intro[] = ' when you get a chance.';
    $intro[] = hsprintf('

');

    $intro[] = 'Hmm? ';
    $intro[] = id(new PHUITagView())
      ->setType(PHUITagView::TYPE_OBJECT)
      ->setName('D123')
      ->setClosed(true)
      ->setHref('#');
    $intro[] = ' is ';
    $intro[] = id(new PHUITagView())
      ->setType(PHUITagView::TYPE_STATE)
      ->setBackgroundColor(PHUITagView::COLOR_BLACK)
      ->setName('Abandoned');
    $intro[] = '.';
    $intro[] = hsprintf('

');

    $intro[] = 'I hope someone is going to ';
    $intro[] = id(new PHUITagView())
      ->setType(PHUITagView::TYPE_OBJECT)
      ->setName('T123: Water The Dog')
      ->setHref('#');
    $intro[] = ' -- that task is ';
    $intro[] = id(new PHUITagView())
      ->setType(PHUITagView::TYPE_STATE)
      ->setBackgroundColor(PHUITagView::COLOR_RED)
      ->setName('High Priority');
    $intro[] = '!';

    $intro = id(new PHUIBoxView())
      ->appendChild($intro)
      ->addPadding(PHUI::PADDING_LARGE);

    $header1 = id(new PHUIHeaderView())
      ->setHeader('Colors');

    $colors = PHUITagView::getColors();
    $tags = array();
    foreach ($colors as $color) {
      $tags[] = id(new PHUITagView())
        ->setType(PHUITagView::TYPE_STATE)
        ->setBackgroundColor($color)
        ->setName(ucwords($color));
      $tags[] = hsprintf('

');
    }

    $content1 = id(new PHUIBoxView())
      ->appendChild($tags)
      ->addPadding(PHUI::PADDING_LARGE);

    $tags = array();
    $tags[] = id(new PHUITagView())
      ->setType(PHUITagView::TYPE_STATE)
      ->setBackgroundColor(PHUITagView::COLOR_GREEN)
      ->setDotColor(PHUITagView::COLOR_RED)
      ->setName('Christmas');
    $tags[] = hsprintf('

');
    $tags[] = id(new PHUITagView())
      ->setType(PHUITagView::TYPE_OBJECT)
      ->setBackgroundColor(PHUITagView::COLOR_ORANGE)
      ->setDotColor(PHUITagView::COLOR_BLACK)
      ->setName('Halloween');
    $tags[] = hsprintf('

');
    $tags[] = id(new PHUITagView())
      ->setType(PHUITagView::TYPE_STATE)
      ->setBackgroundColor(PHUITagView::COLOR_INDIGO)
      ->setDotColor(PHUITagView::COLOR_YELLOW)
      ->setName('Easter');

    $content2 = id(new PHUIBoxView())
      ->appendChild($tags)
      ->addPadding(PHUI::PADDING_LARGE);

    $icons = array();
    $icons[] = id(new PHUITagView())
      ->setType(PHUITagView::TYPE_STATE)
      ->setBackgroundColor(PHUITagView::COLOR_GREEN)
      ->setIcon('fa-check white')
      ->setName('Passed');
    $icons[] = hsprintf('

');
    $icons[] = id(new PHUITagView())
      ->setType(PHUITagView::TYPE_STATE)
      ->setBackgroundColor(PHUITagView::COLOR_RED)
      ->setIcon('fa-times white')
      ->setName('Failed');
    $icons[] = hsprintf('

');
    $icons[] = id(new PHUITagView())
      ->setType(PHUITagView::TYPE_STATE)
      ->setBackgroundColor(PHUITagView::COLOR_BLUE)
      ->setIcon('fa-refresh white')
      ->setName('Running');
    $icons[] = hsprintf('

');
    $icons[] = id(new PHUITagView())
      ->setType(PHUITagView::TYPE_STATE)
      ->setBackgroundColor(PHUITagView::COLOR_GREY)
      ->setIcon('fa-pause white')
      ->setName('Paused');
    $icons[] = hsprintf('

');
    $icons[] = id(new PHUITagView())
      ->setType(PHUITagView::TYPE_STATE)
      ->setBackgroundColor(PHUITagView::COLOR_BLACK)
      ->setIcon('fa-stop white')
      ->setName('Stopped');

    $content3 = id(new PHUIBoxView())
      ->appendChild($icons)
      ->addPadding(PHUI::PADDING_LARGE);

    $shades = PHUITagView::getShades();
    $tags = array();
    foreach ($shades as $shade) {
      $tags[] = id(new PHUITagView())
        ->setType(PHUITagView::TYPE_OBJECT)
        ->setShade($shade)
        ->setIcon('fa-tags')
        ->setName(ucwords($shade))
        ->setHref('#');
      $tags[] = hsprintf(' ');
      $tags[] = id(new PHUITagView())
        ->setType(PHUITagView::TYPE_OBJECT)
        ->setShade($shade)
        ->setSlimShady(true)
        ->setIcon('fa-tags')
        ->setName(ucwords($shade))
        ->setHref('#');
      $tags[] = hsprintf('

');
    }

    $content4 = id(new PHUIBoxView())
      ->appendChild($tags)
      ->addPadding(PHUI::PADDING_LARGE);

    $box = id(new PHUIObjectBoxView())
      ->setHeaderText('Inline')
      ->appendChild($intro);

    $box1 = id(new PHUIObjectBoxView())
      ->setHeaderText('Colors')
      ->appendChild($content1);

    $box2 = id(new PHUIObjectBoxView())
      ->setHeaderText('Holidays')
      ->appendChild($content2);

    $box3 = id(new PHUIObjectBoxView())
      ->setHeaderText('Icons')
      ->appendChild($content3);

    $box4 = id(new PHUIObjectBoxView())
      ->setHeaderText('Shades')
      ->appendChild($content4);

    return array($box, $box1, $box2, $box3, $box4);
  }
}


text:
'use strict';

var expect = require('chai').expect;
var ActionsLogger = require('../src/logger');

describe('logger_test.js', function() {
  it("should display above that `foo` was called", function(){
    let object = { foo() { return "bar"; }, value: "value" }
    let decorated = ActionsLogger(object)
    decorated.value
    decorated.foo()
  })
})


text: A class to have nice scales checks subclasses


text:
package org.assertj.core.api.integer_;

import org.assertj.core.api.IntegerAssert;
import org.assertj.core.api.IntegerAssertBaseTest;
import org.assertj.core.data.Percentage;

import static org.assertj.core.data.Percentage.withPercentage;
import static org.mockito.Mockito.verify;

/**
 * Tests for <code>{@link IntegerAssert#isNotCloseTo(Integer, Percentage)}</code>.
 *
 * @author Chris Arnott
 */
public class IntegerAssert_isNotCloseToPercentage_integer_Test extends IntegerAssertBaseTest {

    private final Percentage percentage = withPercentage(5);
    private final Integer value = 10;

    @Override
    protected IntegerAssert invoke_api_method() {
        return assertions.isNotCloseTo(value, percentage);
    }

    @Override
    protected void verify_internal_effects() {
        verify(integers).assertIsNotCloseToPercentage(getInfo(assertions), getActual(assertions), value, percentage);
    }
}


text:
package com.cybage.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.util.UriComponentsBuilder;

import com.cybage.model.Category;
import com.cybage.model.Project;
import com.cybage.model.User;

import com.cybage.service.HomeService;

@org.springframework.web.bind.annotation.RestController
@RequestMapping("/home")
public class RestController
{
	@Autowired
	HomeService service;

	public RestController() {
		System.out.println("rest controller");
	}

	@RequestMapping(value = "/home")
	public String homepgae()
	{
		System.out.println("in Show Home");
		return "homepage";
	}

	@RequestMapping(value = "/list/categories", method = RequestMethod.GET)
	 public ResponseEntity<List<Category>> listAllCatgories()
		{
			System.out.println("List cat function");
	        List<Category> cList = service.getCategories();
	        for (Category cat : cList) {
				System.out.println(cat);
			}
	        if(cList.isEmpty()){
	            return new ResponseEntity<List<Category>>(HttpStatus.NO_CONTENT);//You many decide to return HttpStatus.NOT_FOUND
	        }
	        return new ResponseEntity<List<Category>>(cList, HttpStatus.OK);
	    }

	@RequestMapping(value = "/list/user", method = RequestMethod.GET)
    public ResponseEntity<List<User>> listAllUsers()
	{
		System.out.println("List cat function");
        List<User> uList = service.getUser();
        for (User cat : uList) {
			System.out.println(cat);
		}
        if(uList.isEmpty()){
            return new ResponseEntity<List<User>>(HttpStatus.NO_CONTENT);//You many decide to return HttpStatus.NOT_FOUND
        }
        return new ResponseEntity<List<User>>(uList, HttpStatus.OK);
    }

	@RequestMapping(value = "/newCategory", method = RequestMethod.POST)
    public ResponseEntity<Void> createUser(@RequestBody Category category,UriComponentsBuilder ucBuilder) {
        System.out.println("Creating Category " + category.getCategoryName());

        service.saveCategory(category);

        HttpHeaders headers = new HttpHeaders();
        return new ResponseEntity<Void>(headers, HttpStatus.CREATED);
    }

	@RequestMapping(value = "/newProject", method = RequestMethod.POST)
    public ResponseEntity<Void> createProject(@RequestBody Project project,UriComponentsBuilder ucBuilder) {
        //System.out.println("Creating Category " + category.getCategoryName());

        service.saveProject(project);

        HttpHeaders headers = new HttpHeaders();
        return new ResponseEntity<Void>(headers, HttpStatus.CREATED);
    }

	@RequestMapping(value = "/list/project", method = RequestMethod.GET)
	public ResponseEntity<List<Project>> listAllProjects()
	{
		System.out.println("List project function");
        List<Project> pList = service.getProject();
        for (Project cat : pList) {
			System.out.println(cat);
		}
        if(pList.isEmpty()){
            return new ResponseEntity<List<Project>>(HttpStatus.NO_CONTENT);//You many decide to return HttpStatus.NOT_FOUND
        }
        return new ResponseEntity<List<Project>>(pList, HttpStatus.OK);
	}

}


text:
<?php

namespace tests\units\JL\GlovoApi\Managers;

use mageekguy\atoum as Units;
use JL\GlovoApi\Managers\CustomersManager as TestedManager;
use JL\GlovoApi\HTTP\HttpResponse;

class CustomersManager extends Units\Test
{
    public function testGetCustomers()
    {
        $jsonString = '[{"id":15985,"urn":"glv:customer:fake","name":"fake-name","email":"fake-mail","passwordType":"BCRYPT","deviceUrn":null,"picture":null,"description":null,"deleted":false,"phoneNumber":null,"mediaSource":null,"mediaCampaign":null,"preferredLanguage":"en","sourceCompany":null,"sourceCompanyOrders":null,"paymentWay":"MONTHLY","paymentMethod":"BANK_TRANSFER","preferredCityCode":"BCN","os":null,"analyticsId":null,"sendInvoice":false,"enabled":true}]';
        $this->if($this->mockGenerator()->orphanize('__construct'))
            ->and($this->mockGenerator()->orphanize('getJsonAuthorized'))
            ->and($this->mockClass('\JL\GlovoApi\HTTP\HttpRequester', '\Mock'))
            ->and($httpRequesterMock = new \mock\HttpRequester())
            ->and($httpRequesterMock->getMockController()->getJsonAuthorized = new HttpResponse(200, 'OK', json_decode($jsonString, true)))
            ->and($object = new TestedManager($httpRequesterMock))
            ->when($customers = $object->getCustomers('fake-token'))
            ->then->array($customers)->size->isEqualTo(1)
            ->and->variable($customers[0]->urn())->isEqualTo('glv:customer:fake')
            ->and->variable($customers[0]->name())->isEqualTo('fake-name')
            ->and->variable($customers[0]->email())->isEqualTo('fake-mail');
        ;
    }
}


text:
import unittest, time, sys
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i

class Basic(unittest.TestCase):
    def tearDown(self):
        h2o.check_sandbox_for_errors()

    @classmethod
    def setUpClass(cls):
        localhost = h2o.decide_if_localhost()
        if (localhost):
            h2o.build_cloud(2)
        else:
            h2o_hosts.build_cloud_with_hosts()

    @classmethod
    def tearDownClass(cls):
        h2o.tear_down_cloud()

    def test_rf_1ktrees_fvec(self):
        h2o.beta_features = True
        SYNDATASETS_DIR = h2o.make_syn_dir()

        # always match the run below!
        # just using one file for now
        for x in [1000]:
            shCmdString = "perl " + h2o.find_file("syn_scripts/parity.pl") + " 128 4 "+ str(x) + " quad " + SYNDATASETS_DIR
            h2o.spawn_cmd_and_wait('parity.pl', shCmdString.split(),4)
            csvFilename = "parity_128_4_" + str(x) + "_quad.data"

        # always match the gen above!
        for trial in range (1,5):
            sys.stdout.write('.')
            sys.stdout.flush()

            csvFilename = "parity_128_4_" + str(1000) + "_quad.data"
            csvPathname = SYNDATASETS_DIR + '/' + csvFilename

            hex_key = csvFilename + "_" + str(trial) + ".hex"
            parseResult = h2o_cmd.parseResult = h2i.import_parse(path=csvPathname, schema='put', hex_key=hex_key, timeoutSecs=30)

            h2o.verboseprint("Trial", trial)
            start = time.time()
            h2o_cmd.runRF(parseResult=parseResult, trees=1000, max_depth=2, timeoutSecs=600, retryDelaySecs=3)
            print "RF #", trial,  "end on ", csvFilename, 'took', time.time() - start, 'seconds'

        print "Waiting 60 secs for TIME_WAIT sockets to go away"
        time.sleep(60)

if __name__ == '__main__':
    h2o.unit_main()


text:
package com.yahoo.sketches;

//import org.testng.Assert;
import org.testng.annotations.Test;

import com.yahoo.sketches.PowerLawGenerator.Pair;

/**
 * This provides sample code that generates tables of values that can be used for plotting or
 * other analytic computations. The first column is just the point number. The second column is
 * the generating index for the coordinate pair.  The third column represents the "X-axis" and the
 * last column represents the "Y-axis".  The first two columns are informational only.
 */
public class PowerLawGeneratorTest {

  //FIRST CODE EXAMPLE

  /**
   * Generate a table of (x,y) Pairs.

   * X varies from 1 to 2^20.

   * Y varies from 2^20 to 1.

   * The x-axis is log-base2.

   * The resolution is 2 points per power of 2.

   * Skip duplicate integers for the X-coordinate.
   */
  @Test
  public void testPLG() {
    Pair start = new Pair(1, 1<<20);
    Pair end = new Pair(1<<20, 1);
    double xLogBase = 2.0;
    int ptsPerXBase = 2;

    PowerLawGenerator plg = new PowerLawGenerator(xLogBase, ptsPerXBase, start, end);
    int numGenIdxs = plg.getNumGenIndices();
    int startGenIdx = plg.getStartGenIndex();
    int del = plg.getDelta();

    println("Slope: "+plg.getSlope());

    Pair cur = plg.getPair(startGenIdx);
    /*
     * The iteration variable "i" guarantees that no more than numGenIdxs are output.
     * Fewer than numGenIdxs may be output based on the user-configured skip method.
     * The iteration variable "gi" is the generating index and can subsequently increase or
     * decrease based on whether del == 1 or -1.
     * The iteration variable "row" just counts the actual output rows for convenience.
     */
    for (int i=1, gi=startGenIdx, row=1; i<=numGenIdxs; i++, gi += del) {
      if (gi != startGenIdx) {
        Pair next = plg.getPair(gi);
        if (skip(cur, next)) continue;
        cur = next;
      }
      outputPair(row++, gi, cur);
    }

  }

  /**
   * Returns true if the next Pair should be skipped. Change this function to the desired criteria.
   * @param cur the current Pair
   * @param next the next Pair
   * @return true to skip the next pair
   */
  private static boolean skip(Pair cur, Pair next) {
    return ((int)next.x == (int)cur.x);
  }

  /**
   * Place-holder for a plotting or other analysis function
   * @param row the row number (for convenience)
   * @param gi generating index (for convenience)
   * @param p the point Pair
   */
  private static void outputPair(int row, int gi, Pair p) {
    int x = (int)p.x;
    int y = (int)p.y;
    println(row+"\t"+gi+"\t"+x+"\t"+y);
  }

  // SECOND CODE EXAMPLE

  /**
   * Generate a series of equally spaced values for a log axis using static methods.

   * X varies from 1E9 to 10. (backwards)

   * The x-axis is log-base10.

   * The resolution is 5 points per power of 10.

   * Skip duplicate integers
   */
  @Test
  public void testPLG2() {
    Pair start = new Pair(1E9, 1); //Y is not used
    Pair end   = new Pair(10, 1);  //Y is not used
    double xLogBase = 10.0;
    int ptsPerXBase = 5;

    int numGenIdxs = PowerLawGenerator.getNumGenIndices(start, end, xLogBase, ptsPerXBase);
    int startGenIdx = PowerLawGenerator.getStartGenIndex(start, end, xLogBase, ptsPerXBase);
    int del = PowerLawGenerator.getDelta(start, end);

    double cur = PowerLawGenerator.getX(startGenIdx, xLogBase, ptsPerXBase);
    /*
     * The iteration variable "i" guarantees that no more than numGenIdxs are output.
     * Fewer than numGenIdxs may be output based on the user-configured skip method.
     * The iteration variable "gi" is the generating index and can subsequently increase or
     * decrease based on whether del == 1 or -1.
     * The iteration variable "row" just counts the actual output rows for convenience.
     */
    for (int i=1, gi=startGenIdx, row=1; i<=numGenIdxs; i++, gi += del) {
      if (gi != startGenIdx) {
        double next = PowerLawGenerator.getX(gi, xLogBase, ptsPerXBase);
        if (skip(cur, next)) continue;
        cur = next;
      }
      outputX(row++, gi, cur);
    }

  }

  /**
   * Returns true if cur == next. Change this function to the desired criteria.
   * @param cur the current value of x
   * @param next the next value of x
   * @return true if cur == next
   */
  private static boolean skip(double cur, double next) {
    return ((int)next == (int)cur);
  }

  /**
   * Place-holder for a plotting or other analysis function
   * @param row the row number (for convenience)
   * @param gi generating index (for convenience)
   * @param x the value x
   */
  private static void outputX(int row, int gi, double x) {
    println(row+"\t"+gi+"\t"+((int)x));
  }

  /**
   * @param s value to print
   */
  private static void println(String s) {
    //System.out.println(s); //disable here
  }

}


text:
<form class="formly" role="form">
	<formly-field ng-repeat="field in fields"
				  options="field"
				  form-result="result"
				  form-id="options.uniqueFormId"
				  ng-if="!field.hide"
				  index="$index">
	</formly-field>
	<div ng-transclude></div>
</form>


text:
'use strict';

describe('Directive: ngSymbiosis.utils', function(){

    describe('Filter: offset', function () {

        var offset;

        beforeEach(function () {

            module('ngSymbiosis.utils');

            inject(function ($filter) {
                offset = $filter('offset');
            });

        });

        it('should remove the number of items specified:"', function () {
            expect(offset('angularjs', 3)).toBe('ularjs');
            expect(offset([1, 2, 3, 4, 5, 6, 7], 3)).toEqual([4, 5, 6, 7]);
        });

    });

    describe('Service: dasherize', function () {

        var dasherize;

        beforeEach(function () {

            module('ngSymbiosis.utils');

            inject(function (_dasherize_) {
                dasherize = _dasherize_;
            });

        });

        it('should do something', function () {
            expect(!!dasherize).toBe(true);
        });

        it('should apply snake-case to component name - ex. snakeCase -> snake-case', function () {
            expect(dasherize('snakeCase')).toBe('snake-case');
            expect(dasherize('snakeCaseCase')).toBe('snake-case-case');
            expect(dasherize('snakeCaseCaseSnake')).toBe('snake-case-case-snake');
        });

        it('should not split multiple capital letters into camelCase (i.e. NameXML -> name-xml', function () {
            expect(dasherize('nameXML')).toBe('name-xml');
        });

        it('should not snake case the first letter', function () {
            expect(dasherize('NameXML')).toBe('name-xml');
        });

        it('should transform XMLfile to xml-file', function() {
            expect(dasherize('XMLfileIsCool')).toBe('xml-file-is-cool');
        });
    });

});


text:
class FixIdSeqs < ActiveRecord::Migration[5.2]
  def change
    [
        :account_entries, :account_link_requests, :account_links, :accounts,
        :deal_patterns, :deals, :entry_patterns, :friend_permissions, :friend_requests,
        :preferences, :sessions, :settlements, :single_logins, :users
    ].each do |table_name|
      execute "SELECT setval('#{table_name}_id_seq', (SELECT MAX(id) FROM #{table_name}));"
    end
  end
end


text:
define(['okta', 'views/shared/TextBox'], function (Okta, TextBox) {

  var _ = Okta._;

  return Okta.Form.extend({
    className: 'mfa-verify-totp',
    autoSave: true,
    noCancelButton: true,
    save: _.partial(Okta.loc, 'mfa.challenge.verify', 'login'),
    scrollOnError: false,
    layout: 'o-form-theme',
    attributes: { 'data-se': 'factor-totp' },

    initialize: function () {
      var factorName = this.model.get('factorLabel');
      var maskPasswordField = this.model.get('provider') === 'RSA' || this.model.get('provider') === 'DEL_OATH';

      this.title = factorName;
      this.subtitle = Okta.loc('mfa.challenge.title', 'login', [factorName]);

      this.addInput({
        label: false,
        'label-top': true,
        placeholder: Okta.loc('mfa.challenge.enterCode.placeholder', 'login'),
        className: 'o-form-fieldset o-form-label-top auth-passcode',
        name: 'answer',
        input: TextBox,
        type: maskPasswordField ? 'password' : 'text'
      });

      if (this.options.appState.get('allowRememberDevice')) {
        this.addInput({
          label: false,
          'label-top': true,
          placeholder: this.options.appState.get('rememberDeviceLabel'),
          className: 'margin-btm-0',
          name: 'rememberDevice',
          type: 'checkbox'
        });
      }
    }

  });

});


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace LocalizationWebsite.Models;

public class Customer
{
}


text:
from six import python_2_unicode_compatible
from .base import Ref, QuickbooksManagedObject, QuickbooksTransactionEntity, AttachableRef
from ..client import QuickBooks
from ..mixins import DeleteMixin

@python_2_unicode_compatible
class Attachable(DeleteMixin, QuickbooksManagedObject, QuickbooksTransactionEntity):
    """
    QBO definition: This page covers the Attachable, Upload, and Download resources used for attachment management. Attachments are supplemental information linked to a transaction or Item object. They can be files, notes, or a combination of both.
    In the case of file attachments, use an upload endpoint multipart request to upload the files to the QuickBooks attachment list and, optionally, to supply metadata for each via an attachable object. If meta data is not supplied with the upload request, the system creates it.
    In the case of a note, use the create attachable endpoint.
    For information about attachments, see the Attachments Developer Guide.
    """

    class_dict = {
        "EntityRef": Ref,
    }

    list_dict = {
        "AttachableRef": AttachableRef,
    }

    qbo_object_name = "Attachable"

    def __init__(self):
        super(Attachable, self).__init__()

        self.AttachableRef = []
        self.FileName = None
        self._FilePath = ''
        self.Note = ""
        self.FileAccessUri = None
        self.TempDownloadUri = None
        self.Size = None
        self.ContentType = None
        self.Category = None
        self.Lat = None
        self.Long = None
        self.PlaceName = None
        self.ThumbnailFileAccessUri = None
        self.ThumbnailTempDownloadUri = None

    def __str__(self):
        return self.FileName

    def to_ref(self):
        ref = Ref()
        ref.name = self.FileName
        ref.type = self.qbo_object_name
        ref.value = self.Id
        return ref

    def save(self, qb=None):
        if not qb:
            qb = QuickBooks()

        if self.Id and int(self.Id) > 0:
            json_data = qb.update_object(self.qbo_object_name, self.to_json(), _file_path=self._FilePath)
        else:
            json_data = qb.create_object(self.qbo_object_name, self.to_json(), _file_path=self._FilePath)

        if self.FileName:
            obj = type(self).from_json(json_data['AttachableResponse'][0]['Attachable'])
        else:
            obj = type(self).from_json(json_data['Attachable'])

        self.Id = obj.Id

        return obj


text:
#ifndef _ODECYLINDERSHAPE_HH_
#define _ODECYLINDERSHAPE_HH_

#include "gazebo/physics/CylinderShape.hh"
#include "gazebo/physics/ode/ODEPhysics.hh"

namespace gazebo
{
  namespace physics
  {
    /// \brief ODE cylinder shape
    class ODECylinderShape : public CylinderShape
    {
      /// \brief Constructor
      /// \param[in] _parent Collision parent.
      public: explicit ODECylinderShape(CollisionPtr _parent)
              : CylinderShape(_parent) {}

      /// \brief Destructor.
      public: virtual ~ODECylinderShape() {}

      // Documentation inerited.
      public: void SetSize(double _radius, double _length)
      {
        CylinderShape::SetSize(_radius, _length);
        ODECollisionPtr oParent;
        oParent =
          boost::dynamic_pointer_cast<ODECollision>(this->collisionParent);

        if (oParent->GetCollisionId() == NULL)
          oParent->SetCollision(dCreateCylinder(0, _radius, _length), true);
        else
          dGeomCylinderSetParams(oParent->GetCollisionId(), _radius, _length);
      }
    };
  }
}
#endif


text:
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using DotVVM.Framework.Routing;

namespace DotVVM.Framework.ResourceManagement
{
    /// <summary>
    /// Repository of named resources
    /// </summary>
    public class DotvvmResourceRepository : IDotvvmResourceRepository
    {
        /// <summary>
        /// Dictionary of resources
        /// </summary>
        [JsonIgnore]
        public ConcurrentDictionary<string, IResource> Resources { get; } = new ConcurrentDictionary<string, IResource>();

        [JsonIgnore]
        public ConcurrentDictionary<string, IDotvvmResourceRepository> Parents { get; } = new ConcurrentDictionary<string, IDotvvmResourceRepository>();

        [JsonIgnore]
        public IList<IResourceProcessor> DefaultResourceProcessors { get; } = new List<IResourceProcessor>();

        /// <summary>
        /// Finds the resource with the specified name.
        /// </summary>
        public IResource FindResource(string name)
        {
            if (Resources.ContainsKey(name))
            {
                return Resources[name];
            }

            IDotvvmResourceRepository parent;
            if (name.Contains(':'))
            {
                var split = name.Split(new[] { ':' }, 2);
                if (Parents.TryGetValue(split[0], out parent))
                {
                    return parent.FindResource(split[1]);
                }
            }

            if (Parents.TryGetValue("", out parent))
            {
                var resource = parent.FindResource(name);
                if (resource != null) return resource;
            }
            return null;
        }

        /// <summary>
        /// Registers a new resource in the repository.
        /// </summary>
        public void Register(string name, IResource resource, bool replaceIfExists = true)
        {
            if (resource == null)
            {
                throw new ArgumentNullException(nameof(resource));
            }

            ValidateResourceName(name);
            ValidateResourceLocation(resource, name);
            if (replaceIfExists)
            {
                Resources.AddOrUpdate(name, resource, (key, res) => resource);
            }
            else if (!Resources.TryAdd(name, resource))
            {
                throw new InvalidOperationException($"A resource with the name '{name}' is already registered!");
            }
        }

        private void ValidateResourceLocation(IResource resource, string name)
        {
            var linkResource = resource as LinkResourceBase;
            if (linkResource != null)
            {
                if (linkResource.Location == null)
                {
                    throw new DotvvmLinkResourceException($"The Location property of the resource '{name}' is not set.");
                }
            }
        }

        /// <summary>
        /// Registers a child resource repository.
        /// </summary>
        public void RegisterNamedParent(string name, IDotvvmResourceRepository parent)
        {
            ValidateResourceName(name);
            Parents[name] = parent;
        }

        protected virtual void ValidateResourceName(string name)
        {
            if (!Regex.IsMatch(name, @"^[a-zA-Z0-9]+([._-][a-zA-Z0-9]+)*$"))
            {
                throw new ArgumentException("The resource name {name} is not valid! Only alphanumeric characters, dots, underscores and dashes are allowed! Also please note that two or more subsequent dots, underscores and dashes are reserved for internal use, and are allowed only in the middle of the resource name.");
            }
        }

        /// <summary>
        /// Creates nested repository. All new registrations in the nested repo will not apply to this.
        /// </summary>
        public DotvvmResourceRepository Nest()
        {
            return new DotvvmResourceRepository(this);
        }

        public DotvvmResourceRepository()
        {

        }

        public DotvvmResourceRepository(DotvvmResourceRepository parent)
        {
            this.Parents.TryAdd("", parent);
        }

        public NamedResource FindNamedResource(string name)
        {
            return new NamedResource(name, FindResource(name));
        }
    }
}


text:
package saberapplications.pawpads.service;

import android.Manifest;
import android.app.Service;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.location.Location;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.preference.PreferenceManager;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.LocalBroadcastManager;

import com.crashlytics.android.Crashlytics;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.LocationListener;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices;
import com.quickblox.core.exception.QBResponseException;
import com.quickblox.location.QBLocations;
import com.quickblox.location.model.QBLocation;
import com.quickblox.location.request.QBLocationRequestBuilder;
import com.quickblox.location.request.SortField;
import com.quickblox.location.request.SortOrder;

import java.text.NumberFormat;
import java.util.ArrayList;

import saberapplications.pawpads.C;
import saberapplications.pawpads.PawPadsApplication;
import saberapplications.pawpads.Util;

/**
 * This service sends user location updates when app is active
 */

public class UserLocationService extends Service implements
        GoogleApiClient.ConnectionCallbacks,
        GoogleApiClient.OnConnectionFailedListener,
        LocationListener {
    private static final String USERID = "userid";
    public static final String LOCATION_CHANGED = "LOCATION_CHANGED";
    public static final String LOCATION = "location";
    private GoogleApiClient mGoogleApiClient;
    private static Location lastLocation;
    private QBLocation qbLocation;
    private int userId;
    private static boolean mIsRunning;
    private long mLocationLastSent;

    public UserLocationService() {

    }

    public static void startService(int userId) {
        if (!checkPermissions()) return;
        Intent intent = new Intent(PawPadsApplication.getInstance(), UserLocationService.class);
        intent.putExtra(USERID, userId);
        PawPadsApplication.getInstance().startService(intent);

    }

    public static void stop() {
        Intent intent = new Intent(PawPadsApplication.getInstance(), UserLocationService.class);
        PawPadsApplication.getInstance().stopService(intent);
    }

    @Override
    public void onCreate() {
        super.onCreate();
        mIsRunning = true;
        if (mGoogleApiClient == null) {
            mGoogleApiClient = new GoogleApiClient.Builder(this)
                    .addConnectionCallbacks(this)
                    .addOnConnectionFailedListener(this)
                    .addApi(LocationServices.API)
                    .build();
        }
        mGoogleApiClient.connect();
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        if (intent == null && userId == 0) {
            stopSelf();
        }
        if (intent == null) {
            stopSelf();
            return START_STICKY;
        }
        userId = intent.getIntExtra(USERID, 0);
        if (userId == 0) {
            stopSelf();
        }
        return START_STICKY;

    }

    @Override
    public void onDestroy() {
        mIsRunning = false;
        if (mGoogleApiClient.isConnected()) {
            mGoogleApiClient.disconnect();
        }
        super.onDestroy();
    }

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public void onConnected(Bundle bundle) {
        LocationRequest locationRequest = new LocationRequest();
        SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(this);
        switch (preferences.getString(C.ACCURACY,C.ACCURACY_MEDIUM)){
            case C.ACCURACY_LOW:
                locationRequest.setPriority(LocationRequest.PRIORITY_LOW_POWER);
                break;
            case C.ACCURACY_MEDIUM:
                locationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);
                break;
            case C.ACCURACY_HIGH:
                locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
                break;
        }

        locationRequest.setInterval(C.LOCATION_PUSH_INTERVAL);
        if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
                && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
            return;
        }
        LocationServices.FusedLocationApi.requestLocationUpdates(
                mGoogleApiClient, locationRequest, this);
        lastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);

        updateLocationAsync(lastLocation);
    }

    @Override
    public void onConnectionSuspended(int i) {

    }

    @Override
    public void onConnectionFailed(ConnectionResult connectionResult) {

    }

    @Override
    public void onLocationChanged(Location location) {
        lastLocation = location;
        updateLocationAsync(location);
    }

    private void updateLocationAsync(final Location location) {
        Intent intent = new Intent(LOCATION_CHANGED);
        intent.putExtra("location", location);
        LocalBroadcastManager.getInstance(this).sendBroadcast(intent);

        AsyncTask<Void, Void, Void> task = new AsyncTask<Void, Void, Void>() {
            @Override
            protected Void doInBackground(Void... params) {

                updateUserLocation(location);
                return null;
            }
        };
        task.execute();
    }

    private void updateUserLocation(Location location) {
        if (!mGoogleApiClient.isConnected()) return;
        if (mLocationLastSent >0 && (System.currentTimeMillis()- mLocationLastSent)<C.LOCATION_PUSH_INTERVAL)
            return;

        if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
            return;
        }
        if (location == null) {
            location = LocationServices.FusedLocationApi.getLastLocation(
                    mGoogleApiClient);
        }

        if (location == null) return;
        if (qbLocation == null) {
            initUserLocation(lastLocation);
        }
        if (qbLocation == null) {
            stopSelf();
            return;
        }

        qbLocation.setLatitude(accuracySettings(location.getLatitude()));
        qbLocation.setLongitude(accuracySettings(location.getLongitude()));
        try {
            QBLocations.deleteObsoleteLocations(1);
            qbLocation = QBLocations.updateLocation(qbLocation);
            mLocationLastSent =System.currentTimeMillis();
            SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(getBaseContext()).edit();
            editor.putString(Util.USER_LOCATION_LAT, String.valueOf(qbLocation.getLatitude()));
            editor.putString(Util.USER_LOCATION_LONG, String.valueOf(qbLocation.getLongitude()));

            editor.apply();

        } catch (QBResponseException e) {
            if (e.getMessage().contains("Entity you are looking for was not found")){
                initUserLocation(location);
            }else {
                e.printStackTrace();
                Crashlytics.logException(e);
            }
        }

    }

    protected void initUserLocation(Location location) {
        try {
            QBLocationRequestBuilder getLocationsBuilder = new QBLocationRequestBuilder();
            getLocationsBuilder.setSort(SortField.CREATED_AT, SortOrder.DESCENDING);
            getLocationsBuilder.setUserId(userId);
            Bundle bundle = new Bundle();
            ArrayList<QBLocation> locations = QBLocations.getLocations(getLocationsBuilder, bundle);
            if (locations.size() > 0) {
                qbLocation = locations.get(0);
            } else {
                qbLocation = new QBLocation();
                qbLocation.setUserId(userId);

                qbLocation.setLatitude(accuracySettings(location.getLatitude()));
                qbLocation.setLongitude(accuracySettings(location.getLongitude()));

                qbLocation = QBLocations.createLocation(qbLocation);
            }
        } catch (QBResponseException e) {
            if (e.getMessage().equals("Entity you are looking for was not found.")) {
                qbLocation = new QBLocation();
                qbLocation.setUserId(userId);

                qbLocation.setLatitude(accuracySettings(location.getLatitude()));
                qbLocation.setLongitude(accuracySettings(location.getLongitude()));

                try {
                    qbLocation = QBLocations.createLocation(qbLocation);
                } catch (QBResponseException e1) {
                    e1.printStackTrace();
                    Crashlytics.logException(e1);
                }
            } else {
                e.printStackTrace();
                Crashlytics.logException(e);
            }
        }
    }

    public static Location getLastLocation() {
        return lastLocation;
    }

    public Double accuracySettings(Double location) {
        Double loc;
        NumberFormat formatter;
        if (Util.ACCURACY==null){
            SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
            Util.ACCURACY=prefs.getString(C.ACCURACY,C.ACCURACY_MEDIUM);
        }
        if (Util.ACCURACY.equals(C.ACCURACY_HIGH)) {
            loc = (double)Math.round(location * 1000) / 1000;
            return loc;
        } else if (Util.ACCURACY.equals(C.ACCURACY_LOW)) {
            loc = (double)Math.round(location * 10) / 10;
            return loc;
        } else {
            return location;
        }
    }

    public static boolean isRunning() {
        return mIsRunning;
    }

    private static boolean checkPermissions() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            if (ActivityCompat.checkSelfPermission(PawPadsApplication.getInstance(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED ||
                    ActivityCompat.checkSelfPermission(PawPadsApplication.getInstance(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
                return false;
            }

        }

        return true;
    }

}


text:
import DOMElement from "openfl/display/DOMElement";
import * as assert from "assert";

describe ("ES6 | DOMElement", function () {

	it ("new", function () {

		// TODO: Confirm functionality

		var domElement = new DOMElement (null);
		var exists = domElement;

		assert.notEqual (exists, null);

	});

});


text:
package semaphore

import (
	"context"
	"sync/atomic"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"

	"github.com/zrepl/zrepl/daemon/logging/trace"
)

func TestSemaphore(t *testing.T) {
	const numGoroutines = 10
	const concurrentSemaphore = 6
	const sleepTime = 1 * time.Second

	begin := time.Now()

	sem := New(concurrentSemaphore)

	var acquisitions struct {
		beforeT, afterT uint32
	}

	rootCtx, endRoot := trace.WithTaskFromStack(context.Background())
	defer endRoot()
	_, add, waitEnd := trace.WithTaskGroup(rootCtx, "TestSemaphore")

	for i := 0; i < numGoroutines; i++ {
		// not capturing i so no need for local copy
		add(func(ctx context.Context) {
			res, err := sem.Acquire(ctx)
			require.NoError(t, err)
			defer res.Release()
			if time.Since(begin) > sleepTime {
				atomic.AddUint32(&acquisitions.afterT, 1)
			} else {
				atomic.AddUint32(&acquisitions.beforeT, 1)
			}
			time.Sleep(sleepTime)
		})
	}

	waitEnd()

	assert.True(t, acquisitions.beforeT == concurrentSemaphore)
	assert.True(t, acquisitions.afterT == numGoroutines-concurrentSemaphore)

}


text:
import colors from '../settings/colors';
import darken from '../internal/darken';

export default {
  root: {
    backgroundColor: colors.white,
    boxSizing: 'border-box',
    cursor: 'pointer',
    display: 'flex',
    alignItems: 'center',
    height: '52px',
    listStyle: 'none',
    paddingTop: '0',
    paddingRight: '8px',
    paddingLeft: '8px',
    paddingBottom: '0',
    position: 'relative',
    transition: 'background-color .3s ease-in-out',

    ':hover': {
      backgroundColor: darken(colors.white, 0.05)
    },
    ':active': {
      backgroundColor: darken(colors.white, 0.15)
    }
  },
  active: {
    backgroundColor: colors.theme,
    color: colors.white,

    ':hover': {
      backgroundColor: darken(colors.theme, 0.05)
    },
    ':active': {
      backgroundColor: darken(colors.theme, 0.15)
    }
  },
  icon: {
    position: 'absolute',
    top: '0',
    left: '0',
    width: '40px',
    height: '40px',
    padding: '8px',
    boxSizing: 'border-box',
    backgroundColor: 'rgba(21, 21, 21, .75)',
    borderRadius: '50%'
  },
  rightButton: {
    paddingRight: '52px'
  },
  button: {
    transition: 'transform .3s ease-in-out',
    width: '40px',
    height: '40px'
  },
  primaryText: {
    color: colors.primaryText,
    fontSize: '16px',
    margin: 0,
    lineHeight: '18px',
    userSelect: 'none',
    whiteSpace: 'nowrap',
    overflow: 'hidden',
    textOverflow: 'ellipsis',
    fontWeight: 'inherit'
  },
  secondaryText: {
    color: colors.secondaryText,
    fontSize: '14px',
    fontWeight: 'inherit',
    marginBottom: 0,
    marginTop: '2.4px',
    lineHeight: '16px',
    userSelect: 'none',
    whiteSpace: 'nowrap',
    overflow: 'hidden',
    textOverflow: 'ellipsis',
  },
  leftAvatar: {
    paddingLeft: '56px'
  },
  avatar: {
    position: 'relative',
    marginRight: '8px',
    width: '40px',
    height: '40px'
  },
  badge: {
    position: 'absolute',
    right: '-3px',
    top: '-3px'
  },
  container: {
    width: '100%'
  },
  text: {
    width: '100%',
    paddingRight: '8px',
    boxSizing: 'border-box'
  }
};