text:
"""
Arast Daemon

The Arast daemon runs on the control node.

"""
import argparse
import sys
import signal
import daemon
import logging
import lockfile
import multiprocessing
import os
import pymongo
import pika
import router
from ConfigParser import SafeConfigParser

import shock
import cloud

# Config precedence: command-line args > config file

def start(config_file, shock_url=None, mongo_host=None, mongo_port=None,
          rabbit_host=None, rabbit_port=None, deploy_config=None):
    # Read config file
    cparser = SafeConfigParser()
    if deploy_config:
        cparser.read(deploy_config)
        print " [.] Found Deployment Config: {}".format(deploy_config)
    else:
        cparser.read(config_file)

    if not shock_url:
        shock_host = cparser.get('shock', 'host')
        shock_url = shock.verify_shock_url(shock_host)
    if not mongo_host:
        mongo_host = cparser.get('assembly', 'mongo_host')
    if not mongo_port:
        mongo_port = int(cparser.get('assembly', 'mongo_port'))
    if not rabbit_host:
        rabbit_host = cparser.get('assembly', 'rabbitmq_host')
    if not rabbit_port:
        rabbit_port = int(cparser.get('assembly', 'rabbitmq_port'))

    print " [.] Starting Assembly Service Control Server"
    print " [.] Shock URL: %s" % shock_url
    print " [.] MongoDB host: %s" % mongo_host
    print " [.] MongoDB port: %s" % mongo_port
    print " [.] RabbitMQ host: %s" % rabbit_host
    print " [.] RabbitMQ port: %s" % rabbit_port

    # Check MongoDB status
    try:
        connection = pymongo.Connection(mongo_host, mongo_port)
        logging.info("MongoDB Info: %s" % connection.server_info())
    except pymongo.errors.PyMongoError as e:
        logging.error("MongoDB connection error: {}".format(e))
        sys.exit('MongoDB error: {}'.format(e))

    print " [.] MongoDB connection successful."

    router_kwargs = {'shock_url': shock_url,
                     'mongo_host': mongo_host, 'mongo_port': mongo_port,
                     'rabbit_host' :rabbit_host, 'rabbit_port' : rabbit_port}

    router_process = multiprocessing.Process(name='router', target=start_router,
                                             args=(config_file,), kwargs=router_kwargs)
    router_process.start()

    # qc_process = multiprocessing.Process(name='qcmon', target=start_qc_monitor,
    #                                          args=(rabbit_host,))
    # qc_process.start()

    # router.start(config_file, mongo_host=mongo_host, mongo_port=mongo_port,
    #              rabbit_host=rabbit_host, rabbit_port=rabbit_port)

def start_router(config_file, **kwargs):
    router.start(config_file, **kwargs)

def start_qc_monitor(rabbit_host, rabbit_port):
    router.start_qc_monitor(rabbit_host, rabbit_port)

def tear_down():
    print "Tear down"
    sys.exit()

parser = argparse.ArgumentParser(prog='arastd')

parser.add_argument("-v", "--verbose", help="increase output verbosity",
                    action="store_true")
parser.add_argument("-p", "--pidfile", help="Process ID file",
                    action="store")
parser.add_argument("--shock-url", help="specify the shock server url",
                    action="store")
parser.add_argument("--mongo-host", help="specify the mongodb url",
                    action="store")
parser.add_argument("--mongo-port", help="specify the mongodb port",
                    action="store")
parser.add_argument("--rabbit-host", help="specify the rabbitmq url",
                    action="store")
parser.add_argument("--rabbit-port", help="specify the rabbitmq port",
                    action="store")
parser.add_argument("--logfile", help="specify the logfile",
                    action="store")
parser.add_argument("--deploy-config", help="specify the deployment-specific config",
                    action="store")
parser.add_argument("-c", "--config", help="specify the config file",
                    action="store", required=True)

