text:
package org.pockito.dctm.test;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Hashtable;
import java.util.Properties;

import org.apache.log4j.Logger;

import com.documentum.com.DfClientX;
import com.documentum.com.IDfClientX;
import com.documentum.fc.client.DfClient;
import com.documentum.fc.client.IDfClient;
import com.documentum.fc.client.IDfDocbrokerClient;
import com.documentum.fc.client.IDfSession;
import com.documentum.fc.client.IDfSessionManager;
import com.documentum.fc.client.IDfTypedObject;
import com.documentum.fc.common.DfException;
import com.documentum.fc.common.DfId;
import com.documentum.fc.common.DfLoginInfo;
import com.documentum.fc.common.IDfId;
import com.documentum.fc.common.IDfLoginInfo;

public class Repository {

	static final Logger _logger = Logger.getLogger(Repository.class);

	// hide constructor (avoid multiple instantiation).
	private Repository() {
		loadProperties();
	}

	static class InstanceHolder {
		static Repository instance = new Repository();
	}

	public static Repository getInstance() {
		return InstanceHolder.instance;
	}

	public static Repository getNewInstance() {
		return new Repository();
	}

	/**
	 * Gets a new session. The session is not be managed.
	 *
	 * @param repository
	 * @param username
	 * @param password
	 * @return
	 * @throws DmsException
	 * @throws DfException
	 */
	public IDfSession getSession(String repository, String username,
			String password) throws DfException {
		IDfLoginInfo li = new DfLoginInfo();
		li.setUser(username);
		li.setPassword(password);
		li.setDomain(null);

		IDfSession dfSession = null;
		IDfClient client = DfClient.getLocalClient();
		dfSession = client.newSession(repository, li);
		return dfSession;
	}

	/**
	 * Gets the session manager.
	 *
	 * @return
	 * @throws DfException
	 */
	public IDfSessionManager getSessionManager() throws DfException {
		if (_sessMgr == null) {
			synchronized (lockSessionMgr) {
				if (_sessMgr == null) {
					_sessMgr = createSessionManager();
				}
			}
		}
		return _sessMgr;
	}

	/**
	 * Gets a session manager.
	 *
	 * @return
	 * @throws DfException
	 */
	public IDfSessionManager newSessionManager() throws DfException {
		return createSessionManager();
	}

	/**
	 * Resolves an alias for a repository. Aliases are defined in
	 * Repository.properties config file.
	 *
	 * @param alias
	 * @return - the resolved alias or the alias it self if no alias is found.
	 */
	public String resolveRepositoryAlias(String alias) {
		String value = alias;
		if (_reposAliases.containsKey(alias)) {
			value = (String) _reposAliases.get(alias);
		}
		return value;
	}

	private Object lockSessionMgr = new Object();

	/**
	 * Gets a DFC session connected to <tt>repository</tt> as <tt>username</tt>.
	 *
	 * @param repository
	 * @param username
	 * @return
	 * @throws Exception
	 */
	public IDfSession getManagedSession(String repository, String username,
			String password) throws DfException {

		IDfClientX clientX = new DfClientX();

		IDfClient localClient = clientX.getLocalClient();
		IDfTypedObject clientConfig = localClient.getClientConfig();
		String docbroker = getDocbroker();
		if (docbroker != null) {
			clientConfig.setString("primary_host", docbroker);
		}
		String port = getPort();
		if (port != null) {
			clientConfig.setString("primary_port", port);
		}

		IDfLoginInfo li = clientX.getLoginInfo();
		li.setUser(username);
		li.setPassword(password);
		li.setDomain(null);

		// WBD-308 - use aliases for repository names
		String realRepo = resolveRepositoryAlias(repository);

		IDfSessionManager sessMgr = getSessionManager();
		IDfSession dfSession = null;

		synchronized (lockSessionMgr) {
			if (sessMgr.hasIdentity(realRepo)) {
				sessMgr.clearIdentity(realRepo);
			}
			sessMgr.setIdentity(realRepo, li);

			dfSession = sessMgr.getSession(realRepo);
		}

		return dfSession;
	}

	public IDfLoginInfo setIdentity(String repository, String username,
			String password) throws DfException {
		IDfClientX clientX = new DfClientX();

		IDfLoginInfo li = clientX.getLoginInfo();
		li.setUser(username);
		li.setPassword(password);
		li.setDomain(null);

		// WBD-308 - use aliases for repository names
		String realRepo = resolveRepositoryAlias(repository);

		IDfSessionManager sessMgr = getSessionManager();

		synchronized (lockSessionMgr) {
			if (sessMgr.hasIdentity(realRepo)) {
				sessMgr.clearIdentity(realRepo);
			}
			sessMgr.setIdentity(realRepo, li);
		}

		return li;
	}

	/**
	 * Gets a session for the repository using the current identity.
	 *
	 * @param repository
	 * @return
	 * @throws DfException
	 */
	public IDfSession getSession(String repository) throws DfException {
		return getSessionManager().getSession(repository);
	}

	/**
	 * Gets a DFC session connected to <tt>repository</tt> as <tt>username</tt>
	 * using login ticket.
	 *
	 * @param repository
	 * @param username
	 * @return
	 * @throws Exception
	 */
	public IDfSession getManagedSession(String repository, String username)
			throws DfException {

		String ticket = getLoginTicketForUser(repository, username);
		return getManagedSession(repository, username, ticket);
	}

	public IDfSession getManagedSessionForOperator(String repository)
			throws DfException {
		return getManagedSession(repository, getOperatorName(),
				getOperatorPassword());
	}

	/**
	 * Creates a DFC session connected to <tt>repository</tt> as
	 * <tt>username</tt>.
	 *
	 * @param repository
	 * @param username
	 * @return
	 * @throws Exception
	 */
	public IDfSession newManagedSession(String repository, String username,
			String password) throws DfException {
		return newManagedSession(getSessionManager(), repository, username,
				password);
	}

	public IDfSession newManagedSession(IDfSessionManager sessMgr,
			String repository, String username, String password)
			throws DfException {

		IDfClientX clientX = new DfClientX();

		IDfLoginInfo li = clientX.getLoginInfo();
		li.setUser(username);
		li.setPassword(password);
		li.setDomain(null);

		// WBD-308 - use aliases for repository names
		String realRepo = resolveRepositoryAlias(repository);

		IDfSession dfSession = null;

		synchronized (lockSessionMgr) {
			if (sessMgr.hasIdentity(realRepo)) {
				sessMgr.clearIdentity(realRepo);
			}
			sessMgr.setIdentity(realRepo, li);

			dfSession = sessMgr.newSession(realRepo);
		}
		return dfSession;
	}

	/**
	 * Creates a DFC session connected to <tt>repository</tt> as
	 * <tt>username</tt> using login ticket.
	 *
	 * @param repository
	 * @param username
	 * @return
	 * @throws Exception
	 */
	public IDfSession newManagedSession(String repository, String username)
			throws DfException {

		String ticket = getLoginTicketForUser(repository, username);
		return newManagedSession(repository, username, ticket);
	}

	public IDfSession newManagedSessionForOperator(String repository)
			throws DfException {
		return newManagedSession(repository, getOperatorName(),
				getOperatorPassword());
	}

	/**
	 * Releases a session.
	 *
	 * @param dfSession
	 */
	public void releaseSession(IDfSession dfSession) {
		try {
			if (dfSession != null) {
				IDfSessionManager sMgr = dfSession.getSessionManager();
				// try {
				// sMgr.release(dfSession);
				// } catch (Exception e) {
				// dfSession.disconnect();
				// }
				sMgr.release(dfSession);
			}
		} catch (Exception ignore) {
			ignore.printStackTrace();
		}
	}

	/**
	 * Gets a privileged (super user) session.
	 *
	 * @param repository
	 * @return
	 * @throws DfException
	 */
	public IDfSession getPrivilegedSession(String repository)
			throws DfException {
		IDfSession dfSession = null;
		try {
			IDfClientX clientX = new DfClientX();

			IDfClient localClient = clientX.getLocalClient();
			IDfTypedObject clientConfig = localClient.getClientConfig();
			String docbroker = getDocbroker();
			if (docbroker != null) {
				clientConfig.setString("primary_host", docbroker);
			}
			String port = getPort();
			if (port != null) {
				clientConfig.setString("primary_port", port);
			}

			IDfLoginInfo li = clientX.getLoginInfo();
			li.setUser(getSuUsername());
			li.setPassword(getSuPassword());
			li.setDomain(null);

			// WBD-308 - use aliases for repository names
			String realRepo = resolveRepositoryAlias(repository);

			dfSession = clientX.getLocalClient().newSession(realRepo, li);
		} catch (DfException e) {
			throw e;
		}
		return dfSession;
	}

	public IDfSession getPrivilegedSession()
			throws DfException {
		return getPrivilegedSession(getDocbase());
	}

	/**
	 * Releases the privileged session.
	 *
	 * @param dfSession
	 */
	public void releasePrivilegedSession(IDfSession dfSession) {
		if (dfSession != null) {
			try {
				dfSession.disconnect();
			} catch (DfException ignore) {
				ignore.printStackTrace();
			}
		}
	}

	/**
	 * Gets a login ticket for an user.
	 *
	 * @param repository
	 * @param username
	 * @return
	 * @throws DfException
	 */
	public String getLoginTicketForUser(String repository, String username)
			throws DfException {
		String ticket = null;
		// WBD-308 - use aliases for repository names
		String realRepo = resolveRepositoryAlias(repository);
		IDfSession dfPriviligedSession = getPrivilegedSession(realRepo);
		try {
			ticket = dfPriviligedSession.getLoginTicketForUser(username);
		} catch (DfException e) {
			throw e;
		} finally {
			releasePrivilegedSession(dfPriviligedSession);
		}
		return ticket;
	}

	/**
	 * Creates a new session manager instance. The session manager does not have
	 * any identities associated with it.
	 *
	 * @return
	 *
	 * @throws DfException
	 */
	private static IDfSessionManager createSessionManager() throws DfException {

		IDfClientX clientX = new DfClientX();
		IDfClient localClient = clientX.getLocalClient();
		IDfTypedObject clientConfig = localClient.getClientConfig();
		String docbroker = getDocbroker();
		if (docbroker != null) {
			clientConfig.setString("primary_host", docbroker);
		}
		String port = getPort();
		if (port != null) {
			clientConfig.setString("primary_port", port);
		}
		IDfSessionManager sessMgr = localClient.newSessionManager();
		return sessMgr;
	}

	public static String getDocbroker() {
		return docbroker;
	}

	public void setDocbroker(String docbroker) {
		if (docbroker == null || docbroker.trim().length() == 0
				|| "_default_".equals(docbroker.trim())) {
			Repository.docbroker = null;
		} else {
			Repository.docbroker = docbroker;
		}
	}

	public static String getPort() {
		return port;
	}

	public void setPort(String port) {
		if (port == null || port.trim().length() == 0
				|| "_default_".equals(port.trim())) {
			Repository.port = null;
		} else {
			Repository.port = port;
		}
	}

	public String getDocbase() {
		return repositoryName;
	}

	public void setDocbase(String docbase) {
		this.repositoryName = docbase;
	}

	public String getSuUsername() {
		return suUsername;
	}

	public void setSuUsername(String suUsername) {
		this.suUsername = suUsername;
	}

	public String getSuPassword() {
		return suPassword;
	}

	public void setSuPassword(String suPassword) {
		this.suPassword = suPassword;
	}

	public String getOperatorName() {
		return operatorName;
	}

	public void setOperatorName(String operatorName) {
		this.operatorName = operatorName;
	}

	public String getOperatorPassword() {
		return operatorPassword;
	}

