text:
/*!
 * \file pw_ssl.h
 * \brief Support SSL/TLS protocols and certificates with openssl(http://openssl.org).
 * \copyright Copyright (c) 2015, SK PLANET. All Rights Reserved.
 * \license This project is released under the MIT License.
 */

#include "./pw_common.h"
#include "./pw_ini.h"
#include "./pw_digest.h"
#include "./pw_crypto.h"

#ifndef __PW_SSL_H__
#define __PW_SSL_H__

namespace pw {

class SslContext;
class SslCertificate;
class SslCertificateStoreContext;
class SslAsymmetricKey;
class SslSign;
class SslVerify;
class SslCertificateList;

namespace ssl {

//! \brief SSL 알고리즘 및 엔진 초기화
extern bool initialize(void);

//! \brief 검증 함수 타입
using verify_func_type = int (*) (int, const SslCertificateStoreContext*);

//! \brief 검증 타입.
class VerifyMode final
{
public:
	inline VerifyMode() = default;
	inline VerifyMode(const VerifyMode&) = default;
	inline VerifyMode(VerifyMode&&) = default;

	VerifyMode& operator = (const VerifyMode&) = default;
	VerifyMode& operator = (VerifyMode&&) = default;

	inline void clear(void) { m_mode = 0; }
	VerifyMode& addFlagPeer(void);
	VerifyMode& addFlagFailIfNoPeerCert(void);
	VerifyMode& addFlagClientOnce(void);

	inline int getFlags(void) const { return m_mode; }

private:
	int m_mode = 0;
};

//! \brief 메소드 타입.
enum class Method : int
{
	INVALID = 0, //!< 잘못된 메소드
	CLIENT_V2,
	SERVER_V2,
	BOTH_V2,
	CLIENT_V3,
	SERVER_V3,
	BOTH_V3,
	CLIENT_V2_V3,
	SERVER_V2_V3,
	BOTH_V2_V3,
	CLIENT_T1,
	SERVER_T1,
	BOTH_T1,
	CLIENT_T1_1,
	SERVER_T1_1,
	BOTH_T1_1,
	CLIENT_T1_2,
	SERVER_T1_2,
	BOTH_T1_2,
	CLIENT_T1_3,
	SERVER_T1_3,
	BOTH_T1_3
};

//! \brief 사이드 타입.
enum class Side : int
{
	CLIENT,
	SERVER,
};

//! \brief 패딩 타입.
enum class RSAPadding : int
{
	INVALID = 0,
	NONE,	//!< No padding
	PKCS1,	//!< PKCS#1
	PKCS1_OAEP,	//!< PKCS#1 with OEAP
	PKCS1_PSS,	//!< PKCS#1 with PSS
	X931,	//!< X9.31
	SSL_V2_V3,	//!< SSLv2 v3
};

//! \brief 사이닝 타입.
enum class Sign : int
{
	SHA1,
	RIPEMD160,
	MD5,
	MD5_SHA1,
};

//! \brief 키 알고리즘
enum class AsymKeyAlg : int
{
	INVALID = 0,
	RSA,
	DSA,
 	DH,
 	EC,
	HMAC,
	CMAC
};

extern const char* toStringA(AsymKeyAlg ka);
extern std::string toString(AsymKeyAlg ka);
extern std::string& toString(std::string& out, AsymKeyAlg ka);
extern AsymKeyAlg toAsymKeyAlg(const char* s);
extern AsymKeyAlg toAsymKeyAlg(const std::string& s);

struct pkcs12_load_param_type
{
	struct
	{
		SslAsymmetricKey* key = nullptr;
		SslCertificate* cert = nullptr;
		SslCertificateList* cert_list = nullptr;
	} out;

	struct
	{
		const char* passwd = nullptr;

		struct {
			bool key = true;
			bool cert = true;
			bool cert_list = true;
		} need;
	} in;
};

extern bool loadPKCS12File(pkcs12_load_param_type& inout, const char* path);

//! \brief 클라이언트측 최신 메소드
inline
constexpr
Method
getLastClientMethod(void)
{
#ifdef HAVE_TLSV1_3_METHOD
	return Method::CLIENT_T1_3;
#elif HAVE_TLSV1_2_METHOD
	return Method::CLIENT_T1_2;
#elif HAVE_TLSV1_1_METHOD
	return Method::CLIENT_T1_1;
#elif HAVE_TLSV1_METHOD
	return Method::CLIENT_T1;
#else
	return Method::CLIENT_V3;
#endif
}

//! \brief 서버측 최신 메소드
inline
constexpr
Method
getLastServerMethod(void)
{
#ifdef HAVE_TLSV1_3_METHOD
	return Method::SERVER_T1_3;
#elif HAVE_TLSV1_2_METHOD
	return Method::SERVER_T1_2;
#elif HAVE_TLSV1_1_METHOD
	return Method::SERVER_T1_1;
#elif HAVE_TLSV1_METHOD
	return Method::SERVER_T1;
#else
	return Method::SERVER_V3;
#endif
}

//! \brief 양단 최신 메소드
inline
constexpr
Method
getLastBothMethod(void)
{
#ifdef HAVE_TLSV1_3_METHOD
	return Method::BOTH_T1_3;
#elif HAVE_TLSV1_2_METHOD
	return Method::BOTH_T1_2;
#elif HAVE_TLSV1_1_METHOD
	return Method::BOTH_T1_1;
#elif HAVE_TLSV1_METHOD
	return Method::BOTH_T1;
#else
	return Method::BOTH_V3;
#endif
}

inline
constexpr
digest::DigestType
getDefaultSignHash(void)
{
	return digest::DigestType::SHA256;
}

inline
constexpr
size_t
getDefaultRSA_PSS_SaltSize(void)
{
	return size_t(20);
}

//! \brief Ssl 환경설정 세트
struct context_type final
{
	SslContext*	ctx = nullptr;//!< Context
	std::string	method;		//!< Method
	std::string	ca_file;	//!< CAfile
	std::string	ca_path;	//!< CApath
	std::string	cipher_list;//!< Cipherlist
	std::string	cert_file;	//!< Certificate file
	std::string	cert_passwd;//!< Certificate password
	std::string	pkey_file;	//!< Privatekey file
	std::string	pkey_passwd;//!< Privatekey password

	inline context_type() = default;
	~context_type();

	context_type(const context_type&) = delete;
	context_type(context_type&&) = delete;
	context_type& operator = (const context_type&) = delete;
	context_type& operator = (context_type&&) = delete;

	//! \brief 설정 초기화
	void clear(void);

	//! \brief 준비 되었는지 확인한다.
	inline bool isReady(void) const { return ctx not_eq nullptr; }

	//! \brief SSL 설정을 INI 파일에서 읽고 초기화한다.
	//! \param[in] ini INI 객체
	//! \param[in] prefix 아이템 이름 prefix.
	//! \param[in] sec 섹션 반복자.
	//! \return 성공하면 true를 반환한다.
	bool read(const Ini& ini, const char* prefix, Ini::sec_citr sec);
	bool read(const Ini& ini, const char* prefix, const std::string& sec);

	//! \brief Swap
	void swap(context_type& v);
};

//! \brief 마지막 SSL 오류 문자열 반환.
std::string& getLastErrorString(std::string& out);

//! \brief 마지막 SSL 오류 문자열 반환.
const char* getLastErrorString(void);

//! \brief 메소드를 문자열로 반환.
const char* getMethodString(Method type);

//! \brief 문자열을 메소드로 반환.
Method getMethod(const char* type);

//namespace ssl
};

//! \brief SSL 상태머신.
class Ssl final
{
public:
	//! \brief Ssl 생성하기.
	static Ssl* s_create(const SslContext& ctx);
	inline static Ssl* s_create(const SslContext* ctx) { return s_create(*ctx); }

	//! \brief Ssl 해제하기.
	inline static void s_release(Ssl* v) { delete v; }

	~Ssl();

public:
	inline void release(void) { delete this; }
	inline void swap(Ssl& v) { std::swap(m_ssl, v.m_ssl); }
	bool reset(void);
	bool setFD(int fd);
	bool setReadFD(int fd);
	bool setWriteFD(int fd);
	bool connect(int* need);
	bool accept(int* need);
	bool handshake(int* need = nullptr);
	ssize_t read(char* buf, size_t blen);
	ssize_t write(const char* buf, size_t blen);

public:
	SslCertificate* getPeerCertificate(void) const;
	bool verifyPeerCertificate(void) const;
	const void* getCipher(void) const;
	const char* getCipherName(void) const;
	size_t getCipherBits(void) const;
	const char* getCipherVersion(void) const;
	void setVerify(const ssl::VerifyMode& v, ssl::verify_func_type func = nullptr);
	void setVerifyDepth(size_t depth = 3);

private:
	inline Ssl() = default;

	Ssl(const Ssl&) = delete;
	Ssl(Ssl&&) = delete;
	Ssl& operator = (const Ssl&) = delete;
	Ssl& operator = (Ssl&&) = delete;

private:
	void*	m_ssl = nullptr;
};

//! \brief SSL 컨텍스트
class SslContext final
{
public:
	static SslContext* s_create(ssl::Method type);
	inline static SslContext* s_create(const char* type) { return s_create( ssl::getMethod(type) ); }
	inline static void s_release(SslContext* v) { delete v; }

	~SslContext();

public:
	inline Ssl* create(void) { return Ssl::s_create(this); }
	inline void release(void) { delete this; }
	inline void swap(SslContext& v) { std::swap(m_ctx, v.m_ctx); }
	bool setVerifyLocation(const char* file, const char* path = nullptr);
	bool setClientCAList(const char* file);
	bool addExtraChainCertificate(const SslCertificate& cert);
	bool setCertificate(const SslCertificate& cert);
	bool setCertificate(const char* path, const char* passwd = nullptr);
	bool setPrivateKey(const SslAsymmetricKey& pkey);
	bool setPrivateKey(const char* path, const char* passwd = nullptr);
	bool verifyPrivateKey(void) const;
	bool setCipherList(const char* lst);
	void setVerify(const ssl::VerifyMode& v, ssl::verify_func_type func = nullptr);
	void setVerifyDepth(size_t depth = 3);

private:
	inline SslContext()  = default;

	SslContext(const SslContext&) = delete;
	SslContext(SslContext&&) = delete;
	SslContext& operator = (const SslContext&) = delete;
	SslContext& operator = (SslContext&&) = delete;

private:
	void*	m_ctx = nullptr;

friend class Ssl;
};

//! \brief X509 인증서
class SslCertificate final
{
public:
	enum create_type
	{
		CT_RAW_DATA,
		CT_FILE,
	};

	using line_cont = std::list<std::string>;
	using kv_cont = std::map<std::string, line_cont>;

public:
	static SslCertificate* s_create(create_type ct, ...);
	static SslCertificate* s_createRawData(void* rawdata);
	static SslCertificate* s_createFile(const char* path, const char* passwd = nullptr);
	inline static void s_release(SslCertificate* v) { delete v; }