args = parser.parse_args()
if args.logfile:
    logfile = args.logfile
    try:
        os.makedirs(os.path.dirname(logfile))
    except:
        pass

else:
    logfile = 'ar_server.log'

if args.verbose:
    logging.basicConfig(level=logging.DEBUG, filename=logfile, stream=sys.stdout)
else:
    logging.basicConfig(level=logging.DEBUG, filename=logfile)

start(args.config, shock_url=args.shock_url, mongo_host=args.mongo_host, mongo_port=args.mongo_port,
      rabbit_host=args.rabbit_host, rabbit_port=args.rabbit_port,
      deploy_config=args.deploy_config)


text:
package org.broadinstitute.hellbender.utils.genotyper;

import htsjdk.variant.variantcontext.Allele;
import org.broadinstitute.hellbender.utils.Utils;

import java.util.AbstractList;
import java.util.List;

/**
 * Utils operations on {@link AlleleList} instances.
 *
 * @author Valentin Ruano-Rubio <valentin@broadinstitute.org>
 */
public final class AlleleListUtils {
    private AlleleListUtils(){}

    @SuppressWarnings({"unchecked","rawtypes"})
    private static final AlleleList EMPTY_LIST = new AlleleList() {
        @Override
        public int alleleCount() {
            return 0;
        }

        @Override
        public int alleleIndex(final Allele allele) {
            return -1;
        }

        @Override
        public Allele alleleAt(final int index) {
            throw new IllegalArgumentException("allele index is out of range");
        }
    };

    /**
     * Checks whether two allele lists are in fact the same.
     * @param first one list to compare.
     * @param second another list to compare.
     *
     * @throws IllegalArgumentException if if either list is {@code null}.
     *
     * @return {@code true} iff both list are equal.
     */
    public static <A extends Allele> boolean equals(final AlleleList<A> first, final AlleleList<A> second) {
        if (first == null || second == null) {
            throw new IllegalArgumentException("no null list allowed");
        }
        final int alleleCount = first.alleleCount();
        if (alleleCount != second.alleleCount()) {
            return false;
        }

        for (int i = 0; i < alleleCount; i++) {
            final A firstSample = first.alleleAt(i);
            Utils.nonNull(firstSample, "no null samples allowed in sample-lists: first list at " + i);
            final A secondSample = second.alleleAt(i);
            Utils.nonNull(secondSample,"no null samples allowed in sample-list: second list at " + i);
            if (!firstSample.equals(secondSample)) {
                return false;
            }
        }

        return true;
    }

    /**
     * Resolves the index of the reference allele in an allele-list.
     *
     * <p>
     *     If there is no reference allele, it returns -1. If there is more than one reference allele,
     *     it returns the first occurrence (lowest index).
     * </p>
     *
     * @param list the search allele-list.
     * @param <A> allele component type.
     *
     * @throws IllegalArgumentException if {@code list} is {@code null}.
     *
     * @return -1 if there is no reference allele, or a values in [0,{@code list.alleleCount()}).
     */
    public static <A extends Allele> int indexOfReference(final AlleleList<A> list) {
        Utils.nonNull(list, "the input list cannot be null");
        final int alleleCount = list.alleleCount();
        for (int i = 0; i < alleleCount; i++) {
            if (list.alleleAt(i).isReference()) {
                return i;
            }
        }
        return -1;
    }

    /**
     * Returns a {@link java.util.List} unmodifiable view of a allele-list
     * @param list the sample-list to wrap.
     *
     * @throws IllegalArgumentException if {@code list} is {@code null}.
     *
     * @return never {@code null}.
     */
    @SuppressWarnings({"unchecked","rawtypes"})
    public static <A extends Allele> List<A> asList(final AlleleList<A> list) {
        Utils.nonNull(list, "the list cannot be null");
        return new AsList(list);
    }

