text:
/////////////////////////////////////////////////////////////////////////////
/// TestHarmonicDihedralConstraintTerm.cpp
///
/// Implementation of TestHarmonicDihedralConstraintTerm class
///
///
/// \copyright Copyright 2010-2014 BARCELONA SUPERCOMPUTING CENTER. See the COPYRIGHT file at the top-level directory of this distribution.
///
/// \author arincon
/// \author vgil
/// \date 20/09/2012
/////////////////////////////////////////////////////////////////////////////

#include "TestHarmonicDihedralConstraintTerm.h"

#include "../HarmonicDihedralConstraintTerm.h"
#include "../../../../../Tools/Assertion.h"
#include "../../../../../System/System.h"
#include "../../../../../Molecules/ComplexBuilder.h"
#include "../../../../../Molecules/Complex.h"
#include "../../../../../Minimizers/Parameters/TNParams.h"
#include "../../../../../Minimizers/MinimizerBuilder.h"
#include "../../../../../Minimizers/Minimizer.h"
#include "../../../../EnergyCalculatorBuilder.h"
#include "../../../../EnergyCalculator.h"
#include "../../../../../Molecules/Selection/SelectionBuilder.h"
#include "../../../../../Molecules/Selection/Selector.h"
#include "../../../ConstrainedTerms.h"
#include "../../../../../Tools/Math/Point.h"
#include "../../../../Tests/ToolsForEnergyTests.h"
#include "../../../../../Tools/Math/MathTools.h"
#include "../../../../../Minimizers/TruncatedNewton/TruncatedNewton.h"
#include "../../../../../Inout/Structures/PDBWriter.h"
#include "../../../../../Molecules/Templates/ImpactTemplateReader.h"
#include "../../../../../Energy/ForceField/ForceFieldBuilder.h"
#include "../../../../../Energy/ForceField/ForceField.h"
#include "../../../../../Molecules/Solvent/SolventGenerator.h"
#include "../../../../../Molecules/Solvent/Solvent.h"
#include "../../../../../Molecules/AtomNames.h"

using namespace std;

/**
 * This test uses the structure created ex profeso called test_dihedral.pdb
 * which defines a residue like this:
 *
 *  OH
 *  |
 *  |
 *  |
 *  |
 *  C-------------CZ
 *                |
 *                |
 *                |
 *                |
 *                |
 *                O
 *
 * The names of the atom have been chosen to be inside the 'AtomNames' namespace.
 */

TestHarmonicDihedralConstraintTerm::TestHarmonicDihedralConstraintTerm(string name)
{
    test_name = name;
    this->atoms = NULL;
}

TestHarmonicDihedralConstraintTerm::~TestHarmonicDihedralConstraintTerm(){}

void TestHarmonicDihedralConstraintTerm::init() {}

void TestHarmonicDihedralConstraintTerm::run()
{
    Test::run();

	TEST_FUNCTION(testCreation)

	TEST_FUNCTION(testGenerateFullHessianMatrixFromTriangularMatrix)

	// Move close to 90 degrees with an extra constraint and a mild force (it doesn't move too much
	// from the initial angle which is 0 / 180)
	TEST_REGRESSION_FUNCTION(testMinimizationWithDihedralConstraint,
			90,
			2,
			"src/Energy/PotentialConstraint/ConstraintTerms/HarmonicDihedralConstraint/Tests/data/test_dihedral_180deg.pdb",
			"src/Energy/PotentialConstraint/ConstraintTerms/HarmonicDihedralConstraint/Tests/data/diez_with_extra_phi",
			168.,169.)

	// Move close to 90 degrees with an extra constraint and a very strong force (it moves)
	TEST_REGRESSION_FUNCTION(testMinimizationWithDihedralConstraint,
			90,
			20,
			"src/Energy/PotentialConstraint/ConstraintTerms/HarmonicDihedralConstraint/Tests/data/test_dihedral_180deg.pdb",
			"src/Energy/PotentialConstraint/ConstraintTerms/HarmonicDihedralConstraint/Tests/data/diez_with_extra_phi",
			90.,92.)

	// Move from 180º to the third quadrant (overflow)
	TEST_REGRESSION_FUNCTION(testMinimizationWithDihedralConstraint,
			210,
			20,
			"src/Energy/PotentialConstraint/ConstraintTerms/HarmonicDihedralConstraint/Tests/data/test_dihedral_180deg.pdb",
			"src/Energy/PotentialConstraint/ConstraintTerms/HarmonicDihedralConstraint/Tests/data/diez",
			-151,-149) // angles always in -pi,pi range

    // Move from 180º to the second quadrant (overflow)
	TEST_REGRESSION_FUNCTION(testMinimizationWithDihedralConstraint,
			-210,
			20,
			"src/Energy/PotentialConstraint/ConstraintTerms/HarmonicDihedralConstraint/Tests/data/test_dihedral_180deg.pdb",
			"src/Energy/PotentialConstraint/ConstraintTerms/HarmonicDihedralConstraint/Tests/data/diez",
			149.,151.)// angles always in -pi,pi range

	// Move from 180º to the 4th quadrant
	TEST_REGRESSION_FUNCTION(testMinimizationWithDihedralConstraint,
			-45,
			20,
			"src/Energy/PotentialConstraint/ConstraintTerms/HarmonicDihedralConstraint/Tests/data/test_dihedral_180deg.pdb",
			"src/Energy/PotentialConstraint/ConstraintTerms/HarmonicDihedralConstraint/Tests/data/diez",
			-46.,-44)// angles always in -pi,pi range

	// Move from 0º to the 4th quadrant
	TEST_REGRESSION_FUNCTION(testMinimizationWithDihedralConstraint,
			-45,
			20,
			"src/Energy/PotentialConstraint/ConstraintTerms/HarmonicDihedralConstraint/Tests/data/test_dihedral_0deg.pdb",
			"src/Energy/PotentialConstraint/ConstraintTerms/HarmonicDihedralConstraint/Tests/data/diez",
			-46.,-44)// angles always in -pi,pi range

	finish();
}

void TestHarmonicDihedralConstraintTerm::finish()
{
    Test::finish();
}

bool TestHarmonicDihedralConstraintTerm::testGenerateFullHessianMatrixFromTriangularMatrix() {
	double triangular_hessian_array[] = {24, 35, 68, 67, 16, 25, 1, 70, 27, 42, 6, 34, 18, 15, 19,
			11, 12, 52, 37, 28, 59, 63, 75, 32, 21, 14, 43, 48, 50, 10, 60, 44, 57, 62, 54,
			4, 55, 9, 3, 17, 64, 0, 76, 31, 69, 58, 74, 23, 8, 53, 22, 51, 56, 29, 66, 65,
			49, 72, 46, 39, 7, 30, 13, 61, 45, 33, 26, 36, 71, 40, 5, 41, 73, 2, 77, 38, 20, 47};
	vector<double> triangular_hessian (triangular_hessian_array, triangular_hessian_array + sizeof(triangular_hessian_array) / sizeof(double));

	double full_matrix[][12] =
	     {{24, 35, 68, 67, 16, 25,  1, 70, 27, 42,  6, 34},
		 {0, 18, 15, 19, 11, 12, 52, 37, 28, 59, 63, 75},
		 {0,  0, 32, 21, 14, 43, 48, 50, 10, 60, 44, 57},
		 {0,  0,  0, 62, 54,  4, 55,  9,  3, 17, 64,  0},
		 {0,  0,  0,  0, 76, 31, 69, 58, 74, 23,  8, 53},
		 {0,  0,  0,  0,  0, 22, 51, 56, 29, 66, 65, 49},
		 {0,  0,  0,  0,  0,  0, 72, 46, 39,  7, 30, 13},
		 {0,  0,  0,  0,  0,  0,  0, 61, 45, 33, 26, 36},
		 {0,  0,  0,  0,  0,  0,  0,  0, 71, 40,  5, 41},
		 {0,  0,  0,  0,  0,  0,  0,  0,  0, 73,  2, 77},
		 {0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 38, 20},
		 {0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 47}};

	double returned_full_matrix[12][12];
	HarmonicDihedralConstraintTerm::generateFullHessianMatrixFromTriangularMatrix(triangular_hessian, returned_full_matrix);

	bool ok = true;
	for(int i=0; i<12; ++i) {
		ok = Assertion::expectedVectorEqualsCalculatedWithinPrecision(returned_full_matrix[i], full_matrix[i], 12, 1e-13)
				and ok;
	}

	return ok;
}

Complex* load_complex(const char* pdb, const char* mol_template_path){
	TestTools::addOneImpactProteinTemplate(mol_template_path, OPLS2005, "DIEZ");
	ComplexBuilder complexBuilder(OPLS2005);
	Complex * complex = complexBuilder.build(pdb);
	TestTools::deleteOneImpactProteinTemplate(OPLS2005, "DIEZ");
	return complex;
}

void generate_constraint_nodes(vector<Atom*>& nodes, vector<string>& nodeNames, AtomSet* complex) {
	nodes.clear();
	nodeNames.clear();
	nodeNames.push_back(AtomNames::OH);
	nodeNames.push_back(AtomNames::C);
	nodeNames.push_back(AtomNames::CZ);
	nodeNames.push_back(AtomNames::O);

	for(unsigned int i=0; i<nodeNames.size(); i++) {
		SelectionBuilder selectionBuilder;
		vector<Atom*> selectedAtoms;
		//cout <<"{\"atoms\" : { \"names\":[\""+nodeNames[i]+"\"]} }"<< endl;
		Selector* selector = selectionBuilder.create("{\"atoms\" : { \"names\":[\""+nodeNames[i]+"\"]} }");
		selector->getAtoms(selectedAtoms, complex);
		delete selector;

		if(selectedAtoms.size() != 1) {
			cout << "Selected atoms length different than 1" << endl;
		}
		nodes.push_back(selectedAtoms[0]);
	}
}

bool TestHarmonicDihedralConstraintTerm::testCreation(){
	// Load complex and create nodes
	System sys;
	Complex* complex = load_complex(
			"src/Energy/PotentialConstraint/ConstraintTerms/HarmonicDihedralConstraint/Tests/data/test_dihedral.pdb",
			"src/Energy/PotentialConstraint/ConstraintTerms/HarmonicDihedralConstraint/Tests/data/diez");
	vector<Atom*> nodes;
	vector<string> nodeNames;
	generate_constraint_nodes(nodes, nodeNames, complex);

	// Generate the dihedral constraint
	HarmonicDihedralConstraintTerm constraintTerm(
			2,
			Math::degToRad(90),
			nodes);

	// Check
	// Get the names actually stored into the constraint
	vector<string> stored_names;
	for(unsigned int i = 0; i < constraintTerm.atoms.size(); i++){
		stored_names.push_back(constraintTerm.atoms[i]->name);
	}
	delete complex;

	// Do the assertions
	return Assertion::expectedEqualsCalculated(constraintTerm.springConstant, 2.) and
	Assertion::expectedEqualsCalculated(constraintTerm.equilibriumAngle, Math::degToRad(90)) and
	Assertion::expectedVectorEqualsCalculated(nodeNames, stored_names);
}