	~SslCertificate();

public:
	inline void release(void) { delete this; }
	inline void swap(SslCertificate& v) { std::swap(m_cert, v.m_cert); }
	bool getSubject(std::string& out) const;
	bool getSubject(kv_cont& cont, bool sn = false) const;
	bool getIssuer(std::string& out) const;
	bool getIssuer(kv_cont& cont, bool sn = false) const;
	bool getSubjectHash(std::string& out) const;
	uint32_t getSubjectHash(void) const;
	bool getSerial(std::string& out) const;
	int32_t getVersion(void) const;
	time_t getExpirationBefore(void) const;
	time_t getExpirationAfter(void) const;
	bool verifyExpiration(void) const;

private:
	inline SslCertificate() = default;

	SslCertificate(const SslCertificate&) = delete;
	SslCertificate(SslCertificate&&) = delete;
	SslCertificate& operator = (const SslCertificate&) = delete;
	SslCertificate& operator = (SslCertificate&&) = delete;

private:
	void* m_cert = nullptr;

friend class Ssl;
friend class SslContext;
};

//! \brief 인증서 목록(STACK_OF(X509))
class SslCertificateList final
{
public:
	using self_type = SslCertificateList;
	using self_ptr_type = SslCertificateList*;

public:
	static self_ptr_type s_createRawData(void* rawdata);
	~SslCertificateList();

public:
	inline void* getRawData(void) { return m_cl; }
	inline const void* getRawData(void) const { return m_cl; }

private:
	void* m_cl = nullptr;
};

//! \brief Certificate store
class SslCertificateStore final
{
public:
	using self_type = SslCertificateStore;
	using self_ptr_type = SslCertificateStore*;

public:
	static self_ptr_type s_createRawData(void* rawdata);
	~SslCertificateStore();

public:
	bool setCertificate(SslCertificate& in);

private:
	void* m_cs = nullptr;
};

//! \brief Certificate store context
class SslCertificateStoreContext final
{
public:
	using self_type = SslCertificateStoreContext;
	using self_ptr_type = SslCertificateStoreContext*;

public:
	static self_ptr_type s_createRawData(void* rawdata);
	~SslCertificateStoreContext();

private:
	void* m_ctx = nullptr;
};

//! \brief 비대칭키
class SslAsymmetricKey final
{
public:
	enum create_type
	{
		CT_NULL,
		CT_RAW_DATA,
		CT_GENERATE_RSA,
		CT_GENERATE_HMAC,
		CT_GENERATE_CMAC,
		CT_FILE,
		CT_PRIVATE_KEY_FILE = CT_FILE,
		CT_PUBLIC_KEY_FILE,
		CT_MEMORY,
		CT_PRIVATE_KEY_MEMORY = CT_MEMORY,
		CT_PUBLIC_KEY_MEMORY
	};

public:
	static SslAsymmetricKey* s_create(create_type ct, ...);
	static SslAsymmetricKey* s_createNull(void);
	static SslAsymmetricKey* s_createRawData(void* rawdata);
	static SslAsymmetricKey* s_createGenerateRSA(size_t keysize);
	static SslAsymmetricKey* s_createGenerateHMAC(const void* passwd, size_t passwd_len);
	static SslAsymmetricKey* s_createGenerateCMAC(const void* passwd, size_t passwd_len);
	static SslAsymmetricKey* s_createPrivateKeyFile(const char* fn, const char* pw = nullptr);
	static SslAsymmetricKey* s_createPublicKeyFile(const char* fn, const char* pw = nullptr);
	static SslAsymmetricKey* s_createPrivateKeyMemory(const void* in, size_t ilen, const char* pw = nullptr);
	static SslAsymmetricKey* s_createPublicKeyMemory(const void* in, size_t ilen, const char* pw = nullptr);
	inline static void s_release(SslAsymmetricKey* v) { delete v; }

	virtual ~SslAsymmetricKey();

public:
	inline void release(void) { delete this; }
	inline void swap(SslAsymmetricKey& v) { std::swap(m_pkey, v.m_pkey); }

	ssl::AsymKeyAlg getType(void) const;
	size_t getSize(void) const;

public:
	ssize_t writePublicKeyAsDER(std::ostream& os) const;
	ssize_t writePublicKeyAsDER(std::string& ostr) const;
	ssize_t writePrivateKeyAsDER(std::ostream& os) const;
	ssize_t writePrivateKeyAsDER(std::string& ostr) const;

	ssize_t writePublicKeyAsPEM(std::ostream& os) const;
	ssize_t writePublicKeyAsPEM(std::string& ostr) const;
	ssize_t writePrivateKeyAsPEM(std::ostream& os, crypto::CipherType ct = crypto::CipherType::EMPTY, const blob_type* key = nullptr, const blob_type* passwd = nullptr) const;
	ssize_t writePrivateKeyAsPEM(std::string& ostr, crypto::CipherType ct = crypto::CipherType::EMPTY, const blob_type* key = nullptr, const blob_type* passwd = nullptr) const;

	ssize_t encrypt(std::ostream& os, const void* in, size_t ilen, ssl::RSAPadding pt = ssl::RSAPadding::PKCS1_OAEP) const;
	inline ssize_t encrypt(std::ostream& os, const std::string& in, ssl::RSAPadding pt = ssl::RSAPadding::PKCS1_OAEP) const { return this->encrypt(os, in.c_str(), in.size(), pt); }
	ssize_t encrypt(std::string& os, const void* in, size_t ilen, ssl::RSAPadding pt = ssl::RSAPadding::PKCS1_OAEP) const;
	inline ssize_t encrypt(std::string& os, const std::string& in, ssl::RSAPadding pt = ssl::RSAPadding::PKCS1_OAEP) const { return this->encrypt(os, in.c_str(), in.size(), pt); }
	ssize_t encrypt(char* obuf, size_t* olen, const void* in, size_t ilen, ssl::RSAPadding pt = ssl::RSAPadding::PKCS1_OAEP) const;
	inline ssize_t encrypt(char* obuf, size_t* olen, const std::string& in, ssl::RSAPadding pt = ssl::RSAPadding::PKCS1_OAEP) const { return this->encrypt(obuf, olen, in.c_str(), in.size(), pt); }

	ssize_t decrypt(std::ostream& os, const void* in, size_t ilen, ssl::RSAPadding pt = ssl::RSAPadding::PKCS1_OAEP) const;
	inline ssize_t decrypt(std::ostream& os, const std::string& in, ssl::RSAPadding pt = ssl::RSAPadding::PKCS1_OAEP) const { return this->decrypt(os, in.c_str(), in.size(), pt); }
	ssize_t decrypt(std::string& os, const void* in, size_t ilen, ssl::RSAPadding pt = ssl::RSAPadding::PKCS1_OAEP) const;
	inline ssize_t decrypt(std::string& os, const std::string& in, ssl::RSAPadding pt = ssl::RSAPadding::PKCS1_OAEP) const { return this->decrypt(os, in.c_str(), in.size(), pt); }
	ssize_t decrypt(char* obuf, size_t* olen, const void* in, size_t ilen, ssl::RSAPadding pt = ssl::RSAPadding::PKCS1_OAEP) const;
	inline ssize_t decrypt(char* obuf, size_t* olen, const std::string& in, ssl::RSAPadding pt = ssl::RSAPadding::PKCS1_OAEP) const { return this->decrypt(obuf, olen, in.c_str(), in.size(), pt); }

public:
	inline bool isRSA(void) const { return (getType() == ssl::AsymKeyAlg::RSA); }
	inline bool isDH(void) const { return (getType() == ssl::AsymKeyAlg::DH); }
	inline bool isDSA(void) const { return (getType() == ssl::AsymKeyAlg::DSA); }
	inline bool isEC(void) const { return (getType() == ssl::AsymKeyAlg::EC); }

	inline void* getRawData(void) { return m_pkey; }
	inline const void* getRawData(void) const { return m_pkey; }

private:
	inline explicit SslAsymmetricKey() = default;

	SslAsymmetricKey(const SslAsymmetricKey&) = delete;
	SslAsymmetricKey(SslAsymmetricKey&&) = delete;
	SslAsymmetricKey& operator = (const SslAsymmetricKey&) = delete;
	SslAsymmetricKey& operator = (SslAsymmetricKey&&) = delete;

private:
	using out_type = char*;

	bool _enc(out_type& ostr, size_t& olen, const void* in, size_t ilen, ssl::RSAPadding pt, bool direction) const;
	void* _write_priv_pem(out_type& ostr, size_t& olen, crypto::CipherType ct, const blob_type* key, const blob_type* passwd) const;
	void* _write_pub_pem(out_type& ostr, size_t& olen) const;

private:
	void* m_pkey = nullptr;

friend class SslContext;
friend class SslSign;
friend class SslVerify;
};

//! \brief SslAsymmetricKey를 이용한 디지털 서명
class SslSign final
{
public:
	static SslSign* s_createRSA_PKCS1(SslAsymmetricKey& pkey, digest::DigestType ht = ssl::getDefaultSignHash());
	static SslSign* s_createRSA_X931(SslAsymmetricKey& pkey, digest::DigestType ht = ssl::getDefaultSignHash());
	static SslSign* s_createRSA_PKCS1_PSS(SslAsymmetricKey& pkey, digest::DigestType ht = ssl::getDefaultSignHash(), size_t saltlen = ssl::getDefaultRSA_PSS_SaltSize());
	static inline void s_release(SslSign* p) { delete p; }

	~SslSign();

public:
	inline void release(void) { s_release(this); }

	bool update(const void* in, size_t ilen);
	inline bool update(const std::string& in) { return this->update(in.c_str(), in.size()); }

	bool finalize(void* out, size_t* olen);
	bool finalize(std::string& out);

	bool reinitialize(void);

	inline void* getRawData(void) { return m_ctx; }
	inline const void* getRawData(void) const { return m_ctx; }

	void* getRawDataMDContext(void);
	const void* getRawDataMDContext(void) const;
	const void* getRawDataMD(void) const;
	void* getRawDataAsymKey(void);
	const void* getRawDataAsymKey(void) const;

private:
	void* m_ctx = nullptr;

private:
	inline explicit SslSign() = default;

	SslSign(const SslSign&) = delete;
	SslSign(SslSign&&) = delete;
	SslSign& operator = (const SslSign&) = delete;
	SslSign& operator = (SslSign&&) = delete;
};

//! \brief SslAsymmetricKey를 이용한 디지털 서명 검증
class SslVerify final
{
public:
	static SslVerify* s_createRSA_PKCS1(SslAsymmetricKey& pkey, digest::DigestType ht = ssl::getDefaultSignHash());
// 	static SslVerify* s_createRSA_X931(SslAsymmetricKey& pkey, hash::DigestType ht = ssl::getDefaultSignHash());
	static SslVerify* s_createRSA_PKCS1_PSS(SslAsymmetricKey& pkey, digest::DigestType ht = ssl::getDefaultSignHash(), size_t saltlen = ssl::getDefaultRSA_PSS_SaltSize());
	static inline void s_release(SslVerify* p) { delete p; }

	~SslVerify();

public:
	inline void release(void) { s_release(this); }

	bool update(const void* in, size_t ilen);
	inline bool update(const std::string& in) { return this->update(in.c_str(), in.size()); }