	public void setOperatorPassword(String operatorPassword) {
		this.operatorPassword = operatorPassword;
	}

	public String getRepositoryName() {
		return repositoryName;
	}

	public void setRepositoryName(String repositoryName) {
		this.repositoryName = repositoryName;
	}

	/**
	 * Gets the repository where an object is stored.
	 *
	 * @param anObjectId
	 * @return
	 */
	public static String getDocbaseNameFromId(final String anObjectId) {
		String docbaseName = null;
		try {
			final IDfId objectId = new DfId(anObjectId);
			if (objectId.isObjectId()) {
				docbaseName = getDocbaseNameFromId(objectId);
			}
		} catch (DfException ignore) {
			_logger.debug(
					"failed to retrieve the docbase name from the object id",
					ignore);
		}
		return docbaseName;
	}

	/**
	 * Gets the repository where an object is stored.
	 *
	 * @param objectId
	 * @return
	 * @throws DfException
	 */
	public static String getDocbaseNameFromId(final IDfId objectId)
			throws DfException {
		String retval = null;
		if (objectId != null && objectId.isObjectId()) {
			IDfClientX clientX = new DfClientX();

			IDfClient localClient = clientX.getLocalClient();
			IDfTypedObject clientConfig = localClient.getClientConfig();
			String docbroker = getDocbroker();
			if (docbroker != null) {
				clientConfig.setString("primary_host", docbroker);
			}
			String port = getPort();
			if (port != null) {
				clientConfig.setString("primary_port", port);
			}

			final IDfDocbrokerClient docbrokerClient = clientX
					.getDocbrokerClient();
			retval = docbrokerClient.getDocbaseNameFromId(objectId);
		}
		return retval;
	}

	/**
	 * Indicates whether this ID is a valid object ID in the repository. Checks
	 * also the type against the type passed as an argument.
	 *
	 * @param anObjectId
	 * @param repository
	 * @param type
	 * @return
	 */
	public static boolean isObjectId(final String anObjectId,
			String repository, int type) {
		Boolean isAnId = null;
		try {
			final IDfId objectId = new DfId(anObjectId);
			if (objectId.isObjectId()) {
				if (repository == null) {
					isAnId = Boolean.TRUE;
				} else {
					String docbaseName = getDocbaseNameFromId(objectId);
					isAnId = Boolean.valueOf(repository.equals(docbaseName));
				}
				if (type == -1) {
					if (isAnId == null) {
						isAnId = Boolean.TRUE;
					}
				} else {
					int actualTypePart = objectId.getTypePart();
					isAnId = Boolean.valueOf(type == actualTypePart);
				}
			} else {
				isAnId = Boolean.FALSE;
			}
		} catch (DfException ignore) {
			_logger.debug(
					"failed to retrieve the docbase name from the object id",
					ignore);
		}
		return isAnId.booleanValue();
	}

	private Hashtable<String, String> _reposAliases = new Hashtable<String, String>();

	private void loadProperties() {

		Properties prop = new Properties();
		try {
			String configFilename = System.getProperty("Repository.config");
			InputStream is;
			if (configFilename == null) {
				is = Repository.class
						.getResourceAsStream("Repository.properties");
				if (is == null) {
					is = Repository.class
							.getResourceAsStream("/Repository.properties");
				}
			} else {
				is = new FileInputStream(configFilename);
			}
			if (is != null) {
				prop.load(is);
				setDocbase(prop.getProperty("repository.name"));
				setDocbroker(prop.getProperty("repository.docbroker.host"));
				setPort(prop.getProperty("repository.docbroker.port"));
				setSuUsername(prop.getProperty("repository.su.username"));
				setSuPassword(prop.getProperty("repository.su.password"));
				setOperatorName(prop
						.getProperty("repository.operator.username"));
				setOperatorPassword(prop
						.getProperty("repository.operator.password"));
				// load repository aliases
				try {
					int aliasCount = Integer.parseInt(prop.getProperty(
							"repository.alias.count", "0"));
					for (int aliasIndex = 0; aliasIndex < aliasCount; aliasIndex++) {
						String indexKey = Integer.toString(aliasIndex);
						String name = prop.getProperty("repository.alias.name."
								+ indexKey);
						String value = prop
								.getProperty("repository.alias.value."
										+ indexKey);
						if (name != null && value != null) {
							_reposAliases.put(name, value);
						}
					}
				} catch (NumberFormatException ignore) {
					_logger.debug("invalid aliases count", ignore);
				}
			}
		} catch (IOException ignore) {
			_logger.debug("failed to load default config values", ignore);
		}

	}

	private static String docbroker;
	private static String port;
	// private static String docbase;
	private String suUsername;
	private String suPassword;
	private String operatorName;
	private String operatorPassword;
	private IDfSessionManager _sessMgr = null;
	private String repositoryName;

}


text:
Tests can be executed in three different modes as follows:
For Windows use **set** and for OSX, Linux use **export**
* **LIVE**
Tests will be run against the Live Service, no recording happens
To run the tests in **LIVE** mode, set the following environment variable:
```
set NOCK_OFF=true
```

* **RECORD**
Tests will be run against the Live Service and the HTTP traffic will be recorded to a file at "azure-xplat-cli/tests/recordings/{test-suite}/{full-test-title}.nock.js"
To run the tests in **RECORD** mode, set the following environment variable:
```
set NOCK_OFF=
set AZURE_NOCK_RECORD=true
```

* **PLAYBACK**
Tests will run against the previously recorded HTTP traffic, vs a Live Service. The Travis CI runs tests in this mode.
To run tests in **PLAYBACK** mode, unset the following environment variables:
```
set NOCK_OFF=
set AZURE_NOCK_RECORD=
```
The recordings will get saved in azure-xplat-cli/test/recordings/{test-suite} directory

## Partial recordings

#### Recording tests related to a specific service/feature
If you plan on adding some tests / features and do not need to regenerate the full set of test recordings, you can open the file:
```
test/testlist.txt (if you are writing tests for commands in asm mode)
test/testlist-arm.txt (if you are writing tests for commands in arm mode)
```
and comment out the tests you do not wish to run during the recording process.

To do so, use a leading \# character. i.e.:

\# commands/cli.cloudservice-tests.js

\# commands/cli.deployment-tests.js

commands/cli.site-tests.js

\# commands/cli.site.appsetting-tests

In the above example only the cli.site-tests.js tests would be run.

#### Recording a particular test in a suite

A test-file can have multiple suites and multiple tests within a suite.

* Executing a specific test from the entire suite: "it.only()"
```js
describe.('list', function () {
  it.only('should work', function (done) {
    suite.execute('location list --json', function (result) {
      result.exitStatus.should.equal(0);
      //verify the command indeed produces something valid such as a well known provider: sql provider
      var allResources = JSON.parse(result.text);
      allResources.some(function (res) {
        return res.name.match(/Microsoft.Sql\/servers/gi);
      }).should.be.true;
      done();
    });
  });

  it('should not work', function (done) {
    suite.execute('location list --json', function (result) {
      result.exitStatus.should.equal(1);
      //verify the command indeed produces something valid such as a well known provider: sql provider
      var allResources = JSON.parse(result.text);
      allResources.some(function (res) {
        return res.name.match(/Microsoft.Sql\/servers/gi);
      }).should.be.false;
      done();
    });
  });
});
```
* Skipping an entire suite, will not execute the entire suite. This can de achieved by using the "skip" keyword
```js
describe.skip('list', function () {
  it('should work', function (done) {
    suite.execute('location list --json', function (result) {
      result.exitStatus.should.equal(0);
      //verify the command indeed produces something valid such as a well known provider: sql provider
      var allResources = JSON.parse(result.text);
      allResources.some(function (res) {
        return res.name.match(/Microsoft.Sql\/servers/gi);
      }).should.be.true;
      done();
    });
  });

  it('should not work', function (done) {
    suite.execute('location list --json', function (result) {
      result.exitStatus.should.equal(1);
      //verify the command indeed produces something valid such as a well known provider: sql provider
      var allResources = JSON.parse(result.text);
      allResources.some(function (res) {
        return res.name.match(/Microsoft.Sql\/servers/gi);
      }).should.be.false;
      done();
    });
  });
});
```
* Skipping a particular test in a suite. This can be achieved in two ways
  * it.skip() **OR**
  * passing null as the second argument to the test
```js
describe('list', function () {
  //The first test will not be run as it is marked skip
  it.skip('should work', null, function (done) {
    suite.execute('location list --json', function (result) {
      result.exitStatus.should.equal(0);
      //verify the command indeed produces something valid such as a well known provider: sql provider
      var allResources = JSON.parse(result.text);
      allResources.some(function (res) {
        return res.name.match(/Microsoft.Sql\/servers/gi);
      }).should.be.true;
      done();
    });
  });
  //The second test will not be run as null is provided as the second argument to the test function.
  it('should not work', null, function (done) {
    suite.execute('location list --json', function (result) {
      result.exitStatus.should.equal(1);
      //verify the command indeed produces something valid such as a well known provider: sql provider
      var allResources = JSON.parse(result.text);
      allResources.some(function (res) {
        return res.name.match(/Microsoft.Sql\/servers/gi);
      }).should.be.false;
      done();
    });
  });

  it('should always work', function (done) {
    suite.execute('location list --json', function (result) {
      result.exitStatus.should.equal(0);
      //verify the command indeed produces something valid such as a well known provider: sql provider
      var allResources = JSON.parse(result.text);
      allResources.some(function (res) {
        return res.name.match(/Microsoft.Sql\/servers/gi);
      }).should.be.false;
      done();
    });
  });
});
```

redpajama_set_name: RedPajamaGithub


text:
import * as materials from "materials/legacy/legacy-normal";
export { materials };
export default materials;


text:
package com.orange.entity.sprite.vbo;

/**
 * (c) OrangeGame 2012
 *
 * @author OrangeGame <OGEngine@orangegame.cn>
 */
public interface IUniformColorSpriteVertexBufferObject extends ISpriteVertexBufferObject {
	// ===========================================================
	// Constants
	// ===========================================================

	// ===========================================================
	// Methods
	// ===========================================================
}


text:
/////////////////////////////////////////////////////////////////////////////
// Name:        wx/hashset.h
// Purpose:     wxHashSet class
// Author:      Mattia Barbon
// Modified by:
// Created:     11/08/2003
// RCS-ID:      $Id: hashset.h,v 1.6.2.2 2006/01/18 16:32:38 JS Exp $
// Copyright:   (c) Mattia Barbon
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////

#ifndef _WX_HASHSET_H_
#define _WX_HASHSET_H_

#include "wx/hashmap.h"

#if wxUSE_STL && defined(HAVE_STL_HASH_MAP)

#if defined(HAVE_EXT_HASH_MAP)
    #include <ext/hash_set>
#elif defined(HAVE_HASH_MAP)
    #include <hash_set>
#endif

#define _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, CLASSEXP )\
    typedef WX_HASH_MAP_NAMESPACE::hash_set< KEY_T, HASH_T, KEY_EQ_T > CLASSNAME;

#else // !wxUSE_STL || !defined(HAVE_STL_HASH_MAP)

// this is a complex way of defining an easily inlineable identity function...
#define _WX_DECLARE_HASH_SET_KEY_EX( KEY_T, CLASSNAME, CLASSEXP )            \
CLASSEXP CLASSNAME                                                           \
{                                                                            \
    typedef KEY_T key_type;                                                  \
    typedef const key_type const_key_type;                                   \
    typedef const_key_type& const_key_reference;                             \
public:                                                                      \
    CLASSNAME() { }                                                          \
    const_key_reference operator()( const_key_reference key ) const          \
        { return key; }                                                      \
                                                                             \
    /* the dummy assignment operator is needed to suppress compiler */       \
    /* warnings from hash table class' operator=(): gcc complains about */   \
    /* "statement with no effect" without it */                              \
    CLASSNAME& operator=(const CLASSNAME&) { return *this; }                 \
};

