text:
/********************************************************************
*
* =-----------------------------------------------------------------=
* =                          ____          _________                =
* =                         / _  \         \___  __/                =
* =                        / /_/ /     ____   / /                   =
* =                       /  _   \ ¡ñ / _   \ / /                    =
* =                      /  /_/  // // / / // /                     =
* =                      \______//_//_/ /_//_/                      =
* =                                                                 =
* =             Copyright (c) BIN Technology studio,2004 - 2006     =
* =                           LET'Z BT                              =
* =-----------------------------------------------------------------=
*
*   FileName    :   exmpatParser.hpp
*   Author      :   waterflier (waterflier@gmail.com)
*   Create      :   2006-11-10 16:08
*   LastChange  :   2006-11-10 16:08
*   History     :
*
*   Description :   class "expatParser"
*                   expatParserÊÇBINT frameworkµÄXML SAX½âÎöµÄ»ù´¡·â×°Àà
*                   ·â×°ÁËÒ»¸ö¿ìËÙµÄSAX XML½âÎöÆ÷expat
*                   ҪʹÓà XMLÏà¹ØµÄ¹¦ÄÜ,±ØÐë±£Ö¤expatµÄÍ·ÎļþÔÚÄãµÄ·¾¶ÉèÖÃÖÐ
*                   ²¢ÇÒÔÚʹÓõ½µÄÏîÄ¿ÖÐlinkµ½expatµÄlibrary(libexpat.lib ¾²Ì¬ static,XMLParser.lib ¶¯Ì¬)
*
* Tip: ¹ØÓÚExpatµÄ±àÂëÎÊÌâ
* Although expat may accept
* input in various encodings, the strings that it passes
* to the handlers are always encoded in UTF-8. The
* application is responsible for any translation of
* these strings into other encodings. Also no matter
* what you put in, as long as it is in a known encoding,
* what you get out is UTF-8.
*
********************************************************************/

//-----------------------------------------------------------------------------
//
// @doc
//
// @module	ExpatImpl.h - Expat class container |
//
// This module contains the definition of the expat class container.
//
// Copyright (c) 1994-2002 - Descartes Systems Sciences, Inc.
//
// @end
//
// $History: ExpatImpl.h $
//
//      *****************  Version 1  *****************
//      User: Tim Smith    Date: 1/29/02    Time: 1:57p
//      Created in $/Omni_V2/_ToolLib
//      1. String.h now replaced with StringCode.h.
//      2. StringRsrc.h modified to use new string class.
//      3. Added tons of new classes from the wedge work.
//
//-----------------------------------------------------------------------------

#ifndef _EXPAT_PARSER_HPP_
#define _EXPAT_PARSER_HPP_

extern "C"
{
#include <expat/expat.h>
}

//-----------------------------------------------------------------------------
//
// Forward definitions
//
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
//
// Template class definition
//
//-----------------------------------------------------------------------------
namespace xl
{

namespace xml
{

#ifndef __cdecl
#define __cdecl
#endif

template <class _T>
class expat_parser
{

// @access Constructors and destructors
public:

	// @cmember General constructor

	expat_parser ()
	{
		m_p = NULL;
	}

	// @cmember Destructor

	~expat_parser ()
	{
		destroy ();
	}

// @access Parser creation and deletion methods
public:

	// @cmember Create a parser

	bool create (const XML_Char *pszEncoding = NULL,
		const XML_Char *pszSep = NULL)
	{

		//
		// Destroy the old parser
		//

		destroy ();

		//
		// If the encoding or seperator are empty, then NULL
		//

		if (pszEncoding != NULL && pszEncoding [0] == 0)
			pszEncoding = NULL;
		if (pszSep != NULL && pszSep [0] == 0)
			pszSep = NULL;

		//
		// Create the new one
		//

		m_p = XML_ParserCreate_MM (pszEncoding, NULL, pszSep);
		if (m_p == NULL)
			return false;

		//
		// Invoke the post create routine
		//

		_T *pThis = static_cast <_T *> (this);
		pThis ->OnPostCreate ();

		//
		// Set the user data used in callbacks
		//

		XML_SetUserData (m_p, (void *) this);
		return true;
	}

	// @cmember Destroy the parser

	void destroy ()
	{
		if (m_p != NULL)
			XML_ParserFree (m_p);
		m_p = NULL;
	}

// @access Parser parse methods
public:

	// @cmember Parse a block of data

	bool parse (const char *pszBuffer, int nLength = -1, bool fIsFinal = true)
	{

		//
		// Validate
		//

		//assert (m_p != NULL);

		//
		// Get the length if not specified
		//

		if (nLength < 0)
			nLength = (int)strlen (pszBuffer);

		//
		// Invoke the parser
		//

		return XML_Parse (m_p, pszBuffer, nLength, fIsFinal) != 0;
	}

	// @cmember Parse a block of data

#ifdef WCHAR
	bool parse (const WCHAR *pszBuffer, int nLength = -1, bool fIsFinal = true)
	{

		//
		// Validate
		//

		//assert (m_p != NULL);

		//
		// Get the length if not specified
		//

		if (nLength < 0)
			nLength = wcslen (pszBuffer) * 2;

		//
		// Invoke the parser
		//

		return XML_Parse (m_p, pszBuffer, nLength, fIsFinal) != 0;
	}
#endif

	// @cmember Parse internal buffer

	bool parse_buffer (int nLength, bool fIsFinal = true)
	{
		//assert (m_p != NULL);
		return XML_ParseBuffer (m_p, nLength, fIsFinal) != 0;
	}

	// @cmember Get the internal buffer

	void *get_buffer (int nLength)
	{
		//assert (m_p != NULL);
		return XML_GetBuffer (m_p, nLength);
	}

    int stop_parser(bool resumable = false)
    {
        return XML_StopParser(m_p,resumable);
    }

// @access Parser callback enable/disable methods
public:

	// @cmember Enable/Disable the start element handler

	void enable_start_element_handler (bool fEnable = true)
	{
		//assert (m_p != NULL);
		XML_SetStartElementHandler (m_p, fEnable ? StartElementHandler : NULL);
	}

	// @cmember Enable/Disable the end element handler

	void enable_end_element_handler (bool fEnable = true)
	{
		//assert (m_p != NULL);
		XML_SetEndElementHandler (m_p, fEnable ? EndElementHandler : NULL);
	}

	// @cmember Enable/Disable the element handlers

	void enable_element_handler (bool fEnable = true)
	{
		//assert (m_p != NULL);
		enable_start_element_handler (fEnable);
		enable_end_element_handler (fEnable);
	}

	// @cmember Enable/Disable the character data handler

	void enable_character_data_handler (bool fEnable = true)
	{
		//assert (m_p != NULL);
		XML_SetCharacterDataHandler (m_p,
			fEnable ? CharacterDataHandler : NULL);
	}

	// @cmember Enable/Disable the processing instruction handler

	void enable_processing_instruction_handler (bool fEnable = true)
	{
		//assert (m_p != NULL);
		XML_SetProcessingInstructionHandler (m_p,
			fEnable ? ProcessingInstructionHandler : NULL);
	}

	// @cmember Enable/Disable the comment handler

	void enable_comment_handler (bool fEnable = true)
	{
		//assert (m_p != NULL);
		XML_SetCommentHandler (m_p, fEnable ? CommentHandler : NULL);
	}

	// @cmember Enable/Disable the start CDATA section handler

	void enable_start_cdata_section_handler (bool fEnable = true)
	{
		//assert (m_p != NULL);
		XML_SetStartCdataSectionHandler (m_p,
			fEnable ? StartCdataSectionHandler : NULL);
	}

	// @cmember Enable/Disable the end CDATA section handler

	void enable_end_cdata_section_handler (bool fEnable = true)
	{
		//assert (m_p != NULL);
		XML_SetEndCdataSectionHandler (m_p,
			fEnable ? EndCdataSectionHandler : NULL);
	}

	// @cmember Enable/Disable the CDATA section handlers

	void enable_cdata_section_handler (bool fEnable = true)
	{
		//assert (m_p != NULL);
		enable_start_cdata_section_handler (fEnable);
		enable_end_cdata_section_handler (fEnable);
	}

	// @cmember Enable/Disable default handler

	void enable_default_handler (bool fEnable = true, bool fExpand = true)
	{
		//assert (m_p != NULL);
		if (fExpand)
		{
			XML_SetDefaultHandlerExpand (m_p,
				fEnable ? DefaultHandler : NULL);
		}
		else
			XML_SetDefaultHandler (m_p, fEnable ? DefaultHandler : NULL);
	}

	// @cmember Enable/Disable external entity ref handler

	void enable_external_entity_ref_handler (bool fEnable = true)
	{
		//assert (m_p != NULL);
		XML_SetExternalEntityRefHandler (m_p, (XML_ExternalEntityRefHandler)
			fEnable ? ExternalEntityRefHandler : NULL);
	}

	// @cmember Enable/Disable unknown encoding handler
	void enable_unknown_encoding_handler (bool fEnable = true)
	{
		//assert (m_p != NULL);
		XML_SetUnknownEncodingHandler (m_p,
			fEnable ? UnknownEncodingHandler : NULL,NULL);
	}

	// @cmember Enable/Disable start namespace handler

	void enable_start_namespace_decl_handler (bool fEnable = true)
	{
		//assert (m_p != NULL);
		XML_SetStartNamespaceDeclHandler (m_p,
			fEnable ? StartNamespaceDeclHandler : NULL);
	}

	// @cmember Enable/Disable end namespace handler

	void enable_end_namespace_decl_handler (bool fEnable = true)
	{
		//assert (m_p != NULL);
		XML_SetEndNamespaceDeclHandler (m_p,
			fEnable ? EndNamespaceDeclHandler : NULL);
	}

	// @cmember Enable/Disable namespace handlers

	void enable_namespace_decl_handler (bool fEnable = true)
	{
		enable_start_namespace_decl_handler (fEnable);
		enable_end_namespace_decl_handler (fEnable);
	}

	// @cmember Enable/Disable the XML declaration handler

	void enable_xml_decl_handler (bool fEnable = true)
	{
		//assert (m_p != NULL);
		XML_SetXmlDeclHandler (m_p, fEnable ? XmlDeclHandler : NULL);
	}

	// @cmember Enable/Disable the start DOCTYPE declaration handler

	void enable_start_doctype_decl_handler (bool fEnable = true)
	{
		//assert (m_p != NULL);
		XML_SetStartDoctypeDeclHandler (m_p,
			fEnable ? StartDoctypeDeclHandler : NULL);
	}

	// @cmember Enable/Disable the end DOCTYPE declaration handler

	void enable_end_doctype_decl_handler (bool fEnable = true)
	{
		//assert (m_p != NULL);
		XML_SetEndDoctypeDeclHandler (m_p,
			fEnable ? EndDoctypeDeclHandler : NULL);
	}