	bool finalize(const void* sign, size_t sign_len);
	inline bool finalize(const std::string& sign) { return this->finalize(sign.c_str(), sign.size()); }

	bool reinitialize(void);

	inline void* getRawData(void) { return m_ctx; }
	inline const void* getRawData(void) const { return m_ctx; }

	void* getRawDataMDContext(void);
	const void* getRawDataMDContext(void) const;
	const void* getRawDataMD(void) const;
	void* getRawDataAsymKey(void);
	const void* getRawDataAsymKey(void) const;

private:
	void* m_ctx = nullptr;

private:
	inline explicit SslVerify() = default;

	SslVerify(const SslVerify&) = delete;
	SslVerify(SslVerify&&) = delete;
	SslVerify& operator = (const SslVerify&) = delete;
	SslVerify& operator = (SslVerify&&) = delete;
};

};//namespace pw

#endif//__PW_SSL_H__


text:
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
  xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Labspace</title>
    <link>rodolfolab.github.io</link>
    <description>Blog criado para divulgar diversos estudos no universo da tecnologia</description>
    <pubDate>Mon, 14 Dec 2015 12:30:00 -0300</pubDate>
    <item>
      <title>Hello Word - Uma Jornada para o infinito</title>
      <link>rodolfolab.github.io/hello/word/intro/2015/12/14/welcome-to-jekyll.html</link>
      <description>
Ola, antes de começar com este hello word que descreve o motivo pelo qual eu criei este blog, é melhor eu me apresentar:

</description>
      <pubDate>Mon, 14 Dec 2015 12:30:00 -0300</pubDate>
      <dc:date>2015-12-14T12:30:00-03:00</dc:date>
    </item>
    <dc:date>2015-12-14T12:30:00-03:00</dc:date>
  </channel>
</rss>

redpajama_set_name: RedPajamaGithub


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W29841_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans6.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">10/1612014

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">GEOLOGEC PROGNDSIS

    <p class="styleSans9.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Weli Name: Maynor3-35H Rig: Cyclone 33 Prospect: Williston Target: Middle Bakken Spacing: 1280

    <p class="styleSans313.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">[1' Pre—Staked '

El Staked Rig Grade Elevation: 2224' KB: 20' RKB: 2244' _FORMATIN '    UBSA  TVD

m umumum: ' mm: -—— ———w

    <p class="styleSans6.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Maynor 3—35H AFE V1

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">SHL: 1737' FSL Sec. 35
Williams
BHL: 660' FSL Sec. 36
Williams

    <p class="styleSans3.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">372' FWL
154N — 100W ND
200' FEL 154N - 100W
ND

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">


text: example code with python


text:
$(document).ready(function() {

    // create a 'smart' resize function with debounce
    (function($,sr){
        // debouncing function from John Hann: http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
        var debounce = function (func, threshold, execAsap) {
            var timeout;
            return function debounced () {
                var obj = this, args = arguments;
                function delayed () {
                    if (!execAsap) { func.apply(obj, args); };
                    timeout = null;
                };
                if (timeout) { clearTimeout(timeout); }
                else if (execAsap) { func.apply(obj, args); };
                timeout = setTimeout(delayed, threshold || 100);
          };
        };
        // smartresize via Paul Irish http://www.paulirish.com/2009/throttled-smartresize-jquery-event-handler/
        jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); };
    })(jQuery,'smartresize');

    // create the state-indicator element
    var stateIndicator = document.createElement('div');
    stateIndicator.className = 'state-indicator';
    document.body.appendChild(stateIndicator);

    // Create a method which returns device state
    function getDeviceState() {
       return parseInt(window.getComputedStyle(stateIndicator).getPropertyValue('z-index'), 10);
    };

    // JS events that you want to trigger go here. The case statements should correspond to your breakpoints.
    function jsMediaQuery(deviceState) {
        switch (deviceState) {
            default: // this is where you reset things to the default state
                if (deviceState >= 1025) {
                    $('.blockone').insertBefore('.blocktwo');
                };
                $('body').removeClass();
                break;
            case 1024:
                if ($('body.is1024').length) { // Things that happen on every resize go here (rare, but nice to have the option)
                } else { // the 'run once' events
                    // set a class to prevent firing events repeatedly at this size.
                    $('body').removeClass().addClass('is1024');
                    // now you add the actions you want:
                    $('.blockone').insertAfter('.blockthree');
                };
                break;
            case 640:
                if ($('body.is640').length) {
                } else {
                    $('body').removeClass().addClass('is640');
                    $('.blockone').insertBefore('.blockthree');
                };
                break;
            case 480:
                if ($('body.is480').length) {
                } else {
                    $('body').removeClass().addClass('is480');
                    $('.blockone').insertBefore('.blocktwo');
                };
                break;
        }
    };

    // Fire!
    $(window).smartresize(function(){
        var state = getDeviceState(),
        lastDeviceState;
        if(state != lastDeviceState) {
            lastDeviceState = state;
        }
        jsMediaQuery(getDeviceState());
    });

    jsMediaQuery(getDeviceState());

});


text:
namespace arangodb {

// identical code to RecursiveWriteLocker except for type
template<typename T>
class RecursiveMutexLocker {
 public:
  RecursiveMutexLocker(T& mutex, std::atomic<std::thread::id>& owner,
                       arangodb::basics::LockerType type, bool acquire,
                       char const* file, int line)
      : _locked(false),
        _locker(&mutex, type, false, file, line),  // does not lock yet
        _owner(owner),
        _update(noop) {
    if (acquire) {
      lock();
    }
  }

  ~RecursiveMutexLocker() { unlock(); }

  bool isLocked() const noexcept { return _locked; }

  void lock() {
    // recursive locking of the same instance is not yet supported (create a new
    // instance instead)
    TRI_ASSERT(_update != owned);

    if (std::this_thread::get_id() != _owner.load()) {  // not recursive
      _locker.lock();
      _owner.store(std::this_thread::get_id());
      _update = owned;
    }
    _locked = true;
  }

  void unlock() { _update(*this); }

 private:
  bool _locked;  // track locked state separately for recursive lock acquisition
  arangodb::basics::MutexLocker<T> _locker;
  std::atomic<std::thread::id>& _owner;
  void (*_update)(RecursiveMutexLocker& locker);

  static void noop(RecursiveMutexLocker&) noexcept {}
  static void owned(RecursiveMutexLocker& locker) noexcept {
    locker._owner.store(std::thread::id());
    locker._locker.unlock();
    locker._update = noop;
    locker._locked = false;
  }
};

#define NAME__(name, line) name##line
#define NAME_EXPANDER__(name, line) NAME__(name, line)
#define NAME(name) NAME_EXPANDER__(name, __LINE__)
#define RECURSIVE_MUTEX_LOCKER_NAMED(name, lock, owner, acquire)            \
  arangodb::RecursiveMutexLocker<typename std::decay<decltype(lock)>::type> \
      name(lock, owner, arangodb::basics::LockerType::BLOCKING, acquire,    \
           __FILE__, __LINE__)
#define RECURSIVE_MUTEX_LOCKER(lock, owner) \
  RECURSIVE_MUTEX_LOCKER_NAMED(NAME(RecursiveLocker), lock, owner, true)

template<typename T>
class RecursiveReadLocker {
 public:
  RecursiveReadLocker(T& mutex, std::atomic<std::thread::id>& owner,
                      char const* file, int line)
      : _locker(&mutex, arangodb::basics::LockerType::TRY, false, file,
                line) {  // does not lock yet
    if (owner.load() != std::this_thread::get_id()) {
      // only try to lock if we don't already have the write-lock
      _locker.lock();
    }
  }

 private:
  arangodb::basics::ReadLocker<T> _locker;
};

// identical code to RecursiveMutexLocker except for type
template<typename T>
class RecursiveWriteLocker {
 public:
  RecursiveWriteLocker(T& mutex, std::atomic<std::thread::id>& owner,
                       arangodb::basics::LockerType type, bool acquire,
                       char const* file, int line)
      : _locked(false),
        _locker(&mutex, type, false, file, line),
        _owner(owner),
        _update(noop) {
    if (acquire) {
      lock();
    }
  }

  ~RecursiveWriteLocker() { unlock(); }

  bool isLocked() const noexcept { return _locked; }

  void lock() {
    // recursive locking of the same instance is not yet supported (create a new
    // instance instead)
    TRI_ASSERT(_update != owned);

    if (std::this_thread::get_id() != _owner.load()) {  // not recursive
      _locker.lock();
      _owner.store(std::this_thread::get_id());
      _update = owned;
    }
    _locked = true;
  }

  void unlock() {
    _update(*this);
    _locked = false;
  }

 private:
  bool _locked;  // track locked state separately for recursive lock acquisition
  arangodb::basics::WriteLocker<T> _locker;
  std::atomic<std::thread::id>& _owner;
  void (*_update)(RecursiveWriteLocker& locker);

  static void noop(RecursiveWriteLocker&) noexcept {}
  static void owned(RecursiveWriteLocker& locker) noexcept {
    locker._owner.store(std::thread::id());
    locker._locker.unlock();
    locker._update = noop;
    locker._locked = false;
  }
};

#define NAME__(name, line) name##line
#define NAME_EXPANDER__(name, line) NAME__(name, line)
#define NAME(name) NAME_EXPANDER__(name, __LINE__)
#define RECURSIVE_READ_LOCKER(lock, owner)                                 \
  arangodb::RecursiveReadLocker<typename std::decay<decltype(lock)>::type> \
      NAME(RecursiveLocker)(lock, owner, __FILE__, __LINE__)
#define RECURSIVE_WRITE_LOCKER_NAMED(name, lock, owner, acquire)            \
  arangodb::RecursiveWriteLocker<typename std::decay<decltype(lock)>::type> \
      name(lock, owner, arangodb::basics::LockerType::BLOCKING, acquire,    \
           __FILE__, __LINE__)
#define RECURSIVE_WRITE_LOCKER(lock, owner) \
  RECURSIVE_WRITE_LOCKER_NAMED(NAME(RecursiveLocker), lock, owner, true)

}  // namespace arangodb


text:
#include "libtest/yatlcon.h"
#include <libtest/common.h>
#include "libtest/exception.hpp"
#include <cstdarg>

namespace libtest {

#pragma GCC diagnostic ignored "-Wformat-nonliteral"

fatal::fatal(const char *file_arg, int line_arg, const char *func_arg, ...) :
  libtest::exception(file_arg, line_arg, func_arg)
{
  va_list args;
  va_start(args, func_arg);
  init(args);
  va_end(args);
}

fatal::fatal( const fatal& other ) :
  libtest::exception(other)
{
}

static bool _disabled= false;
static uint32_t _counter= 0;

bool fatal::is_disabled() throw()
{
  return _disabled;
}

void fatal::disable() throw()
{
  _counter= 0;
  _disabled= true;
}

void fatal::enable() throw()
{
  _counter= 0;
  _disabled= false;
}

uint32_t fatal::disabled_counter() throw()
{
  return _counter;
}

void fatal::increment_disabled_counter() throw()
{
  _counter++;
}

#pragma GCC diagnostic ignored "-Wformat-nonliteral"
disconnected::disconnected(const char *file_arg, int line_arg, const char *func_arg,
                           const std::string& instance, const int port, ...) :
  libtest::exception(file_arg, line_arg, func_arg),
  _port(port)
{
  va_list args;
  va_start(args, port);
  const char *format= va_arg(args, const char *);
  char last_error[BUFSIZ];
  (void)vsnprintf(last_error, sizeof(last_error), format, args);
  va_end(args);

  char buffer_error[BUFSIZ];
  int error_length= snprintf(buffer_error, sizeof(buffer_error), "%s:%u %s", instance.c_str(), uint32_t(port), last_error);

  if (error_length > 0)
  {
    what(size_t(error_length), buffer_error);
  }
}

disconnected::disconnected(const disconnected& other):
  libtest::exception(other),
  _port(other._port)
{
  strncpy(_instance, other._instance, BUFSIZ);
}

} // namespace libtest