#define _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, CLASSEXP )\
_WX_DECLARE_HASH_SET_KEY_EX( KEY_T, CLASSNAME##_wxImplementation_KeyEx, CLASSEXP ) \
_WX_DECLARE_HASHTABLE( KEY_T, KEY_T, HASH_T, CLASSNAME##_wxImplementation_KeyEx, KEY_EQ_T, CLASSNAME##_wxImplementation_HashTable, CLASSEXP, grow_lf70, never_shrink ) \
CLASSEXP CLASSNAME:public CLASSNAME##_wxImplementation_HashTable             \
{                                                                            \
public:                                                                      \
    _WX_DECLARE_PAIR( iterator, bool, Insert_Result, CLASSEXP )              \
                                                                             \
    wxEXPLICIT CLASSNAME( size_type hint = 100, hasher hf = hasher(),        \
                          key_equal eq = key_equal() )                       \
        : CLASSNAME##_wxImplementation_HashTable( hint, hf, eq,              \
                      CLASSNAME##_wxImplementation_KeyEx() ) {}              \
                                                                             \
    Insert_Result insert( const key_type& key )                              \
    {                                                                        \
        bool created;                                                        \
        Node *node = GetOrCreateNode( key, created );                        \
        return Insert_Result( iterator( node, this ), created );             \
    }                                                                        \
                                                                             \
    const_iterator find( const const_key_type& key ) const                   \
    {                                                                        \
        return const_iterator( GetNode( key ), this );                       \
    }                                                                        \
                                                                             \
    iterator find( const const_key_type& key )                               \
    {                                                                        \
        return iterator( GetNode( key ), this );                             \
    }                                                                        \
                                                                             \
    size_type erase( const key_type& k )                                     \
        { return CLASSNAME##_wxImplementation_HashTable::erase( k ); }       \
    void erase( const iterator& it ) { erase( *it ); }                       \
    void erase( const const_iterator& it ) { erase( *it ); }                 \
                                                                             \
    /* count() == 0 | 1 */                                                   \
    size_type count( const const_key_type& key )                             \
        { return GetNode( key ) ? 1 : 0; }                                   \
}

#endif // !wxUSE_STL || !defined(HAVE_STL_HASH_MAP)

// these macros are to be used in the user code
#define WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME) \
    _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, class )

// and these do exactly the same thing but should be used inside the
// library
#define WX_DECLARE_HASH_SET_WITH_DECL( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL) \
    _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL )

#define WX_DECLARE_EXPORTED_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME) \
    WX_DECLARE_HASH_SET_WITH_DECL( KEY_T, HASH_T, KEY_EQ_T, \
                                   CLASSNAME, class WXDLLEXPORT )

// delete all hash elements
//
// NB: the class declaration of the hash elements must be visible from the
//     place where you use this macro, otherwise the proper destructor may not
//     be called (a decent compiler should give a warning about it, but don't
//     count on it)!
#define WX_CLEAR_HASH_SET(type, hashset)                                     \
    WX_CLEAR_HASH_MAP(type, hashset)

#endif // _WX_HASHSET_H_


text:
package ch.admin.seco.jobroom.domain;

public enum UserInfoRole {
    JOB_SEEKER,
    COMPANY,
    PAV
}


text:
require 'nest_subclass'

describe NestSubclass do
  describe '.subclass' do
    before(:all) do
      class ::Foo
        extend NestSubclass
      end
      @subclass = ::Foo.subclass("hoge")
      @subclass_2 = ::Foo::Hoge.subclass("another")
    end

    it do
      expect(@subclass.name).to eq("Foo::Hoge")
    end

    it do
      expect(@subclass.superclass).to be Foo
    end

    it do
      expect(@subclass_2.superclass).to be Foo::Hoge
    end

    it do
      class ::Bar
        extend NestSubclass
      end

      sub = ::Bar.subclass("hoge") do
        def hoge
          :hoge!
        end
      end

      expect(sub.new.hoge).to be :hoge!
    end

    it do
      class ::Boo
        extend NestSubclass
      end
      k = ::Boo.subclass("hoge") do
        def hoge
          :yellow
        end
      end.subclass("another") do
        def hoge
          super.to_s + " blue"
        end
      end

      expect(k.new.hoge).to eq('yellow blue')
    end

    it do
      expect do
        k = nil
        2.times do
          class ::Too
            extend NestSubclass
          end
          k = ::Too.subclass("hoge") do
            def hoge
              :green
            end
          end.subclass("another") do
            def hoge
              super.to_s + " blue"
            end
          end
        end

        expect(k.new.hoge).to eq('green blue')
      end.to output(/warning/).to_stderr
    end
  end
end


text:
package org.smilec.smile.bu;

import org.smilec.smile.util.ActivityUtil;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class NetworkManager extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        NetworkInfo networkInfo = (NetworkInfo) intent
            .getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO);
        if (networkInfo.getType() == ConnectivityManager.TYPE_WIFI) {
            DisplayWifiState(context, intent);
        }
    }

    private void DisplayWifiState(Context context, Intent intent) {
        NetworkInfo currentNetworkInfo = (NetworkInfo) intent
            .getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO);
        NetworkInfo otherNetworkInfo = (NetworkInfo) intent
            .getParcelableExtra(ConnectivityManager.EXTRA_OTHER_NETWORK_INFO);

        if (currentNetworkInfo.equals(otherNetworkInfo)) {
            ActivityUtil.showLongToast(context, "IP changed! Current is " + currentNetworkInfo);
        }
    }
}


text:
require.ensure([], function(require) {
require("./26.async.js");
require("./52.async.js");
require("./104.async.js");
require("./207.async.js");
});
module.exports = 208;


text:
module ApiCaller
  class Route
    attr_reader :template, :http_verb

    def initialize(params)
      @template = params[:template]
      @http_verb  = params[:http_verb]
    end

    def build_request(context)
      params  = context.raw_params
      base_url = context.base_url

      route_template = Addressable::Template.new(template)
      url = route_template.expand(params)
      full_url = Addressable::URI.join(base_url, url).to_s

      excluded_params_keys = params.keys.to_symbol_arr - route_template.variables.to_symbol_arr
      # TODO:: change :post, :put to constants
      body = {}
      body = params.select { |k, _| excluded_params_keys.include? k } if [:post, :put].include? @http_verb

      ApiCaller::Request.new http_verb: http_verb, url: full_url, body: body
    end
  end
end


text:
InputField::~InputField()
{
#ifdef _WIN32
    this->neo20->kill();
    delete this->neo20;
    qDebug() << "qwertz keylayout active";
#endif
#ifdef __linux__
    QProcess setxkbmap;
    QStringList args;
    args << "-c" << "setxkbmap de && xset r 51";
    setxkbmap.start(QString("/bin/bash"), args);
    setxkbmap.waitForFinished();
    qDebug() << "qwertz keylayout active";
#endif
    delete this->settings;
    delete this->sound;
    if (this->words == NULL)
    {
        delete this->words;
    }
    delete this->timeoutTimer;
    delete this->sessionTimer;
    delete this->guiUpdateTimer;
    delete this->elapsed;
}

InputField::InputField(QObject *parent) :
    QTextEdit((QWidget*)parent),
    neo1(QString("graphics")+QDir::separator()+QString("neo1.png")),
    neo2(QString("graphics")+QDir::separator()+QString("neo2.png")),
    neo3(QString("graphics")+QDir::separator()+QString("neo3.png")),
    words(NULL)
{
#ifdef _WIN32
    this->neo20 = new QProcess();
    this->neo20->start(QString("external")+QDir::separator()+QString("neo20.exe"));
    qDebug() << "neo keylayout active";
#endif
#ifdef __linux__
    QProcess setxkbmap;
    QStringList args;
    args << "-c" << "setxkbmap lv && xmodmap external/neo_de.xmodmap && xset -r 51";
    setxkbmap.start(QString("/bin/bash"), args);
    setxkbmap.waitForFinished();
    qDebug() << "neo keylayout active";
#endif
    display = NULL;
    corrects = 0;
    mistakes = 0;
    errorstate = false;
    setLineWrapMode(QTextEdit::NoWrap);
    this->settings = new QSettings("settings.ini", QSettings::IniFormat);
    if (!this->settings->contains("statsCounter"))
    {
        this->settings->setValue("statsCounter", 0);
    }
    if (!this->settings->contains("blockOnError"))
    {
        this->settings->setValue("blockOnError", true);
    }
    if (!this->settings->contains("playErrorSound"))
    {
        this->settings->setValue("playErrorSound", true);
    }
    if (!this->settings->contains("fontSize"))
    {
        this->settings->setValue("fontSize", 20);
    }
    if (!this->settings->contains("goodLineA"))
    {
        this->settings->setValue("goodLineA", 120);
    }
    if (!this->settings->contains("goodLineE"))
    {
        this->settings->setValue("goodLineE", 2);
    }
    if (!this->settings->contains("badLineA"))
    {
        this->settings->setValue("badLineA", 100);
    }
    if (!this->settings->contains("badLineE"))
    {
        this->settings->setValue("badLineE", 3);
    }
    if (!this->settings->contains("pow"))
    {
        this->settings->setValue("pow", 2.0);
    }
    if (!this->settings->contains("visualErrorFeedback"))
    {
        this->settings->setValue("visualErrorFeedback", true);
    }
    if (!this->settings->contains("influencingSessions"))
    {
        this->settings->setValue("influencingSessions", 5);
    }
    if (!this->settings->contains("sessionDuration"))
    {
        this->settings->setValue("sessionDuration", 300);
    }
    if (!this->settings->contains("timeout"))
    {
        this->settings->setValue("timeout", 3000);
    }
    qDebug() << "generated missing settings";
    this->fontSize = this->settings->value("fontSize").toInt();
    this->sound = new QSound(QString("sounds")+QDir::separator()+QString("err.wav"));
    this->timeoutTimer = new QTimer();
    this->guiUpdateTimer = new QTimer();
    this->sessionTimer = new QTimer();
    this->elapsed = new QElapsedTimer();
    this->running = false;
    connect(this->timeoutTimer, SIGNAL(timeout()), this, SLOT(handleTimeout()));
    connect(this->guiUpdateTimer, SIGNAL(timeout()), this, SLOT(handleGuiUpdate()));
    connect(this->sessionTimer, SIGNAL(timeout()), this, SLOT(handleSessionEnd()));
    connect(this, SIGNAL(correctTextTyped()), this, SLOT(scrollDisplay()));
}

void InputField::scrollDisplay()
{
    emit scrollDisplay2((int)(((float)this->correctTextLength/this->display->toPlainText().split("\n").at(0).length())*this->display->horizontalScrollBar()->maximum()));
}

void InputField::handleTimeout()
{
    this->timeout = true;
    this->sessionTimer->stop();
    this->stats->timeout();
    this->timeUntilEnd -= this->elapsed->elapsed();
    this->elapsed->restart();
}

