text:
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
// Copyright (C) 2014 Gael Guennebaud <gael.guennebaud@inria.fr>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

static bool g_called;
#define EIGEN_SCALAR_BINARY_OP_PLUGIN { g_called |= (!internal::is_same<LhsScalar,RhsScalar>::value); }

#include "main.h"

template<typename MatrixType> void linearStructure(const MatrixType& m)
{
  using std::abs;
  /* this test covers the following files:
     CwiseUnaryOp.h, CwiseBinaryOp.h, SelfCwiseBinaryOp.h
  */
  typedef typename MatrixType::Scalar Scalar;
  typedef typename MatrixType::RealScalar RealScalar;

  Index rows = m.rows();
  Index cols = m.cols();

  // this test relies a lot on Random.h, and there's not much more that we can do
  // to test it, hence I consider that we will have tested Random.h
  MatrixType m1 = MatrixType::Random(rows, cols),
             m2 = MatrixType::Random(rows, cols),
             m3(rows, cols);

  Scalar s1 = internal::random<Scalar>();
  while (abs(s1)<RealScalar(1e-3)) s1 = internal::random<Scalar>();

  Index r = internal::random<Index>(0, rows-1),
        c = internal::random<Index>(0, cols-1);

  VERIFY_IS_APPROX(-(-m1),                  m1);
  VERIFY_IS_APPROX(m1+m1,                   2*m1);
  VERIFY_IS_APPROX(m1+m2-m1,                m2);
  VERIFY_IS_APPROX(-m2+m1+m2,               m1);
  VERIFY_IS_APPROX(m1*s1,                   s1*m1);
  VERIFY_IS_APPROX((m1+m2)*s1,              s1*m1+s1*m2);
  VERIFY_IS_APPROX((-m1+m2)*s1,             -s1*m1+s1*m2);
  m3 = m2; m3 += m1;
  VERIFY_IS_APPROX(m3,                      m1+m2);
  m3 = m2; m3 -= m1;
  VERIFY_IS_APPROX(m3,                      m2-m1);
  m3 = m2; m3 *= s1;
  VERIFY_IS_APPROX(m3,                      s1*m2);
  if(!NumTraits<Scalar>::IsInteger)
  {
    m3 = m2; m3 /= s1;
    VERIFY_IS_APPROX(m3,                    m2/s1);
  }

  // again, test operator() to check const-qualification
  VERIFY_IS_APPROX((-m1)(r,c), -(m1(r,c)));
  VERIFY_IS_APPROX((m1-m2)(r,c), (m1(r,c))-(m2(r,c)));
  VERIFY_IS_APPROX((m1+m2)(r,c), (m1(r,c))+(m2(r,c)));
  VERIFY_IS_APPROX((s1*m1)(r,c), s1*(m1(r,c)));
  VERIFY_IS_APPROX((m1*s1)(r,c), (m1(r,c))*s1);
  if(!NumTraits<Scalar>::IsInteger)
    VERIFY_IS_APPROX((m1/s1)(r,c), (m1(r,c))/s1);

  // use .block to disable vectorization and compare to the vectorized version
  VERIFY_IS_APPROX(m1+m1.block(0,0,rows,cols), m1+m1);
  VERIFY_IS_APPROX(m1.cwiseProduct(m1.block(0,0,rows,cols)), m1.cwiseProduct(m1));
  VERIFY_IS_APPROX(m1 - m1.block(0,0,rows,cols), m1 - m1);
  VERIFY_IS_APPROX(m1.block(0,0,rows,cols) * s1, m1 * s1);
}

// Make sure that complex * real and real * complex are properly optimized
template<typename MatrixType> void real_complex(DenseIndex rows = MatrixType::RowsAtCompileTime, DenseIndex cols = MatrixType::ColsAtCompileTime)
{
  typedef typename MatrixType::Scalar Scalar;
  typedef typename MatrixType::RealScalar RealScalar;

  RealScalar s = internal::random<RealScalar>();
  MatrixType m1 = MatrixType::Random(rows, cols);

  g_called = false;
  VERIFY_IS_APPROX(s*m1, Scalar(s)*m1);
  VERIFY(g_called && "real * matrix<complex> not properly optimized");

  g_called = false;
  VERIFY_IS_APPROX(m1*s, m1*Scalar(s));
  VERIFY(g_called && "matrix<complex> * real not properly optimized");

  g_called = false;
  VERIFY_IS_APPROX(m1/s, m1/Scalar(s));
  VERIFY(g_called && "matrix<complex> / real not properly optimized");

  g_called = false;
  VERIFY_IS_APPROX(s+m1.array(), Scalar(s)+m1.array());
  VERIFY(g_called && "real + matrix<complex> not properly optimized");

  g_called = false;
  VERIFY_IS_APPROX(m1.array()+s, m1.array()+Scalar(s));
  VERIFY(g_called && "matrix<complex> + real not properly optimized");

  g_called = false;
  VERIFY_IS_APPROX(s-m1.array(), Scalar(s)-m1.array());
  VERIFY(g_called && "real - matrix<complex> not properly optimized");

  g_called = false;
  VERIFY_IS_APPROX(m1.array()-s, m1.array()-Scalar(s));
  VERIFY(g_called && "matrix<complex> - real not properly optimized");
}

