text:
package com.baidu.cc.web.action;

import com.baidu.bjf.web.struts2.annotation.FromJSON;
import com.baidu.bjf.web.struts2.annotation.ToJSON;
import com.baidu.cc.configuration.bo.User;
import com.baidu.cc.web.action.UserSaveActionBase.DataResult;
import com.baidu.lego.web.spi.EJsonDataResult;

import com.opensymphony.xwork2.validator.annotations.RegexFieldValidator;
import com.opensymphony.xwork2.validator.annotations.Validations;

import java.util.HashMap;
import java.util.Map;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;

/**
 * 功能:保存用户信息.
 *
 * @author BJF
 * @param <ReqParam>
 *            request param
 * @param <DataResult>
 *            data return result
 */
@Namespace("/user")
@Results({ @Result(name = "success", location = "/user/listUser.action", type = "redirect")

})
public abstract class UserSaveActionBase<ReqParam, DataResult>
        extends
        com.baidu.lego.web.struts2.DirectServiceVisitAction<ReqParam, DataResult> {

    /** serial Version UID. */
    private static final long serialVersionUID = 1L;

    /** request param. */
    @FromJSON(validationVisitor = UserSaveAction.class)
    protected UserSaveActionBase.ReqParam reqParam;

    /**
     * get request param.
     *
     * @return ReqParam
     */
    public UserSaveActionBase.ReqParam getReqParam() {
        if (reqParam == null) {
            reqParam = new UserSaveActionBase.ReqParam();
        }
        return reqParam;
    }

    /**
     * set request param.
     *
     * @param reqParam
     *            ReqParam
     */
    public void setReqParam(UserSaveActionBase.ReqParam reqParam) {
        this.reqParam = reqParam;
    }

    /*
     * (non-Javadoc)
     *
     * @see com.baidu.lego.web.struts2.DirectVisitAction#getAsReqParam()
     */
    @Override
    public Object getAsReqParam() {
        return getReqParam();
    }

    /*
     * (non-Javadoc)
     *
     * @see
     * com.baidu.lego.web.struts2.DirectVisitAction#setAsDataResult(java.lang
     * .Object)
     */
    @Override
    public void setAsDataResult(Object v) {
        if (v instanceof UserSaveActionBase.DataResult) {
            setData((UserSaveActionBase.DataResult) v);
        }
        setEJsonDataResult(v);
    }

    /** return data object. */
    protected UserSaveActionBase.DataResult data;

    /**
     * get return data object.
     *
     * @return DataResult
     */
    public UserSaveActionBase.DataResult getData() {
        if (data == null) {
            data = new UserSaveActionBase.DataResult();
        }
        return data;
    }

    /**
     * set return data object.
     *
     * @param data
     *            DataResult
     */
    protected void setData(UserSaveActionBase.DataResult data) {
        this.data = data;
    }

    /** return data object of e-json wrapped. */
    @ToJSON
    protected EJsonDataResult result;

    /**
     * get return data object wrapped by ejson.
     *
     * @return EJsonDataResult
     */
    public EJsonDataResult getResult() {
        if (result == null) {
            result = new EJsonDataResult();
        }
        return result;
    }

    /**
     * set ejson data object.
     *
     * @param result
     *            EJsonDataResult
     */
    public void setEJsonDataResult(EJsonDataResult result) {
        this.result = result;
    }

    /**
     * set ejson data object.
     *
     * @param data
     *            DataResult
     */
    public void setEJsonDataResult(Object data) {
        getResult().setData(data);
    }

    /**
     * set ejson data object.
     *
     * @param data
     *            DataResult
     * @param status
     *            状态码
     * @param statusInfo
     *            状态信息
     */
    public void setEJsonDataResult(DataResult data, int status,
            String statusInfo) {
        getResult().setData(data);
        getResult().setStatus(status);
        getResult().setStatusInfo(statusInfo);
    }

    // step1 main entry to define action name
    /**
     * do execute service.
     *
     * @return result name
     * @throws Exception
     *             throws all available exception
     */
    @Action("saveUser")
    public String doExecute() throws Exception {
        return execute();
    }

    /**
     * do interal validaotr. do not override it
     */
    @Validations(regexFields = { @RegexFieldValidator(fieldName = "reqParam.user.id",
        message = "字段\'id\'必须为整数类型", expression = "^(\\+|-)?[0-9]\\d*$") })
    public final void internalValidator() {
        throw new RuntimeException("invalid access.");
    }

    /*
     * (non-Javadoc)
     *
     * @see
     * com.baidu.lego.web.struts2.DirectVisitAction#getValidationTarget(java
     * .lang.Object)
     */
    @Override
    protected Object getValidationTarget(Object target) {
        UserSaveAction action = new UserSaveAction();
        action.setReqParam((UserSaveActionBase.ReqParam) target);
        return action;
    }

    /**
     * Request param class.
     *
     * @author BJF
     */
    protected static class ReqParam {

        /** 说明:. */
        private User user;

        /**
         * set .
         *
         * @param user
         *            User
         */
        public void setUser(User user) {
            this.user = user;
        }

        /**
         * get .
         *
         * @return User
         */
        public User getUser() {
            return user;
        }

        /**
         * get Map instance.
         *
         * @return Map
         */
        public Map<String, Object> toMap() {
            Map<String, Object> map = new HashMap<String, Object>();
            map.put("user", user);
            return map;
        }
    }

    /**
     * Data return class.
     *
     * @author BJF
     */
    public static class DataResult {

    }

}


text:
'use strict';

const noLargeSnapshots = require('../no-large-snapshots').create;

// was not able to use https://eslint.org/docs/developer-guide/nodejs-api#ruletester for these because there is no way to configure RuleTester to run non .js files
describe('no-large-snapshots', () => {
  it('should return an empty object for non snapshot files', () => {
    const mockContext = {
      getFilename: () => 'mock-component.jsx',
      options: [],
    };
    const result = noLargeSnapshots(mockContext);

    expect(result).toEqual({});
  });

  it('should return an object with an ExpressionStatement function for snapshot files', () => {
    const mockContext = {
      getFilename: () => 'mock-component.jsx.snap',
      options: [],
    };

    const result = noLargeSnapshots(mockContext);

    expect(result).toMatchObject({
      ExpressionStatement: expect.any(Function),
    });
  });

  describe('ExpressionStatement function', () => {
    it('should report if node has more than 50 lines of code and no sizeThreshold option is passed', () => {
      const mockReport = jest.fn();
      const mockContext = {
        getFilename: () => 'mock-component.jsx.snap',
        options: [],
        report: mockReport,
      };
      const mockNode = {
        loc: {
          start: {
            line: 1,
          },
          end: {
            line: 53,
          },
        },
      };
      noLargeSnapshots(mockContext).ExpressionStatement(mockNode);

      expect(mockReport).toHaveBeenCalledTimes(1);
      expect(mockReport.mock.calls[0]).toMatchSnapshot();
    });

    it('should report if node has more lines of code than number given in sizeThreshold option', () => {
      const mockReport = jest.fn();
      const mockContext = {
        getFilename: () => 'mock-component.jsx.snap',
        options: [{ maxSize: 70 }],
        report: mockReport,
      };
      const mockNode = {
        loc: {
          start: {
            line: 20,
          },
          end: {
            line: 103,
          },
        },
      };
      noLargeSnapshots(mockContext).ExpressionStatement(mockNode);

      expect(mockReport).toHaveBeenCalledTimes(1);
      expect(mockReport.mock.calls[0]).toMatchSnapshot();
    });

    it('should report if maxSize is zero', () => {
      const mockReport = jest.fn();
      const mockContext = {
        getFilename: () => 'mock-component.jsx.snap',
        options: [{ maxSize: 0 }],
        report: mockReport,
      };
      const mockNode = {
        loc: {
          start: {
            line: 1,
          },
          end: {
            line: 2,
          },
        },
      };
      noLargeSnapshots(mockContext).ExpressionStatement(mockNode);

      expect(mockReport).toHaveBeenCalledTimes(1);
      expect(mockReport.mock.calls[0]).toMatchSnapshot();
    });

    it('should not report if node has fewer lines of code than limit', () => {
      const mockReport = jest.fn();
      const mockContext = {
        getFilename: () => 'mock-component.jsx.snap',
        options: [],
        report: mockReport,
      };
      const mockNode = {
        loc: {
          start: {
            line: 1,
          },
          end: {
            line: 18,
          },
        },
      };
      noLargeSnapshots(mockContext).ExpressionStatement(mockNode);

      expect(mockReport).not.toHaveBeenCalled();
    });
  });
});

redpajama_set_name: RedPajamaGithub


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

namespace Stratus.Gameplay
{
	[CustomEditor(typeof(StratusCharacterMovementInput))]
	public class StratusCharacterMovementInputEditor : StratusBehaviourEditor<StratusCharacterMovementInput>
	{
		StratusCharacterMovementInput.Preset.Template presetTemplate;

		protected override void OnStratusEditorEnable()
		{
			AddPropertyChangeCallback(nameof(StratusCharacterMovementInput.target), () => target.ChangeTarget(this.target.target));
			AddArea(AddTemplate);
		}

		private void AddTemplate(Rect rect)
		{
			EditorGUILayout.BeginHorizontal();
			{
				presetTemplate = (StratusCharacterMovementInput.Preset.Template)EditorGUILayout.EnumPopup("Template", presetTemplate);
				if (GUILayout.Button("Add", EditorStyles.miniButtonRight)) target.presets.Add(StratusCharacterMovementInput.Preset.FromTemplate(presetTemplate));
			}
			EditorGUILayout.EndHorizontal();
		}
	}

}


text:
<?php
//## NextScripts Twitter Connection Class

/*
1. Options

nName - Nickname of the account [Optional] (Presentation purposes only - No affect on functionality)
rdUName - Reddit User Name
rdPass - Reddit User Passord
rdSubReddit - Name of the Sub-Reddit
postType - A or T - "Attached link" or "Text"

rdTitleFormat
rdTextFormat

2. Post Info

url
title - [up to 300 characters long] - title of the submission
text

*/
$nxs_snapAPINts[] = array('code'=>'RD', 'lcode'=>'rd', 'name'=>'Reddit');