void InputField::handleGuiUpdate()
{
    if (!this->timeout)
    {
        this->timeUntilEnd -= this->elapsed->elapsed();
        this->elapsed->restart();
    }
    this->timeLeftLabel->setText(QString::number(this->timeUntilEnd/1000, 10)+" Sekunden");
    this->hitsLabel->setText(QString::number(corrects, 10)+" Richtige");
    this->mistakesLabel->setText(QString::number(mistakes, 10)+" Fehler");
    if (this->settings->value("sessionDuration").toInt()-this->timeUntilEnd/1000 == 0)
    {
        this->hitsPerMinuteLabel->setText("0 Zeichen/Minute");
    }
    else
    {
        this->hitsPerMinuteLabel->setText(QString::number((int)((corrects+mistakes)/(((float)(this->settings->value("sessionDuration").toInt()-this->timeUntilEnd/1000))/60)), 10)+" Zeichen/Minute");
    }
    if (corrects == 0)
    {
        this->mistakesRateLabel->setText("0 % Fehlerrate");
    }
    else
    {
        this->mistakesRateLabel->setText(QString::number((double)mistakes*100/(corrects+mistakes))+" % Fehlerrate");
    }
    this->guiUpdateTimer->setInterval(1000);
    this->guiUpdateTimer->setSingleShot(true);
    this->guiUpdateTimer->start();
}

void InputField::handleSessionEnd()
{
    int statsCounter = this->settings->value("statsCounter").toInt();
    this->stats->save(statsCounter, corrects, mistakes, this->lesson);
    statsCounter++;
    this->settings->setValue("statsCounter", QVariant(statsCounter));
    setReadOnly(true);
    clear();
    display->clear();
    this->timeoutTimer->stop();
    this->guiUpdateTimer->stop();
}

Wordpool* InputField::loadWordpool(QString& lesson)
{
    QString path = QString("wp")+QDir::separator()+lesson;
    QFile in(path);
    if (!in.open(QIODevice::ReadOnly))
    {
        qDebug() << "file" << path << "not openable";
    }
    Wordpool* wp = new Wordpool(this->stats);
    while (true)
    {
        QByteArray bytes = in.readLine();
        if (bytes.size() == 0)
        {
            break;
        }
//        QString str(bytes);
        QString str = QString::fromUtf8(bytes);
        str.remove("\n");
        str.remove("\r");
        wp->addWord(str);
    }
    wp->finalise();
    in.close();
    qDebug() << "loaded wordpool" << path;
    return wp;
}

void InputField::preinit(QTextEdit* display, Statistic* stats, QMainWindow* mw, QLabel* keyboard, QLabel* timeLeftLabel, QLabel* hitsLabel, QLabel* mistakesLabel, QLabel* hitsPerMinuteLabel, QLabel* mistakesRateLabel)
{
    this->display = display;
    this->stats = stats;
    this->mw = mw;
    this->keyboard = keyboard;
    this->keyboard->setPixmap(neo1);
    this->timeLeftLabel = timeLeftLabel;
    this->hitsLabel = hitsLabel;
    this->mistakesLabel = mistakesLabel;
    this->hitsPerMinuteLabel = hitsPerMinuteLabel;
    this->mistakesRateLabel = mistakesRateLabel;
    setReadOnly(true);
    connect(this, SIGNAL(scrollDisplay2(int)), this->display->horizontalScrollBar(), SLOT(setValue(int)));
}

void InputField::init()
{
    if (this->running)
    {
        abort();
    }
    this->running = true;
    qDebug() << "starting session";
    mistakes = 0;
    corrects = 0;
    errorstate = false;
    this->stats->load();
    QAction* action = (QAction*)QObject::sender();
    this->lesson = action->iconText();
    this->words = loadWordpool(this->lesson);
    display->clear();
    clear();
    setReadOnly(false);
    showText();
    this->timeout = true;
    this->firstKeyPress = true;
    this->correctTextLength = 0;
    this->timeUntilEnd = this->settings->value("sessionDuration").toInt()*1000;
    this->guiUpdateTimer->setInterval(1000);
    this->guiUpdateTimer->setSingleShot(true);
    this->guiUpdateTimer->start();
}

void InputField::keyReleaseEvent(QKeyEvent *e)
{
    if (e->key() == Qt::Key_Shift)
    {
        keyboard->setPixmap(neo1);
    }
    if (e->key() == -1)
    {
        keyboard->setPixmap(neo1);
    }
    if (isReadOnly())
    {
        return;
    }
    QTextEdit::keyReleaseEvent(e);
    if (this->settings->value("visualErrorFeedback").toBool())
    {
        setStyleSheet("QTextEdit { background-color: white }");
    }
}

void InputField::keyPressEvent(QKeyEvent* e)
{
    bool emitter = false;
    if (this->firstKeyPress)
    {
        this->timeoutTimer->setInterval(this->settings->value("timeout").toInt());
        this->timeoutTimer->setSingleShot(true);
        this->timeoutTimer->start();
        this->sessionTimer->setInterval(this->settings->value("sessionDuration").toInt()*1000);
        this->sessionTimer->setSingleShot(true);
        this->sessionTimer->start();
        this->firstKeyPress = false;
        this->elapsed->start();
        this->timeout = false;
        return;
    }
    if (this->timeout)
    {
        this->sessionTimer->start(this->timeUntilEnd);
        this->elapsed->restart();
    }
    else
    {
        this->timeoutTimer->stop();
    }
    this->timeoutTimer->setInterval(this->settings->value("timeout").toInt());
    this->timeoutTimer->setSingleShot(true);
    this->timeoutTimer->start();
    if (e->key() == Qt::Key_Shift)
    {
        keyboard->setPixmap(neo2);
    }
    if (e->key() == Qt::Key_Mode_switch)
    {
        keyboard->setPixmap(neo3);
    }
    if (isReadOnly())
    {
        return;
    }
    if (e->key() == Qt::Key_Backspace || e->key() == Qt::Key_Delete || e->key() == Qt::Key_Left || e->key() == Qt::Key_Right)
    {
        QTextEdit::keyPressEvent(e);
    }
    else
    {
        this->fontSize = this->settings->value("fontSize").toInt();
        QString key = e->text();
        if (key != QString(""))
        {
            if (e->key() == Qt::Key_Return)
            {
                key = QString("\n");
            }
            QString typedText = toPlainText()+key;
            QString displayText = this->display->toPlainText();
            if (displayText.left(typedText.length()).compare(typedText) == 0)
            {
                corrects++;
                errorstate = false;
                int prevprevIndex = typedText.length()-2-1;
                int prevIndex = typedText.length()-1-1;
                int nextnextIndex = typedText.length()+2-1;
                int nextIndex = typedText.length()+1-1;
                QChar prevprev('\0');
                QChar prev('\0');
                QChar next('\0');
                QChar nextnext('\0');
                if (prevprevIndex >= 0)
                {
                    prevprev = displayText.at(prevprevIndex);
                }
                if (prevIndex >= 0)
                {
                    prev = displayText.at(prevIndex);
                }
                if (nextnextIndex < displayText.length())
                {
                    nextnext = displayText.at(nextnextIndex);
                }
                if (nextIndex < displayText.length())
                {
                    next = displayText.at(nextIndex);
                }
                stats->reportSuccess(prevprev, prev, displayText.at(typedText.length()-1), next, nextnext);
                this->correctTextLength = typedText.length();
                emitter = true;
                QTextCursor cursor(textCursor());
                QTextCharFormat format;
                format.setBackground(QBrush(QColor("white")));
                format.setForeground(QBrush(QColor("green")));
                format.setFontPointSize(this->fontSize);
                cursor.setCharFormat(format);
                cursor.insertText(key);
                this->display->clear();
                QTextCursor cursor2(this->display->textCursor());
                QTextCharFormat format2;
                format2.setBackground(QBrush(QColor("white")));
                format2.setForeground(QBrush(QColor("black")));
                format2.setFontWeight(QFont::Normal);
                format2.setFontPointSize(this->fontSize);
                cursor2.setCharFormat(format2);
                cursor2.insertText(typedText);
                QTextCursor cursor3(this->display->textCursor());
                QTextCharFormat format3;
                format3.setBackground(QBrush(QColor("lightgrey")));
                format3.setForeground(QBrush(QColor("black")));
                format3.setFontWeight(QFont::Normal);
                format3.setFontPointSize(this->fontSize);
                cursor3.setCharFormat(format3);
                cursor3.insertText(displayText.left(typedText.length()+1).right(1));
                QTextCursor cursor4(this->display->textCursor());
                QTextCharFormat format4;
                format4.setBackground(QBrush(QColor("white")));
                format4.setForeground(QBrush(QColor("black")));
                format4.setFontWeight(QFont::Normal);
                format4.setFontPointSize(this->fontSize);
                cursor4.setCharFormat(format4);
                cursor4.insertText(displayText.right(displayText.length()-typedText.length()-1));
                if (e->key() == Qt::Key_Return)
                {
                    showText();
                    this->correctTextLength = 0;
                    emitter = true;
                }
            }
            else
            {
                if (this->settings->value("visualErrorFeedback").toBool())
                {
                    setStyleSheet("QTextEdit { background-color: red }");
                }
                if (this->settings->value("playErrorSound").toBool())
                {
                    this->sound->play();
                }
                if (!errorstate)//protect from followed mistakes
                {
                    mistakes++;
                    errorstate = true;
                    int prevprevIndex = typedText.length()-2-1;
                    int prevIndex = typedText.length()-1-1;
                    int nextnextIndex = typedText.length()+2-1;
                    int nextIndex = typedText.length()+1-1;
                    QChar prevprev('\0');
                    QChar prev('\0');
                    QChar next('\0');
                    QChar nextnext('\0');
                    if (prevprevIndex >= 0)
                    {
                        prevprev = displayText.at(prevprevIndex);
                    }
                    if (prevIndex >= 0)
                    {
                        prev = displayText.at(prevIndex);
                    }
                    if (nextnextIndex < displayText.length())
                    {
                        nextnext = displayText.at(nextnextIndex);
                    }
                    if (nextIndex < displayText.length())
                    {
                        next = displayText.at(nextIndex);
                    }
                    QChar wrong = e->text().at(0);
                    stats->reportMistake(prevprev, prev, displayText.at(typedText.length()-1), next, nextnext, wrong);
                }
                if (!this->settings->value("blockOnError").toBool())
                {
                    QTextCursor cursor(textCursor());
                    QTextCharFormat format;
                    format.setBackground(QBrush(QColor("red")));
                    format.setForeground(QBrush(QColor("black")));
                    format.setFontPointSize(this->fontSize);
                    cursor.setCharFormat(format);
                    cursor.insertText(key);
                }
            }
        }
    }
    this->timeout = false;
    if (emitter)
    {
        emit correctTextTyped();
    }
}

void InputField::abort()
{
    setReadOnly(true);
    clear();
    this->display->clear();
    this->running = false;
    qDebug() << "session aborted";
}

void InputField::showText()
{
    this->display->clear();
    QTextCursor cursor(this->display->textCursor());
    QTextCharFormat format;
    format.setFontWeight(QFont::Normal);
    format.setFontPointSize(this->fontSize);
    format.setBackground(QBrush(QColor("lightgrey")));
    format.setForeground(QBrush(QColor("black")));
    cursor.setCharFormat(format);
    QString word = this->words->getRandomWord();
    cursor.insertText(word.left(1));

    QTextCursor cursor2(this->display->textCursor());
    QTextCharFormat format2;
    format2.setFontWeight(QFont::Normal);
    format2.setFontPointSize(this->fontSize);
    format2.setBackground(QBrush(QColor("white")));
    format2.setForeground(QBrush(QColor("black")));
    cursor2.setCharFormat(format2);
    cursor2.insertText(word.right(word.length()-1));
    if (!word.contains(" "))
    {
        cursor2.insertText(" ");
        cursor2.insertText(this->words->getRandomWord());
        cursor2.insertText(" ");
        cursor2.insertText(this->words->getRandomWord());
        cursor2.insertText(" ");
        cursor2.insertText(this->words->getRandomWord());
        cursor2.insertText(" ");
        cursor2.insertText(this->words->getRandomWord());
        cursor2.insertText(" ");
        cursor2.insertText(this->words->getRandomWord());
        cursor2.insertText("\n");
    }
    else
    {
        cursor2.insertText("\n");
    }
    clear();
}