text:
ActiveRecord::Schema.define(:version => 20120829165609) do

  create_table "password_resets", :force => true do |t|
    t.string   "email"
    t.string   "password"
    t.string   "password_confirmation"
    t.string   "reset_token"
    t.datetime "reset_sent_at"
    t.integer  "user_id"
    t.datetime "created_at",            :null => false
    t.datetime "updated_at",            :null => false
  end

  create_table "users", :force => true do |t|
    t.string   "username"
    t.string   "email"
    t.string   "password_digest"
    t.datetime "created_at",      :null => false
    t.datetime "updated_at",      :null => false
  end

end


text:
@interface RYPoster ()

@end

@implementation RYPoster

+ (void)postStatuse {
    [RYRouter ryPresentVC:RY_ROUTER_VC_KEY_POSTSTATUSE
                   param:nil
                callBack:^(id obj) {

                }];
}

+ (void)repostStatuse:(RYStatuse *)statuse {

}

@end


text:
const Mock = require('mockjs')
const config = require('../utils/config')

const {
    apiPrefix
} = config

const crmaccmanag = Mock.mock({
    'data|100': [{
        companyName: '@title',
        industryName: '@word',
        contactor: '@first @last',
        contatorEmail: '@email',
        contactPhone: '@word',
        createTime: '@dateTime',
        validPeriod: '@dateTime',
        // [{
        //   moment: '@dateTime'
        // }, {
        //   moment: '@dateTime'
        // }],
        'limitAcctNum|10-200': 1,
        'status': '@boolean',
        customerId: '@id',
    }]
})

let database = crmaccmanag.data

module.exports = {

    [`GET ${apiPrefix}/crmaccmanag`](req, res) {
        const {
            query
        } = req
        let {
            pageSize,
            page,
            ...other
        } = query
        pageSize = pageSize || 10
        page = page || 1

        let newData = database
        for (let key in other) {
            if ({}.hasOwnProperty.call(other, key)) {
                newData = newData.filter((item) => {
                    if ({}.hasOwnProperty.call(item, key)) {
                        if (key === 'address') {
                            return other[key].every(iitem => item[key].indexOf(iitem) > -1)
                        } else if (key === 'createTime') {
                            const start = new Date(other[key][0]).getTime()
                            const end = new Date(other[key][1]).getTime()
                            const now = new Date(item[key]).getTime()

                            if (start && end) {
                                return now >= start && now <= end
                            }
                            return true
                        }
                        return String(item[key]).trim().indexOf(decodeURI(other[key]).trim()) > -1
                    }
                    return true
                })
            }
        }

        res.status(200).json({
            data: newData.slice((page - 1) * pageSize, page * pageSize),
            total: newData.length,
        })
    },

    [`POST ${apiPrefix}/crmaccmanag`](req, res) {
        const newData = req.body
        newData.createTime = Mock.mock('@now')
        newData.customerId = Mock.mock('@id')
        database.unshift(newData)

        res.status(200).end()
    },

    [`GET ${apiPrefix}/crmaccmanag/:customerId`](req, res) {
        const {
            customerId
        } = req.params
        const data = queryArray(database, customerId, 'customerId')
        if (data) {
            res.status(200).json(data)
        } else {
            res.status(404).json(NOTFOUND)
        }
    },

    [`DELETE ${apiPrefix}/crmaccmanag/:customerId`](req, res) {
        const {
            customerId
        } = req.params
        const data = queryArray(database, customercustomerId, 'customercustomerId')
        if (data) {
            database = database.filter(item => item.customerId !== customerId)
            res.status(204).end()
        } else {
            res.status(404).json(NOTFOUND)
        }
    },
    [`PATCH ${apiPrefix}/crmaccmanag/:customerId`](req, res) {
        const {
            customerId
        } = req.params
        const editItem = req.body
        let isExist = false

        database = database.map((item) => {
            if (item.customerId === customerId) {
                isExist = true
                return Object.assign({}, item, editItem)
            }
            return item
        })

        if (isExist) {
            res.status(201).end()
        } else {
            res.status(404).json(NOTFOUND)
        }
    },
}


text:
import axios from 'axios';
import { API } from '../../config/config';
import Moment from 'moment';

export const GET_SUPPLIERS_FULL_LIST = 'GET_SUPPLIERS_FULL_LIST';
export const CREATE_SUPPLIER = 'CREATE_SUPPLIER';
export const UPDATE_SUPPLIER = 'UPDATE_SUPPLIER';
export const GET_SUPPLIER = 'GET_SUPPLIER';
export const DELETE_SUPPLIER = 'DELETE_SUPPLIER';

export function getSuppliersFullList() {
  return {
    type: GET_SUPPLIERS_FULL_LIST,
    payload: axios.get(`${API.ROOT_URL}${API.ENDPOINTS.SUPPLIERS}`, {
      headers: {
        authorization: localStorage.getItem('token')
      }
    })
  }
}

export function createSupplier(props) {
  return {
    type: CREATE_SUPPLIER,
    payload: axios.post(`${API.ROOT_URL}${API.ENDPOINTS.SUPPLIERS}`, props, {
      headers: {
        authorization: localStorage.getItem('token')
      }
    })
  }
}

export function updateSupplier(props, id) {
  return {
    type: UPDATE_SUPPLIER,
    payload: axios.put(`${API.ROOT_URL}${API.ENDPOINTS.SUPPLIERS}/${id}`, props, {
      headers: {
        authorization: localStorage.getItem('token')
      }
    })
  }
}

export function getSupplier(id) {
  return {
    type: GET_SUPPLIER,
    payload: axios.get(`${API.ROOT_URL}${API.ENDPOINTS.SUPPLIERS}/${id}`, {
      headers: {
        authorization: localStorage.getItem('token')
      }
    })
  }
}

export function deleteSupplier(supplier) {
  if(supplier !== '') {
    return {
      type: DELETE_SUPPLIER,
      payload: axios.delete(`${API.ROOT_URL}${API.ENDPOINTS.SUPPLIERS}/${supplier}`, {
        headers: {
          authorization: localStorage.getItem('token')
        }
      })
    }
  }
}


text:
pfUI:RegisterSkin("Spellbook", "vanilla:tbc", function ()
  local rawborder, border = GetBorderSize()
  local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()

  StripTextures(SpellBookFrame)
  CreateBackdrop(SpellBookFrame, nil, nil, .75)
  CreateBackdropShadow(SpellBookFrame)

  SpellBookFrame.backdrop:SetPoint("TOPLEFT", 12, -12)
  SpellBookFrame.backdrop:SetPoint("BOTTOMRIGHT", -30, 72)
  SpellBookFrame:SetHitRectInsets(12,30,12,72)
  EnableMovable(SpellBookFrame)

  SpellBookTitleText:ClearAllPoints()
  SpellBookTitleText:SetPoint("TOP", SpellBookFrame.backdrop, "TOP", 0, -10)

  SpellBookFrameTabButton1:ClearAllPoints()
  SpellBookFrameTabButton1:SetPoint("TOPLEFT", SpellBookFrame.backdrop, "BOTTOMLEFT", bpad, -(border + (border == 1 and 1 or 2)))
  for i=1, 3 do
    local tab = _G["SpellBookFrameTabButton"..i]
    local lastTab = _G["SpellBookFrameTabButton"..(i-1)]
    if lastTab then
      tab:ClearAllPoints()
      tab:SetPoint("LEFT", lastTab, "RIGHT", border*2 + 1, 0)
    end
    SkinTab(tab)
  end

  for i=1,SPELLS_PER_PAGE do
    local button = _G["SpellButton"..i]
    local texture = _G["SpellButton"..i.."IconTexture"]

    StripTextures(button)
    SkinButton(button, nil, nil, nil, texture)

    _G["SpellButton"..i.."SubSpellName"]:SetTextColor(1, 1, 1)
    _G["SpellButton"..i.."AutoCastable"]:SetTexture("Interface\\Buttons\\UI-AutoCastableOverlay")
    _G["SpellButton"..i.."Highlight"]:SetTexture("")
    _G["SpellButton"..i.."Highlight"].SetTexture = function(self, tex) return end
  end

  SpellBookSkillLineTab1:ClearAllPoints()
  SpellBookSkillLineTab1:SetPoint("TOPLEFT", SpellBookFrame.backdrop, "TOPRIGHT", border + (border == 1 and 1 or 2), -30)
  for i = 1, MAX_SKILLLINE_TABS do
    local button = _G["SpellBookSkillLineTab"..i]
    local lastbutton = _G["SpellBookSkillLineTab"..(i-1)]
    local texture = _G["SpellBookSkillLineTab"..i]:GetNormalTexture()

    StripTextures(button)
    SkinButton(button, nil, nil, nil, texture)

    button:SetScale(1.1)
    texture:SetTexCoord(.07,.93,.07,.93)

    if lastbutton then
      button:ClearAllPoints()
      button:SetPoint("TOP", lastbutton, "BOTTOM", 0, - (border + (border == 1 and 1 or 2) + bpad))
    end
  end

  SkinArrowButton(SpellBookPrevPageButton, "left", 18)
  SkinArrowButton(SpellBookNextPageButton, "right", 18)

  SkinCloseButton(SpellBookCloseButton, SpellBookFrame.backdrop, -6, -6)
  SpellBookPageText:SetTextColor(1, 1, 1)
end)


text:
package org.jetbrains.plugins.scala
package lang.completion3

import com.intellij.codeInsight.completion.CompletionType
import org.jetbrains.plugins.scala.codeInsight.ScalaCodeInsightTestBase

/**
 * @author Alefas
 * @since 04.09.13
 */
class ScalaSuperParametersTest extends ScalaCodeInsightTestBase {
  def testConstructorCall() {
    val fileText =
      """
class TUI {
  class A(x: Int, y: Int) {
    def this(x: Int, y: Int, z: Int) = this(x, y)
  }

  class B(x: Int, y: Int, z: Int) extends A(<caret>)
}
      """.replaceAll("\r", "").trim()
    configureFromFileTextAdapter("dummy.scala", fileText)
    val (activeLookup, _) = complete(1, CompletionType.BASIC)

    val resultText =
      """
class TUI {
  class A(x: Int, y: Int) {
    def this(x: Int, y: Int, z: Int) = this(x, y)
  }

  class B(x: Int, y: Int, z: Int) extends A(x, y, z)<caret>
}
      """.replaceAll("\r", "").trim()

    completeLookupItem(activeLookup.find(le => le.getLookupString == "x, y, z").get)
    checkResultByText(resultText)
  }