if (!class_exists("nxs_class_SNAP_RD")) { class nxs_class_SNAP_RD {

    var $ntCode = 'RD';
    var $ntLCode = 'rd';

    function doPost($options, $message){ if (!is_array($options)) return false; $out = array(); // return false;
      foreach ($options as $ii=>$ntOpts) $out[$ii] = $this->doPostToNT($ntOpts, $message);
      return $out;
    }
    function doPostToNT($options, $message){ global $nxs_urlLen; $badOut = array('pgID'=>'', 'isPosted'=>0, 'pDate'=>date('Y-m-d H:i:s'), 'Error'=>'');
      //## Check settings
      if (!is_array($options)) { $badOut['Error'] = 'No Options'; return $badOut; }
      if (!isset($options['rdUName']) || trim($options['rdUName'])=='' || !isset($options['rdPass']) || trim($options['rdPass'])=='') { $badOut['Error'] = 'No username/password Found'; return $badOut; }
      //## Format Post
      if (!empty($message['pTitle'])) $title = $message['pTitle']; else $title = nxs_doFormatMsg($options['rdTitleFormat'], $message); $title = nsTrnc($title, 300);
      if (!empty($message['pText'])) $text = $message['pText']; else $text = nxs_doFormatMsg($options['rdTextFormat'], $message);
      //## Make Post
      $pass = substr($options['rdPass'], 0, 5)=='n5g9a'?nsx_doDecode(substr($options['rdPass'], 5)):$options['rdPass'];   $hdrsArr = '';
      $loginInfo = doConnectToRD($options['rdUName'], $pass); if (!is_array($loginInfo))  {  $badOut['Error'] = print_r($loginInfo, true)." - ERROR"; return $badOut; }
      $mh = $loginInfo['mh']; $ck = $loginInfo['ck']; $post = array('uh'=>$mh, 'sr'=>$options['rdSubReddit'], 'title'=>$title, 'save'=>true);
      if ($options['postType']=='A') { $post['url'] = $message['url']; $post['kind']='link'; $retNum = 16; } else { $post['text'] = $text; $post['kind']='self'; $retNum = 10; }
      $url = "http://www.reddit.com/api/submit"; $postParams = array( 'method' => 'POST', 'timeout' => 45, 'redirection' => 0, 'extension'=>'json',  'headers' => $hdrsArr, 'body' => $post, 'cookies' => $ck);
      $response = wp_remote_post($url, $postParams); // prr($postParams); prr($response);
      if (is_wp_error($response)) {  $badOut['Error'] = print_r($response, true)." - ERROR"; return $badOut; }
      $response = json_decode($response['body'], true); $rdNewPostID = 'http://www.reddit.com'; // prr($response);

      if (!isset($response['jquery']) || !is_array($response['jquery'])) {  $badOut['Error'] = print_r($response, true)." - ERROR"; return $badOut; }
      $r = $response['jquery']; if (is_array($r[$retNum][3]) && count($r[$retNum][3])>0 && stripos($r[$retNum][3][0], 'http://')!==false) $rdNewPostID = $r[$retNum][3][0];
      if (isset($r[18]) && is_array($r[18][3]) && count($r[18][3])>0 && stripos($r[18][3][0], 'error.BAD_CAPTCHA')!==false ) {  $badOut['Error'] = "ERROR: Post Rejected. Reddit thinks that you don't have rights to post here"; return $badOut; }
      if (isset($r[18]) && is_array($r[18][3]) && count($r[18][3])>0 && stripos($r[18][3][0], 'error')!==false ) {  $badOut['Error'] = "ERROR: ".$r[18][3][0]; return $badOut; }
      if (is_array($r[$retNum][3]) && count($r[$retNum][3])>0 && stripos($r[$retNum][3][0], 'http://')===false) {  $badOut['Error'] = print_r($r[$retNum][3][0], true)." - ERROR"; return $badOut; }
      if (isset($r[18]) && is_array($r[18][3]) && count($r[18][3])>0 && stripos($r[18][3][0], 'already been submitted')!==false ) $rdNewPostID .= str_ireplace('?already_submitted=true', '', $r[10][3][0]);
      // echo "ID:".$rdNewPostID;
      if ($rdNewPostID!='http://www.reddit.com') {
         return array('postID'=>$rdNewPostID, 'isPosted'=>1, 'postURL'=>$rdNewPostID, 'pDate'=>date('Y-m-d H:i:s'));
      } else { $badOut['Error'] .= print_r($tmhOAuth->response['response'], true)." MSG:".print_r($msg, true);
        return $badOut;
      }
      return $badOut;
    }

}}
?>


text:
package com.coroptis.imagestore.filestore;

import com.google.common.base.MoreObjects;

public class ImageRequest extends ResizeRequest {

    private String extension;

    private Integer idImage;

    public ImageRequest(final Integer idImage) {
	this.idImage = idImage;
    }

    /**
     * @return the extension
     */
    public String getExtension() {
	return extension;
    }

    /**
     * @param extension
     *            the extension to set
     */
    public void setExtension(String extension) {
	this.extension = extension;
    }

    /**
     * @return the idImage
     */
    public Integer getIdImage() {
	return idImage;
    }

    /**
     * @param idImage
     *            the idImage to set
     */
    public void setIdImage(Integer idImage) {
	this.idImage = idImage;
    }

    @Override
    public String toString() {
	return MoreObjects.toStringHelper(this).add("idImage", idImage).add("extension", extension)
		.add("width", getWidth()).add("height", getHeight())
		.add("keepAspectRatio", isKeepAspectRatio()).toString();
    }

}


text:
\documentclass[letterpaper, 12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath}
\usepackage[affil-it]{authblk}
\usepackage{verbatim}
\usepackage{todonotes}
\usepackage{setspace}
\usepackage{graphicx}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{hyperref}
\usepackage{bbold}
\usepackage{url}
\usepackage{fancyhdr}

