text:
package org.springframework.web.util;

import java.net.URI;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

import org.springframework.lang.Nullable;
import org.springframework.util.CollectionUtils;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.util.StringUtils;

/**
 * Utility methods for URI encoding and decoding based on RFC 3986.
 *
 *
There are two types of encode methods:
 *

 *
{@code "encodeXyz"} -- these encode a specific URI component (e.g. path,
 * query) by percent encoding illegal characters, which includes non-US-ASCII
 * characters, and also characters that are otherwise illegal within the given
 * URI component type, as defined in RFC 3986. The effect of this method, with
 * regards to encoding, is comparable to using the multi-argument constructor
 * of {@link URI}.
 *
{@code "encode"} and {@code "encodeUriVariables"} -- these can be used
 * to encode URI variable values by percent encoding all characters that are
 * either illegal, or have any reserved meaning, anywhere within a URI.
 *

 *
 * @author Arjen Poutsma
 * @author Juergen Hoeller
 * @author Rossen Stoyanchev
 * @since 3.0
 * @see RFC 3986
 */
public abstract class UriUtils {

	/**
	 * Encode the given URI scheme with the given encoding.
	 * @param scheme the scheme to be encoded
	 * @param encoding the character encoding to encode to
	 * @return the encoded scheme
	 */
	public static String encodeScheme(String scheme, String encoding) {
		return encode(scheme, encoding, HierarchicalUriComponents.Type.SCHEME);
	}

	/**
	 * Encode the given URI scheme with the given encoding.
	 * @param scheme the scheme to be encoded
	 * @param charset the character encoding to encode to
	 * @return the encoded scheme
	 * @since 5.0
	 */
	public static String encodeScheme(String scheme, Charset charset) {
		return encode(scheme, charset, HierarchicalUriComponents.Type.SCHEME);
	}

	/**
	 * Encode the given URI authority with the given encoding.
	 * @param authority the authority to be encoded
	 * @param encoding the character encoding to encode to
	 * @return the encoded authority
	 */
	public static String encodeAuthority(String authority, String encoding) {
		return encode(authority, encoding, HierarchicalUriComponents.Type.AUTHORITY);
	}

	/**
	 * Encode the given URI authority with the given encoding.
	 * @param authority the authority to be encoded
	 * @param charset the character encoding to encode to
	 * @return the encoded authority
	 * @since 5.0
	 */
	public static String encodeAuthority(String authority, Charset charset) {
		return encode(authority, charset, HierarchicalUriComponents.Type.AUTHORITY);
	}

	/**
	 * Encode the given URI user info with the given encoding.
	 * @param userInfo the user info to be encoded
	 * @param encoding the character encoding to encode to
	 * @return the encoded user info
	 */
	public static String encodeUserInfo(String userInfo, String encoding) {
		return encode(userInfo, encoding, HierarchicalUriComponents.Type.USER_INFO);
	}

	/**
	 * Encode the given URI user info with the given encoding.
	 * @param userInfo the user info to be encoded
	 * @param charset the character encoding to encode to
	 * @return the encoded user info
	 * @since 5.0
	 */
	public static String encodeUserInfo(String userInfo, Charset charset) {
		return encode(userInfo, charset, HierarchicalUriComponents.Type.USER_INFO);
	}

	/**
	 * Encode the given URI host with the given encoding.
	 * @param host the host to be encoded
	 * @param encoding the character encoding to encode to
	 * @return the encoded host
	 */
	public static String encodeHost(String host, String encoding) {
		return encode(host, encoding, HierarchicalUriComponents.Type.HOST_IPV4);
	}

	/**
	 * Encode the given URI host with the given encoding.
	 * @param host the host to be encoded
	 * @param charset the character encoding to encode to
	 * @return the encoded host
	 * @since 5.0
	 */
	public static String encodeHost(String host, Charset charset) {
		return encode(host, charset, HierarchicalUriComponents.Type.HOST_IPV4);
	}

	/**
	 * Encode the given URI port with the given encoding.
	 * @param port the port to be encoded
	 * @param encoding the character encoding to encode to
	 * @return the encoded port
	 */
	public static String encodePort(String port, String encoding) {
		return encode(port, encoding, HierarchicalUriComponents.Type.PORT);
	}

	/**
	 * Encode the given URI port with the given encoding.
	 * @param port the port to be encoded
	 * @param charset the character encoding to encode to
	 * @return the encoded port
	 * @since 5.0
	 */
	public static String encodePort(String port, Charset charset) {
		return encode(port, charset, HierarchicalUriComponents.Type.PORT);
	}

	/**
	 * Encode the given URI path with the given encoding.
	 * @param path the path to be encoded
	 * @param encoding the character encoding to encode to
	 * @return the encoded path
	 */
	public static String encodePath(String path, String encoding) {
		return encode(path, encoding, HierarchicalUriComponents.Type.PATH);
	}

	/**
	 * Encode the given URI path with the given encoding.
	 * @param path the path to be encoded
	 * @param charset the character encoding to encode to
	 * @return the encoded path
	 * @since 5.0
	 */
	public static String encodePath(String path, Charset charset) {
		return encode(path, charset, HierarchicalUriComponents.Type.PATH);
	}

	/**
	 * Encode the given URI path segment with the given encoding.
	 * @param segment the segment to be encoded
	 * @param encoding the character encoding to encode to
	 * @return the encoded segment
	 */
	public static String encodePathSegment(String segment, String encoding) {
		return encode(segment, encoding, HierarchicalUriComponents.Type.PATH_SEGMENT);
	}

	/**
	 * Encode the given URI path segment with the given encoding.
	 * @param segment the segment to be encoded
	 * @param charset the character encoding to encode to
	 * @return the encoded segment
	 * @since 5.0
	 */
	public static String encodePathSegment(String segment, Charset charset) {
		return encode(segment, charset, HierarchicalUriComponents.Type.PATH_SEGMENT);
	}

	/**
	 * Encode the given URI query with the given encoding.
	 * @param query the query to be encoded
	 * @param encoding the character encoding to encode to
	 * @return the encoded query
	 */
	public static String encodeQuery(String query, String encoding) {
		return encode(query, encoding, HierarchicalUriComponents.Type.QUERY);
	}

	/**
	 * Encode the given URI query with the given encoding.
	 * @param query the query to be encoded
	 * @param charset the character encoding to encode to
	 * @return the encoded query
	 * @since 5.0
	 */
	public static String encodeQuery(String query, Charset charset) {
		return encode(query, charset, HierarchicalUriComponents.Type.QUERY);
	}

	/**
	 * Encode the given URI query parameter with the given encoding.
	 * @param queryParam the query parameter to be encoded
	 * @param encoding the character encoding to encode to
	 * @return the encoded query parameter
	 */
	public static String encodeQueryParam(String queryParam, String encoding) {
		return encode(queryParam, encoding, HierarchicalUriComponents.Type.QUERY_PARAM);
	}

	/**
	 * Encode the given URI query parameter with the given encoding.
	 * @param queryParam the query parameter to be encoded
	 * @param charset the character encoding to encode to
	 * @return the encoded query parameter
	 * @since 5.0
	 */
	public static String encodeQueryParam(String queryParam, Charset charset) {
		return encode(queryParam, charset, HierarchicalUriComponents.Type.QUERY_PARAM);
	}

	/**
	 * Encode the query parameters from the given {@code MultiValueMap} with UTF-8.
	 *
This can be used with {@link UriComponentsBuilder#queryParams(MultiValueMap)}
	 * when building a URI from an already encoded template.
	 *
{@code
	 * MultiValueMap<String, String> params = new LinkedMultiValueMap<>(2);
	 * // add to params...
	 *
	 * ServletUriComponentsBuilder.fromCurrentRequest()
	 *         .queryParams(UriUtils.encodeQueryParams(params))
	 *         .build(true)
	 *         .toUriString();
	 * }

	 * @param params the parameters to encode
	 * @return a new {@code MultiValueMap} with the encoded names and values
	 * @since 5.2.3
	 */
	public static MultiValueMap<String, String> encodeQueryParams(MultiValueMap<String, String> params) {
		Charset charset = StandardCharsets.UTF_8;
		MultiValueMap<String, String> result = new LinkedMultiValueMap<>(params.size());
		for (Map.Entry<String, List<String>> entry : params.entrySet()) {
			for (String value : entry.getValue()) {
				result.add(encodeQueryParam(entry.getKey(), charset), encodeQueryParam(value, charset));
			}
		}
		return result;
	}

	/**
	 * Encode the given URI fragment with the given encoding.
	 * @param fragment the fragment to be encoded
	 * @param encoding the character encoding to encode to
	 * @return the encoded fragment
	 */
	public static String encodeFragment(String fragment, String encoding) {
		return encode(fragment, encoding, HierarchicalUriComponents.Type.FRAGMENT);
	}

	/**
	 * Encode the given URI fragment with the given encoding.
	 * @param fragment the fragment to be encoded
	 * @param charset the character encoding to encode to
	 * @return the encoded fragment
	 * @since 5.0
	 */
	public static String encodeFragment(String fragment, Charset charset) {
		return encode(fragment, charset, HierarchicalUriComponents.Type.FRAGMENT);
	}

	/**
	 * Variant of {@link #encode(String, Charset)} with a String charset.
	 * @param source the String to be encoded
	 * @param encoding the character encoding to encode to
	 * @return the encoded String
	 */
	public static String encode(String source, String encoding) {
		return encode(source, encoding, HierarchicalUriComponents.Type.URI);
	}