	// @cmember Enable/Disable the DOCTYPE declaration handler

	void enable_doctype_decl_handler (bool fEnable = true)
	{
		//assert (m_p != NULL);
		enable_start_doctype_decl_handler (fEnable);
		enable_end_doctype_decl_handler (fEnable);
	}

// @access Parser error reporting methods
public:

	// @cmember Get last error

	enum XML_Error get_error_code ()
	{
		//assert (m_p != NULL);
		return XML_GetErrorCode (m_p);
	}

	// @cmember Get the current byte index

	long get_current_byte_index ()
	{
		//assert (m_p != NULL);
		return XML_GetCurrentByteIndex (m_p);
	}

	// @cmember Get the current line number

	int get_current_line_number ()
	{
		//assert (m_p != NULL);
		return XML_GetCurrentLineNumber (m_p);
	}

	// @cmember Get the current column number

	int get_current_column_number ()
	{
		//assert (m_p != NULL);
		return XML_GetCurrentColumnNumber (m_p);
	}

	// @cmember Get the current byte count

	int get_current_byte_count ()
	{
		//assert (m_p != NULL);
		return XML_GetCurrentByteCount (m_p);
	}

	// @cmember Get the input context

	const char *get_input_context (int *pnOffset, int *pnSize)
	{
		//assert (m_p != NULL);
		return XML_GetInputContext (m_p, pnOffset, pnSize);
	}

	// @cmember Get last error string

	const XML_LChar *get_error_string ()
	{
		return XML_ErrorString (get_error_code ());
	}

// @access Parser other methods
public:

	// @cmember Return the version string

	static const XML_LChar *get_expat_version ()
	{
		return XML_ExpatVersion ();
	}
	// @cmember Get last error string

	static const XML_LChar *get_error_string (enum XML_Error nError)
	{
		return XML_ErrorString (nError);
	}

// @access Public handler methods
public:

	// @cmember Start element handler

	void OnStartElement (const XML_Char *pszName, const XML_Char **papszAttrs)
	{
		return;
	}

	// @cmember End element handler

	void OnEndElement (const XML_Char *pszName)
	{
		return;
	}

	// @cmember Character data handler

	void OnCharacterData (const XML_Char *pszData, int nLength)
	{
		return;
	}

	// @cmember Processing instruction handler

	void OnProcessingInstruction (const XML_Char *pszTarget,
		const XML_Char *pszData)
	{
		return;
	}

	// @cmember Comment handler

	void OnComment (const XML_Char *pszData)
	{
		return;
	}

	// @cmember Start CDATA section handler

	void OnStartCdataSection ()
	{
		return;
	}

	// @cmember End CDATA section handler

	void OnEndCdataSection ()
	{
		return;
	}

	// @cmember Default handler

	void OnDefault (const XML_Char *pszData, int nLength)
	{
		return;
	}

	// @cmember External entity ref handler

	bool OnExternalEntityRef (const XML_Char *pszContext,
		const XML_Char *pszBase, const XML_Char *pszSystemID,
		const XML_Char *pszPublicID)
	{
		return false;
	}

	// @cmember Unknown encoding handler

	bool OnUnknownEncoding (const XML_Char *pszName, XML_Encoding *pInfo)
	{
		return false;
	}

	// @cmember Start namespace declaration handler

	void OnStartNamespaceDecl (const XML_Char *pszPrefix,
		const XML_Char *pszURI)
	{
		return;
	}

	// @cmember End namespace declaration handler

	void OnEndNamespaceDecl (const XML_Char *pszPrefix)
	{
		return;
	}

	// @cmember XML declaration handler

	void OnXmlDecl (const XML_Char *pszVersion, const XML_Char *pszEncoding,
		bool fStandalone)
	{
		return;
	}

	// @cmember Start DOCTYPE declaration handler

	void OnStartDoctypeDecl (const XML_Char *pszDoctypeName,
		const XML_Char *pszSysID, const XML_Char *pszPubID,
		bool fHasInternalSubset)
	{
		return;
	}

	// @cmember End DOCTYPE declaration handler

	void OnEndDoctypeDecl ()
	{
		return;
	}

// @access Protected methods
protected:

	// @cmember Handle any post creation

	void OnPostCreate ()
	{
	}

// @access Protected static methods
protected:

	// @cmember Start element handler wrapper

	static void __cdecl StartElementHandler (void *pUserData,
		const XML_Char *pszName, const XML_Char **papszAttrs)
	{
		_T *pThis = static_cast <_T *> ((expat_parser <_T> *) pUserData);
		pThis ->OnStartElement (pszName, papszAttrs);
	}

	// @cmember End element handler wrapper

	static void __cdecl EndElementHandler (void *pUserData,
		const XML_Char *pszName)
	{
		_T *pThis = static_cast <_T *> ((expat_parser <_T> *) pUserData);
		pThis ->OnEndElement (pszName);
	}

	// @cmember Character data handler wrapper

	static void __cdecl CharacterDataHandler (void *pUserData,
		const XML_Char *pszData, int nLength)
	{
		_T *pThis = static_cast <_T *> ((expat_parser <_T> *) pUserData);
		pThis ->OnCharacterData (pszData, nLength);
	}

	// @cmember Processing instruction handler wrapper

	static void __cdecl ProcessingInstructionHandler (void *pUserData,
		const XML_Char *pszTarget, const XML_Char *pszData)
	{
		_T *pThis = static_cast <_T *> ((expat_parser <_T> *) pUserData);
		pThis ->OnProcessingInstruction (pszTarget, pszData);
	}

	// @cmember Comment handler wrapper

	static void __cdecl CommentHandler (void *pUserData,
		const XML_Char *pszData)
	{
		_T *pThis = static_cast <_T *> ((expat_parser <_T> *) pUserData);
		pThis ->OnComment (pszData);
	}

	// @cmember Start CDATA section wrapper

	static void __cdecl StartCdataSectionHandler (void *pUserData)
	{
		_T *pThis = static_cast <_T *> ((expat_parser <_T> *) pUserData);
		pThis ->OnStartCdataSection ();
	}

	// @cmember End CDATA section wrapper

	static void __cdecl EndCdataSectionHandler (void *pUserData)
	{
		_T *pThis = static_cast <_T *> ((expat_parser <_T> *) pUserData);
		pThis ->OnEndCdataSection ();
	}

	// @cmember Default wrapper

	static void __cdecl DefaultHandler (void *pUserData,
		const XML_Char *pszData, int nLength)
	{
		_T *pThis = static_cast <_T *> ((expat_parser <_T> *) pUserData);
		pThis ->OnDefault (pszData, nLength);
	}

	// @cmember External entity ref wrapper

	static int __cdecl ExternalEntityRefHandler ( XML_Parser parser,
		const XML_Char *pszContext, const XML_Char *pszBase,
		const XML_Char *pszSystemID, const XML_Char *pszPublicID)
	{
        void* pUserData = XML_GetUserData(parser);
		_T *pThis = static_cast <_T *> ((expat_parser <_T> *) pUserData);
		return pThis ->OnExternalEntityRef (pszContext,
			pszBase, pszSystemID, pszPublicID) ? 1 : 0;
	}

	// @cmember Unknown encoding wrapper

	static int __cdecl UnknownEncodingHandler (void *pUserData,
		const XML_Char *pszName, XML_Encoding *pInfo)
	{
		_T *pThis = static_cast <_T *> ((expat_parser <_T> *) pUserData);
		return pThis ->OnUnknownEncoding (pszName, pInfo) ? 1 : 0;
	}

	// @cmember Start namespace decl wrapper

	static void __cdecl StartNamespaceDeclHandler (void *pUserData,
		const XML_Char *pszPrefix, const XML_Char *pszURI)
	{
		_T *pThis = static_cast <_T *> ((expat_parser <_T> *) pUserData);
		pThis ->OnStartNamespaceDecl (pszPrefix, pszURI);
	}

	// @cmember End namespace decl wrapper

	static void __cdecl EndNamespaceDeclHandler (void *pUserData,
		const XML_Char *pszPrefix)
	{
		_T *pThis = static_cast <_T *> ((expat_parser <_T> *) pUserData);
		pThis ->OnEndNamespaceDecl (pszPrefix);
	}

	// @cmember XML declaration wrapper

	static void __cdecl XmlDeclHandler (void *pUserData,
		const XML_Char *pszVersion, const XML_Char *pszEncoding,
		int nStandalone)
	{
		_T *pThis = static_cast <_T *> ((expat_parser <_T> *) pUserData);
		pThis ->OnXmlDecl (pszVersion, pszEncoding, nStandalone != 0);
	}

	// @cmember Start Doctype declaration wrapper

	static void __cdecl StartDoctypeDeclHandler (void *pUserData,
		const XML_Char *pszDoctypeName, const XML_Char *pszSysID,
		const XML_Char *pszPubID, int nHasInternalSubset)
	{
		_T *pThis = static_cast <_T *> ((expat_parser <_T> *) pUserData);
		pThis ->OnStartDoctypeDecl (pszDoctypeName, pszSysID,
			pszPubID, nHasInternalSubset != 0);
	}

	// @cmember End Doctype declaration wrapper

	static void __cdecl EndDoctypeDeclHandler (void *pUserData)
	{
		_T *pThis = static_cast <_T *> ((expat_parser <_T> *) pUserData);
		pThis ->OnEndDoctypeDecl ();
	}

// @access Protected members
protected:

	XML_Parser		m_p;
};

//-----------------------------------------------------------------------------
//
// This is a test use for ExpatParser.
//
//-----------------------------------------------------------------------------

//class CExpat : public expatParser <CExpat>
//{
//// @access Constructors and destructors
//public:
//
//	CExpat ()
//	{
//	}
//
//// @access Public handler methods
//public:
//
//	// @cmember Start element handler
//
//	virtual void OnStartElement (const XML_Char *pszName,
//		const XML_Char **papszAttrs)
//	{
//		return;
//	}
//
//	// @cmember End element handler
//
//	virtual void OnEndElement (const XML_Char *pszName)
//	{
//		return;
//	}
//
//	// @cmember Character data handler
//
//	virtual void OnCharacterData (const XML_Char *pszData, int nLength)
//	{
//		return;
//	}
//
//	// @cmember Processing instruction handler
//
//	virtual void OnProcessingInstruction (const XML_Char *pszTarget,
//		const XML_Char *pszData)
//	{
//		return;
//	}
//
//	// @cmember Comment handler
//
//	virtual void OnComment (const XML_Char *pszData)
//	{
//		return;
//	}
//
//	// @cmember Start CDATA section handler
//
//	virtual void OnStartCdataSection ()
//	{
//		return;
//	}
//
//	// @cmember End CDATA section handler
//
//	virtual void OnEndCdataSection ()
//	{
//		return;
//	}
//
//	// @cmember Default handler
//
//	virtual void OnDefault (const XML_Char *pszData, int nLength)
//	{
//		return;
//	}
//
//	// @cmember External entity ref handler
//
//	virtual bool OnExternalEntityRef (const XML_Char *pszContext,
//		const XML_Char *pszBase, const XML_Char *pszSystemID,
//		const XML_Char *pszPublicID)
//	{
//		return false;
//	}
//
//	// @cmember Unknown encoding handler
//
//	virtual bool OnUnknownEncoding (const XML_Char *pszName, XML_Encoding *pInfo)
//	{
//		return false;
//	}
//
//	// @cmember Start namespace declaration handler
//
//	virtual void OnStartNamespaceDecl (const XML_Char *pszPrefix,
//		const XML_Char *pszURI)
//	{
//		return;
//	}
//
//	// @cmember End namespace declaration handler
//
//	virtual void OnEndNamespaceDecl (const XML_Char *pszPrefix)
//	{
//		return;
//	}
//
//	// @cmember XML declaration handler
//
//	virtual void OnXmlDecl (const XML_Char *pszVersion,
//		const XML_Char *pszEncoding, bool fStandalone)
//	{
//		return;
//	}
//
//	// @cmember Start DOCTYPE declaration handler
//
//	virtual void OnStartDoctypeDecl (const XML_Char *pszDoctypeName,
//		const XML_Char *pszSysID, const XML_Char *pszPubID,
//		bool fHasInternalSubset)
//	{
//		return;
//	}
//
//	// @cmember End DOCTYPE declaration handler
//
//	virtual void OnEndDoctypeDecl ()
//	{
//		return;
//	}
//};
}//namespace XML

}//namespace Xunlei
#endif // _EXPAT_PARSER_HPP_


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('podcast', '0011_auto_20170530_1744'),
    ]

    operations = [
        migrations.AlterField(
            model_name='episode',
            name='dateCreated',
            field=models.DateField(auto_now_add=True),
        ),
        migrations.AlterField(
            model_name='episode',
            name='dateUpdated',
            field=models.DateField(auto_now=True),
        ),
    ]

redpajama_set_name: RedPajamaGithub


text: sysctl debug.kdb.panic=1


text:
    <title>Privacy Policy for Electric Fields</title>

Privacy Policy for Electric Fields

What information do we collect?

We do not collect any information from users.

What information do we use?

We do not use any user information.

How do we protect your information?

All of your information is stored on your personal device and protected by the operating
            system policies.

Do we disclose any information to outside parties?

No.

Do we share any user data?

No.

Do we use cookies?

No.

Your Consent

By using our application, you consent to our web site privacy policy.

Contacting Us

If there are any questions regarding this privacy policy you may contact us using the information below.


text:
description: How to install Docker Compose on Linux
keywords: compose, orchestration, install, installation, docker, documentation
toc_max: 3
title: Install the Compose plugin
redirect_from:
- /compose/compose-plugin/
- /compose/compose-linux/
---

On this page you can find instructions on how to install the Compose plugin on Linux from the command line.