\fancypagestyle{headerstyle}
{
   \fancyhf{}
	\fancyfoot[C]{\textbf{CONFIDENTIAL MATERIAL: DO NOT COPY OR DISTRIBUTE WITHOUT SPONSOR'S PERMISSION.}}
	\renewcommand{\headrulewidth}{0pt}
	\renewcommand{\footrulewidth}{0pt}
}

\fancyhf{}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

\pagestyle{fancy}

\makeatletter
%\let\ps@plain\ps@fancy
\let\ps@plain\ps@headerstyle
\makeatother

\begin{document}

\title{\vspace{30mm}An Improved Approach to Model Epistatic Interactions Among Multiple Genetic Variants Using Pleiotropy}
\author{\vspace{20mm}Tian-Shun Allan Jiang}

\affil{%\vspace{8mm}
Stanford University,\\NC School of Science and Mathematics}

\author{Gregory Carter}
\affil{%\vspace{8mm}
The Jackson Laboratory}

\date{The Jackson Lab Summer Student Program\\
\vspace{5mm} \today}

\singlespace
\maketitle

\listoftodos

\newpage

\doublespace

\section*{Introduction}

One area of focus in systems biology is the use of quantitative and statistical genetics to understand how genetic variants combine to influence complex traits. Advances in high-density genotyping and multidimensional phenotyping can produce highly detailed views of biological systems for this purpose. However, extracting meaningful biological models for human health and disease from these large datasets will require the creation of new analytical methods and software.

One promising approach to use this data is in the systematic study of genetic interactions as a way to map genetic networks \cite{boone2007}. These networks can then be used to infer functional relationships in molecular biology such as activation, repression, and pathway ordering \cite{avery1992ordering}. Previous work by Carter et al.\ \cite{carter2013fly,carter2012yeast} created mathematical models to infer genetic networks from epistatic interactions using various fly and yeast crosses exhibiting partial pleiotropy. These models were then used on some well-studied biological systems, such as the reproductive pathway in yeast \cite{carter2012yeast} to confirm wet-lab results found in literature.

However, interactions detected by existing models only analyse two genetic variants at a time and thus may not provide a complete model of epistasis. In this paper, we create a more complete model of epistasis by extending the previous model to incorporate multiple genetic variants at a time, which can help uncover novel interactions and detect indirect variant-to-variant influences.

\todo[inline]{Summarize what you've done with little cross dataset, like in Carter 2013}

\begin{comment}
What are the ideas?
\begin{enumerate}
\item Advances in genomic/phenotypic technologies allow us to gather a lot of data which need new methods of studying \cite{tyler2013cape}
\item We want to map genetic networks using interaction analysis on a \textbf{genome-scale}. Has been done in yeast worm and fly. \cite{carter2013fly}
\item New mouse populations allow us to conduct interaction analysis in mammalian models for ``activation, repression, and pathway ordering" \cite{carter2012yeast}
\end{enumerate}
\end{comment}

\section*{Methods}
\subsection*{Data Source}
Data were obtained from a study of \todo{write about the data...}

\subsection*{Genetic Interaction Model}
Since our model extends upon previous data analysis techniques by Carter et al.\ which are described at length in previous publications \cite{carter2013fly, carter2012yeast}, we summarize the known analysis procedures here, and cover novel techniques and ideas in higher detail. All of the previously known analysis techniques were performed using the software package \texttt{R/cape} \cite{tyler2013cape}.

\subsubsection*{1. Singular Value Decomposition}
First, we performed singular value decomposition (SVD) on our mean-centered, standard-deviation-normalized phenotype data to maximize orthogonality. This allows us to fully exploit the complementary phenotype data by reducing linear dependence. Then we chose the first five left singular vectors for analysis. For convenience, we hereafter refer to these left singular vectors as ``eigentraits".
\todo[size=\tiny]{In our data, these eigentraits captured x\% of the variance.}

\missingfigure{Show plotSVD that has percent variance plots}

\subsubsection*{2. Singlescan to find covariates}

Then, we performed a linear regression for each of the 100 genes to identify strong-effect genetic variants to be treated as additive covariates in subsequent pairwise regressions. For each locus we performed the regression:

\begin{equation} \label{eq:singlescan}
U^{j}_{i} = \beta^{j}_{0} + \beta^{j}_{1}x_i + \epsilon^{j}_{i}
\end{equation}

where $i$ is looped over all individuals in the population, $j$ is looped over all eigentraits, $U^{j}_{i}$ is the value of eigentrait $j$ for individual $i$, $\beta^{j}$ is the effect of the effect of the locus on eigentrait $j$, and $\epsilon^{j}_{i}$ is the residual error. In our data, each of the $x_{i}$ genotype values were either $0, 1$ or $2$, corresponding to the AA, AB, and BB genotypes. Genotypes are encoded this way by the additive assumption of variants on phenotypes. Then, strong-effect knockdowns are identified as significant $\beta^{j}_{1}$ coefficients, which are then included as covariates for the associated phenotype.
%Then, we use those covariates and perform a ``pairscan" regression, which models all possible variant pairs with main effects and an interaction term. For example, in a pairscan using variants 1 and 2 we get:

Here is where our analysis extends upon methodology by Carter et al.\ \cite{carter2013fly,carter2012yeast}. Previous methodology conducted a ``pairscan", shown below for sample variants 1 and 2.

\begin{equation}
U^{j}_{i} = \beta^{j}_{0} + \underbrace{\sum_{c}x_{c,i}\beta_{c}^j}_{\text{Covariates}} +  \underbrace{\beta^{j}_{1}x_{1i} + \beta^{j}_{2}x_{2i}}_{\text{Main Effects}} + \underbrace{\beta^{j}_{2}x_{1i}x_{2i}}_{\text{Interaction}} + \epsilon^{j}_{i}
\end{equation}

The variables are the same as those in Equation \ref{eq:singlescan}, with the additional interaction term $\beta_{12}^j$ and the addition of strong-effect knockdowns as covariates. This interaction term can be reparameterized into variant-to-variant influences, but is limited by the fact that it can only model interactions between two variants at a time.

\subsubsection*{3. Extending the model to $n$ variants}

Here, we extend the model to the analysis of $n$ variants as follows:

\begin{equation}
U^{j}_{i} = \beta^{j}_{0} + \underbrace{\sum_{c}x_{c,i}\beta_{c}^j}_{\text{Covariates}} +  \underbrace{\sum_{a=1}^{n}\beta^{j}_{1}x_{ai}}_{\text{Main Effects}} + \underbrace{\sum_{a,b}\beta^{j}_{ab}x_{ai}x_{bi}}_{\text{all pairs }a,b} + \underbrace{\sum_{a,b,c}\beta^{j}_{abc}x_{ai}x_{bi}x_{bi}}_{\text{all triples }a,b,c} + \ldots + \epsilon^{j}_{i}
\end{equation}

This regression models combined variant interaction effects among $n$ variants, as it includes terms for any combination of variants under analysis. For example, the $\beta_{abc}^j$ coefficient represents the strength of the interaction among variants $a,b$ and $c$ in explaining the variance of eigentrait $j$.

To resolve these combined interaction coefficients into variant-to-variant influences, we first reparameterize the interaction coefficients in terms of variables $\delta_{ab}$ and $\delta_{ba}$ for all combinations of variants $a$ and $b$ from the $n$ variants of interest.

The value of $\delta_{ab}$ represents the change in genotype value in variant $b$ when the perturbation in variant $a$ is present (i.e. when variant $a$ is not homozygous for the reference strain). This way, genetic interactions are quantified as the phenotype-relevant activity of each variant is altered according to the value of $\delta$.

\section*{Results}

\section*{Discussion}

\newpage

\bibliographystyle{plain}
\bibliography{references}

\end{document}

%======================================================
%======================================================
%================Document ends here!=========================
%======================================================
%================Notes being below!==========================
%======================================================
%======================================================

Document is online:
https://docs.google.com/document/d/1Ow97N7w9jhJ7RWqQ-gROuoLHtffS94VSSVpHRCWtpOI/edit?usp=sharing
WYSIWYG life oops

This study aims to create a mathematical model to more accurately detect epistasis (gene-gene interactions) among multiple genetic variants using the existence of partial pleiotropy (when one gene affects multiple phenotypes). Previous methods to detect epistatic interactions have been defined \cite{carter2012yeast}, but may fail to produce the most complete model of the genetic network. This study aims to extend previous models to more accurately model epistatic interactions among multiple loci and to create an open-source software package in \texttt{R} to allow other researchers to replicate the same data analysis.

%\subsubsection*{Background}
One area of focus in systems biology is the use of quantitative and statistical genetics to understand how genetic variants combine to influence complex traits. Recent advances in high-density genotyping and multidimensional phenotyping can produce highly detailed views of biological systems for this purpose. However, extracting meaningful models for health and disease from these large datasets will require the creation of new analytical methods and software.

One potentially promising approach to use this data is in the study of genetic interactions. Previous work by Carter et al.\ \cite{carter2013fly,carter2012yeast} created mathematical models to detect epistatic interactions from various fly and yeast crosses exhibiting partial pleiotropy, and Tyler et al.\ \cite{tyler2013cape} implemented the methodology by publishing an open-source \texttt{R} package called \texttt{cape} to conduct the statistical analysis. These models were then used on some well-studied biological systems, such as the reproductive pathway in yeast \cite{carter2012yeast}, to confirm wet-lab results found in literature. However, due to the method's usage of pair-wise analysis of genetic variants, it also detected some additional novel genetic interactions which could be false positives. Thus, our goal in improving the model is to limit the number of false positives in the genetic network.

%\subsubsection*{Experimental Approach:}
We hypothesize that analyzing interactions between multiple ($n \geq 3$) variants at once (instead of a pair-wise analysis) will aid in minimizing detection of false positives while maintaining the statistical power to pick up true interactions. In order to test this hypothesis, the following steps will be taken:
\begin{enumerate}
\item Create candidate mathematical models for the analysis of $n$ genetic variants
\item Evaluate the models based on performance on fabricated data
\item Evaluate model robustness by adding varying levels of noise to the fabricated data
\end{enumerate}
This methodology should help to create a more accurate and robust model for the detection of variant-to-variant interactions while avoiding false positive interactions. The resulting genetic network created by the analysis can help to translate statistical epistasis in a large dataset into a precise and testable hypothesis.

http://www.math.uni-leipzig.de/~hellmund/LaTeX/pgf-tut.pdf
\begin{tikzpicture}[scale=1]
\draw [line width=3pt,->] (2,0) -- (0,2);
\end{tikzpicture}

\begin{tikzpicture}[scale=1, transform shape] %transform shape scales node sizes as well
\tikzstyle{every node} = [circle, fill=gray!30]
\node (a) at (0, 0) {A};
\node (b) at +(0: 1.5) {B}; %+ is polar coordinates!
\node (c) at +(60: 1.5) {C};
\foreach \from/\to in {a/b, b/c, c/a}
\draw [->] (\from) -- (\to);
\end{tikzpicture}

\begin{tikzpicture}[scale=1, transform shape] %transform shape scales node sizes as well
\node[draw, shape=circle]       (a) at (0, 0) {var1};
\node[draw, shape=circle]       (b) at (2.5, 0) {var2};
\node[draw, shape=rectangle] (c) at (2.5/2, 1.75) {phenotype1};
\node[draw, shape=rectangle] (d) at (2.5/2, -1.75) {phenotype2};
\foreach \from/\to in {a/b, b/a, b/c, a/c, b/d, a/d}
\draw [->] (\from) -- (\to);
\end{tikzpicture}


text:
<?php

    if (!$_SESSION['hotel_login']){

		$_SESSION['Reservation'] = true;
        //Enter redirect here

        //header('location:hotel_login.php');
		//exit();
    }
	else{

	}

?>

<!DOCTYPE html>
<?php
	include_once('function.php');
	$func = new dbUser();

	$Hotel_ID = $_SESSION['hotel_id'];
	$Hotel_name = $_SESSION['hotel'];

	$Room_ID = $_SESSION['Room_ID'];
	$Room_name = $_SESSION['Room_name'];

	$User_ID = $_SESSION['customer_ID'];
	$First_Name = $Last_Name = $Country = $Contact =$Address = $DOB = $Checkin =$Checkout = "";

	$First_Name = $_POST['First_Name'];
	$Last_Name = $_POST['Last_Name'];
	$Gender = $_POST['Gender'];
	$Country = $_POST['Country'];
	$Contact = $_POST['Contact'];
	$Checkin = $_POST['Check_in'];
	$Checkout = $_POST['Check_out'];
$Check_in = date( 'Y-m-d H:i:s', $Check_in );
$Check_out = date( 'Y-m-d H:i:s', $Check_out );
	$Status = "NP";

	$func->user_reserve($Hotel_ID, $User_ID, $Room_ID, $Checkin, $Checkout, $First_Name,$Last_Name, $Gender, $Country, $Status);

?>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">

					 <button type="button" class="btn btn-primary btn-md">

           Home
        </button>

                    <button type="button" class="btn btn-primary btn-md">

           Back
        </button>
					<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
Toggle navigation
					</button>

						<button type="submit" class="btn btn-primary btn-md">
							 Login as

                        </button>

                        <button type="submit" class="btn btn-primary btn-md">
                             About us

						</button>

<?php echo $Hotel_name; ?>

                    <form name = "reservation" class="form-horizontal col-md-10 col-md-offset-1" role="form" align = "left" >
					   <legend>Enter reservation details for <?php echo $Room_name; ?></legend>

								First name

								<input type="inputName" class="form-control" id="inputName" name = "First_Name" />

								Last name

								<input type="inputName" class="form-control" id="inputName"  name = "Last_Name" />

								Gender

                                  <button class="btn btn-default  dropdown-toggle" type="button" data-toggle="dropdown">   Gender
                                  </button>

Male

Female

								Date of birth

                        <input type="date" id="for" class="form-control" name = "DOB">

								Address

								<input type="inputAddress" class="form-control" id="inputAddress" placeholder="No 10, Down Street, Colombo 10" name = "Address"/>

								Country

                                  <button class="btn btn-default  dropdown-toggle btn-md"  type="button" data-toggle="dropdown">   Country
                                  </button>

HTML

CSS

JavaScript

								Contact No

								<input type="inputNumber" class="form-control" id="inputNumber" placeholder="00947777123456" name= "Contact"/>

								Check in

                        <input type="date" id="for" class="form-control" name = "Checkin">

								Check out

                        <input type="date" id="for" class="form-control" name = "Checkout">

								Payment method

                                  <button class="btn btn-default  dropdown-toggle btn-md"  type="button" data-toggle="dropdown">   Payment method
                                  </button>

Cash

Cheque

Credit card

    I have read and accept the terms of the<a href="#" role="button" class="btn popovers" data-toggle="popover" title="" data-content="test content link on content"data-original-title="test title">User Agreement

								<button type="Next" class="btn btn-default" type="submit">

									Save
								</button>


text:
package org.deeplearning4j.parallelism.main;

import org.nd4j.linalg.dataset.api.iterator.DataSetIterator;

public interface DataSetIteratorProviderFactory {

    /**
     * Create an {@link DataSetIterator}
     * @return
     */
    DataSetIterator create();
}


text:
<level>
    <title>100 Click</title>
    <theme>BSNL</theme>

    <levelName>Battle_100Click</levelName>
    <creatorsName>John Conomikes</creatorsName>

    <startPoint>-100</startPoint>
    <endPoint>100</endPoint>

    <totalTrials>42</totalTrials>
    <questionSequence>randomOnce</questionSequence>

    <perfectHitPercent>97</perfectHitPercent>
    <partialHitPercent>95</partialHitPercent>
    <nearMissHitPercent>92</nearMissHitPercent>

    <questionType>normal</questionType>
    <numberType>whole</numberType>
    <mode>submarine</mode>

    <guidesEnabled>true</guidesEnabled>
    <guidesMode>normal</guidesMode>
    <guidesType>1</guidesType>

    <timeLimit>5</timeLimit>

    <questions>
        <question>
            <answer>-100</answer>
        </question>
        <question>
            <answer>-95</answer>
        </question>
        <question>
            <answer>-88</answer>
        </question>
        <question>
            <answer>-85</answer>
        </question>
        <question>
            <answer>-80</answer>
        </question>
        <question>
            <answer>-71</answer>
        </question>
        <question>
            <answer>-62</answer>
        </question>
        <question>
            <answer>-61</answer>
        </question>
        <question>
            <answer>-56</answer>
        </question>
        <question>
            <answer>-49</answer>
        </question>
        <question>
            <answer>-44</answer>
        </question>
        <question>
            <answer>-44</answer>
        </question>
        <question>
            <answer>-40</answer>
        </question>
        <question>
            <answer>-37</answer>
        </question>
        <question>
            <answer>-28</answer>
        </question>
        <question>
            <answer>-21</answer>
        </question>
        <question>
            <answer>-20</answer>
        </question>
        <question>
            <answer>-12</answer>
        </question>
        <question>
            <answer>-10</answer>
        </question>
        <question>
            <answer>-8</answer>
        </question>
        <question>
            <answer>0</answer>
        </question>
        <question>
            <answer>2</answer>
        </question>
        <question>
            <answer>7</answer>
        </question>
        <question>
            <answer>14</answer>
        </question>
        <question>
            <answer>16</answer>
        </question>
        <question>
            <answer>21</answer>
        </question>
        <question>
            <answer>29</answer>
        </question>
        <question>
            <answer>33</answer>
        </question>
        <question>
            <answer>37</answer>
        </question>
        <question>
            <answer>44</answer>
        </question>
        <question>
            <answer>50</answer>
        </question>
        <question>
            <answer>52</answer>
        </question>
        <question>
            <answer>60</answer>
        </question>
        <question>
            <answer>62</answer>
        </question>
        <question>
            <answer>65</answer>
        </question>
        <question>
            <answer>73</answer>
        </question>
        <question>
            <answer>77</answer>
        </question>
        <question>
            <answer>81</answer>
        </question>
        <question>
            <answer>84</answer>
        </question>
        <question>
            <answer>96</answer>
        </question>
        <question>
            <answer>98</answer>
        </question>
        <question>
            <answer>42</answer>
        </question>
    </questions>
</level>


text:
package ktak.differegex;

import java.util.Comparator;

import org.junit.Assert;
import org.junit.Test;

public class AlternationNormalizationTest {

    private static final Comparator<Character> charCmp =
            (c1, c2) -> c1.compareTo(c2);

    private static final RegexComparator<Character> regexCmp =
            new RegexComparator<Character>(charCmp);

    Regex<Character> testRegex =
            Regex.singleChar('a')
            .seq(
                    Regex.singleChar('b').alt(Regex.singleChar('c')))
            .negate()
            .zeroOrMore()
            .conj(
                    Regex.singleChar('x')
                    .seq(Regex.singleChar('y'))
                    .seq(Regex.singleChar('z')));

    @Test
    public void idempotenceTest() {

        Assert.assertEquals(0, regexCmp.compare(
                testRegex.alt(testRegex).normalize(regexCmp),
                testRegex.normalize(regexCmp)));

        Assert.assertEquals(0, regexCmp.compare(
                Regex.singleChar('b')
                .alt(Regex.singleChar('a'))
                .alt(Regex.singleChar('b').alt(
                        Regex.singleChar('c'))
                        .alt(Regex.singleChar('a')))
                .normalize(regexCmp),
                Regex.singleChar('a').alt(
                        Regex.singleChar('b').alt(
                                Regex.singleChar('c')))));

    }

    @Test
    public void emptySetIdentityElementTest() {

        Assert.assertEquals(0, regexCmp.compare(
                testRegex.alt(new EmptySet<Character>()).normalize(regexCmp),
                testRegex.normalize(regexCmp)));

        Assert.assertEquals(0, regexCmp.compare(
                new EmptySet<Character>().alt(testRegex).normalize(regexCmp),
                testRegex.normalize(regexCmp)));

    }

    @Test
    public void emptySetNegationZeroElementTest() {

        Assert.assertEquals(0, regexCmp.compare(
                testRegex.alt(new EmptySet<Character>().negate()).normalize(regexCmp),
                new EmptySet<Character>().negate()));

        Assert.assertEquals(0, regexCmp.compare(
                new EmptySet<Character>().negate().alt(testRegex).normalize(regexCmp),
                new EmptySet<Character>().negate()));

    }

    @Test
    public void rightAssociativityTest() {

        Regex<Character> rightAssociative =
                Regex.singleChar('a').alt(
                        Regex.singleChar('b').alt(
                                Regex.singleChar('c').alt(
                                        Regex.singleChar('d'))));

        Assert.assertEquals(0, regexCmp.compare(
                rightAssociative.normalize(regexCmp), rightAssociative));

        Assert.assertEquals(0, regexCmp.compare(
                Regex.singleChar('a')
                .alt(Regex.singleChar('b'))
                .alt(Regex.singleChar('c'))
                .alt(Regex.singleChar('d'))
                .normalize(regexCmp),
                rightAssociative));

        Assert.assertEquals(0, regexCmp.compare(
                Regex.singleChar('c')
                .alt(Regex.singleChar('d'))
                .alt(Regex.singleChar('a').alt(Regex.singleChar('b')))
                .normalize(regexCmp),
                rightAssociative));

    }

    @Test
    public void subComponentOrderingTest() {

        Regex<Character> regex =
                Regex.singleChar('x')
                .alt(
                        Regex.singleChar('y').zeroOrMore().conj(Regex.singleChar('z').negate()))
                .seq(
                        Regex.singleChar('a').seq(Regex.singleChar('b')));

        Regex<Character> lesser =
                regexCmp.compare(regex.normalize(regexCmp), testRegex.normalize(regexCmp)) == -1 ?
                        regex.normalize(regexCmp) : testRegex.normalize(regexCmp);

        Regex<Character> greater =
                regexCmp.compare(regex.normalize(regexCmp), testRegex.normalize(regexCmp)) == -1 ?
                        testRegex.normalize(regexCmp) : regex.normalize(regexCmp);

        Assert.assertEquals(0, regexCmp.compare(
                lesser.alt(greater).normalize(regexCmp),
                greater.alt(lesser).normalize(regexCmp)));

    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans
	xmlns:beans="http://www.springframework.org/schema/beans"
	xmlns:security="http://www.springframework.org/schema/security"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
    http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.0.xsd">

  <security:authentication-manager alias="authenticationManager">
    <security:authentication-provider>
      <security:user-service>
        <security:user name="antadmin2" password="^i3d@anta!" authorities="ROLE_ADMIN,ROLE_PUBLISHER" />
        <security:user name="srichard" password="5mrGPT@dm1n" authorities="ROLE_ADMIN,ROLE_PUBLISHER" />
        <security:user name="antpublisher" password="^i3d@pub!" authorities="ROLE_PUBLISHER" />
        <security:user name="user" password="user" authorities="ROLE_USER" />
      </security:user-service>
    </security:authentication-provider>
  </security:authentication-manager>

</beans:beans>


text:
import idaapi
import idautils
import idc
import os

# ----------------------------------------------------------------------
class asm_colorizer_t(object):
    def is_id(self, ch):
        return ch == '_' or ch.isalpha() or '0' <= ch <= '9'

    def get_identifier(self, line, x, e):
        i = x
        is_digit = line[i].isdigit()
        while i < e:
            ch = line[i]
            if not self.is_id(ch):
                if ch != '.' or not is_digit:
                    break
            i += 1
        return (i, line[x:i])

    def get_quoted_string(self, line, x, e):
        quote = line[x]
        i = x + 1
        while i < e:
            ch = line[i]
            if ch == '\\' and line[i+1] == quote:
                i += 1
            elif ch == quote:
                i += 1 # also take the quote
                break
            i += 1
        return (i, line[x:i])

    def colorize(self, lines):
        for line in lines:
            line = line.rstrip()
            if not line:
                self.add_line()
                continue
            x = 0
            e = len(line)
            s = ""
            while x < e:
                ch = line[x]
                # String?
                if ch == '"' or ch == "'":
                    x, w = self.get_quoted_string(line, x, e)
                    s += self.as_string(w)
                # Tab?
                elif ch == '\t':
                    s += ' ' * 4
                    x += 1
                # Comment?
                elif ch == ';':
                    s += self.as_comment(line[x:])
                    # Done with this line
                    break
                elif ch == '.' and x + 1 < e:
                    x, w = self.get_identifier(line, x + 1, e)
                    s += self.as_directive(ch + w)
                # Identifiers?
                elif self.is_id(ch):
                    x, w = self.get_identifier(line, x, e)
                    # Number?
                    if ch.isdigit():
                        s += self.as_num(w)
                    # Other identifier
                    else:
                        s += self.as_id(w)
                # Output as is
                else:
                    s += ch
                    x += 1
            self.add_line(s)

# -----------------------------------------------------------------------
class asmview_t(idaapi.simplecustviewer_t, asm_colorizer_t):
    def Create(self, fn):
        # Create the customview
        if not idaapi.simplecustviewer_t.Create(self, "Viewing file - %s" % os.path.basename(fn)):
            return False

        self.instruction_list = idautils.GetInstructionList()
        self.instruction_list.extend(["ret"])
        self.register_list    = idautils.GetRegisterList()
        self.register_list.extend(["eax", "ebx", "ecx", "edx", "edi", "esi", "ebp", "esp"])

        self.fn = fn
        if not self.reload_file():
            return False

        self.id_refresh = self.AddPopupMenu("Refresh")
        self.id_close   = self.AddPopupMenu("Close")

        return True

    def reload_file(self):
        if not self.colorize_file(self.fn):
            self.Close()
            return False
        return True

    def colorize_file(self, fn):
        try:
            f = open(fn, "r")
            lines = f.readlines()
            f.close()
            self.ClearLines()
            self.colorize(lines)
            return True
        except:
            return False

    def add_line(self, s=None):
        if not s:
            s = ""
        self.AddLine(s)

    def as_comment(self, s):
        return idaapi.COLSTR(s, idaapi.SCOLOR_RPTCMT)

    def as_id(self, s):
        t = s.lower()
        if t in self.register_list:
            return idaapi.COLSTR(s, idaapi.SCOLOR_REG)
        elif t in self.instruction_list:
            return idaapi.COLSTR(s, idaapi.SCOLOR_INSN)
        else:
            return s

    def as_string(self, s):
        return idaapi.COLSTR(s, idaapi.SCOLOR_STRING)

    def as_num(self, s):
        return idaapi.COLSTR(s, idaapi.SCOLOR_NUMBER)

    def as_directive(self, s):
        return idaapi.COLSTR(s, idaapi.SCOLOR_KEYWORD)

    def OnPopupMenu(self, menu_id):
        """
        A context (or popup) menu item was executed.
        @param menu_id: ID previously registered with AddPopupMenu()
        @return: Boolean
        """
        if self.id_refresh == menu_id:
            return self.reload_file()
        elif self.id_close == menu_id:
            self.Close()
            return True
        return False

    def OnKeydown(self, vkey, shift):
        """
        User pressed a key
        @param vkey: Virtual key code
        @param shift: Shift flag
        @return Boolean. True if you handled the event
        """
        # ESCAPE
        if vkey == 27:
            self.Close()
        elif vkey == ord('H'):
            lineno = self.GetLineNo()
            if lineno is not None:
                line, fg, bg = self.GetLine(lineno)
                if line and line[0] != idaapi.SCOLOR_INV:
                    s = idaapi.SCOLOR_INV + line + idaapi.SCOLOR_INV
                    self.EditLine(lineno, s, fg, bg)
                    self.Refresh()
        elif vkey == ord('C'):
            self.ClearLines()
            self.Refresh()
        elif vkey == ord('S'):
            print "Selection (x1, y1, x2, y2) = ", self.GetSelection()
        elif vkey == ord('I'):
            print "Position (line, x, y) = ", self.GetPos(mouse = 0)
        else:
            return False
        return True

# -----------------------------------------------------------------------
class asmviewplg(idaapi.plugin_t):
    flags = idaapi.PLUGIN_KEEP
    comment = "ASM viewer"
    help = "This is help"
    wanted_name = "ASM file viewer"
    wanted_hotkey = "Alt-F8"
    def __init__(self):
        self.view = None

    def init(self):
        return idaapi.PLUGIN_KEEP
    def run(self, arg):
        if self.view:
            self.Close()
        fn = idc.AskFile(0, "*.asm", "Select ASM file to view")
        if not fn:
            return
        self.view = asmview_t()
        if not self.view.Create(fn):
            return
        self.view.Show()

    def term(self):
        if self.view:
            self.view.Close()

def PLUGIN_ENTRY():
    return asmviewplg()


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>polyloader — polyloader 0.1.0 documentation</title>

    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />

    <link rel="top" title="polyloader 0.1.0 documentation" href="../index.html" />
    <link rel="up" title="Module code" href="index.html" />

Navigation

          index

          modules |

polyloader 0.1.0 documentation »

Module code »

Source code for polyloader

# -*- coding: utf-8 -*-
import sys

__author__ = 'Kenneth M. "Elf" Sternberg'
__email__ = 'elf.sternberg@gmail.com'
__version__ = '0.1.0'

if sys.version_info[0:2] >= (2, 6):
    from ._python2 import install, reset

if sys.version_info[0] >= 3:
    from ._python3 import install, reset

__all__ = ['install', 'reset']

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

    Enter search terms or a module, class or function name.

Navigation

          index

          modules |

polyloader 0.1.0 documentation »

Module code »

        © Copyright 2016, Kenneth M. "Elf" Sternberg.
      Created using Sphinx 1.2.2.


text:
package com.ctrip.xpipe.redis.checker.healthcheck.actions.sentinel.collector.command;

import com.ctrip.xpipe.cluster.ClusterType;
import com.ctrip.xpipe.endpoint.HostPort;
import com.ctrip.xpipe.pool.XpipeNettyClientKeyedObjectPool;
import com.ctrip.xpipe.redis.checker.AbstractCheckerTest;
import com.ctrip.xpipe.redis.checker.SentinelManager;
import com.ctrip.xpipe.redis.checker.alert.AlertManager;
import com.ctrip.xpipe.redis.checker.healthcheck.RedisHealthCheckInstance;
import com.ctrip.xpipe.redis.core.meta.MetaCache;
import com.ctrip.xpipe.redis.core.protocal.cmd.AbstractRedisCommand;
import com.ctrip.xpipe.simpleserver.Server;
import com.ctrip.xpipe.tuple.Pair;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.ScheduledExecutorService;

import static org.mockito.Mockito.*;

@RunWith(MockitoJUnitRunner.class)
public class ResetSentinelsTest extends AbstractCheckerTest {

    private ResetSentinels resetSentinels;

    @Mock
    private SentinelManager sentinelManager;
    @Mock
    private MetaCache metaCache;
    @Mock
    private AlertManager alertManager;
    @Mock
    private XpipeNettyClientKeyedObjectPool keyedObjectPool;
    @Mock
    private ScheduledExecutorService scheduled;
    @Mock
    private ExecutorService resetExecutor;

    @Before
    public void init() throws Exception {
        resetSentinels = new ResetSentinels(new SentinelHelloCollectContext(), metaCache, alertManager,
                keyedObjectPool, scheduled, resetExecutor,sentinelManager);
        resetSentinels.setKeyedObjectPool(getXpipeNettyClientKeyedObjectPool()).setScheduled(scheduled);
    }

    @Test
    public void testOneWayReset() throws Exception {
        RedisHealthCheckInstance instance = newRandomRedisHealthCheckInstance("currentDc", "activeDc", randomPort());
        resetSentinels.setContext(new SentinelHelloCollectContext().setInfo(instance.getCheckInfo()));

//        sentinelManager.slaves
        when(metaCache.getAllKeepers()).thenReturn(Sets.newHashSet(new HostPort(LOCAL_HOST, 8000), new HostPort(LOCAL_HOST, 8001)));
        Pair<Boolean, String> shouldResetAndReason = resetSentinels.shouldReset(Lists.newArrayList(new HostPort(LOCAL_HOST, 8000), new HostPort(LOCAL_HOST, 8001)), "cluster", "shard");
        Assert.assertTrue(shouldResetAndReason.getKey());
        Assert.assertTrue(shouldResetAndReason.getValue().contains("has 2 keepers"));

        HostPort wrongSlave = new HostPort("otherClusterShardSlave", 6379);
        when(metaCache.findClusterShard(wrongSlave)).thenReturn(new Pair<>("otherCluster", "otherShard"));
        shouldResetAndReason = resetSentinels.shouldReset(Lists.newArrayList(new HostPort(LOCAL_HOST, 8000), wrongSlave), "cluster", "shard");
        Assert.assertTrue(shouldResetAndReason.getKey());
        Assert.assertTrue(shouldResetAndReason.getValue().contains("but meta:otherCluster:otherShard"));

        Server unknownKeeperServer = startServer(randomPort(), "*3\r\n"
                + "$6\r\nkeeper\r\n"
                + ":0\r\n*0\r\n");
        HostPort unknownKeeper = new HostPort(LOCAL_HOST, unknownKeeperServer.getPort());
        when(metaCache.findClusterShard(unknownKeeper)).thenReturn(null);
        shouldResetAndReason = resetSentinels.shouldReset(Lists.newArrayList(new HostPort(LOCAL_HOST, 8000), unknownKeeper), "cluster", "shard");
        Assert.assertTrue(shouldResetAndReason.getKey());
        Assert.assertTrue(shouldResetAndReason.getValue().contains("keeper or dead"));

        unknownKeeperServer.stop();
        shouldResetAndReason = resetSentinels.shouldReset(Lists.newArrayList(new HostPort(LOCAL_HOST, 8000), unknownKeeper), "cluster", "shard");
        Assert.assertTrue(shouldResetAndReason.getKey());
        Assert.assertTrue(shouldResetAndReason.getValue().contains("keeper or dead"));

        HostPort trueSlave = new HostPort(LOCAL_HOST, 6379);
        when(metaCache.findClusterShard(trueSlave)).thenReturn(new Pair<>("cluster", "shard"));
        shouldResetAndReason = resetSentinels.shouldReset(Lists.newArrayList(new HostPort(LOCAL_HOST, 8000), trueSlave), "cluster", "shard");
        Assert.assertFalse(shouldResetAndReason.getKey());

    }

    @Test
    public void testOneWayIsRedundantInstance() throws Exception {
        RedisHealthCheckInstance instance = newRandomRedisHealthCheckInstance("currentDc", "activeDc", randomPort());
        resetSentinels.setContext(new SentinelHelloCollectContext().setInfo(instance.getCheckInfo()));
        int originTimeout = AbstractRedisCommand.DEFAULT_REDIS_COMMAND_TIME_OUT_MILLI;
        try {
            AbstractRedisCommand.DEFAULT_REDIS_COMMAND_TIME_OUT_MILLI = 10;
            boolean result = resetSentinels.redundantInstance(localHostport(0));
            logger.info("{}", result);
            Assert.assertTrue(result);
        } finally {
            AbstractRedisCommand.DEFAULT_REDIS_COMMAND_TIME_OUT_MILLI = originTimeout;
        }
    }

    @Test
    public void testNotOneWayReset() throws Exception {
        RedisHealthCheckInstance instance = newRandomRedisHealthCheckInstance("currentDc", "activeDc", randomPort(),ClusterType.CROSS_DC);
        resetSentinels.setContext(new SentinelHelloCollectContext().setInfo(instance.getCheckInfo()));

        HostPort trueSlave = new HostPort(LOCAL_HOST, 6379);
        when(metaCache.findClusterShard(trueSlave)).thenReturn(new Pair<>("cluster", "shard"));
        Pair<Boolean, String> shouldResetAndReason = resetSentinels.shouldReset(Lists.newArrayList(trueSlave), "cluster", "shard");
        Assert.assertFalse(shouldResetAndReason.getKey());

        HostPort wrongSlave = new HostPort("otherClusterShardSlave", 6379);
        when(metaCache.findClusterShard(wrongSlave)).thenReturn(new Pair<>("otherCluster", "otherShard"));
        shouldResetAndReason = resetSentinels.shouldReset(Lists.newArrayList(trueSlave, wrongSlave), "cluster", "shard");
        Assert.assertTrue(shouldResetAndReason.getKey());
        Assert.assertTrue(shouldResetAndReason.getValue().contains("but meta:otherCluster:otherShard"));

        Server unknownActiveServer = startServer(randomPort(), "*3\r\n"
                + "$6\r\nslave\r\n"
                + ":0\r\n*0\r\n");
        HostPort unknownActive = new HostPort(LOCAL_HOST, unknownActiveServer.getPort());
        when(metaCache.findClusterShard(unknownActive)).thenReturn(null);
        shouldResetAndReason = resetSentinels.shouldReset(Lists.newArrayList(trueSlave, unknownActive), "cluster", "shard");
        Assert.assertFalse(shouldResetAndReason.getKey());
        verify(alertManager, times(1)).alert(anyString(), anyString(), any(), any(), anyString());

        unknownActiveServer.stop();
        waitConditionUntilTimeOut(() -> unknownActiveServer.getConnected() <= 0);
        shouldResetAndReason = resetSentinels.shouldReset(Lists.newArrayList(trueSlave, unknownActive), "cluster", "shard");
        Assert.assertTrue(shouldResetAndReason.getKey());
        Assert.assertTrue(shouldResetAndReason.getValue().contains("keeper or dead"));
        verify(metaCache, never()).getAllKeepers();

    }

}


text:
package core.menu;

import core.Frame;

public abstract class SetupScreen {

	Frame frame;
	public boolean finished = false;

	public SetupScreen(Frame frame) {
		this.frame = frame;
	}

	public abstract void cancel();

	public void finish() {
		finished = true;
	}
}


text:
{{ currentResource.resource.data.name }}

Unit:  {{ currentResource.resource.data.unit }}

Primary Contact Information

Name: {{ currentResource.resource.data.firstName }} {{ currentResource.resource.data.lastName }}

Phone: {{ currentResource.resource.data.phoneNumber }}

Email: {{ currentResource.resource.data.email }}


text:
When using Jest's snapshot capability one should be mindful of the size of
created snapshots. As a general best practice snapshots should be limited in
size in order to be more manageable and reviewable. A stored snapshot is only as
good as its review and as such keeping it short, sweet, and readable is
important to allow for thorough reviews.

## Usage

Because Jest snapshots are written with back-ticks (\` \`) which are only valid
with
[ES2015 onwards](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
you should set `parserOptions` in your config to at least allow ES2015 in order
to use this rule:

```js
module.exports = {
  parserOptions: {
    ecmaVersion: 2015,
  },
};
```

## Rule Details

This rule looks at all Jest inline and external snapshots (files with `.snap`
extension) and validates that each stored snapshot within those files does not
exceed 50 lines (by default, this is configurable as explained in `Options`
section below).

Example of **incorrect** code for this rule:

```js
exports[`a large snapshot 1`] = `
line 1
line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
line 10
line 11
line 12
line 13
line 14
line 15
line 16
line 17
line 18
line 19
line 20
line 21
line 22
line 23
line 24
line 25
line 26
line 27
line 28
line 29
line 30
line 31
line 32
line 33
line 34
line 35
line 36
line 37
line 38
line 39
line 40
line 41
line 42
line 43
line 44
line 45
line 46
line 47
line 48
line 49
line 50
line 51
`;
```

Example of **correct** code for this rule:

```js
exports[`a more manageable and readable snapshot 1`] = `
line 1
line 2
line 3
line 4
`;
```

## Options

This rule has options for modifying the max number of lines allowed for a
snapshot:

In an `eslintrc` file:

```json
{
  "rules": {
    "jest/no-large-snapshots": ["warn", { "maxSize": 12, "inlineMaxSize": 6 }]
  }
}
```

Max number of lines allowed could be defined by snapshot type (Inline and
External). Use `inlineMaxSize` for
[Inline Snapshots](https://jestjs.io/docs/en/snapshot-testing#inline-snapshots)
size and `maxSize` for
[External Snapshots](https://jestjs.io/docs/en/snapshot-testing#snapshot-testing-with-jest).
If only `maxSize` is provided on options, the value of `maxSize` will be used to
both snapshot types (Inline and External).

Since `eslint-disable` comments are not preserved by Jest when updating
snapshots, you can use the `allowedSnapshots` option to have specific snapshots
allowed regardless of their size.

This option takes a map, with the key being the absolute filepath to a snapshot
file, and the value an array of values made up of strings and regular
expressions to compare to the names of the snapshots in the `.snap` file when
checking if the snapshots size should be allowed.

Note that regular expressions can only be passed in via `.eslintrc.js` as
instances of `RegExp`.

In an `.eslintrc.js` file:

```javascript
module.exports = {
  rules: {
    'jest/no-large-snapshots': [
      'error',
      {
        allowedSnapshots: {
          '/path/to/file.js.snap': ['snapshot name 1', /a big snapshot \d+/],
        },
      },
    ],
  },
};
```

Since absolute paths are typically not very portable, you can use the builtin
`path.resolve` function to expand relative paths into absolutes like so:

```javascript
const path = require('path');

module.exports = {
  rules: {
    'jest/no-large-snapshots': [
      'error',
      {
        allowedSnapshots: {
          [path.resolve('test/__snapshots__/get.js.snap')]: ['full request'],
          [path.resolve('test/__snapshots__/put.js.snap')]: ['full request'],
        },
      },
    ],
  },
};
```


text:
package iso20022

// Acceptor configuration to be downloaded from the terminal management system.
type AcceptorConfiguration4 struct {

	// Identification of the point of interaction for terminal management.
	POIIdentification *GenericIdentification71 `xml:"POIId,omitempty"`

	// Identification of the terminal management system (TMS) sending the acceptor parameters.
	TerminalManagerIdentification *GenericIdentification71 `xml:"TermnlMgrId"`

	// Data set containing the acceptor parameters of a point of interaction (POI).
	DataSet []*TerminalManagementDataSet14 `xml:"DataSet"`
}

func (a *AcceptorConfiguration4) AddPOIIdentification() *GenericIdentification71 {
	a.POIIdentification = new(GenericIdentification71)
	return a.POIIdentification
}

func (a *AcceptorConfiguration4) AddTerminalManagerIdentification() *GenericIdentification71 {
	a.TerminalManagerIdentification = new(GenericIdentification71)
	return a.TerminalManagerIdentification
}

func (a *AcceptorConfiguration4) AddDataSet() *TerminalManagementDataSet14 {
	newValue := new(TerminalManagementDataSet14)
	a.DataSet = append(a.DataSet, newValue)
	return newValue
}


text:
 package afk.ge;

import static afk.ge.AbstractFilter.getPixels;
import static afk.ge.AbstractFilter.setPixels;
import java.awt.Color;
import java.awt.image.BufferedImage;

/**
 *
 * @author Daniel
 */
public class MultiplyFilter extends AbstractFilter
{

    private Color mixColor;

    public MultiplyFilter(Color mixColor)
    {
        this.mixColor = mixColor;
    }

    @Override
    public BufferedImage filter(BufferedImage src, BufferedImage dest)
    {
        if (dest == null)
        {
            dest = createCompatibleDestImage(src, null);
        }

        int width = src.getWidth();
        int height = src.getHeight();

        int[] pixels = new int[width * height];
        getPixels(src, 0, 0, width,
                height, pixels);
        mixColor(pixels);
        setPixels(dest, 0, 0, width,
                height, pixels);
        return dest;
    }

    private void mixColor(int[] inPixels)
    {
        int mix_a = mixColor.getAlpha();
        int mix_r = mixColor.getRed();
        int mix_b = mixColor.getBlue();
        int mix_g = mixColor.getGreen();

        for (int i = 0; i < inPixels.length; i++)
        {
            int argb = inPixels[i];

            int a = argb & 0xFF000000;
            int r = (argb >> 16) & 0xFF;
            int g = (argb >> 8) & 0xFF;
            int b = (argb) & 0xFF;
            r = (int) ((r * mix_r) / 256.0f);
            g = (int) ((g * mix_g) / 256.0f);
            b = (int) ((b * mix_b) / 256.0f);

            inPixels[i] = a << 24 | r << 16 | g << 8 | b;
        }
    }
}


text:
extern crate chrono;
extern crate tina;

use tina::*;

mod eew_builder;
use eew_builder::*;

const DEF_COND: ValueCondition = ValueCondition {
	first: None, succeeding: None, alert: None, last: None, cancel: None, drill: None, test: None,
	phase_changed: None, epicenter_name_changed: None, magnitude_over: None, intensity_over: None,
	intensity_up: None, intensity_down: None,
};

#[test]
fn it_should_return_true_when_no_value_is_supplied()
{
	let eew = EEWBuilder::new().build();
	let cond = ValueCondition { .. DEF_COND };

	assert_eq!(cond.is_satisfied(&eew, None), true);
	assert_eq!(cond.is_satisfied(&eew, Some(&eew)), true);
}

#[test]
fn it_should_handle_first_condition()
{
	let eew = EEWBuilder::new().build();
	let cond = ValueCondition { first: Some(true), .. DEF_COND };

	assert_eq!(cond.is_satisfied(&eew, None), true);
	assert_eq!(cond.is_satisfied(&eew, Some(&eew)), false);
}

#[test]
fn it_should_handle_succeeding_condition()
{
	let eew = EEWBuilder::new().build();
	let cond = ValueCondition { succeeding: Some(true), .. DEF_COND };

	assert_eq!(cond.is_satisfied(&eew, None), false);
	assert_eq!(cond.is_satisfied(&eew, Some(&eew)), true);
}

#[test]
fn it_should_handle_alert_condition()
{
	let bad_eew = EEWBuilder::new().build();
	let good_eew = EEWBuilder::new().warning_status(WarningStatus::Alert).build();
	let cond = ValueCondition { alert: Some(true), .. DEF_COND };

	assert_eq!(cond.is_satisfied(&bad_eew, None), false);
	assert_eq!(cond.is_satisfied(&good_eew, None), true);
}

#[test]
#[ignore]
fn it_should_handle_last_condition()
{
	unimplemented!()
}

#[test]
#[ignore]
fn it_should_handle_cancel_condition()
{
	unimplemented!()
}

#[test]
#[ignore]
fn it_should_handle_drill_condition()
{
	unimplemented!()
}

#[test]
#[ignore]
fn it_should_handle_test_condition()
{
	unimplemented!()
}

#[test]
#[ignore]
fn it_should_handle_phase_changed_condition()
{
	unimplemented!()
}

#[test]
fn it_should_handle_epicenter_name_changed_condition()
{
	let a_eew = EEWBuilder::new().epicenter_name("A").build();
	let b_eew = EEWBuilder::new().epicenter_name("B").build();
	let cond = ValueCondition { epicenter_name_changed: Some(true), .. DEF_COND };

	assert_eq!(cond.is_satisfied(&a_eew, None), false);
	assert_eq!(cond.is_satisfied(&a_eew, Some(&a_eew)), false);
	assert_eq!(cond.is_satisfied(&a_eew, Some(&b_eew)), true);
}

#[test]
fn it_should_handle_magnitude_over_condition()
{
	let detail_none_eew = EEWBuilder::new().detail_none().build();
	let m_none_eew = EEWBuilder::new().magnitude(None).build();
	let bad_eew = EEWBuilder::new().magnitude(Some(4.0)).build();
	let good_eew = EEWBuilder::new().magnitude(Some(4.1)).build();
	let cond = ValueCondition { magnitude_over: Some(4.1), .. DEF_COND };

	assert_eq!(cond.is_satisfied(&detail_none_eew, None), false);
	assert_eq!(cond.is_satisfied(&m_none_eew, None), false);
	assert_eq!(cond.is_satisfied(&bad_eew, None), false);
	assert_eq!(cond.is_satisfied(&good_eew, None), true);
}

#[test]
fn it_should_handle_intensity_over_condition()
{
	let detail_none_eew = EEWBuilder::new().detail_none().build();
	let i_none_eew = EEWBuilder::new().maximum_intensity(None).build();
	let bad_eew = EEWBuilder::new().maximum_intensity(Some(IntensityClass::FiveLower)).build();
	let good_eew = EEWBuilder::new().maximum_intensity(Some(IntensityClass::FiveUpper)).build();
	let cond = ValueCondition { intensity_over: Some(IntensityClass::FiveUpper), .. DEF_COND };

	assert_eq!(cond.is_satisfied(&detail_none_eew, None), false);
	assert_eq!(cond.is_satisfied(&i_none_eew, None), false);
	assert_eq!(cond.is_satisfied(&bad_eew, None), false);
	assert_eq!(cond.is_satisfied(&good_eew, None), true);
}

#[test]
fn it_should_handle_intensity_up_condition()
{
	let detail_none_eew = EEWBuilder::new().detail_none().build();
	let i_none_eew = EEWBuilder::new().maximum_intensity(None).build();
	let lo_eew = EEWBuilder::new().maximum_intensity(Some(IntensityClass::FiveLower)).build();
	let hi_eew = EEWBuilder::new().maximum_intensity(Some(IntensityClass::FiveUpper)).build();
	let cond = ValueCondition { intensity_up: Some(1), .. DEF_COND };

	assert_eq!(cond.is_satisfied(&detail_none_eew, Some(&detail_none_eew)), false);
	assert_eq!(cond.is_satisfied(&detail_none_eew, Some(&i_none_eew)), false);
	assert_eq!(cond.is_satisfied(&detail_none_eew, Some(&lo_eew)), false);
	assert_eq!(cond.is_satisfied(&detail_none_eew, Some(&hi_eew)), false);

	assert_eq!(cond.is_satisfied(&i_none_eew, Some(&detail_none_eew)), false);
	assert_eq!(cond.is_satisfied(&i_none_eew, Some(&i_none_eew)), false);
	assert_eq!(cond.is_satisfied(&i_none_eew, Some(&lo_eew)), false);
	assert_eq!(cond.is_satisfied(&i_none_eew, Some(&hi_eew)), false);

	assert_eq!(cond.is_satisfied(&lo_eew, Some(&detail_none_eew)), false);
	assert_eq!(cond.is_satisfied(&lo_eew, Some(&i_none_eew)), true);
	assert_eq!(cond.is_satisfied(&lo_eew, Some(&lo_eew)), false);
	assert_eq!(cond.is_satisfied(&lo_eew, Some(&hi_eew)), false);

	assert_eq!(cond.is_satisfied(&hi_eew, Some(&detail_none_eew)), false);
	assert_eq!(cond.is_satisfied(&hi_eew, Some(&i_none_eew)), true);
	assert_eq!(cond.is_satisfied(&hi_eew, Some(&lo_eew)), true);
	assert_eq!(cond.is_satisfied(&hi_eew, Some(&hi_eew)), false);
}

#[test]
fn it_should_handle_intensity_up_condition_with_value_2()
{
	let i_none_eew = EEWBuilder::new().maximum_intensity(None).build();
	let zero_eew = EEWBuilder::new().maximum_intensity(Some(IntensityClass::Zero)).build();
	let one_eew = EEWBuilder::new().maximum_intensity(Some(IntensityClass::One)).build();
	let two_eew = EEWBuilder::new().maximum_intensity(Some(IntensityClass::Two)).build();
	let three_eew = EEWBuilder::new().maximum_intensity(Some(IntensityClass::Three)).build();
	let cond = ValueCondition { intensity_up: Some(2), .. DEF_COND };

	assert_eq!(cond.is_satisfied(&zero_eew, Some(&i_none_eew)), false);
	assert_eq!(cond.is_satisfied(&one_eew, Some(&i_none_eew)), true);

	assert_eq!(cond.is_satisfied(&two_eew, Some(&one_eew)), false);
	assert_eq!(cond.is_satisfied(&three_eew, Some(&one_eew)), true);
}

#[test]
fn it_should_handle_intensity_down_condition()
{
	let detail_none_eew = EEWBuilder::new().detail_none().build();
	let i_none_eew = EEWBuilder::new().maximum_intensity(None).build();
	let lo_eew = EEWBuilder::new().maximum_intensity(Some(IntensityClass::FiveLower)).build();
	let hi_eew = EEWBuilder::new().maximum_intensity(Some(IntensityClass::FiveUpper)).build();
	let cond = ValueCondition { intensity_down: Some(1), .. DEF_COND };

	assert_eq!(cond.is_satisfied(&detail_none_eew, Some(&detail_none_eew)), false);
	assert_eq!(cond.is_satisfied(&detail_none_eew, Some(&i_none_eew)), false);
	assert_eq!(cond.is_satisfied(&detail_none_eew, Some(&lo_eew)), false);
	assert_eq!(cond.is_satisfied(&detail_none_eew, Some(&hi_eew)), false);

	assert_eq!(cond.is_satisfied(&i_none_eew, Some(&detail_none_eew)), false);
	assert_eq!(cond.is_satisfied(&i_none_eew, Some(&i_none_eew)), false);
	assert_eq!(cond.is_satisfied(&i_none_eew, Some(&lo_eew)), true);
	assert_eq!(cond.is_satisfied(&i_none_eew, Some(&hi_eew)), true);

	assert_eq!(cond.is_satisfied(&lo_eew, Some(&detail_none_eew)), false);
	assert_eq!(cond.is_satisfied(&lo_eew, Some(&i_none_eew)), false);
	assert_eq!(cond.is_satisfied(&lo_eew, Some(&lo_eew)), false);
	assert_eq!(cond.is_satisfied(&lo_eew, Some(&hi_eew)), true);

	assert_eq!(cond.is_satisfied(&hi_eew, Some(&detail_none_eew)), false);
	assert_eq!(cond.is_satisfied(&hi_eew, Some(&i_none_eew)), false);
	assert_eq!(cond.is_satisfied(&hi_eew, Some(&lo_eew)), false);
	assert_eq!(cond.is_satisfied(&hi_eew, Some(&hi_eew)), false);
}

#[test]
fn it_should_handle_intensity_down_condition_with_value_2()
{
	let i_none_eew = EEWBuilder::new().maximum_intensity(None).build();
	let zero_eew = EEWBuilder::new().maximum_intensity(Some(IntensityClass::Zero)).build();
	let one_eew = EEWBuilder::new().maximum_intensity(Some(IntensityClass::One)).build();
	let two_eew = EEWBuilder::new().maximum_intensity(Some(IntensityClass::Two)).build();
	let three_eew = EEWBuilder::new().maximum_intensity(Some(IntensityClass::Three)).build();
	let cond = ValueCondition { intensity_down: Some(2), .. DEF_COND };

	assert_eq!(cond.is_satisfied(&i_none_eew, Some(&zero_eew)), false);
	assert_eq!(cond.is_satisfied(&i_none_eew, Some(&one_eew)), true);

	assert_eq!(cond.is_satisfied(&one_eew, Some(&two_eew)), false);
	assert_eq!(cond.is_satisfied(&one_eew, Some(&three_eew)), true);
}


text:
module MCollective
  module Facts
    require 'yaml'

    # A factsource that reads a hash of facts from a YAML file
    #
    # Multiple files can be specified seperated with a : in the
    # config file, they will be merged with later files overriding
    # earlier ones in the list.
    class Yaml_facts<Base
      def initialize
        @yaml_file_mtimes = {}

        super
      end

      def load_facts_from_source
        config = Config.instance

        fact_files = config.pluginconf["yaml"].split(File::PATH_SEPARATOR)
        facts = {}

        fact_files.each do |file|
          begin
            if File.exist?(file)
              facts.merge!(YAML.load(File.read(file)))
            else
              raise("Can't find YAML file to load: #{file}")
            end
          rescue Exception => e
            Log.error("Failed to load yaml facts from #{file}: #{e.class}: #{e}")
          end
        end

        facts
      end

      # force fact reloads when the mtime on the yaml file change
      def force_reload?
        config = Config.instance

        fact_files = config.pluginconf["yaml"].split(File::PATH_SEPARATOR)

        fact_files.each do |file|
          @yaml_file_mtimes[file] ||= File.stat(file).mtime
          mtime = File.stat(file).mtime

          if mtime > @yaml_file_mtimes[file]
            @yaml_file_mtimes[file] = mtime

            Log.debug("Forcing fact reload due to age of #{file}")

            return true
          end
        end

        false
      end
    end
  end
end


text:
package org.artifactory.ui.rest.service.artifacts.browse.treebrowser.tabs.nugetview;

import org.artifactory.addon.AddonsManager;
import org.artifactory.addon.nuget.UiNuGetAddon;
import org.artifactory.api.context.ContextHelper;
import org.artifactory.nuget.NuMetaData;
import org.artifactory.repo.InternalRepoPathFactory;
import org.artifactory.repo.RepoPath;
import org.artifactory.rest.common.service.ArtifactoryRestRequest;
import org.artifactory.rest.common.service.RestResponse;
import org.artifactory.rest.common.service.RestService;
import org.artifactory.ui.rest.model.artifacts.browse.treebrowser.tabs.nugetinfo.NugetArtifactInfo;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * @author Chen Keinan
 */
@Component
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class NugetViewService implements RestService {
    @Override
    public void execute(ArtifactoryRestRequest request, RestResponse response) {
        NugetArtifactInfo nugetArtifactInfo = (NugetArtifactInfo) request.getImodel();
        // get nuGet Meta data
        NugetArtifactInfo nuGetMetaData = getNuGetMetaData(nugetArtifactInfo);
        // update response with model data
        if (nuGetMetaData != null) {
            response.iModel(nuGetMetaData);
        }
    }

    /**
     * get  Nuget MetaData model
     *
     * @param nugetArtifactInfo
     * @return nuGet Meta Data model
     */
    private NugetArtifactInfo getNuGetMetaData(NugetArtifactInfo nugetArtifactInfo) {
        String repoKey = nugetArtifactInfo.getRepoKey();
        String path = nugetArtifactInfo.getPath();
        RepoPath repoPath = InternalRepoPathFactory.create(repoKey, path);
        AddonsManager addonsManager = ContextHelper.get().beanForType(AddonsManager.class);
        UiNuGetAddon uiNuGetAddon = addonsManager.addonByType(UiNuGetAddon.class);
        if (uiNuGetAddon != null) {
            NuMetaData nugetSpecMetaData = uiNuGetAddon.getNutSpecMetaData(repoPath);
            nugetArtifactInfo = new NugetArtifactInfo(nugetSpecMetaData);
        }
        return nugetArtifactInfo;
    }
}


text:
package dev.nick.tiles.tile;

import android.content.Intent;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;

/**
 * Description of a single dashboard tile that the user can select.
 */
public class Tile {
    /**
     * Default value for {@link Tile#id DashboardTile.id}
     * indicating that no identifier value is set.  All other values (including those below -1)
     * are valid.
     */
    public static final int TILE_ID_UNDEFINED = -1;
    public static final Parcelable.Creator<Tile> CREATOR = new Parcelable.Creator<Tile>() {
        public Tile createFromParcel(Parcel source) {
            return new Tile(source);
        }

        public Tile[] newArray(int size) {
            return new Tile[size];
        }
    };
    /**
     * Identifier for this tile, to correlate with a new list when
     * it is updated.  The default value is
     * {@link Tile#TILE_ID_UNDEFINED}, meaning no id.
     *
     * @attr ref android.R.styleable#PreferenceHeader_id
     */
    public int id = TILE_ID_UNDEFINED;
    /**
     * Resource ID of title of the tile that is shown to the user.
     *
     * @attr ref android.R.styleable#PreferenceHeader_title
     */
    public int titleRes;
    /**
     * Title of the tile that is shown to the user.
     *
     * @attr ref android.R.styleable#PreferenceHeader_title
     */
    public CharSequence title;
    /**
     * Resource ID of optional summary describing what this tile controls.
     *
     * @attr ref android.R.styleable#PreferenceHeader_summary
     */
    public int summaryRes;
    /**
     * Optional summary describing what this tile controls.
     *
     * @attr ref android.R.styleable#PreferenceHeader_summary
     */
    public CharSequence summary;
    /**
     * Optional icon resource to show for this tile.
     *
     * @attr ref android.R.styleable#PreferenceHeader_icon
     */
    public int iconRes;

    public Drawable iconDrawable;

    /**
     * Full class name of the fragment to display when this tile is
     * selected.
     *
     * @attr ref android.R.styleable#PreferenceHeader_fragment
     */
    public String fragment;
    /**
     * Optional arguments to supply to the fragment when it is
     * instantiated.
     */
    public Bundle fragmentArguments;
    /**
     * Intent to launch when the preference is selected.
     */
    public Intent intent;
    /**
     * Optional additional data for use by subclasses of the activity
     */
    public Bundle extras;
    public TileView tileView;

    public Tile() {
        // Empty
    }

    Tile(Parcel in) {
        readFromParcel(in);
    }

    /**
     * Return the currently set title.  If {@link #titleRes} is set,
     * this resource is loaded from <var>res</var> and returned.  Otherwise
     * {@link #title} is returned.
     */
    public CharSequence getTitle(Resources res) {
        if (titleRes != 0) {
            return res.getText(titleRes);
        }
        return title;
    }

    public TileView getTileView() {
        return tileView;
    }

    /**
     * Return the currently set summary.  If {@link #summaryRes} is set,
     * this resource is loaded from <var>res</var> and returned.  Otherwise
     * {@link #summary} is returned.
     */
    public CharSequence getSummary(Resources res) {
        if (summaryRes != 0) {
            return res.getText(summaryRes);
        }
        return summary;
    }

    public int describeContents() {
        return 0;
    }

    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeInt(titleRes);
        TextUtils.writeToParcel(title, dest, flags);
        dest.writeInt(summaryRes);
        TextUtils.writeToParcel(summary, dest, flags);
        dest.writeInt(iconRes);
        dest.writeString(fragment);
        dest.writeBundle(fragmentArguments);
        if (intent != null) {
            dest.writeInt(1);
            intent.writeToParcel(dest, flags);
        } else {
            dest.writeInt(0);
        }
        dest.writeBundle(extras);
    }

    public void readFromParcel(Parcel in) {
        id = in.readInt();
        titleRes = in.readInt();
        title = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
        summaryRes = in.readInt();
        summary = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
        iconRes = in.readInt();
        fragment = in.readString();
        fragmentArguments = in.readBundle();
        if (in.readInt() != 0) {
            intent = Intent.CREATOR.createFromParcel(in);
        }
        extras = in.readBundle();
    }
}


text:
package models

import (
	"testing"

	"github.com/gophish/gophish/config"
	"gopkg.in/check.v1"
)

// Hook up gocheck into the "go test" runner.
func Test(t *testing.T) { check.TestingT(t) }

type ModelsSuite struct {
	config *config.Config
}

var _ = check.Suite(&ModelsSuite{})

func (s *ModelsSuite) SetUpSuite(c *check.C) {
	conf := &config.Config{
		DBName:         "sqlite3",
		DBPath:         ":memory:",
		MigrationsPath: "../db/db_sqlite3/migrations/",
	}
	s.config = conf
	err := Setup(conf)
	if err != nil {
		c.Fatalf("Failed creating database: %v", err)
	}
}

func (s *ModelsSuite) TearDownTest(c *check.C) {
	// Clear database tables between each test. If new tables are
	// used in this test suite they will need to be cleaned up here.
	db.Delete(Group{})
	db.Delete(Target{})
	db.Delete(GroupTarget{})
	db.Delete(SMTP{})
	db.Delete(Page{})
	db.Delete(Result{})
	db.Delete(MailLog{})
	db.Delete(Campaign{})

	// Reset users table to default state.
	db.Not("id", 1).Delete(User{})
	db.Model(User{}).Update("username", "admin")
}

func (s *ModelsSuite) createCampaignDependencies(ch *check.C, optional ...string) Campaign {
	// we use the optional parameter to pass an alternative subject
	group := Group{Name: "Test Group"}
	group.Targets = []Target{
		Target{BaseRecipient: BaseRecipient{Email: "test1@example.com", FirstName: "First", LastName: "Example"}},
		Target{BaseRecipient: BaseRecipient{Email: "test2@example.com", FirstName: "Second", LastName: "Example"}},
		Target{BaseRecipient: BaseRecipient{Email: "test3@example.com", FirstName: "Second", LastName: "Example"}},
		Target{BaseRecipient: BaseRecipient{Email: "test4@example.com", FirstName: "Second", LastName: "Example"}},
	}
	group.UserId = 1
	ch.Assert(PostGroup(&group), check.Equals, nil)

	// Add a template
	t := Template{Name: "Test Template"}
	if len(optional) > 0 {
		t.Subject = optional[0]
	} else {
		t.Subject = "{{.RId}} - Subject"
	}
	t.Text = "{{.RId}} - Text"
	t.HTML = "{{.RId}} - HTML"
	t.UserId = 1
	ch.Assert(PostTemplate(&t), check.Equals, nil)

	// Add a landing page
	p := Page{Name: "Test Page"}
	p.HTML = "<html>Test</html>"
	p.UserId = 1
	ch.Assert(PostPage(&p), check.Equals, nil)

	// Add a sending profile
	smtp := SMTP{Name: "Test Page"}
	smtp.UserId = 1
	smtp.Host = "example.com"
	smtp.FromAddress = "test@test.com"
	ch.Assert(PostSMTP(&smtp), check.Equals, nil)

	c := Campaign{Name: "Test campaign"}
	c.UserId = 1
	c.Template = t
	c.Page = p
	c.SMTP = smtp
	c.Groups = []Group{group}
	return c
}

func (s *ModelsSuite) createCampaign(ch *check.C) Campaign {
	c := s.createCampaignDependencies(ch)
	// Setup and "launch" our campaign
	ch.Assert(PostCampaign(&c, c.UserId), check.Equals, nil)

	// For comparing the dates, we need to fetch the campaign again. This is
	// to solve an issue where the campaign object right now has time down to
	// the microsecond, while in MySQL it's rounded down to the second.
	c, _ = GetCampaign(c.Id, c.UserId)
	return c
}

func setupBenchmark(b *testing.B) {
	conf := &config.Config{
		DBName:         "sqlite3",
		DBPath:         ":memory:",
		MigrationsPath: "../db/db_sqlite3/migrations/",
	}
	err := Setup(conf)
	if err != nil {
		b.Fatalf("Failed creating database: %v", err)
	}
}

func tearDownBenchmark(b *testing.B) {
	err := db.Close()
	if err != nil {
		b.Fatalf("error closing database: %v", err)
	}
}

func resetBenchmark(b *testing.B) {
	db.Delete(Group{})
	db.Delete(Target{})
	db.Delete(GroupTarget{})
	db.Delete(SMTP{})
	db.Delete(Page{})
	db.Delete(Result{})
	db.Delete(MailLog{})
	db.Delete(Campaign{})

	// Reset users table to default state.
	db.Not("id", 1).Delete(User{})
	db.Model(User{}).Update("username", "admin")
}


text:
luonet's vim and other dotfiles, partially referenced [YARD](https://github.com/skwp/dotfiles).

## Install Vim dotfile

Both automatic installation and manual installation are available.

### Automatic Installation

```sh
sh -c "`curl -fsSL https://raw.githubusercontent.com/luonet/dotfiles/master/install`"
```

It might take a long time for the first time installation because under the hood it will:

- Upgrade package management program
- Install vim
- Install vim Plugins

### Manual Installation

* clone the project

  ```sh
  git clone https://github.com/luonet/dotfiles.git ~/.dotfiles
  cd ~/.dotfiles
  ```

* see all available rake tasks

  ```sh
  rake -T
  ```

* dry run and print all shell commands that will be executed

  ```sh
  DEBUG=1 rake
  ```

* execute default task

  ```sh
  rake
  ```

### Upgrade

```sh
rake update
```

### Uninstall

```sh
rake uninstall
```

Note: Uninstallation will keep vim and plugins, but plugins won't be loaded because there's no configuration file.

## Vim Frequently Used Key Bindings

### List Available Key Bindings

- ```:map``` all mode key mappings
- ```:nmap``` normal mode key mappings
- ```:vmap``` visual mode key mappings
- ```:imap``` insert mode key mappings

### Movement Key Bindings

- [normal mode] ```f then id``` quick jump to any words in the screen, the id for each word will be shown once you pressed ```f```
- [normal mode] ```ctrl and ]```  jump to definition, need to rebuild ctags first with ```ctags -R --exclude=node_modules```
- [normal mode] ```ctrl and o``` jump back to last cursor position
- [normal mode] ```ctrl and i``` jump back to next cursor position
- [normal mode] ```space then space``` jump to and jump back between the current editing file and the last edited file
- [normal mode] ``` ` then ` ``` jump to and jump back between the current editing line and the last edited line

### Selection Key Bindings

- [normal mode] ```ctrl and n``` press multiple times to select multiple current word and edit all of them at the same time

### Comment Key Bindings

- [visual mode] ```g then c``` toggle comment

### Alignment Key Bindings

- [visual mode] ```enter then =``` align selected lines by =
- [visual mode] ```enter then =``` align selected lines by :

### Buffers (Windows) Key Bindings

- [normal mode] ```space then f``` find from files recursively
- [normal mode] ```space then e``` open buffer lists
- [normal mode] ```space then y``` open yank lists
- [normal mode] ```space then e``` open undo list, go back to any edited version
- [normal mode] ```space then s``` grep globally
- [normal mode] ```space then c``` open console
- [normal mode] ```space then b``` open tag bar
- [normal mode] ```space then w``` open a new horizontal buffer on the right
- [normal mode] ```space then q``` shortcut for :q
- [normal mode] ```space then o``` maximize current buffer
- [normal mode] ```space then t```  toggle directory tree
- [normal mode] ```ctrl and h/j/k/l```  move left/up/down/right among buffers

## Other dotfiles

### Installation

Install all dotfiles

```sh
rake install_dotfiles
```

Or install specific dotfile running rake tasks listed in ```rake -T```, e.g.:

```sh
rake install_pryrc
```

### Uninstallation

Uninstall all dotfiles

```sh
rake uninstall_dotfiles
```

Uninstall specific dotfile

```sh
rake uninstall_pryrc
```


text:
namespace bbzy {
    namespace type {
        namespace detail {
            template<class T>
            struct IsLowerConst {
            private:
                template<class HelperT>
                struct Helper {
                    enum {
                        value = std::is_const<HelperT>::value
                    };
                };

                template<class HelperT>
                struct Helper<HelperT &> {
                    enum {
                        value = Helper<HelperT>::value
                    };
                };

                template<class HelperT>
                struct Helper<HelperT &&> {
                    enum {
                        value = Helper<HelperT>::value
                    };
                };

                template<class HelperT>
                struct Helper<HelperT *> {
                    enum {
                        value = Helper<HelperT>::value
                    };
                };

                template<class HelperT>
                struct Helper<HelperT *const> {
                    enum {
                        value = Helper<HelperT>::value
                    };
                };

            public:
                enum {
                    value = std::is_pointer<T>::value || std::is_reference<T>::value ? Helper<T>::value : 0
                };
            };

            template<class T>
            struct AddLowerConst {
            private:
                template<class HelperT>
                struct Helper {
                    using type = AddConst<HelperT>;
                };

                template<class HelperT>
                struct Helper<HelperT &> {
                    using type = typename Helper<HelperT>::type &;
                };

                template<class HelperT>
                struct Helper<HelperT &&> {
                    using type = typename Helper<HelperT>::type &&;
                };

                template<class HelperT>
                struct Helper<HelperT *> {
                    using type = typename Helper<HelperT>::type *;
                };

                template<class HelperT>
                struct Helper<HelperT *const> {
                    using type = typename Helper<HelperT>::type *const;
                };

            public:
                using type = Conditional<std::is_pointer<T>::value || std::is_reference<T>::value,
                        typename Helper<T>::type, T>;
            };

            template<class T>
            struct RemoveLowerConst {
            private:
                template<class HelperT>
                struct Helper {
                    using type = RemoveConst<HelperT>;
                };

                template<class HelperT>
                struct Helper<HelperT &> {
                    using type = typename Helper<HelperT>::type &;
                };

                template<class HelperT>
                struct Helper<HelperT &&> {
                    using type = typename Helper<HelperT>::type &&;
                };

                template<class HelperT>
                struct Helper<HelperT *> {
                    using type = typename Helper<HelperT>::type *;
                };

                template<class HelperT>
                struct Helper<HelperT *const> {
                    using type = typename Helper<HelperT>::type *const;
                };

            public:
                using type = Conditional<std::is_pointer<T>::value || std::is_reference<T>::value,
                        typename Helper<T>::type, T>;
            };

            template<class TargetT, class SourceT>
            struct CopyLowerConst {
                using type = Conditional<IsLowerConst<SourceT>::value, typename AddLowerConst<TargetT>::type, TargetT>;
            };

        }

        using detail::IsLowerConst;

        template<class T>
        using IsLC = IsLowerConst<T>;

        template<class T>
        using AddLowerConst = typename detail::AddLowerConst<T>::type;

        template<class T>
        using AddLC = AddLowerConst<T>;

        template<class T>
        using RemoveLowerConst = typename detail::RemoveLowerConst<T>::type;

        template<class T>
        using RmLC = RemoveLowerConst<T>;

        template<class TargetT, class SourceT>
        using CopyLowerConst = typename detail::CopyLowerConst<TargetT, SourceT>::type;

        template<class TargetT, class SourceT>
        using CpLC = CopyLowerConst<TargetT, SourceT>;

    }
}


text:
// +build linux

// Package contains code from OCI/opencontainers (https://github.com/opencontainers/runc) with following:
// - function getCFQStats
// - function getStats
// - function splitBlkioStatLine
// - function getBlkioStat

package cgroupfs

import (
	"bufio"
	"fmt"
	"os"
	"path/filepath"
	"strconv"
	"strings"

	"github.com/intelsdi-x/snap-plugin-collector-docker/container"
)

// Blkio implements StatGetter interface
type Blkio struct{}

// GetStats reads blkio metrics from Blkio Group from blkio.*
func (b *Blkio) GetStats(stats *container.Statistics, opts container.GetStatOpt) error {
	path, err := opts.GetStringValue("cgroup_path")
	if err != nil {
		return err
	}
	// Try to read CFQ stats available on all CFQ enabled kernels first
	if blkioStats, err := getBlkioStat(filepath.Join(path, "blkio.io_serviced_recursive")); err == nil && blkioStats != nil {
		return getCFQStats(path, stats)
	}
	return getStats(path, stats) // Use generic stats as fallback
}

func splitBlkioStatLine(r rune) bool {
	return r == ' ' || r == ':'
}

func getBlkioStat(path string) ([]container.BlkioStatEntry, error) {
	var blkioStats []container.BlkioStatEntry
	f, err := os.Open(path)
	if err != nil {
		if os.IsNotExist(err) {
			return blkioStats, nil
		}
		return nil, err
	}
	defer f.Close()

	sc := bufio.NewScanner(f)
	for sc.Scan() {
		// format: dev type amount
		fields := strings.FieldsFunc(sc.Text(), splitBlkioStatLine)
		if len(fields) < 3 {
			if len(fields) == 2 && fields[0] == "Total" {
				// skip total line
				continue
			} else {
				return nil, fmt.Errorf("Invalid line found while parsing %s: %s", path, sc.Text())
			}
		}

		major, err := strconv.ParseUint(fields[0], 10, 64)
		if err != nil {
			return nil, err
		}

		minor, err := strconv.ParseUint(fields[1], 10, 64)
		if err != nil {
			return nil, err
		}

		op := ""
		index := 2
		if len(fields) == 4 {
			op = fields[2]
			index = 3
		}
		val, err := strconv.ParseUint(fields[index], 10, 64)
		if err != nil {
			return nil, err
		}
		blkioStats = append(blkioStats, container.BlkioStatEntry{Major: major, Minor: minor, Op: op, Value: val})
	}

	return blkioStats, nil
}

func getCFQStats(path string, stats *container.Statistics) error {
	var blkioStats []container.BlkioStatEntry
	var err error

	if blkioStats, err = getBlkioStat(filepath.Join(path, "blkio.sectors_recursive")); err != nil {
		return err
	}
	stats.Cgroups.BlkioStats.SectorsRecursive = blkioStats

	if blkioStats, err = getBlkioStat(filepath.Join(path, "blkio.io_service_bytes_recursive")); err != nil {
		return err
	}
	stats.Cgroups.BlkioStats.IoServiceBytesRecursive = blkioStats

	if blkioStats, err = getBlkioStat(filepath.Join(path, "blkio.io_serviced_recursive")); err != nil {
		return err
	}
	stats.Cgroups.BlkioStats.IoServicedRecursive = blkioStats

	if blkioStats, err = getBlkioStat(filepath.Join(path, "blkio.io_queued_recursive")); err != nil {
		return err
	}
	stats.Cgroups.BlkioStats.IoQueuedRecursive = blkioStats

	if blkioStats, err = getBlkioStat(filepath.Join(path, "blkio.io_service_time_recursive")); err != nil {
		return err
	}
	stats.Cgroups.BlkioStats.IoServiceTimeRecursive = blkioStats

	if blkioStats, err = getBlkioStat(filepath.Join(path, "blkio.io_wait_time_recursive")); err != nil {
		return err
	}
	stats.Cgroups.BlkioStats.IoWaitTimeRecursive = blkioStats

	if blkioStats, err = getBlkioStat(filepath.Join(path, "blkio.io_merged_recursive")); err != nil {
		return err
	}
	stats.Cgroups.BlkioStats.IoMergedRecursive = blkioStats

	if blkioStats, err = getBlkioStat(filepath.Join(path, "blkio.time_recursive")); err != nil {
		return err
	}
	stats.Cgroups.BlkioStats.IoTimeRecursive = blkioStats

	return nil
}

func getStats(path string, stats *container.Statistics) error {
	var blkioStats []container.BlkioStatEntry
	var err error

	if blkioStats, err = getBlkioStat(filepath.Join(path, "blkio.throttle.io_service_bytes")); err != nil {
		return err
	}
	stats.Cgroups.BlkioStats.IoServiceBytesRecursive = blkioStats

	if blkioStats, err = getBlkioStat(filepath.Join(path, "blkio.throttle.io_serviced")); err != nil {
		return err
	}
	stats.Cgroups.BlkioStats.IoServicedRecursive = blkioStats

	return nil
}