  def testConstructorCall2() {
    val fileText =
      """
class TUI {
  class A(x: Int, y: Int) {
    def this(x: Int, y: Int, z: Int) = this(x, y)
  }

  class B(x: Int, y: Int, z: Int) extends A(<caret>)
}
      """.replaceAll("\r", "").trim()
    configureFromFileTextAdapter("dummy.scala", fileText)
    val (activeLookup, _) = complete(1, CompletionType.BASIC)

    val resultText =
      """
class TUI {
  class A(x: Int, y: Int) {
    def this(x: Int, y: Int, z: Int) = this(x, y)
  }

  class B(x: Int, y: Int, z: Int) extends A(x, y)<caret>
}
      """.replaceAll("\r", "").trim()

    completeLookupItem(activeLookup.find(le => le.getLookupString == "x, y").get)
    checkResultByText(resultText)
  }

  def testConstructorCall2Smart() {
    val fileText =
      """
class TUI {
  class A(x: Int, y: Int) {
    def this(x: Int, y: Int, z: Int) = this(x, y)
  }

  class B(x: Int, y: Int, z: Int) extends A(<caret>)
}
      """.replaceAll("\r", "").trim()
    configureFromFileTextAdapter("dummy.scala", fileText)
    val (activeLookup, _) = complete(1, CompletionType.SMART)

    val resultText =
      """
class TUI {
  class A(x: Int, y: Int) {
    def this(x: Int, y: Int, z: Int) = this(x, y)
  }

  class B(x: Int, y: Int, z: Int) extends A(x, y)<caret>
}
      """.replaceAll("\r", "").trim()

    completeLookupItem(activeLookup.find(le => le.getLookupString == "x, y").get)
    checkResultByText(resultText)
  }

  def testSuperCall() {
    val fileText =
      """
class TUI {
  class A {
    def foo(x: Int, y: Int, z: Int) = 1
    def foo(x: Int, y: Int) = 2
  }

  class B extends A {
    override def foo(x: Int, y: Int, z: Int) = {
      super.foo(<caret>)
    }
  }
}
      """.replaceAll("\r", "").trim()
    configureFromFileTextAdapter("dummy.scala", fileText)
    val (activeLookup, _) = complete(1, CompletionType.BASIC)

    val resultText =
      """
class TUI {
  class A {
    def foo(x: Int, y: Int, z: Int) = 1
    def foo(x: Int, y: Int) = 2
  }

  class B extends A {
    override def foo(x: Int, y: Int, z: Int) = {
      super.foo(x, y)<caret>
    }
  }
}
      """.replaceAll("\r", "").trim()

    completeLookupItem(activeLookup.find(le => le.getLookupString == "x, y").get)
    checkResultByText(resultText)
  }

  def testSuperCall2() {
    val fileText =
      """
class TUI {
  class A {
    def foo(x: Int, y: Int, z: Int) = 1
    def foo(x: Int, y: Int) = 2
  }

  class B extends A {
    override def foo(x: Int, y: Int, z: Int) = {
      super.foo(<caret>)
    }
  }
}
      """.replaceAll("\r", "").trim()
    configureFromFileTextAdapter("dummy.scala", fileText)
    val (activeLookup, _) = complete(1, CompletionType.BASIC)

    val resultText =
      """
class TUI {
  class A {
    def foo(x: Int, y: Int, z: Int) = 1
    def foo(x: Int, y: Int) = 2
  }

  class B extends A {
    override def foo(x: Int, y: Int, z: Int) = {
      super.foo(x, y, z)<caret>
    }
  }
}
      """.replaceAll("\r", "").trim()

    completeLookupItem(activeLookup.find(le => le.getLookupString == "x, y, z").get)
    checkResultByText(resultText)
  }

}


text:
package org.grobid.core.engines;

import java.io.Closeable;
import java.io.IOException;
import java.util.StringTokenizer;

import org.chasen.crfpp.Model;
import org.chasen.crfpp.Tagger;
import org.grobid.core.GrobidModels;
import org.grobid.core.exceptions.GrobidException;
import org.grobid.core.utilities.counters.CntManager;
import org.grobid.core.utilities.counters.impl.CntManagerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public abstract class AbstractParser implements Closeable {
    private static final Logger LOGGER = LoggerFactory.getLogger(AbstractParser.class);
    private final Model model;
    protected CntManager cntManager = CntManagerFactory.getNoOpCntManager();

//    protected Tagger tagger;

    protected AbstractParser(GrobidModels model) {
        this(model, CntManagerFactory.getNoOpCntManager());
    }

    protected AbstractParser(GrobidModels model, CntManager cntManager) {
        this.cntManager = cntManager;
        this.model = ModelMap.getModel(model);
//		tagger = createTagger(model);
    }

//	public Tagger getTagger() {
//		return tagger;
//	}

    // TODO: VZ: Switch to String iterables

    protected String getTaggerResult(StringTokenizer st) {
        return getTaggerResult(st, null);
    }

    protected String getTaggerResult(StringTokenizer st, String type) {
        Tagger tagger = null;
        StringBuilder res;
        try {
            tagger = feedTaggerAndParse(st);

            res = new StringBuilder();
            for (int i = 0; i < tagger.size(); i++) {
                for (int j = 0; j < tagger.xsize(); j++) {
                    res.append(tagger.x(i, j)).append("\t");
                }

                if (type != null) {
                    res.append(type).append("\t");
                }

                res.append(tagger.y2(i));
                res.append("\n");
            }
        } finally {
            if (tagger != null) {
                tagger.delete();
            }
        }

        return res.toString();
    }

    private Tagger feedTaggerAndParse(StringTokenizer st) {
        Tagger tagger = getNewTagger();
        feedTaggerAndParse(tagger, st);
        return tagger;
    }

//	protected void feedTagger(StringTokenizer st) {
//        Tagger tagger = getNewTagger();
//		feedTagger(tagger, st);
//        tagger.delete();
//	}

    public Tagger getNewTagger() {
        return model.createTagger();
    }

    public static void feedTaggerAndParse(Tagger tagger, StringTokenizer st) {
        tagger.clear();
        feedTagger(tagger, st);
        if (!tagger.parse()) {
            throw new GrobidException("CRF++ parsing failed.");
        }

        if (!tagger.what().isEmpty()) {
            LOGGER.warn("CRF++ Tagger Warnings: " + tagger.what());
        }
    }

    private static void feedTagger(Tagger tagger, StringTokenizer st) {
        while (st.hasMoreTokens()) {
            String piece = st.nextToken();
            if (piece.trim().isEmpty()) {
                continue;
            }
            if (!tagger.add(piece)) {
                LOGGER.warn("CRF++ Tagger Warnings: " + tagger.what());
                throw new GrobidException("Cannot add a feature row: " + piece
                        + "\n Reason: " + tagger.what());
            }
        }
    }

    public static Tagger createTagger(GrobidModels model) {
        return ModelMap.getTagger(model);
    }

    @Override
    public void close() throws IOException {
//		if (tagger != null) {
//			tagger.clear();
//			tagger.delete();
//		}
//		tagger = null;
    }
}


text:
package org.uberfire.client.workbench.widgets.split;

import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style;
import com.google.gwt.dom.client.Style.Position;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DockLayoutPanel;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.RequiresResize;
import com.google.gwt.user.client.ui.SplitLayoutPanel;
import com.google.gwt.user.client.ui.Widget;
import org.uberfire.client.resources.WorkbenchResources;
import org.uberfire.client.workbench.widgets.listbar.ResizeFlowPanel;
import org.uberfire.workbench.model.CompassPosition;

/**
 * A panel that adds user-positioned splitters between each of its child
 * widgets.
 *

 * This is a fork of the standard SplitLayoutPanel with the following changes:-
 *

 *
http://code.google.com/p/google-web-toolkit/issues/detail?id=7135

 *

 *

 *

 * This panel is used in the same way as {@link DockLayoutPanel}, except that
 * its children's sizes are always specified in {@link Unit#PX} units, and each
 * pair of child widgets has a splitter between them that the user can drag.
 *

 *

 * This widget will only work in standards mode, which requires that
 * the HTML page in which it is run have an explicit <!DOCTYPE>
 * declaration.
 *

 *
CSS Style Rules

 *

 *
.gwt-SplitLayoutPanel { the panel itself }

 *
.gwt-SplitLayoutPanel .gwt-SplitLayoutPanel-HDragger { horizontal dragger
 * }

 *
.gwt-SplitLayoutPanel .gwt-SplitLayoutPanel-VDragger { vertical dragger }
 *

 *

 *

 *
Example
 {@example com.google.gwt.examples.SplitLayoutPanelExample}
 *

 */
public class WorkbenchSplitLayoutPanel extends DockLayoutPanel {

    class HSplitter extends Splitter {
        public HSplitter(Widget target,
                         boolean reverse) {
            super( target,
                   reverse );
            setStyleName(WorkbenchResources.INSTANCE.CSS().splitLayoutPanelHDragger());
        }

        @Override
        protected void setUpHoverStyle( final Style style, int size ) {
            style.setWidth( size, Unit.PX );
            style.setMarginLeft( - (size/2), Unit.PX );
        }

        @Override
        public void onResize() {
            hover.getElement().getStyle().setHeight( target.getOffsetHeight(), Unit.PX );
        }

        @Override
        protected Style.Cursor getHoverCursorStyle() {
            return Style.Cursor.COL_RESIZE;
        }

        @Override
        protected int getAbsolutePosition() {
            return getAbsoluteLeft();
        }

        @Override
        protected double getCenterSize() {
            return getCenterWidth();
        }

        @Override
        protected int getEventPosition(Event event) {
            return event.getClientX();
        }

        @Override
        protected int getTargetPosition() {
            return target.getAbsoluteLeft();
        }

        @Override
        protected int getTargetSize() {
            return target.getOffsetWidth();
        }
    }

    abstract class Splitter extends Composite implements RequiresResize {
        protected final Widget target;
        protected final Widget hover;
        protected final Element mouseTracker;

        private int              offset;
        private boolean          mouseDown;
        private ScheduledCommand layoutCommand;

        private final boolean    reverse;
        private int              minSize;

        private double           centerSize, syncedCenterSize;

        public Splitter(Widget target,
                        boolean reverse) {
            this.target = target;
            this.reverse = reverse;

            final ResizeFlowPanel widget = new ResizeFlowPanel();

            sinkEvents( Event.ONMOUSEDOWN | Event.ONMOUSEUP | Event.ONMOUSEMOVE | Event.ONDBLCLICK );

            this.hover = new FlowPanel();
            final Style style = hover.getElement().getStyle();
            style.setOpacity( 0 );
            style.setZIndex( 2 );
            style.setPosition( Position.FIXED );
            setUpHoverStyle( style, DEFAULT_SPLITTER_HOVER_SIZE );
            widget.add( hover );
            initWidget( widget );

            mouseTracker = Document.get().createDivElement();
            mouseTracker.getStyle().setCursor( getHoverCursorStyle() );
            mouseTracker.getStyle().setZIndex( Integer.MAX_VALUE );
            mouseTracker.getStyle().setPosition( Position.ABSOLUTE );
            mouseTracker.getStyle().setHeight( 50, Unit.PX );
            mouseTracker.getStyle().setWidth( 50, Unit.PX );
        }