	/**
	 * Encode all characters that are either illegal, or have any reserved
	 * meaning, anywhere within a URI, as defined in
	 * RFC 3986.
	 * This is useful to ensure that the given String will be preserved as-is
	 * and will not have any o impact on the structure or meaning of the URI.
	 * @param source the String to be encoded
	 * @param charset the character encoding to encode to
	 * @return the encoded String
	 * @since 5.0
	 */
	public static String encode(String source, Charset charset) {
		return encode(source, charset, HierarchicalUriComponents.Type.URI);
	}

	/**
	 * Convenience method to apply {@link #encode(String, Charset)} to all
	 * given URI variable values.
	 * @param uriVariables the URI variable values to be encoded
	 * @return the encoded String
	 * @since 5.0
	 */
	public static Map<String, String> encodeUriVariables(Map<String, ?> uriVariables) {
		Map<String, String> result = CollectionUtils.newLinkedHashMap(uriVariables.size());
		uriVariables.forEach((key, value) -> {
			String stringValue = (value != null ? value.toString() : "");
			result.put(key, encode(stringValue, StandardCharsets.UTF_8));
		});
		return result;
	}

	/**
	 * Convenience method to apply {@link #encode(String, Charset)} to all
	 * given URI variable values.
	 * @param uriVariables the URI variable values to be encoded
	 * @return the encoded String
	 * @since 5.0
	 */
	public static Object[] encodeUriVariables(Object... uriVariables) {
		return Arrays.stream(uriVariables)
				.map(value -> {
					String stringValue = (value != null ? value.toString() : "");
					return encode(stringValue, StandardCharsets.UTF_8);
				})
				.toArray();
	}

	private static String encode(String scheme, String encoding, HierarchicalUriComponents.Type type) {
		return HierarchicalUriComponents.encodeUriComponent(scheme, encoding, type);
	}

	private static String encode(String scheme, Charset charset, HierarchicalUriComponents.Type type) {
		return HierarchicalUriComponents.encodeUriComponent(scheme, charset, type);
	}

	/**
	 * Decode the given encoded URI component.
	 *
See {@link StringUtils#uriDecode(String, Charset)} for the decoding rules.
	 * @param source the encoded String
	 * @param encoding the character encoding to use
	 * @return the decoded value
	 * @throws IllegalArgumentException when the given source contains invalid encoded sequences
	 * @see StringUtils#uriDecode(String, Charset)
	 * @see java.net.URLDecoder#decode(String, String)
	 */
	public static String decode(String source, String encoding) {
		return StringUtils.uriDecode(source, Charset.forName(encoding));
	}

	/**
	 * Decode the given encoded URI component.
	 *
See {@link StringUtils#uriDecode(String, Charset)} for the decoding rules.
	 * @param source the encoded String
	 * @param charset the character encoding to use
	 * @return the decoded value
	 * @throws IllegalArgumentException when the given source contains invalid encoded sequences
	 * @since 5.0
	 * @see StringUtils#uriDecode(String, Charset)
	 * @see java.net.URLDecoder#decode(String, String)
	 */
	public static String decode(String source, Charset charset) {
		return StringUtils.uriDecode(source, charset);
	}

	/**
	 * Extract the file extension from the given URI path.
	 * @param path the URI path (e.g. "/products/index.html")
	 * @return the extracted file extension (e.g. "html")
	 * @since 4.3.2
	 */
	@Nullable
	public static String extractFileExtension(String path) {
		int end = path.indexOf('?');
		int fragmentIndex = path.indexOf('#');
		if (fragmentIndex != -1 && (end == -1 || fragmentIndex < end)) {
			end = fragmentIndex;
		}
		if (end == -1) {
			end = path.length();
		}
		int begin = path.lastIndexOf('/', end) + 1;
		int paramIndex = path.indexOf(';', begin);
		end = (paramIndex != -1 && paramIndex < end ? paramIndex : end);
		int extIndex = path.lastIndexOf('.', end);
		if (extIndex != -1 && extIndex >= begin) {
			return path.substring(extIndex + 1, end);
		}
		return null;
	}

}


text:
package org.switchyard.common.util;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.ServiceLoader;

import org.jboss.logging.Logger;
import org.switchyard.common.type.Classes;

/**
 * A registry for service providers which allows for service lookup using a
 * registry in place of ServiceLoader. If no registry is available,
 * ServiceLoader is used as a fallback.
 */
public final class ProviderRegistry {

    private static Registry _registry;
    private static Logger _logger = Logger.getLogger(ProviderRegistry.class);

    private ProviderRegistry() {
    }

    /**
     * Obtain a provider using the Thread Context ClassLoader.
     *
     * @param clazz the class of the provider to find
     * @param <T> the provider type
     * @return a provider of the specified class or null if none is available
     */
    public static <T> T getProvider(Class<T> clazz) {
        return getProvider(clazz, Classes.getTCCL());
    }

    /**
     * Obtain a provider using a specified ClassLoader.
     *
     * @param clazz the class of the provider to find
     * @param loader the class loader
     * @param <T> the provider type
     * @return a provider of the specified class or null if none is available
     */
    public static <T> T getProvider(Class<T> clazz, ClassLoader loader) {
        if (_registry != null) {
            return _registry.getProvider(clazz);
        }
        ServiceLoader<T> services = ServiceLoader.load(clazz, loader);
        Iterator<T> iterator = services.iterator();
        while (iterator.hasNext()) {
            try {
                T instance = iterator.next();
                if (_logger.isDebugEnabled()) {
                    _logger.debug(String.format("Loading [%s] for type [%s]", instance.getClass().getName(), clazz.getName()));
                }
                return instance;
            } catch (Throwable t) {
                _logger.debug("Error creating provider for class " + clazz.getName(), t);
            }
        }
        return null;
    }

    /**
     * Obtain a list of providers using the Thread Context ClassLoader.
     *
     * @param clazz the class of the provider to find
     * @param <T> the provider type
     * @return the list of providers found
     */
    public static <T> List<T> getProviders(Class<T> clazz) {
        return getProviders(clazz, Classes.getTCCL());
    }

    /**
     * Obtain a list of providers using a specified ClassLoader.
     *
     * @param clazz the class of the provider to find
     * @param loader the class loader
     * @param <T> the provider type
     * @return the list of providers found
     */
    public static <T> List<T> getProviders(Class<T> clazz, ClassLoader loader) {
        if (_registry != null) {
            return _registry.getProviders(clazz);
        }
        List<T> list = new ArrayList<T>();
        ServiceLoader<T> services = ServiceLoader.load(clazz, loader);
        Iterator<T> iterator = services.iterator();
        while (iterator.hasNext()) {
            try {
                T instance = iterator.next();
                if (_logger.isDebugEnabled()) {
                    _logger.debug(String.format("Loading [%s] for type [%s]", instance.getClass().getName(), clazz.getName()));
                }
                list.add(instance);
            } catch (Throwable t) {
                _logger.debug("Error creating provider for class " + clazz.getName(), t);
            }
        }
        return list;
    }

    /**
     * Set a registry provider to be used for service lookups.
     * @param registry service provider registry
     */
    public static void setRegistry(Registry registry) {
        ProviderRegistry._registry = registry;
    }

    /**
     * Represents a pluggable service registry provider.
     */
    public interface Registry {
        /**
         * Return a provider for the specified interface.
         * @param clazz the class of the provider to find
         * @param <T> the provider type
         * @return provider
         */
        <T> T getProvider(Class<T> clazz);

        /**
         * Return a list of providers for the specified interface.
         * @param clazz the class of the provider to find
         * @param <T> the provider type
         * @return list of providers
         */
        <T> List<T> getProviders(Class<T> clazz);
    }

}

redpajama_set_name: RedPajamaGithub


text:
package lila.racer

import play.api.libs.json._

import lila.common.LightUser
import lila.storm.StormJson
import lila.storm.StormSign

final class RacerJson(stormJson: StormJson, sign: StormSign, lightUserSync: LightUser.GetterSync) {

  import StormJson._

  implicit private val playerWrites = OWrites[RacerPlayer] { p =>
    val user = p.userId flatMap lightUserSync
    Json
      .obj("name" -> p.name, "score" -> p.score)
      .add("userId", p.userId)
      .add("title", user.flatMap(_.title))
  }

  // full race data
  def data(race: RacerRace, player: RacerPlayer) =
    Json
      .obj(
        "race" -> Json
          .obj("id" -> race.id.value)
          .add("lobby", race.isLobby),
        "player"  -> player,
        "puzzles" -> race.puzzles
      )
      .add("owner", race.owner == player.id) ++ state(race)

  // socket updates
  def state(race: RacerRace) = Json
    .obj(
      "players" -> race.players
    )
    .add("startsIn", race.startsInMillis)
}


text:
package org.apache.commons.vfs2.provider.ftps;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.net.ftp.FTPSClient;
import org.apache.commons.vfs2.FileSystemException;
import org.apache.commons.vfs2.FileSystemOptions;
import org.apache.commons.vfs2.provider.ftp.FtpClientFactory;

import javax.net.ssl.KeyManager;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLException;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;

/**
 * Create FTPSClient instances.
 *
 * @since 2.0
 */
public final class FtpsClientFactory {

    private FtpsClientFactory() {
    }

    /**
     * Creates a new connection to the server.
     *
     * @param hostname The host name.
     * @param port The port.
     * @param username The user name for authentication.
     * @param password The user's password.
     * @param workingDirectory The directory to use.
     * @param fileSystemOptions The FileSystemOptions.
     * @return The FTPSClient.
     * @throws FileSystemException if an error occurs.
     */
    public static FTPSClient createConnection(final String hostname, final int port, final char[] username,
            final char[] password, final String workingDirectory, final FileSystemOptions fileSystemOptions)
            throws FileSystemException {
        final FtpsConnectionFactory factory = new FtpsConnectionFactory(FtpsFileSystemConfigBuilder.getInstance());
        return factory.createConnection(hostname, port, username, password, workingDirectory, fileSystemOptions);
    }