    /**
     * Returns an unmodifiable empty allele-list.
     * @param <A> the allele class.
     * @return never {@code null}.
     */
    @SuppressWarnings("unchecked")
    public static <A extends Allele> AlleleList<A> emptyList() {
        return EMPTY_LIST;
    }

    /**
     * Simple list view of a sample-list.
     */
    private static final class AsList<A extends Allele> extends AbstractList<A> {

        private final AlleleList<A> list;

        private AsList(final AlleleList<A> list) {
            this.list = list;
        }

        @Override
        public A get(final int index) {
            return list.alleleAt(index);
        }

        @Override
        public int size() {
            return list.alleleCount();
        }
    }

    /**
     * Returns a permutation between two allele lists.
     * @param original the original allele list.
     * @param target the target allele list.
     * @param <A> the allele type.
     *
     * @throws IllegalArgumentException if {@code original} or {@code target} is {@code null}, or
     * elements in {@code target} is not contained in {@code original}
     *
     * @return never {@code null}
     */
    public static <A extends Allele> AlleleListPermutation<A> permutation(final AlleleList<A> original, final AlleleList<A> target) {
        if (equals(original,target)) {
            return new NonPermutation<>(original);
        } else {
            return new ActualPermutation<>(original, target);
        }
    }

    /**
     * This is the identity permutation.
     */
    private static final class NonPermutation<A extends Allele> implements AlleleListPermutation<A> {

        private final AlleleList<A> list;

        public NonPermutation(final AlleleList<A> original) {
            list = original;
        }

        @Override
        public boolean isPartial() {
            return false;
        }

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

        @Override
        public int toIndex(final int fromIndex) {
            return fromIndex;
        }

        @Override
        public int fromIndex(final int toIndex) {
            return toIndex;
        }

        @Override
        public int fromSize() {
            return list.alleleCount();
        }

        @Override
        public int toSize() {
            return list.alleleCount();
        }

        @Override
        public List<A> fromList() {
            return asList(list);
        }

        @Override
        public java.util.List<A> toList() {
            return asList(list);
        }

        @Override
        public int alleleCount() {
            return list.alleleCount();
        }

        @Override
        public int alleleIndex(final A allele) {
            return list.alleleIndex(allele);
        }

        @Override
        public A alleleAt(final int index) {
            return list.alleleAt(index);
        }
    }

    private static final class ActualPermutation<A extends Allele> implements AlleleListPermutation<A> {

        private final AlleleList<A> from;

        private final AlleleList<A> to;

        private final int[] fromIndex;

        private final boolean nonPermuted;

        private final boolean isPartial;

        private ActualPermutation(final AlleleList<A> original, final AlleleList<A> target) {
            this.from = original;
            this.to = target;
            final int toSize = target.alleleCount();
            final int fromSize = original.alleleCount();
            if (fromSize < toSize) {
                throw new IllegalArgumentException("target allele list is not a permutation of the original allele list");
            }

            fromIndex = new int[toSize];
            boolean nonPermuted = fromSize == toSize;
            this.isPartial = !nonPermuted;
            for (int i = 0; i < toSize; i++) {
                final int originalIndex = original.alleleIndex(target.alleleAt(i));
                if (originalIndex < 0) {
                    throw new IllegalArgumentException("target allele list is not a permutation of the original allele list");
                }
                fromIndex[i] = originalIndex;
                nonPermuted &= originalIndex == i;
            }

            this.nonPermuted = nonPermuted;
        }

        @Override
        public boolean isPartial() {
            return isPartial;
        }

        @Override
        public boolean isNonPermuted() {
            return nonPermuted;
        }

        @Override
        public int toIndex(final int fromIndex) {
            return to.alleleIndex(from.alleleAt(fromIndex));
        }

        @Override
        public int fromIndex(final int toIndex) {
            return fromIndex[toIndex];
        }

        @Override
        public int fromSize() {
            return from.alleleCount();
        }

        @Override
        public int toSize() {
            return to.alleleCount();
        }

