text:
BRANCH='master'

FS_CONF_PATH=https://raw.github.com/Star2Billing/newfies-dialer/$BRANCH/install/freeswitch-conf
FS_INIT_PATH=https://raw.github.com/Star2Billing/newfies-dialer/$BRANCH/install/freeswitch-init
FS_CONFIG_PATH=/etc/freeswitch
FS_BASE_PATH=/usr/src/
CURRENT_PATH=$PWD
# Valid Freeswitch versions are : v1.2.stable
FS_VERSION=v1.2.stable

# Identify Linux Distribution type
if [ -f /etc/debian_version ] ; then
    DIST='DEBIAN'
elif [ -f /etc/redhat-release ] ; then
    DIST='CENTOS'
else
    echo "\n\nThis Installer should be run on a Debian 7.X or CentOS 6.X"
    exit 1
fi

clear
echo ""
echo "FreeSWITCH will be installed!"
echo ""
echo "Press Enter to continue or CTRL-C to exit"
echo ""
read INPUT

# -- Functions --

func_install_deps() {
    echo "Setting up Prerequisites and Dependencies for FreeSWITCH"
    case $DIST in
        'DEBIAN')
            apt-get -y update
            apt-get -y install --reinstall language-pack-en

            export LANGUAGE=en_US.UTF-8
            export LANG=en_US.UTF-8
            export LC_ALL=en_US.UTF-8
            locale-gen en_US.UTF-8
            locale-gen es_ES.UTF-8
            locale-gen fr_FR.UTF-8
            locale-gen pt_BR.UTF-8

            apt-get -y install autoconf2.64 automake autotools-dev binutils bison build-essential cpp curl flex g++ gcc git-core libaudiofile-dev libc6-dev libdb-dev libexpat1 libexpat1-dev libgdbm-dev libgnutls-dev libmcrypt-dev libncurses5-dev libnewt-dev libpcre3 libpopt-dev libsctp-dev libsqlite3-dev libtiff4 libtiff4-dev libtool libx11-dev libxml2 libxml2-dev lksctp-tools lynx m4 make mcrypt ncftp nmap openssl sox sqlite3 ssl-cert ssl-cert unzip zip zlib1g-dev zlib1g-dev
            apt-get -y install libssl-dev pkg-config
            apt-get -y install libvorbis0a libogg0 libogg-dev libvorbis-dev
            apt-get -y install flite flite1-dev
            apt-get -y install unixodbc-dev odbc-postgresql
            ;;
        'CENTOS')
            yum -y update
            yum -y install speex-devel libedit-devel ldns-devel sox-devel pcre-devel sqlite-devel autoconf automake bzip2 cpio curl curl-devel curl-devel expat-devel fileutils gcc-c++ gettext-devel gnutls-devel libjpeg-devel libogg-devel libtiff-devel libtool libvorbis-devel make ncurses-devel nmap openssl openssl-devel openssl-devel perl patch unixODBC unixODBC-devel unzip wget zip zlib zlib-devel
            yum -y install git
            yum -y install --enablerepo=epel flite flite-devel
        ;;
    esac
}

func_install_fs_sources() {
    echo "Installing from sources"

    #install Dependencies
    func_install_deps

    #Add Freeswitch group and user
    grep -c "^freeswitch:" /etc/group &> /dev/null
    if [ $? = 1 ]; then
        /usr/sbin/groupadd -r -f freeswitch
    fi
    grep -c "^freeswitch:" /etc/passwd &> /dev/null
    if [ $? = 1 ]; then
        echo "adding user freeswitch..."
        /usr/sbin/useradd -r -c "freeswitch" -g freeswitch freeswitch
    fi

    #Download and install FS from git repository.
    cd $FS_BASE_PATH
    rm -rf freeswitch
    # dont use depth :  --depth=1 as we wont be able to checkout
    #git clone git://git.freeswitch.org/freeswitch.git
    mkdir -p $FS_BASE_PATH/freeswitch
    cd $FS_BASE_PATH/freeswitch
    wget http://www.kazoo.com.cn/freeswitch/freeswitch.tar.gz
    tar -xvzf freeswitch.tar.gz
    ./bootstrap.sh

    # !!! virtual memory exhausted: Cannot allocate memory !!!
    # we need to make more temporary swap space
    #
    # dd if=/dev/zero of=/root/fakeswap bs=1024 count=1048576
    # mkswap /root/fakeswap
    # swapon /root/fakeswap

    ./configure --without-pgsql --prefix=/usr/local/freeswitch --sysconfdir=/etc/freeswitch/
    [ -f modules.conf ] && cp modules.conf modules.conf.bak
    sed -i -e \
    "s/#applications\/mod_curl/applications\/mod_curl/g" \
    -e "s/#asr_tts\/mod_flite/asr_tts\/mod_flite/g" \
    -e "s/#asr_tts\/mod_tts_commandline/asr_tts\/mod_tts_commandline/g" \
    -e "s/#formats\/mod_shout/formats\/mod_shout/g" \
    -e "s/#endpoints\/mod_dingaling/endpoints\/mod_dingaling/g" \
    -e "s/#formats\/mod_shell_stream/formats\/mod_shell_stream/g" \
    -e "s/#say\/mod_say_de/say\/mod_say_de/g" \
    -e "s/#say\/mod_say_es/say\/mod_say_es/g" \
    -e "s/#say\/mod_say_fr/say\/mod_say_fr/g" \
    -e "s/#say\/mod_say_it/say\/mod_say_it/g" \
    -e "s/#say\/mod_say_nl/say\/mod_say_nl/g" \
    -e "s/#say\/mod_say_ru/say\/mod_say_ru/g" \
    -e "s/#say\/mod_say_zh/say\/mod_say_zh/g" \
    -e "s/#say\/mod_say_hu/say\/mod_say_hu/g" \
    -e "s/#say\/mod_say_th/say\/mod_say_th/g" \
    -e "s/#xml_int\/mod_xml_cdr/xml_int\/mod_xml_cdr/g" \
    modules.conf
    make && make install && make sounds-install && make moh-install

    # Remove temporary swap
    # swapoff /root/fakeswap
    # rm /root/fakeswap

    #Set permissions
    chown -R freeswitch:freeswitch /usr/local/freeswitch /etc/freeswitch
}

install_fs_deb_packages() {
    #for 1.2 Stable Branch
    echo 'deb http://files.freeswitch.org/repo/deb/debian/ wheezy main' >> /etc/apt/sources.list.d/freeswitch.list

    curl http://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | apt-key add -

    #install Dependencies
    func_install_deps

    apt-get -y install freeswitch-meta-vanilla
    apt-get -y install freeswitch-mod-vmd freeswitch-mod-python freeswitch-mod-sndfile freeswitch-sounds-en
    apt-get -y install libfreeswitch-dev freeswitch-mod-lua freeswitch-mod-flite
    apt-get -y install freeswitch-mod-esl freeswitch-mod-event-socket freeswitch-mod-curl
}

func_configure_fs() {
    echo "Enable FreeSWITCH modules"
    cd $FS_CONFIG_PATH/autoload_configs/
    [ -f modules.conf.xml ] && cp modules.conf.xml modules.conf.xml.bak
    sed -i -r \
    -e "s/<\!--\s?<load module=\"mod_lua\"\/>\s?-->/<load module=\"mod_lua\"\/>/g" \
    -e "s/<\!--\s?<load module=\"mod_xml_cdr\"\/>\s?-->/<load module=\"mod_xml_cdr\"\/>/g" \
    -e "s/<\!--\s?<load module=\"mod_dingaling\"\/>\s?-->/<load module=\"mod_dingaling\"\/>/g" \
    -e "s/<\!--\s?<load module=\"mod_shell_stream\"\/>\s?-->/<load module=\"mod_shell_stream\"\/>/g" \
    -e "s/<\!-- \s?<load module=\"mod_shell_stream\"\/>\s? -->/<load module=\"mod_shell_stream\"\/>/g" \
    -e "s/<\!--\s?<load module=\"mod_shout\"\/>\s?-->/<load module=\"mod_shout\"\/>/g" \
    -e "s/<\!--\s?<load module=\"mod_tts_commandline\"\/>\s?-->/<load module=\"mod_tts_commandline\"\/>/g" \
    -e "s/<\!--\s?<load module=\"mod_flite\"\/>\s?-->/<load module=\"mod_flite\"\/>/g" \
    -e "s/<\!--\s?<load module=\"mod_say_ru\"\/>\s?-->/<load module=\"mod_say_ru\"\/>/g" \
    -e "s/<\!--\s?<load module=\"mod_say_zh\"\/>\s?-->/<load module=\"mod_say_zh\"\/>/g" \
    -e 's/mod_say_zh.*$/&\n    <load module="mod_say_de"\/>\n    <load module="mod_say_es"\/>\n    <load module="mod_say_fr"\/>\n    <load module="mod_say_it"\/>\n    <load module="mod_say_nl"\/>\n    <load module="mod_say_hu"\/>\n    <load module="mod_say_th"\/>/' \
    modules.conf.xml

    [ -f lua.conf.xml ] && mv lua.conf.xml lua.conf.xml.bak
    wget --no-check-certificate $FS_CONF_PATH/lua.conf.xml -O lua.conf.xml

    #Configure Dialplan
    #cd $FS_CONFIG_PATH/conf/dialplan/
    #Configure XML CDR
    #cd $FS_CONFIG_PATH/conf/autoload_configs/

    #this is commented as we don't use xml_cdr anymore
    ## Place Newfies XML CDR conf in FreeSWITCH
    #[ -f xml_cdr.conf.xml ] && mv xml_cdr.conf.xml xml_cdr.conf.xml.bak
    #wget --no-check-certificate $FS_CONF_PATH/xml_cdr.conf.xml -O xml_cdr.conf.xml
    #create dir to store send error of CDR
    #mkdir /usr/local/freeswitch/log/err_xml_cdr/
}

func_create_alias_fs_cli() {
    echo "Setup alias fs_cli"
    alias fs_cli='/usr/local/freeswitch/bin/fs_cli'
    chk=`grep "fs_cli" ~/.bashrc|wc -l`
    if [ $chk -lt 1 ] ; then
        echo "alias fs_cli='/usr/local/freeswitch/bin/fs_cli'" >> ~/.bashrc
    fi
}

func_add_init_script() {
    #Install init.d script
    case $DIST in
        'DEBIAN')
            wget --no-check-certificate $FS_INIT_PATH/debian/freeswitch -O /etc/init.d/freeswitch
            chmod 0755 /etc/init.d/freeswitch
            cd /etc/init.d; update-rc.d freeswitch defaults 90
        ;;
        'CENTOS')
            wget --no-check-certificate $FS_INIT_PATH/centos/freeswitch -O /etc/init.d/freeswitch
            chmod 0755 /etc/init.d/freeswitch
            chkconfig --add freeswitch
            chkconfig --level 345 freeswitch on
        ;;
    esac
}