    /** Connection Factory for FTPS case. */
    private static final class FtpsConnectionFactory
            extends FtpClientFactory.ConnectionFactory<FTPSClient, FtpsFileSystemConfigBuilder> {

        private final Log log = LogFactory.getLog(getClass());
        private FtpsConnectionFactory(final FtpsFileSystemConfigBuilder builder) {
            super(builder);
        }

        @Override
        protected FTPSClient createClient(final FileSystemOptions fileSystemOptions) throws FileSystemException {
            final FTPSClient client;
            if (builder.getFtpsMode(fileSystemOptions) == FtpsMode.IMPLICIT) {
                client = new FTPSClient(true);
            } else {
                client = new FTPSClient();
            }

            final TrustManager trustManager = builder.getTrustManager(fileSystemOptions);
            if (trustManager != null) {
                client.setTrustManager(trustManager);
            }

            final KeyManager keyManager = builder.getKeyManager(fileSystemOptions);
            if (keyManager != null) {
                client.setKeyManager(keyManager);
            }
            return client;
        }

        @Override
        protected void preConfigureClient(FileSystemOptions fileSystemOptions) throws Exception {

            String KEYSTORE = builder.getKeyStore(fileSystemOptions);
            String TRUSTSTORE = builder.getTrustStore(fileSystemOptions);
            String KS_PASSWD = builder.getKeyStorePW(fileSystemOptions);
            String TS_PASSWD = builder.getTrustStorePW(fileSystemOptions);
            String KEY_PASSWD = builder.getKeyPW(fileSystemOptions);

            KeyManagerFactory keyManagerFactory = null;
            TrustManagerFactory trustManagerFactory = null;
            try {
                if (KEYSTORE != null && !KEYSTORE.trim().isEmpty()) {
                    FileInputStream keystorePath = new FileInputStream(new File(KEYSTORE));
                    KeyStore keyStore = KeyStore.getInstance("jks");

                    //load key store.
                    keyStore.load(keystorePath, KS_PASSWD.toCharArray());
                    keystorePath.close();

                    // initialize key manager factory
                    keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
                    keyManagerFactory.init(keyStore, KEY_PASSWD.toCharArray());
                }
                if (TRUSTSTORE != null && !TRUSTSTORE.trim().isEmpty()) {
                    FileInputStream truststorePath = new FileInputStream(new File(TRUSTSTORE));
                    KeyStore trustStore = KeyStore.getInstance("jks");
                    //load trust store.
                    trustStore.load(truststorePath, TS_PASSWD.toCharArray());
                    truststorePath.close();
                    // initialize trust manager factory
                    trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
                    trustManagerFactory.init(trustStore);
                }

            } catch (KeyStoreException e) {
                log.error("Error occurred when initializing keystores",e);
                throw e;
            } catch (IOException e) {
                log.error("Error occurred while retrieving the keystore paths",e);
                throw e;
            } catch (NoSuchAlgorithmException e) {
                log.error("Error when getting the default algorithm",e);
                throw e;
            } catch (CertificateException e) {
                log.error("Certificate exception occurred when loading the KeyStores ",e);
                throw e;
            } catch (UnrecoverableKeyException e) {
                log.error("Unrecoverable Key exception occurred",e);
                throw e;
            }
        }

        @Override
        protected void setupOpenConnection(final FTPSClient client, final FileSystemOptions fileSystemOptions)
                throws IOException {
            final FtpsDataChannelProtectionLevel level = builder.getDataChannelProtectionLevel(fileSystemOptions);
            if (level != null) {
                // '0' means streaming, that's what we do!
                try {
                    client.execPBSZ(0);
                    client.execPROT(level.name());
                } catch (final SSLException e) {
                    throw new FileSystemException("vfs.provider.ftps/data-channel.level", e, level.toString());
                }
            }
        }
    }
}


text:
import {createStore, applyMiddleware, compose} from 'redux';
import thunkMiddleware from 'redux-thunk';
import {persistState} from 'redux-devtools';
import DevTools from './DevTools';
import rootReducer from './reducers';

import typedToPlain from './typedToPlainMiddleware';

const enhancer: Function = compose(
    applyMiddleware(thunkMiddleware, typedToPlain),
    DevTools.instrument(),
    persistState(getDebugSessionKey())
);