        @Override
        public List<A> fromList() {
            return asList(from);
        }

        @Override
        public List<A> toList() {
            return asList(to);
        }

        @Override
        public int alleleCount() {
            return to.alleleCount();
        }

        @Override
        public int alleleIndex(final A allele) {
            return to.alleleIndex(allele);
        }

        @Override
        public A alleleAt(final int index) {
            return to.alleleAt(index);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
/*

App Landing Template

http://www.templatemo.com/tm-474-app-landing

*/

@font-face {
    font-family: 'sphereographic_penbold';
    src: url('../fonts/bridgefall_font_bold-webfont.eot');
    src: url('../fonts/bridgefall_font_bold-webfont.eot?#iefix') format('embedded-opentype'),
         url('../fonts/bridgefall_font_bold-webfont.woff2') format('woff2'),
         url('../fonts/bridgefall_font_bold-webfont.woff') format('woff'),
         url('../fonts/bridgefall_font_bold-webfont.ttf') format('truetype'),
         url('../fonts/bridgefall_font_bold-webfont.svg#sphereographic_penbold') format('svg');
    font-weight: normal;
    font-style: normal;

}
html {
    overflow: hidden;
}
body {
    background: #f0f0f0;
    overflow: auto;
	height: 100vh;

}
/***** Typography *****/
body, p, a, th, td, li, dl, .form-control { font: normal normal 300 32px/4m 'sphereographic_penbold';}
b, strong, dt { font-weight: 400;}
h1, h2, h3, h4, h5, h6 { line-height: 2em;}
/***** Material Shadow *****/
.shadow-top-down {
    box-shadow: 0px 8px 8px -4px rgba(0,0,0,0.75);
    transition: all .4s;
}
.shadow-top-down:hover { box-shadow: 0px 0px 8px 0px rgba(0,0,0,0.25);}
/***** Material Form Elements *****/
form {
    max-width: 500px;
    margin: 0 auto;
    margin-top: 30px;
}
form .form-group { margin-top: 30px;}
form input.form-control,
form button.form-control,
form textarea.form-control ,
form select.form-control {
    border: 0px;
    background-color: transparent;
    border-bottom: 3px solid #233842;
    border-radius: 0px;
    height: 45px;
}
form input.form-control:focus,
form button.form-control:focus,
form textarea.form-control:focus {
    border-bottom-color: #c0c0c0;
    box-shadow: none;
}
form button.form-control {
    background-color: #275267;
    transition: .5s;
}
form button.form-control[type=reset] { background-color: transparent;}
form button.form-control:hover,
form button.form-control:focus {
    border-bottom-color: #275267;
    background-color: #1c2d35;
}
form textarea.form-control { min-height: 120px;}
form .input-group-addon {
    border: 0px;
    background-color: transparent;
    border-bottom: 3px solid #233842;
    vertical-align: top;
    border-radius: 0;
    color: white;
}
form .input-group-addon i { padding-top: 10px;color: #000;}
form .checkbox input[type=checkbox] { margin-top: 12px;}
/***** Images Padding Config *****/
.img-rounded { border-radius: 6px;}
.img-n-pargaraph .pull-right {
    padding: 0;
    margin: 10px 0 15px 15px;
}
.img-n-pargaraph .pull-left {
    padding: 0;
    margin: 10px 15px 15px 0;
}
/***** Template Header *****/
header.template_header h1 {
    font: normal normal 200 50px/150px 'sphereographic_penbold', sans-serif;
    text-align: center;
    margin-top: 50px;
    color: #000000;
}
header.template_header h1 span {
    position: relative;
    top: -15px;
}
/***** Main Menu *****/
nav.main-menu {
    top: 130px;
    right: 100px;
    z-index: 998;
    display: none;
    position: fixed;
    background: url(../images/bridgeBg.jpg) fixed;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid rgba(37,58,68,.15);
}
nav.main-menu a:link, nav.main-menu a:hover, nav.main-menu a:focus, nav.main-menu a {
    color: #3d2688;
    text-align: center;
    font: normal normal 400 32px/64px 'sphereographic_penbold', sans-serif;
    padding: 0px 50px 0px 30px;
    border-radius: 0;
}
.show-menu {
    position: fixed;
    z-index: 999;
    top: 50px;
    right: 100px;
    text-align: center;
}
.show-menu a:hover, .show-menu a {
    font: normal normal 100 100px/70px 'sphereographic_penbold', sans-serif;
    text-decoration: none;
     background: url(../images/bridgeBg.jpg) fixed;
    display: block;
    color: #3d2688;
    width: 70px;
    height: 70px;
    padding: 0px;
}
/***** Home *****/
#templatemo_home {
    background: url(../images/bridgeBg.jpg) fixed;
    background-size: cover;
    min-height: 20vh;
    padding-bottom: 0px;
    color: #000000;
}
#templatemo_home .templatemo_home_inner_wapper {
    width: 90%;
    max-width: 1080px;
    margin: 0 auto;
}
#templatemo_home h1 {
    margin-top: 2vh;
}
#templatemo_home h2 {
    font: normal normal 100 48px/52px 'sphereographic_penbold', sans-serif;
}
#templatemo_home p {
    margin: 8px 0 6px 0;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    padding-top: 35px;
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
	border: 3px groove #7b0101;
}