case $DIST in
    'DEBIAN')
        #Install FreeSWITCH from Debian packages
        #install_fs_deb_packages

        #!!! At the moment we cannot install from Deb packages cause we need the sources to compile
        #libs/esl/python

        #Install FreeSWITCH from sources
        func_install_fs_sources
        #Create alias fs_cli
        func_create_alias_fs_cli
        #Install init.d script
        func_add_init_script
    ;;
    'CENTOS')
        #Install FreeSWITCH from sources
        func_install_fs_sources
        #Create alias fs_cli
        func_create_alias_fs_cli
        #Install init.d script
        #*Not need if installed from deb packages
        func_add_init_script
    ;;
esac

#Configure FreeSWITCH
func_configure_fs

#Start FreeSWITCH
/etc/init.d/freeswitch start

cd $CURRENT_PATH

echo ""
echo "********************************************"
echo "Congratulations, FreeSWITCH is now installed"
echo "********************************************"
echo


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Pertusaria coccodes f. plasmodicarpa Eitner

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
Fasta
=====

Perl scripts dealing with fasta files.

========================================================

fasta_FetchSeqs.pl [v1.0]

	WHAT IT DOES
	This script allows to extract fasta sequences from a file.
	  - matching ID (from command line or from a file containing a list of IDs using -file)
	  - containing a word in the ID or in the description (-desc), or in both (-both)
	  - the complement of that (meaning, extract when it does not match), option -inv (inverse match)

	Note that for a given fasta header:
	   >ID description
	   The ID corresponds to anything before the first space, description is anything that's after (even if spaces)

	Usage:
		perl FetchSeqs.pl -in <fa> -m <X> [-file] [-out <X>] [-fq] [-grep] [-desc] [-both] [-regex] [-inv] [-noc] [-chlog] [-v] [-h]

	This script allows to extract fasta sequences from a file.
	  - matching ID (from command line or using another fasta file or a file containing a list of IDs using -file)
	  - containing a word in the ID or in the description (-desc), or in both (-both)
	  - the complement of that (meaning, extract when it does not match), option -inv (inverse match)

	Note that for a given fasta header:
	   >ID description
	   The ID corresponds to anything before the first space, description is anything that's after (even if spaces)

	Examples:
	   To extract all sequences containing ERV or LTR in IDs only:
		  perl fasta_FetchSeqs.pl -in fastafile.fa -m ERV,LTR -regex -v
	   To extract all sequences that don't have the word \"virus\" in the description or in the ID
		  perl fasta_FetchSeqs.pl -in fastafile.fa -m virus -both -inv -v
	   To extract all sequences that have their ID listed in a file
		  perl fasta_FetchSeqs.pl -in fastafile.fa -m list.txt -v
	   To extract all sequences that have their full header listed in a file
		  perl fasta_FetchSeqs.pl -in fastafile.fa -m list.txt -both -v

    MANDATORY:
    -in     => (STRING) input fasta file
    -m      => (STRING) provide (i) a word or a list of words, or (ii) a path to a file
                        (i) in command line: you can set several words using , (comma) as a separator.
                            For example: -m ERV,LTR
                            Note that there can't be spaces in the command line, or they have to be escaped with \
                        (ii) a file: it can be a fasta/fastq file, or simply a file with a list of IDs (one column)
                            If the \">\" or @ is kept with the ID, then all lines need to have it (unless -grep)
                            Headers can contain:
                             - fasta/fastq IDs only (no spaces) [defaults earch is done against IDs only]
                             - full fasta headers (use -both to match both, otherwise only ID is looked at)
                             - descriptions only (spaces allowed) if -desc is set
                            Note that you need to use the -file flag

    OPTIONAL:
    -file   => (BOOL)   chose this if -m corresponds to a file
    -out    => (STRING) to set the name of the output file (default = input.extract.fa)
    -fq     => (BOOL)   if input file is in fastq format; output will also be fastq
    -grep   => (BOOL)   Chose this with -fq to use grep instead of using BioSeq
    					But this is even slower on large files.
						Only relevant if -fq is set as well, because the sequences
						will be extracted using grep -A 3 for each word set with -m
						(extracting line that matches + 3 lines after the match)
                        Also, this makes irrelevant the use of these options:
                        -desc, -both, -regex, -inv, -noc
    -desc   => (BOOL)   to look for match in the description and not the header
    -both   => (BOOL)   to look into both headers and description
    -regex  => (BOOL)   to look for containing the word and not an exact match
                        Special characters in names or descriptions will be an issue;
                        the only ones that are taken care of are: | / . [ ]
    -inv    => (BOOL)   to extract what DOES NOT match
    -noc    => (BOOL)   to ignore case in matching
    -chlog  => (BOOL)   print updates
    -v      => (BOOL)   verbose mode, make the script talk to you
    -v      => (BOOL)   print version if only option
    -h|help => (BOOL)   print this help

========================================================

fasta_keep-unique.pl [v3.0]

	WHAT IT DOES
    This script will filter out non unique sequences (based on sequences, not names)
    This v3 now takes descriptions into account, instead of just keeping
    the first occurence of a sequence:
       - if hypotheticals, putative or uncharacterixed, chose other if any
       - if several descriptions possible, use the majority one
       - if no majority, use the first one [so if no description, the order of the sequences will matter]
    There will be 2 output files per input file:
      - sequences that are unique when all files are considered
      - removed sequences
    As well as a tabulated file with the details of removed and kept sequences.

    perl <scriptname.pl> -i <in.fa> [-v] [-h|help]

    MANDATORY
    -i,--in   (STRING)  Fasta file. Can be several files separated by \",\"
                        Typically: -i myseqs.fa,checkseqs.fa

    OPTIONAL
    -o,--out  (STRING)  To rename the output names
                        Default: name of the first file in -i is used
    -d,--dir    (BOOL)  Give a directory to -i
                        Only .fa, .fasta, .faa, .fas, .fna files in it will be loaded
                        Will ignore *unique* and *removed* files
    -l,--log    (BOOL)  Print the change log (updates)
    -v          (BOOL)  Verbose mode, make the script talks to you
    -v          (BOOL)  Print version if only option
    -h,--help   (BOOL)  Print this usage

========================================================

fasta_Cut_based-on-Mo.pl

	perl fasta_Cut_based-on-Mo.pl <FastaFile> <File size in Mo>

	This script will rewrite a fasta file (typically, a genome) in pieces of X Mo (~correlated to the total length of sequences)

	<FastaFile>       --> (STRING)  Input file in fasta format (typically, a genome)
	<File size in Mo> --> (INTEGER) To set X, the size of output files in Mo

	NB: - if cut results in more than 100 files, you should then replace \"%02d\" by \"%03d\" at line 39.
	    - if some sequences are longer than the set size in Mo, then files containing them will be bigger anyway since the script won't cut a sequence.

========================================================

fasta_extract_random.pl [v1.2]
fasta_extract_random_pieces.pl [v1.1]

    PURPOSE:
    These scripts will extract random sequences (fasta_extract_random.pl),
    or random sub sequences (fasta_extract_random_pieces.pl)

	perl fasta_extract_random.pl -i <in.fa> [-n <X>] [-p <X>] [-d] [-u] [-c] [-f <X>] [-m <X>] [-nom] [-v] [-h|help]
	perl fasta_extract_random_pieces.pl -i <in.fa> -l <min,max> [-n <X>] [-p <X>] [-o <out.fa] [-a <X>] [-u] [-s] [-b] [-v] [-h|help]

    Check their usage (use -h) to see the details of the options. Briefly:
    -n or -p to set the number of sequences to extract
    -u to write sequence in upper cases
    -a to decide allowed overlap (0% to 100%)

========================================================

fasta_split_blast_parse_P.pl [v1.1]

	WHAT IT DOES
	This script will blast a fasta file against the fasta file set with -db (set the blast type with -type)
	To allow threading, the input fasta file is split in one file per sequence
	Outputs (standard ones with alignments in the files) can be parsed to be in table format if -parse if chosen,
	with optional filtering using -s, -e, -id (and/or): a hit will be kept if at least one of the condition is met
	Additionally, like the tabular output of blasts, the top X hits can be extracted (independently of filtering)

	perl <fasta_split_blast_parse_P.pl> -in <in.fa> -db <db.fa> -type <blast_type> [-blast <path/bin>]
	                                   [-dbtype <db_type>] [-eval <evalue>] [-parse] [-s <score>] [-e <evalue>]
	                                   [-id <%id>] [-top <X>] [-cat] [-cpu <number>] [-v]

    MANDATORY ARGUMENT:
    -in     => (STRING) input fasta file
    -db     => (STRING) fasta file that will be used as the db to blast against
                        writing access needed (for makeblastdb)
    -type   => (STRING) the type of blast, to chose between usual blasts (blastn, blastp, tblastn, tblastx...)

    OPTIONAL ARGUMENTS
    -blast =>  (STRING) To override default blast path
                        Default = /home/software/ncbi-blast-2.2.29+/bin
    -dbtype => (STRING) molecule_type for makeblastdb (-dbtype nucl or -dbtype prot)
                        default = prot
    -eval   => (STRING) (or FLOAT) evalue used as threshold during the blast.
                        default = 10e-50
    -parse  => (BOOL)   to parse the blast outputs (if not chosen script will end when all blasts are done)
                        If no hits, there won't be a parsed file
    -s      => (INT)    when -parse is chosen: filter out hits with a bit score < X
    -e      => (STRING) when -parse is chosen: filter out hits with an evalue < X
    -id     => (FLOAT)  when -parse is chosen: filter out hits with a % identity < X
    -top    => (INT)    DESPITE the filters, print anyway parsed data for the top X hits
    -cat    => (BOOL)   when -parse is chosen: concatenate the parsed outputs in one file
    -cpus   => (INT)    number of cpus that will be used (number of threads started)
                        default = 1 (e.g. no threading)
    -chlog  => (BOOL)   print updates
    -v      => (BOOL)   verbose mode, make the script talk to you
    -v      => (BOOL)   print version if only option
    -h|help => (BOOL)   print this help


text:
import IsoBox from '../vo/IsoBox';
import FactoryMaker from '../../core/FactoryMaker';