function getDebugSessionKey() {
    const matches: Array<string> = window.location.href.match(/[?&]debug_session=([^&#]+)\b/);
    return (matches && matches.length > 0) ? matches[1] : undefined;
}

function configureStore(history: any, initialState: any): Redux.Store {
    const store: Redux.Store = createStore(rootReducer, initialState, enhancer);

    if (module.hot) {
        module.hot.accept('./reducers', () => {
            const nextRootReducer: Redux.Reducer = <Redux.Reducer>require('./reducers');
            store.replaceReducer(nextRootReducer);
        });
    }

    return store;
}

export {configureStore};


text:
Post Composer 0.1.0
===================

This is a ProBoards plugin that adds a keyboard to the posting pages.  It allows members to create a song and attach it to their post so that other members can play it if they wish.


text:
namespace Geck
{
    partial class frmRace
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.Windows.Forms.Label label1;
            this.listBox1 = new System.Windows.Forms.ListBox();
            this.comboBox1 = new System.Windows.Forms.ComboBox();
            this.label2 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.label4i = new System.Windows.Forms.Label();
            this.label5 = new System.Windows.Forms.Label();
            this.label6 = new System.Windows.Forms.Label();
            this.label7 = new System.Windows.Forms.Label();
            this.button1 = new System.Windows.Forms.Button();
            this.button2 = new System.Windows.Forms.Button();
            this.label8 = new System.Windows.Forms.Label();
            this.label9 = new System.Windows.Forms.Label();
            this.label10 = new System.Windows.Forms.Label();
            this.label11 = new System.Windows.Forms.Label();
            this.label12 = new System.Windows.Forms.Label();
            this.label13 = new System.Windows.Forms.Label();
            this.label14 = new System.Windows.Forms.Label();
            this.label15 = new System.Windows.Forms.Label();
            this.radioButton1 = new System.Windows.Forms.RadioButton();
            this.radioButton2 = new System.Windows.Forms.RadioButton();
            this.listBox2 = new System.Windows.Forms.ListBox();
            this.label16 = new System.Windows.Forms.Label();
            this.textBox1 = new System.Windows.Forms.TextBox();
            label1 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            //
            // label1
            //
            label1.AutoSize = true;
            label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            label1.Location = new System.Drawing.Point(194, 40);
            label1.Name = "label1";
            label1.Size = new System.Drawing.Size(32, 13);
            label1.TabIndex = 2;
            label1.Text = "STR";
            //
            // listBox1
            //
            this.listBox1.FormattingEnabled = true;
            this.listBox1.Location = new System.Drawing.Point(12, 40);
            this.listBox1.Name = "listBox1";
            this.listBox1.Size = new System.Drawing.Size(161, 277);
            this.listBox1.TabIndex = 0;
            this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
            //
            // comboBox1
            //
            this.comboBox1.BackColor = System.Drawing.SystemColors.Window;
            this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.comboBox1.FormattingEnabled = true;
            this.comboBox1.Items.AddRange(new object[] {
            "Human",
            "Ghoul",
            "Super Mutant"});
            this.comboBox1.Location = new System.Drawing.Point(12, 13);
            this.comboBox1.Name = "comboBox1";
            this.comboBox1.Size = new System.Drawing.Size(161, 21);
            this.comboBox1.TabIndex = 1;
            this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.Location = new System.Drawing.Point(194, 64);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(32, 13);
            this.label2.TabIndex = 3;
            this.label2.Text = "PER";
            //
            // label3
            //
            this.label3.AutoSize = true;
            this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label3.Location = new System.Drawing.Point(194, 88);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(33, 13);
            this.label3.TabIndex = 4;
            this.label3.Text = "END";
            //
            // label4i
            //
            this.label4i.AutoSize = true;
            this.label4i.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label4i.Location = new System.Drawing.Point(194, 110);
            this.label4i.Name = "label4i";
            this.label4i.Size = new System.Drawing.Size(32, 13);
            this.label4i.TabIndex = 5;
            this.label4i.Text = "CHA";
            //
            // label5
            //
            this.label5.AutoSize = true;
            this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label5.Location = new System.Drawing.Point(194, 134);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(28, 13);
            this.label5.TabIndex = 6;
            this.label5.Text = "INT";
            //
            // label6
            //
            this.label6.AutoSize = true;
            this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label6.Location = new System.Drawing.Point(194, 156);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(28, 13);
            this.label6.TabIndex = 7;
            this.label6.Text = "AGI";
            //
            // label7
            //
            this.label7.AutoSize = true;
            this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label7.Location = new System.Drawing.Point(194, 180);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(31, 13);
            this.label7.TabIndex = 8;
            this.label7.Text = "LUC";
            //
            // button1
            //
            this.button1.Location = new System.Drawing.Point(365, 294);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(75, 23);
            this.button1.TabIndex = 9;
            this.button1.Text = "Confirm";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // button2
            //
            this.button2.Location = new System.Drawing.Point(284, 294);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(75, 23);
            this.button2.TabIndex = 10;
            this.button2.Text = "Cancel";
            this.button2.UseVisualStyleBackColor = true;
            this.button2.Click += new System.EventHandler(this.button2_Click);
            //
            // label8
            //
            this.label8.AutoSize = true;
            this.label8.Location = new System.Drawing.Point(231, 40);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(35, 13);
            this.label8.TabIndex = 11;
            this.label8.Text = "label8";
            //
            // label9
            //
            this.label9.AutoSize = true;
            this.label9.Location = new System.Drawing.Point(231, 64);
            this.label9.Name = "label9";
            this.label9.Size = new System.Drawing.Size(35, 13);
            this.label9.TabIndex = 12;
            this.label9.Text = "label9";
            //
            // label10
            //
            this.label10.AutoSize = true;
            this.label10.Location = new System.Drawing.Point(231, 88);
            this.label10.Name = "label10";
            this.label10.Size = new System.Drawing.Size(41, 13);
            this.label10.TabIndex = 13;
            this.label10.Text = "label10";
            //
            // label11
            //
            this.label11.AutoSize = true;
            this.label11.Location = new System.Drawing.Point(231, 110);
            this.label11.Name = "label11";
            this.label11.Size = new System.Drawing.Size(41, 13);
            this.label11.TabIndex = 14;
            this.label11.Text = "label11";
            //
            // label12
            //
            this.label12.AutoSize = true;
            this.label12.Location = new System.Drawing.Point(231, 134);
            this.label12.Name = "label12";
            this.label12.Size = new System.Drawing.Size(41, 13);
            this.label12.TabIndex = 15;
            this.label12.Text = "label12";
            //
            // label13
            //
            this.label13.AutoSize = true;
            this.label13.Location = new System.Drawing.Point(231, 156);
            this.label13.Name = "label13";
            this.label13.Size = new System.Drawing.Size(41, 13);
            this.label13.TabIndex = 16;
            this.label13.Text = "label13";
            //
            // label14
            //
            this.label14.AutoSize = true;
            this.label14.Location = new System.Drawing.Point(231, 180);
            this.label14.Name = "label14";
            this.label14.Size = new System.Drawing.Size(41, 13);
            this.label14.TabIndex = 17;
            this.label14.Text = "label14";
            //
            // label15
            //
            this.label15.AutoSize = true;
            this.label15.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label15.Location = new System.Drawing.Point(294, 16);
            this.label15.Name = "label15";
            this.label15.Size = new System.Drawing.Size(67, 13);
            this.label15.TabIndex = 18;
            this.label15.Text = "Racial Perks";
            //
            // radioButton1
            //
            this.radioButton1.AutoSize = true;
            this.radioButton1.Location = new System.Drawing.Point(180, 14);
            this.radioButton1.Name = "radioButton1";
            this.radioButton1.Size = new System.Drawing.Size(48, 17);
            this.radioButton1.TabIndex = 19;
            this.radioButton1.TabStop = true;
            this.radioButton1.Text = "Male";
            this.radioButton1.UseVisualStyleBackColor = true;
            //
            // radioButton2
            //
            this.radioButton2.AutoSize = true;
            this.radioButton2.Location = new System.Drawing.Point(234, 14);
            this.radioButton2.Name = "radioButton2";
            this.radioButton2.Size = new System.Drawing.Size(59, 17);
            this.radioButton2.TabIndex = 20;
            this.radioButton2.TabStop = true;
            this.radioButton2.Text = "Female";
            this.radioButton2.UseVisualStyleBackColor = true;
            //
            // listBox2
            //
            this.listBox2.Cursor = System.Windows.Forms.Cursors.Default;
            this.listBox2.FormattingEnabled = true;
            this.listBox2.Location = new System.Drawing.Point(297, 40);
            this.listBox2.Name = "listBox2";
            this.listBox2.SelectionMode = System.Windows.Forms.SelectionMode.None;
            this.listBox2.Size = new System.Drawing.Size(143, 160);
            this.listBox2.TabIndex = 21;
            this.listBox2.SelectedIndexChanged += new System.EventHandler(this.listBox2_SelectedIndexChanged);
            //
            // label16
            //
            this.label16.AutoSize = true;
            this.label16.Location = new System.Drawing.Point(194, 214);
            this.label16.Name = "label16";
            this.label16.Size = new System.Drawing.Size(38, 13);
            this.label16.TabIndex = 23;
            this.label16.Text = "Name:";
            //
            // textBox1
            //
            this.textBox1.Location = new System.Drawing.Point(234, 211);
            this.textBox1.Name = "textBox1";
            this.textBox1.Size = new System.Drawing.Size(206, 20);
            this.textBox1.TabIndex = 24;
            //
            // frmRace
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.SystemColors.ButtonFace;
            this.ClientSize = new System.Drawing.Size(452, 329);
            this.ControlBox = false;
            this.Controls.Add(this.textBox1);
            this.Controls.Add(this.label16);
            this.Controls.Add(this.listBox2);
            this.Controls.Add(this.radioButton2);
            this.Controls.Add(this.radioButton1);
            this.Controls.Add(this.label15);
            this.Controls.Add(this.label14);
            this.Controls.Add(this.label13);
            this.Controls.Add(this.label12);
            this.Controls.Add(this.label11);
            this.Controls.Add(this.label10);
            this.Controls.Add(this.label9);
            this.Controls.Add(this.label8);
            this.Controls.Add(this.button2);
            this.Controls.Add(this.button1);
            this.Controls.Add(this.label7);
            this.Controls.Add(this.label6);
            this.Controls.Add(this.label5);
            this.Controls.Add(this.label4i);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.label2);
            this.Controls.Add(label1);
            this.Controls.Add(this.comboBox1);
            this.Controls.Add(this.listBox1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.Name = "frmRace";
            this.ShowIcon = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text = "Select a Race";
            this.Load += new System.EventHandler(this.Race_Load);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.ListBox listBox1;
        private System.Windows.Forms.ComboBox comboBox1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.Label label4i;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.Label label7;
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.Label label8;
        private System.Windows.Forms.Label label9;
        private System.Windows.Forms.Label label10;
        private System.Windows.Forms.Label label11;
        private System.Windows.Forms.Label label12;
        private System.Windows.Forms.Label label13;
        private System.Windows.Forms.Label label14;
        private System.Windows.Forms.Label label15;
        private System.Windows.Forms.RadioButton radioButton1;
        private System.Windows.Forms.RadioButton radioButton2;
        private System.Windows.Forms.ListBox listBox2;
        private System.Windows.Forms.Label label16;
        private System.Windows.Forms.TextBox textBox1;
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <artifactId>pax-exam-samples</artifactId>
        <groupId>org.ops4j.pax.exam</groupId>
        <version>4.6.0-SNAPSHOT</version>
        <relativePath>..</relativePath>
    </parent>
    <groupId>org.ops4j.pax.exam.samples</groupId>
    <artifactId>pax-exam-sample1-web</artifactId>
    <name>OPS4J Pax Exam Sample1 Web</name>
    <packaging>war</packaging>
    <dependencies>
        <dependency>
            <groupId>org.ops4j.pax.exam.samples</groupId>
            <artifactId>pax-exam-sample1-service</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
        </dependency>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>


text:
using namespace std;

class LineJob2D : public noisepp::PipelineJob
{
 private:
  noisepp::Pipeline2D *mPipe;
  noisepp::PipelineElement2D *mElement;
  noisepp::Real x, y;
  int n;
  noisepp::Real xDelta;
  noisepp::Real *buffer;

 public:
  /// Constructor.
  /// @param pipe The pipeline.
  /// @param element A pointer to the pipeline element.
  /// @param x The start x-coordinate.
  /// @param y The y-coordinate.
  /// @param n The number of pixels to build.
  /// @param xDelta The delta value the x-coordinate will change each pixel.
  /// @param buffer A pointer to the output buffer.
  LineJob2D (noisepp::Pipeline2D *pipe, noisepp::PipelineElement2D *element, noisepp::Real x, noisepp::Real y, int n, noisepp::Real xDelta, noisepp::Real *buffer) :
   mPipe(pipe), mElement(element), x(x), y(y), n(n), xDelta(xDelta), buffer(buffer)
  {}
  void execute (noisepp::Cache *cache)
  {
   for (int i=0;i<n;++i)
   {
    // cleans the cache
    mPipe->cleanCache (cache);
    // calculates the value
    buffer[i] = mElement->getValue(x, y, cache);
    // move on
    x += xDelta;
   }
  }
};

int main ()
{
 noisepp::PerlinModule perlin;
#if NOISEPP_ENABLE_UTILS
 noisepp::Pipeline2D *pipeline = noisepp::utils::System::createOptimalPipeline2D();
#elif NOISEPP_ENABLE_THREADS
 noisepp::Pipeline2D *pipeline = new noisepp::ThreadedPipeline2D(2);
#else
 noisepp::Pipeline2D *pipeline = new noisepp::Pipeline2D;
#endif
 noisepp::PipelineElement2D *element = pipeline->getElement(perlin.addToPipeline(pipeline));

 int w = 512;
 int h = 512;
 // create a buffer
 noisepp::Real *buffer = new noisepp::Real[w*h];
 noisepp::Real xPos = 0;
 noisepp::Real yPos = 0;
 noisepp::Real xDelta = 1.0/noisepp::Real(w);
 noisepp::Real yDelta = 1.0/noisepp::Real(h);
 // add the jobs
 for (int y=0;y<h;++y)
 {
  pipeline->addJob (new LineJob2D(pipeline, element, xPos, yPos, w, xDelta, buffer+(y*w)));
  // move along the y-axis
  yPos += xDelta;
 }
 // execute the jobs
 pipeline->executeJobs ();
 // do something with the buffer
 // ...
 cout << buffer[0] << endl;
 // ...

 // free buffer
 delete[] buffer;
 buffer = 0;
 // free the pipeline
 delete pipeline;
 pipeline = 0;

 return 0;
}


text:
package jvm;

import aj.org.objectweb.asm.ClassWriter;
import aj.org.objectweb.asm.MethodVisitor;
import aj.org.objectweb.asm.Opcodes;

import java.lang.reflect.InvocationTargetException;

/**
 * @auther xzl on 16:12 2018/1/10
 * 测试 asm
 */
public class AmsHelloWorld extends ClassLoader implements Opcodes{
    public static void main(String[] args) throws InvocationTargetException, IllegalAccessException {
        // COMPUTE_MAXS 自动计算最大局部变量表 和 最深操作数栈
        //COMPUTE_FRAMES 自动计算映射帧栈
        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS|ClassWriter.COMPUTE_FRAMES);
        //设置类的 基本信息
        cw.visit(V1_7,ACC_PUBLIC,"Example",null,"java/lang/Object",null);
        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC,"<init>","()V",null,null);
        mv.visitVarInsn(ALOAD,0);
        mv.visitMethodInsn(INVOKESPECIAL,"java/lang/Object","<init>","()V");
        mv.visitInsn(RETURN);
        mv.visitMaxs(0,0);
        mv.visitEnd();

        mv = cw.visitMethod(ACC_PUBLIC+ACC_STATIC,"main","([Ljava/lang/String;)V",null,null);
        mv.visitFieldInsn(GETSTATIC,"java/lang/System","out","Ljava/io/PrintStream;");
        mv.visitLdcInsn("Hello World,AMS");
        mv.visitMethodInsn(INVOKEVIRTUAL,"java/io/PrintStream","println","(Ljava/lang/String;)V");
        mv.visitInsn(RETURN);
        mv.visitMaxs(0,0);
        mv.visitEnd();

        byte[] codes = cw.toByteArray();
        AmsHelloWorld amsHelloWorld = new AmsHelloWorld();
        Class exampleClass = amsHelloWorld.defineClass("Example",codes,0,codes.length);
        exampleClass.getMethods()[0].invoke(null,new Object[]{ null });
    }
}


text:
namespace Google.Cloud.Monitoring.V3.Snippets
{
    // [START monitoring_v3_generated_ServiceMonitoringService_CreateServiceLevelObjective_sync_flattened]
    using Google.Cloud.Monitoring.V3;

    public sealed partial class GeneratedServiceMonitoringServiceClientSnippets
    {
        /// <summary>Snippet for CreateServiceLevelObjective</summary>
        /// <remarks>
        /// This snippet has been automatically generated and should be regarded as a code template only.
        /// It will require modifications to work:
        /// - It may require correct/in-range values for request initialization.
        /// - It may require specifying regional endpoints when creating the service client as shown in
        ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
        /// </remarks>
        public void CreateServiceLevelObjective()
        {
            // Create client
            ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.Create();
            // Initialize request argument(s)
            string parent = "projects/[PROJECT]/services/[SERVICE]";
            ServiceLevelObjective serviceLevelObjective = new ServiceLevelObjective();
            // Make the request
            ServiceLevelObjective response = serviceMonitoringServiceClient.CreateServiceLevelObjective(parent, serviceLevelObjective);
        }
    }
    // [END monitoring_v3_generated_ServiceMonitoringService_CreateServiceLevelObjective_sync_flattened]
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project>
  <parent>
    <artifactId>org.beamfoundry.bundles.spring-dm.iandt-bundles</artifactId>
    <groupId>org.beamfoundry.bundles.spring-dm.iandt</groupId>
    <version>1.3.0-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.beamfoundry.bundles.spring-dm.iandt</groupId>
  <artifactId>org.beamfoundry.bundles.spring-dm.iandt.config</artifactId>
  <packaging>pom</packaging>
  <name>Spring DM Test Bundle: Integration testing bundles for configuration options</name>

  <properties>
    <!-- root, empty package -->
    <!-- plugin not yet enabled to avoid further problems -->
	<spring.osgi.import.pkg>!org.springframework.osgi.iandt, *</spring.osgi.import.pkg>
	<spring.osgi.export.pkg>${pom.artifactId}*</spring.osgi.export.pkg>
  </properties>

  <!-- shared dependencies -->
  <dependencies>
        <dependency>
            <groupId>org.beamfoundry.bundles.spring-dm</groupId>
            <artifactId>org.beamfoundry.bundles.spring-dm-core</artifactId>
            <version>${project.parent.version}</version>
            <type>jar</type>
            <scope>provided</scope>
        </dependency>
  </dependencies>

  <modules>
    <module>no-publish</module>
    <module>async-nowait</module>
	<module>async-wait</module>
    <module>sync-nowait</module>
	<module>sync-tail</module>
    <module>sync-wait</module>
  </modules>

 <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
          </archive>
        </configuration>
      </plugin>
    </plugins>

 </build>

   <!-- the above doesn't work, so we spell it out in full below
  <reporting>
   <excludeDefaults>true</excludeDefaults>
   <plugins>
     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-project-info-reports-plugin</artifactId>
       <inherited>true</inherited>
       <reportSets>
        <reportSet></reportSet>
       </reportSets>
     </plugin>
	<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
        <excludePackageNames>*</excludePackageNames>
        </configuration>
     </plugin>
   </plugins>
  </reporting>
  -->
</project>


text:
package com.intellij.openapi.command.impl;

import com.intellij.openapi.command.undo.DocumentReference;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class DocumentReferenceByVirtualFile implements DocumentReference {
  private VirtualFile myFile;

  DocumentReferenceByVirtualFile(@NotNull VirtualFile file) {
    myFile = file;
  }

  @Override
  @Nullable
  public Document getDocument() {
    assert myFile.isValid() : "should not be called on references to deleted file: " + myFile;
    return FileDocumentManager.getInstance().getDocument(myFile);
  }

  @Override
  @NotNull
  public VirtualFile getFile() {
    return myFile;
  }

  @Override
  public String toString() {
    return myFile.toString();
  }

  public void update(VirtualFile f) {
    myFile = f;
  }
}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using System.Net.Test.Common;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;

namespace System.Net.Http.Functional.Tests
{
    public abstract class IdnaProtocolTests : HttpClientHandlerTestBase
    {
        protected abstract bool SupportsIdna { get; }

        public IdnaProtocolTests(ITestOutputHelper output) : base(output) { }

        [Theory]
        [MemberData(nameof(InternationalHostNames))]
        public async Task InternationalUrl_UsesIdnaEncoding_Success(string hostname)
        {
            if (!SupportsIdna)
            {
                return;
            }

            Uri uri = new Uri($"http://{hostname}/");

            await LoopbackServer.CreateServerAsync(async (server, serverUrl) =>
            {
                // We don't actually want to do DNS lookup on the IDNA host name in the URL.
                // So instead, configure the loopback server as a proxy so we will send to it.
                HttpClientHandler handler = CreateHttpClientHandler();
                handler.UseProxy = true;
                handler.Proxy = new WebProxy(serverUrl.ToString());

                using (HttpClient client = CreateHttpClient(handler))
                {
                    Task<HttpResponseMessage> getResponseTask = client.GetAsync(uri);
                    Task<List<string>> serverTask = server.AcceptConnectionSendResponseAndCloseAsync();

                    await TestHelper.WhenAllCompletedOrAnyFailed(getResponseTask, serverTask);

                    List<string> requestLines = await serverTask;

                    // Note since we're using a proxy, host name is included in the request line
                    Assert.Equal($"GET http://{uri.IdnHost}/ HTTP/1.1", requestLines[0]);
                    Assert.Contains($"Host: {uri.IdnHost}", requestLines);
                }
            });
        }

        [ActiveIssue(26355)] // We aren't doing IDNA encoding properly
        [Theory]
        [MemberData(nameof(InternationalHostNames))]
        public async Task InternationalRequestHeaderValues_UsesIdnaEncoding_Success(string hostname)
        {
            if (!SupportsIdna)
            {
                return;
            }

            Uri uri = new Uri($"http://{hostname}/");

            await LoopbackServer.CreateServerAsync(async (server, serverUrl) =>
            {
                using (HttpClient client = CreateHttpClient())
                {
                    var request = new HttpRequestMessage(HttpMethod.Get, serverUrl) { Version = VersionFromUseHttp2 };
                    request.Headers.Host = hostname;
                    request.Headers.Referrer = uri;
                    Task<HttpResponseMessage> getResponseTask = client.SendAsync(request);
                    Task<List<string>> serverTask = server.AcceptConnectionSendResponseAndCloseAsync();

                    await TestHelper.WhenAllCompletedOrAnyFailed(getResponseTask, serverTask);

                    List<string> requestLines = await serverTask;

                    Assert.Contains($"Host: {uri.IdnHost}", requestLines);
                    Assert.Contains($"Referer: http://{uri.IdnHost}/", requestLines);
                }
            });
        }

        [ActiveIssue(26355)] // We aren't doing IDNA decoding properly
        [Theory]
        [MemberData(nameof(InternationalHostNames))]
        public async Task InternationalResponseHeaderValues_UsesIdnaDecoding_Success(string hostname)
        {
            if (!SupportsIdna)
            {
                return;
            }

            Uri uri = new Uri($"http://{hostname}/");

            await LoopbackServer.CreateServerAsync(async (server, serverUrl) =>
            {
                HttpClientHandler handler = CreateHttpClientHandler();
                handler.AllowAutoRedirect = false;

                using (HttpClient client = CreateHttpClient(handler))
                {
                    Task<HttpResponseMessage> getResponseTask = client.GetAsync(serverUrl);
                    Task<List<string>> serverTask = server.AcceptConnectionSendResponseAndCloseAsync(
                        HttpStatusCode.Found, "Location: http://{uri.IdnHost}/\r\n");

                    await TestHelper.WhenAllCompletedOrAnyFailed(getResponseTask, serverTask);

                    HttpResponseMessage response = await getResponseTask;

                    Assert.Equal(uri, response.Headers.Location);
                }
            });
        }

        public static IEnumerable<object[]> InternationalHostNames()
        {
            // Latin-1 supplement
            yield return new object[] { "\u00E1.com" };
            yield return new object[] { "\u00E1b\u00E7d\u00EB.com" };
            yield return new object[] { "b\u00E7.com" };
            yield return new object[] { "b\u00E7d.com" };

            // Hebrew
            yield return new object[] { "\u05E1.com" };
            yield return new object[] { "\u05D1\u05F1.com" };

            // Katakana
            yield return new object[] { "\u30A5.com" };
            yield return new object[] { "\u30B6\u30C7\u30D8.com" };
        }
    }
}


text:
#pragma once

/**
\file SOGEGameObjectRigidBody.h
\author Elias Kosunen

Rigid body base class
*/

#include "SOGEGameObjectMovable.h"

#include "SOGEPrerequisites.h"

namespace SOGE
{
	/**
	Rigid body collision shape
	*/
	enum CollisionShape
	{
		SHAPE_UNDEFINED = 0,
		SHAPE_SPHERE,	///< Collision shape is a sphere around the object, cheapest to check, works well with most meshes
		SHAPE_BOX,		///< Collision shape is a box around the object, cheap to check
		SHAPE_CAPSULE,	///< Collision shape is a capsule around the object, cheap to check, usually not the best option
		SHAPE_CONVEX,	///< Collision shape is a convex hull of the object, relatively expensive to check
		SHAPE_MESH		///< Collision shape is a triangle mesh of the object, really expensive, usually not worth it
	};

	/**
	Rigid body base class
	*/
	class GameObjectRigidBody : public GameObjectMovable
	{
	public:
		friend class World;
	protected:
		btRigidBody *_body;
		btCollisionShape *_shape;
		CollisionShape _shapeType;
		BtOgre::RigidBodyState *_motionState;
		Real _mass;

		GameObjectRigidBody(String name, GameObjectType type) : GameObjectMovable(name, type, true), _body(0), _shape(0), _shapeType(SHAPE_UNDEFINED), _motionState(0), _mass(Real(-1)) {}
		virtual ~GameObjectRigidBody() {}

		virtual void _applyCentralForce(const Vector3 &force) = 0;
		virtual void _applyTorque(const Vector3 &torque) = 0;
		virtual void _applyForce(const Vector3 &force, const Vector3 &pos) = 0;
		virtual void _applyCentralImpulse(const Vector3 &impulse) = 0;
		virtual void _applyTorqueImpulse(const Vector3 &torque) = 0;
		virtual void _applyImpulse(const Vector3 &impulse, const Vector3 &pos) = 0;
	public:
		btRigidBody *getBody() { SOGE_ASSERT(_body, "RigidBody is NULL"); return _body; }
		btCollisionShape *getShape() { SOGE_ASSERT(_shape, "CollisionShape is NULL"); return _shape; }
		CollisionShape getShapeType() { return _shapeType; }
		BtOgre::RigidBodyState *getMotionState() { SOGE_ASSERT(_motionState, "MotionShape is NULL"); return _motionState; }
		Real getMass() { return _mass; }

		virtual void initRigidBody(Real mass = 0) = 0;	///< Initialize the RigidBody
		virtual void cleanRigidBody() = 0;				///< Clean up the RigidBody

		/**
		Apply force to the center of the rigid body
		\param force
			Force to apply
		*/
		void applyCentralForce(const Vector3 &force);

		/**
		Apply torque to the rigid body
		\param torque
			Torque to apply
		*/
		void applyTorque(const Vector3 &torque);

		/**
		Apply force to a specific point of the rigid body
		\param force
			Force to apply
		\param pos
			Position to apply the force
		*/
		void applyForce(const Vector3 &force, const Vector3 &pos);

		/**
		Apply impulse to the center of the rigid body
		\param impulse
			Impulse to apply
		*/
		void applyCentralImpulse(const Vector3 &impulse);

		/**
		Apply torque impulse to the rigid body
		\param torque
			Torque to apply
		*/
		void applyTorqueImpulse(const Vector3 &torque);

		/**
		Apply impulse to the rigid body
		\param impulse
			Impulse to apply
		\param pos
			Position to apply the impulse
		*/
		void applyImpulse(const Vector3 &impulse, const Vector3 &pos);

		/**
		Clear all forces of the rigid body
		*/
		virtual void clearForces() = 0;

		/**
		Get the center of mass of the rigid body
		\return
			Center of mass
		*/
		virtual Vector3 getCenterOfMass() = 0;

		/**
		Set collision shape
		\param shape
			Collision shape
		*/
		virtual void setShape(CollisionShape shape) = 0;
	};
}

#include "SOGEPostrequisites.h"


text:
namespace ash {
namespace {

// Boost factor for non-integrated displays.
const float kBoostForNonIntegrated = 1.20f;

}  // namespace

EventTransformationHandler::EventTransformationHandler()
    : transformation_mode_(TRANSFORM_AUTO) {
}

EventTransformationHandler::~EventTransformationHandler() {
}

void EventTransformationHandler::OnScrollEvent(ui::ScrollEvent* event) {
  if (transformation_mode_ == TRANSFORM_NONE)
    return;

  // It is unnecessary to scale the event for the device scale factor since
  // the event locations etc. are already in DIP.
  gfx::Point point_in_screen(event->location());
  aura::Window* target = static_cast<aura::Window*>(event->target());
  ::wm::ConvertPointToScreen(target, &point_in_screen);
  const gfx::Display& display =
      Shell::GetScreen()->GetDisplayNearestPoint(point_in_screen);

  // Apply some additional scaling if the display is non-integrated.
  if (!display.IsInternal())
    event->Scale(kBoostForNonIntegrated);
}

}  // namespace ash


text:
<?php

namespace Fusonic\OpenGraph\Elements;

use Fusonic\OpenGraph\Property;

/**
 * An Open Graph audio element.
 */
class Audio extends ElementBase
{
    /**
     * The URL of an audio resource associated with the object.
     *
     * @var string
     */
    public $url;

    /**
     * An alternate URL to use if an audio resource requires HTTPS.
     *
     * @var string
     */
    public $secureUrl;

    /**
     * The MIME type of an audio resource associated with the object.
     *
     * @var type
     */
    public $type;

    /**
     * @param   string      $url            URL to the audio file.
     */
    public function __construct($url)
    {
        parent::__construct();

        $this->url = $url;
    }

    /**
     * Gets all properties set on this element.
     *
     * @return  array|Property[]
     */
    public function getProperties()
    {
        $properties = [];

        // URL must precede all other properties
        if ($this->url !== null) {
            $properties[] = new Property(Property::AUDIO_URL, $this->url);
        }

        if ($this->secureUrl !== null) {
            $properties[] = new Property(Property::AUDIO_SECURE_URL, $this->secureUrl);
        }

        if ($this->type !== null) {
            $properties[] = new Property(Property::AUDIO_TYPE, $this->type);
        }

        return $properties;
    }
}


text:
/// <reference path='../../xsrt2/xsrt.d.ts' />
function circle(radius: number) {
    return <Xaml.Ellipse width={radius} height={radius} fill="Black" />
}
function hstack(children) {
    return <Xaml.StackPanel orientation='Horizontal'>{children}</Xaml.StackPanel>
}
function vstack(children) {
    return <Xaml.StackPanel orientation='Vertical'>{children}</Xaml.StackPanel>
}
function range(min,max) {
    var result = [];
    for (var i=min; i<max; i++) {
        result.push(i);
    }
    return result;
}

module App {

    interface Entry {
        inputText: string;
        result: any;
    }

    export function setInitialState() {
        var helloWorld = doEval("t = " + JSON.stringify({ type: 'TextBlock', text: "hello world" }));
        var sample = doEval("hstack(range(1,5).map(function(i) { return i * 10; }).map(circle))");
        host.setState({
            text: "",
            history: [
                helloWorld,
                { inputText: "1+1", result: 1+1 },
                sample
            ]
        });
    };

    function textChanged(sender, e) {
        host.setState({ text: sender.text });
    }
    function evalClicked(sender, e) {
        var entry = doEval(host.getState().text);

        var history = host.getState().history;
        history.push(entry);
        host.setState({history: history, text: ''});
    }
    function doEval(input:string) {
        var entry : Entry;
        var result : any;
        try {
            result = eval(input);
        }
        catch (e) {
            result = "" + e;
        }

        try {
            entry = {
                inputText: input,
                result: JSON.parse(JSON.stringify(result))
            };
        }
        catch (e) {
            entry = { inputText: input, result: result };
        }
        return entry;
    }

    function renderEntry(e : Entry) {
        return (
            <Xaml.StackPanel>
                <Xaml.TextBlock text={">" + e.inputText} />
                <Xaml.ContentControl content={e.result} />
            </Xaml.StackPanel>
        );
    }

    function EntryBox() {
        return <Xaml.TextBox
            fontFamily='Consolas'
            fontSize={14}
            width={450}
            horizontalAlignment='Stretch'
            verticalAlignment='Stretch' />
    }

    export function render() {

        return (
            <Xaml.ScrollViewer>
                <Xaml.StackPanel
                    horizontalAlignment='Stretch'
                    verticalAlignment='Stretch' >

                    <Xaml.StackPanel>{host.getState().history.map(renderEntry)}</Xaml.StackPanel>

                    <Xaml.StackPanel orientation='Horizontal'>
                        <EntryBox
                            onTextChanged={textChanged}
                            text={host.getState().text}  />
                        <Xaml.Button
                            content='eval'
                            onClick={evalClicked}
                            />
                    </Xaml.StackPanel>

                </Xaml.StackPanel>
            </Xaml.ScrollViewer>
        );
    }
}


text:
<!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE 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.
-->
<project name="configurations" default="run.dev" xmlns:ivy="antlib:org.apache.ivy.ant">
    <!-- some variables used -->
    <property name="lib.dir" value="lib"/>
    <property name="build.dir" value="build"/>
    <property name="src.dir" value="src"/>

    <!-- paths used for compilation and run  -->
    <path id="compile.path.id">
        <fileset dir="${lib.dir}/compile"/>
    </path>
    <path id="lib.run.dev.id">
        <path location="${build.dir}"/>
        <fileset dir="${lib.dir}/rundev"/>
    </path>
    <path id="lib.run.prod.id">
        <path location="${build.dir}"/>
        <fileset dir="${lib.dir}/runprod"/>
    </path>

    <!-- =================================
          target: resolve
         ================================= -->
    <target name="resolve" description="--> retreive dependencies with ivy">
        <!-- conf="*" will copy artifacts defined for each conf in a dir matching conf name -->
        <ivy:retrieve pattern="${ivy.lib.dir}/[conf]/[artifact]-[revision].[ext]"/>
    </target>

    <!-- =================================
          target: report
         ================================= -->
    <target name="report" depends="resolve" description="--> generates a report of dependencies">
        <ivy:report todir="${build.dir}"/>
    </target>

    <!-- =================================
         target: run.dev
         ================================= -->
    <target name="run.dev" depends="resolve" description="--> compile and run the project">
        <mkdir dir="${build.dir}"/>
        <javac srcdir="${src.dir}" destdir="${build.dir}" classpathref="lib.run.dev.id" includeAntRuntime="false"/>
        <copy todir="${build.dir}">
            <fileset dir="${src.dir}" includes="**/*.properties"></fileset>
        </copy>
        <java classpathref="lib.run.dev.id" classname="example.ConfigurationsExample" fork="true">
            <arg value="--dev"/>
        </java>
    </target>

    <!-- =================================
         target: run.prod
         ================================= -->
    <target name="run.prod" depends="resolve" description="--> compile and run the project">
        <mkdir dir="${build.dir}"/>
        <javac srcdir="${src.dir}" destdir="${build.dir}" classpathref="lib.run.prod.id" includeAntRuntime="false"/>
        <copy todir="${build.dir}">
            <fileset dir="${src.dir}" includes="**/*.properties"></fileset>
        </copy>
        <java classpathref="lib.run.prod.id" classname="example.ConfigurationsExample" fork="true"/>
    </target>

    <!-- =================================
          target: clean
         ================================= -->
    <target name="clean" description="--> clean the project">
        <delete includeemptydirs="true">
            <fileset dir="${basedir}">
                <exclude name="src/**"/>
                <exclude name="build.xml"/>
                <exclude name="ivy.xml"/>
            </fileset>
        </delete>
    </target>

    <!-- =================================
          target: clean-cache
         ================================= -->
    <target name="clean-cache" description="--> clean the ivy cache">
        <ivy:cleancache/>
    </target>
</project>


text:
module Gallerist::PhotosExtensions::PersonPhoto

  def __extend
    self.table_name = 'RKPersonVersion'

    has_one :person, primary_key: 'personId', foreign_key: 'modelId'
    has_one :photo, primary_key: 'versionId', foreign_key: 'modelId'

    alias_attribute :person_id, :personId
    alias_attribute :photo_id, :versionId
  end

end


text:
namespace System.Windows.Forms
{
    public enum RibbonTheme
    {
        /// <summary>
        /// The default theme is identical to the Blue theme.
        /// </summary>
        Normal,
        /// <summary>
        /// This theme is identical to the normal "default" theme.
        /// </summary>
        Blue,
        Blue_2010,
        Black,
        Green,
        Purple,
        JellyBelly,
        Halloween,
        VSLight,
        VSDark
    }

    public enum RibbonOrbStyle
    {
        Office_2007,
        Office_2010,
        Office_2010_Extended,
        Office_2013 //Michael Spradlin - 05/03/2013 Office 2013 Style Changes
    }

    /// <summary>
    /// Represents the directions that arrows can have
    /// </summary>
    public enum RibbonArrowDirection
    {
        /// <summary>
        /// The arrow points up
        /// </summary>
        Up,

        /// <summary>
        /// The arrow points down
        /// </summary>
        Down,

        /// <summary>
        /// The arrow points right
        /// </summary>
        Right,

        /// <summary>
        /// The arrow points left
        /// </summary>
        Left
    }

    public enum RibbonButtonStyle
    {
        /// <summary>
        /// Simple clickable button
        /// </summary>
        Normal,
        /// <summary>
        /// Button with a right side drop down
        /// </summary>
        DropDown,
        /// <summary>
        /// Button with an optional dropdown attachment on the right
        /// </summary>
        SplitDropDown,
        /// <summary>
        /// Mimics a standard drop down list item with no image
        /// </summary>
        DropDownListItem
    }

    /// <summary>
    /// Possible modes for the ribbon to be placed on the window
    /// </summary>
    public enum RibbonWindowMode
    {
        InsideWindow,

        NonClientAreaCustomDrawn,

        NonClientAreaGlass
    }

    /// <summary>
    /// Represents possible flow directions of items on the panels
    /// </summary>
    public enum RibbonPanelFlowDirection
    {
        /// <summary>
        /// Layout of items flows to the left, then down
        /// </summary>
        Left = 2,
        /// <summary>
        /// Layout of items flows to the Right, then down
        /// </summary>
        Right = 1,
        /// <summary>
        /// Layout of items flows to the bottom, then to the right
        /// </summary>
        Bottom = 0
    }

    /// <summary>
    /// Represents the size modes that a RibbonElement can be
    /// </summary>
    public enum RibbonElementSizeMode
    {
        /// <summary>
        /// The item is being shown on a dropdown
        /// </summary>
        DropDown = 5,

        /// <summary>
        /// Maximum size the element can reach
        /// </summary>
        Large = 4,

        /// <summary>
        /// A medium size for the element when not much space is available
        /// </summary>
        Medium = 3,

        /// <summary>
        /// The minimum size the element can be
        /// </summary>
        Compact = 2,

        /// <summary>
        /// The item doesn't fit as compact, so it must be shown as a single button
        /// </summary>
        Overflow = 1,

        /// <summary>
        /// No size mode specified
        /// </summary>
        None = 0
    }

    /// <summary>
    /// The width of the Separator bar when displayed on a drop down
    /// </summary>
    public enum RibbonSeparatorDropDownWidth
    {
        /// <summary>
        /// Full width to divide different controls
        /// </summary>
        Full = 1,

        /// <summary>
        /// Partial width to divide similar items
        /// </summary>
        Partial = 0
    }
}


text:
from apps.projects.models import Category, Project, Experiment
from django.shortcuts import render, HttpResponseRedirect
from django.core.exceptions import PermissionDenied

from django.views.generic import FormView, CreateView, ListView, DetailView, UpdateView
from django.contrib.auth.mixins import LoginRequiredMixin
from .forms import ProjectForm, ProjectImageCreateFormSet, ProjectImageFormSet
from django.core import serializers
from django.utils.encoding import uri_to_iri

from django.views.generic import CreateView
from django.contrib.auth.mixins import LoginRequiredMixin

class NewProject(LoginRequiredMixin, CreateView):
    form_class = ProjectForm
    template_name = 'projects/project_create.html'

    def get_context_data(self, **kwargs):
        data = super(NewProject, self).get_context_data(**kwargs)
        if self.request.method == 'POST':
            data['project_image'] = ProjectImageCreateFormSet(self.request.POST, self.request.FILES, instance=self.object)
        else:
            data['project_image'] = ProjectImageCreateFormSet(instance=self.object)
        return data

    def form_valid(self, form):
        user = self.request.user
        form.instance.user = user

        context = self.get_context_data()
        project_image = context['project_image']

        self.object = form.save()
        if project_image.is_valid():
            project_image.instance = self.object
            project_image.save()
        return super(NewProject, self).form_valid(form)

class UpdateProject(LoginRequiredMixin, UpdateView):
    model = Project
    form_class = ProjectForm
    pk_url_kwarg = 'id'

    def get(self, request, *args, **kwargs):
        self.object = self.get_object()
        if not self.object.user == self.request.user and not self.object.visibility:
            raise PermissionDenied()
        return super(UpdateProject, self).get(request, *args, **kwargs)

    def get_context_data(self, **kwargs):
        data = super(UpdateProject, self).get_context_data(**kwargs)
        if self.request.method == 'POST':
            data['project_image'] = ProjectImageFormSet(self.request.POST, self.request.FILES, instance=self.object)
        else:
            data['project_image'] = ProjectImageFormSet(instance=self.object)
        return data

    def form_valid(self, form):
        context = self.get_context_data()
        project_image = context['project_image']

        if project_image.is_valid():
            project_image.save()
        return super(UpdateProject, self).form_valid(form)

class MyProjects(LoginRequiredMixin, ListView):
    model = Project
    allow_empty = True
    paginate_by = 10

    def get_queryset(self):
        user = self.request.user
        return Project.objects.filter(user=user).order_by('created')

class ProjectDetail(DetailView):
    model = Project
    pk_url_kwarg = 'id'

    def get(self, request, *args, **kwargs):
        self.object = self.get_object()
        if not self.object.user == self.request.user and not self.object.visibility:
            raise PermissionDenied()
        return super(ProjectDetail, self).get(request, *args, **kwargs)

def categories(request, id=None):
    return render(
        request,
        'projects/categories.html',
        {
            'categories': Category.objects.allDescandends(parent=id)
        }
    )

def createExperiment(request, name, id):
    if request.method == 'POST':
        post_data = request.POST.copy()
        description = post_data['description']

        new_experiment = Experiment(project_id=id, description=description)
        new_experiment.save()

    return render(request, 'projects/createExperiment.html')

def delete_project(request, project_id):
    Project.objects.get(id=project_id).delete()

    return HttpResponseRedirect('/projects/')


text:
CClientUIInterface uiInterface;

bool InitError(const std::string& str)
{
    uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_ERROR);
    return false;
}

void InitWarning(const std::string& str)
{
    uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_WARNING);
}


text:
#ifndef __BASE_SYS_INC_IPHELPER_H__
#define __BASE_SYS_INC_IPHELPER_H__

#include <list>
#include <string>

#include <netinet/ip.h>

namespace parrot
{
class IPHelper
{
  public:
    IPHelper();
    explicit IPHelper(const std::string& ip);

  public:
    /**
     * Set IP address. E.g.:
     * (1) 192.168.1.1,
     * (2) ::FFFF:192.168.1.1,
     * (3) 2001:0db8:85a3:0000:0000:8a2e:0370:7334.
     *
     * @param  ip            The ipv4 address or ipv6 address.
     */
    void setIP(const std::string& ip);

    /**
     * Set IPv6 address in binary form.
     *
     * @param  addr             The IPv6 addr.
     */
    void setIP(const struct in6_addr& addr);

    /**
     * Set IPv4 address in binary form.
     *
     * @param  addr             The IPv4 addr.
     */
    void setIP(const struct in_addr& addr);

    /**
     * Check whether the IP is the IPv4 address .
     *
     * @return      True if IP is IPv4. Otherwise false.
     */
    bool isIPv4() const noexcept;

    /**
     * Check whether the IP is the IPv6 address .
     *
     * @return      True if IP is IPv6. Otherwise false.
     */
    bool isIPv6() const noexcept;

    /**
     * Get binary form IPv4 address.
     *
     * @return      The binary form IPv4 address.
     */
    struct in_addr  getIPv4Bin() const noexcept;

    /**
     * Get binary form IPv6 address.
     *
     * @return      The binary form IPv6 address.
     */
    struct in6_addr getIPv6Bin() const noexcept;

    /**
     * Get text form IP address.
     *
     * @return      The binary form IP address.
     */
    std::string     getIPStr() const noexcept;

  public:

    /**
     * Get IP addresses from domain name.
     *
     * @param   domainName    Domain name.
     * @param   ipv4List      The IPv4 addresses mapped to the domain name.
     * @param   ipv6List      The IPv6 addresses mapped to the domain name.
     */
    static void getIPAddress(const std::string&      domainName,
                             std::list<std::string>& ipv4List,
                             std::list<std::string>& ipv6List);

  private:
    int             _version; ///< 4 IPv4, 6 IPv6.
    std::string     _ip;
    struct in6_addr _addr6;
    struct in_addr  _addr4;
};
}

#endif


text:
require 'pathname'

## -------------------------------------------------------------------
## Constants

PLT_LIBS = %w( kernel stdlib )
PLT_FILE = "#{ENV['HOME']}/.dialyzer_plt"

CLEAN.include 'dialyzer.log'

## -------------------------------------------------------------------
## Rules

rule PLT_FILE do
  puts "generating base PLT file..."
  `dialyzer --build_plt -r #{erl_where('kernel', 'ebin')} --plt #{PLT_FILE}`
end

## -------------------------------------------------------------------
## Tasks

namespace :dialyzer do

  desc "Update your PLT file with the libraries required by this application"
  task :update_plt => PLT_FILE do
    PLT_LIBS.each do |lib|
      puts "adding #{lib} to plt..."
      `dialyzer --add_to_plt -r #{erl_where(lib, 'ebin')} --plt #{PLT_FILE}`
    end

    ERL_PATH.each do |app_path|
      path = abspath(app_path)
      puts "adding #{path} to plt..."
      `dialyzer --add_to_plt -r #{path} --plt #{PLT_FILE}`
    end
  end

  task :prepare do
    ERLC_FLAGS << '+debug_info'
  end

  desc "Run Dialyzer on the compiled beam files"
  task :run => [:prepare] + ERL_BEAM do
    warnings = ENV['WARN']
    if !warnings.nil? && !warnings.empty?
      warn_opts = ' -W' + warnings.split(',').join(' -W')
    else
      warn_opts = ''
    end

    sh "dialyzer -Iinclude -r ebin --plt #{PLT_FILE}\
                 -Werror_handling -Wunmatched_returns #{warn_opts} | tee dialyzer.log"
  end

end

task :dialyzer => 'dialyzer:run'


text:
id: V-38559
status: opt-in
tag: auditd
---

The audit rules for permission changes made with ``lremovexattr`` are disabled
by default as they can generate an excessive amount of logs in a short period
of time, especially during a deployment.

Deployers can enable auditing for ``lremovexattr`` usage by setting the
following Ansible variable:

.. code-block:: yaml

   security_audit_DAC_lremovexattr: yes


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.brandwatch</groupId>
    <artifactId>user-service</artifactId>
    <version>0.0.1</version>
    <packaging>war</packaging>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.2.1.RELEASE</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>1.2.1.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>4.0.7.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>4.0.7.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <optional>true</optional>
            <version>2.0.3</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>17.0</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.7</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
            <version>4.11</version>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <scope>test</scope>
            <version>1.9.5</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.4.1</version>
        </dependency>

        <dependency>
            <groupId>com.google.gag</groupId>
            <artifactId>gag</artifactId>
            <version>1.0.1</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>


text:
/*
 * ETextLineEncoder.cpp
 *
 *  Created on: 2016-5-24
 *      Author: cxxjava@163.com
 */

#include "../inc/ETextLineEncoder.hh"
#include "../inc/EIoBuffer.hh"

namespace efc {
namespace eio {

ETextLineEncoder::~ETextLineEncoder() {
	eso_mfree(crlf);
}

ETextLineEncoder::ETextLineEncoder(const char* s): crlf(null) {
	crlf = eso_mstrdup(s ? s : "\r\n");
}

void ETextLineEncoder::encode(sp<EIoSession>& session, sp<EObject>& message, sp<EProtocolEncoderOutput>& out) {
	const char* value = (message == null ? "" : message->toString().c_str());
	sp<EIoBuffer> buf = EIoBuffer::allocate(eso_strlen(value) + 2)->setAutoExpand(true);
	buf->putString(value);

	buf->putString(crlf);
	buf->flip();
	out->write(buf);
}

} /* namespace eio */
} /* namespace efc */


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

namespace Simple.Mocking.SetUp
{
	interface IParameterValueConstraint
	{
		bool Matches(object value);
	}
}


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Spinner - UIkit tests</title>

Spinner


text:
var collect = require('./collect');

module.exports = function(qualifier) {

	qualifier = qualifier || 'assets';

	return collect(qualifier, function(assets) {
		assets.forEach(function(asset) {
			if (asset.css) {
				asset.css.forEach(function(href) {
					var stylesheet = '<link href="'+ href +'" rel="stylesheet" />';
					if (this.locals('plugin.before').indexOf(stylesheet) === -1) {
						this.before(stylesheet);
					}
				}.bind(this));
			}
			if (asset.js) {
				asset.js.forEach(function(src) {
					var script = '<script src="'+ src +'" type="text/javascript"></script>';
					if (this.locals('plugin.before').indexOf(script) === -1) {
						this.before(script);
					}
				}.bind(this));
			}
		}.bind(this));

	});

};


text:
package org.drools.benchmarks.buildtime;

import java.io.IOException;
import java.io.StringReader;
import java.util.concurrent.TimeUnit;

import org.drools.benchmarks.common.DRLProvider;
import org.drools.benchmarks.common.providers.RulesWithJoinsProvider;
import org.drools.benchmarks.common.providers.SimpleRulesWithConstraintsProvider;
import org.drools.benchmarks.common.util.BuildtimeUtil;
import org.kie.api.KieBase;
import org.kie.api.KieBaseConfiguration;
import org.kie.api.KieServices;
import org.kie.api.builder.ReleaseId;
import org.kie.api.io.Resource;
import org.kie.api.io.ResourceType;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.Warmup;

@State(Scope.Thread)
@BenchmarkMode(Mode.AverageTime)
@Warmup(iterations = 15, time = 2, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 15, time = 2, timeUnit = TimeUnit.SECONDS)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@Fork(3)
public class BuildKieBaseFromContainerBenchmark {

    @Param({"true", "false"})
    private boolean useCanonicalModel;

    @Param({"100", "500"})
    private int numberOfRules;

    @Param({SimpleRulesWithConstraintsProvider.PROVIDER_ID, RulesWithJoinsProvider.PROVIDER_ID})
    private String rulesProviderId;

    private ReleaseId releaseId;
    private KieServices kieServices;
    private KieBaseConfiguration kieBaseConfiguration;

    @Setup
    public void createKJar() throws IOException {
        kieServices = KieServices.get();
        kieBaseConfiguration = kieServices.newKieBaseConfiguration();

        final DRLProvider drlProvider = getDRLProvider();
        final Resource drlResource = KieServices.get().getResources()
                .newReaderResource(new StringReader(drlProvider.getDrl(numberOfRules)))
                .setResourceType(ResourceType.DRL)
                .setSourcePath("drlFile.drl");
        releaseId = BuildtimeUtil.createKJarFromResources(useCanonicalModel, drlResource);
    }

    @Benchmark
    public KieBase getKieBaseFromContainer() {
        return kieServices.newKieContainer(releaseId).newKieBase(kieBaseConfiguration);
    }

    private DRLProvider getDRLProvider() {
        switch (rulesProviderId) {
            case SimpleRulesWithConstraintsProvider.PROVIDER_ID:
                return new SimpleRulesWithConstraintsProvider("Integer(this == ${i})");
            case RulesWithJoinsProvider.PROVIDER_ID:
                return new RulesWithJoinsProvider(4, false, true);
            default:
                throw new IllegalArgumentException("Benchmark doesn't support rules provider with id: " + rulesProviderId + "!");
        }
    }
}