/***** Features *****/
#templatemo_features {
	background: url(../images/bridgeBg.jpg) fixed;
    padding-bottom: 100px;
}
#templatemo_features p {
    padding-bottom: 30px;
	font: normal normal 400 32px/56px 'sphereographic_penbold', sans-serif;
    text-align: center;
	color: #3d2688;

}
#templatemo_features .feature-box {
    transition: all .5s;
    background: transparent;
    padding: 40px 0 40px 0;
    margin-bottom: 0px;
    margin-top: 0px;
}
#templatemo_features .feature-box:hover {
    padding: 0;
    color: #fff;
}
#templatemo_features .feature-box .feature-box-inner {
    box-shadow: inset 0px 0px 0 10px #cecece;
    border-bottom: 10px solid #cecece;
    border-top: 10px solid #cecece;
    transition: all .5s;
    background: #f0f0f0;
    padding: 20px;
    margin: auto;
}
#templatemo_features .feature-box:hover .feature-box-inner {
    box-shadow: inset 0px 0px 0px 0px #cecece;
    border-bottom: 10px solid #3d799f;
    border-top: 10px solid #3d799f;
    padding: 60px 20px 60px 20px;
    background: #3399cc;
}
#templatemo_features .feature-box p {
    max-width: 250px;
    min-height: 260px;
    line-height: 32px;
    padding-top: 30px;
    margin: auto;
}
#templatemo_features .feature-box .feature-box-icon {
    border-radius: 5px;
    text-align: center;
    padding-top: 20px;

}
/***** Download
#templatemo_download {
    background: url(../images/bridgeBg.jpg) fixed;
}
#templatemo_download h2 {
    font: normal normal 100 100px/150px 'sphereographic_penbold', sans-serif;
    text-align: center;
    color: #fff;
}
#templatemo_download p {
    text-align: center;
    color: #fff;
}
#templatemo_download a {
    margin: 50px auto 100px auto;
    display: block;
    width: 260px;
}
#templatemo_download .templatemo_download_text_wapper {
    width: 100%;
    max-width: 550px;
    margin: auto;
}
*****/
/***** Element *****/
#templatemo_element .container {
    background-color: #fff;
    margin-top: 40px;
    margin-bottom: 80px;
    padding-bottom: 40px;
    border-radius: 5px;
}
#templatemo_element header h1 { color: #000;}
#templatemo_element #element-icon-wapper {
    overflow: hidden;
    border-radius: 5px;
}
#templatemo_element #element-icon-wapper > div {
    background-color: rgba(0,0,0,.05);
    padding-bottom: 5px;
    padding-top: 5px;
    text-align: center;
    line-height: 40px;
    font-size: 25px;
}
#templatemo_element #element-icon-wapper > div:hover {
    transition: .5s;
    background-color: rgba(0,0,0,.2);
}
#templatemo_element #element-icon-wapper a { color: #000;}
#templatemo_element #img-grid-wapper > div { padding: 5px;}