To install the Compose plugin on Linux, you can either:
- [Set up Docker's repository on your Linux system](#install-using-the-repository).
- [Install Compose manually](#install-the-plugin-manually).

> **Note**
>
> These instructions assume you already have Docker Engine and Docker CLI installed and now want to install the Compose plugin.
For Compose standalone, see [Install Compose Standalone](other.md).

### Install using the repository

1. Set up the repository. Find distro-specific instructions in:

    [Ubuntu](../../engine/install/ubuntu.md/#set-up-the-repository) |
    [CentOS](../../engine/install/centos.md/#set-up-the-repository) |
    [Debian](../../engine/install/debian.md/#set-up-the-repository) |
    [Fedora](../../engine/install/fedora.md/#set-up-the-repository) |
    [RHEL](../../engine/install/rhel.md/#set-up-the-repository) |
    [SLES](../../engine/install/sles.md/#set-up-the-repository).

2. Update the package index, and install the latest version of Docker Compose:

    * For Ubuntu and Debian, run:

        ```console
        $ sudo apt-get update
        $ sudo apt-get install docker-compose-plugin
        ```
    * For RPM-based distros, run:

        ```console
        $ sudo yum update
        $ sudo yum install docker-compose-plugin
        ```

3.  Verify that Docker Compose is installed correctly by checking the version.

    ```console
    $ docker compose version
    Docker Compose version vN.N.N
    ```

Where `vN.N.N` is placeholder text standing in for the latest version.

#### Update Compose

To update the Compose plugin, run the following commands:

* For Ubuntu and Debian, run:

    ```console
    $ sudo apt-get update
    $ sudo apt-get install docker-compose-plugin
    ```
* For RPM-based distros, run:

    ```console
    $ sudo yum update
    $ sudo yum install docker-compose-plugin
    ```

### Install the plugin manually

> **Note**
>
> This option requires you to manage upgrades manually. We recommend setting up Docker's repository for easier maintenance.

1.  To download and install the Compose CLI plugin, run:

    ```console
    $ DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
    $ mkdir -p $DOCKER_CONFIG/cli-plugins
    $ curl -SL https://github.com/docker/compose/releases/download/{{site.compose_version}}/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
    ```

    This command downloads the latest release of Docker Compose (from the Compose releases repository) and installs Compose for the active user under `$HOME` directory.

    To install:
    * Docker Compose for _all users_ on your system, replace `~/.docker/cli-plugins` with `/usr/local/lib/docker/cli-plugins`.
    * A different version of Compose, substitute `{{site.compose_version}}` with the version of Compose you want to use.

2. Apply executable permissions to the binary:

    ```console
    $ chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
    ```
    or, if you chose to install Compose for all users:

    ```console
    $ sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
    ```

3. Test the installation.

    ```console
    $ docker compose version
    Docker Compose version {{site.compose_version}}
    ```


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Fixtures>
	<Report type="XLSX">
		<ReportFile>target/reports/kafka.xlsx</ReportFile>
	</Report>

	<DefaultFixture>
		<DefaultSharedConfig protocol="KAFKA">
			<Properties>
				<Property name="topic">test_cluster_part3</Property>
				<Property name="acks">1</Property>
				<Property name="brokerList">mingz14:9092,ge7-2012r2:9092,ge8-2012r2:9092</Property>
			</Properties>
		</DefaultSharedConfig>
		<ProducerConfig commandPort="5010">
			<Properties>
				<Property name="simulationFile">src/test/resources/simulations/county_envelopes_1000_points.csv</Property>
			</Properties>
		</ProducerConfig>
		<ConsumerConfig protocol="TCP_SERVER" commandPort="5020" timeoutInSec="5">
			<Properties>
				<Property name="port">5575</Property>
			</Properties>
		</ConsumerConfig>
		<Simulation>
			<TimeTest eventsPerSec="1000" totalTimeInSec="20" staggeringInterval="10" />
		</Simulation>
	</DefaultFixture>

	<Fixture name="1000 e/s" />

	<Fixture name="2000 e/s">
		<Simulation>
			<TimeTest eventsPerSec="2000"/>
		</Simulation>
	</Fixture>

	<Fixture name="3000 e/s">
		<Simulation>
			<TimeTest eventsPerSec="3000"/>
		</Simulation>
	</Fixture>
</Fixtures>


text:
---
meta:
- name: description
  content: Use Agenda with Express/Koa, TypeScript and Ts.ED. Agenda, a light-weight job scheduling library for Node.js
- name: keywords
  content: ts.ed express typescript agenda node.js javascript decorators
---
# Agenda

<Banner src="/agenda.svg" href="https://github.com/agenda/agenda" height="200" />

## Feature

Currently, `@tsed/agenda` allows you to decorate classes with `@Agenda` and
corresponding methods to have them picked up by the Agenda library to be
scheduled automatically (`@Every`) or programmatically (`@Define`) via the AgendaService.

For more information about Agenda look at the documentation [here](https://github.com/agenda/agenda);

## Installation

To begin, install the Agenda module for Ts.ED:

```bash
npm install --save @tsed/agenda
npm install --save agenda
```

## Configure your server

Import `@tsed/agenda` in your Server:

```typescript
import {Configuration} from "@tsed/common";
import "@tsed/agenda"; // import agenda ts.ed module

const mongoConnectionString = "mongodb://127.0.0.1/agenda";

@Configuration({
  agenda: {
   enabled: true, // Enable Agenda jobs for this instance.
   // pass any options that you would normally pass to new Agenda(), e.g.
   db: {
     address: mongoConnectionString
   }
  }
})
export class Server {
}
```

## Create a new Service

Decorate the class with `@Agenda`. The `namespace` option is optional and will
prefix the job name with `namespace.`

Use the `@Every` decorator to define a cron-like job that gets automatically
scheduled based on the given interval. The name is optional and by default the
method name is used as job name.

Use the `@Define` decorator on methods that you would like to schedule
programmatically via the AgendaService and Agenda instance access.

```typescript
import {Agenda, Every, Define} from "@tsed/agenda";
import {Job} from "agenda";

@Agenda({ namespace: "email" })
export class EmailJobService {
  @Every("60 minutes", {
    name: "maintenanceJob",
    /* ... and any option you would normally pass to agenda.every/define */ }
  })
  async sendAdminStatistics(job: Job) {
    // implement something here
  }

  @Define({
    name: "sendWelcomeEmail",
    /*  ... and any option you would normally pass to agenda.define(...) */
  })
  async sendWelcomeEmail(job: Job) {
    // implement something here
  }

  @Define({name: "sendFollowUpEmail"})
  async sendFollowUpEmail(job: Job) {
    // implement something here
  }
}
```

## Inject Agenda

Inject the AgendaService instance to interact with it directly, e.g. to schedule
a job manually.

```typescript
import {Service, AfterRoutesInit} from "@tsed/common";
import {AgendaService} from "@tsed/agenda";

@Service()
export class UsersService implements AfterRoutesInit {
  @Inject()
  private agenda: AgendaService;

  async create(user: User): Promise<User> {
    // do something
    // ...
    // then schedule some jobs
    await this.agenda.now("email.sendWelcomeEmail", {user})
    await this.agenda.schedule("in 2 hours", "email.sendFollowUpEmail", {user})

    return user;
  }
}
```

## Author

<GithubContributors :users="['ochrstn']"/>

## Maintainers

<GithubContributors :users="['ochrstn']"/>

<div class="flex items-center justify-center p-5">
<Button href="/contributing.html" class="rounded-medium">
 Become maintainer
</Button>
</div>


text:
package be.wegenenverkeer.atomium.api;

import java.util.List;

/**
 * Created by Karel Maesen, Geovise BVBA on 14/12/16.
 */
public interface EventReader<T> {

    List<Event<T>> getEvents(long startNum, long size);

    Long totalNumberOfEvents();

}


text:
package net.co.java.model;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.util.Scanner;

import net.co.java.entity.Location;
import net.co.java.entity.Monster;
import net.co.java.entity.Player;
import net.co.java.entity.Player.Profession;
import net.co.java.item.ItemInstance;
import net.co.java.item.ItemInstance.EquipmentInstance;
import net.co.java.item.ItemPrototype.EquipmentPrototype;
import net.co.java.item.ItemPrototype;
import net.co.java.packets.Character_Creation_Packet;
import net.co.java.server.Map;
import net.co.java.skill.Skill;
import net.co.java.skill.WeaponProficiency;
import net.co.java.skill.WeaponType;

/**
 * The Mock model is a model using mock data and is mainly for
 * developing and testing purposes.
 *
 * @author Jan-Willem Gmelig Meyling
 *
 */
public class Mock extends AbstractModel {

	private Player player;

	public Mock() throws FileNotFoundException {
		createSomeStuff();
	}

	private void createSomeStuff() throws FileNotFoundException{
		System.out.println("Creating the magical world of Conquer Online");
		// We spawn a BullMessenger in Twin City for testing purposes here
		new Monster(new Location(Map.CentralPlain, 370, 344, 4), 400001, "BullMessenger",  112, 117, 55000).spawn();
		new Monster(new Location(Map.CentralPlain, 373, 344, 4), 524000, "BullMessenger",  112, 117, 55000).spawn();
		new Monster(new Location(Map.CentralPlain, 376, 344, 4), 475000, "BullMessenger",  112, 117, 55000).spawn();
		new Monster(new Location(Map.CentralPlain, 379, 344, 4), 499999, "BullMessenger",  112, 117, 55000).spawn();
		// Load the item data
		readItemPrototypes(new File("ini/COItems.txt"));
	}

	@Override
	public boolean isAuthorised(String server, String username, String password) {
		return true;
	}

	@Override
	public AuthorizationPromise createAuthorizationPromise(String accountName)
			throws AccessException {
		Long identity = this.createPlayerIdentity();
		String characterName = null;
		if (player != null ) {
			characterName = player.getName();
		} else  if(accountName.equalsIgnoreCase("jackpotsvr")) {
			player = new Player(identity, accountName, new Location(Map.CentralPlain, 382, 341), 0);
			player.setLevel(1);
			player.setStrength(1);
			player.setDexterity(1);
			player.setSpirit(1);
			player.setVitality(1);
			player.setProfession(Profession.TrojanMaster);
			player.setMesh((38000 + 1003));
			player.setGold(0);
			player.setCps(0);
			player.setRebornCount(0);
			player.setHP(player.getMaxHP());
			player.setExperience(0);
			characterName = accountName;
		}
		AuthorizationPromise promise = new AuthorizationPromise(identity, accountName, characterName);
		this.authPromises.put(identity, promise);
		return promise;
	}

	@Override
	public boolean createCharacter(Character_Creation_Packet ip)
			throws AccessException {
		player = new Player(ip.getIdentity(), ip.getCharacterName(), new Location(Map.CentralPlain, 382, 341), 0);
		player.setLevel(1);
		player.setStrength(1);
		player.setDexterity(1);
		player.setSpirit(1);
		player.setVitality(1);
		player.setProfession(Profession.valueOf(ip.getProffession()));
		player.setMesh((38000 + ip.getBody()));
		player.setGold(0);
		player.setCps(0);
		player.setRebornCount(0);
		player.setHP(player.getMaxHP());
		player.setExperience(0);
		return true;
	}

	@Override
	protected Player fetchPlayer(AuthorizationPromise promise)
			throws AccessException {
		Player player = this.player;
		this.player = null;
		player.setGold(1111);
		player.setCps(215);
		player.setStrength(180);
		player.setDexterity(50);
		player.setVitality(50);
		player.setSpirit(50);
		player.setHP(5000);
		player.setLevel(130);
		player.setProfession(Profession.TrojanMaster);
		return player;
	}

	@Override
	protected void fetchInventory(Player hero) throws AccessException {
		ItemInstance item = new EquipmentInstance(2342239l, this.getEquipmentPrototype(480029l))
			.setFirstSocket(EquipmentInstance.Socket.SuperFury)
			.setSecondSocket(EquipmentInstance.Socket.SuperRainbowGem)
			.setDura(1500).setBless(3).setPlus(7).setEnchant(172);
		itemInstances.put(2342239l, item);
		hero.inventory.addItem(item);
		ItemInstance item2 = new EquipmentInstance(2342240l, this.getEquipmentPrototype(480029l))
			.setFirstSocket(EquipmentInstance.Socket.SuperDragon)
			.setSecondSocket(EquipmentInstance.Socket.SuperPhoenix)
			.setDura(1500).setBless(3).setPlus(7).setEnchant(172);
		itemInstances.put(2342240l, item2);
		hero.inventory.addItem(item2);
	}

	@Override
	protected void fetchEquipment(Player hero) throws AccessException {
		EquipmentInstance LeftBlade = new EquipmentInstance(1l, this.getEquipmentPrototype(410339l))
			.setFirstSocket(EquipmentInstance.Socket.SuperFury)
			.setSecondSocket(EquipmentInstance.Socket.SuperRainbowGem)
			.setDura(5000).setBless(3).setPlus(9).setEnchant(169);
		EquipmentInstance RightBlade = new EquipmentInstance(2l, this.getEquipmentPrototype(410339l))
			.setFirstSocket(EquipmentInstance.Socket.SuperDragon)
			.setSecondSocket(EquipmentInstance.Socket.SuperPhoenix)
			.setDura(5000).setBless(2).setPlus(9).setEnchant(172);
		EquipmentInstance Armor = new EquipmentInstance(3l, this.getEquipmentPrototype(135999l))
			.setFirstSocket(EquipmentInstance.Socket.SuperDragon)
			.setSecondSocket(EquipmentInstance.Socket.SuperPhoenix)
			.setDura(5000).setBless(4).setPlus(9).setEnchant(154);

		itemInstances.put(LeftBlade.uniqueIdentifier, LeftBlade);
		itemInstances.put(RightBlade.uniqueIdentifier, RightBlade);
		itemInstances.put(Armor.uniqueIdentifier, Armor);

		hero.inventory.equip(Player.Inventory.LEFT_HAND, LeftBlade);
		hero.inventory.equip(Player.Inventory.RIGHT_HAND, RightBlade);
		hero.inventory.equip(Player.Inventory.ARMOR, Armor);
	}

	@Override
	protected void fetchSkill(Player hero) throws AccessException {
		hero.setSkill(Skill.FAST_BLADE, 4, 0);
		hero.setSkill(Skill.SCENT_SWORD, 4, 0);
		hero.setSkill(Skill.RAGE, 8, 0);
	}

	@Override
	protected void fetchProficiency(Player hero) throws AccessException {
		hero.setProficiency(WeaponType.BLADE, 20, 65000);
		hero.setProficiency(WeaponType.SWORD, 12, 65000);
	}

	@Override
	protected ItemPrototype fetchItemPrototype(long id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	protected ItemInstance fetchItemInstance(long id) throws AccessException {
		// TODO Auto-generated method stub
		return null;
	}

	private void readItemPrototypes(File file) throws FileNotFoundException {
		Scanner sc = new Scanner(file);
		if(sc.hasNext()&&sc.next().equalsIgnoreCase("[Items]")) {
			while(sc.hasNext()) {
				try {
					constructItemPrototype(sc.next());
				} catch (Exception e) {	}
			}
		}

		sc.close();
		System.out.println("Loaded " + itemPrototypes.size() + " item prototypes");
	}

	/**
	 *
	 * @param string element
	 * @return a new {@code ItemPrototype} instance
	 * @throws InputMismatchException
     * @throws NoSuchElementException if input is exhausted
	 */
	private ItemPrototype constructItemPrototype(String string) {
		String[] split = string.split("=");
		Long id = Long.valueOf(split[0]);
		boolean isEquipment = ItemPrototype.isEquipment(id);
		Scanner sc = new Scanner(split[1]);
		sc.useDelimiter("-[^\\w]*");

		String name = sc.next();
		int classReq = sc.nextInt();
		int profReq = sc.nextInt();
		int lvlReq = sc.nextInt();
		int sexReq = sc.nextInt();
		int strReq = sc.nextInt();
		int agiReq = sc.nextInt();
		int worth = sc.nextInt();
		int minAtk = sc.nextInt();
		int maxAtk = sc.nextInt();
		int defence = sc.nextInt();
		int mDef = sc.nextInt();
		int mAttack = sc.nextInt();
		int dodge = sc.nextInt();
		int agility = sc.nextInt();
		int CPWorth = sc.nextInt();

		int maxDura = 0;
		if(sc.hasNextInt()) {
			maxDura = sc.nextInt() * 100;
		}

		sc.close();

		ItemPrototype item = isEquipment ? new EquipmentPrototype(id, name, maxDura, worth,
				CPWorth, classReq, profReq, lvlReq, sexReq, strReq, agiReq,
				minAtk, maxAtk, defence, mDef, mAttack, dodge, agility)
				: new ItemPrototype(id, name, maxDura, worth, CPWorth);
		itemPrototypes.put(id, item);
		return item;
	}

	@Override
	public void setProficiency(Player hero, WeaponProficiency wp)
			throws AccessException {
		// TODO Auto-generated method stub

	}

	@Override
	protected void fetchNPCs() throws AccessException {
		// TODO Auto-generated method stub

	}

}


text:
namespace SudentGroups
{
    using System.Collections.Generic;
    using System.Linq;

    public class Extensions
    {
        private const int DivisibleNumber = 1000000;

        public static IEnumerable<string> OrderStudentByFirstNameLINQ(List<Student> students)
        {
            var orderedStudents =
                from st in students
                orderby st.FirstName
                select st.FirstName;

            return orderedStudents;
        }

        public static IEnumerable<string> OrderStudentByFirstNameLambda(List<Student> students)
        {
            var orderedStudent = students
                .OrderBy(st => st.FirstName)
                .Select(st => st.FirstName);

            return orderedStudent;
        }

        public static IEnumerable<string> ExtractStudentsByEmail(List<Student> students)
        {
            var studentsEmail = students
                .Where(st => st.Email.Contains("abv.bg"))
                .Select(st => st.FirstName);

            return studentsEmail;
        }

        public static IEnumerable<string> ExtractStudentsByPhoneInSofia(List<Student> students)
        {
            var studentsPhone = students
                .Where(st => st.Tel / DivisibleNumber == 2)
                .Select(st => st.FirstName);

            return studentsPhone;
        }

        public static IEnumerable<string> ExtractStudentsWithTwoMarks(List<Student> students)
        {
            var studentsWithTwoMarks = students
                .Where(st => st.Marks.Count(m => m == 2) == 2)
                .Select(st => st.FirstName + " " + st.LastName);

            return studentsWithTwoMarks;
        }

        public static IEnumerable<string> ExtractMarksByFN(List<Student> students)
        {
            var marksByFN = students
                .Where(st => st.FN % 100 == 6)
                .Select(st => string.Format("{0} {1}, MARKS = {2}", st.FirstName, st.LastName, string.Join(", ", st.Marks)));

            return marksByFN;
        }

        // Problem 9. Student groups
        // Create a class Student with properties FirstName, LastName, FN, Tel, Email, Marks (a List), GroupNumber.
        // Create a List<Student> with sample students. Select only the students that are from group number 2.
        // Use LINQ query. Order the students by FirstName.

        // Problem 10. Student groups extensions
        // Implement the previous using the same query expressed with extension methods.

        // Problem 11. Extract students by email
        // Extract all students that have email in abv.bg.
        // Use string methods and LINQ.

        // Problem 12. Extract students by phone
        // Extract all students with phones in Sofia.
        // Use LINQ.

        // Problem 13. Extract students by marks
        // Select all students that have at least one mark Excellent (6) into a new anonymous class that has properties – FullName and Marks.
        // Use LINQ.

        // Problem 14. Extract students with two marks
        // Write down a similar program that extracts the students with exactly two marks "2".
        // Use extension methods.

        // Problem 15. Extract marks
        // Extract all Marks of the students that enrolled in 2006. (The students from 2006 have 06 as their 5-th and 6-th digit in the FN).

        // Problem 16.* Groups
        // Create a class Group with properties GroupNumber and DepartmentName.
        // Introduce a property GroupNumber in the Student class.
        // Extract all students from "Mathematics" department.
        // Use the Join operator.

        // Problem 17. Longest string
        // Write a program to return the string with maximum length from an array of strings.
        // Use LINQ.

        // Problem 18. Grouped by GroupNumber
        // Create a program that extracts all students grouped by GroupNumber and then prints them to the console.
        // Use LINQ.

        // Problem 19. Grouped by GroupName extensions
        // Rewrite the previous using extension methods.
    }
}


text:
module Azure::ARM::Graph
  module Models
    #
    # Request parameters for creating a new application.
    #
    class ApplicationCreateParameters

      include MsRestAzure

      # @return [Boolean] Whether the application is available to other
      # tenants.
      attr_accessor :available_to_other_tenants

      # @return [String] The display name of the application.
      attr_accessor :display_name

      # @return [String] The home page of the application.
      attr_accessor :homepage

      # @return [Array<String>] A collection of URIs for the application.
      attr_accessor :identifier_uris

      # @return [Array<String>] A collection of reply URLs for the application.
      attr_accessor :reply_urls

      # @return [Array<KeyCredential>] The list of KeyCredential objects.
      attr_accessor :key_credentials

      # @return [Array<PasswordCredential>] The list of PasswordCredential
      # objects.
      attr_accessor :password_credentials

      #
      # Mapper for ApplicationCreateParameters class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          required: false,
          serialized_name: 'ApplicationCreateParameters',
          type: {
            name: 'Composite',
            class_name: 'ApplicationCreateParameters',
            model_properties: {
              available_to_other_tenants: {
                required: true,
                serialized_name: 'availableToOtherTenants',
                type: {
                  name: 'Boolean'
                }
              },
              display_name: {
                required: true,
                serialized_name: 'displayName',
                type: {
                  name: 'String'
                }
              },
              homepage: {
                required: false,
                serialized_name: 'homepage',
                type: {
                  name: 'String'
                }
              },
              identifier_uris: {
                required: true,
                serialized_name: 'identifierUris',
                type: {
                  name: 'Sequence',
                  element: {
                      required: false,
                      serialized_name: 'StringElementType',
                      type: {
                        name: 'String'
                      }
                  }
                }
              },
              reply_urls: {
                required: false,
                serialized_name: 'replyUrls',
                type: {
                  name: 'Sequence',
                  element: {
                      required: false,
                      serialized_name: 'StringElementType',
                      type: {
                        name: 'String'
                      }
                  }
                }
              },
              key_credentials: {
                required: false,
                serialized_name: 'keyCredentials',
                type: {
                  name: 'Sequence',
                  element: {
                      required: false,
                      serialized_name: 'KeyCredentialElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'KeyCredential'
                      }
                  }
                }
              },
              password_credentials: {
                required: false,
                serialized_name: 'passwordCredentials',
                type: {
                  name: 'Sequence',
                  element: {
                      required: false,
                      serialized_name: 'PasswordCredentialElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'PasswordCredential'
                      }
                  }
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
package de.droidcon.berlin2018.schedule.backend;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.Html;
import com.squareup.moshi.Json;
import de.droidcon.berlin2018.model.Speaker;
import java.util.List;
import org.jetbrains.annotations.NotNull;

/**
 * @author Hannes Dorfmann
 */
class DroidconBerlinSpeaker implements Speaker {

  @Json(name = "uid") String id;
  @Json(name = "gn") String firstName;
  @Json(name = "sn") String lastName;
  @Json(name = "org") String company;
  @Json(name = "position") String jobTitle;
  @Json(name = "image") String profilePic;
  @Json(name = "description_short") String info;
  @Json(name = "links") List<DroidconBerlinLink> links;

  @Nullable @org.jetbrains.annotations.Nullable @Override public String profilePic() {
    return profilePic;
  }

  @Nullable @org.jetbrains.annotations.Nullable @Override public String link3() {
    return links != null && links.size() >= 1 ? links.get(0).url : null;
  }

  @Nullable @org.jetbrains.annotations.Nullable @Override public String link2() {
    return links != null && links.size() >= 2 ? links.get(1).url : null;
  }

  @Nullable @org.jetbrains.annotations.Nullable @Override public String link1() {
    return links != null && links.size() >= 3 ? links.get(2).url : null;
  }

  @Nullable @org.jetbrains.annotations.Nullable @Override public String jobTitle() {
    return jobTitle == null ? null : Html.fromHtml(jobTitle).toString();
  }

  @Nullable @org.jetbrains.annotations.Nullable @Override public String company() {
    return company == null ? null : Html.fromHtml(company).toString();
  }

  @Nullable @org.jetbrains.annotations.Nullable @Override public String info() {
    return info == null ? null : Html.fromHtml(info).toString();
  }

  @NonNull @NotNull @Override public String name() {
    return firstName + " " + lastName;
  }

  @NonNull @NotNull @Override public String id() {
    return id;
  }

  public DroidconBerlinSpeaker() {
  }

  public DroidconBerlinSpeaker(String id) {
    this.id = id;
  }
}


text:
"""Runs some tests about the disable-delete handler and cascading deletes.

You can run only these tests by issuing::

  $ go team
  $ python manage.py test tests.test_ddh

Or::

  $ go book
  $ python setup.py test -s tests.ProjectsTests.test_ddh

"""

from __future__ import unicode_literals
from __future__ import print_function

from django.core.exceptions import ValidationError
from lino.utils.djangotest import RemoteAuthTestCase
from lino.api import rt

from lino.utils.instantiator import create_row as create

class DDHTests(RemoteAuthTestCase):
    maxDiff = None

    def test01(self):
        from lino.modlib.users.choicelists import UserTypes
        Ticket = rt.models.tickets.Ticket
        Project = rt.models.tickets.Project
        User = rt.models.users.User
        Star = rt.models.votes.Vote
        # ContentType = rt.models.contenttypes.ContentType
        # ct_Ticket = ContentType.objects.get_for_model(Ticket)

        create(Project, name='project')
        robin = create(User, username='robin',
                       first_name="Robin",
                       user_type=UserTypes.admin,
                       language="en")

        def createit():
            return create(Ticket, summary="Test", user=robin)

        #
        # If there are no vetos, user can ask to delete it
        #
        obj = createit()
        obj.delete()

        obj = createit()

        if False:
            try:
                robin.delete()
                self.fail("Expected veto")
            except Warning as e:
                self.assertEqual(
                    str(e), "Cannot delete User Robin "
                    "because 1 Tickets refer to it.")

        create(Star, votable=obj, user=robin)

        try:
            robin.delete()
            self.fail("Expected veto")
        except Warning as e:
            self.assertEqual(
                str(e), "Cannot delete User Robin "
                "because 1 Tickets refer to it.")

        self.assertEqual(Star.objects.count(), 1)
        self.assertEqual(Ticket.objects.count(), 1)

        obj.delete()
        self.assertEqual(Star.objects.count(), 0)
        self.assertEqual(Ticket.objects.count(), 0)


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/white"
    android:gravity="center"
    android:orientation="vertical" >

    <include
        android:id="@+id/include_title"
        android:layout_width="fill_parent"
        android:layout_height="@dimen/activity_title_height"
        layout="@layout/title_control" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:padding="10dp" >

        <EditText
            android:id="@+id/txt_search_info"
            style="@style/edittext_userinfo"
            android:layout_width="0dp"
            android:layout_weight="3.0"
            android:hint="@string/promte_search_friend" />

        <Button
            android:id="@+id/btn_search"
            android:layout_width="0dp"
            android:layout_height="40dp"
            android:layout_marginLeft="5dp"
            android:layout_weight="1.0"
            android:background="@drawable/selector_btn_fitband_style"
            android:text="@string/search"
            android:textSize="@dimen/text_size_small" />
    </LinearLayout>

    <TextView
        android:id="@+id/txt_empty"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:background="@drawable/border_square"
        android:gravity="center"
        android:padding="5dp"
        android:text="@string/search_result_empty"
        android:textColor="@color/gray"
        android:textSize="@dimen/text_size_small"
        android:visibility="gone" />

    <ListView
        android:id="@+id/list_search_friends"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="10dp"
        android:background="@android:color/white"
        android:divider="@color/gray"
        android:dividerHeight="0.6dp" >
    </ListView>

</LinearLayout>


text:
#ifndef THREEENGINE_MOVECONTROLLER_H
#define THREEENGINE_MOVECONTROLLER_H

#include "../../Engine/Actor.h"
#include "../../Engine/Utilities/Simulation.h"

namespace ThreeEngine {

    class MoveController : public IUpdatable {
        public:
            number angle;
            Vector front;

            Actor* actor;

            MoveController();

            virtual ~MoveController();

            void Update(milliseconds delta) override;
    };

} /* namespace ThreeEngine */

#endif //THREEENGINE_MOVECONTROLLER_H


text:
namespace Camus.EventSystems
{
    public interface IEvent
    {
    }
}


text:
<TITLE>Review for Independence Day (1996)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Independence Day (1996)

reviewed by
Lewis Butler

                             INDEPENDENCE DAY
                       A film review by Lewis Butler
                        Copyright 1995 Lewis Butler

        In short:   One of the best action movies to come along in
        years.  INDEPENDENCE DAY (ID4) has everything it needs to take
        its place with such movies as STAR WARS and TERMINATOR 2.
        Whether it will attain such heights remians to be seen, but
        all the makings are there.  It is not, however, perfect.
        +3 on the old -4/+4.

ID4 is a movie with something for everyone.  It has a large cast of
characters, so there's plenty of people to identify with.  The plot is
basic and simple: Aliens finally come, and they're not friendly.  The movie
starts with the alien mothership's arrival, a huge ship 1/4th the size of
the moon.  The first half-hour is all about the arrival and Earth's
reaction to it.  Then things start getting messy.

The plot is thin, but adequate.  Before humanity is completely
exterminated, we have to find a way to win against superior technology.
Seemingly, we don't have a chance.  The Alien ships are bigger, more
powerful, and they have some sort of energy shield that we can't penetrate.
It's going to be tough.

Bill Pullman plays the only completly unbelievable character in the movie,
an American President who is not a political weasel, but a fairly young
ex-fighter pilot hero of the Gulf War, politcally naive.  A man of honor and
ethics.  Basically, he plays a President the exact opposite of our current
canidates if they were merged into one.  That said, he's a convincing
character, and you can't help liking him.  He gets the audience on his side
when he announces that he is staying in Washington DC even after the 15
mile wide alien spaceship (one of 30) takes position directly over the
White House.  He send the vice-president and the cabinet to Norad.  Of
course, we've seen the White House get blown up in the previews...

A lot of people die in this movie, obviously.  But while it could have been
a lot of faceless people, the filmmakers take the time to introduce us to a
few of them.  It gives the movie a little bit of an edge and prevents it
from becoming completely silly summer escapism.  It's still mostly that,
don't be deceived, but there's enough there to keep you going.

One of the things I enjoyed about this film was that it made an effort not
to ignore the rest of the world.  Yes, it's an American film about
Americans, but there are just enough cutaways to other parts of the world
so that we know what's happening.  And though we don't see them, the
rest of the world is fighting their own battle, with just a little bit fo
help from the Americans.

There are many nice touches throughout the film, and many references,
somtimes oblique, to other films.  Look for Randy Quaid late in the film
doing a scene from... well, that might be considered a spoiler.  You'll
know it when you see it.

Performances are solid all the way around.  Some of the highlights are Will
Smith, playing a fighter pilot; Judd Hirsch as Jeff Goldblum's father;
eff Goldblum as a computer geek; and Brent Spinner as a xenobiologist or
soemthing whose been locked away underground for 30 years or so.  Pullman,
Goldblum, and Smith form the core cast of the film.

It is easy to dismiss this as "just another summer movie."  But I would
remind people of some other, recent, summer movies.  HUDSON HAWK.  THE LAST
ACTION HERO.  BEVERLY HILLS COP III.  TANGO AND CASH.  DIE HARD II.  Get
the point?  While this may not be a "great" movie, it is exactly what it
wants to be, entertaining.  It is very entertaining.

And the effects.  I haven't even mentioned the special effects, and this
movie is loaded with them.  Still, what is there to say?  We live in a time
where special effects in movies are so good it's really only worth
discussing them when they are poorly done.  They are not poorly done.  They
are spectacular.  The most impressive effects are the ones involving the
destruction of the various cities.

See it, it is the best "summer" movie in a lot of summers.  Better, even,
than TRUE LIES.

--
Signatures follow:

Distribution of this message by Microsoft, its subsidiaries, or its
software shall constitute a violation of my copyrights.  Microsoft may
license copyrights to my messages, for distribution only, for the sum of
$1,000 US per week.
--
kreme@cerebus.kreme.com   1015 South Gaylord, Denver, CO 80209 #100
WWW URL <">http://www.nyx.net/~kreme>
[303/722-2009] Vox
[303/777-2911] Data

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
@echo off
REM Delete link on Desktop
echo Deleting Desktop shortcut...
del "%USERPROFILE%\Desktop\Watir Robot.lnk"
echo Uninstall complete.
pause


text:
<?php

namespace app\controllers;

use Yii;
use yii\filters\AccessControl;
use yii\web\BadRequestHttpException;
use yii\web\Controller;
use yii\filters\VerbFilter;
use app\models\LoginForm;
use app\models\ContactForm;
use app\models\RegisterForm;
use yii\web\ForbiddenHttpException;
use app\models\Alerts;
use app\modules\admin\models\Articles;
use yii\web\NotFoundHttpException;

class SiteController extends Controller
{
    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'logout' => ['post'],
                    'checklogin' => ['post'],
                    'checkregister' => ['post']
                ],
            ],
        ];
    }

    /**
     * @inheritdoc
     */
    public function actions()
    {
        return [
            'error' => [
                'class' => 'yii\web\ErrorAction',
            ],
            'captcha' => [
                'class' => 'yii\captcha\CaptchaAction',
                'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
            ],
        ];
    }

    /**
     * Displays homepage.
     *
     * @return string
     */
    public function actionIndex()
    {
        if (!Yii::$app->user->isGuest) {
            if (Yii::$app->user->can('adminAccess')) {
                return $this->redirect(array('/admin'));
            } else
                return $this->redirect(array('site/alerts'));
        }

        return $this->render('index');
    }

    /**
     * Logout action.
     *
     * @return string
     */
    public function actionLogout()
    {

        (new \app\models\Alerts())->triggerAlert('logout', array('logoutUsername' => Yii::$app->user->identity->username));
        Yii::$app->user->logout();

        return $this->goHome();
    }

    /**
     * Вход на сайт
     */
    public function actionChecklogin() {
        if (!Yii::$app->user->isGuest) {
            if (Yii::$app->user->can('adminAccess')) {
                return $this->redirect(array('/admin/default'));
            } else
                return $this->redirect(array('site/alerts'));
        }

        $model = new LoginForm();
        $model->attributes = Yii::$app->request->post();

        $model->on('login', function ($event) {
            (new \app\models\Alerts())->triggerAlert('login', $event->vars);
        });

        if ($model->login()) {
            return $this->goHome();
        }

        return $this->render('index', [
            'model' => $model,
        ]);
    }

    public function actionRegister() {
        if (!Yii::$app->user->isGuest) {
            return $this->goHome();
        }

        return $this->render('register', ['errors' => array()]);
    }

    public function actionCheckregister() {
        if (!Yii::$app->user->isGuest) {
            return $this->goHome();
        }

        $model = new RegisterForm();

        // Вешаем обработчик события на регистрацию
        $model->on('register', function ($event) {
            (new \app\models\Alerts())->triggerAlert('register', $event->vars);
        });

        $model->attributes = Yii::$app->request->post();

        if ($model->validate() && $model->register()) {
            return $this->goHome();

        } else {
            return $this->render('register', [
            'errors' => $model->errors,
            ]);
        }
    }

    public function actionAlerts() {
        if (Yii::$app->user->isGuest) {
            throw new ForbiddenHttpException();
        }

        //(new Alerts)->triggerAlert('register', array('testVar'=>'Привет, Мир1!'));

        $page = Yii::$app->request->get('page');
        $user = Yii::$app->user->getId();

        return $this->render('view_alerts', [
            'alerts' => (new Alerts())->getListForUser('browser', $user, $page)
        ]);
    }

    public function actionAlertslist() {
        if (Yii::$app->user->isGuest) {
            throw new ForbiddenHttpException();
        }

        $page = Yii::$app->request->get('page');
        $user = Yii::$app->user->getId();

        return json_encode((new Alerts())->getListForUser('browser', $user, $page));
    }

    public function actionSwitch() {
        if (Yii::$app->user->isGuest) {
            throw new ForbiddenHttpException();
        }

        $id = Yii::$app->request->get('id');
        $page = Yii::$app->request->get('page');
        $user = Yii::$app->user->getId();

        if (!(new Alerts())->setReaded($user, $id)) {
            throw new BadRequestHttpException();
        } else {
            return $this->redirect(['site/alerts', ['page'=>$page]]);
        }
    }

    public function actionArticle() {
        $id = (int)Yii::$app->request->get('id');

        $article = Articles::findOne($id);

        if (!$article) {
            throw  new NotFoundHttpException();
        }

        return $this->render('article', [
            'article' => $article
        ]);
    }
}


text:
package org.michaelbel.bottomsheet;

import android.content.Context;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.support.annotation.ColorInt;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import android.text.TextUtils;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

/**
 * Date: 17 FEB 2018
 * Time: 00:31 MSK
 *
 * @author Michael Bel
 */

@SuppressWarnings("all")
public class BottomSheetGrid extends LinearLayout {

    private TextView textView;
    private ImageView iconView;

    public BottomSheetGrid(Context context) {
        super(context);

        setOrientation(VERTICAL);
        setPadding(Utils.dp(getContext(), 24), Utils.dp(getContext(), 16), Utils.dp(getContext(), 24), Utils.dp(getContext(), 16));

        iconView = new ImageView(context);
        iconView.setScaleType(ImageView.ScaleType.CENTER);

        LayoutParams params1 = new LayoutParams(Utils.dp(getContext(), 48), Utils.dp(getContext(), 48));
        params1.gravity = Gravity.TOP | Gravity.CENTER_HORIZONTAL;

        iconView.setLayoutParams(params1);
        addView(iconView);

        textView = new TextView(context);
        textView.setLines(1);
        textView.setMaxLines(1);
        textView.setSingleLine(true);
        textView.setEllipsize(TextUtils.TruncateAt.END);
        textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);

        LayoutParams params2 = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        params2.gravity = Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL;

        textView.setLayoutParams(params2);
        addView(textView);
    }

    public BottomSheetGrid setIcon(@DrawableRes int resId, @ColorInt int color) {
        Drawable icon = ContextCompat.getDrawable(getContext(), resId);
        if (icon != null) {
            icon.clearColorFilter();
            icon.mutate().setColorFilter(color, PorterDuff.Mode.MULTIPLY);
        }

        iconView.setImageDrawable(icon);
        return this;
    }

    public BottomSheetGrid setIcon(Drawable resId, @ColorInt int color) {
        Drawable icon = resId;
        if (icon != null) {
            icon.clearColorFilter();
            icon.mutate().setColorFilter(color, PorterDuff.Mode.MULTIPLY);
        }

        iconView.setImageDrawable(icon);
        return this;
    }

    public BottomSheetGrid setText(@NonNull CharSequence text, @ColorInt int color) {
        textView.setText(text);
        textView.setTextColor(color);
        return this;
    }
}


text:
import sbt._
import Keys._

object BuildSettings {
  // Common settings for all our projects
  lazy val commonSettings = Seq[Setting[_]](
    organization          :=  "com.snowplowanalytics",
    version               :=  "0.6.2",
    scalaVersion          :=  "2.10.6",
    crossScalaVersions    :=  Seq("2.10.6", "2.11.7"),
    scalacOptions         :=  Seq("-deprecation", "-encoding", "utf8",
                                  "-unchecked", "-feature",
                                  "-Xfatal-warnings", "-target:jvm-1.7"),
    scalacOptions in Test :=  Seq("-Yrangepos"),
    resolvers             ++= Dependencies.resolutionRepos
  )

  // Settings specific for Schema Guru CLI
  lazy val coreSettings = Seq[Setting[_]](
    description           :=  "For deriving JSON Schemas from collections of JSON instances",

    mainClass in (Compile, run) := Some("com.snowplowanalytics.schemaguru.Main")
  )

  // Makes our SBT app settings available from within the ETL
  lazy val scalifySettings = Seq(sourceGenerators in Compile <+= (sourceManaged in Compile, version, name, organization, scalaVersion) map { (d, v, n, o, sv) =>
    val file = d / "settings.scala"
    IO.write(file, """package com.snowplowanalytics.schemaguru.generated
                     |object ProjectSettings {
                     |  val version = "%s"
                     |  val name = "%s"
                     |  val organization = "%s"
                     |  val scalaVersion = "%s"
                     |}
                     |""".stripMargin.format(v, n, o, sv))
    Seq(file)
  })

  // sbt-assembly settings for building a fat jar
  import sbtassembly.Plugin._
  import AssemblyKeys._
  lazy val sbtAssemblyCommonSettings = assemblySettings ++ Seq(
    // Executable jarfile
    assemblyOption in assembly ~= { _.copy(prependShellScript = Some(defaultShellScript)) },

    // Name it as an executable
    jarName in assembly := { s"${name.value}-${version.value}" }
  )

  lazy val sbtAssemblyCoreSettings = sbtAssemblyCommonSettings ++ Seq(
    // Drop these jars
    excludedJars in assembly <<= (fullClasspath in assembly) map { cp =>
      val excludes = Set(
        "commons-beanutils-1.8.3.jar" // Clashes with commons-collections
      )
      cp filter { jar => excludes(jar.data.getName) }
    },
    mainClass in assembly := Some("com.snowplowanalytics.schemaguru.Main")
  )

  lazy val coreBuildSettings =
    commonSettings ++
    coreSettings ++
    scalifySettings ++
    sbtAssemblyCoreSettings
}


text:
--TEST--
Test closedir() function : usage variations - close a file pointer
--FILE--
<?php
/* Prototype  : void closedir([resource $dir_handle])
 * Description: Close directory connection identified by the dir_handle
 * Source code: ext/standard/dir.c
 * Alias to functions: close
 */

/*
 * Create a file pointer using fopen() then try to close it using closedir()
 */

echo "*** Testing closedir() : usage variations ***\n";

echo "\n-- Open a file using fopen() --\n";
var_dump($fp = fopen(__FILE__, 'r'));

echo "\n-- Try to close the file pointer using closedir() --\n";
var_dump(closedir($fp));

echo "\n-- Check file pointer: --\n";
var_dump($fp);

if(is_resource($fp)) {
	fclose($fp);
}
?>
===DONE===
--EXPECTF--
*** Testing closedir() : usage variations ***

-- Open a file using fopen() --
resource(%d) of type (stream)

-- Try to close the file pointer using closedir() --

Warning: closedir(): %d is not a valid Directory resource in %s on line %d
bool(false)

-- Check file pointer: --
resource(%d) of type (stream)
===DONE===


text:
number1 = int(input("digite um número que servirá de base:"))
number2 = int(input("digite um número que servirá de expoente: "))
counter = 1
number = number1

while counter < number2:
    number = number * number1
    counter += 1

print("o número",number1,"elevado ao número",number2,"é:",number)


text:
import builtins
import token
from collections.abc import Mapping
from io import StringIO
from tokenize import generate_tokens, untokenize

from robot.errors import DataError
from robot.utils import get_error_message, type_name

from .notfound import variable_not_found

PYTHON_BUILTINS = set(builtins.__dict__)

def evaluate_expression(expression, variable_store, modules=None, namespace=None):
    try:
        if not isinstance(expression, str):
            raise TypeError(f'Expression must be string, got {type_name(expression)}.')
        if not expression:
            raise ValueError('Expression cannot be empty.')
        return _evaluate(expression, variable_store, modules, namespace)
    except Exception:
        raise DataError(f"Evaluating expression '{expression}' failed: "
                        f"{get_error_message()}")

def _evaluate(expression, variable_store, modules=None, namespace=None):
    if '$' in expression:
        expression = _decorate_variables(expression, variable_store)
    # Given namespace must be included in our custom local namespace to make
    # it possible to detect which names are not found and should be imported
    # automatically as modules. It must be also be used as the global namespace
    # with `eval()` because lambdas and possibly other special constructs don't
    # see the local namespace at all.
    namespace = dict(namespace) if namespace else {}
    if modules:
        namespace.update(_import_modules(modules))
    local_ns = EvaluationNamespace(variable_store, namespace)
    return eval(expression, namespace, local_ns)

def _decorate_variables(expression, variable_store):
    variable_started = False
    variable_found = False
    tokens = []
    for toknum, tokval, _, _, _ in generate_tokens(StringIO(expression).readline):
        if variable_started:
            if toknum == token.NAME:
                if tokval not in variable_store:
                    variable_not_found('$%s' % tokval,
                                       variable_store.as_dict(decoration=False),
                                       deco_braces=False)
                tokval = 'RF_VAR_' + tokval
                variable_found = True
            else:
                tokens.append((token.ERRORTOKEN, '$'))
            variable_started = False
        if toknum == token.ERRORTOKEN and tokval == '$':
            variable_started = True
        else:
            tokens.append((toknum, tokval))
    return untokenize(tokens).strip() if variable_found else expression

def _import_modules(module_names):
    modules = {}
    for name in module_names.replace(' ', '').split(','):
        if not name:
            continue
        modules[name] = __import__(name)
        # If we just import module 'root.sub', module 'root' is not found.
        while '.' in name:
            name, _ = name.rsplit('.', 1)
            modules[name] = __import__(name)
    return modules

class EvaluationNamespace(Mapping):

    def __init__(self, variable_store, namespace):
        self.namespace = namespace
        self.variables = variable_store

    def __getitem__(self, key):
        if key.startswith('RF_VAR_'):
            return self.variables[key[7:]]
        if key in self.namespace:
            return self.namespace[key]
        return self._import_module(key)

    def _import_module(self, name):
        if name in PYTHON_BUILTINS:
            raise KeyError
        try:
            return __import__(name)
        except ImportError:
            raise NameError(f"name '{name}' is not defined nor importable as module")

    def __iter__(self):
        yield from self.variables
        yield from self.namespace

    def __len__(self):
        return len(self.variables) + len(self.namespace)


text:
package org.knowm.xchange.bitcoinaverage;

import java.io.IOException;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.knowm.xchange.bitcoinaverage.dto.marketdata.BitcoinAverageTicker;
import org.knowm.xchange.bitcoinaverage.dto.marketdata.BitcoinAverageTickers;

/**
 * @author veken0m
 */

@Path("/")
@Produces(MediaType.APPLICATION_JSON)
public interface BitcoinAverage {

  @GET
  @Path("ticker/global/{currency}/")
  BitcoinAverageTicker getTicker(@PathParam("currency") String currency) throws IOException;

  @GET
  @Path("ticker/global/all")
  BitcoinAverageTickers getAllTickers() throws IOException;

}


text:
<?php

namespace Oro\Bundle\MigrationBundle\Tests\Unit\Migration;

use Oro\Bundle\MigrationBundle\Migration\QueryBag;

class QueryBagTest extends \PHPUnit_Framework_TestCase
{
    public function testBag()
    {
        $queries = new QueryBag();
        $queries->addPreQuery('query1');
        $queries->addPreQuery('query2');
        $queries->addPostQuery('query3');
        $queries->addQuery('query4');

        $this->assertEquals(
            ['query1', 'query2'],
            $queries->getPreQueries()
        );
        $this->assertEquals(
            ['query3', 'query4'],
            $queries->getPostQueries()
        );

        $queries->clear();
        $this->assertCount(0, $queries->getPreQueries());
        $this->assertCount(0, $queries->getPostQueries());
    }
}


text:
Uses JMX protocol to collect measurements from 1 or more instances of WebLogic that is ethier co-resident with the meter the plugin is running on or remotely.

### Prerequisites

|     OS    | Linux | Windows | SmartOS | OS X |
|:----------|:-----:|:-------:|:-------:|:----:|
| Supported |   v   |    v    |    v    |  v   |

* Java 1.7 or later.
* This plugin is compatible with WebLogic X.X.X or later.

#### Boundary Meter versions v4.2 or later

- To install new meter go to Settings->Installation or [see instructions](https://help.boundary.com/hc/en-us/sections/200634331-Installation).
- To upgrade the meter to the latest version - [see instructions](https://help.boundary.com/hc/en-us/articles/201573102-Upgrading-the-Boundary-Meter).

### Plugin Setup

To collect statistics from a WebLogic instance you need to enable access to the JMX remote endpoint.

```
$ # Specific commands and instructions to be determined

```

### Plugin Configuration Fields

|Field Name     | Description                                                                                |
|:--------------|:-------------------------------------------------------------------------------------------|
| Host          | Host of the WebLogic JMX endpoint.                                                         |
| Port          | Port of the WebLogic JMX endpoint. Defaults to XXXX.                                       |
| Username      | Username of the WebLogic JMX endpoint.                                                     |
| Password      | Password of the WebLogic JMX endpoint.                                                     |
| Source        | The Source to display in the legend for the metrics data (default: hostname of the server).|
| Poll Interval | How often should the plugin poll for metrics. |

### Metrics Collected

|Metric Name                   |Description                                                               |
|:-----------------------------|:----------------------------------------------|
| WEBLOGIC_JVM_HEAPMEMORY_USED | Heap memory used by the java virtual machine. |

### Dashboards

- WebLogic

### References

[https://docs.oracle.com/cd/E13222_01/wls/docs90/jmx/accessWLS.html](https://docs.oracle.com/cd/E13222_01/wls/docs90/jmx/accessWLS.html)


text:
<?php

/*
 * This file is part of Sulu.
 *
 * (c) MASSIVE ART WebServices GmbH
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Sulu\Bundle\ContactBundle\Entity;

use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\NoResultException;

/**
 * AccountContactRepository.
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class AccountContactRepository extends EntityRepository
{
    public function findByForeignIds($accountId, $contactId)
    {
        try {
            $qb = $this->createQueryBuilder('accountContact')
                ->leftJoin('accountContact.contact', 'contact')
                ->leftJoin('accountContact.account', 'account')
                ->leftJoin('account.mainContact', 'mainContact')
                ->leftJoin('accountContact.position', 'position')
                ->addSelect('position')
                ->addSelect('mainContact')
                ->addSelect('account')
                ->where('account.id = :accountId AND contact.id = :contactId');

            $query = $qb->getQuery();
            $query->setParameter('accountId', $accountId);
            $query->setParameter('contactId', $contactId);

            return $query->getSingleResult();
        } catch (NoResultException $ex) {
            return;
        }
    }
}


text: export { CalendarTools as default } from "./";


text:
package org.ops4j.pax.exam.regression.maven;

import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.assertThat;

import javax.ws.rs.ProcessingException;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;

import org.junit.Test;

public class WabSampleIT {

    @Test
    public void checkPlainTextFromWabServlet() throws InterruptedException {
        Client client = ClientBuilder.newClient();
        WebTarget resource = client.target("http://localhost:8181/wab/WABServlet");

        // The server is started by the exam-maven-plugin in a background process:
        // We need to make sure it has finished startup.

        int i = 0;
        int delay = 1000;
        int maxRetries = 5;

        String response = null;

        while (i < maxRetries) {
            i++;

            try {
                response = resource.request().get(String.class);
                break;
            }
            catch (ProcessingException exc) {
                Thread.sleep(delay);
            }
        }

        assertThat(response, containsString("wab symbolic name : org.ops4j.pax.exam.samples.pax-exam-sample11-wab"));
    }
}


text:
/* Problem 3. We are given a matrix of strings of size N x M. Sequences in the matrix we define as sets of several neighbor elements
 * located on the same line, column or diagonal. Write a program that finds the longest sequence of equal strings in the matrix.
 */
using System;

class Sequencess
{
    static void Main()
    {
        string[,] mat =
        {
            {"ha","fifi","ho","hi"},
            {"fo","ha","hi","xx"},
            {"xxx","ho","ha","xx"},
        };

        /*
        string[,] mat =
        {
            {"s","qq","s"},
            {"pp","pp","s"},
            {"pp","qq","s"},
        };
         */
        string sequence, maxSequence = "", display = "";
        int sequenceLenght = 1, maxSequenceLenght = 0;
        bool check = false;
        for (int i = 0; i < mat.GetLength(0); i++)
        {
            for (int j = 0; j < mat.GetLength(1); j++)
            {
                //checking right
                sequenceLenght = 1;
                sequence = mat[i, j];
                do
                {
                    check = false;
                    if (j + sequenceLenght < mat.GetLength(1))
                    {
                        if (mat[i, j + sequenceLenght] == sequence)
                        {
                            sequenceLenght++;
                            if (sequenceLenght > maxSequenceLenght)
                            {
                                maxSequenceLenght = sequenceLenght;
                                maxSequence = sequence;
                            }
                            check = true;
                        }
                    }
                } while (check);

                //checking right down diagonal
                sequenceLenght = 1;
                do
                {
                    check = false;
                    if ((i + sequenceLenght < mat.GetLength(0)) && (j + sequenceLenght < mat.GetLength(1)))
                    {
                        if (mat[i + sequenceLenght, j + sequenceLenght] == sequence)
                        {
                            sequenceLenght++;
                            if (sequenceLenght > maxSequenceLenght)
                            {
                                maxSequenceLenght = sequenceLenght;
                                maxSequence = sequence;
                            }
                            check = true;
                        }
                    }
                } while (check);

                //checking down
                sequenceLenght = 1;
                do
                {
                    check = false;
                    if (i + sequenceLenght < mat.GetLength(0))
                    {
                        if (mat[i + sequenceLenght, j] == sequence)
                        {
                            sequenceLenght++;
                            if (sequenceLenght > maxSequenceLenght)
                            {
                                maxSequenceLenght = sequenceLenght;
                                maxSequence = sequence;
                            }
                            check = true;
                        }
                    }
                } while (check);

                //checking left down diagonal
                sequenceLenght = 1;
                do
                {
                    check = false;
                    if ((i+sequenceLenght<mat.GetLength(0))&&(j - sequenceLenght >= 0))
                    {
                        if (mat[i + sequenceLenght, j - sequenceLenght] == sequence)
                        {
                            sequenceLenght++;
                            if (sequenceLenght > maxSequenceLenght)
                            {
                                maxSequenceLenght = sequenceLenght;
                                maxSequence = sequence;
                            }
                            check = true;
                        }
                    }
                } while (check);
            }
        }

        for (int i = 0; i < maxSequenceLenght; i++)
        {
            display += maxSequence;
            if (i < maxSequenceLenght - 1)
            {
                display += ", ";
            }
        }
        Console.WriteLine("The bigest seqence is {0}", display);

    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

using nhs.itk.hl7v3.rim;
using nhs.itk.hl7v3.datatypes;
using nhs.itk.hl7v3.templates;
using nhs.itk.hl7v3.xml;
using nhs.itk.hl7v3.utils;
using nhs.itk.hl7v3.oids;
using System.Xml;

namespace nhs.itk.hl7v3.cda.classes
{
    public class act_CDAParentDocument : ActClass
    {
        private string typeCode;

        //public act_CDAParentDocument(CDAActRelationshipDocument typeCodeValue)
        //    : base()
        public act_CDAParentDocument()
            : base()
        {
            CDAActRelationshipDocument typeCodeValue = CDAActRelationshipDocument.RPLC;
            typeCode = StringEnum.GetStringValue(typeCodeValue);
            base.ClassCode = "DOCCLIN";
            base.MoodCode = "EVN";
        }

        /// <summary>
        ///
        /// </summary>
        public Guid Id
        {
            set
            {
                base.SetId(value);
            }
        }

        public Guid SetId
        {
            set
            {
                base.SetSetId(value);
            }
        }

        public int VersionNumber
        {
            set
            {
                base.SetVersionNumber(value);
            }
        }

        public void SetCodeLocal(string codeSystemValue, string codeValue, string displayNameValue)
        {
            base.SetCode(codeSystemValue, codeValue, displayNameValue);
        }

        public void SetCodeSnomedCT(string codeValue, string displayNameValue = null)
        {
            base.SetCode(OIDStore.OIDCodeSystemSnomedCT, codeValue, displayNameValue);
        }

        public void SetCodeSnomedCTComposition(SnomedConcept DocumentType, SnomedConcept CareSetting)
        {
            string composition =
                string.Format(
                "810301000000103:810311000000101={0},810321000000107={1}",
                DocumentType.ConceptCode,
                CareSetting.ConceptCode
                );

            string displayname =
                string.Format(
                "810301000000103|Clinical document descriptor|:810311000000101|Type of clinical document|={0}|{1}|,810321000000107|Care setting of clinical document|={2}|{3}|",
                DocumentType.ConceptCode,
                DocumentType.DisplayName,
                CareSetting.ConceptCode,
                CareSetting.DisplayName
                );

            base.SetCode(OIDStore.OIDCodeSystemSnomedCT, composition, displayname);

        }

        public void SetCodeSnomedCTComposition(string codeDocumentType, string codeCareSetting, string displayName)
        {

            string composition =
                string.Format(
                "810301000000103:810311000000101={0},810321000000107={1}",
                codeDocumentType,
                codeCareSetting);

            base.SetCode(OIDStore.OIDCodeSystemSnomedCTCompositionalGrammar, composition, displayName);
        }

        #region XML Members
        public void WriteXml(XmlWriter writer)
        {
            writer.WriteStartElement("relatedDocument");
            writer.WriteAttributeString("typeCode", this.typeCode);
            writer.WriteStartElement("parentDocument");
            this.WriteXML(writer);
            writer.WriteEndElement();
            writer.WriteEndElement();
        }
        #endregion
    }
}


text:
using Client.DataGrouping.ViewModels;
using jQueryApi;
using Slick;
using Slick.Data;
using SparkleXrm;
using SparkleXrm.CustomBinding;
using SparkleXrm.GridEditor;
using System;
using System.Collections.Generic;
using Xrm;

namespace Client.DataGrouping.Views
{
    public class TreeView
    {
        public static void init()
        {
            TreeDataViewModel vm = new TreeDataViewModel();
            GridDataViewBinder binder = new GridDataViewBinder();

             List<Column> columns = new List<Column>(

                new Column(
                    ColumnProperties.Id, "status",
                    ColumnProperties.Name, "Status",
                    ColumnProperties.Field, "status",
                    ColumnProperties.Width, 70,
                    ColumnProperties.MinWidth, 50,
                    ColumnProperties.CssClass, "cell-title",
                    ColumnProperties.Sortable, true
                   ),
                 new Column(
                    ColumnProperties.Id, "project",
                    ColumnProperties.Name, "Project",
                    ColumnProperties.Field, "project",
                    ColumnProperties.Width, 70,
                    ColumnProperties.MinWidth, 50,
                    ColumnProperties.CssClass, "cell-title",
                    ColumnProperties.Sortable, true,
                    ColumnProperties.Editor, XrmTextEditor.TextEditor),
                   new Column(
                    ColumnProperties.Id, "date",
                    ColumnProperties.Name, "Date",
                    ColumnProperties.Field, "date",
                    ColumnProperties.Width, 70,
                    ColumnProperties.Sortable, true
                    ),
                new Column(
                    ColumnProperties.Id, "employee",
                    ColumnProperties.Name, "Employee",
                    ColumnProperties.Field, "employee",
                    ColumnProperties.Width, 80,
                    ColumnProperties.Sortable, true
                  ),
                new Column(
                    ColumnProperties.Id, "duration",
                    ColumnProperties.Name, "Duration",
                    ColumnProperties.Field, "duration",
                    ColumnProperties.MinWidth, 60,
                    ColumnProperties.Sortable, true)
               );

            vm.Items.OnGetItemMetaData += Items_OnGetItemMetaData;
            Grid grid = binder.DataBindXrmGrid(vm.Items,columns,"projectsGrid",null,true,false);
            grid.RegisterPlugin(new GroupGridRowPlugin());
            // Data Bind
            ViewBase.RegisterViewModel(vm);
        }

        static ItemMetaData Items_OnGetItemMetaData(object item)
        {

            Group group = (Group)item;
            if (group.Level != null)
            {
                return GetGroupRowMetadata(item);
            }
            else return null;
        }

        public static ItemMetaData GetGroupRowMetadata(object item)
        {

             ItemMetaData metaData = new ItemMetaData();
             metaData.Selectable = false;
             metaData.Focusable = true;
             metaData.CssClasses =  "slick-group";
             metaData.Columns = new Dictionary<object,Column>();
             Column col = new Column();
             metaData.Columns[0] = col;
             col.ColSpan = "*";
             col.Formatter = GroupCellFormatter;
             col.Editor = null;
             return metaData;
         }

        public static string GroupCellFormatter(int row, int cell, object value, Column columnDef, object dataContext)
        {
            Group item = (Group)dataContext;

            string indentation = (item.Level * 15).ToString() + "px";
            return "" +
                "" +
                "" +
                  item.Title +
                "";
        }

    }
}


text:
Directions for running locally:

Install node if not already downloaded. Create a directory and clone into repository.

Run `npm install` to install all dependencies in package.json.
Run `node server.js` and load page on http://localhost:3000/ to view.