text:
package com.candicedailey.art;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class WebAppRunner {

    public static void main(String[] args) throws Exception {
        SpringApplication.run(WebAppRunner.class, args);
    }
}


text:
Link component will use the same props as `a` tag.

### Internal Link

A link which `href` is an internal link. will go to another page inside your app.

```js-example
var React = require('react');
var Link = require('fluxes/components/link.jsx');

module.exports = React.createClass({
  render: function() {
    return (
      <div>
        <Link href="/">Internal Link to Homepage</Link>
      </div>
    );
  }
});
```

### Button Link

A link without `href` is a button link. It will call the function of `onClick`.

```js-example
var React = require('react');
var Link = require('fluxes/components/link.jsx');

module.exports = React.createClass({
  alert: function() {
    alert('Alert!');
  },

  render: function() {
    return (
      <div>
        <Link onClick={this.alert}>Button Link</Link> <br/>
      </div>
    );
  }
});
```

### External Link

A link which `href` starts with "http" or `target` is `blank` is an external link.
It will go to another page outside your app.

```js-example
var React = require('react');
var Link = require('fluxes/components/link.jsx');

module.exports = React.createClass({
  render: function() {
    return (
      <div>
        <Link href="http://github.com">External Link in current tab</Link> <br/>
        <Link target="_blank" href="//github.com">External Link in a new tab</Link> <br/>
      </div>
    );
  }
});
```


text:
using System;
namespace DBlog.Data
{

    ///--------------------------------------------------------------------------------
    ///
    ///Persistent domain entity class representing 'PostLogin' entities.
    ///
    ///<remarks>
    ///
    ///Mapping information:
    ///This class maps to the 'PostLogin' table in the data source.
    ///</remarks>
    ///--------------------------------------------------------------------------------
    public class PostLogin
    {
#region " Generated Code Region "
        //Private field variables

        //Holds property values
        private System.Int32 m_Id;
        private Login m_Login;
        private Post m_Post;

        //Public properties
        ///--------------------------------------------------------------------------------
        ///
        ///Persistent primitive identity property.
        ///
        ///<remarks>
        ///This property is an identity property.
        ///The identity index for this property is '0'.
        ///This property accepts values of the type 'System.Int32'.
        ///The accessibility level for this property is 'PublicAccess'.
        ///The accessibility level for the field 'm_Id' that holds the value for this property is 'PrivateAccess'.
        ///
        ///Mapping information:
        ///The property maps to the column 'PostLogin_Id' in the data source.
        ///</remarks>
        ///--------------------------------------------------------------------------------
        public virtual System.Int32 Id
        {
            get
            {
                return m_Id;
            }
        }

        ///--------------------------------------------------------------------------------
        ///
        ///Persistent one-many reference property.
        ///
        ///<remarks>
        ///This property accepts references to objects of the type 'Login'.
        ///This property is part of a 'OneToMany' relationship.
        ///The inverse property for this property is 'Login.PostLogins'.
        ///The accessibility level for this property is 'PublicAccess'.
        ///The accessibility level for the field 'm_Login' that holds the value for this property is 'PrivateAccess'.
        ///
        ///Mapping information:
        ///The property maps to the column 'Login_Id' in the data source.
        ///</remarks>
        ///--------------------------------------------------------------------------------
        public virtual Login Login
        {
            get
            {
                return m_Login;
            }
            set
            {
                m_Login = value;
            }
        }

        ///--------------------------------------------------------------------------------
        ///
        ///Persistent one-many reference property.
        ///
        ///<remarks>
        ///This property accepts references to objects of the type 'Post'.
        ///This property is part of a 'OneToMany' relationship.
        ///The inverse property for this property is 'Post.PostLogins'.
        ///The accessibility level for this property is 'PublicAccess'.
        ///The accessibility level for the field 'm_Post' that holds the value for this property is 'PrivateAccess'.
        ///
        ///Mapping information:
        ///The property maps to the column 'Post_Id' in the data source.
        ///</remarks>
        ///--------------------------------------------------------------------------------
        public virtual Post Post
        {
            get
            {
                return m_Post;
            }
            set
            {
                m_Post = value;
            }
        }

#endregion //Generated Code Region

        //Add your synchronized custom code here:
#region " Synchronized Custom Code Region "
#endregion //Synchronized Custom Code Region

        //Add your unsynchronized custom code here:
#region " Unsynchronized Custom Code Region "

#endregion //Unsynchronized Custom Code Region

    }
}


text:
package stsc.frontend.zozka.components.simulation.dialogs;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.regex.Pattern;

import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType;
import javafx.scene.control.TextInputDialog;
import javafx.scene.control.Alert.AlertType;
import stsc.frontend.zozka.common.dialogs.TextAreaDialog;
import stsc.frontend.zozka.common.models.ExecutionDescription;
import stsc.frontend.zozka.common.models.NumberAlgorithmParameter;
import stsc.frontend.zozka.common.models.ParameterType;
import stsc.frontend.zozka.common.models.TextAlgorithmParameter;

/**
 * This class contain helper methods for
 * {@link CreateExecutionDescriptionDialog}
 */
final class CreateExecutionDescriptionDialogHelper {

	private static final String DOUBLE_DEFAULT_FROM = "0.0";
	private static final String DOUBLE_DEFAULT_STEP = "2.0";
	private static final String DOUBLE_DEFAULT_TO = "50.0";

	private static final String INTEGER_DEFAULT_FROM = "0";
	private static final String INTEGER_DEFAULT_STEP = "1";
	private static final String INTEGER_DEFAULT_TO = "22";

	static final Pattern PARAMETER_NAME_PATTERN = Pattern.compile("^_?[a-zA-Z]([\\w_])*$");

	static final class NumberParameters {

		private boolean valid = true;

		Optional<String> from = Optional.empty();
		Optional<String> step = Optional.empty();
		Optional<String> to = Optional.empty();

		public boolean isValid() {
			return valid;
		}
	}

	public void processAddParameterAction(final ExecutionDescription model) {
		final Optional<String> parameterName = getParameterName(model);
		if (!parameterName.isPresent()) {
			return;
		}
		final Optional<ParameterType> parameterType = getParameterType();
		if (!parameterType.isPresent()) {
			return;
		}
		switch (parameterType.get()) {
		case DOUBLE:
			addDoubleParameter(parameterName.get(), model);
			break;
		case INTEGER:
			addIntegerParameter(parameterName.get(), model);
			break;
		case STRING:
			addStringParameter(parameterName.get(), model);
			break;
		case SUB_EXECUTION:
			addSubExecutionParameter(parameterName.get(), model);
			break;
		default:
			break;
		}
	}

	private Optional<String> getParameterName(final ExecutionDescription model) {
		final Optional<String> parameterName = getParameterName();

		if (parameterName.isPresent() && model.parameterNameExists(parameterName.get())) {
			new TextAreaDialog("Parameter name does not match pattern", "You could add only one parameter (one for both for number or test tables).");
			return Optional.empty();
		}
		return parameterName;
	}

	private Optional<ParameterType> getParameterType() {
		final Alert alert = new Alert(AlertType.NONE, "Choose type for parameter");
		for (ParameterType pt : ParameterType.values()) {
			final ButtonType buttonType = new ButtonType(pt.getName());
			alert.getButtonTypes().add(buttonType);
		}
		final Optional<ButtonType> result = alert.showAndWait();
		if (result.isPresent()) {
			return Optional.ofNullable(ParameterType.findByName(result.get().getText()));
		}
		return Optional.empty();
	}

	private void addIntegerParameter(final String parameterName, final ExecutionDescription model) {
		CreateExecutionDescriptionDialogHelper.NumberParameters numberParameters = readAllIntegerParameters();
		if (numberParameters.isValid()) {
			model.addNumberAlgorithm(
					new NumberAlgorithmParameter(parameterName, ParameterType.INTEGER, numberParameters.from.get(), numberParameters.step.get(), numberParameters.to.get()));
		}
	}

	private void addDoubleParameter(final String parameterName, final ExecutionDescription model) {
		CreateExecutionDescriptionDialogHelper.NumberParameters numberParameters = readAllDoubleParameters();
		if (numberParameters.isValid()) {
			model.addNumberAlgorithm(
					new NumberAlgorithmParameter(parameterName, ParameterType.DOUBLE, numberParameters.from.get(), numberParameters.step.get(), numberParameters.to.get()));
		}
	}

	private void addStringParameter(final String parameterName, final ExecutionDescription model) {
		final List<String> values = getStringDomen("String Parameter");
		final String domen = TextAlgorithmParameter.createStringRepresentation(values);
		model.getTextAlgorithms().add(new TextAlgorithmParameter(parameterName, ParameterType.STRING, domen));
	}

	private void addSubExecutionParameter(final String parameterName, final ExecutionDescription model) {
		final List<String> values = getStringDomen("SubExecution Parameter");
		final String domen = TextAlgorithmParameter.createStringRepresentation(values);
		model.getTextAlgorithms().add(new TextAlgorithmParameter(parameterName, ParameterType.SUB_EXECUTION, domen));
	}

	/**
	 * ParameterName
	 */
	private Optional<String> getParameterName() {
		final TextInputDialog dialog = new TextInputDialog();
		dialog.setTitle("Enter Parameter Name");
		dialog.setHeaderText("Parameter name:");
		dialog.setContentText("Enter: ");
		final Optional<String> parameterName = dialog.showAndWait();

		if (parameterName.isPresent() && !PARAMETER_NAME_PATTERN.matcher(parameterName.get()).matches()) {
			new TextAreaDialog("Parameter name does not match pattern", "Parameter name should contain only letters, numbers and '_' symbol.");
			return Optional.empty();
		}
		return parameterName;
	}

	/**
	 * For {@link ParameterType#INTEGER}.
	 */

	private NumberParameters readAllIntegerParameters() {
		final String errorMessage = "Integer is a number (-)?([0-9])+";
		final NumberParameters result = new NumberParameters();
		result.from = readIntegerParameter(INTEGER_DEFAULT_FROM, "Enter From", "From: ", errorMessage);
		if (!result.from.isPresent()) {
			result.valid = false;
			return result;
		}
		result.step = readIntegerParameter(INTEGER_DEFAULT_STEP, "Enter Step", "Step: ", errorMessage);
		if (!result.step.isPresent()) {
			result.valid = false;
			return result;
		}
		result.to = readIntegerParameter(INTEGER_DEFAULT_TO, "Enter To", "To: ", errorMessage);
		if (!result.to.isPresent()) {
			result.valid = false;
			return result;
		}
		return result;
	}

	private Optional<String> readIntegerParameter(final String defaultValue, String masthead, String message, String errorMessage) {
		final TextInputDialog dialog = new TextInputDialog(defaultValue);
		dialog.setTitle("Integer Parameter");
		dialog.setHeaderText(masthead);
		dialog.setContentText(message);
		final Optional<String> integerParameter = dialog.showAndWait();
		if (!integerParameter.isPresent() || !validateInteger(integerParameter.get())) {
			new TextAreaDialog("Integer value is incorrect", errorMessage);
			return Optional.empty();
		}
		return Optional.of(integerParameter.get());
	}

	boolean validateInteger(final String integerValue) {
		return NumberAlgorithmParameter.integerParPattern.matcher(integerValue).matches();
	}

	/**
	 * For {@link ParameterType#DOUBLE}.
	 */