function IsoFile() {

    let instance,
        parsedIsoFile,
        commonProps,
        sidxProps,
        sidxRefProps,
        emsgProps,
        mdhdProps,
        mfhdProps,
        subsProps,
        tfhdProps,
        tfdtProps,
        trunProps,
        trunSampleProps;

    /**
    * @param {string} type
    * @returns {IsoBox|null}
    * @memberof IsoFile#
    */
    function getBox(type) {
        if (!type || !parsedIsoFile || !parsedIsoFile.boxes || (parsedIsoFile.boxes.length === 0)) return null;

        return convertToDashIsoBox(parsedIsoFile.fetch(type));
    }

    /**
    * @param {string} type
    * @returns {Array} array of {@link IsoBox}
    * @memberof IsoFile#
    */
    function getBoxes(type) {
        var boxData = parsedIsoFile.fetchAll(type);
        var boxes = [];
        var box;

        for (var i = 0, ln = boxData.length; i < ln; i++) {
            box = convertToDashIsoBox(boxData[i]);

            if (box) {
                boxes.push(box);
            }
        }

        return boxes;
    }

    /**
    * @param {string} value
    * @memberof IsoFile#
    */
    function setData(value) {
        parsedIsoFile = value;
    }

    /**
    * @returns {IsoBox|null}
    * @memberof IsoFile#
    */
    function getLastBox() {
        if (!parsedIsoFile || !parsedIsoFile.boxes || !parsedIsoFile.boxes.length) return null;

        var type = parsedIsoFile.boxes[parsedIsoFile.boxes.length - 1].type;
        var boxes = getBoxes(type);

        return boxes[boxes.length - 1];
    }

    /**
    * @returns {number}
    * @memberof IsoFile#
    */
    function getOffset() {
        return parsedIsoFile._cursor.offset;
    }

    function setup() {
        commonProps = {
            offset: '_offset',
            size: 'size',
            type: 'type'
        };

        sidxProps = {
            references: 'references',
            timescale: 'timescale',
            earliest_presentation_time: 'earliest_presentation_time',
            first_offset: 'first_offset'
        };

        sidxRefProps = {
            reference_type: 'reference_type',
            referenced_size: 'referenced_size',
            subsegment_duration: 'subsegment_duration'
        };

        emsgProps = {
            id: 'id',
            value: 'value',
            timescale: 'timescale',
            scheme_id_uri: 'scheme_id_uri',
            presentation_time_delta: 'presentation_time_delta',
            event_duration: 'event_duration',
            message_data: 'message_data'
        };

        mdhdProps = {
            timescale: 'timescale'
        };

        mfhdProps = {
            sequence_number: 'sequence_number'
        };

        subsProps = {
            samples_with_subsamples: 'samples_with_subsamples'
        };

        tfhdProps = {
            base_data_offset: 'base_data_offset',
            sample_description_index: 'sample_description_index',
            default_sample_duration: 'default_sample_duration',
            default_sample_size: 'default_sample_size',
            default_sample_flags: 'default_sample_flags',
            flags: 'flags'
        };

        tfdtProps = {
            version: 'version',
            baseMediaDecodeTime: 'baseMediaDecodeTime',
            flags: 'flags'
        };

        trunProps = {
            sample_count: 'sample_count',
            first_sample_flags: 'first_sample_flags',
            data_offset: 'data_offset',
            flags: 'flags',
            samples: 'samples'
        };

        trunSampleProps = {
            sample_size: 'sample_size',
            sample_duration: 'sample_duration',
            sample_composition_time_offset: 'sample_composition_time_offset'
        };
    }

    function copyProps(from, to, props) {
        for (var prop in props) {
            to[prop] = from[props[prop]];
        }
    }

    function convertToDashIsoBox(boxData) {
        if (!boxData) return null;

        var box = new IsoBox();
        var i,
            ln;

        copyProps(boxData, box, commonProps);

        if (boxData.hasOwnProperty('_incomplete')) {
            box.isComplete = !boxData._incomplete;
        }

        switch (box.type) {
            case 'sidx':
                copyProps(boxData, box, sidxProps);
                if (box.references) {
                    for (i = 0, ln = box.references.length; i < ln; i++) {
                        copyProps(boxData.references[i], box.references[i], sidxRefProps);
                    }
                }
                break;
            case 'emsg':
                copyProps(boxData, box, emsgProps);
                break;
            case 'mdhd':
                copyProps(boxData, box, mdhdProps);
                break;
            case 'mfhd':
                copyProps(boxData, box, mfhdProps);
                break;
            case 'subs':
                copyProps(boxData, box, subsProps);
                break;
            case 'tfhd':
                copyProps(boxData, box, tfhdProps);
                break;
            case 'tfdt':
                copyProps(boxData, box, tfdtProps);
                break;
            case 'trun':
                copyProps(boxData, box, trunProps);
                if (box.samples) {
                    for (i = 0, ln = box.samples.length; i < ln; i++) {
                        copyProps(boxData.samples[i], box.samples[i], trunSampleProps);
                    }
                }
                break;
        }

        return box;
    }

    instance = {
        getBox: getBox,
        getBoxes: getBoxes,
        setData: setData,
        getLastBox: getLastBox,
        getOffset: getOffset
    };

    setup();

    return instance;
}
IsoFile.__dashjs_factory_name = 'IsoFile';
export default FactoryMaker.getClassFactory(IsoFile);


text:
Portfolio Repository

User stories guide:

1. As a developer, I need my site to use valid and semantic markup, so that employers will love me.
2. As the creator, I need the page to link to my social and GitHub pages, so that visitors can follow me and I can build my audience.
3. As a developer, I want wireframes for each of the main views in my portfolio, so I will have a concrete idea of the design I am building.
4. As a developer, I want to make a data model (object constructor) for my portfolio data, so I can store individual projects and render them to the DOM.
5. As a visitor, I want the images to be responsive, so that content stays properly proportioned.
6. As a visitor, I want the viewport properly sized, so that content fits all the size I have available.
7. As a visitor, I want the primary nav to be responsive, so that I can get around using any device.


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">Byte Buddy Android test</string>
    <string name="version_info">Build version: %1$s</string>
    <string name="info">
        This application creates a runtime subclass using Byte Buddy and loads the generated classes using Byte
        Buddy\'s class loading strategy for Android. For this, it uses version the Android SDK\'s dex compiler
        in the form it is available on Maven Central.
    </string>
    <string name="run_test_wrapping">Run test: wrapping</string>
    <string name="run_test_injecting">Run test: injecting</string>
</resources>


text:
import React from 'react';
import { CategorySearch } from '@appbaseio/reactivesearch';

import Navbar, { title } from '../styles/Navbar';
import Flex, { FlexChild } from '../styles/Flex';
import { categorySearchContainer } from '../styles/Container';

export default () => (
	<Navbar>
		<Flex alignCenter responsive justifyContent="space-between">
			<FlexChild className={title}>Car Store</FlexChild>
			<FlexChild className={categorySearchContainer}>
				<CategorySearch
					dataField="model"
					categoryField="brand.keyword"
					componentId="category"
					placeholder="Search for cars..."
					iconPosition="left"
					react={{
						and: 'brand',
					}}
				/>
			</FlexChild>
		</Flex>
	</Navbar>
);


text:
namespace PhotoArtSystem.Data.Common.Repositories
{
    using System.Linq;
    using Models;

    public interface IPhotoArtSystemEfDbRepository<T>
        where T : class, IAuditInfo, IDeletableEntity
    {
        IQueryable<T> GetAll();

        IQueryable<T> GetAllWithDeleted();

        T GetById(object id);

        void Create(T entity);

        void Update(T entity);

        void Delete(T entity);

        void DeletePermanent(T entity);
    }
}


text:
class Component:
    def __init__(self,model,name):
        self.model = model
        self.name = name

        self.inlets = []
        self.outlets = []

    def ensureNodeExists(self,index):
        if not index in self.model.nodes:
            self.model.nodes[index] = {}

    def addInlet(self,index):
        self.ensureNodeExists(index)

        self.model.nodes[index]['to'] = self.name

        self.inlets.append(index)

    def addOutlet(self,index):
        self.ensureNodeExists(index)

        self.model.nodes[index]['from'] = self.name

        self.outlets.append(index)

    def storeResult(self,data):
        self.model.result[self.name] = data

    def getNodes(self):
        # Inlet nodes:
        nodes = {}
        nodes['i'] = [self.model.nodes[k] for k in self.inlets]
        nodes['o'] = [self.model.nodes[k] for k in self.outlets]

        return nodes


text:
package dk.muj.mujlib.util;

import dk.muj.mujlib.arg.Argument;
import dk.muj.mujlib.arg.ArgumentNullException;
import dk.muj.mujlib.doc.Pure;

import java.util.regex.Pattern;

/**
 * This class has some different utilities
 * for dealing with strings.
 *
 * @author Magnus Ulf Jørgensen
 */
public final class Txt
{
	// -------------------------------------------- //
	// CONSTRUCTOR (FORBIDDEN)
	// -------------------------------------------- //

	private Txt()
	{
		throw new AssertionError();
	}

	// -------------------------------------------- //
	// CONSTANTS
	// -------------------------------------------- //

	public static final Pattern REGEX_WHITESPACE = Pattern.compile("\\s+");

	private static final char[] VOWELS =
	{
		'a', 'e', 'i', 'o', 'u', 'y', 'æ', 'ø', 'å', 'ä', 'ö', 'ü',
		'A', 'E', 'I', 'O', 'U', 'Y', 'Æ', 'Ø', 'Å', 'Ä', 'Ö', 'Ü'
	};