bool TestHarmonicDihedralConstraintTerm::testMinimizationWithDihedralConstraint(
		double angle,
		double force_const,
		const char* pdb,
		const char* mol_template_path,
		double ang_range_start,
		double ang_range_end) {

	// Load complex and create nodes
	System sys;
	Complex* complex = load_complex(pdb, mol_template_path);
	vector<Atom*> nodes;
	vector<string> nodeNames;
	generate_constraint_nodes(nodes, nodeNames, complex);

	// Create energy calculator for use in minimization
	SolventGenerator solventGenerator;
	Solvent * vacuum = solventGenerator.createVacuum();
	EnergyCalculatorBuilder energyCalculatorBuilder;
	EnergyCalculator* enerCalc = ToolsForEnergyTests::createSimpleEnergyCalculator( complex, vacuum, 12.);

	// With this torsional constraint
	HarmonicDihedralConstraintTerm* dihedral_constraint = new HarmonicDihedralConstraintTerm(
			force_const,
			Math::degToRad(angle),
			nodes);
	enerCalc->addAnmConstraintTerm(dihedral_constraint);

	// Write the initial angle
	double initial_angle = dihedral_constraint->getCurrentAngle(&complex->getAllCartesianCoordinates()[0]);
	cout<<"Initial angle: "<<initial_angle<<endl;

	// Create minimizer and use it
	MinParams* min_params = new TNParams;
	Minimizer minimizer(new TruncatedNewton);
	minimizer.minimize(min_params,
			complex,
			enerCalc);

	// Calculate the final angle
	double current_angle = dihedral_constraint->getCurrentAngle(&complex->getAllCartesianCoordinates()[0]);
	cout<<"Final angle: "<<current_angle<<endl;

//	PDBWriter writer;
//	std::ostringstream out;
//	writer.writeAllChainsToPdb(complex, out);
//	cout<<out.str()<<endl;

	delete enerCalc;
	delete min_params;
	delete complex;
	delete vacuum;

	return Assertion::isInRange(current_angle,ang_range_start,ang_range_end);
}


text:
<?xml version="1.0" encoding="UTF-8"?>

<objects xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
    xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
    xmlns:icfc="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/connector-schema-3"
    xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
    xsi:schemaLocation="http://midpoint.evolveum.com/xml/ns/public/common/common-3 ../../infra/schema/src/main/resources/xml/ns/public/common/common-3.xsd">

    <resource oid="2fdc92cd-b373-455b-892c-627e65169aa0">
        <name>Office 365 Connector</name>

        <connectorRef type="ConnectorType">
            <filter>
                <q:equal>
                <q:path>c:connectorType</q:path>
                    <q:value>org.identityconnectors.office365.Office365Connector</q:value>
                </q:equal>
            </filter>
        </connectorRef>

        <connectorConfiguration>

            <icfc:configurationProperties
                xmlns:o365="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/bundle/org.forgerock.openicf.connectors.office365-connector/org.identityconnectors.office365.Office365Connector">
                <o365:apiEndPoint>graph.windows.net</o365:apiEndPoint>
                <o365:tenancy>TENANCYNAME.onmicrosoft.com</o365:tenancy>
                <o365:symetricKey>
                    <clearValue>SYMETRICKEY</clearValue>
                </o365:symetricKey>
                <o365:authURL>https://accounts.accesscontrol.windows.net/tokens/OAuth/2</o365:authURL>
                <o365:principalID>PRINCIAPLID</o365:principalID>
                <o365:resourceID>00000002-0000-0000-c000-000000000000</o365:resourceID>
                <o365:acsPrincipalID>00000001-0000-0000-c000-000000000000</o365:acsPrincipalID>
                <o365:immutableIDEncodeMechanism>straight-base64</o365:immutableIDEncodeMechanism>
            </icfc:configurationProperties>

        </connectorConfiguration>

        <schemaHandling>
            <objectType>
	        <kind>account</kind>
                <intent>default</intent>
                <displayName>Federated Account</displayName>
                <default>true</default>
                <objectClass>ri:AccountObjectClass</objectClass>

                <attribute>

                    <ref>icfs:name</ref>
                    <displayName>Distinguished Name</displayName>

                    <limitations>
                        <access>
                            <read>true</read>
                            <add>true</add>
                        </access>
                    </limitations>

                    <outbound>
                        <strength>weak</strength>
                        <source>
                            <path>$user/name</path>
                        </source>
                        <expression>

                        </expression>
                    </outbound>
                </attribute>

                <attribute>
                    <ref>ri:mailNickname</ref>
                    <displayName>Mail nickname</displayName>
                    <outbound>
                        <source>
                            <path>$user/name</path>
                        </source>
                    </outbound>
                </attribute>

                <attribute>
                    <ref>ri:givenName</ref>
                    <displayName>First name</displayName>
                    <outbound>
                        <source>
                            <path>$user/givenName</path>
                        </source>
                    </outbound>
                </attribute>

                <attribute>
                    <ref>ri:surname</ref>
                    <displayName>Last name</displayName>
                    <outbound>
                        <source>
                            <path>$user/familyName</path>
                        </source>
                    </outbound>
                </attribute>

                <attribute>
                    <ref>ri:displayName</ref>
                    <description>The display name.</description>
                    <outbound>
                        <source>
                            <path>$user/fullName</path>
                        </source>
                    </outbound>
                </attribute>

                <attribute>
                    <ref>ri:mail</ref>
                    <displayName>Email Address</displayName>
                    <inbound>
                        <target>
                            <path>$user/emailAddress</path>
                        </target>
                    </inbound>
                </attribute>

                <attribute>
                    <ref>ri:licenses</ref>
                    <displayName>License to assign</displayName>
                    <description>The license and plans to assign to the user</description>
                    <outbound>
                        <expression>
                            <value>ENTERPRISEPACK</value>
                        </expression>
                    </outbound>
                </attribute>

                <attribute>
                    <ref>ri:usageLocation</ref>
                    <displayName>Usage Location</displayName>
                    <description>Location of account usage</description>
                    <outbound>
                        <expression>
                            <value>GB</value>
                        </expression>
                    </outbound>
                </attribute>

                <attribute>
                    <ref>ri:telephoneNumber</ref>
                    <displayName>Telephone Number</displayName>
                    <outbound>
                        <source>
                            <path>$user/telephoneNumber</path>
                        </source>
                    </outbound>
                </attribute>

                <attribute>
                    <ref>ri:jobTitle</ref>
                    <displayName>Job Title</displayName>
                    <outbound>
                        <source>
                            <path>$user/title</path>
                        </source>
                    </outbound>
                </attribute>

                <attribute>
                    <ref>ri:department</ref>
                    <displayName>Department</displayName>
                    <outbound>
                        <source>
                            <path>$user/organizationalUnit</path>
                        </source>
                    </outbound>
                </attribute>

                <attribute>
                    <ref>ri:city</ref>
                    <displayName>City</displayName>
                    <outbound>
                        <source>
                            <path>$user/extension/city</path>
                        </source>
                    </outbound>
                </attribute>

                <attribute>
                    <ref>ri:proxyAddresses</ref>
                    <displayName>EMail Address</displayName>
                    <description>Proxy Addresses for the user.</description>
                </attribute>

                <attribute>
                    <ref>ri:immutableId</ref>
                    <displayName>Immutable ID</displayName>
                    <description>The unique non changing attribute to link this account in a federated domain</description>
                    <outbound>
                        <source>
                            <path>$user/extension/adimmutableuid</path>
                        </source>
                    </outbound>
                </attribute>

                <activation>
                    <administrativeStatus>
                        <outbound />
                        <inbound>
                            <strength>weak</strength>
                        </inbound>
                    </administrativeStatus>
                </activation>

                <credentials>
                    <password>
                        <outbound>
                            <expression>
                                <generate />
                            </expression>
                        </outbound>
                    </password>
                </credentials>

            </objectType>
        </schemaHandling>

        <capabilities
            xmlns:cap="http://midpoint.evolveum.com/xml/ns/public/resource/capabilities-3">
            <configured>
                <cap:activation>
                    <cap:status>
                        <cap:attribute>ri:accountEnabled</cap:attribute>
                        <cap:enableValue />
                        <cap:enableValue>true</cap:enableValue>
                        <cap:disableValue>false</cap:disableValue>
                    </cap:status>
                </cap:activation>
            </configured>
        </capabilities>

        <synchronization>
            <objectSynchronization>

                <enabled>true</enabled>

                <correlation>
                    <q:description>
                        Correlation expression is a search query.
                        Following search queury will look for users that have "name"
                        equal to the "mailNickname" attribute of the account. Simply speaking,
                        it will look for match in usernames in the IDM and the resource.
                        The correlation rule always looks for users, so it will not match
                        any other object type.
                    </q:description>
                    <q:equal>
                        <q:path>c:name</q:path>
                        <expression>

                        </expression>
                    </q:equal>
                </correlation>

                <reaction>
                    <situation>linked</situation>
                    <action>
                    	<handlerUri>http://midpoint.evolveum.com/xml/ns/public/model/action-3#modifyUser</handlerUri>
                    </action>
                </reaction>
                <reaction>
                    <situation>deleted</situation>
                    <action>
                    	<handlerUri>http://midpoint.evolveum.com/xml/ns/public/model/action-3#unlinkAccount</handlerUri>
                    </action>
                </reaction>
                <reaction>
                    <situation>unlinked</situation>
                    <action>
                    	<handlerUri>http://midpoint.evolveum.com/xml/ns/public/model/action-3#linkAccount</handlerUri>
                    </action>
                </reaction>
                <reaction>
                    <situation>unmatched</situation>
                    <action>
                    	<handlerUri>http://midpoint.evolveum.com/xml/ns/public/model/action-3#linkAccount</handlerUri>
                    </action>
                </reaction>
            </objectSynchronization>
        </synchronization>
    </resource>
</objects>

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>
RSAOtherPrimeInfo (Java Platform SE 6)
</TITLE>

<META NAME="date" CONTENT="2007-03-19">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

      概述
      软件包
    类
      使用
      树
      已过时
      索引
      帮助

JavaTM Platform
Standard Ed. 6

 上一个类
 下一个类

  框架
 无框架

  所有类

  摘要: 嵌套 | 字段 | 构造方法 | 方法

详细信息: 字段 | 构造方法 | 方法

java.security.spec

类 RSAOtherPrimeInfo

java.lang.Object
  java.security.spec.RSAOtherPrimeInfo

public class RSAOtherPrimeInfo
extends Object

此类表示 RSA 的 OtherPrimeInfo 结构中的三元组(素数、指数和素数),如 PKCS#1 v2.1 中所定义的。RSA 的 OtherPrimeInfo 的 ASN.1 语法如下:

 OtherPrimeInfo ::= SEQUENCE {
   prime INTEGER,
   exponent INTEGER,
   coefficient INTEGER
   }

从以下版本开始:

1.4

另请参见:
RSAPrivateCrtKeySpec,
RSAMultiPrimePrivateCrtKey

构造方法摘要