	private NumberParameters readAllDoubleParameters() {
		final String errorMessage = "Double is a number (-)?([0-9])+(.[0-9]+)?";
		final NumberParameters result = new NumberParameters();
		result.from = readDoubleParameter(DOUBLE_DEFAULT_FROM, "Double Parameter", "Enter From", "From: ", errorMessage);
		if (!result.from.isPresent()) {
			result.valid = false;
			return result;
		}
		result.step = readDoubleParameter(DOUBLE_DEFAULT_STEP, "Double Parameter", "Enter Step", "Step: ", errorMessage);
		if (!result.step.isPresent()) {
			result.valid = false;
			return result;
		}
		result.to = readDoubleParameter(DOUBLE_DEFAULT_TO, "Double Parameter", "Enter To", "To: ", errorMessage);
		if (!result.to.isPresent()) {
			result.valid = false;
			return result;
		}
		return result;
	}

	private Optional<String> readDoubleParameter(final String defaultValue, String title, String masthead, String message, String errorMessage) {
		final TextInputDialog dialog = new TextInputDialog(defaultValue);
		dialog.setTitle(title);
		dialog.setHeaderText(masthead);
		dialog.setContentText(message);
		final Optional<String> doubleParameter = dialog.showAndWait();
		if (!doubleParameter.isPresent() || !validateDouble(doubleParameter.get())) {
			new TextAreaDialog("Double value is incorrect", errorMessage);
			return Optional.empty();
		}
		return Optional.of(doubleParameter.get());
	}

	boolean validateDouble(final String doubleValue) {
		return NumberAlgorithmParameter.doubleParPattern.matcher(doubleValue).matches();
	}

	/**
	 * For {@link ParameterType#STRING} {@link ParameterType#SUB_EXECUTION}.
	 */

	private List<String> getStringDomen(String title) {
		final ArrayList<String> values = new ArrayList<>();
		while (true) {
			final TextInputDialog dialog = new TextInputDialog();
			dialog.setTitle(title);
			dialog.setContentText("Hack: add several divided by ','.\nPress 'Cancel' to finish enter.");
			final Optional<String> stringValue = dialog.showAndWait();
			if (stringValue.isPresent()) {
				values.add(stringValue.get());
			} else {
				break;
			}
		}
		return values;
	}
}


text:
require 'mechanize/test_case'

class TestMechanizePageMetaRefresh < Mechanize::TestCase

  def setup
    super

    @MR = Mechanize::Page::MetaRefresh

    @uri = URI 'http://example/here/'
  end

  def util_page delay, uri
    body = <<-BODY
<meta http-equiv="refresh" content="#{delay};url=#{uri}">
    BODY

    Mechanize::Page.new(@uri, nil, body, 200, @mech)
  end

  def util_meta_refresh page
    node = page.search('meta').first
    @MR.from_node node, page
  end

  def test_class_parse
    delay, uri, link_self = @MR.parse "0; url=http://localhost:8080/path", @uri
    assert_equal "0", delay
    assert_equal "http://localhost:8080/path", uri.to_s
    refute link_self

    delay, uri, link_self =
      @MR.parse "100.001; url=http://localhost:8080/path", @uri
    assert_equal "100.001", delay
    assert_equal "http://localhost:8080/path", uri.to_s
    refute link_self

    delay, uri, link_self =
      @MR.parse "0; url='http://localhost:8080/path'", @uri
    assert_equal "0", delay
    assert_equal "http://localhost:8080/path", uri.to_s
    refute link_self

    delay, uri, link_self =
      @MR.parse "0; url=\"http://localhost:8080/path\"", @uri
    assert_equal "0", delay
    assert_equal "http://localhost:8080/path", uri.to_s
    refute link_self

    delay, uri, link_self = @MR.parse "0; url=", @uri
    assert_equal "0", delay
    assert_equal "http://example/here/", uri.to_s
    assert link_self

    delay, uri, link_self = @MR.parse "0", @uri
    assert_equal "0", delay
    assert_equal "http://example/here/", uri.to_s
    assert link_self

    delay, uri, link_self = @MR.parse "   0;   ", @uri
    assert_equal "0", delay
    assert_equal "http://example/here/", uri.to_s
    assert link_self

    delay, uri, link_self = @MR.parse "   0 ;   ", @uri
    assert_equal "0", delay
    assert_equal "http://example/here/", uri.to_s
    assert link_self

    delay, uri, link_self = @MR.parse "0; UrL=http://localhost:8080/path", @uri
    assert_equal "0", delay
    assert_equal "http://localhost:8080/path", uri.to_s
    refute link_self

    delay, uri, link_self = @MR.parse "0 ; UrL = http://localhost:8080/path", @uri
    assert_equal "0", delay
    assert_equal "http://localhost:8080/path", uri.to_s
    refute link_self
  end

  def test_class_parse_funky
    delay, uri, link_self = @MR.parse "0; url=/funky?Welcome<%2Fb>", @uri

    assert_equal "0", delay
    assert_equal "http://example/funky?%3Cb%3EWelcome%3C%2Fb%3E",
                 uri.to_s

    refute link_self
  end

  def test_class_from_node
    page = util_page 5, 'http://b.example'
    link = util_meta_refresh page
    assert_equal 5, link.delay
    assert_equal 'http://b.example', link.href

    page = util_page 5, 'http://example/a'
    link = util_meta_refresh page
    assert_equal 5, link.delay
    assert_equal 'http://example/a', link.href

    page = util_page 5, 'test'
    link = util_meta_refresh page
    assert_equal 5, link.delay
    assert_equal 'test', link.href

    page = util_page 5, '/test'
    link = util_meta_refresh page
    assert_equal 5, link.delay
    assert_equal '/test', link.href

    page = util_page 5, nil
    link = util_meta_refresh page
    assert_equal 5, link.delay
    assert_nil link.href

    page = util_page 5, @uri
    link = util_meta_refresh page
    assert_equal 5, link.delay
    assert_equal 'http://example/here/', link.href
  end

  def test_class_from_node_no_content
    body = <<-BODY
<meta http-equiv="refresh">
    BODY

    page = Mechanize::Page.new(@uri, nil, body, 200, @mech)

    assert_nil util_meta_refresh page
  end

  def test_class_from_node_not_refresh
    body = <<-BODY
<meta http-equiv="other-thing" content="0;">
    BODY

    page = Mechanize::Page.new(@uri, nil, body, 200, @mech)

    assert_nil util_meta_refresh page
  end

  def test_meta_refresh_click_sends_no_referer
    page = util_page 0, '/referer'
    link = util_meta_refresh page
    refreshed = link.click
    assert_equal '', refreshed.body
  end
end


text:
<?php
/**
 * bbPress Forum Template
 */
?>
<?php get_header(); ?>
<?php $GLOBALS['sbg_sidebar'] = get_post_meta(get_the_ID(), 'sbg_selected_sidebar_replacement', true);  ?>

 <div <?php post_class('widget_container content_page'); ?>>
 	<?php echo jelly_breadcrumbs_options(); ?>

		<?php if ( ! have_posts() ) : ?>

<?php _e( 'Not Found', 'tie' ); ?>

<?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'tie' ); ?>

				<?php get_search_form(); ?>

		<?php endif; ?>

		<?php while ( have_posts() ) : the_post(); ?>
		<article <?php post_class('post-listing'); ?>>

<?php the_title(); ?>

					<?php the_content(); ?>

		<?php endwhile;?>

                <?php if (is_active_sidebar('bbpress-sidebar')){ dynamic_sidebar('bbpress-sidebar'); }?>

<?php get_footer(); ?>


text:
package azkaban;

import static azkaban.Constants.ConfigurationKeys.HADOOP_CONF_DIR_PATH;
import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull;

import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;

import javax.sql.DataSource;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.codahale.metrics.MetricRegistry;
import com.google.inject.AbstractModule;
import com.google.inject.Inject;
import com.google.inject.Provides;
import com.google.inject.Scopes;
import com.google.inject.Singleton;

import azkaban.db.AzkabanDataSource;
import azkaban.db.DatabaseOperator;
import azkaban.db.DatabaseOperatorImpl;
import azkaban.db.H2FileDataSource;
import azkaban.db.MySQLDataSource;
import azkaban.db.OracleDataSource;
import azkaban.executor.AlerterHolder;
import azkaban.executor.ExecutorLoader;
import azkaban.executor.ExecutorManager;
import azkaban.executor.JdbcExecutorLoader;
import azkaban.executor.JdbcExecutorLoaderOracle;
import azkaban.project.JdbcProjectImpl;
import azkaban.project.JdbcProjectImplOracle;
import azkaban.project.ProjectLoader;
import azkaban.spi.AzkabanException;
import azkaban.spi.Storage;
import azkaban.spi.StorageException;
import azkaban.storage.HdfsAuth;
import azkaban.storage.StorageImplementationType;
import azkaban.trigger.JdbcTriggerImpl;
import azkaban.trigger.JdbcTriggerImplOracle;
import azkaban.trigger.TriggerLoader;
import azkaban.utils.CryptUtils;
import azkaban.utils.Props;

/**
 * This Guice module is currently a one place container for all bindings in the
 * current module. This is intended to help during the migration process to
 * Guice. Once this class starts growing we can move towards more modular
 * structuring of Guice components.
 */
public class AzkabanCommonModule extends AbstractModule {

	private static final Logger log = LoggerFactory.getLogger(AzkabanCommonModule.class);

	private final Props props;
	private final AzkabanCommonModuleConfig config;
	private final String CRYPT_KEY = "JAVAPLAT-PSBC-TJ";

	public AzkabanCommonModule(final Props props) {
		this.props = props;
		this.config = new AzkabanCommonModuleConfig(props);
	}

	@Override
	protected void configure() {
		if ("oracle".equals(this.getDataSource(props).getDBType())) {
			bind(ExecutorLoader.class).to(JdbcExecutorLoaderOracle.class).in(Scopes.SINGLETON);
			bind(TriggerLoader.class).to(JdbcTriggerImplOracle.class).in(Scopes.SINGLETON);
			bind(ProjectLoader.class).to(JdbcProjectImplOracle.class).in(Scopes.SINGLETON);
		} else {
			bind(ExecutorLoader.class).to(JdbcExecutorLoader.class).in(Scopes.SINGLETON);
			bind(TriggerLoader.class).to(JdbcTriggerImpl.class).in(Scopes.SINGLETON);
			bind(ProjectLoader.class).to(JdbcProjectImpl.class).in(Scopes.SINGLETON);
		}
		bind(Props.class).toInstance(this.config.getProps());
		bind(Storage.class).to(resolveStorageClassType()).in(Scopes.SINGLETON);
		bind(HdfsAuth.class).in(Scopes.SINGLETON);
		bind(DatabaseOperator.class).to(DatabaseOperatorImpl.class).in(Scopes.SINGLETON);
		bind(DataSource.class).to(AzkabanDataSource.class);
		bind(ExecutorManager.class).in(Scopes.SINGLETON);
		bind(AlerterHolder.class).in(Scopes.SINGLETON);
		bind(MetricRegistry.class).in(Scopes.SINGLETON);
	}

	public Class<? extends Storage> resolveStorageClassType() {
		final StorageImplementationType type = StorageImplementationType.from(this.config.getStorageImplementation());
		if (type != null) {
			return type.getImplementationClass();
		} else {
			return loadCustomStorageClass(this.config.getStorageImplementation());
		}
	}

	private Class<? extends Storage> loadCustomStorageClass(final String storageImplementation) {
		try {
			return (Class<? extends Storage>) Class.forName(storageImplementation);
		} catch (final ClassNotFoundException e) {
			throw new StorageException(e);
		}
	}