void test_linearstructure()
{
  g_called = true;
  VERIFY(g_called); // avoid `unneeded-internal-declaration` warning.
  for(int i = 0; i < g_repeat; i++) {
    CALL_SUBTEST_1( linearStructure(Matrix<float, 1, 1>()) );
    CALL_SUBTEST_2( linearStructure(Matrix2f()) );
    CALL_SUBTEST_3( linearStructure(Vector3d()) );
    CALL_SUBTEST_4( linearStructure(Matrix4d()) );
    CALL_SUBTEST_5( linearStructure(MatrixXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2), internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2))) );
    CALL_SUBTEST_6( linearStructure(MatrixXf (internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
    CALL_SUBTEST_7( linearStructure(MatrixXi (internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
    CALL_SUBTEST_8( linearStructure(MatrixXcd(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2), internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2))) );
    CALL_SUBTEST_9( linearStructure(ArrayXXf (internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
    CALL_SUBTEST_10( linearStructure(ArrayXXcf (internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );

    CALL_SUBTEST_11( real_complex<Matrix4cd>() );
    CALL_SUBTEST_11( real_complex<MatrixXcf>(10,10) );
    CALL_SUBTEST_11( real_complex<ArrayXXcf>(10,10) );
  }

#ifdef EIGEN_TEST_PART_4
  {
    // make sure that /=scalar and /scalar do not overflow
    // rational: 1.0/4.94e-320 overflow, but m/4.94e-320 should not
    Matrix4d m2, m3;
    m3 = m2 =  Matrix4d::Random()*1e-20;
    m2 = m2 / 4.9e-320;
    VERIFY_IS_APPROX(m2.cwiseQuotient(m2), Matrix4d::Ones());
    m3 /= 4.9e-320;
    VERIFY_IS_APPROX(m3.cwiseQuotient(m3), Matrix4d::Ones());

  }
#endif
}


text:
<?php

if (!defined('ADMIN_PAGES')) { exit; }
if (!can_admin('headlines')) { die('Access Denied'); }
$pagetitle .= ' '._BC_DELIM.' '._HEADLINESADMIN;

if (isset($_POST['save'])) {
	$xsitename = str_replace(' ', '', Fix_Quotes($_POST['xsitename']));
	$headlinesurl = Fix_Quotes($_POST['headlinesurl']);
	$db->sql_query('UPDATE '.$prefix."_headlines SET sitename='$xsitename', headlinesurl='$headlinesurl' where hid=".intval($_POST['save']));
	url_redirect(adminlink());
} else if (isset($_POST['addHeadline'])) {
	$xsitename = str_replace(' ', '', Fix_Quotes($_POST['xsitename']));
	$headlinesurl = Fix_Quotes($_POST['headlinesurl']);
	$db->sql_query('INSERT INTO '.$prefix."_headlines (hid, sitename, headlinesurl) VALUES (DEFAULT, '$xsitename', '$headlinesurl')");
	url_redirect(adminlink());
} elseif (isset($_GET['edit'])) {
	$hid = intval($_GET['edit']);
	$pagetitle .= ' '._BC_DELIM.' '._EDITHEADLINE;
	require_once('header.php');
	GraphicAdmin('_AMENU6');
	list($xsitename, $headlinesurl) = $db->sql_ufetchrow("SELECT sitename, headlinesurl FROM ".$prefix."_headlines WHERE hid='$hid'",SQL_NUM);
	OpenTable();
	echo ''._HEADLINESADMIN.'

	'.open_form(adminlink(), false, _EDITHEADLINE).'
	'._SITENAME.'
	 <input type="text" name="xsitename" size="50" maxlength="30" value="'.htmlprepare($xsitename).'" />

	'._RSSFILE.'
	 <input type="text" name="headlinesurl" size="50" maxlength="200" value="'.$headlinesurl.'" />

	<input type="hidden" name="save" value="'.$hid.'" />
	<input type="submit" value="'._SAVECHANGES.'" />
	'.close_form();
	CloseTable();
} else if (isset($_GET['del'])) {
	if (isset($_POST['cancel'])) { url_redirect(adminlink()); }
	if (isset($_POST['confirm'])) {
		$db->sql_query('DELETE FROM '.$prefix."_headlines WHERE hid='".intval($_GET['del'])."'");
		url_redirect(adminlink());
	}
	cpg_delete_msg(adminlink('&del='.intval($_GET['del'])), _SURE2DELHEADLINE);
} else {
	require_once('header.php');
	GraphicAdmin('_AMENU6');
	OpenTable();
	echo ''._HEADLINESADMIN.'

	   '._SITENAME.'
	   '._URL.'
	   '._FUNCTIONS.'

';
	$result = $db->sql_uquery("SELECT hid, sitename, headlinesurl FROM ".$prefix."_headlines ORDER BY hid");
	$bgcolor = $bgcolor3;
	while (list($hid, $sitename, $headlinesurl) = $db->sql_fetchrow($result)) {
		$bgcolor = ($bgcolor == '') ? ' bgcolor="'.$bgcolor3.'"' : '';
		echo '

	   '.$sitename.'
	   '.$headlinesurl.'
	   '._EDIT.' / '._DELETE.'

';
	 }
	 echo '

	 '.open_form(adminlink(), false, _ADDHEADLINE).'
	 '._SITENAME.'
	  <input type="text" name="xsitename" size="50" maxlength="30" />

	 '._RSSFILE.'
	  <input type="text" name="headlinesurl" size="50" maxlength="200" />

	 <input type="submit" name="addHeadline" value="'._ADDHEADLINE.'" />'.
	 close_form();
	 CloseTable();
}

redpajama_set_name: RedPajamaGithub


text:
VERSION="1.3"

rm -rf dist; mkdir -p dist
for GOOS in darwin linux windows; do
  for GOARCH in 386 amd64; do
    echo "Building $GOOS-$GOARCH"
    if [[ $GOOS == "windows" ]]; then
      env GOOS=$GOOS GOARCH=$GOARCH go build -o dist/aws-es-proxy-${VERSION}-${GOOS}-${GOARCH}.exe
    elif [[ $GOOS == "darwin" ]]; then
      env GOOS=$GOOS GOARCH=$GOARCH go build -o dist/aws-es-proxy-${VERSION}-mac-${GOARCH}
    else
      env GOOS=$GOOS GOARCH=$GOARCH go build -o dist/aws-es-proxy-${VERSION}-${GOOS}-${GOARCH}
    fi
  done
done


text:
import Sauce from './Sauce';

// ==============================
// CONCRETE SAUCE
// ==============================

export default class Pesto implements Sauce {
    public ingredients(): string {
        return "Pesto (basil, garlic, oil, grated cheese, pine nuts)";
    }
}


text:
module HealthSeven::V2_3
class Prc < ::HealthSeven::Segment
  # Primary Key Value
  attribute :primary_key_value, Ce, position: "PRC.1", require: true
  # Facility ID
  attribute :facility_ids, Array[Ei], position: "PRC.2", require: true, multiple: true
  # Department
  attribute :departments, Array[Ce], position: "PRC.3", multiple: true
  # Valid Patient Classes
  attribute :valid_patient_classes, Array[Id], position: "PRC.4", multiple: true
  # Price
  attribute :prices, Array[Cp], position: "PRC.5", multiple: true
  # Formula
  attribute :formulas, Array[St], position: "PRC.6", multiple: true
  # Minimum Quantity
  attribute :minimum_quantity, Nm, position: "PRC.7"
  # Maximum Quantity
  attribute :maximum_quantity, Nm, position: "PRC.8"
  # Minimum Price
  attribute :minimum_price, Mo, position: "PRC.9"
  # Maximum Price
  attribute :maximum_price, Mo, position: "PRC.10"
  # Effective Start Date
  attribute :effective_start_date, Ts, position: "PRC.11"
  # Effective End Date
  attribute :effective_end_date, Ts, position: "PRC.12"
  # Price Override Flag
  attribute :price_override_flag, Id, position: "PRC.13"
  # Billing Category
  attribute :billing_categories, Array[Ce], position: "PRC.14", multiple: true
  # Chargeable Flag
  attribute :chargeable_flag, Id, position: "PRC.15"
  # Active/Inactive Flag
  attribute :active_inactive_flag, Id, position: "PRC.16"
  # Cost
  attribute :cost, Mo, position: "PRC.17"
  # Charge On Indicator
  attribute :charge_on_indicator, Id, position: "PRC.18"
end
end


text:
import { Column, Component, ITooltipParams } from "@ag-grid-community/core";
export declare class ToolPanelColumnComp extends Component {
    private readonly column;
    private readonly columnDept;
    private readonly allowDragging;
    private readonly groupsExist;
    private readonly focusWrapper;
    private static TEMPLATE;
    private columnController;
    private dragAndDropService;
    private modelItemUtils;
    private eLabel;
    private cbSelect;
    private eDragHandle;
    private displayName;
    private processingColumnStateChange;
    constructor(column: Column, columnDept: number, allowDragging: boolean, groupsExist: boolean, focusWrapper: HTMLElement);
    init(): void;
    private setupTooltip;
    getTooltipParams(): ITooltipParams;
    protected handleKeyDown(e: KeyboardEvent): void;
    private onLabelClicked;
    private onCheckboxChanged;
    private onChangeCommon;
    private refreshAriaLabel;
    private setupDragging;
    private createDragItem;
    private onColumnStateChanged;
    getDisplayName(): string | null;
    onSelectAllChanged(value: boolean): void;
    isSelected(): boolean | undefined;
    isSelectable(): boolean;
    isExpandable(): boolean;
    setExpanded(value: boolean): void;
}


text:
namespace blink {

class BodyStreamBuffer;
class RequestInit;
class WebServiceWorkerRequest;

using RequestInfo = RequestOrUSVString;

class MODULES_EXPORT Request final : public Body {
    DEFINE_WRAPPERTYPEINFO();
    WTF_MAKE_NONCOPYABLE(Request);
public:
    ~Request() override {}

    // From Request.idl:
    static Request* create(ScriptState*, const RequestInfo&, const Dictionary&, ExceptionState&);

    static Request* create(ScriptState*, const String&, ExceptionState&);
    static Request* create(ScriptState*, const String&, const Dictionary&, ExceptionState&);
    static Request* create(ScriptState*, Request*, ExceptionState&);
    static Request* create(ScriptState*, Request*, const Dictionary&, ExceptionState&);
    static Request* create(ExecutionContext*, FetchRequestData*);
    static Request* create(ExecutionContext*, const WebServiceWorkerRequest&);

    // From Request.idl:
    String method() const;
    KURL url() const;
    Headers* headers() const { return m_headers; }
    String context() const;
    String referrer() const;
    String mode() const;
    String credentials() const;
    String redirect() const;

    // From Request.idl:
    Request* clone(ExceptionState&);

    FetchRequestData* passRequestData();
    void populateWebServiceWorkerRequest(WebServiceWorkerRequest&) const;
    bool hasBody() const;
    BodyStreamBuffer* bodyBuffer() override { return m_request->buffer(); }
    const BodyStreamBuffer* bodyBuffer() const override { return m_request->buffer(); }

    DECLARE_VIRTUAL_TRACE();

private:
    Request(ExecutionContext*, FetchRequestData*);
    Request(ExecutionContext*, const WebServiceWorkerRequest&);
    Request(ExecutionContext*, FetchRequestData*, Headers*);

    const FetchRequestData* request() const { return m_request; }
    static Request* createRequestWithRequestOrString(ScriptState*, Request*, const String&, const RequestInit&, ExceptionState&);

    String mimeType() const override;

    const Member<FetchRequestData> m_request;
    const Member<Headers> m_headers;
};

} // namespace blink

#endif // Request_h


text:
$('#TipoDeRegistroDatos').change(function(){
    var selectedOption = $(this).find('option:selected');

    if(selectedOption.val().localeCompare("Articulo publicado") == 0)
        $("#revista").removeClass("hidden");
    else
    {
        $("#revista").addClass("hidden");
        table4.clear().draw();
        $("#EmpresaDatos").val("");
        $("#InstitucionDatos").val("");
    }

    if(selectedOption.val().localeCompare("Tutoria de pasantias") == 0)
        $("#divEmpresaDatos").removeClass("hidden");
    else
    {
        $("#divEmpresaDatos").addClass("hidden");
        table4.clear().draw();
        $("#EmpresaDatos").val("");
        $("#InstitucionDatos").val("");
    }

    if(selectedOption.val().localeCompare("Tutoria de servicio comunitario") == 0)
        $("#divInstitucionDatos").removeClass("hidden");
    else
    {
        $("#divInstitucionDatos").addClass("hidden");
        table4.clear().draw();
        $("#EmpresaDatos").val("");
        $("#InstitucionDatos").val("");
    }
});


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

namespace TestMethodGen
{
    class Program
    {
        enum ReplaceType
        {
            test,
            exception,
        }

        static void Main( string[] args )
        {
            if(args.Length < 2)
            {
                Usage();
                return;
            }

            try
            {
                ReplaceType type;

                if(Enum.TryParse(args[0].ToLower(), out type))
                {
                    string dir = args[1];

                    if(File.Exists( dir ))
                    {
                        switch(type)
                        {
                            case ReplaceType.test:
                                ParseTestFile( dir );
                                break;

                            case ReplaceType.exception:
                                ParseExceptionFile( dir );
                                break;
                        }

                    }
                    else
                    {
                        ParseDirectory( type, dir );
                    }
                }
                else
                {
                    Console.WriteLine( "Error: Invalid type");
                    Usage();
                }
            }
            catch(Exception e)
            {
                Console.WriteLine( e.Message );
                Usage();
            }
        }

        static void ParseDirectory( ReplaceType type, string dir )
        {
            foreach(string file in Directory.GetFiles( dir, "*.cs" ))
            {
                switch(type)
                {
                    case ReplaceType.test:
                        ParseTestFile( file );
                        break;

                    case ReplaceType.exception:
                        ParseExceptionFile( file );
                        break;
                }
            }

            foreach(string subdir in Directory.GetDirectories( dir ))
            {
                if(subdir != "." && subdir != "..")
                {
                    ParseDirectory( type, subdir );
                }
            }
        }

        static void ParseExceptionFile( string file )
        {
            string fileTmp = Path.Combine( Path.GetDirectoryName( file ), Path.GetFileNameWithoutExtension( file ) );
            string ext = Path.GetExtension( file );
            int i = 0;
            Regex exp = new Regex( @"\bthrow\s+new\s+(\w*Exception)\s*\((.*)\)" );
            Regex expIfDef = new Regex( "#if EXCEPTION_STRINGS" );
            Regex expEndif = new Regex( "#endif" );
            Regex expTabs  = new Regex( @"\A(\s+)" );
            Regex expComment = new Regex( @"\A\s*\/\/" );
            Regex expIf = new Regex( @"\A\s*if\s*\(" );
            List<string> tests = new List<string>();
            bool exceptionFound = false;
            bool exceptInitFoundState = false;

            while(File.Exists( fileTmp + i.ToString( "X" ) + ext ))
            {
                i++;
            }

            fileTmp += i.ToString( "X" ) + ext;

            using(TextWriter tw = File.CreateText( fileTmp ))
            using(TextReader tr = File.OpenText( file ))
            {
                while(tr.Peek() != -1)
                {
                    string line = tr.ReadLine();

                    if(exceptInitFoundState)
                    {
                        if(expEndif.IsMatch( line ))
                        {
                            exceptInitFoundState = false;
                        }

                        tw.WriteLine( line );
                    }
                    else if(expIfDef.IsMatch( line ))
                    {
                        exceptInitFoundState = true;

                        tw.WriteLine( line );
                    }
                    else if(!expComment.IsMatch( line ))
                    {
                        Match m = exp.Match( line );

                        if(m.Success && m.Groups[2].Value.Trim().Length > 0)
                        {
                            exceptionFound = true;

                            string exception = m.Groups[1].Value;

                            string tab = "";
                            string indent = "";
                            string epilog = null;
                            // find indent
                            Match mTab = expTabs.Match( line );

                            if(mTab.Success)
                            {
                                tab = mTab.Groups[1].Value;
                            }

                            if(mTab.Index + mTab.Length != m.Index)
                            {
                                tw.WriteLine( line.Substring( 0, m.Index ) );

                                if(expIf.IsMatch( line ))
                                {
                                    indent = "    ";
                                }

                                line = tab + indent + line.Substring( m.Index );
                            }

                            tw.WriteLine( "#if EXCEPTION_STRINGS" );

                            int idxSemi = line.IndexOf( ';' );
                            if(idxSemi == -1)
                            {
                                tw.WriteLine( line );

                                do
                                {
                                    line = tr.ReadLine();
                                    tw.WriteLine( line );
                                } while(line.IndexOf( ';' ) == -1);
                            }
                            else
                            {
                                epilog = line.Substring( idxSemi + 1 ).Trim();
                                tw.WriteLine( line.Substring(0, idxSemi + 1) );
                            }

                            tw.WriteLine( "#else" );
                            if(exception == "ObjectDisposedException")
                            {
                                tw.WriteLine( tab + indent + "throw new " + exception + "( null );" );
                            }
                            else
                            {
                                tw.WriteLine( tab + indent + "throw new " + exception + "();" );
                            }
                            tw.WriteLine( "#endif" );

                            if(!string.IsNullOrEmpty( epilog ))
                            {
                                tw.WriteLine( tab + epilog );
                            }
                        }
                        else
                        {
                            tw.WriteLine( line );
                        }
                    }
                    else
                    {
                        tw.WriteLine( line );
                    }
                }
            }

            if(exceptionFound)
            {
                Console.WriteLine("Modified file: " + file);
                File.Copy( fileTmp, file, true );
            }
            File.Delete( fileTmp );
        }

        static void ParseTestFile( string file )
        {
            string fileTmp = Path.Combine(Path.GetDirectoryName(file), Path.GetFileNameWithoutExtension(file));
            string ext = Path.GetExtension(file);
            int i=0;
            Regex exp = new Regex( @"\s*public\s+MFTestResults\s+([\w+\d+_]+)\(\)" );
            Regex expOpenBrace = new Regex( "{" );
            Regex expCloseBrace = new Regex( "}" );
            Regex expAlreadyParsed = new Regex( @"\s*public\s+MFTestMethod\[\]\s+Tests" );
            Regex expTestStart = new Regex( @"\s*return\s+new\s+MFTestMethod\[\]" );
            List<string> tests = new List<string>();
            int braceCnt = 0;
            bool testsFound = false;
            int testInitFoundState = 0;
            int testInitBraceCount = 0;
            int max = 0;

            while(File.Exists(fileTmp + i.ToString("X") + ext))
            {
                i++;
            }

            fileTmp += i.ToString("X") + ext;

            using(TextWriter tw = File.CreateText( fileTmp ))
            using(TextReader tr = File.OpenText( file ))
            {
                while(tr.Peek() != -1)
                {
                    string line = tr.ReadLine();

                    if(testInitFoundState > 0)
                    {
                        if(testInitFoundState == 1)
                        {
                            if(expTestStart.IsMatch( line ))
                            {
                                testInitFoundState++;
                            }
                            else if(expOpenBrace.IsMatch( line ))
                            {
                                testInitBraceCount++;
                            }
                            continue;
                        }
                        else
                        {
                            string test = line.Trim().TrimEnd( ',' );

                            if(expCloseBrace.IsMatch( test ))
                            {
                                testInitBraceCount--;
                            }
                            else if(expOpenBrace.IsMatch( test ))
                            {
                                testInitBraceCount++;
                            }
                            else if(!string.IsNullOrEmpty( test ))
                            {
                                Regex expMFTest = new Regex( @"\s*new\s+MFTestMethod\s*\(\s*([\w+\d+_]+)," );

                                Match m2 = expMFTest.Match( test );
                                if(m2.Success)
                                {
                                    test = m2.Groups[1].Value;
                                }

                                if(!tests.Contains( test ))
                                {
                                    tests.Add( test );
                                }
                            }

                            if(testInitBraceCount <= 0)
                            {
                                testInitFoundState = 0;
                            }
                        }
                        // make sure we don't re-write old tests
                        continue;
                    }
                    else if(expAlreadyParsed.IsMatch( line ))
                    {
                        testInitFoundState = 1;
                        continue;
                    }

                    MatchCollection ms = expOpenBrace.Matches( line );

                    braceCnt += ms.Count;

                    if(max < braceCnt) max = braceCnt;

                    ms = expCloseBrace.Matches( line );

                    braceCnt -= ms.Count;

                    Match m = exp.Match( line );

                    if(m.Success)
                    {
                        string test = m.Groups[1].Value;

                        if(m.Groups.Count > 1 && !tests.Contains(test))
                        {
                            tests.Add( test );
                        }
                    }

                    if(braceCnt == 1 && max > 1 && tests.Count > 0)
                    {
                        tw.Write(
    @"
        public MFTestMethod[] Tests
        {
            get
            {
                return new MFTestMethod[]
                {
" );
                        foreach(string tst in tests)
                        {
                            tw.WriteLine( "                    new MFTestMethod( " + tst + ", " + "\"" + tst + "\" ),"  );
                        }
                        testsFound = true;
                        tests.Clear();
                        max = 0;
                        tw.Write(
    @"                };
             }
        }
" );
                    }

                    tw.WriteLine( line );
                }
            }

            if(testsFound)
            {
                File.Copy( fileTmp, file, true );
            }
            File.Delete( fileTmp );
        }

        static void Usage()
        {
            Console.WriteLine( "Usage: TestMethodGen [test|exceptions] <test path>" );
        }
    }
}


text:
=head1 LICENSE

Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2017] EMBL-European Bioinformatics Institute

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=cut

package EnsEMBL::REST::Controller::ga4gh::annotationSets;

use Moose;
use namespace::autoclean;
use Try::Tiny;
use Data::Dumper;
use Time::HiRes qw(gettimeofday);

use Bio::EnsEMBL::Variation::Utils::VEP qw/get_version_data/;
require EnsEMBL::REST;
EnsEMBL::REST->turn_on_config_serialisers(__PACKAGE__);

=pod

POST requests : /ga4gh/variantannotationsets/search -d

GET requests: /ga4gh/variantannotationsets/ensembl79

=cut

BEGIN {extends 'Catalyst::Controller::REST'; }

sub searchAnnotationSets_POST {
  my ( $self, $c ) = @_;

  my $post_data = $c->req->data;

  ## A variantSet id is required
  $c->go( 'ReturnError', 'custom', [ ' Cannot find a "variantSetId" key in your request' ] )
    unless exists $post_data->{variantSetId};

  my $annotationSet;

  try {
    $annotationSet = $c->model('ga4gh::annotationSets')->fetch_annotationSet( $post_data );
  } catch {
    $c->go('ReturnError', 'from_ensembl', [$_]);
  };

  $self->status_ok($c, entity => $annotationSet);

}

sub searchAnnotationSets: Chained('/') PathPart('ga4gh/variantannotationsets/search') ActionClass('REST')  {}

## get method
sub id: Chained('/') PathPart('ga4gh/variantannotationsets') ActionClass('REST') {}

sub id_GET {
  my ($self, $c, $id) = @_;
  my $annotationSet;
  try {
    $annotationSet = $c->model('ga4gh::annotationsets')->getAnnotationSet($id);
  } catch {
    $c->go('ReturnError', 'from_ensembl', [qq{$_}]) if $_ =~ /STACK/;
    $c->go('ReturnError', 'custom', [qq{$_}]);
  };
  $self->status_ok($c, entity => $annotationSet);
}

__PACKAGE__->meta->make_immutable;

1;


text:
//
//  UIScrollView+Reload.h
//  SSPullRefreshDemo
//
//  Created by Quincy Yan on 2017/1/3.
//  Copyright © 2017年 SSKit. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "SSReloadView.h"
#import "SSReloadBaseView.h"
#import "SSStarReloadView.h"

@interface UIScrollView (Reload)

@property (nonatomic,strong) SSReloadBaseView *reloadView;

/**
 添加默认的刷新控件
 */
- (void)sspr_insertReloadViewAttachCallback:(SSRefreshingBlock)callback;

/**
 添加自定义的刷新控件
 view需指定size
 */
- (void)sspr_insertReloadViewAttachView:(SSReloadBaseView *)view withCallback:(SSRefreshingBlock)callback;
- (void)sspr_insertReloadViewAttachViewStyle:(SSRefreshReloadStyle)style withCallback:(SSRefreshingBlock)callback;
- (void)sspr_insertReloadViewAttachViewStyle:(SSRefreshReloadStyle)style withHeight:(CGFloat)height withCallback:(SSRefreshingBlock)callback;
- (void)sspr_insertReloadViewAttachViewClass:(Class)aClass withCallback:(SSRefreshingBlock)callback;
- (void)sspr_insertReloadViewAttachViewClass:(Class)aClass withHeight:(CGFloat)height withCallback:(SSRefreshingBlock)callback;

- (void)sspr_removeReloadView;

@end


text:
package com.google.common.io;

public interface LineProcessor<T>
{
  // Methods

  public T getResult();
  public boolean processLine(java.lang.String arg1) throws java.io.IOException;
}


text: module.exports = require('./dist/ko-typed.applied.node.js');


text:
/*
 * Test routines to make sure a variety of system calls are or are not
 * available in capability mode.  The goal is not to see if they work, just
 * whether or not they return the expected ECAPMODE.
 */

#include <sys/cdefs.h>
__FBSDID("$FreeBSD: soc2013/dpl/head/tools/regression/security/cap_test/cap_test_pdfork.c 225250 2011-08-18 23:15:04Z jonathan $");

#include <sys/types.h>

#include <sys/capability.h>
#include <sys/errno.h>
#include <sys/procdesc.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/wait.h>

#include <err.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#include <stdio.h>
#include <time.h>

#include "cap_test.h"

int
test_pdfork(void)
{
	struct stat stat;
	int success = PASSED;
	int pd, error;
	pid_t pid;
	time_t now;

	//cap_enter();

	pid = pdfork(&pd, 0);
	if (pid < 0)
		err(-1, "pdfork");

	else if (pid == 0) {
		/*
		 * Child process.
		 *
		 * pd should not be a valid process descriptor.
		 */
		error = pdgetpid(pd, &pid);
		if (error != -1)
			FAILX("pdgetpid succeeded");
		else if (errno != EBADF)
			FAIL("pdgetpid failed, but errno != EBADF");

		exit(success);
	}

	/* Parent process. Ensure that [acm]times have been set correctly. */
	REQUIRE(fstat(pd, &stat));

	now = time(NULL);
	CHECK(now != (time_t)-1);

	CHECK(now >= stat.st_birthtime);
	CHECK((now - stat.st_birthtime) < 2);
	CHECK(stat.st_birthtime == stat.st_atime);
	CHECK(stat.st_atime == stat.st_ctime);
	CHECK(stat.st_ctime == stat.st_mtime);

	/* Wait for the child to finish. */
	error = pdgetpid(pd, &pid);
	CHECK(error == 0);
	CHECK(pid > 0);

	int status;
	while (waitpid(pid, &status, 0) != pid) {}
	if ((success == PASSED) && WIFEXITED(status))
		success = WEXITSTATUS(status);
	else
		success = FAILED;

	return (success);
}


text:
module Dirigible
  module Request
    def get(path, options = {}, headers = {})
      request(:get, path, options, headers)
    end

    def post(path, options = {}, headers = {})
      request(:post, path, options, headers)
    end

    def put(path, options = {}, headers = {})
      request(:put, path, options, headers)
    end

    def delete(path, options = {}, headers = {})
      request(:delete, path, options, headers)
    end

    private
    # Perform an HTTP request.
    def request(method, path, options, headers)
      headers.merge!({
        'User-Agent' => user_agent,
        'Accept' => 'application/vnd.urbanairship+json; version=3;',
      })

      response = connection.send(method) do |request|
        request.url("#{endpoint}#{path}/")

        if [:post, :put].member?(method)
          request.body = options.to_json
        else
          request.params.merge!(options)
        end

        request.headers.merge!(headers)
      end

      Utils.handle_api_error(response) unless (200..399).include?(response.status)

      Utils.parse_message(response)
    end
  end
end


text:
package org.nutz.castor.castor;

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

import org.nutz.castor.Castor;
import org.nutz.castor.FailToCastObjectException;

import static java.lang.String.*;

@SuppressWarnings({"rawtypes"})
public class String2Class extends Castor<String, Class> {

    public String2Class() {
        fromClass = String.class;
        toClass = Class.class;
    }

    public static final Map<String, Class<?>> map = new HashMap<String, Class<?>>();
    static {
        map.put("long", long.class);
        map.put("int", int.class);
        map.put("short", short.class);
        map.put("byte", byte.class);
        map.put("float", float.class);
        map.put("double", double.class);
        map.put("char", char.class);
        map.put("boolean", boolean.class);
    }

    @Override
    public Class<?> cast(String src, Class toType, String... args) {
        if (null == src)
            return null;
        Class<?> c = map.get(src);
        if (null != c)
            return c;
        try {
            return Class.forName(src);
        }
        catch (ClassNotFoundException e) {
            throw new FailToCastObjectException(format("String '%s' can not cast to Class<?>!", src));
        }
    }

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Bot. Notiser 106 (1867)

#### Original name
Raphiospora fusispora Hepp ex Körb.

### Remarks
null