/***** Contact *****/
#templatemo_contact {
    background: url(../images/bridgeBg.jpg) fixed;
    color: #3d2688;
}
#templatemo_contact header h1 { color: #000000;}
#templatemo_contact p, #templatemo_contact a  {
    line-height: 2.5em;
	 font-family:'sphereographic_penbold';
	 font-size: 32px;
    color: #3d2688;
}
#templatemo_contact form .form-group { margin-top: 30px;}
#templatemo_contact form input.form-control,
#templatemo_contact form button.form-control,
#templatemo_contact form textarea.form-control ,
#templatemo_contact form select.form-control { border-bottom: 3px solid #fff;color: #fff;}
#templatemo_contact form input.form-control:focus,
#templatemo_contact form button.form-control:focus,
#templatemo_contact form textarea.form-control:focus { border-bottom-color: #275267;}
#templatemo_contact form textarea.form-control { min-height: 120px;}
#templatemo_contact form .input-group-addon { border-bottom: 3px solid #fff;}
#templatemo_contact form .input-group-addon i { color: #fff;}
#templatemo_contact .social {
	margin: auto auto auto auto;
	text-align: center;
    max-width: 360px;
    width: 100%;

}
#templatemo_contact .social li {

    margin-left: 5px;
    width: 20%;
}
#templatemo_contact .social a {
    margin: 50px auto 4px auto;
    border-radius: 20px;
    line-height: 40px;
    transition: .5s;
    height: 69px;
    width: 69px;
}
#templatemo_contact .social a:hover {
    transform: rotate(360deg);
    color: #223741;
}
#templatemo_contact .social .social-facebook { background: #4a6fb5;}
#templatemo_contact .social .social-twitter { background: #28a9e0;}
#templatemo_contact .social .social-youtube { background: #f86d70;}
#templatemo_contact .social .social-instagram { background: #cab9a9;}
/***** Footer *****/
footer {
    padding: 20px 0 16px 0;
    text-align: center;
    background: #fff;
}
.footer-copyright p {
    margin:20px auto 20px auto;
    text-align: center;
    line-height: 32px;
    color: #666;
}
.footer-copyright a {
    border-bottom: 1px dotted #fff;
    color: #666;
}
.footer-copyright a:hover {
    color: #000;
    border: 0;
}
@media (min-width: 992px) and (max-width: 1199px) {
    .show-menu {right: 50px;}
    nav.main-menu {right: 50px;}
}
@media (max-width: 991px) {
    .show-menu {right: 30px;}
    nav.main-menu {right: 30px;}
}
@media (max-width: 767px) {
    #templatemo_download h2 {font-size: 70px;}
    #templatemo_home h2 {font-size: 26px;}
}
@media (max-width: 400px) {
    nav.main-menu {right: 10px;}
    .show-menu {right: 10px;}
    #templatemo_contact .social a {
        padding: 18px;
        font-size: 25px;
        line-height: 20px;
        height: 60px;
        width: 60px;
    }
}


text:
        <button type="button" class="btn btn-primary btn-xs" data-toggle="offcanvas">Toggle nav</button>

Phonecat App

This is an example of an application written in AngularJs, especially for LoftBlog.

				{{status}}

{{phone.name}}

{{phone.snippet}}

View details »

Фильтр телефонов

          <form>
            <input type="text" class="form-control" placeholder="Search..." ng-model="search">
          </form>