	// todo kunkun-tang: the below method should moved out to azkaban-db module
	// eventually.
	@Inject
	@Provides
	@Singleton
	public AzkabanDataSource getDataSource(final Props props) {
		final String databaseType = props.getString("database.type");

		if (databaseType.equals("h2")) {
			final String path = props.getString("h2.path");
			final Path h2DbPath = Paths.get(path).toAbsolutePath();
			log.info("h2 DB path: " + h2DbPath);
			return new H2FileDataSource(h2DbPath);
		}
		if (databaseType.equals("oracle")) {
			final String url = props.getString("oracle.url");
			final String user = props.getString("oracle.user");
			String password = props.getString("oracle.password");
			final int numConnections = props.getInt("oracle.numconnections");

			return new OracleDataSource(url, user, password, numConnections);
		} else {
			final int port = props.getInt("mysql.port");
			final String host = props.getString("mysql.host");
			final String database = props.getString("mysql.database");
			final String user = props.getString("mysql.user");
			String password = props.getString("mysql.password");

			final int numConnections = props.getInt("mysql.numconnections");

			return new MySQLDataSource(host, port, database, user, password, numConnections);
		}

	}

	@Inject
	@Provides
	@Singleton
	public Configuration createHadoopConfiguration() {
		final String hadoopConfDirPath = requireNonNull(this.props.get(HADOOP_CONF_DIR_PATH));

		final File hadoopConfDir = new File(requireNonNull(hadoopConfDirPath));
		checkArgument(hadoopConfDir.exists() && hadoopConfDir.isDirectory());

		final Configuration hadoopConf = new Configuration(false);
		hadoopConf.addResource(new org.apache.hadoop.fs.Path(hadoopConfDirPath, "core-site.xml"));
		hadoopConf.addResource(new org.apache.hadoop.fs.Path(hadoopConfDirPath, "hdfs-site.xml"));
		hadoopConf.set("fs.hdfs.impl", org.apache.hadoop.hdfs.DistributedFileSystem.class.getName());
		return hadoopConf;
	}

	@Inject
	@Provides
	@Singleton
	public FileSystem createHadoopFileSystem(final Configuration hadoopConf, final HdfsAuth auth) {
		try {
			auth.authorize();
			return FileSystem.get(hadoopConf);
		} catch (final IOException e) {
			log.error("Unable to initialize HDFS", e);
			throw new AzkabanException(e);
		}
	}

	@Provides
	public QueryRunner createQueryRunner(final AzkabanDataSource dataSource) {
		return new QueryRunner(dataSource);
	}
}


text:
/*!
 * numbro.js language configuration
 * language : German
 * locale: Germany
 * author : Marco Krage : https://github.com/sinky
 *
 * Generally useful in Germany, Austria, Luxembourg, Belgium
 */
(function(){"use strict";var a={langLocaleCode:"de-DE",cultureCode:"de-DE",delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(){return"."},currency:{symbol:"€",position:"postfix",spaceSeparated:!0,code:"EUR"},defaults:{currencyFormat:",4"},formats:{fourDigits:"4 a",fullWithTwoDecimals:",0.00 $",fullWithTwoDecimalsNoCurrency:",0.00",fullWithNoDecimals:",0 $"}};
// CommonJS
"undefined"!=typeof module&&module.exports&&(module.exports=a),
// Browser
"undefined"!=typeof window&&window.numbro&&window.numbro.culture&&window.numbro.culture(a.cultureCode,a)}).call("undefined"==typeof window?this:window);


text:
namespace radius {
namespace {

const int BUFLEN = 1000;
int s;
bool isRunning;
}
void initBind(const char *addr, const int port = 0) {

    if (isRunning) {
        std::cerr<<"initBind() ran twice";
        return;
    }
    struct sockaddr_in server;

    s = createSocket();
    initAddr(server,std::string(addr),port);
    bindSocket(s,server);

    isRunning = true;
}

void unbind() {
    close(s);
    isRunning = false;
}

packets::Packet recvPacket() {
    if (!isRunning) {
        std::cerr<<"You have to call initBind() first"<<std::endl;
        exit(EXIT_FAILURE);
    }
    socklen_t slen = sizeof(sockaddr_in);
    int recv_len;
    std::vector<byte> buf(BUFLEN, '\0');
    struct sockaddr_in src_addr;

    if ((recv_len = recvfrom(s, &buf[0], buf.size(), 0,(struct sockaddr *)&src_addr, &slen)) == -1) {
        if (errno == EINTR) {
            std::cout << "Stopping server.."<<std::endl;
        } else {
            std::cerr<<"recvfrom() failed with errno code : "<< errno<<std::endl;
        }
        unbind();
        exit(EXIT_FAILURE);
    }
    return packets::Packet(buf, src_addr);
}
void sendPacket(packets::Packet sen_pack) {
    if (!isRunning) {
        std::cerr<<"You have to call initBind() first"<<std::endl;
        exit(EXIT_FAILURE);
    }
    sockaddr_in dest_addr = sen_pack.addr;
    std::vector<byte> buf(sen_pack.bytes.begin(), sen_pack.bytes.end());

    if (sendto(s, &buf[0], buf.size(), 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr)) ==
        -1) {
        std::cerr<<"sendto() failed with errno code : "<<errno<<std::endl;
        exit(EXIT_FAILURE);
    }
}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<View xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/divider"
    android:layout_width="match_parent"
    android:layout_height="1dp"
    android:layout_marginBottom="8dp"
    android:layout_marginTop="8dp"
    android:background="#B6B6B6" />


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more contributor
  license agreements.  See the NOTICE.txt file distributed with this work for
  additional information regarding copyright ownership.  The ASF licenses this
  file to you under the Apache License, Version 2.0 (the "License"); you may not
  use this file except in compliance with the License.  You may obtain a copy of
  the License at

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

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
  License for the specific language governing permissions and limitations under
  the License.