        @Override
        public void onBrowserEvent(final Event event) {
            switch ( event.getTypeInt() ) {
                case Event.ONMOUSEDOWN :
                    mouseDown = true;
                    /*
                     * Resize glassElem to take up the entire scrollable window
                     * area, which is the greater of the scroll size and the
                     * client size.
                     */
                    int width = Math.max( Window.getClientWidth(),
                                          Document.get().getScrollWidth() );
                    int height = Math.max( Window.getClientHeight(),
                                           Document.get().getScrollHeight() );
                    glassElem.getStyle().setHeight( height,
                                                    Unit.PX );
                    glassElem.getStyle().setWidth( width,
                                                   Unit.PX );
                    Document.get().getBody().appendChild( glassElem );

                    offset = getEventPosition( event ) - getAbsolutePosition();
                    Event.setCapture( getElement() );
                    event.preventDefault();

                    Document.get().getBody().appendChild( mouseTracker );
                    break;

                case Event.ONMOUSEUP :
                    mouseDown = false;

                    glassElem.removeFromParent();

                    Event.releaseCapture( getElement() );
                    event.preventDefault();

                    mouseTracker.removeFromParent();
                    break;

                case Event.ONMOUSEMOVE :
                    if ( mouseDown ) {
                        int size;
                        if ( reverse ) {
                            size = getTargetPosition() + getTargetSize()
                                    - getEventPosition( event ) - offset;
                        } else {
                            size = getEventPosition( event ) - getTargetPosition() - offset;
                        }
                        setAssociatedWidgetSize( size );
                        event.preventDefault();

                        mouseTracker.getStyle().setLeft( event.getClientX() - mouseTracker.getOffsetWidth() / 2, Unit.PX );
                        mouseTracker.getStyle().setTop( event.getClientY() - mouseTracker.getOffsetHeight() / 2, Unit.PX );
                    }
                    break;
            }
        }

        public void setMinSize(int minSize) {
            this.minSize = minSize;
            LayoutData layout = (LayoutData) target.getLayoutData();

            // Try resetting the associated widget's size, which will enforce the new
            // minSize value.
            setAssociatedWidgetSize( (int) layout.size );
        }

        protected abstract void setUpHoverStyle(Style style, int size);

        protected abstract Style.Cursor getHoverCursorStyle();

        protected abstract int getAbsolutePosition();

        protected abstract double getCenterSize();

        protected abstract int getEventPosition(Event event);

        protected abstract int getTargetPosition();

        protected abstract int getTargetSize();

        private double getMaxSize() {
            // To avoid seeing stale center size values due to deferred layout
            // updates, maintain our own copy up to date and resync when the
            // DockLayoutPanel value changes.
            double newCenterSize = getCenterSize();
            if ( syncedCenterSize != newCenterSize ) {
                syncedCenterSize = newCenterSize;
                centerSize = newCenterSize;
            }

            return Math.max( ((LayoutData) target.getLayoutData()).size + centerSize,
                             0 );
        }

        private void setAssociatedWidgetSize(double size) {
            double maxSize = getMaxSize();
            if ( size > maxSize ) {
                size = maxSize;
            }

            if ( size < minSize ) {
                size = minSize;
            }

            LayoutData layout = (LayoutData) target.getLayoutData();
            if ( size == layout.size ) {
                return;
            }

            double newCenterSize = centerSize + (layout.size - size);
            if ( newCenterSize < minCenterSize ) {
                return;
            }

            // Adjust our view until the deferred layout gets scheduled.
            centerSize += layout.size - size;
            centerSize = newCenterSize;
            layout.size = size;

            // Defer actually updating the layout, so that if we receive many
            // mouse events before layout/paint occurs, we'll only update once.
            if ( layoutCommand == null ) {
                layoutCommand = new Command() {
                    @Override
                    public void execute() {
                        layoutCommand = null;
                        forceLayout();
                    }
                };
                Scheduler.get().scheduleDeferred( layoutCommand );
            }
        }
    }

    class VSplitter extends Splitter {
        public VSplitter(Widget target,
                         boolean reverse) {
            super( target,
                   reverse );
            setStyleName(WorkbenchResources.INSTANCE.CSS().splitLayoutPanelVDragger());
        }

        @Override
        protected void setUpHoverStyle( final Style style, int size ) {
            style.setHeight( size, Unit.PX );
            style.setMarginTop( -( size / 2 ), Unit.PX );
        }

        @Override
        public void onResize() {
            hover.getElement().getStyle().setWidth( target.getOffsetWidth(), Unit.PX );
        }

        @Override
        protected Style.Cursor getHoverCursorStyle() {
            return Style.Cursor.ROW_RESIZE;
        }

        @Override
        protected int getAbsolutePosition() {
            return getAbsoluteTop();
        }

        @Override
        protected double getCenterSize() {
            return getCenterHeight();
        }

        @Override
        protected int getEventPosition(Event event) {
            return event.getClientY();
        }

        @Override
        protected int getTargetPosition() {
            return target.getAbsoluteTop();
        }

        @Override
        protected int getTargetSize() {
            return target.getOffsetHeight();
        }
    }

    private static final int DEFAULT_SPLITTER_SIZE = 1;
    private static final int DEFAULT_SPLITTER_HOVER_SIZE = 10;

    /**
     * The element that masks the screen so we can catch mouse events over
     * iframes.
     */
    private static Element   glassElem             = null;

    private final int        splitterSize;

    private int              minCenterSize         = 0;

    /**
     * Construct a new {@link SplitLayoutPanel} with the default splitter size
     * of 8px.
     */
    public WorkbenchSplitLayoutPanel() {
        this( DEFAULT_SPLITTER_SIZE );
    }

    /**
     * Construct a new {@link SplitLayoutPanel} with the specified splitter size
     * in pixels.
     *
     * @param splitterSize
     *            the size of the splitter in pixels
     */
    public WorkbenchSplitLayoutPanel(int splitterSize) {
        super( Unit.PX );
        this.splitterSize = splitterSize;
        setStyleName(WorkbenchResources.INSTANCE.CSS().splitLayoutPanel());

        if ( glassElem == null ) {
            glassElem = Document.get().createDivElement();
            glassElem.getStyle().setPosition( Position.ABSOLUTE );
            glassElem.getStyle().setTop( 0,
                                         Unit.PX );
            glassElem.getStyle().setLeft( 0,
                                          Unit.PX );
            glassElem.getStyle().setMargin( 0,
                                            Unit.PX );
            glassElem.getStyle().setPadding( 0,
                                             Unit.PX );
            glassElem.getStyle().setBorderWidth( 0,
                                                 Unit.PX );

            // We need to set the background color or mouse events will go right
            // through the glassElem. If the SplitPanel contains an iframe, the
            // iframe will capture the event and the slider will stop moving.
            glassElem.getStyle().setProperty( "background",
                    "white" );
            glassElem.getStyle().setOpacity( 0.0 );
        }
    }

    /**
     * Return the size of the splitter in pixels.
     *
     * @return the splitter size
     */
    public int getSplitterSize() {
        return splitterSize;
    }

    @Override
    public void insert(Widget child,
                       Direction direction,
                       double size,
                       Widget before) {
        super.insert( child,
                      direction,
                      size,
                      before );
        if ( direction != Direction.CENTER ) {
            insertSplitter( child,
                            before );
        }
    }

    @Override
    public boolean remove(Widget child) {
        assert !(child instanceof Splitter) : "Splitters may not be directly removed";

        int idx = getWidgetIndex( child );
        if ( super.remove( child ) ) {
            // Remove the associated splitter, if any.
            // Now that the widget is removed, idx is the index of the splitter.
            if ( idx < getWidgetCount() ) {
                // Call super.remove(), or we'll end up recursing.
                super.remove( getWidget( idx ) );
            }
            return true;
        }
        return false;
    }

    /**
     * Sets the minimum allowable size for the given widget.
     *

     * Its associated splitter cannot be dragged to a position that would make
     * it smaller than this size. This method has no effect for the
     * {@link DockLayoutPanel.Direction#CENTER} widget.
     *

     *
     * @param child
     *            the child whose minimum size will be set
     * @param minSize
     *            the minimum size for this widget
     */
    public void setWidgetMinSize(Widget child,
                                 int minSize) {
        assertIsAChild( child );
        Splitter splitter = getAssociatedSplitter( child );
        // The splitter is null for the center element.
        if ( splitter != null ) {
            splitter.setMinSize( minSize );
        } else {
            minCenterSize = minSize;
        }
    }

    private void assertIsAChild(Widget widget) {
        assert (widget == null) || (widget.getParent() == this) : "The specified widget is not a child of this panel";
    }

    private Splitter getAssociatedSplitter(Widget child) {
        // If a widget has a next sibling, it must be a splitter, because the only
        // widget that *isn't* followed by a splitter must be the CENTER, which has
        // no associated splitter.
        int idx = getWidgetIndex( child );
        if ( idx > -1 && idx < getWidgetCount() - 1 ) {
            Widget splitter = getWidget( idx + 1 );
            assert splitter instanceof Splitter : "Expected child widget to be splitter";
            return (Splitter) splitter;
        }
        return null;
    }

    private void insertSplitter(Widget widget,
                                Widget before) {
        assert getChildren().size() > 0 : "Can't add a splitter before any children";

        LayoutData layout = (LayoutData) widget.getLayoutData();
        Splitter splitter = null;
        switch ( getResolvedDirection( layout.direction ) ) {
            case WEST :
                splitter = new HSplitter( widget,
                                          false );
                break;
            case EAST :
                splitter = new HSplitter( widget,
                                          true );
                break;
            case NORTH :
                splitter = new VSplitter( widget,
                                          false );
                break;
            case SOUTH :
                splitter = new VSplitter( widget,
                                          true );
                break;
            default :
                assert false : "Unexpected direction";
        }

        super.insert( splitter,
                      layout.direction,
                      splitterSize,
                      before );
    }

    /**
     * Adds the given widget as a child of this splitter.
     *
     * @param child
     *            the widget to add
     * @param position
     *            the position to dock the widget at (must be an actual compass position NORTH, SOUTH, EAST, or WEST)
     * @param size
     *            the width or height to give the added child.
     */
    public void add( Widget child,
                     CompassPosition position,
                     double size ) {
        switch ( position ) {
            case NORTH:
                addNorth( child, size );
                break;
            case SOUTH:
                addSouth( child, size );
                break;
            case EAST:
                addEast( child, size );
                break;
            case WEST:
                addWest( child, size );
                break;
            default:
                throw new IllegalArgumentException( "Bad child position: " + position );
        }
    }

    /**
     * Adds the given widget as a child of this splitter.
     *
     * @param child
     *            the widget to add
     * @param position
     *            the position to dock the widget at (must be an actual compass position NORTH, SOUTH, EAST, or WEST)
     * @param size
     *            the width or height to give the added child
     */
    public void add( Widget child,
                     CompassPosition position,
                     int size ) {
        double doubleSize = (double) size;
        add( child, position, doubleSize );
    }
}