RSAOtherPrimeInfo(BigInteger prime,
                  BigInteger primeExponent,
                  BigInteger crtCoefficient)

          给定如 PKCS#1 中所定义的素数、primeExponent 和 crtCoefficient,创建一个新的 RSAOtherPrimeInfo。

方法摘要

 BigInteger
getCrtCoefficient()

          返回素数的 crtCoefficient。

 BigInteger
getExponent()

          返回素数的指数。

 BigInteger
getPrime()

          返回素数。

从类 java.lang.Object 继承的方法

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

构造方法详细信息

RSAOtherPrimeInfo

public RSAOtherPrimeInfo(BigInteger prime,
                         BigInteger primeExponent,
                         BigInteger crtCoefficient)

给定如 PKCS#1 中所定义的素数、primeExponent 和 crtCoefficient,创建一个新的 RSAOtherPrimeInfo。

参数:
prime - n 的素数因子。
primeExponent - 指数。
crtCoefficient - Chinese Remainder Theorem 系数。

抛出:

NullPointerException - 如果任一参数(即:prime、primeExponent 和 crtCoefficient)为 null。

方法详细信息

getPrime

public final BigInteger getPrime()

返回素数。

返回:
素数。

getExponent

public final BigInteger getExponent()

返回素数的指数。

返回:
primeExponent。

getCrtCoefficient

public final BigInteger getCrtCoefficient()

返回素数的 crtCoefficient。

返回:
crtCoefficient。

      概述
      软件包
    类
      使用
      树
      已过时
      索引
      帮助

JavaTM Platform
Standard Ed. 6

 上一个类
 下一个类

  框架
 无框架

  所有类

  摘要: 嵌套 | 字段 | 构造方法 | 方法

详细信息: 字段 | 构造方法 | 方法

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。


text:
package org.jetbrains.sbt
package language.completion

import com.intellij.codeInsight.completion._
import com.intellij.patterns.PlatformPatterns
import com.intellij.psi._
import com.intellij.util.ProcessingContext
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plugins.scala.lang.completion.ScalaCompletionContributor
import org.jetbrains.plugins.scala.lang.completion.lookups.{LookupElementManager, ScalaChainLookupElement, ScalaLookupItem}
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiUtil
import org.jetbrains.plugins.scala.lang.psi.api.expr.{ScInfixExpr, ScReferenceExpression}
import org.jetbrains.plugins.scala.lang.psi.api.statements.{ScTypeAlias, ScValue, ScVariable}
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.ScTypedDefinition
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef._
import org.jetbrains.plugins.scala.lang.psi.types._
import org.jetbrains.plugins.scala.lang.psi.types.api.ParameterizedType
import org.jetbrains.plugins.scala.lang.psi.types.api.designator.{ScDesignatorType, ScProjectionType}
import org.jetbrains.plugins.scala.lang.psi.types.nonvalue.NonValueType
import org.jetbrains.plugins.scala.lang.psi.types.result.Success
import org.jetbrains.plugins.scala.lang.resolve.{ResolveUtils, ScalaResolveResult}
import org.jetbrains.plugins.scala.project.ProjectContext

/**
 * @author Nikolay Obedin
 * @since 7/10/14.
 */

class SbtCompletionContributor extends ScalaCompletionContributor {

  val afterInfixOperator = PlatformPatterns.psiElement().withSuperParent(2, classOf[ScInfixExpr])

  extend(CompletionType.BASIC, afterInfixOperator, new CompletionProvider[CompletionParameters] {
    override def addCompletions(parameters: CompletionParameters, context: ProcessingContext, result: CompletionResultSet) {
      if (parameters.getOriginalFile.getFileType.getName != Sbt.Name) return
      implicit val project: ProjectContext = parameters.getPosition.getProject

      val place     = positionFromParameters(parameters)
      val infixExpr = place.getContext.getContext.asInstanceOf[ScInfixExpr]
      val operator  = infixExpr.operation
      val parentRef = infixExpr.rOp match {
        case ref: ScReferenceExpression => ref
        case _ => return
      }

      // Check if we're on the right side of expression
      if (parentRef != place.getContext) return

      def qualifiedName(t: ScType) = t.extractClass.map(_.qualifiedName).getOrElse("")

      // In expression `setting += ???` extracts type T of `setting: Setting[Seq[T]]`
      def extractSeqType: Option[ScType] = {
        if (operator.getText != "+=") return None
        operator.getType() match {
          case Success(ParameterizedType(_, typeArgs), _) =>
            typeArgs.last match {
              case ParameterizedType(settingType, Seq(seqFullType)) if qualifiedName(settingType) == "sbt.Init.Setting" =>
                val collectionTypeNames = Seq("scala.collection.Seq", "scala.collection.immutable.Set")
                seqFullType match {
                  case ParameterizedType(seqType, Seq(valType)) if collectionTypeNames contains qualifiedName(seqType) =>
                    Some(valType)
                  case _ => None
                }
              case _ => None
            }
          case _ => None
        }
      }

      def getScopeType: Option[ScType] = {
        if (operator.getText != "in") return None
        place.elementScope.getCachedClass("sbt.Scope").map {
          ScDesignatorType(_)
        }
      }

      val expectedTypes = Seq(
        parentRef.expectedType().filterNot(_.isInstanceOf[NonValueType]),
        extractSeqType,
        getScopeType
      ).flatten
      val expectedType = expectedTypes match {
        case Seq(t, rest @ _*) => t
        case _ => return
      }

      def isAccessible(cls: PsiMember): Boolean = ResolveUtils.isAccessible(cls, place, forCompletion = true)

      // Collect all values, variables and inner objects from given object amd apply them
      def collectAndApplyVariants(obj: PsiClass): Unit = obj match {
        case obj: ScObject if isAccessible(obj) && ScalaPsiUtil.hasStablePath(obj) =>
          def fetchAndApply(element: ScTypedDefinition) {
            val lookup = LookupElementManager.getLookupElement(new ScalaResolveResult(element), isClassName = true,
              isOverloadedForClassName = false, shouldImport = true, isInStableCodeReference = false).head
            lookup.addLookupStrings(obj.name + "." + element.name)
            applyVariant(lookup)
          }
          obj.members.foreach {
            case v: ScValue    => v.declaredElements foreach fetchAndApply
            case v: ScVariable => v.declaredElements foreach fetchAndApply
            case obj: ScObject => fetchAndApply(obj)
            case _ => // do nothing
          }
        case _ => // do nothing
      }

      def applyVariant(variantObj: Object) {
        def apply(item: ScalaLookupItem) {
          item.isSbtLookupItem = true
          result.addElement(item)
        }
        val variant = variantObj match {
          case el: ScalaLookupItem => el
          case ch: ScalaChainLookupElement => ch.element
          case _ => return
        }

        variant.element match {
          case f: PsiField if f.getType.toScType().conforms(expectedType) =>
            apply(variant)
          case typed: ScTypedDefinition if typed.getType().getOrAny.conforms(expectedType) =>
            variant.isLocalVariable =
              (typed.isVar || typed.isVal) &&
                typed.containingFile.exists(_.getName == parameters.getOriginalFile.getName)
            apply(variant)
          case _ => // do nothing
        }
      }

      // Get results from companion objects and static fields from java classes/enums
      expectedType.extractClass match {
        case Some(clazz: ScTypeDefinition) =>
          expectedType match {
            case ScProjectionType(proj, _: ScTypeAlias | _: ScClass | _: ScTrait, _) =>
              proj.extractClass foreach collectAndApplyVariants
            case _ => // do nothing
          }
          ScalaPsiUtil.getCompanionModule(clazz) foreach collectAndApplyVariants
        case Some(p: PsiClass) if isAccessible(p) =>
          p.getFields.foreach (field => {
            if (field.hasModifierProperty("static") && isAccessible(field)) {
              val lookup = LookupElementManager.getLookupElement(new ScalaResolveResult(field), isClassName = true,
                isOverloadedForClassName = false, shouldImport = true, isInStableCodeReference = false).head
              lookup.addLookupStrings(p.getName + "." + field.getName)
              applyVariant(lookup)
            }
          })
        case _ => // do nothing
      }

      // Get results from parent reference
      parentRef.getVariants() foreach applyVariant
    }
  })
}


text:
'use strict';
const common = require('../common');
const assert = require('assert');
const path = require('path');
const fs = require('fs');

let watchSeenOne = 0;
let watchSeenTwo = 0;
let watchSeenThree = 0;
let watchSeenFour = 0;

const testDir = common.tmpDir;

const filenameOne = 'watch.txt';
const filepathOne = path.join(testDir, filenameOne);

const filenameTwo = 'hasOwnProperty';
const filepathTwo = filenameTwo;
const filepathTwoAbs = path.join(testDir, filenameTwo);

const filenameThree = 'charm'; // because the third time is

const filenameFour = 'get';

process.on('exit', function() {
  fs.unlinkSync(filepathOne);
  fs.unlinkSync(filepathTwoAbs);
  fs.unlinkSync(filenameThree);
  fs.unlinkSync(filenameFour);
  assert.strictEqual(1, watchSeenOne);
  assert.strictEqual(2, watchSeenTwo);
  assert.strictEqual(1, watchSeenThree);
  assert.strictEqual(1, watchSeenFour);
});

fs.writeFileSync(filepathOne, 'hello');

assert.throws(
  function() {
    fs.watchFile(filepathOne);
  },
  function(e) {
    return e.message === '"watchFile()" requires a listener function';
  }
);

assert.doesNotThrow(
  function() {
    fs.watchFile(filepathOne, function() {
      fs.unwatchFile(filepathOne);
      ++watchSeenOne;
    });
  }
);

setTimeout(function() {
  fs.writeFileSync(filepathOne, 'world');
}, 1000);

process.chdir(testDir);

fs.writeFileSync(filepathTwoAbs, 'howdy');

assert.throws(
  function() {
    fs.watchFile(filepathTwo);
  },
  function(e) {
    return e.message === '"watchFile()" requires a listener function';
  }
);

assert.doesNotThrow(
  function() {
    function a() {
      fs.unwatchFile(filepathTwo, a);
      ++watchSeenTwo;
    }
    function b() {
      fs.unwatchFile(filepathTwo, b);
      ++watchSeenTwo;
    }
    fs.watchFile(filepathTwo, a);
    fs.watchFile(filepathTwo, b);
  }
);

setTimeout(function() {
  fs.writeFileSync(filepathTwoAbs, 'pardner');
}, 1000);

assert.doesNotThrow(
  function() {
    function b() {
      fs.unwatchFile(filenameThree, b);
      ++watchSeenThree;
    }
    fs.watchFile(filenameThree, common.mustNotCall());
    fs.watchFile(filenameThree, b);
    fs.unwatchFile(filenameThree, common.mustNotCall());
  }
);

setTimeout(function() {
  fs.writeFileSync(filenameThree, 'pardner');
}, 1000);

setTimeout(function() {
  fs.writeFileSync(filenameFour, 'hey');
}, 200);

setTimeout(function() {
  fs.writeFileSync(filenameFour, 'hey');
}, 500);