-->
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

  <display-name>CAS Product Server Web Application</display-name>

  <servlet>
    <servlet-name>RSSServlet</servlet-name>
    <servlet-class>
      org.apache.oodt.cas.product.rss.RSSProductServlet
    </servlet-class>
  </servlet>

  <servlet>
    <servlet-name>RSSTransferServlet</servlet-name>
    <servlet-class>
      org.apache.oodt.cas.product.rss.RSSProductTransferServlet
    </servlet-class>
  </servlet>

  <servlet>
    <servlet-name>RDFProductServlet</servlet-name>
    <servlet-class>
      org.apache.oodt.cas.product.rdf.RDFProductServlet
    </servlet-class>
  </servlet>

  <servlet>
    <servlet-name>RDFDatasetServlet</servlet-name>
    <servlet-class>
      org.apache.oodt.cas.product.rdf.RDFDatasetServlet
    </servlet-class>
  </servlet>

  <servlet>
    <servlet-name>DataDeliveryServlet</servlet-name>
    <servlet-class>
      org.apache.oodt.cas.product.data.DataDeliveryServlet
    </servlet-class>
  </servlet>

  <servlet>
    <servlet-name>DatasetDeliveryServlet</servlet-name>
    <servlet-class>
      org.apache.oodt.cas.product.data.DatasetDeliveryServlet
    </servlet-class>
  </servlet>

  <servlet>
    <servlet-name>CasProductJaxrsServlet</servlet-name>
    <servlet-class>
       org.apache.oodt.cas.product.jaxrs.servlets.CasProductJaxrsServlet
    </servlet-class>
    <init-param>
      <param-name>jaxrs.serviceClasses</param-name>
      <param-value>
        org.apache.oodt.cas.product.jaxrs.services.CasProductJaxrsService
      </param-value>
    </init-param>
    <init-param>
      <param-name>jaxrs.providers</param-name>
      <param-value>
        org.apache.cxf.jaxrs.provider.json.JSONProvider,
        org.apache.oodt.cas.product.jaxrs.writers.ReferenceFileWriter,
        org.apache.oodt.cas.product.jaxrs.writers.ReferenceZipWriter,
        org.apache.oodt.cas.product.jaxrs.writers.ReferenceRssWriter,
        org.apache.oodt.cas.product.jaxrs.writers.ProductZipWriter,
        org.apache.oodt.cas.product.jaxrs.writers.ProductRssWriter,
        org.apache.oodt.cas.product.jaxrs.writers.DatasetZipWriter,
        org.apache.oodt.cas.product.jaxrs.writers.DatasetRdfWriter,
        org.apache.oodt.cas.product.jaxrs.writers.DatasetRssWriter,
        org.apache.oodt.cas.product.jaxrs.writers.TransfersRssWriter,
        org.apache.oodt.cas.product.jaxrs.exceptionmappers.NotFoundExceptionMapper,
        org.apache.oodt.cas.product.jaxrs.exceptionmappers.BadRequestExceptionMapper,
        org.apache.oodt.cas.product.jaxrs.exceptionmappers.InternalServerErrorExceptionMapper,
        org.apache.oodt.cas.product.jaxrs.exceptionmappers.CasProductExceptionMapper,
      </param-value>
    </init-param>
    <init-param>
      <param-name>jaxrs.inInterceptors</param-name>
      <param-value>
        org.apache.oodt.cas.product.jaxrs.filters.BackwardsCompatibleInterceptor
      </param-value>
    </init-param>
    <init-param>
      <param-name>jaxrs.scope</param-name>
      <param-value>prototype</param-value>
    </init-param>
    <init-param>
      <param-name>jaxrs.extensions</param-name>
      <param-value>
        file=application/octet-stream
        json=application/json
        rdf=application/rdf+xml
        rss=application/rss+xml
        xml=application/xml
        zip=application/zip
      </param-value>
    </init-param>
  </servlet>

  <servlet>
    <servlet-name>CasProductJaxrsServletV2</servlet-name>
    <servlet-class>
      org.apache.oodt.cas.product.jaxrs.servlets.CasProductJaxrsServlet
    </servlet-class>
    <init-param>
      <param-name>jaxrs.serviceClasses</param-name>
      <param-value>
        org.apache.oodt.cas.product.jaxrs.services.FileManagerJaxrsServiceV2
      </param-value>
    </init-param>
    <init-param>
      <param-name>jaxrs.providers</param-name>
      <param-value>
        org.apache.oodt.cas.product.jaxrs.exceptionmappers.NotFoundExceptionMapper,
        org.apache.oodt.cas.product.jaxrs.exceptionmappers.BadRequestExceptionMapper,
        org.apache.oodt.cas.product.jaxrs.exceptionmappers.InternalServerErrorExceptionMapper,
        org.apache.oodt.cas.product.jaxrs.exceptionmappers.CasProductExceptionMapper,
      </param-value>
    </init-param>
    <init-param>
      <param-name>jaxrs.extensions</param-name>
      <param-value>
        file=application/octet-stream
        json=application/json
        rdf=application/rdf+xml
        rss=application/rss+xml
        xml=application/xml
        zip=application/zip
      </param-value>
    </init-param>
  </servlet>

  <servlet-mapping>
    <servlet-name>RSSServlet</servlet-name>
    <url-pattern>/viewRecent</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>RSSTransferServlet</servlet-name>
    <url-pattern>/viewTransfers</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>RDFProductServlet</servlet-name>
    <url-pattern>/rdf</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
      <servlet-name>RDFDatasetServlet</servlet-name>
      <url-pattern>/rdf/dataset</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>DataDeliveryServlet</servlet-name>
    <url-pattern>/data</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>DatasetDeliveryServlet</servlet-name>
    <url-pattern>/dataset</url-pattern>
  </servlet-mapping>

  <!--FM Product JAXRS V2 REST APIs mapping-->
  <servlet-mapping>
    <servlet-name>CasProductJaxrsServletV2</servlet-name>
    <url-pattern>/jaxrs/v2/*</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>CasProductJaxrsServlet</servlet-name>
    <url-pattern>/jaxrs/*</url-pattern>
  </servlet-mapping>

  <!-- CORS Header Filtering -->
  <filter>
    <filter-name>CorsFilter</filter-name>
    <filter-class>org.apache.oodt.cas.product.jaxrs.filters.CORSFilter</filter-class>
  </filter>

  <filter-mapping>
    <filter-name>CorsFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

</web-app>


text:
import React from 'react';
import Action from 'dist/actions/actions';

var Browse = React.createClass({
    statics: {
	    fetchData (params) {
	      return Action.usersLoad.triggerPromise().then((res) => res);
	    }
  	},
    getInitialState() {
    	return {data: this.props.data.Browse};
  	},
	render(){
		var rows=this.state.data.map(function(user){
			var url='#/detail/'+user.userName
			return
{user.name}	{user.email}
;
		});

		return(

						Name
						Email

					{rows}

			);
	}

});

export default Browse


text:
require 'spec_helper'

describe IssueObserver do
  let(:some_user)      { create :user }
  let(:assignee)       { create :user }
  let(:author)         { create :user }
  let(:mock_issue)     { create(:issue, assignee: assignee, author: author) }

  before { subject.stub(:current_user).and_return(some_user) }
  before { subject.stub(:current_commit).and_return(nil) }
  before { subject.stub(notification: double('NotificationService').as_null_object) }
  before { mock_issue.project.stub_chain(:repository, :commit).and_return(nil) }

  subject { IssueObserver.instance }

  describe '#after_create' do
    it 'trigger notification to send emails' do
      subject.should_receive(:notification)

      subject.after_create(mock_issue)
    end

    it 'should create cross-reference notes' do
      other_issue = create(:issue)
      mock_issue.stub(references: [other_issue])

      Note.should_receive(:create_cross_reference_note).with(other_issue, mock_issue,
        some_user, mock_issue.project)
      subject.after_create(mock_issue)
    end
  end

  context '#after_close' do
    context 'a status "closed"' do
      before { mock_issue.stub(state: 'closed') }

      it 'note is created if the issue is being closed' do
        Note.should_receive(:create_status_change_note).with(mock_issue, mock_issue.project, some_user, 'closed', nil)

        subject.after_close(mock_issue, nil)
      end

      it 'trigger notification to send emails' do
        subject.notification.should_receive(:close_issue).with(mock_issue, some_user)
        subject.after_close(mock_issue, nil)
      end

      it 'appends a mention to the closing commit if one is present' do
        commit = double('commit', gfm_reference: 'commit 123456')
        subject.stub(current_commit: commit)

        Note.should_receive(:create_status_change_note).with(mock_issue, mock_issue.project, some_user, 'closed', commit)

        subject.after_close(mock_issue, nil)
      end
    end

    context 'a status "reopened"' do
      before { mock_issue.stub(state: 'reopened') }

      it 'note is created if the issue is being reopened' do
        Note.should_receive(:create_status_change_note).with(mock_issue, mock_issue.project, some_user, 'reopened', nil)

        subject.after_reopen(mock_issue, nil)
      end
    end
  end

  context '#after_update' do
    before(:each) do
      mock_issue.stub(:is_being_reassigned?).and_return(false)
    end

    context 'notification' do
      it 'triggered if the issue is being reassigned' do
        mock_issue.should_receive(:is_being_reassigned?).and_return(true)
        subject.should_receive(:notification)

        subject.after_update(mock_issue)
      end

      it 'is not triggered if the issue is not being reassigned' do
        mock_issue.should_receive(:is_being_reassigned?).and_return(false)
        subject.should_not_receive(:notification)

        subject.after_update(mock_issue)
      end
    end

    context 'cross-references' do
      it 'notices added references' do
        mock_issue.should_receive(:notice_added_references)

        subject.after_update(mock_issue)
      end
    end
  end
end


text:
global using System;
global using System.IO;
global using static System.Text.Encoding;


text:
import { browser, element, by, protractor } from 'protractor/globals';
import { waitForElementPresence, waitForStalenessOf } from '../utils/e2e_util';
var Promise = require('bluebird');

export class SensorListPage {

    clickOnActionsAndWait(parserNames: string[], clickOnClassName: string, waitOnClassName: string) {
        let queueForClick = Promise.resolve();
        parserNames.forEach((name) => {
            queueForClick = queueForClick.then((result) => {
                return this.getIconButton(name, clickOnClassName).click();
            });
        });

        return queueForClick.then(() => {
            let promiseArray = [];
            parserNames.map(name => {
                promiseArray.push(this.waitForElement(this.getIconButton(name, waitOnClassName)));
            });

            return protractor.promise.all(promiseArray).then(args => {
                return args;
            });
        });
    }

    clickOnDropdownAndWait(parserNames: string[], dropDownLinkName: string, waitOnClassName: string) {
        return protractor.promise.all([this.toggleSelectAll(), this.toggleDropdown()]).then(() => {

            return element(by.css('span[data-action=\"'+ dropDownLinkName +'\"]')).click().then(() => {
                let promiseArray = [];
                parserNames.map(name => {
                    promiseArray.push(this.waitForElement(this.getIconButton(name, waitOnClassName)));
                });

                return protractor.promise.all(promiseArray).then(args => {
                    return this.toggleSelectAll().then(() => {
                        return args;
                    })
                });
            });
        });
    }

    closePane(className: string ='.close-button') {
        return this.waitForElement(element(by.css(className))).then(() => {
            return element(by.css(className)).click();
        });
    }

    disableParsers(names: string[]) {
        return this.clickOnActionsAndWait(names, 'i.fa-ban', 'i.fa-check-circle-o');
    }

    disableParsersFromDropdown(names: string[]) {
        return this.clickOnDropdownAndWait(names, 'Disable', 'i.fa-check-circle-o');
    }

    deleteParser(name: string) {
        return this.getIconButton(name, '.fa-trash-o').click().then(() => {
            browser.sleep(1000);
            return element(by.css('.metron-dialog .btn-primary')).click().then(() => {
                browser.sleep(1000);
                return element(by.css('.alert .close')).click().then(() => {
                    return waitForStalenessOf(element(by.cssContainingText('td', name))).then(() =>{
                        return true;
                    });
                })
            });
        });
    }

    enableParsers(names: string[]) {
        return this.clickOnActionsAndWait(names, 'i.fa-check-circle-o', 'i.fa-ban');
    }

    enableParsersFromDropdown(names: string[]) {
        return this.clickOnDropdownAndWait(names, 'Enable', 'i.fa-ban');
    }

    getActions(name: string) {
        return element.all(by.css('table>tbody>tr')).filter(row => {
            return row.all(by.tagName('td')).get(0).getText().then(pName => {
                return pName === name;
            })
        }).get(0).all(by.tagName('i')).map(icon => {
            return icon.getAttribute('class').then(classNames => {
                let className = classNames.replace('fa ', '').replace('fa-lg', '').replace('fa-spin  fa-fw', '').trim();
                return {classNames: className, displayed: icon.isDisplayed()};
            });
        });
    }

    getAddButton() {
        return element(by.css('.metron-add-button.hexa-button .fa-plus')).isPresent();
    }

    getColumnValues(colId: number) {
        return element.all(by.css('table tbody tr')).map(function(elm) {
            return elm.all(by.css('td')).get(colId).getText();
        });
    }

    getDropdownActionState() {
        return protractor.promise.all([
            element.all(by.css('.dropdown.open .dropdown-menu span:not(.disabled)')).count(),
            element.all(by.css('.dropdown.open .dropdown-menu span.disabled')).count(),
            element.all(by.css('.dropdown-menu')).isDisplayed()
        ]).then(args => {
            return  {
                enabled: args[0],
                disabled: args[1],
                displayed: args[2][0],
            }
        });
    }

    getIconButton(name: string, className: string) {
        return element.all(by.css('table>tbody>tr')).filter(row => {
            return row.all(by.tagName('td')).get(0).getText().then(pName => {
                return pName === name;
            })
        }).get(0).element(by.css(className));
    }

    getParserCount() {
        browser.waitForAngular();
        return element.all(by.css('table>tbody>tr')).count();
    }

    getRow(name: string) {
        return element.all(by.css('table>tbody>tr')).filter(row => {
            return row.all(by.tagName('td')).get(0).getText().then(pName => {
                return pName === name;
            })
        }).get(0);
    }

    getSelectedRowCount() {
        return element.all(by.css('tr.active')).count();
    }

    getSortOrder(name: string) {
        return element(by.linkText(name)).element(by.tagName('i')).getAttribute('class');
    }

    getTableColumnNames() {
        return element.all(by.css('table th a')).map(function(elm) {
            return elm.getText();
        });
    }

    getTitle() {
        return element(by.css('.metron-title')).getText();
    }

    load() {
        return browser.get('/sensors');
    }

    openDetailsPane(name: string) {
        return this.getRow(name).click().then(() =>{
            return browser.getCurrentUrl();
        });
    }

    openEditPane(name: string) {
        let row = element(by.cssContainingText('td', name));
        return waitForElementPresence(row).then(() => {
            return this.getIconButton(name, '.fa-pencil').click().then(() =>{
                return browser.getCurrentUrl();
            });
        })
    }

    openEditPaneAndClose(name: string) {
        return this.getIconButton(name, '.fa-pencil').click().then(() =>{
            let url = browser.getCurrentUrl();
            browser.sleep(500);
            return this.closePane('.main.close-button').then(() => {
                return url;
            });
        });
    }

    startParsers(names: string[]) {
        return this.clickOnActionsAndWait(names, 'i.fa-play', 'i.fa-stop');
    }

    startParsersFromDropdown(names: string[]) {
        return this.clickOnDropdownAndWait(names, 'Start', 'i.fa-stop');
    }

    stopParsers(names: string[]) {
        return this.clickOnActionsAndWait(names, 'i.fa-stop', 'i.fa-play');
    }

    stopParsersFromDropdown(names: string[]) {
        return this.clickOnDropdownAndWait(names, 'Stop', 'i.fa-play');
    }

    toggleDropdown() {
        return element.all(by.id('dropdownMenu1')).click();
    }

    toggleRowSelect(name: string) {
        element.all(by.css('label[for=\"'+name+'\"]')).click();
    }

    toggleSelectAll() {
        return element.all(by.css('label[for="select-deselect-all"]')).click();
    }

    toggleSort(name: string) {
        element.all(by.linkText(name)).click();
    }

    waitForElement ( _element ) {
        var EC = protractor.ExpectedConditions;
        return browser.wait(EC.visibilityOf(_element));
    };
}


text:
<?php

namespace Google\Service\Compute;

class HealthCheckReference extends \Google\Model
{
  /**
   * @var string
   */
  public $healthCheck;

  /**
   * @param string
   */
  public function setHealthCheck($healthCheck)
  {
    $this->healthCheck = $healthCheck;
  }
  /**
   * @return string
   */
  public function getHealthCheck()
  {
    return $this->healthCheck;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(HealthCheckReference::class, 'Google_Service_Compute_HealthCheckReference');


text:
<?php
/**
 * Created by IntelliJ IDEA.
 * User: sebastian
 * Date: 05.05.15
 * Time: 10:36
 */

namespace Sandstorm\Newsletter\Domain\Repository;
use TYPO3\Flow\Persistence\Doctrine\Repository;
use TYPO3\Flow\Annotations as Flow;

/**
 * Class ReceiverSourceRepository
 * @package Sandstorm\Newsletter\Domain\Repository
 * @Flow\Scope("singleton")
 */
class UnsubscribeListRepository extends Repository {

}


text: Simple python script to upload files to pastebin