text:
import path from 'path'
import postcss from 'postcss'
import tailwind from '../../src'

export function run(input, config, plugin = tailwind) {
  let { currentTestName } = expect.getState()

  return postcss(plugin(config)).process(input, {
    from: `${path.resolve(__filename)}?test=${currentTestName}`,
  })
}

export let css = String.raw
export let html = String.raw
export let javascript = String.raw


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2009-2016 DigitalGlobe, Inc.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and limitations under the License.
  ~
  -->
<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.mrgeo</groupId>
    <artifactId>mrgeo</artifactId>
    <version>1.1.0-SNAPSHOT</version>
    <relativePath>../pom.xml</relativePath>
  </parent>
  <artifactId>mrgeo-dataprovider</artifactId>
  <version>1.1.0-SNAPSHOT</version>
  <name>mrgeo-dataprovider</name>
  <packaging>pom</packaging>
  <build>
  </build>
  <modules>
    <module>mrgeo-dataprovider-accumulo</module>
    <module>mrgeo-dataprovider-distribution</module>
  </modules>
  <profiles>
    <profile>
      <id>include-geowave</id>
      <modules>
        <module>mrgeo-dataprovider-geowave</module>
      </modules>
    </profile>
  </profiles>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <comments>A business-friendly OSS license</comments>
    </license>
  </licenses>
</project>


text:
import logging

from flask import g
from clint.textui import colored

from utils.datautils import thresholds

def context_id():
    return 'rqid', g.uuid.hex

class ColoredStreamHandler(logging.StreamHandler):
    def format(self, record):
        s = super(ColoredStreamHandler, self).format(record)
        return thresholds(record.levelno, (
            (colored.green, logging.INFO),
            (colored.blue, logging.WARNING),
            (colored.yellow, logging.ERROR),
            (colored.red, logging.CRITICAL)
        ), colored.magenta)(s)

class ContextFilter(logging.Filter):
    def filter(self, record):
        try:
            namespace, id = context_id()
            record.context_id = ':'.join((namespace, id[:6]))
        except RuntimeError:
            record.context_id = '<nocontext>'
        return True

def setup_logging(*roots, **kwargs):
    if not hasattr(setup_logging, 'configured_roots'):
        setup_logging.configured_roots = set()
    configured_roots = setup_logging.configured_roots
    if not configured_roots: # first invocation
        null_handler = logging.NullHandler()
        null_handler.set_name('null')
        logging.getLogger().addHandler(null_handler)
    level = kwargs.pop('level', logging.DEBUG)
    formatter = logging.Formatter('[%(process)05d/%(threadName)-10s] [%(levelno)02d] %(context_id)s '
                                  '%(name)-12s %(message)s')
    handler = ColoredStreamHandler()
    handler.setFormatter(formatter)
    handler.addFilter(ContextFilter())
    for root_name in {'jj'}.union(roots):
        if root_name in configured_roots:
            continue
        configured_roots.add(root_name)
        logger = logging.getLogger(root_name)
        logger.addHandler(handler)
        logger.setLevel(level)


text:
@implementation RNNBackButtonOptions

- (instancetype)initWithDict:(NSDictionary *)dict {
	self = [super init];

	self.icon = [ImageParser parse:dict key:@"icon"];
	self.title = [TextParser parse:dict key:@"title"];
	self.transition = [TextParser parse:dict key:@"transition"];
	self.color = [ColorParser parse:dict key:@"color"];
	self.showTitle = [BoolParser parse:dict key:@"showTitle"];
	self.visible = [BoolParser parse:dict key:@"visible"];

	return self;
}

@end


text:
"""
A connector to communicate with AWS.
"""
import os, time, uuid
import paramiko, json
import boto3
import subprocess as sp
from bssp.util import logger
from bssp.util import files

MOCK = False
SETTING_NAME = 'AWS'
ADVERTISER_CODE = '<<ADVERTISER_SHORT_NAME>>'
DEFAULT_ENV = 'DEV'
PROD_ENV = 'PROD'

def get_env():
	return os.getenv('ENV_NAME', DEFAULT_ENV)

def mock():
	global MOCK
	MOCK = True

if get_env() != PROD_ENV:
	mock()

def zonename():
	return os.getenv('AWS_ZONE_NAME', 'us-west-1')

def accesskey():
	return os.getenv('AWS_ACCESS_KEY_ID', 'notset')

def secretkey():
	return os.getenv('AWS_SECRET_ACCESS_KEY', 'notset')

def keyname():
	return os.getenv('AWS_EC2_KEY_NAME', 'notset')

def sshkeyfile():
	return os.getenv('AWS_SSH_KEY_FILE', 'notset')

def hadoopuser():
	return os.getenv('AWS_HADOOP_USER', 'notset')

def instancetype():
	return os.getenv('AWS_EMR_INSTANCE_TYPE', 'm3.xlarge')

def instancecount():
	return os.getenv('AWS_EMR_INSTANCE_COUNT', 1)

def releaselabel():
	return os.getenv('AWS_EMR_RELEASE_LABEL', 'emr-4.6.0')

def mockpath(bucketname = 'aiobj', keyname = ''):
	fulldir = os.path.join('/datavol/aiobj', bucketname, keyname)
	if os.path.isdir(fulldir):
		if not os.path.exists(fulldir):
			try:
				os.makedirs(fulldir)
			except:
				pass
	else:
		if not os.path.exists(os.path.dirname(fulldir)):
			try:
				os.makedirs(os.path.dirname(fulldir))
			except:
				pass
	return fulldir

def string_upload(strdata, bucketname, keyname):
	"""Upload a string to s3."""
	if MOCK:
		logger.info('MOCK AWS S3 string upload to: ' + bucketname + '/' + keyname)
		with open(mockpath(bucketname, keyname), 'w') as fout:
			fout.write(strdata)
			return
	logger.info('AWS S3 string upload to: ' + bucketname + '/' + keyname)
	boto3.resource('s3').Bucket(bucketname).put_object(Key = keyname, Body = strdata)

def file_upload(filepath, bucketname, keypath):
	"""Upload a file to s3 using boto."""
	filename = os.path.basename(filepath)
	if MOCK:
		logger.info('MOCK AWS S3 file upload: ' + filepath + ' to: ' + bucketname)
		files.copy(filepath, os.path.join(mockpath(bucketname, keypath), filename))
		return
	keyname = os.path.join(keypath, filename)
	logger.info('AWS S3 file upload: ' + filepath + ' to: ' + os.path.join(bucketname, keyname))
	boto3.resource('s3').Bucket(bucketname).upload_file(filepath, keyname)

def emrstatus(jobid):
	"""Get the status of an EMR job."""
	status = boto3.client('emr').describe_cluster(ClusterId = jobid)['Cluster']
	return status

def emrstate(jobid):
	"""Get the state of an EMR job."""
	return emrstatus(jobid)['Status']['State']

def emrmasterdns(jobid):
	"""Get the master node dn of an EMR job."""
	return emrstatus(jobid)['MasterPublicDnsName']

def emrssh(jobid):
	"""SSH connect to master EMR node."""
	hostname = emrmasterdns(jobid)
	ssh = paramiko.SSHClient()
	ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
	ssh.connect(hostname = hostname, username = hadoopuser(), key_filename = sshkeyfile(), timeout = 30)
	return ssh

def spark_cluster(instance_count = None, instance_type = None):
	"""Start up an EMR Spark cluster."""
	awscmd = 'aws emr create-cluster --name "SparkCluster" --release-label %s '
	awscmd += '--applications Name=Spark --ec2-attributes KeyName=%s --instance-type %s '
	awscmd += '--instance-count %s --use-default-roles '
	instance_type = instance_type or instancetype()
	instance_count = instance_count or instancecount()
	awscmd = awscmd % (releaselabel(), keyname(), instance_type, instance_count)
	resp = sp.check_output(awscmd, stderr = sp.STDOUT, shell = True)
	jobid = json.loads(resp.decode('utf-8'))['ClusterId']
	return jobid

def spark_execute(sparktxt, jobid):
	"""Execute a Spark script on EMR."""
	scriptname = str(uuid.uuid4()) + '.scala'
	string_upload(sparktxt, 'aiobj-code', scriptname)
	started = time.time()
	while True:
		time.sleep(10)
		state = emrstate(jobid)
		if state == 'WAITING':
			break
		if state == 'FAILED' or (time.time() - started) > 600:
			raise Exception('AWS Spark Job %s Failed!' % jobid)
	ssh = emrssh(jobid)
	ssh.exec_command('sudo nohup shutdown -h 54 &')
	ssh.exec_command('aws s3 cp s3://aiobj-code/%s .' % scriptname)
	ssh.exec_command('spark-shell -i %s' % scriptname)
	ssh.close()

def spark_run(sparktxt):
	"""Run Spark code on EMR"""
	jobid = spark_cluster()
	spark_execute(sparktxt, jobid)
	return jobid


text:
<archimate:Product
    xmlns:archimate="http://www.archimatetool.com/archimate"
    name="SoNIA"
    id="4ffdf624-2df0-4c25-aafe-dcc6d759e03f"
    documentation="SoNIA: a Java-based package for visualizing dynamic or longitudinal "network" data. It is released under the GNU GPL License.
at https://sourceforge.net/projects/sonia/
Seems not anymore in development. Standford page can't be accessed."/>