assert.doesNotThrow(
  function() {
    function a() {
      ++watchSeenFour;
      assert.strictEqual(1, watchSeenFour);
      fs.unwatchFile(`.${path.sep}${filenameFour}`, a);
    }
    fs.watchFile(filenameFour, a);
  }
);


text:
int main() {
    // Setup the problem
    auto setup = Unit::tcg <Real,Rm> ();

    // Problem setup
    setup.A = std::make_unique <Matrix>(
        Unit::Matrix <Real>::mostly_dd_indef(setup.m));
    setup.b = std::make_unique <Vector> (Unit::Vector <Real>::elast(setup.m));
    setup.x_offset = std::make_unique <Vector> (
        Unit::Vector <Real>::basic(setup.m));

    // Trust-Region
    {
        // Make the TR radius large enough to not constrain ourselves until we
        // hit the negative curvature.
        setup.delta = 1e5;

        // Target solutions
        setup.iter_star = 5;
        setup.stop_star = Optizelle::TruncatedStop::NegativeCurvature;

        // Tests
        Unit::reset_checks <Real,Rm> (setup);
        setup.check_iter = true;
        setup.check_stop = true;
        setup.check_tr = true;

        // Check the solver
        Unit::run_and_verify <Real,Rm> (setup);
    }

    // Line-search
    {
        // Blow out the trust-region
        setup.delta = std::numeric_limits<Real>::infinity();

        // Target solutions
        setup.iter_star = 5;
        setup.stop_star = Optizelle::TruncatedStop::NegativeCurvature;

        // Tests
        Unit::reset_checks <Real,Rm> (setup);
        setup.check_iter = true;
        setup.check_stop = true;

        // Check the solver
        Unit::run_and_verify <Real,Rm> (setup);

        // Extract the solution that we generated.  This should be the
        // answer at the iteration prior to this.  Pull these in as the
        // answers and then rerun the example
        setup.iter_max = setup.iter-1;
        setup.x_star = std::make_unique <Vector> (*setup.x);
        setup.iter_star = setup.iter-1;
        setup.stop_star = Optizelle::TruncatedStop::MaxItersExceeded;

        // Tests
        Unit::reset_checks <Real,Rm> (setup);
        setup.check_stop = true;
        setup.check_sol = true;
        setup.check_iter = true;

        // Check the solver
        Unit::run_and_verify <Real,Rm> (setup);
    }

    // Declare success
    return EXIT_SUCCESS;
}


text:
GRAPHLAB_DIR = /home/erich/graphlabapi

#We need a nice way to import the compile and link flags from the graphlab
#build.  Until then we are using a horrible method to build the reference
#executables - we copy each cpp file to a temporary project directory
#within the graphlab directory, build it there and copy the executable back

#INCLUDES = -I$(GRAPHLAB_DIR)/src -I$(GRAPHLAB_DIR)/deps/local/include

#This may need to be tweaked for your system
#CFLAGS = -O3 -g3 -ggdb -march=native -mtune=native  -Wall -g  -fopenmp -DHAS_BUILTIN_CRC32

#LDFLAGS = -g3 -ggdb -L$(GRAPHLAB_DIR)/release/src/graphlab -L$(GRAPHLAB_DIR)/deps/local/lib

#LDLIBS = -lgraphlab -lboost_filesystem -lboost_program_options -lboost_system \
  -lboost_iostreams -lboost_date_time -lz -lpthread -ltcmalloc -levent \
  -levent_pthreads -lmpichcxx -lmpich -ljson -lgomp

ALGORITHMS = pagerank sssp sssp_gather bfs connected_component

BINARIES = $(foreach x,$(ALGORITHMS),$x.x)

#OBJECTS = $(foreach x,$(BINARIES),$x.o)

all: $(BINARIES)

#%.o: %.cpp
#	g++ $(INCLUDES) $(CFLAGS) -c -o $@ $<

%.x: %.cpp
	$(eval APPDIR = $(GRAPHLAB_DIR)/demoapps/tmp_$*)
	$(eval APPBUILDDIR = $(GRAPHLAB_DIR)/release/demoapps/tmp_$*)
	mkdir -p $(APPDIR)
	cp $< ../graphio.cpp ../graphio.h $(APPDIR)/
	printf 'project(GraphLab)\nadd_graphlab_executable(tmp_$@ $< graphio.cpp)\n' > $(APPDIR)/CMakeLists.txt
	cd $(GRAPHLAB_DIR) && ./configure
	cd $(APPBUILDDIR) && make
	cp $(APPBUILDDIR)/tmp_$@ $@
	rm $(APPDIR)/CMakeLists.txt $(APPDIR)/$< $(APPDIR)/graphio.cpp $(APPDIR)/graphio.h
	rmdir $(APPDIR)

#pagerank: pagerank.cpp
#	g++ $(LDFLAGS)  pagerank.o -o pagerank $(LDLIBS)

clean:
	rm -f $(BINARIES)

.PHONY: all clean


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

namespace FireworksNet.Model
{
    /// <summary>
    /// Stores current algorithm state.
    /// </summary>
    /// <remarks>This class is not thread-safe.</remarks>
    public class AlgorithmState
    {
        private readonly TId id = new TId();
        private IEnumerable<Firework> fireworks;
        private int stepNumber;
        private Solution bestSolution;

        /// <summary>
        /// Gets unique state identifier.
        /// </summary>
        public TId Id
        {
            get
            {
                return this.id;
            }
        }

        /// <summary>
        /// Gets or sets a collection of current fireworks.
        /// </summary>
        /// <exception cref="System.ArgumentNullException"> if value is null.</exception>
        public IEnumerable<Firework> Fireworks
        {
            get
            {
                return this.fireworks;
            }

            set
            {
                if (value == null)
                {
                    throw new ArgumentNullException("value");
                }

                this.fireworks = value;
            }
        }

        /// <summary>
        /// Gets or sets the step number.
        /// </summary>
        /// <exception cref="System.ArgumentOutOfRangeException"> if value is less than zero.</exception>
        public int StepNumber
        {
            get
            {
                return this.stepNumber;
            }

            set
            {
                if (value < 0)
                {
                    throw new ArgumentOutOfRangeException("value");
                }

                this.stepNumber = value;
            }
        }

        /// <summary>
        /// Gets or sets the best solution among <see cref="AlgorithmState.Fireworks"/>.
        /// </summary>
        /// <exception cref="System.ArgumentNullException"> if value is null.</exception>
        public Solution BestSolution
        {
            get
            {
                return this.bestSolution;
            }

            set
            {
                if (value == null)
                {
                    throw new ArgumentNullException("value");
                }

                this.bestSolution = value;
            }
        }
    }
}


text:
package lasagna

func PreparationTime(layers []string, avgPrepTimePerLayer int) int {
	const DEFAULT_PREP_TIME_PER_LAYER = 2

	if avgPrepTimePerLayer == 0 {
		return len(layers) * DEFAULT_PREP_TIME_PER_LAYER
	}
	return len(layers) * avgPrepTimePerLayer
}

func Quantities(layers []string) (quantityNoodles int, quantitySauce float64) {
	numNoodles := count(layers, "noodles")
	numSauce := count(layers, "sauce")
	return numNoodles * 50, float64(numSauce) * 0.2
}

func AddSecretIngredient(friendsList []string, myList []string) []string {
	lastItem := friendsList[len(friendsList)-1]
	result := append(myList, lastItem)
	return result
}

func ScaleRecipe(quantities []float64, desiredNumPortions int) []float64 {
	result := make([]float64, len(quantities))
	for i, quantity := range quantities {
		quantityForOnePortion := quantity / 2.0
		result[i] = quantityForOnePortion * float64(desiredNumPortions)
	}
	return result
}

// count returns the number of times item occurs in s
func count(s []string, item string) (result int) {
	for _, v := range s {
		if v == item {
			result += 1
		}
	}
	return result
}


text:
/*
 * mipointrst.h
 *
 */

/*

Copyright 1989, 1998  The Open Group

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/

#include "mipointer.h"
#include "scrnintstr.h"

typedef struct {
    ScreenPtr		    pScreen;    /* current screen */
    ScreenPtr		    pSpriteScreen;/* screen containing current sprite */
    CursorPtr		    pCursor;    /* current cursor */
    CursorPtr		    pSpriteCursor;/* cursor on screen */
    BoxRec		    limits;	/* current constraints */
    Bool		    confined;	/* pointer can't change screens */
    int			    x, y;	/* hot spot location */
    int			    devx, devy;	/* sprite position */
} miPointerRec, *miPointerPtr;

typedef struct {
    miPointerSpriteFuncPtr  spriteFuncs;	/* sprite-specific methods */
    miPointerScreenFuncPtr  screenFuncs;	/* screen-specific methods */
    CloseScreenProcPtr	    CloseScreen;
    Bool		    waitForUpdate;	/* don't move cursor in SIGIO */
    Bool		    showTransparent;	/* show empty cursors */
} miPointerScreenRec, *miPointerScreenPtr;


text:
<component name="CopyrightManager">
  <settings default="Apache 2.0">
    <module2copyright />
  </settings>
</component>


text:
namespace Microsoft.Azure.Management.Internal.Resources.Models
{
    /// <summary>
    /// The management lock properties.
    /// </summary>
    public partial class ManagementLockProperties
    {
        private string _level;

        /// <summary>
        /// Optional. Gets or sets the lock level of the management lock.
        /// </summary>
        public string Level
        {
            get { return this._level; }
            set { this._level = value; }
        }

        private string _notes;

        /// <summary>
        /// Optional. Gets or sets the notes of the management lock.
        /// </summary>
        public string Notes
        {
            get { return this._notes; }
            set { this._notes = value; }
        }

        /// <summary>
        /// Initializes a new instance of the ManagementLockProperties class.
        /// </summary>
        public ManagementLockProperties()
        {
        }
    }
}


text:
package com.spider.dao;
//=======================================================
//		          .----.
//		       _.'__    `.
//		   .--(^)(^^)---/!\
//		 .' @          /!!!\
//		 :         ,    !!!!
//		  `-..__.-' _.-\!!!/
//		        `;_:    `"'
//		      .'"""""`.
//		     /,  ya ,\\
//		    //狗神保佑\\
//		    `-._______.-'
//		    ___`. | .'___
//		   (______|______)
//=======================================================

import com.spider.dao.datasource.unpooled.UnpooledDataSource;
import com.spider.entity.FollowNexus;
import com.spider.entity.UserBase;
import com.spider.entity.UserInfo;
import com.spider.tool.Config;

import java.lang.reflect.Proxy;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * [Zhihu]https://www.zhihu.com/people/Sweets07
 * [Github]https://github.com/MatrixSeven
 * Created by seven on 2016/12/5.
 */
public class SaveDaoImp implements SaveDaoInterface {