	private static final String[] DIGIT_TO_STRING = {null, "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};

	private static final String[] ELEVEN_THROUGH_NINETEEN = {"eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"};

	private static final String[] TENS_TO_STRING = {null, "ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"};

	private static final String[] POWER_OF_TEN_TO_STRING =
			{
					null,
					"ten",
					"hundred",
					"thousand",
					null,
					null,
					"million",
					null,
					null,
					"billion",
					null,
					null,
					"trillion",
					null,
					null,
					"quadrillion",
					null,
					null
			};

	// -------------------------------------------- //
	// REPEAT
	// -------------------------------------------- //

	/**
	 * Creates a string equal to the passed sequence,
	 * concatenated onto itself X times.
	 * @param cs
	 * The charsequence to repeat.
	 * @param times
	 * The amount of times to repeat the charsequence.
	 * @return str
	 * The charsequence repeated after itself.
	 * @throws ArgumentNullException
	 * if the charsequence is null,
	 * @throws IllegalArgumentException
	 * if the times is less than or equal to 0
	 */
	@Pure
	public static String repeat(final CharSequence cs, final int times) throws ArgumentNullException, IllegalArgumentException
	{
		Argument.handleNull(cs, "cs");
		if (times <= 0) throw new IllegalArgumentException("times: " + times);

		StringBuilder ret = new StringBuilder(times*cs.length());
		for (int i = 0; i < times; i++)
		{
			ret.append(cs);
		}

		assert ret.length() == cs.length()*times;

		return ret.toString();
	}

	/**
	 * Creates a string equal to the passed char,
	 * concatenated onto itself X times.
	 * @param ch
	 * The character to repeat.
	 * @param times
	 * The amount of times to repeat the character.
	 * @return str
	 * The character repeated after itself.
	 * @throws IllegalArgumentException
	 * if the times is less than or equal to 0
	 */
	@Pure
	public static String repeat(final char ch, final int times) throws IllegalArgumentException
	{
		// Checks
		if (times <= 0) throw new IllegalArgumentException("times: " + times);

		// Create, fill, and return.
		char[] ret = new char[times];
		for (int i = 0; i < times; i++)
		{
			ret[i] = ch;
		}

		assert ret.length == times;

		return new String(ret);
	}

	// -------------------------------------------- //
	// LETTER STRING
	// -------------------------------------------- //

	/**
	 * Turns a long such as 1, 2, 3 etc
	 * into a letter string (no digits).
	 * EXAMPLES
	 * 1 turns into "one"
	 * 2 turns into "two"
	 * etc
	 * For negative numbers it will start with "minus "
	 *
	 * The output of this method is undefined.
	 * And nothing is tested.
	 * TODO
	 *
	 * @param number
	 * The number to get a string representation of.
	 * @return
	 * A non-digit string representation of the passed number.
	 */
	@Pure
	public static String letterString(long number)
	{
		// This is just zero
		if (number == 0) return "zero";

		// negative numbers
		if (number < 0) return "minus ".concat(letterString(-number));

		// Special detection, because english makes no sense :P
		if (number >= 11 && number <= 19) return ELEVEN_THROUGH_NINETEEN[ (int) number-11];

		String ret = "";
		for(int idx = 0; number > 0; idx++)
		{
			int digit = (int) number % 10;
			number /= 10;

			if (digit == 0) continue; // Don't add nothingness.
			ret = letterString0(digit, idx).concat(ret);
		}

		assert ! ret.contains("null") : ret;
		assert ! ret.codePoints().anyMatch(Character::isDigit);

		return ret;
	}

	private static String letterString0(int number, int index)
	{
		assert number > 0: "number: " + number;
		assert index >= 0: "index: " + index;

		// Just a simple digit such as 1, 3, 6, 9 or 0
		if (index == 0) return DIGIT_TO_STRING[number];

		// A number such as 10, 30, 60 or 90
		if (index == 1) return TENS_TO_STRING[number];

		// For hundreds
		if (index == 2) return DIGIT_TO_STRING[number] + "hundred";

		final int rest = index % 3;
		String pre = letterString0(number, rest);
		String ret = pre;
		if (rest == 0) ret += " " + POWER_OF_TEN_TO_STRING[index-rest];
		// Higher numbers with many digits.
		return ret + " ";
	}

	// -------------------------------------------- //
	// VOWEL & AAN
	// -------------------------------------------- //

	/**
	 * This method can check if a character is a vowel.
	 * It may not support all unicode characters and all
	 * languages. If it does not, please make a PR so it will.
	 * @param ch
	 * Character to check wether it is a vowel or not.
	 * @return
	 * True if and only if the passed char is a vowel
	 */
	@Pure
	public static boolean isVowel(char ch)
	{
		return ArrayUtil.containsElement(VOWELS, ch);
	}

	/**
	 * This method will return the appropriate
	 * telex ("an" or "a") depending on the passed string.
	 *
	 * @param str
	 * The string to check for what it's telex should be.
	 * @return
	 * "an" if and only if the first character is a vowel.
	 * "a" otherwise.
	 * @throws ArgumentNullException
	 * If str is null.
	 * @throws IllegalArgumentException
	 * If str is empty.
	 */
	@Pure
	public static String aan(String str) throws ArgumentNullException, IllegalArgumentException
	{
		Argument.handleNull(str, "str");
		if (str.isEmpty()) throw new IllegalArgumentException("str is empty");
		return isVowel(str.charAt(0)) ? "an" : "a";
	}

}


text:
This is HTML5 application, built with [Brunch](http://brunch.io).

## Getting started
* Install [Brunch](http://brunch.io): `npm install -g brunch`.
* Install Brunch plugins: `npm install`.
* Install [Bower](http://bower.io) components: `bower install`
* Watch the project with continuous rebuild by
`brunch watch --server`. This will also launch HTTP server.
* Or build the minified project with `brunch build --optimize`.

Open the `public/` dir to see the result.

* Write your code in `app` dir.
* Put static files that should be copied (index.html etc) to `app/assets`.
* Manage dependencies with [Bower](http://bower.io) or simply put
  third-party styles & scripts in `vendor` dir.
=======
brunch-with-beer
================

Brunch skeleton: Chaplin (w/ Backbone), Bootstrap (w/ font-awesome and jQuery), CoffeeScript, Eco, Stylus, Lodash (w/ underscore.string) and tasks manager exemple


text:
package pipe_test

import (
	"context"
	"github.com/akaspin/logx"
	"github.com/akaspin/soil/agent/bus"
	"github.com/akaspin/soil/agent/bus/pipe"
	"github.com/akaspin/soil/fixture"
	"testing"
)

func TestCompositePipe_ConsumeMessage(t *testing.T) {
	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()
	dummy := bus.NewTestingConsumer(ctx)
	strictPipe := pipe.NewStrict("test", logx.GetLog("test"), dummy, "1", "2")

	t.Run("1", func(t *testing.T) {
		strictPipe.ConsumeMessage(bus.NewMessage("1", map[string]string{
			"1": "1",
		}))
		fixture.WaitNoErrorT(t, fixture.DefaultWaitConfig(), dummy.ExpectMessagesFn(
			bus.NewMessage("test", nil),
		))
	})
	t.Run("2", func(t *testing.T) {
		strictPipe.ConsumeMessage(bus.NewMessage("2", map[string]string{
			"2": "2",
		}))
		fixture.WaitNoErrorT(t, fixture.DefaultWaitConfig(), dummy.ExpectMessagesFn(
			bus.NewMessage("test", nil),
			bus.NewMessage("test", map[string]string{
				"1.1": "1",
				"2.2": "2",
			}),
		))
	})
	t.Run("2 off", func(t *testing.T) {
		strictPipe.ConsumeMessage(bus.NewMessage("2", nil))
		fixture.WaitNoErrorT(t, fixture.DefaultWaitConfig(), dummy.ExpectMessagesFn(
			bus.NewMessage("test", nil),
			bus.NewMessage("test", map[string]string{
				"1.1": "1",
				"2.2": "2",
			}),
			bus.NewMessage("test", nil),
		))
	})
	t.Run("2 on", func(t *testing.T) {
		strictPipe.ConsumeMessage(bus.NewMessage("2", map[string]string{
			"2": "3",
		}))
		fixture.WaitNoErrorT(t, fixture.DefaultWaitConfig(), dummy.ExpectMessagesFn(
			bus.NewMessage("test", nil),
			bus.NewMessage("test", map[string]string{
				"1.1": "1",
				"2.2": "2",
			}),
			bus.NewMessage("test", nil),
			bus.NewMessage("test", map[string]string{
				"1.1": "1",
				"2.2": "3",
			}),
		))
	})
}


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jtj.web.dao.RoleDao">

    <insert id="add">
        INSERT INTO auth_role(name, status)
        VALUES (#{name},#{status})
    </insert>

    <update id="update">
        UPDATE auth_role
        <set>
            <if test=" name != '' and name != null ">
                name = #{name},
            </if>
            <if test="status != null ">
                status = #{status},
            </if>
        </set>
        WHERE id = #{id}
    </update>

    <delete id="delete">
        DELETE FROM auth_role WHERE id IN
        <foreach collection="ids" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>

    <sql id="roleConditions">
        <if test="name != null and name != ''">
            AND ${alias}.name = #{name}
        </if>
        <if test="status != null">
            AND ${alias}.status = #{status}
        </if>
    </sql>

    <select id="getList" resultType="Role">
        SELECT
        ar.*
        FROM auth_role ar
        <where>
            <include refid="roleConditions">
                <property name="alias" value="ar"/>
            </include>
        </where>
        LIMIT #{begin},#{offset}
    </select>

    <select id="getNum" resultType="int">
        SELECT
        count(1)
        FROM auth_role ar
        <where>
            <include refid="roleConditions">
                <property name="alias" value="ar"/>
            </include>
        </where>
    </select>

    <select id="getRoleMap" resultType="KeyValue">
        SELECT
        ar.id "key",
        ar.name "value"
        FROM auth_role ar
        WHERE ar.status = 1
    </select>

    <delete id="clearPermission">
        DELETE FROM auth_role_permission_relation WHERE role_id = #{roleId}
    </delete>

    <insert id="addPermission">
        INSERT INTO auth_role_permission_relation(role_id, permission_id) VALUES
        <foreach collection="permissionIds" item="item" separator=",">
            (#{roleId},#{item})
        </foreach>
    </insert>

    <select id="getPermission" resultType="Permission">
        SELECT
        ap.*
        FROM auth_role_permission_relation arpr
        LEFT JOIN auth_permission ap ON arpr.permission_id = ap.id
        WHERE arpr.role_id = #{roleId}
    </select>

</mapper>


text:
package main

import (
	"io"
	"log"
	"net/http"
	"os"

	"github.com/julienschmidt/httprouter"
)

// Handle  实现http操作
type Handle struct {
	dst string
}

func (h *Handle) uploadFile(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {

	if err := h.saveUploadFile(r.Body, h.dst); err != nil {
		w.WriteHeader(http.StatusInternalServerError)
		log.Println(err.Error())
		w.Write([]byte(err.Error()))
		return
	}
}

func (h *Handle) saveUploadFile(src io.ReadCloser, dst string) error {
	defer src.Close()

	out, err := os.Create(dst)
	if err != nil {
		return err
	}
	defer out.Close()

	_, err = io.Copy(out, src)
	return err
}


text:
({
    testClearAndReplaceWholeArrayInAttribute: {
        test: [
            function(cmp) {
                cmp.set("v.listdata",[]);
            }, function(cmp) {
                var expected = [];
                var elements = cmp.find("iterationOnArrayAttribute").getElements();
                $A.test.assertEquals(expected.length, elements.length, "number of element in iteration component is not expected after clear v.listdata." );

                cmp.set("v.listdata",[0,1,2,3,4,5,6,7,8,9]);
            }, function(cmp) {
                var expected = [0,1,2,3,4,5,6,7,8,9];
                var elements = cmp.find("iterationOnArrayAttribute").getElements();
                $A.test.assertEquals( expected.length, elements.length, "number of element in iteration component is not expected after replace v.listdata." );
                for(var i = 0; i< expected.length; i++) {
                    $A.test.assertEquals( i+":"+expected[i], $A.test.getText(elements[i]), "after replace v.listdata ,get unexpected iteration element at index#" + i);
                }
            }
        ]
    },

    testClearAndReplaceWholeArrayInIteration: {
        test: [
            function(cmp) {
                var iter = cmp.find("iterationOnArrayAttribute");
                iter.set("v.items",[]);
            }, function(cmp) {
                var expected = [];
                var iterCmpEle = cmp.find("iterationOnArrayAttribute").getElements();
                $A.test.assertEquals( expected.length, iterCmpEle.length, "number of element in iteration component is not expected after clear v.items in iteration." );

                var iter = cmp.find("iterationOnArrayAttribute");
                iter.set("v.items",[0,1,2,3,4,5,6,7,8,9], true);
            }, function(cmp) {
                var expected = [0,1,2,3,4,5,6,7,8,9];
                var iterCmpEle = cmp.find("iterationOnArrayAttribute").getElements();
                $A.test.assertEquals( expected.length, iterCmpEle.length, "number of element in iteration component is not expected after replace v.items in iteration." );
                for(var i = 0; i< expected.length; i++) {
                    $A.test.assertEquals( i+":"+expected[i], $A.test.getText(iterCmpEle[i]), "after replace v.itemss in iteration ,get unexpected iteration element at index#"+i );
                }
            }
        ]
    },

    testChangeStartAndEnd: {
        attributes: {start:0, end:5},
        test: [
            function(cmp) {
                cmp.set("v.start", 1);
            }, function(cmp) {
                var iterCmpEle = cmp.find("iterationOnArrayAttribute").getElements();
                var expected = [1, 2, 3, 4];
                $A.test.assertEquals( expected.length, iterCmpEle.length, "number of element in iteration component is not expected after change start to 1" );
                for(var i = 0; i< expected.length; i++) {
                    $A.test.assertEquals( (i+1)+":"+expected[i], $A.test.getText(iterCmpEle[i]), "after change start to 0. unexpected iteration element at index#"+i );
                }
            }, function(cmp) {
                cmp.set("v.end", 4);
            }, function(cmp) {
                var iterCmpEle = cmp.find("iterationOnArrayAttribute").getElements();
                var expected = [1, 2, 3];
                $A.test.assertEquals( expected.length, iterCmpEle.length, "number of element in iteration component is not expected after change end to 4." );
                for(var i = 0; i< expected.length; i++) {
                    $A.test.assertEquals( (i+1)+":"+expected[i], $A.test.getText(iterCmpEle[i]), "after change end to 4. unexpected iteration element at index#"+i );
                }
            }
        ]
    },

    testSetItemsInIteration:{
        attributes:{ indexToChange:1 , newValueToChange:999 },
        test: [
            function(cmp) {
                var index = parseInt(cmp.get("v.indexToChange"), 10);
                var newValue = cmp.get("v.newValueToChange");
                var iter = cmp.find("iterationOnArrayAttribute");
                var data = iter.get("v.items");
                data[index] = newValue;
                iter.set("v.items", data, true);
            }, function(cmp) {
                var iterCmpEle = cmp.find("iterationOnArrayAttribute").getElements();
                var expected = [0, "999", 2, 3, 4];

                $A.test.assertEquals( expected.length, iterCmpEle.length, "number of element in iteration component is not expected." );
                for(var i = 0; i< expected.length; i++) {
                    $A.test.assertEquals( i+":"+expected[i], $A.test.getText(iterCmpEle[i]), "unexpected iteration element at index#"+i );
                }

                //second assertion this test, we need to check attribute is updated after changing the iteration cmp
                var v_listdata = cmp.get("v.listdata");
                for(var i = 0; i < v_listdata.length; i++) {
                    $A.test.assertEquals( expected[i].toString(), v_listdata[i].toString(), "unexpected map data at index#"+i );
                }
            }
        ]
    },

    testSetItemsInAttribute: {
        attributes:{ indexToChange:1 , newValueToChange:999 },
        test: [
            function(cmp){
                var index = parseInt(cmp.get("v.indexToChange"), 10);
                var newValue = cmp.get("v.newValueToChange");
                var data = cmp.get("v.listdata");
                data[index] =  newValue;
                cmp.set("v.listdata", data);
            }, function(cmp) {
                var iterCmpEle = cmp.find("iterationOnArrayAttribute").getElements();
                var expected = [0, "999", 2, 3, 4];

                $A.test.assertEquals( expected.length, iterCmpEle.length, "number of element in iteration component is not expected." );
                for(var i = 0; i< expected.length; i++) {
                    $A.test.assertEquals( i+":"+expected[i], $A.test.getText(iterCmpEle[i]), "unexpected iteration element at index#"+i );
                }
            }
        ]
    },

    testInsertItemsInIteration: {
        attributes:{ indexToInsert:0 , newValueToInsert:0 },
        test: [
                function(cmp){
                var index = parseInt(cmp.get("v.indexToInsert"), 10);
                var newValue = cmp.get("v.newValueToInsert");
                var iter = cmp.find("iterationOnArrayAttribute");
                var data = iter.get("v.items");
                data.splice( index, 0, newValue);
                iter.set("v.items", data, true);
            }, function(cmp) {
                var iterCmpEle = cmp.find("iterationOnArrayAttribute").getElements();
                var expected = ["0", 0, 1, 2, 3, 4];

                $A.test.assertEquals( expected.length, iterCmpEle.length, "number of element in iteration component is not expected." );
                for(var i = 0; i< expected.length; i++) {
                    $A.test.assertEquals( i+":"+expected[i], $A.test.getText(iterCmpEle[i]), "unexpected iteration element at index#"+i );
                }

                //second assertion this test, we need to check attribute is updated after changing the iteration cmp
                var v_listdata = cmp.get("v.listdata");
                for(var i = 0; i < v_listdata.length; i++) {
                    $A.test.assertEquals( expected[i].toString(), v_listdata[i].toString(), "unexpected map data at index#"+i );
                }
            }
        ]
    },

    testInsertItemsInAttribute: {
        attributes:{ indexToInsert:0 , newValueToInsert:0 },
        test: [
            function(cmp){
                var index = parseInt(cmp.get("v.indexToInsert"), 10);
                var newValue = cmp.get("v.newValueToInsert");
                var data = cmp.get("v.listdata");
                data.splice( index, 0, newValue);
                cmp.set("v.listdata", data);
            }, function(cmp) {
                var iterCmpEle = cmp.find("iterationOnArrayAttribute").getElements();
                var expected = ["0", 0, 1, 2, 3, 4];

                $A.test.assertEquals( expected.length, iterCmpEle.length, "number of element in iteration component is not expected." );
                for(var i = 0; i< expected.length; i++) {
                    $A.test.assertEquals( i+":"+expected[i], $A.test.getText(iterCmpEle[i]), "unexpected iteration element at index#"+i );
                }
            }
        ]
    },

    testDeleteItemsInIteration: {
        attributes:{ indexToDelete:0 },
        test: [
            function(cmp){
                var index = parseInt(cmp.get("v.indexToInsert"), 10);
                var iter = cmp.find("iterationOnArrayAttribute");
                var data = iter.get("v.items");
                data.splice( index, 1);
                iter.set("v.items", data);
            }, function(cmp) {
                var iterCmpEle = cmp.find("iterationOnArrayAttribute").getElements();
                var expected = [1, 2, 3, 4];

                $A.test.assertEquals( expected.length, iterCmpEle.length, "number of element in iteration component is not expected." );
                for(var i = 0; i< expected.length; i++) {
                    $A.test.assertEquals( i+":"+expected[i], $A.test.getText(iterCmpEle[i]), "unexpected iteration element at index#"+i );
                }

                //second assertion this test, we need to check attribute is updated after changing the iteration cmp
                var v_listdata = cmp.get("v.listdata");
                for(var i = 0; i < v_listdata.length; i++) {
                    $A.test.assertEquals( expected[i].toString(), v_listdata[i].toString(), "unexpected map data at index#"+i );
                }
            }
        ]
    },

    testDeleteItemsInAttribute: {
        attributes:{ indexToDelete:0 },
        test: [
            function(cmp){
                var index = parseInt(cmp.get("v.indexToInsert"), 10);
                var data = cmp.get("v.listdata");
                data.splice( index, 1);
                cmp.set("v.listdata", data);
            }, function(cmp) {
                var iterCmpEle = cmp.find("iterationOnArrayAttribute").getElements();
                var expected = [1, 2, 3, 4];

                $A.test.assertEquals( expected.length, iterCmpEle.length, "number of element in iteration component is not expected." );
                for(var i = 0; i< expected.length; i++) {
                    $A.test.assertEquals( i+":"+expected[i], $A.test.getText(iterCmpEle[i]), "unexpected iteration element at index#"+i );
                }
            }
        ]
    }

})


text:
<?php

namespace Eotvos\VersenyrBundle\Cwm;

use Cancellar\CommonBundle\Cwm\ModuleInterface;

class VersenyrModule implements ModuleInterface
{

    public function getDependencies()
    {
        return array();
    }

    public function getAdminModule()
    {
        return new VersenyrAdminModule();
    }
}


text:
module Homeflow
  module API
    class RdaUserPreference < Resource

      is_resource :rda_user_preferences

      def self.find_by_user_id(user_id)
        Request.run_for(Homeflow::API::ResourceIdentifier.new("/users/#{user_id}/rda_user_preference"))
      end

    end
  end
end


text:
[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

Builds an interpolator that acts on two 4x4 matrices, using algorithms from [W3C Spec](http://www.w3.org/TR/css3-transforms/#matrix-interpolation) to produce consistent results with CSS animations. Translation, scale, skew and perspective are interpolated linearly, and rotation is interpolated with spherical interpolation.

```js
var start = mat4.create()
var end = mat4.fromRotationTranslation([], [0,1,0,0], [20, 50, -10])
var out = mat4.create()

//create the interpolator
var lerp = require('mat4-interpolator')(start, end)

if (!lerp) {
    //returns false is the matrices cannot be inverted
    //in this case you need to fall back to your own animation method
    lerp = discreteAnimator
}

//.. in your render loop
function render() {
    //interpolate based on alpha, storing results in 'out' matrix
    lerp(out, alpha)
}
```

**Note:** [mat4-interpolate](https://www.npmjs.com/package/mat4-interpolate) is recommended for most use cases, but this module may be useful to avoid decomposing static matrices every frame.

You can run the demo on RequireBin:

http://requirebin.com/?gist=1347c3e7fd430a191545

## Usage

[![NPM](https://nodei.co/npm/mat4-interpolator.png)](https://nodei.co/npm/mat4-interpolator/)

#### `lerp = createInterpolator(start, end)`

Creates an interpolator function that acts on the target start and end matrices. This will decompose the two matrices into components. If either matrix is non-invertible (i.e. scale or perspective W of zero), this method returns `false`. W3C suggests falling back to discrete animations in this case.

#### `lerp(out, alpha)`

The returned function accepts an `out` matrix for storing the interpolated results, and an `alpha` for how much to interpolate.

Returns the `out` matrix.

## License

MIT, see [LICENSE.md](http://github.com/mattdesl/mat4-interpolator/blob/master/LICENSE.md) for details.


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

import java.util.*;

/**
 *
 * @author knauth
 */
public interface IDeserializer
{

	////////////////////////////////////////////////////////////////
	// Constants
	////////////////////////////////////////////////////////////////

	////////////////////////////////////////////////////////////////
	// Variables
	////////////////////////////////////////////////////////////////

	////////////////////////////////////////////////////////////////
	// Constructors
	////////////////////////////////////////////////////////////////

	////////////////////////////////////////////////////////////////
	// Methods
	////////////////////////////////////////////////////////////////

	public IDeserializer readNested() throws Exception;

	public byte[] readBinary() throws Exception;

	public byte[] readBinaryFixed(int len) throws Exception;

	public String readASCIIFixed(int len) throws Exception;

	public String readUTF8() throws Exception;

	public String[] readUTF8Array() throws Exception;

	public int readInt32() throws Exception;

	public HashMap<String, String> readStringHashMap() throws Exception;

	public void close() throws Exception;

}


text:
UNIX_InstalledSoftwareElementProvider::UNIX_InstalledSoftwareElementProvider()
{
}

UNIX_InstalledSoftwareElementProvider::~UNIX_InstalledSoftwareElementProvider()
{
}

CIMInstance UNIX_InstalledSoftwareElementProvider::constructInstance(
	const CIMName &className,
	const CIMNamespaceName &nameSpace,
	const UNIX_InstalledSoftwareElement &_p) const
{
	CIMProperty p;

	CIMInstance inst(className);

	// Set path
	inst.setPath(CIMObjectPath(String(""), // hostname
			nameSpace,
			CIMName("UNIX_InstalledSoftwareElement"),
			constructKeyBindings(_p)));

	//CIM_InstalledSoftwareElement Properties
	if (_p.getSoftware(p)) inst.addProperty(p);
	if (_p.getSystem(p)) inst.addProperty(p);

	return inst;
}

Array<CIMKeyBinding> UNIX_InstalledSoftwareElementProvider::constructKeyBindings(const UNIX_InstalledSoftwareElement& _p) const

{

	Array<CIMKeyBinding> keys;

	CIMKeyBinding k1(
		PROPERTY_SOFTWARE,
		CIMValue(_p.getSoftware().getPath()));
	k1.setType(CIMKeyBinding::REFERENCE);
	CIMKeyBinding k2(
		PROPERTY_SYSTEM,
		CIMValue(_p.getSystem().getPath()));
	k2.setType(CIMKeyBinding::REFERENCE);

	keys.append(k1);
	keys.append(k2);

	return keys;
}

#define UNIX_PROVIDER UNIX_InstalledSoftwareElementProvider
#define UNIX_PROVIDER_NAME "UNIX_InstalledSoftwareElementProvider"
#define CLASS_IMPLEMENTATION UNIX_InstalledSoftwareElement
#define CLASS_IMPLEMENTATION_NAME "UNIX_InstalledSoftwareElement"
#define BASE_CLASS_NAME "CIM_InstalledSoftwareElement"
#define NUMKEYS_CLASS_IMPLEMENTATION 2

#include "UNIXProviderBase.hpp"


text:
package org.asteriskjava.manager.action;

/**
 * The PauseMonitorAction temporarily stop monitoring (recording) a channel.
 *

 * It is implemented in res/res_monitor.c
 *

 * Available since Asterisk 1.4.
 *
 * @see UnpauseMonitorAction
 * @author srt
 * @since 0.3
 * @version $Id$
 */
public class PauseMonitorAction extends AbstractManagerAction
{
    /**
     * Serializable version identifier
     */
    private static final long serialVersionUID = -6316010713240389305L;

    /**
     * The name of the channel to temporarily stop monitoring.
     */
    private String channel;

    /**
     * Creates a new empty PauseMonitorAction.
     */
    public PauseMonitorAction()
    {

    }

    /**
     * Creates a new PauseMonitorAction that temporarily stops monitoring the
     * given channel.
     *
     * @param channel the name of the channel to temporarily stop monitoring.
     */
    public PauseMonitorAction(String channel)
    {
        this.channel = channel;
    }

    /**
     * Returns the name of this action, i.e. "PauseMonitor".
     *
     * @return the name of this action.
     */
    @Override
   public String getAction()
    {
        return "PauseMonitor";
    }

    /**
     * Returns the name of the channel to temporarily stop monitoring.
     *
     * @return the name of the channel to temporarily stop monitoring.
     */
    public String getChannel()
    {
        return channel;
    }

    /**
     * Sets the name of the channel to temporarily stop monitoring.
     *

     * This property is mandatory.
     *
     * @param channel the name of the channel to temporarily stop monitoring.
     */
    public void setChannel(String channel)
    {
        this.channel = channel;
    }
}


text:
<?php

namespace Rxnet\Transport;

use MongoDB\Driver\Exception\Exception;
use React\EventLoop\LoopInterface;

class FilterableStream extends BufferedStream
{
    protected $predicates = [];

    public function __construct($socket, LoopInterface $loop)
    {
        parent::__construct($socket, $loop);
    }

    public function filter(callable $predicate)
    {
        $this->predicates[] = $predicate;
        return $this;
    }

    public function notifyNext($data)
    {
        $notify = true;
        try {
            foreach ($this->predicates as $predicate) {
                if (!call_user_func($predicate, $data)) {
                    $notify = false;
                    break;
                }
            }
        }
        catch (Exception $e) {
            $this->notifyError($e);
        }
        if ($notify) {
            parent::notifyNext($data);
        }
    }

}


text:
#include <jansson.h>
#include <string.h>

#include "config_util.h"
#include "log_util.h"

void parse_config(char* config, options_t* options,
                  hardware_info_t* hardware_info) {
  json_t* json_root;
  json_error_t json_error;
  json_root = json_loads(config, 0, &json_error);
  if (json_root == NULL) {
    logging(LOG_CODE_FATAL,
            "Error parsing JSON config file at line %d, column %d: %s\n",
            json_error.line, json_error.column, json_error.text);
  }

  // Application information
  json_t* app_dict = json_object_get(json_root, "application");
  const char* app_key;
  json_t* app_value;
  options->num_of_applications = 0;
  json_object_foreach (app_dict, app_key, app_value) {
    if (options->num_of_applications >= MAX_NUM_APPLICATIONS) {
      logging(LOG_CODE_FATAL, "Too many applications to monitor (max is %d)\n",
              MAX_NUM_APPLICATIONS);
    }

    // Parse hostname
    json_t* json_hostname = json_object_get(app_value, "hostname");
    // Check if hostname is provided
    if (json_hostname == NULL) {
      logging(LOG_CODE_FATAL,
              "Application %s does not contain a hostname (required).\n",
              app_key);
    // Check if the provided hostname is a string
    } else if (!json_is_string(json_hostname)) {
      logging(LOG_CODE_FATAL,
              "The hostname of application %s is not a string.\n", app_key);
    }
    // Parse port
    json_t* json_port = json_object_get(app_value, "port");
    // Check if port is provided
    if (json_hostname == NULL) {
      logging(LOG_CODE_FATAL,
              "Application %s does not contain a port (required).\n", app_key);
    // Check if the provided port is an integer
    } else if (!json_is_integer(json_port)) {
      logging(LOG_CODE_FATAL,
              "The hostname of application %s is not an integer.\n", app_key);
    }

    // Record the parsed information into options
    strcpy(options->applications[options->num_of_applications], app_key);
    strcpy(options->hostnames[options->num_of_applications],
           json_string_value(json_hostname));
    options->ports[options->num_of_applications] =
        json_integer_value(json_port);
    logging(LOG_CODE_INFO, "Start monitoring application: %s at %s:%d.\n",
            options->applications[options->num_of_applications],
            options->hostnames[options->num_of_applications],
            options->ports[options->num_of_applications]);

    // Increment the application counter
    options->num_of_applications++;
  }

  // PMU counters
  int num_of_events = 0;
  json_t* pmu_list = json_object_get(json_root, "pmu");
  size_t pmu_index;
  json_t* pmu_value;

  memset(options->events, 0, sizeof(options->events));

  json_array_foreach (pmu_list, pmu_index, pmu_value) {
    if (!json_is_string(pmu_value)) {
      logging(LOG_CODE_FATAL,
              "The %zuth PMU event is not an integer.\n", pmu_index + 1);
    }
    options->events[num_of_events] =
        (const char*)&options->events_buffer[num_of_events];
    const char* pmu_name = json_string_value(pmu_value);
    strcpy(options->events_buffer[num_of_events], pmu_name);
    num_of_events++;

    logging(LOG_CODE_INFO, "PMU event %s registered.\n", pmu_name);
  }

  // Add PMU counters for NUMA events (local memory access)
  options->events[num_of_events] =
      (const char*)&options->events_buffer[num_of_events];
  strcpy(options->events_buffer[num_of_events], PMU_NUMA_LMA);
  num_of_events++;
  logging(LOG_CODE_INFO, "PMU event %s registered.\n", PMU_NUMA_LMA);

  // Add PMU counters for NUMA events (remote memory access)
  options->events[num_of_events] =
      (const char*)&options->events_buffer[num_of_events];
  strcpy(options->events_buffer[num_of_events], PMU_NUMA_RMA);
  num_of_events++;
  logging(LOG_CODE_INFO, "PMU event %s registered.\n", PMU_NUMA_RMA);

  hardware_info->num_of_events = num_of_events;

  // Number of processes to monitor that are utilizing the most resources
  json_t* num_of_processes = json_object_get(json_root, "num_of_processes");
  options->num_of_processes = json_integer_value(num_of_processes);
  logging(LOG_CODE_INFO, "Monitoring the top %d processes.\n",
          options->num_of_processes);

  // Clean up
  json_decref(json_root);
}


text:
class LogParser
  module Exceptions
    class FileNotFound < ::Exception

      def initialize(message=nil, object=nil)
        message ||= 'Cannot find the specified log file'
        super(message)
        @object = object
      end
    end
  end
end


text:
/*
Utilities for working with CodeMirror.
*/

import Utils from "../utils/Utils";
import $ from "../utils/DOMUtils";

let CMUtils = {};
export default CMUtils;

CMUtils.create = function (target, opts={}, width="100%", height="100%") {
	let keys = {}, ctrlKey = Utils.getCtrlKey();
	//keys[ctrlKey + "-Z"] = keys[ctrlKey + "-Y"] = keys["Shift-" + ctrlKey + "-Z"] = () => false; // block CM handling

	let o = Utils.copy({
		lineNumbers: false,
		tabSize: 3,
		indentWithTabs: true,
		extraKeys: keys,
		specialChars: /[ \u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/,
		specialCharPlaceholder: (ch) => $.create("span", ch === " " ? "cm-space" : "cm-special", " ") // needs to be a space so wrapping works
	}, opts);

	let cm = CodeMirror(target, o);
	cm.setSize(width, height);

	if (cm.getOption("maxLength")) {
		cm.on("beforeChange", CMUtils.enforceMaxLength);
	}
	if (cm.getOption("singleLine")) {
		cm.on("beforeChange", CMUtils.enforceSingleLine);
	}

	return cm;
};

CMUtils.getCharIndexAt = function (cm, winX, winY) {
	let pos = cm.coordsChar({left: winX, top: winY}, "page");
	// test current and prev character, since CM seems to use the center of each character for coordsChar:
	for (let i = 0; i <= 1; i++) {
		let rect = cm.charCoords(pos, "page");
		if (winX >= rect.left && winX <= rect.right && winY >= rect.top && winY <= rect.bottom) {
			return cm.indexFromPos(pos);
		}
		if (pos.ch-- <= 0) {
			break;
		}
	}
	return null;
};
/*
// unused?
CMUtils.getEOLPos = function (cm, pos) {
	if (!isNaN(pos)) {
		pos = cm.posFromIndex(pos);
	}
	let rect = cm.charCoords(pos, "local"), w = cm.getScrollInfo().width;
	return cm.coordsChar({left: w - 1, top: rect.top}, "local");
};
*/
CMUtils.getCharRect = function (cm, index) {
	if (index == null) { return null; }
	let pos = cm.posFromIndex(index), rect = cm.charCoords(pos);
	rect.x = rect.left;
	rect.y = rect.top;
	rect.width = rect.right - rect.left;
	rect.height = rect.bottom - rect.top;
	return rect;
};

CMUtils.enforceMaxLength = function (cm, change) {
	let maxLength = cm.getOption("maxLength");
	if (maxLength && change.update) {
		let str = change.text.join("\n");
		let delta = str.length - (cm.indexFromPos(change.to) - cm.indexFromPos(change.from));
		if (delta <= 0) { return true;
		}
		delta = cm.getValue().length + delta - maxLength;
		if (delta > 0) {
			str = str.substr(0, str.length - delta);
			change.update(change.from, change.to, str.split("\n"));
		}
	}
	return true;
};

CMUtils.enforceSingleLine = function (cm, change) {
	if (change.update) {
		let str = change.text.join("").replace(/(\n|\r)/g, "");
		change.update(change.from, change.to, [str]);
	}
	return true;
};

CMUtils.selectAll = function(cm) {
	cm.focus();
	cm.setSelection({ch:0,line:0},{ch:0, line:cm.lineCount()});
}


text:
class CrashHandler {
 public:
  CrashHandler();
  static void SendMiniDump();
};


text:
module Azure::GraphRbac::V1_6
  module Models
    #
    # Active Directory error information.
    #
    class GraphError

      include MsRestAzure

      # @return [String] Error code.
      attr_accessor :code

      # @return [String] Error message value.
      attr_accessor :message

      #
      # Mapper for GraphError class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'GraphError',
          type: {
            name: 'Composite',
            class_name: 'GraphError',
            model_properties: {
              code: {
                client_side_validation: true,
                required: false,
                serialized_name: 'odata\\.error.code',
                type: {
                  name: 'String'
                }
              },
              message: {
                client_side_validation: true,
                required: false,
                serialized_name: 'odata\\.error.message.value',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
// Copyright 2016 The Bazel Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.devtools.build.lib.remote;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.util.concurrent.MoreExecutors.directExecutor;

import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.ListeningScheduledExecutorService;
import com.google.devtools.build.lib.exec.ExecutionOptions;
import com.google.devtools.build.lib.exec.ModuleActionContextRegistry;
import com.google.devtools.build.lib.exec.SpawnCache;
import com.google.devtools.build.lib.exec.SpawnStrategyRegistry;
import com.google.devtools.build.lib.packages.semantics.BuildLanguageOptions;
import com.google.devtools.build.lib.remote.common.RemoteExecutionClient;
import com.google.devtools.build.lib.remote.common.RemotePathResolver;
import com.google.devtools.build.lib.remote.common.RemotePathResolver.DefaultRemotePathResolver;
import com.google.devtools.build.lib.remote.common.RemotePathResolver.SiblingRepositoryLayoutResolver;
import com.google.devtools.build.lib.remote.options.RemoteOptions;
import com.google.devtools.build.lib.remote.util.DigestUtil;
import com.google.devtools.build.lib.remote.util.TempPathGenerator;
import com.google.devtools.build.lib.runtime.CommandEnvironment;
import com.google.devtools.build.lib.vfs.Path;
import java.util.concurrent.Executor;
import javax.annotation.Nullable;

/** Provides a remote execution context. */
final class RemoteActionContextProvider {

  private final Executor executor;
  private final CommandEnvironment env;
  @Nullable private final RemoteCache remoteCache;
  @Nullable private final RemoteExecutionClient remoteExecutor;
  @Nullable private final ListeningScheduledExecutorService retryScheduler;
  private final DigestUtil digestUtil;
  @Nullable private final Path logDir;
  private TempPathGenerator tempPathGenerator;
  private RemoteExecutionService remoteExecutionService;
  @Nullable private RemoteActionInputFetcher actionInputFetcher;

  private RemoteActionContextProvider(
      Executor executor,
      CommandEnvironment env,
      @Nullable RemoteCache remoteCache,
      @Nullable RemoteExecutionClient remoteExecutor,
      @Nullable ListeningScheduledExecutorService retryScheduler,
      DigestUtil digestUtil,
      @Nullable Path logDir) {
    this.executor = executor;
    this.env = Preconditions.checkNotNull(env, "env");
    this.remoteCache = remoteCache;
    this.remoteExecutor = remoteExecutor;
    this.retryScheduler = retryScheduler;
    this.digestUtil = digestUtil;
    this.logDir = logDir;
  }

  public static RemoteActionContextProvider createForPlaceholder(
      CommandEnvironment env,
      ListeningScheduledExecutorService retryScheduler,
      DigestUtil digestUtil) {
    return new RemoteActionContextProvider(
        directExecutor(),
        env,
        /*remoteCache=*/ null,
        /*remoteExecutor=*/ null,
        retryScheduler,
        digestUtil,
        /*logDir=*/ null);
  }

  public static RemoteActionContextProvider createForRemoteCaching(
      Executor executor,
      CommandEnvironment env,
      RemoteCache remoteCache,
      ListeningScheduledExecutorService retryScheduler,
      DigestUtil digestUtil) {
    return new RemoteActionContextProvider(
        executor,
        env,
        remoteCache,
        /*remoteExecutor=*/ null,
        retryScheduler,
        digestUtil,
        /*logDir=*/ null);
  }

  public static RemoteActionContextProvider createForRemoteExecution(
      Executor executor,
      CommandEnvironment env,
      RemoteExecutionCache remoteCache,
      RemoteExecutionClient remoteExecutor,
      ListeningScheduledExecutorService retryScheduler,
      DigestUtil digestUtil,
      Path logDir) {
    return new RemoteActionContextProvider(
        executor, env, remoteCache, remoteExecutor, retryScheduler, digestUtil, logDir);
  }

  private RemotePathResolver createRemotePathResolver() {
    Path execRoot = env.getExecRoot();
    BuildLanguageOptions buildLanguageOptions =
        env.getOptions().getOptions(BuildLanguageOptions.class);
    RemotePathResolver remotePathResolver;
    if (buildLanguageOptions != null && buildLanguageOptions.experimentalSiblingRepositoryLayout) {
      RemoteOptions remoteOptions = checkNotNull(env.getOptions().getOptions(RemoteOptions.class));
      remotePathResolver =
          new SiblingRepositoryLayoutResolver(
              execRoot, remoteOptions.incompatibleRemoteOutputPathsRelativeToInputRoot);
    } else {
      remotePathResolver = new DefaultRemotePathResolver(execRoot);
    }
    return remotePathResolver;
  }

  public void setActionInputFetcher(RemoteActionInputFetcher actionInputFetcher) {
    this.actionInputFetcher = actionInputFetcher;
  }

  private RemoteExecutionService getRemoteExecutionService() {
    if (remoteExecutionService == null) {
      Path workingDirectory = env.getWorkingDirectory();
      RemoteOptions remoteOptions = checkNotNull(env.getOptions().getOptions(RemoteOptions.class));
      Path captureCorruptedOutputsDir = null;
      if (remoteOptions.remoteCaptureCorruptedOutputs != null
          && !remoteOptions.remoteCaptureCorruptedOutputs.isEmpty()) {
        captureCorruptedOutputsDir =
            workingDirectory.getRelative(remoteOptions.remoteCaptureCorruptedOutputs);
      }

      boolean verboseFailures =
          checkNotNull(env.getOptions().getOptions(ExecutionOptions.class)).verboseFailures;
      remoteExecutionService =
          new RemoteExecutionService(
              executor,
              env.getReporter(),
              verboseFailures,
              env.getExecRoot(),
              createRemotePathResolver(),
              env.getBuildRequestId(),
              env.getCommandId().toString(),
              digestUtil,
              checkNotNull(env.getOptions().getOptions(RemoteOptions.class)),
              remoteCache,
              remoteExecutor,
              tempPathGenerator,
              captureCorruptedOutputsDir);
      env.getEventBus().register(remoteExecutionService);
    }

    return remoteExecutionService;
  }

  /**
   * Registers a remote spawn strategy if this instance was created with an executor, otherwise does
   * nothing.
   *
   * @param registryBuilder builder with which to register the strategy
   */
  public void registerRemoteSpawnStrategy(SpawnStrategyRegistry.Builder registryBuilder) {
    boolean verboseFailures =
        checkNotNull(env.getOptions().getOptions(ExecutionOptions.class)).verboseFailures;
    RemoteSpawnRunner spawnRunner =
        new RemoteSpawnRunner(
            env.getExecRoot(),
            checkNotNull(env.getOptions().getOptions(RemoteOptions.class)),
            env.getOptions().getOptions(ExecutionOptions.class),
            verboseFailures,
            env.getReporter(),
            retryScheduler,
            logDir,
            getRemoteExecutionService());
    registryBuilder.registerStrategy(
        new RemoteSpawnStrategy(env.getExecRoot(), spawnRunner, verboseFailures), "remote");
  }

  /**
   * Registers a spawn cache action context
   *
   * @param registryBuilder builder with which to register the cache
   */
  public void registerSpawnCache(ModuleActionContextRegistry.Builder registryBuilder) {
    RemoteSpawnCache spawnCache =
        new RemoteSpawnCache(
            env.getExecRoot(),
            checkNotNull(env.getOptions().getOptions(RemoteOptions.class)),
            checkNotNull(env.getOptions().getOptions(ExecutionOptions.class)).verboseFailures,
            getRemoteExecutionService());
    registryBuilder.register(SpawnCache.class, spawnCache, "remote-cache");
  }

  /** Returns the remote cache. */
  RemoteCache getRemoteCache() {
    return remoteCache;
  }

  RemoteExecutionClient getRemoteExecutionClient() {
    return remoteExecutor;
  }

  void setTempPathGenerator(TempPathGenerator tempPathGenerator) {
    this.tempPathGenerator = tempPathGenerator;
  }

  public void afterCommand() {
    // actionInputFetcher uses remoteCache to prefetch inputs, so must shut it down before
    // remoteCache.
    if (actionInputFetcher != null) {
      actionInputFetcher.shutdown();
    }
    if (remoteExecutionService != null) {
      remoteExecutionService.shutdown();
    } else {
      if (remoteCache != null) {
        remoteCache.release();
      }
      if (remoteExecutor != null) {
        remoteExecutor.close();
      }
    }
  }
}


text:
C4S_HOME=$HOME/.c4s
CFG_FILE=$C4S_HOME/conf/cassandra4slurm.cfg
source $CFG_FILE
SNAP_NAME=${1}
ROOT_PATH=${2}
CLUSTER=${3}
UNIQ_ID=${4}
DATA_HOME=$ROOT_PATH/cassandra-data
CASSFILE=$C4S_HOME/casslist-"$UNIQ_ID".txt
RINGFILE=$C4S_HOME/ringfile-"$UNIQ_ID".txt
RINGDONE=$C4S_HOME/ringdone-"$UNIQ_ID".txt
HST_IFACE="-ib0" #interface configured in the cassandra.yaml file

NODETOOLFILE=$C4S_HOME/nodetool-"$UNIQ_ID".txt

source $HECUBA_ROOT/bin/cassandra4slurm/hecuba_debug.sh

casslist=`cat $CASSFILE`

DBG " Creating Snapshot directory $SNAP_PATH"
mkdir -p $SNAP_PATH

DBG "  Repairing cassandra"
for u_host in $casslist
do
    $CASS_HOME/bin/nodetool -h ${u_host} repair >> $NODETOOLFILE
done

first_node=`head -n1 $CASSFILE`

DBG "  Generating RingFile $RINGFILE"
rm -f $RINGFILE $RINGDONE
$CASS_HOME/bin/nodetool -h ${first_node} ring > $RINGFILE
echo "1" > $RINGDONE

echo "[INFO] Generating Snapshot $SNAP_NAME"

for u_host in $casslist
do
    $CASS_HOME/bin/nodetool -h ${u_host} snapshot -t $SNAP_NAME >> $NODETOOLFILE
    $CASS_HOME/bin/nodetool -h ${u_host} drain >> $NODETOOLFILE
done
DBG "  Snapshot Done. Copying to GPFS"

run srun --overlap --mem=0 --nodelist=$CASSANDRA_NODELIST --ntasks=$N_NODES --ntasks-per-node=1 --cpus-per-task=$C4S_CASSANDRA_CORES --nodes=$N_NODES $MODULE_PATH/copy_snapshot.sh $SNAP_NAME $ROOT_PATH $CLUSTER $UNIQ_ID


text:
import * as THREE from 'three';

import { UIDiv, UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';

import { SetGeometryCommand } from './commands/SetGeometryCommand.js';

function GeometryParametersPanel( editor, object ) {

	const strings = editor.strings;

	const container = new UIDiv();

	const geometry = object.geometry;
	const parameters = geometry.parameters;

	// radius

	const radiusRow = new UIRow();
	const radius = new UINumber( parameters.radius ).onChange( update );

	radiusRow.add( new UIText( strings.getKey( 'sidebar/geometry/torusKnot_geometry/radius' ) ).setWidth( '90px' ) );
	radiusRow.add( radius );

	container.add( radiusRow );

	// tube

	const tubeRow = new UIRow();
	const tube = new UINumber( parameters.tube ).onChange( update );

	tubeRow.add( new UIText( strings.getKey( 'sidebar/geometry/torusKnot_geometry/tube' ) ).setWidth( '90px' ) );
	tubeRow.add( tube );

	container.add( tubeRow );

	// tubularSegments

	const tubularSegmentsRow = new UIRow();
	const tubularSegments = new UIInteger( parameters.tubularSegments ).setRange( 1, Infinity ).onChange( update );

	tubularSegmentsRow.add( new UIText( strings.getKey( 'sidebar/geometry/torusKnot_geometry/tubularsegments' ) ).setWidth( '90px' ) );
	tubularSegmentsRow.add( tubularSegments );

	container.add( tubularSegmentsRow );

	// radialSegments

	const radialSegmentsRow = new UIRow();
	const radialSegments = new UIInteger( parameters.radialSegments ).setRange( 1, Infinity ).onChange( update );

	radialSegmentsRow.add( new UIText( strings.getKey( 'sidebar/geometry/torusKnot_geometry/radialsegments' ) ).setWidth( '90px' ) );
	radialSegmentsRow.add( radialSegments );

	container.add( radialSegmentsRow );

	// p

	const pRow = new UIRow();
	const p = new UINumber( parameters.p ).onChange( update );

	pRow.add( new UIText( strings.getKey( 'sidebar/geometry/torusKnot_geometry/p' ) ).setWidth( '90px' ) );
	pRow.add( p );

	container.add( pRow );

	// q

	const qRow = new UIRow();
	const q = new UINumber( parameters.q ).onChange( update );

	qRow.add( new UIText( strings.getKey( 'sidebar/geometry/torusKnot_geometry/q' ) ).setWidth( '90px' ) );
	qRow.add( q );

	container.add( qRow );

	//

	function update() {

		editor.execute( new SetGeometryCommand( editor, object, new THREE.TorusKnotGeometry(
			radius.getValue(),
			tube.getValue(),
			tubularSegments.getValue(),
			radialSegments.getValue(),
			p.getValue(),
			q.getValue()
		) ) );

	}

	return container;

}

export { GeometryParametersPanel };


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Hysterium adianti Kunze

### Remarks
null


text:
#ifndef TENSORFLOW_TSL_DISTRIBUTED_RUNTIME_COORDINATION_COORDINATION_CLIENT_H_
#define TENSORFLOW_TSL_DISTRIBUTED_RUNTIME_COORDINATION_COORDINATION_CLIENT_H_

#include <memory>
#include <string>

#include "tensorflow/tsl/distributed_runtime/call_options.h"
#include "tensorflow/tsl/platform/status.h"
#include "tensorflow/tsl/protobuf/coordination_service.pb.h"

namespace tsl {
using tensorflow::BarrierRequest;
using tensorflow::BarrierResponse;
using tensorflow::CancelBarrierRequest;
using tensorflow::CancelBarrierResponse;
using tensorflow::DeleteKeyValueRequest;
using tensorflow::DeleteKeyValueResponse;
using tensorflow::GetKeyValueDirRequest;
using tensorflow::GetKeyValueDirResponse;
using tensorflow::GetKeyValueRequest;
using tensorflow::GetKeyValueResponse;
using tensorflow::GetTaskStateRequest;
using tensorflow::GetTaskStateResponse;
using tensorflow::HeartbeatRequest;
using tensorflow::HeartbeatResponse;
using tensorflow::InsertKeyValueRequest;
using tensorflow::InsertKeyValueResponse;
using tensorflow::RegisterTaskRequest;
using tensorflow::RegisterTaskResponse;
using tensorflow::ReportErrorToServiceRequest;
using tensorflow::ReportErrorToServiceResponse;
using tensorflow::ReportErrorToTaskRequest;
using tensorflow::ReportErrorToTaskResponse;
using tensorflow::ResetTaskRequest;
using tensorflow::ResetTaskResponse;
using tensorflow::ShutdownTaskRequest;
using tensorflow::ShutdownTaskResponse;
using tensorflow::TryGetKeyValueRequest;
using tensorflow::TryGetKeyValueResponse;
using tensorflow::WaitForAllTasksRequest;
using tensorflow::WaitForAllTasksResponse;

// Base class of client interface for communicating with coordination service.
// Can be implemented by a variety of transports such as gRPC.
class CoordinationClient {
 public:
  virtual ~CoordinationClient() = default;

  virtual void RegisterTaskAsync(CallOptions* call_opts,
                                 const RegisterTaskRequest* request,
                                 RegisterTaskResponse* response,
                                 StatusCallback done) = 0;

  virtual void HeartbeatAsync(CallOptions* call_opts,
                              const HeartbeatRequest* request,
                              HeartbeatResponse* response,
                              StatusCallback done) = 0;

  virtual void WaitForAllTasksAsync(const WaitForAllTasksRequest* request,
                                    WaitForAllTasksResponse* response,
                                    StatusCallback done) = 0;

  virtual void ShutdownTaskAsync(CallOptions* call_opts,
                                 const ShutdownTaskRequest* request,
                                 ShutdownTaskResponse* response,
                                 StatusCallback done) = 0;

  virtual void ResetTaskAsync(const ResetTaskRequest* request,
                              ResetTaskResponse* response,
                              StatusCallback done) = 0;

  virtual void ReportErrorToTaskAsync(CallOptions* call_opts,
                                      const ReportErrorToTaskRequest* request,
                                      ReportErrorToTaskResponse* response,
                                      StatusCallback done) = 0;

  virtual void ReportErrorToServiceAsync(
      const ReportErrorToServiceRequest* request,
      ReportErrorToServiceResponse* response, StatusCallback done) = 0;

  virtual void GetTaskStateAsync(const GetTaskStateRequest* request,
                                 GetTaskStateResponse* response,
                                 StatusCallback done) = 0;

  virtual void InsertKeyValueAsync(const InsertKeyValueRequest* request,
                                   InsertKeyValueResponse* response,
                                   StatusCallback done) = 0;

  virtual void GetKeyValueAsync(CallOptions* call_opts,
                                const GetKeyValueRequest* request,
                                GetKeyValueResponse* response,
                                StatusCallback done) = 0;

  virtual void TryGetKeyValueAsync(const TryGetKeyValueRequest* request,
                                   TryGetKeyValueResponse* response,
                                   StatusCallback done) = 0;

  virtual void GetKeyValueDirAsync(const GetKeyValueDirRequest* request,
                                   GetKeyValueDirResponse* response,
                                   StatusCallback done) = 0;

  virtual void DeleteKeyValueAsync(const DeleteKeyValueRequest* request,
                                   DeleteKeyValueResponse* response,
                                   StatusCallback done) = 0;

  virtual void BarrierAsync(const BarrierRequest* request,
                            BarrierResponse* response, StatusCallback done) = 0;

  virtual void CancelBarrierAsync(const CancelBarrierRequest* request,
                                  CancelBarrierResponse* response,
                                  StatusCallback done) = 0;
};

// Simple wrapper class that can be used to retrieve CoordinationClients.
class CoordinationClientCache {
 public:
  virtual ~CoordinationClientCache() = default;

  // If the `target` names a remote task, returns a pointer of the
  // CoordinationClient object wrapping that channel to the remote task.
  virtual CoordinationClient* GetClient(const std::string& target) = 0;

  // If the `target` names a remote task, returns an owned pointer of the
  // CoordinationClient object wrapping that channel to the remote task.
  virtual std::unique_ptr<CoordinationClient> GetOwnedClient(
      const std::string& target) = 0;
};

}  // namespace tsl

#endif  // TENSORFLOW_TSL_DISTRIBUTED_RUNTIME_COORDINATION_COORDINATION_CLIENT_H_


text:
require 'json'
require 'net/http'
require File.dirname(__FILE__) + "/posterous-ruby/session"
require File.dirname(__FILE__) + "/posterous-ruby/user"
require 'crack'
module Posterous

  def self.login_as(user_name,password)
    Session.new(user_name,password)
  end

end