text:
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    style="@style/AppTheme"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingBottom="5dp"
    android:paddingLeft="25dp"
    android:paddingRight="25dp"
    android:paddingTop="10dp"
    tools:context="dev.android.combustivel.MainActivity"
    android:clickable="false"
    android:focusable="false"
    android:focusableInTouchMode="false"
    android:textAlignment="center"
    android:background="@android:color/background_light"
    >

    <EditText
        android:id="@+id/editText_gasolina"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="numberDecimal"
        android:longClickable="false"
        android:numeric="signed"
        android:textAlignment="center"
        android:textStyle="normal"
        android:paddingEnd="10dp"
        android:layout_marginTop="10dp"
        android:layout_below="@+id/textView_gasolina"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true"
        android:layout_marginRight="100dp"
        android:layout_marginBottom="10dp">

        <requestFocus />
    </EditText>

    <EditText
        android:id="@+id/editText_alcool"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="numberDecimal"
        android:numeric="signed"
        android:layout_below="@+id/textView_alcool"
        android:layout_alignLeft="@+id/editText_gasolina"
        android:layout_alignStart="@+id/editText_gasolina"
        android:layout_marginTop="10dp" />

    <TextView
        android:id="@+id/textView_preco_alcool"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/label_preco"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textStyle="italic"
        android:gravity="center"
        android:layout_marginLeft="100dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_alignBottom="@+id/editText_alcool"
        android:layout_alignTop="@+id/editText_alcool" />

    <TextView
        android:id="@+id/textView_alcool"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:layout_below="@+id/editText_gasolina"
        android:layout_centerHorizontal="true"
        android:text="@string/label_alcool"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textStyle="bold"
        android:textColor="@color/alcool_color"
        android:background="@drawable/abc_ab_stacked_transparent_light_holo"
        android:layout_marginTop="10dp" />

    <TextView
        android:id="@+id/textView_gasolina"
        android:layout_width="fill_parent"
        android:gravity="center"
        android:layout_height="wrap_content"
        android:text="@string/label_gasolina"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textStyle="bold"
        android:enabled="false"
        android:textColor="@color/gas_color"
        android:singleLine="true"
        android:layout_alignParentTop="true"
        android:background="@drawable/abc_ab_stacked_transparent_light_holo"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />

    <Button
        android:id="@+id/button_submit"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/button_submit"
        android:textStyle="bold"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true" />

    <TextView
        android:id="@+id/textView_preco_gasolina"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/label_preco"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textStyle="italic"
        android:enabled="true"
        android:focusable="false"
        android:gravity="center"
        android:layout_alignLeft="@+id/textView_preco_alcool"
        android:layout_alignStart="@+id/textView_preco_alcool"
        android:layout_alignTop="@+id/editText_gasolina"
        android:layout_alignBottom="@+id/editText_gasolina" />

    <ImageButton
        style="@style/AppTheme"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/imageButton_alcool"
        android:src="@android:drawable/ic_notification_clear_all"
        android:adjustViewBounds="true"
        android:background="@android:color/background_light"
        android:layout_alignTop="@+id/editText_alcool"
        android:layout_alignRight="@+id/editText_alcool"
        android:layout_alignEnd="@+id/button_submit" />

    <ImageButton
        style="@style/AppTheme"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/imageButton_gas"
        android:src="@android:drawable/ic_notification_clear_all"
        android:adjustViewBounds="true"
        android:background="@android:color/background_light"
        android:layout_alignTop="@+id/editText_gasolina"
        android:layout_alignRight="@+id/editText_gasolina" />

 </RelativeLayout>


text: ./generate_whitelist.sh $* > ipmiwhitelist.cpp


text:
package ieee13BusExampleThreePhaseInDevelopment;

import simulation.SimulationStarter;
import topology.ActorTopology;
import akka.actor.ActorSystem;
import akka.timeManagement.GlobalTime;

// This is executed with Eclipse
public class IEEE13Simulation {

	public static ActorTopology topology;
	private int startTimeStep = 1;
	private int maxTimeStep = 2;

	public void run(){
		topology = IEEE13BusTopology.createTopology();

		// TODO this example is not ready. It still needs some work! BE CAREFULL WHEN USING IT

		SimulationStarter.saveGridTopologyPlot(topology);
		SimulationStarter simulationStarter = new SimulationStarter(new GlobalTime());
        ActorSystem actorSystem = simulationStarter.initialiseActorSystem(topology);
        simulationStarter.startSimulation(actorSystem, startTimeStep, maxTimeStep);
	}

	public static void main(String[] args){
		new IEEE13Simulation().run();
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
  <Dependency>
    <ModuleName>Orchard.Themes</ModuleName>
    <VirtualPath>~/Modules/Orchard.Themes/bin/Orchard.Themes.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>CKEditor</ModuleName>
    <VirtualPath>~/Modules/CKEditor/CKEditor.csproj</VirtualPath>
    <LoaderName>DynamicExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>Orchard.Themes</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Themes/bin/Orchard.Themes.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Common</ModuleName>
    <VirtualPath>~/Core/Common</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Containers</ModuleName>
    <VirtualPath>~/Core/Containers</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Contents</ModuleName>
    <VirtualPath>~/Core/Contents</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>CyberStride.Contacts</ModuleName>
    <VirtualPath>~/Modules/CyberStride.Contacts/CyberStride.Contacts.csproj</VirtualPath>
    <LoaderName>DynamicExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Dashboard</ModuleName>
    <VirtualPath>~/Core/Dashboard</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Feeds</ModuleName>
    <VirtualPath>~/Core/Feeds</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Markdown</ModuleName>
    <VirtualPath>~/Modules/Markdown/bin/Markdown.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>MarkdownSharp</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Markdown/bin/MarkdownSharp.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Navigation</ModuleName>
    <VirtualPath>~/Core/Navigation</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>oforms</ModuleName>
    <VirtualPath>~/Modules/oforms/oforms.csproj</VirtualPath>
    <LoaderName>DynamicExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Alias</ModuleName>
    <VirtualPath>~/Modules/Orchard.Alias/bin/Orchard.Alias.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Tokens</ModuleName>
    <VirtualPath>~/Modules/Orchard.Tokens/bin/Orchard.Tokens.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Autoroute</ModuleName>
    <VirtualPath>~/Modules/Orchard.Autoroute/bin/Orchard.Autoroute.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>Orchard.Alias</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Alias/bin/Orchard.Alias.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Tokens</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Tokens/bin/Orchard.Tokens.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Blogs</ModuleName>
    <VirtualPath>~/Modules/Orchard.Blogs/bin/Orchard.Blogs.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.CodeGeneration</ModuleName>
    <VirtualPath>~/Modules/Orchard.CodeGeneration/Orchard.CodeGeneration.csproj</VirtualPath>
    <LoaderName>DynamicExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Comments</ModuleName>
    <VirtualPath>~/Modules/Orchard.Comments/bin/Orchard.Comments.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>Joel.Net.Akismet</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Comments/bin/Joel.Net.Akismet.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.ContentTypes</ModuleName>
    <VirtualPath>~/Modules/Orchard.ContentTypes/bin/Orchard.ContentTypes.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Scripting</ModuleName>
    <VirtualPath>~/Modules/Orchard.Scripting/bin/Orchard.Scripting.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Widgets</ModuleName>
    <VirtualPath>~/Modules/Orchard.Widgets/bin/Orchard.Widgets.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>Orchard.Scripting</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Scripting/bin/Orchard.Scripting.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Themes</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Themes/bin/Orchard.Themes.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.DesignerTools</ModuleName>
    <VirtualPath>~/Modules/Orchard.DesignerTools/Orchard.DesignerTools.csproj</VirtualPath>
    <LoaderName>DynamicExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>Orchard.Widgets</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Widgets/bin/Orchard.Widgets.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Email</ModuleName>
    <VirtualPath>~/Modules/Orchard.Email/Orchard.Email.csproj</VirtualPath>
    <LoaderName>DynamicExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Fields</ModuleName>
    <VirtualPath>~/Modules/Orchard.Fields/bin/Orchard.Fields.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Forms</ModuleName>
    <VirtualPath>~/Modules/Orchard.Forms/bin/Orchard.Forms.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.jQuery</ModuleName>
    <VirtualPath>~/Modules/Orchard.jQuery/bin/Orchard.jQuery.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Media</ModuleName>
    <VirtualPath>~/Modules/Orchard.Media/bin/Orchard.Media.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>ICSharpCode.SharpZipLib</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Media/bin/ICSharpCode.SharpZipLib.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.MediaPicker</ModuleName>
    <VirtualPath>~/Modules/Orchard.MediaPicker/bin/Orchard.MediaPicker.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>ICSharpCode.SharpZipLib</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Media/bin/ICSharpCode.SharpZipLib.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Media</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Media/bin/Orchard.Media.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Messaging</ModuleName>
    <VirtualPath>~/Modules/Orchard.Messaging/Orchard.Messaging.csproj</VirtualPath>
    <LoaderName>DynamicExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Modules</ModuleName>
    <VirtualPath>~/Modules/Orchard.Modules/bin/Orchard.Modules.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Packaging</ModuleName>
    <VirtualPath>~/Modules/Orchard.Packaging/bin/Orchard.Packaging.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>Orchard.Modules</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Modules/bin/Orchard.Modules.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Pages</ModuleName>
    <VirtualPath>~/Modules/Orchard.Pages/bin/Orchard.Pages.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Projections</ModuleName>
    <VirtualPath>~/Modules/Orchard.Projections/bin/Orchard.Projections.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>Orchard.Forms</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Forms/bin/Orchard.Forms.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Tokens</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Tokens/bin/Orchard.Tokens.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.PublishLater</ModuleName>
    <VirtualPath>~/Modules/Orchard.PublishLater/bin/Orchard.PublishLater.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Recipes</ModuleName>
    <VirtualPath>~/Modules/Orchard.Recipes/bin/Orchard.Recipes.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>Orchard.Modules</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Modules/bin/Orchard.Modules.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Packaging</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Packaging/bin/Orchard.Packaging.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Themes</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Themes/bin/Orchard.Themes.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Roles</ModuleName>
    <VirtualPath>~/Modules/Orchard.Roles/bin/Orchard.Roles.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Rules</ModuleName>
    <VirtualPath>~/Modules/Orchard.Rules/bin/Orchard.Rules.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>Orchard.Forms</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Forms/bin/Orchard.Forms.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Scripting</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Scripting/bin/Orchard.Scripting.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Tokens</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Tokens/bin/Orchard.Tokens.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Setup</ModuleName>
    <VirtualPath>~/Modules/Orchard.Setup/bin/Orchard.Setup.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>Orchard.Modules</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Modules/bin/Orchard.Modules.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Packaging</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Packaging/bin/Orchard.Packaging.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Recipes</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Recipes/bin/Orchard.Recipes.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Themes</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Themes/bin/Orchard.Themes.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Tags</ModuleName>
    <VirtualPath>~/Modules/Orchard.Tags/bin/Orchard.Tags.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Users</ModuleName>
    <VirtualPath>~/Modules/Orchard.Users/bin/Orchard.Users.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Warmup</ModuleName>
    <VirtualPath>~/Modules/Orchard.Warmup/bin/Orchard.Warmup.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Reports</ModuleName>
    <VirtualPath>~/Core/Reports</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>SafeMode</ModuleName>
    <VirtualPath>~/Theme/SafeMode</VirtualPath>
    <LoaderName>RawThemeExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Scheduling</ModuleName>
    <VirtualPath>~/Core/Scheduling</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Settings</ModuleName>
    <VirtualPath>~/Core/Settings</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Shapes</ModuleName>
    <VirtualPath>~/Core/Shapes</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>SimplyBlue</ModuleName>
    <VirtualPath>~/Theme/SimplyBlue</VirtualPath>
    <LoaderName>RawThemeExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>TheAdmin</ModuleName>
    <VirtualPath>~/Theme/TheAdmin</VirtualPath>
    <LoaderName>RawThemeExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>TheThemeMachine</ModuleName>
    <VirtualPath>~/Theme/TheThemeMachine</VirtualPath>
    <LoaderName>RawThemeExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>TinyMce</ModuleName>
    <VirtualPath>~/Modules/TinyMce/bin/TinyMce.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Title</ModuleName>
    <VirtualPath>~/Core/Title</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>UpgradeTo14</ModuleName>
    <VirtualPath>~/Modules/UpgradeTo14/bin/UpgradeTo14.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>Orchard.Alias</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Alias/bin/Orchard.Alias.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Autoroute</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Autoroute/bin/Orchard.Autoroute.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Tokens</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Tokens/bin/Orchard.Tokens.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>XmlRpc</ModuleName>
    <VirtualPath>~/Core/XmlRpc</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
</Dependencies>