    private static final Config CONFIG = Config.INSTANCES();
    private static final UnpooledDataSource UNPOOLED_DATA_SOURCE = new UnpooledDataSource("com.mysql.jdbc.Driver", (CONFIG.getDb_url().concat(CONFIG.getDb_name())), CONFIG.getDb_user_name(), CONFIG.getDb_user_pass());
    private static final Object look = new Object();
    private static final String SQL_INIT = "select * from users where isinit=0 and token='%s'";
    private static final String SQL_INSERT_USERINFO = "INSERT INTO users_info(weibo,name,address,education,company,job,headline,user_id,answer,question,article,favorite,agree,thanked,following,followers,topic,columns,sex,token,index_url)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
    private static final String SQL_INSERT_USERBASE = "insert INTO users (token,index_url,from_id,from_token) VALUES (?,?,?,?)";
    private static final String SQL_UPDATE_USERBASE = "update users set isinit=? where token=?";
    private static final String SQL_INSERT_FOLLOWER = "insert INTO follower (user_token,user_token_follower,user_name,follower_name) VALUES (?,?,?,?)";
    private static final String SQL_SELECT_USERBASE = "SELECT id,token,from_id from_id,from_token FROM users WHERE isinit = '0'  ORDER BY id LIMIT 10000";
    private static final String SQL_ISEXIST_USERBASE = "select * from users where token=?";
    private static final String SQL_UPDATE_USERBASE_PARSER = "UPDATE users set isparser=? WHERE  token=?";
    private static final String SQL_GET_USERBASE_PARSER = "select * from users where isparser='0' limit ".concat(CONFIG.getUser_info_size());
    private static final String IS_INIT_DB = "SELECT w.TABLE_NAME FROM information_schema.TABLES w WHERE w.table_name =? and w.TABLE_SCHEMA=?";
    private Random r = new Random();

    private SaveDaoImp() {
    }

    public static SaveDaoInterface getInstance() {
        return (SaveDaoInterface) Proxy.
                newProxyInstance(SaveDaoImp.class.getClassLoader(),
                        new Class[]{SaveDaoInterface.class}, new Hook(new SaveDaoImp()));
    }

    @Override
    public long UpdateParserInfo(List<UserBase> info) throws Exception {
        long star = System.currentTimeMillis();
        synchronized (look) {
            Connection connection = UNPOOLED_DATA_SOURCE.getConnection();
            connection.setAutoCommit(false);
            PreparedStatement ps = connection.prepareStatement(SQL_UPDATE_USERBASE_PARSER);
            int i = 0;
            for (UserBase token : info) {
                ps.setString(1, "1");
                ps.setString(2, token.getToken());
                ps.addBatch();
                if (i++ % 1000 == 0) {
                    ps.executeBatch();
                    ps.clearBatch();
                    connection.commit();
                }
            }
            ps.executeBatch();
            ps.clearBatch();
            connection.commit();
            close(ps, connection);
        }
        return (System.currentTimeMillis() - star) / 1000L;
    }

    @Override
    public List<UserBase> getParserInfoUserBase() throws Exception {
        Connection connection = UNPOOLED_DATA_SOURCE.getConnection();
        PreparedStatement ps = connection.prepareStatement(SQL_GET_USERBASE_PARSER);
        List<UserBase> userBase = getUserBase(ps.executeQuery());
        close(ps, connection);
        return userBase;
    }

    @Override
    public void UpdateBase(List<UserBase> userBases) throws Exception {
        synchronized (look) {
            Connection connection = UNPOOLED_DATA_SOURCE.getConnection();
            connection.setAutoCommit(false);
            PreparedStatement ps = connection.prepareStatement(SQL_UPDATE_USERBASE);
            for (UserBase u : userBases) {
                ps.setString(1, "1");
                ps.setString(2, u.getToken());
                ps.addBatch();
            }
            ps.executeBatch();
            connection.commit();
            connection.setAutoCommit(true);
            close(ps);
        }
    }

    @Override
    public void SaveForUser(List<UserInfo> info) throws Exception {
        Connection connection = UNPOOLED_DATA_SOURCE.getConnection();
        PreparedStatement ps = connection.prepareStatement(SQL_INSERT_USERINFO);
        connection.setAutoCommit(false);
        int i = 1;
        for (UserInfo u : info) {
            ps.setString(i++, u.getWeibo());
            ps.setString(i++, u.getName());
            ps.setString(i++, u.getAddress());
            ps.setString(i++, u.getEducation());
            ps.setString(i++, u.getCompany());
            ps.setString(i++, u.getJob());
            ps.setString(i++, u.getHeadline());
            ps.setString(i++, u.getId());
            ps.setString(i++, u.getAnswer());
            ps.setString(i++, u.getQuestion());
            ps.setString(i++, u.getArticle());
            ps.setString(i++, u.getFavorite());
            ps.setString(i++, u.getAgree());
            ps.setString(i++, u.getThanked());
            ps.setString(i++, u.getFollowing());
            ps.setString(i++, u.getFollowers());
            ps.setString(i++, u.getTopic());
            ps.setString(i++, u.getColumns());
            ps.setString(i++, u.getSex());
            ps.setString(i++, u.getToken());
            ps.setString(i++, u.getIndex_url());
            i = 1;
            ps.addBatch();

        }
        ps.executeBatch();
        connection.commit();
        connection.setAutoCommit(true);
        close(ps, connection);

    }

    @Override
    public void SaveForFollow(List<FollowNexus> followNexuses) throws Exception {
        Connection connection = UNPOOLED_DATA_SOURCE.getConnection();
        PreparedStatement ps = connection.prepareStatement(SQL_INSERT_FOLLOWER);
        connection.setAutoCommit(false);
        for (FollowNexus f : followNexuses) {
            ps.setString(1, f.getToken_id());
            ps.setString(2, f.getToken_flower());
            ps.setString(3, f.getName());
            ps.setString(4, f.getFlower_name());
            ps.addBatch();
        }
        ps.executeBatch();
        connection.commit();
        connection.setAutoCommit(true);
        close(ps, connection);

    }

    @Override
    public List<UserBase> iniTemp(int size) throws Exception {
        Connection connection = UNPOOLED_DATA_SOURCE.getConnection();
        PreparedStatement preparedStatement = connection.prepareStatement("select * from USERS limit " + size);
        List<UserBase> objects = new ArrayList<>(size);
        objects.addAll(getUserBase(preparedStatement.executeQuery()));
        close(preparedStatement, connection);
        return objects;

    }

    @Override
    public void SaveForUserBase(List<UserBase> userBases) throws Exception {
        synchronized (look) {
            Connection connection = UNPOOLED_DATA_SOURCE.getConnection();
            //token,index_url,from_id,from_token
            connection.setAutoCommit(false);
            PreparedStatement ps = connection.prepareStatement(SQL_INSERT_USERBASE);
            for (UserBase f : userBases) {
                ps.setString(1, f.getToken());
                ps.setString(2, "https://www.zhihu.com/people/".concat(f.getToken()));
                ps.setString(3, f.getFrom_id());
                ps.setString(4, f.getFrom_token());
                ps.addBatch();
            }
            ps.executeBatch();
            connection.commit();
            connection.setAutoCommit(true);
            close(ps);
        }
    }

    @Override
    public List<UserBase> getNewForUserBase() throws Exception {
        Connection connection = UNPOOLED_DATA_SOURCE.getConnection();
        return getUserBase(connection.prepareStatement(SQL_SELECT_USERBASE).executeQuery());

    }

    @Override
    public List<UserBase> Init(UserBase userBase) throws Exception {
        List<UserBase> userBases = new ArrayList<>();
        Connection connection = UNPOOLED_DATA_SOURCE.getConnection();
        connection.setAutoCommit(false);
        PreparedStatement ps = connection.prepareStatement(String.format(SQL_INIT, userBase.getToken()));
        ResultSet res = ps.executeQuery();
        userBases.addAll(getUserBase(ps.executeQuery()));
        if (userBases.size() == 0) {
            ps = connection.prepareStatement("select * FROM  users WHERE  token='" + userBase.getToken() + "'");
            if (getUserBase(ps.executeQuery()).size() != 0) {
                userBases.addAll(getNewForUserBase());
                close(ps, connection);
                return userBases;
            }
            ps = connection.prepareStatement(SQL_INSERT_USERBASE);
            ps.setString(1, userBase.getToken());
            ps.setString(2, "https://www.zhihu.com/people/".concat(userBase.getToken()));
            ps.setString(3, "0");
            ps.setString(4, "0");
            ps.execute();
            connection.commit();
            ps = connection.prepareStatement(String.format(SQL_INIT, userBase.getToken()));
            userBases.addAll(getUserBase(ps.executeQuery()));
        }
        connection.setAutoCommit(true);
        close(ps, connection);
        this.UpdateBase(userBases);
        return userBases;
    }

    public boolean isExist(UserBase userBase) throws Exception {

        Connection connection = UNPOOLED_DATA_SOURCE.getConnection();
        PreparedStatement ps = connection.prepareStatement(SQL_ISEXIST_USERBASE);
        ps.setString(1, userBase.getToken());
        ResultSet resultSet = ps.executeQuery();
        Boolean b = resultSet.next();
        close(resultSet, ps, connection);
        Thread.sleep(500);

        return b;
    }

    private List<UserBase> getUserBase(ResultSet res) throws Exception {
        List<UserBase> userBases = new ArrayList<>();
        UserBase userBase;
        while (res.next()) {
            userBase = new UserBase();
            userBase.setId(res.getString("id"));
            userBase.setToken(res.getString("token"));
            userBase.setFrom_token(res.getString("from_token"));
            userBase.setFrom_token(res.getString("from_token"));
            userBases.add(userBase);
        }
        close(res);
        return userBases;
    }

    @Override
    public void InitDb() throws Exception {
        Connection connection = UNPOOLED_DATA_SOURCE.getConnection();
        PreparedStatement preparedStatement = connection.prepareStatement(IS_INIT_DB);
        preparedStatement.setString(1, "users");
        preparedStatement.setString(2, CONFIG.INSTANCES().getDb_name());
        if (preparedStatement.executeQuery().next()) {
            return;
        }

        //TODO Create Table

    }

    private void close(AutoCloseable... con) {
        try {
            for (AutoCloseable a : con) {
                if (a != null) {
                    a.close();
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>Qsmart.java.applications</groupId>
	<artifactId>FINESCEApi</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>war</packaging>
	<name>FINESCEApi</name>

	<developers>
     		<developer>
         		<id>xxx</id>
         		<name>Myname</name>
         		<email>xxx</email>
     		</developer>
   	</developers>

	<properties>
        	<spring.version>3.2.0.RELEASE</spring.version>
        	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        	<maven.minimum.version>3.0.1</maven.minimum.version>
        	<configurations.path>${basedir}/src/main/configurations</configurations.path>
        	<spring.integration.version>2.2.3.RELEASE</spring.integration.version>
    	</properties>

	<dependencies>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<version>${spring.version}</version>
			<exclusions>
				<exclusion>
					<artifactId>commons-logging</artifactId>
					<groupId>commons-logging</groupId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-web</artifactId>
	                <version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-webmvc</artifactId>
	                <version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-beans</artifactId>
	                <version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
	                <version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.codehaus.jackson</groupId>
			<artifactId>jackson-mapper-asl</artifactId>
	                <version>1.9.11</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.integration</groupId>
			<artifactId>spring-integration-file</artifactId>
	                <version>${spring.integration.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-core</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
    			<groupId>org.springframework.security</groupId>
    			<artifactId>spring-security-web</artifactId>
			<version>${spring.version}</version>
  		</dependency>
  		<dependency>
    			<groupId>org.springframework.security</groupId>
    			<artifactId>spring-security-config</artifactId>
			<version>${spring.version}</version>
  		</dependency>
		<dependency>
	                <groupId>org.springmodules</groupId>
      	        	<artifactId>spring-modules-cache</artifactId>
                	<version>0.8a</version>
	                <exclusions>
	                    <exclusion>
	                        <groupId>org.springframework</groupId>
	                        <artifactId>spring</artifactId>
	                    </exclusion>
                    		<exclusion>
                        		<groupId>gigaspaces</groupId>
                        		<artifactId>gigaspaces-ce</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>jini</groupId>
                        		<artifactId>jsk-lib</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>jini</groupId>
                        		<artifactId>jsk-platform</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>jini</groupId>
                        		<artifactId>mahalo</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>jini</groupId>
                        		<artifactId>reggie</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>jini</groupId>
                        		<artifactId>start</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>jini</groupId>
                        		<artifactId>boot</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>jini</groupId>
                        		<artifactId>webster</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>commons-attributes</groupId>
                        		<artifactId>commons-attributes-api</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>commons-attributes</groupId>
                        		<artifactId>commons-attributes-compiler</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>cglib</groupId>
                        		<artifactId>cglib-nodep</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>jboss</groupId>
                        		<artifactId>javassist</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>jboss</groupId>
                        		<artifactId>jboss-cache</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>jboss</groupId>
                        		<artifactId>jboss-common</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>jboss</groupId>
                        		<artifactId>jboss-jmx</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>jboss</groupId>
                        		<artifactId>jboss-minimal</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>jboss</groupId>
                        		<artifactId>jboss-system</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>jcs</groupId>
                        		<artifactId>jcs</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>jgroups</groupId>
                        		<artifactId>jgroups-all</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>geronimo-spec</groupId>
                        		<artifactId>geronimo-spec-jta</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>xpp3</groupId>
                        		<artifactId>xpp3_min</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>xjavadoc</groupId>
                        		<artifactId>xjavadoc</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>opensymphony</groupId>
                        		<artifactId>oscache</artifactId>
                    		</exclusion>
                    		<exclusion>
                        		<groupId>ehcache</groupId>
                        		<artifactId>ehcache</artifactId>
                    		</exclusion>
               		</exclusions>
            	</dependency>

		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
                	<version>2.5</version>
                	<scope>provided</scope>
		</dependency>
		<dependency>
		    <groupId>javax.servlet</groupId>
		    <artifactId>jstl</artifactId>
		    <version>1.2</version>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
	                <version>2.4</version>
		</dependency>

		<dependency>
			<groupId>javax.inject</groupId>
			<artifactId>javax.inject</artifactId>
	                <version>1</version>
		</dependency>

		<dependency>
			<groupId>org.evolvis</groupId>
			<artifactId>config</artifactId>
                	<version>0.6.0</version>
		</dependency>

		<dependency>
			<groupId>net.sf.opencsv</groupId>
			<artifactId>opencsv</artifactId>
	                <version>2.0</version>
		</dependency>
		<dependency>
			<groupId>com.googlecode.lambdaj</groupId>
			<artifactId>lambdaj</artifactId>
	                <version>2.3.3</version>
		</dependency>
		<dependency>
			<groupId>joda-time</groupId>
			<artifactId>joda-time</artifactId>
	                <version>2.1</version>
		</dependency>

        	<!-- WebDav integration -->

		<dependency>
  			<groupId>com.github.lookfirst</groupId>
  			<artifactId>sardine</artifactId>
		  	<version>5.0.2</version>
		</dependency>

		<!-- Encryption -->

		<dependency>
			<groupId>org.bouncycastle</groupId>
			<artifactId>bcprov-jdk15on</artifactId>
			<version>1.50</version>
		</dependency>

		<!--  XMPP Comunication -->

		<dependency>
			<groupId>Qsmart.java.library</groupId>
 			<artifactId>XMPPConnector</artifactId>
			<version>0.0.1-SNAPSHOT</version>
		</dependency>
		<dependency>
		  	<groupId>org.igniterealtime.smack</groupId>
		  	<artifactId>smack</artifactId>
			<version>3.2.1</version>
		</dependency>

		<!-- Logging -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
                	<version>1.7.2</version>
		</dependency>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
	                <version>1.2.17</version>
		</dependency>
		<dependency>
			<!-- any library that uses commons-logging will be directed to slf4j -->
			<groupId>org.slf4j</groupId>
			<artifactId>jcl-over-slf4j</artifactId>
	                <version>1.7.2</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
	                <version>1.7.2</version>
		</dependency>

		<!--Testing -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-test</artifactId>
                	<version>${spring.version}</version>
                	<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
                	<version>4.11</version>
                	<scope>test</scope>
                	<exclusions>
                	    <exclusion>
                	        <groupId>org.hamcrest</groupId>
                	        <artifactId>hamcrest-core</artifactId>
                	    </exclusion>
                	</exclusions>
		</dependency>
		<dependency>
			<groupId>junit-addons</groupId>
			<artifactId>junit-addons</artifactId>
                	<version>1.4</version>
                	<scope>test</scope>
		</dependency>

		<!-- end scope test -->
	</dependencies>

	<build>
		<finalName>FINESCEApi</finalName>

		<sourceDirectory>src/main/java</sourceDirectory>
		<testSourceDirectory>src/test/java</testSourceDirectory>
		<resources>
			<resource>
				<directory>src/main/java</directory>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
			</resource>
		</resources>
		<testResources>
			<testResource>
				<directory>src/test/resources</directory>
				<filtering>true</filtering>
			</testResource>
		</testResources>

		<plugins>
			<plugin>
                	    <groupId>org.apache.maven.plugins</groupId>
                	    <artifactId>maven-help-plugin</artifactId>
                	    <version>2.2</version>
                	</plugin>
                	<plugin>
                	    <artifactId>maven-enforcer-plugin</artifactId>
                	    <version>1.2</version>
                	    <executions>
                	        <execution>
                	            <id>run-enforcer-during-validate</id>
                	            <goals>
                	                <goal>enforce</goal>
                	            </goals>
                	            <configuration>
                	                <rules>
                	                    <requireMavenVersion>
                	                        <version>${maven.minimum.version}</version>
                	                    </requireMavenVersion>
                	                </rules>
                	            </configuration>
                	        </execution>
                	    </executions>
                	</plugin>
                	<plugin>
                	    <artifactId>maven-compiler-plugin</artifactId>
                	    <version>2.3.2</version>
                	    <configuration>
                	        <source>1.7</source>
                	        <target>1.7</target>
                	        <encoding>${project.build.sourceEncoding}</encoding>
                	        <showDeprecation>true</showDeprecation>
                	        <showWarnings>true</showWarnings>
                	        <fork>true</fork>
                	    </configuration>
                	</plugin>
                	<plugin>
                	    <groupId>org.apache.maven.plugins</groupId>
                	    <artifactId>maven-war-plugin</artifactId>
                	    <version>2.1.1</version>
                	    <configuration>
                	        <failOnMissingWebXml>false</failOnMissingWebXml>
                	        <webappDirectory>${project.build.directory}/war/webapps/
                	        </webappDirectory>
                	        <archive>
                	            <manifestEntries>
                	                <version_name>${project.artifactId}</version_name>
                	                <version_description>${project.description}</version_description>
                	                <version_copyright>Copyright (c) 2013 QSC AG</version_copyright>
                	                <version_version>${project.version}</version_version>
                	            </manifestEntries>
                	        </archive>
                	    </configuration>
                	</plugin>
                	<plugin>
                	    <groupId>org.apache.maven.plugins</groupId>
                	    <artifactId>maven-resources-plugin</artifactId>
                	    <version>2.5</version>
                	    <configuration>
                	        <encoding>UTF-8</encoding>
                	    </configuration>
                	</plugin>

			<!-- Coda quality, sonar, PMD, findbugs, etc... -->
                	<plugin>
                	    <groupId>org.codehaus.mojo</groupId>
                	    <artifactId>sonar-maven-plugin</artifactId>
                	    <version>2.0</version>
                	</plugin>

	                <plugin>
	                    <groupId>org.apache.maven.plugins</groupId>
	                    <artifactId>maven-release-plugin</artifactId>
	                    <version>2.4</version>
	                </plugin>

		</plugins>
	</build>

    <repositories>
        <repository>
            <id>ibiblio</id>
            <name>ibiblio</name>
            <url>http://www.ibiblio.org/maven2</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>tarent-repository-evolvis-3rdparty</id>
            <name>Tarent Maven2 Repository (Evolvis) 3rd party</name>
            <url>http://maven-repo.evolvis.org/3rdparty</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>evolvis-release-repository</id>
            <url>http://maven-repo.evolvis.org/releases/</url>
            <layout>default</layout>
        </repository>
        <repository>
            <id>codehaus</id>
            <url>http://repository.codehaus.org</url>
        </repository>
        <repository>
            <id>cukes</id>
            <url>http://cukes.info/maven</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>tarent-plugin-repository</id>
            <name>Tarent Maven2 Plugin Repository</name>
            <url>http://maven-repo.evolvis.org/releases</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>cukes</id>
            <url>http://cukes.info/maven</url>
        </pluginRepository>
    </pluginRepositories>

</project>


text:
layout: post
date: 2017-03-28
title: "Sherri Hill Spring 2014 Style 21284 2014 Spring Short Sleeves Short/Mini Aline/Princess"
category: Sherri Hill
tags: [Sherri Hill ,Sherri Hill,Aline/Princess ,Bateau,Short/Mini,Short Sleeves,2014,Spring]
---
### Sherri Hill Spring 2014 Style 21284
Just **$399.99**
### 2014 Spring Short Sleeves Short/Mini Aline/Princess

BRANDS	Sherri Hill

Silhouette	Aline/Princess

Neckline	Bateau

Hemline/Train	Short/Mini

Sleeve	Short Sleeves

Years	2014

Season	Spring

Buy it: [https://www.readybrides.com/en/sherri-hill-/51090-sherri-hill-spring-2014-style-21284.html](https://www.readybrides.com/en/sherri-hill-/51090-sherri-hill-spring-2014-style-21284.html)


text:
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AzureStack.Management.Models;

namespace Microsoft.AzureStack.Management
{
    /// <summary>
    /// Your documentation here.  (see
    /// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
    /// more information)
    /// </summary>
    public partial interface ICurationOperations
    {
        /// <summary>
        /// Your documentation here.  (see
        /// http://msdn.microsoft.com/en-us/library/windowsazure/XXXXX.aspx
        /// for more information)
        /// </summary>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Your documentation here.
        /// </returns>
        Task<CurationListResult> ListAsync(CancellationToken cancellationToken);
    }
}


text:
import path from 'path';

import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgeArch } from '@electron-forge/shared-types';
import { expect } from 'chai';
import 'chai-as-promised';
import proxyquire from 'proxyquire';
import { SinonStub, stub } from 'sinon';

import { MakerFlatpakConfig } from '../src/Config';
import { flatpakArch } from '../src/MakerFlatpak';

type MakeFunction = (opts: Partial<MakerOptions>) => Promise<string[]>;

class MakerImpl extends MakerBase<MakerFlatpakConfig> {
  name = 'test';

  defaultPlatforms = [];
}

describe('MakerFlatpak', () => {
  let MakerFlatpak: typeof MakerImpl;
  let maker: MakerImpl;
  let eifStub: SinonStub;
  let ensureDirectoryStub: SinonStub;
  let config: MakerFlatpakConfig;
  let createMaker: () => void;

  const dir = '/my/test/dir/out';
  const makeDir = path.resolve('/make/dir');
  const appName = 'My Test App';
  const targetArch = process.arch;
  const packageJSON = { version: '1.2.3' };

  beforeEach(() => {
    ensureDirectoryStub = stub().returns(Promise.resolve());
    eifStub = stub().resolves();
    config = {};

    MakerFlatpak = proxyquire
      .noPreserveCache()
      .noCallThru()
      .load('../src/MakerFlatpak', {
        'fs-extra': { readdir: stub().returns(Promise.resolve([])) },
        '@malept/electron-installer-flatpak': eifStub,
      }).default;
    createMaker = () => {
      maker = new MakerFlatpak(config);
      maker.ensureDirectory = ensureDirectoryStub;
      maker.prepareConfig(targetArch as ForgeArch);
    };
    createMaker();
  });

  it('should pass through correct defaults', async () => {
    await (maker.make as MakeFunction)({
      dir,
      makeDir,
      appName,
      targetArch,
      packageJSON,
    });
    const opts = eifStub.firstCall.args[0];
    const expectedArch = flatpakArch(process.arch as ForgeArch);
    expect(opts).to.deep.equal({
      arch: expectedArch,
      src: dir,
      dest: path.resolve(makeDir, 'flatpak', expectedArch),
    });
  });

  it('should have config cascade correctly', async () => {
    config = {
      arch: 'overridden',
      options: {
        productName: 'Flatpak',
      },
    } as Record<string, unknown>;
    createMaker();

    await (maker.make as MakeFunction)({
      dir,
      makeDir,
      appName,
      targetArch,
      packageJSON,
    });
    const opts = eifStub.firstCall.args[0];
    const expectedArch = flatpakArch(process.arch as ForgeArch);
    expect(opts).to.deep.equal({
      arch: expectedArch,
      options: {
        productName: 'Flatpak',
      },
      src: dir,
      dest: path.resolve(makeDir, 'flatpak', expectedArch),
    });
  });
});


text:
use range::Range;
use wobj;
use std::default::Default;

use AddTo;
use Vertex;
use Geometry;

/// An object consists of a list of geometries.
/// The geometries are stored separately,
/// in a geometry buffer.
pub struct Object(pub Vec<Range>);

impl Object {
    /// Creates a new object layer.
    pub fn new() -> Object {
        Object(Vec::new())
    }

    /// Adds a new object.
    pub fn new_object<T>(
        obj: &wobj::obj::Object,
        vertices: &mut Vec<T>,
        indices: &mut Vec<u32>,
        geometries: &mut Geometry
    ) -> Range<AddTo<Object>>
        where T: Vertex + Default
    {
        let start = geometries.0.len();
        for geom in obj.geometry.iter() {
            // TODO: How to deal with vertex formats?
            let (add_range, _) = Geometry::new_geometry(
                    geom, obj, vertices, indices
                );
            geometries.add_range(add_range);
        }
        let n = geometries.0.len() - start;
        Range::new(start, n)
    }

    /// Adds new object.
    pub fn add_range(&mut self, range: Range<AddTo<Object>>) {
        self.0.push(range.cast())
    }
}


text:
from collections import OrderedDict
from datetime import timedelta

from mangrove.datastore.database import DatabaseManager, DataObject
from mangrove.datastore.documents import ProjectDocument
from mangrove.datastore.entity import Entity, _from_row_to_entity
from mangrove.errors.MangroveException import DataObjectAlreadyExists
from mangrove.form_model.deadline import Deadline, Month, Week
from mangrove.form_model.field import FieldSet
from mangrove.form_model.form_model import REPORTER, get_form_model_by_code, FormModel
from mangrove.transport.repository.reporters import get_reporters_who_submitted_data_for_frequency_period

default_reminder_and_deadline = {"deadline_type": "Following", "should_send_reminder_to_all_ds": False,
                                 "has_deadline": True,
                                 "deadline_month": "5", "frequency_period": "month"}

class Project(FormModel):
    __document_class__ = ProjectDocument

    def _set_doc(self, form_code, is_registration_model, label, language, name):
        doc = ProjectDocument()
        doc.name = name
        doc.set_label(label)
        doc.form_code = form_code
        doc.active_languages = [language]
        doc.is_registration_model = is_registration_model
        DataObject._set_document(self, doc)

    def __init__(self, dbm, form_code=None, name=None, goals="", devices=None, sender_group=None,
                 language='en', fields=[]):
        FormModel.__init__(self, dbm=dbm, form_code=form_code, is_registration_model=False,
                           label="", language=language, name=name, fields=fields)
        if self._doc:
            self._doc.goals = goals
            self._doc.devices = devices
            self._doc.sender_group = sender_group
            self._doc.reminder_and_deadline = default_reminder_and_deadline

    def is_field_set_field_present(self):
         return len([f for f in self.fields if type(f) is FieldSet and f.fields]) > 0

    def remove_child(self, child_id):
        self._doc.remove_child(child_id)

    def add_child(self, child_id):
        self._doc.add_child_id(child_id)

    def set_parent_info(self, parent_uuid, parent_fields_code_label, action_label):
        self._doc.parent_info["parent_fields_code_label"] = parent_fields_code_label
        self._doc.parent_info['action_label'] = action_label
        self._doc.parent_info['parent_uuid'] = parent_uuid

    @property
    def is_parent_project(self):
        return len(self._doc.child_ids) > 0

    @property
    def is_child_project(self):
        parents_codes = self._doc.parent_info.get("parent_fields_code_label")
        return True if parents_codes and len(parents_codes) > 0 else False

    @property
    def child_ids(self):
        return self._doc.child_ids

    @property
    def parent_info(self):
        return self._doc.parent_info

    @property
    def parent_uuids(self):
        # TODO at some point will also support multiple parents from UI.
        parent_uuid = self._doc.parent_info.get('parent_uuid', None)
        return [parent_uuid] if parent_uuid else []

    @classmethod
    def from_form_model(cls, form_model):
        return super(Project, cls).new_from_doc(form_model._dbm, ProjectDocument.wrap(form_model._doc._data))

    @property
    def data_senders(self):
        return self._doc.data_senders

    @property
    def goals(self):
        return self._doc.goals

    @data_senders.setter
    def data_senders(self, value):
        self._doc.data_senders = value

    @property
    def devices(self):
        return self._doc.devices

    @property
    def language(self):
        return self.activeLanguages[0]

    @property
    def is_outgoing_sms_replies_enabled(self):
        is_enabled = self._doc.is_outgoing_sms_replies_enabled
        return True if is_enabled is None else is_enabled

    @is_outgoing_sms_replies_enabled.setter
    def is_outgoing_sms_replies_enabled(self, enable_replies):
        self._doc.is_outgoing_sms_replies_enabled = enable_replies

    @property
    def reminder_and_deadline(self):
        return self._doc.reminder_and_deadline

    @reminder_and_deadline.setter
    def reminder_and_deadline(self, value):
        self._doc.reminder_and_deadline = value

    def reset_reminder_and_deadline(self):
        self.reminder_and_deadline = default_reminder_and_deadline

    def get_data_senders(self, dbm):
        all_data, fields, label = load_data_senders(dbm, self.data_senders)
        return [dict(zip(fields, data["cols"])) for data in all_data]

    def get_associated_datasenders(self, dbm):
        keys = [([REPORTER], short_code) for short_code in self.data_senders]
        rows = dbm.view.by_short_codes(reduce=False, include_docs=True, keys=keys)
        return [Entity.new_from_doc(dbm, Entity.__document_class__.wrap(row.get('doc'))) for row in rows]

    def _get_data_senders_ids_who_made_submission_for(self, dbm, deadline_date, frequency_period):
        if frequency_period == 'month':
            start_date, end_date = deadline_date - timedelta(days=7), deadline_date + timedelta(days=7)
        else:
            start_date, end_date = deadline_date - timedelta(days=3), deadline_date + timedelta(days=3)
        form_model_id = self.id
        data_senders_with_submission = get_reporters_who_submitted_data_for_frequency_period(dbm, form_model_id, start_date,
                                                                                end_date)
        return [datasender.short_code for datasender in data_senders_with_submission]

    def get_data_senders_without_submissions_for(self, deadline_date, dbm, frequency_period):
        data_sender_ids_with_submission = self._get_data_senders_ids_who_made_submission_for(dbm, deadline_date, frequency_period)
        my_data_senders = self.get_data_senders(dbm)
        data_senders_without_submission = [data_sender for data_sender in my_data_senders if
                                           data_sender['short_code'] not in data_sender_ids_with_submission]
        return data_senders_without_submission

    def deadline(self):
        return Deadline(self._frequency(), self._deadline_type())

    def _frequency(self):
        if self.reminder_and_deadline.get('frequency_period') == 'month':
            return Month(int(self.reminder_and_deadline.get('deadline_month')))
        if self.reminder_and_deadline.get('frequency_period') == 'week':
            return Week(int(self.reminder_and_deadline.get('deadline_week')))

    def has_deadline(self):
        return self.reminder_and_deadline.get('has_deadline')

    def _deadline_type(self):
        return self.reminder_and_deadline.get('deadline_type')

    def _frequency_period(self):
        return self.reminder_and_deadline.get('frequency_period')

    def get_deadline_day(self):
        if self.reminder_and_deadline.get('frequency_period') == 'month':
            return int(self.reminder_and_deadline.get('deadline_month'))

    def should_send_reminders(self, as_of, days_relative_to_deadline):
        next_deadline_day = self.deadline().current(as_of)
        if next_deadline_day is not None:
            if as_of == next_deadline_day + timedelta(days=days_relative_to_deadline):
                return True
        return False

    def is_project_name_unique(self):
        rows = self._dbm.load_all_rows_in_view('project_names', key=self.name.lower())
        if len(rows) and rows[0]['value']["id"] != self.id:
            return False
        return True

    def _check_if_project_name_unique(self):
        if not self.is_project_name_unique():
            raise DataObjectAlreadyExists('Questionnaire', "Name", "'%s'" % self.name)

    def save(self, process_post_update=True):
        assert isinstance(self._dbm, DatabaseManager)
        self._check_if_project_name_unique()
        return super(Project, self).save(process_post_update)

    def update(self, value_dict):
        attribute_list = [item[0] for item in (self._doc.items())]
        for key in value_dict:
            if key in attribute_list:
                # if key == 'name':
                # setattr(self._doc, key, value_dict.get(key))
                # else:
                setattr(self._doc, key, value_dict.get(key))

    def set_void(self, void=True):
        self._doc.void = void

    def delete_datasender(self, dbm, entity_id):
        # from datawinners.search.datasender_index import update_datasender_index_by_id

        self.data_senders.remove(entity_id)
        self.save(process_post_update=False)
        # update_datasender_index_by_id(entity_id, dbm)

    def _remove_duplicate_datasenders(self, data_senders_list):
        datasenders_already_linked_to_questionnaire = []
        for data_senders_code in data_senders_list:
            if data_senders_code in self.data_senders:
                # data_senders_list.remove(data_senders_code)
                datasenders_already_linked_to_questionnaire.append(data_senders_code)
        for ds in datasenders_already_linked_to_questionnaire:
            data_senders_list.remove(ds)

    def associate_data_sender_to_project(self, dbm, data_senders_list):
        self._remove_duplicate_datasenders(data_senders_list)
        # from datawinners.search.datasender_index import update_datasender_index_by_id
        # Normally this case should not happen. However in a special case
        # blank id was sent from client side. So introduced this check.
        if data_senders_list:
            self.data_senders.extend(data_senders_list)
            self.save(process_post_update=False)
            # for data_senders_code in data_senders_list:
            #     update_datasender_index_by_id(data_senders_code, dbm)

    @property
    def is_open_survey(self):
        return self._doc.is_open_survey

    @is_open_survey.setter
    def is_open_survey(self, value):
        self._doc.is_open_survey = value

    def has_attachment(self):
        try: # find a better way to check attachement exisits
            attachment = self.get_attachments('questionnaire.xls')
            return True, attachment, 'xls'
        except LookupError:
            try:
                attachment = self.get_attachments('questionnaire.xlsx')
                return True, attachment, 'xlsx'
            except LookupError:
                return False, None, None

    def update_attachments(self, attachments, attachment_name):
        extension = self.has_attachment()[2]
        self.delete_attachment(self._doc, "questionnaire%s" % extension)
        self.add_attachments(attachments, attachment_name)

    def get_simple_fields(self):
        simple_fields = []
        for field in self.fields:
            if not field.is_field_set:
                simple_fields.append(field)
        return simple_fields

def load_data_senders(manager, short_codes):
    form_model = get_form_model_by_code(manager, 'reg')
    fields, labels, codes = get_entity_type_fields(manager)
    keys = [([REPORTER], short_code) for short_code in short_codes]
    rows = manager.view.by_short_codes(reduce=False, include_docs=True, keys=keys)
    data = [tabulate_data(_from_row_to_entity(manager, row), form_model, codes) for row in rows]
    return data, fields, labels

def get_entity_type_fields(manager, form_code='reg'):
    form_model=get_form_model_by_code(manager, form_code)
    json_fields = form_model._doc["json_fields"]
    return get_json_field_infos(json_fields)

def get_json_field_infos(fields):
    fields_names, labels, codes = [], [], []
    for field in fields:
        if field['name'] != 'entity_type':
            fields_names.append(field['name'])
            labels.append(field['label'])
            codes.append(field['code'])
    return fields_names, labels, codes

def tabulate_data(entity, form_model, field_codes):
    data = {'id': entity.id, 'short_code': entity.short_code}

    dict = OrderedDict()
    for field in form_model.fields:
        if field.name in entity.data:
            dict[field.code] = _get_field_value(field.name, entity)
        else:
            dict[field.code] = _get_field_default_value(field.name, entity)

    stringified_dict = form_model.stringify(dict)

    data['cols'] = [stringified_dict[field_code] for field_code in field_codes]
    return data

def _get_field_value(key, entity):
    value = entity.value(key)
    if key == 'geo_code':
        if value is None:
            return entity.geometry.get('coordinates')
    elif key == 'location':
        if value is None:
            return entity.location_path

    return value

def _get_field_default_value(key, entity):
    if key == 'geo_code':
        return entity.geometry.get('coordinates')
    if key == 'location':
        return entity.location_path
    if key == 'short_code':
        return entity.short_code
    return None


text:
package com.qycloud.oatos.server.domain.entity;

import java.io.Serializable;

/**
 * 客户
 * @author yang
 *
 */
public class Customer implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 客户ID
	 */
	private long customerId;
	/**
	 * 客户登录IP
	 */
	private String customerIP;
	/**
	 * 客户的网盘地址
	 * @deprecated
	 */
	private String cloudDiskIp;

	public long getCustomerId() {
		return customerId;
	}

	public void setCustomerId(long customerId) {
		this.customerId = customerId;
	}

	public String getCustomerIP() {
		return customerIP;
	}

	public void setCustomerIP(String customerIP) {
		this.customerIP = customerIP;
	}

	/**
	 * @deprecated
	 */
	public String getCloudDiskIp() {
		return cloudDiskIp;
	}
	/**
	 * @deprecated
	 */
	public void setCloudDiskIp(String cloudDiskIp) {
		this.cloudDiskIp = cloudDiskIp;
	}

}


text:
package io.vertx.example.jpms.http2;

import io.vertx.core.AbstractVerticle;
import io.vertx.core.Promise;
import io.vertx.core.Vertx;
import io.vertx.core.http.HttpServer;
import io.vertx.core.http.HttpServerOptions;
import io.vertx.core.net.JksOptions;

public class Server extends AbstractVerticle {

  public static void main(String[] args) {
    Vertx vertx = Vertx.vertx();
    vertx.deployVerticle(new Server())
      .onFailure(Throwable::printStackTrace);
  }

  @Override
  public void start(Promise<Void> startFuture) throws Exception {
    HttpServer server = vertx.createHttpServer(
      new HttpServerOptions()
        .setUseAlpn(true)
        .setKeyCertOptions(new JksOptions().setPath("io/vertx/example/jpms/server-keystore.jks").setPassword("wibble"))
        .setSsl(true)
    );
    server.requestHandler(req -> {
      req.response().end("Hello " + req.version());
    }).listen(8080)
      .<Void>mapEmpty()
      .onComplete(startFuture);
  }
}


text:
require 'spree_core'
require 'spree_api'
require 'spree_backend'
require 'spree_frontend'
require 'spree_size_chart/engine'


text:
		<title>Member List</title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<LINK HREF="NVIDIA.css" REL="stylesheet" TYPE="text/css">

				Main Page
				Class Hierarchy
				Compound List
				Compound Members

PxClothFabricCooker Member List

This is the complete list of members for PxClothFabricCooker, including all inherited members.

getDescriptor() const 	PxClothFabricCooker

mImpl	PxClothFabricCooker	private

PxClothFabricCooker(const PxClothMeshDesc &desc, const PxVec3 &gravity, bool useGeodesicTether=true)	PxClothFabricCooker

save(PxOutputStream &stream, bool platformMismatch) const 	PxClothFabricCooker

~PxClothFabricCooker()	PxClothFabricCooker

Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com


text:
#pragma strict
var ourText : TextMesh;
var updateText : boolean = false;
var ourNum : float = 1;
var reduceScale : boolean = false;

function Start () {
	ourText.text = "Congratulations!\nA winner is you!\n\nClick to play again.";
	StartCoroutine(doTimeScale());
	yield WaitForSeconds(8.5);
	updateText = true;
}

function doTimeScale(){
	while(true){
		if(ourNum >= 0.015){
			Time.timeScale = ourNum;
			ourNum-=0.015;
		}
		else{
			Time.timeScale = 0;
		}
		yield;
	}
}

function Update () {
	if(Input.GetMouseButtonDown(0)){
		if(!updateText){
			updateText = true;
    		Time.timeScale = 1;
    		Application.LoadLevel("exanosGoGo");
    		Destroy(transform.gameObject);
		}
	}

    if(updateText){
    	if(ourText.color.a >= 0){
    		ourText.color.a-=0.05;
    	}
    	else{
    		Time.timeScale = 1;
    		Application.LoadLevel("exanosGoGo");
    		Destroy(transform.gameObject);
    	}

    }

}


text:
#ifndef MATRIX_FACTORIZATION_H
#define MATRIX_FACTORIZATION_H

#include <math.h>
#include "example.h"
#include "parse_regressor.h"
#include "parser.h"
#include "gd.h"

namespace MF{
  LEARNER::learner* setup(vw& all, po::variables_map& vm);
}
#endif


text:
//// [contextualTypeWithUnionTypeCallSignatures.ts]
//When used as a contextual type, a union type U has those members that are present in any of
// its constituent types, with types that are unions of the respective members in the constituent types.

// Let S be the set of types in U that have call signatures.
// If S is not empty and the sets of call signatures of the types in S are identical ignoring return types,
// U has the same set of call signatures, but with return types that are unions of the return types of the respective call signatures from each type in S.

interface IWithNoCallSignatures {
    foo: string;
}
interface IWithCallSignatures {
    (a: number): string;
}
interface IWithCallSignatures2 {
    (a: number): number;
}
interface IWithCallSignatures3 {
    (b: string): number;
}
interface IWithCallSignatures4 {
    (a: number): string;
    (a: string, b: number): number;
}

// With no call signature | callSignatures
var x: IWithNoCallSignatures | IWithCallSignatures = a => a.toString();

// With call signatures with different return type
var x2: IWithCallSignatures | IWithCallSignatures2 = a => a.toString(); // Like iWithCallSignatures
var x2: IWithCallSignatures | IWithCallSignatures2 = a => a; // Like iWithCallSignatures2

// With call signatures of mismatching parameter type
var x3: IWithCallSignatures | IWithCallSignatures3 = a => /*here a should be any*/ a.toString();

// With call signature count mismatch
var x4: IWithCallSignatures | IWithCallSignatures4 = a => /*here a should be any*/ a.toString();

//// [contextualTypeWithUnionTypeCallSignatures.js]
//When used as a contextual type, a union type U has those members that are present in any of
// its constituent types, with types that are unions of the respective members in the constituent types.
// With no call signature | callSignatures
var x = function (a) { return a.toString(); };
// With call signatures with different return type
var x2 = function (a) { return a.toString(); }; // Like iWithCallSignatures
var x2 = function (a) { return a; }; // Like iWithCallSignatures2
// With call signatures of mismatching parameter type
var x3 = function (a) { return a.toString(); };
// With call signature count mismatch
var x4 = function (a) { return a.toString(); };


text:
package org.elasticsearch.action.admin.cluster.snapshots.create;

import org.elasticsearch.action.Action;

/**
 * Create snapshot action
 */
public class CreateSnapshotAction extends Action<CreateSnapshotResponse> {

    public static final CreateSnapshotAction INSTANCE = new CreateSnapshotAction();
    public static final String NAME = "cluster:admin/snapshot/create";

    private CreateSnapshotAction() {
        super(NAME);
    }

    @Override
    public CreateSnapshotResponse newResponse() {
        return new CreateSnapshotResponse();
    }
}


text:
package com.navercorp.pinpoint.collector.manage;

/**
 * @author Taejin Koo
 */
public interface CollectorManager {

    String getName();

}