text:
package java.net;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Collections;
import java.util.Date;
import java.util.Hashtable;
import java.util.List;
import java.util.Locale;
import java.util.Map;

/**
 * A connection to a URL for reading or writing. For HTTP connections, see
 * {@link HttpURLConnection} for documentation of HTTP-specific features.
 *
 *
For example, to retrieve {@code
 * ftp://mirror.csclub.uwaterloo.ca/index.html}:
   {@code
 *   URL url = new URL("ftp://mirror.csclub.uwaterloo.ca/index.html");
 *   URLConnection urlConnection = url.openConnection();
 *   InputStream in = new BufferedInputStream(urlConnection.getInputStream());
 *   try {
 *     readStream(in);
 *   } finally {
 *     in.close();
 *   }
 * }

 *
 *
{@code URLConnection} must be configured before it has connected to the
 * remote resource. Instances of {@code URLConnection} are not reusable: you
 * must use a different instance for each connection to a resource.
 *
 *
Timeouts

 * {@code URLConnection} supports two timeouts: a {@link #setConnectTimeout
 * connect timeout} and a {@link #setReadTimeout read timeout}. By default,
 * operations never time out.
 *
 *
Built-in Protocols

 *

 *
File

 *      Resources from the local file system can be loaded using {@code file:}
 *      URIs. File connections can only be used for input.
 *
FTP

 *      File Transfer Protocol (RFC 959)
 *      is supported, but with no public subclass. FTP connections can
 *      be used for input or output but not both.
 *
By default, FTP connections will be made using {@code anonymous} as
 *      the username and the empty string as the password. Specify alternate
 *      usernames and passwords in the URL: {@code
 *      ftp://username:password@host/path}.
 *
HTTP and HTTPS

 *      Refer to the {@link HttpURLConnection} and {@link
 *      javax.net.ssl.HttpsURLConnection HttpsURLConnection} subclasses.
 *
Jar

 *      Refer to the {@link JarURLConnection} subclass.
 *

 *
 *
Registering Additional Protocols

 * Use {@link URL#setURLStreamHandlerFactory} to register handlers for other
 * protocol types.
 */
public abstract class URLConnection {

    /**
     * The URL which represents the remote target of this {@code URLConnection}.
     */
    protected URL url;

    private String contentType;

    private static boolean defaultAllowUserInteraction;

    private static boolean defaultUseCaches = true;

    ContentHandler defaultHandler = new DefaultContentHandler();

    private long lastModified = -1;

    /**
     * The data must be modified more recently than this time in milliseconds
     * since January 1, 1970, GMT to be transmitted.
     */
    protected long ifModifiedSince;

    /**
     * Specifies whether the using of caches is enabled or the data has to be
     * recent for every request.
     */
    protected boolean useCaches = defaultUseCaches;

    /**
     * Specifies whether this {@code URLConnection} is already connected to the
     * remote resource. If this field is set to {@code true} the flags for
     * setting up the connection are not changeable anymore.
     */
    protected boolean connected;

    /**
     * Specifies whether this {@code URLConnection} allows sending data.
     */
    protected boolean doOutput;

    /**
     * Specifies whether this {@code URLConnection} allows receiving data.
     */
    protected boolean doInput = true;

    /**
     * Specifies whether this {@code URLConnection} allows user interaction as
     * it is needed for authentication purposes.
     */
    protected boolean allowUserInteraction = defaultAllowUserInteraction;

    private static ContentHandlerFactory contentHandlerFactory;

    private int readTimeout = 0;

    private int connectTimeout = 0;

    /**
     * Cache for storing content handler
     */
    static Hashtable<String, Object> contentHandlers = new Hashtable<String, Object>();

    /**
     * A hashtable that maps the filename extension (key) to a MIME-type
     * (element)
     */
    private static FileNameMap fileNameMap;

    /**
     * Creates a new {@code URLConnection} instance pointing to the resource
     * specified by the given URL.
     *
     * @param url
     *            the URL which represents the resource this {@code
     *            URLConnection} will point to.
     */
    protected URLConnection(URL url) {
        this.url = url;
    }

    /**
     * Opens a connection to the resource. This method will not
     * reconnect to a resource after the initial connection has been closed.
     *
     * @throws IOException
     *             if an error occurs while connecting to the resource.
     */
    public abstract void connect() throws IOException;

    /**
     * Returns the option value which indicates whether user interaction is allowed
     * on this {@code URLConnection}.
     *
     * @return the value of the option {@code allowUserInteraction}.
     * @see #allowUserInteraction
     */
    public boolean getAllowUserInteraction() {
        return allowUserInteraction;
    }

    /**
     * Returns an object representing the content of the resource this {@code
     * URLConnection} is connected to. First, it attempts to get the content
     * type from the method {@code getContentType()} which looks at the response
     * header field "Content-Type". If none is found it will guess the content
     * type from the filename extension. If that fails the stream itself will be
     * used to guess the content type.
     *
     * @return the content representing object.
     * @throws IOException
     *             if an error occurs obtaining the content.
     */
    public Object getContent() throws java.io.IOException {
        if (!connected) {
            connect();
        }

        if ((contentType = getContentType()) == null) {
            if ((contentType = guessContentTypeFromName(url.getFile())) == null) {
                contentType = guessContentTypeFromStream(getInputStream());
            }
        }
        if (contentType != null) {
            return getContentHandler(contentType).getContent(this);
        }
        return null;
    }

    /**
     * Returns an object representing the content of the resource this {@code
     * URLConnection} is connected to. First, it attempts to get the content
     * type from the method {@code getContentType()} which looks at the response
     * header field "Content-Type". If none is found it will guess the content
     * type from the filename extension. If that fails the stream itself will be
     * used to guess the content type. The content type must match with one of
     * the list {@code types}.
     *
     * @param types
     *            the list of acceptable content types.
     * @return the content representing object or {@code null} if the content
     *         type does not match with one of the specified types.
     * @throws IOException
     *             if an error occurs obtaining the content.
     */
    // Param is not generic in spec
    @SuppressWarnings("unchecked")
    public Object getContent(Class[] types) throws IOException {
        if (!connected) {
            connect();
        }

        if ((contentType = getContentType()) == null) {
            if ((contentType = guessContentTypeFromName(url.getFile())) == null) {
                contentType = guessContentTypeFromStream(getInputStream());
            }
        }
        if (contentType != null) {
            return getContentHandler(contentType).getContent(this, types);
        }
        return null;
    }

    /**
     * Returns the content encoding type specified by the response header field
     * {@code content-encoding} or {@code null} if this field is not set.
     *
     * @return the value of the response header field {@code content-encoding}.
     */
    public String getContentEncoding() {
        return getHeaderField("Content-Encoding");
    }

    /**
     * Returns the specific ContentHandler that will handle the type {@code
     * contentType}.
     *
     * @param type
     *            The type that needs to be handled
     * @return An instance of the Content Handler
     */
    private ContentHandler getContentHandler(String type) throws IOException {
        // Replace all non-alphanumeric character by '_'
        final String typeString = parseTypeString(type.replace('/', '.'));

        // if there's a cached content handler, use it
        Object cHandler = contentHandlers.get(type);
        if (cHandler != null) {
            return (ContentHandler) cHandler;
        }

        if (contentHandlerFactory != null) {
            cHandler = contentHandlerFactory.createContentHandler(type);
            contentHandlers.put(type, cHandler);
            return (ContentHandler) cHandler;
        }

        // search through the package list for the right class for the Content Type
        String packageList = System.getProperty("java.content.handler.pkgs");
        if (packageList != null) {
            for (String packageName : packageList.split("\\|")) {
                String className = packageName + "." + typeString;
                try {
                    Class<?> klass = Class.forName(className, true, ClassLoader.getSystemClassLoader());
                    cHandler = klass.newInstance();
                } catch (ClassNotFoundException e) {
                } catch (IllegalAccessException e) {
                } catch (InstantiationException e) {
                }
            }
        }

        if (cHandler == null) {
            try {
                // Try looking up AWT image content handlers
                String className = "org.apache.harmony.awt.www.content." + typeString;
                cHandler = Class.forName(className).newInstance();
            } catch (ClassNotFoundException e) {
            } catch (IllegalAccessException e) {
            } catch (InstantiationException e) {
            }
        }
        if (cHandler != null) {
            if (!(cHandler instanceof ContentHandler)) {
                throw new UnknownServiceException();
            }
            contentHandlers.put(type, cHandler); // if we got the handler,
            // cache it for next time
            return (ContentHandler) cHandler;
        }

        return defaultHandler;
    }

    /**
     * Returns the content length in bytes specified by the response header field
     * {@code content-length} or {@code -1} if this field is not set.
     *
     * @return the value of the response header field {@code content-length}.
     */
    public int getContentLength() {
        return getHeaderFieldInt("Content-Length", -1);
    }

    /**
     * Returns the MIME-type of the content specified by the response header field
     * {@code content-type} or {@code null} if type is unknown.
     *
     * @return the value of the response header field {@code content-type}.
     */
    public String getContentType() {
        return getHeaderField("Content-Type");
    }

    /**
     * Returns the timestamp when this response has been sent as a date in
     * milliseconds since January 1, 1970 GMT or {@code 0} if this timestamp is
     * unknown.
     *
     * @return the sending timestamp of the current response.
     */
    public long getDate() {
        return getHeaderFieldDate("Date", 0);
    }

    /**
     * Returns the default setting whether this connection allows user interaction.
     *
     * @return the value of the default setting {@code
     *         defaultAllowUserInteraction}.
     * @see #allowUserInteraction
     */
    public static boolean getDefaultAllowUserInteraction() {
        return defaultAllowUserInteraction;
    }

    /**
     * Returns null.
     *
     * @deprecated Use {@link #getRequestProperty}
     */
    @Deprecated
    public static String getDefaultRequestProperty(String field) {
        return null;
    }

    /**
     * Returns the default setting whether this connection allows using caches.
     *
     * @return the value of the default setting {@code defaultUseCaches}.
     * @see #useCaches
     */
    public boolean getDefaultUseCaches() {
        return defaultUseCaches;
    }

    /**
     * Returns the value of the option {@code doInput} which specifies whether this
     * connection allows to receive data.
     *
     * @return {@code true} if this connection allows input, {@code false}
     *         otherwise.
     * @see #doInput
     */
    public boolean getDoInput() {
        return doInput;
    }

    /**
     * Returns the value of the option {@code doOutput} which specifies whether
     * this connection allows to send data.
     *
     * @return {@code true} if this connection allows output, {@code false}
     *         otherwise.
     * @see #doOutput
     */
    public boolean getDoOutput() {
        return doOutput;
    }

    /**
     * Returns the timestamp when this response will be expired in milliseconds
     * since January 1, 1970 GMT or {@code 0} if this timestamp is unknown.
     *
     * @return the value of the response header field {@code expires}.
     */
    public long getExpiration() {
        return getHeaderFieldDate("Expires", 0);
    }

    /**
     * Returns the table which is used by all {@code URLConnection} instances to
     * determine the MIME-type according to a file extension.
     *
     * @return the file name map to determine the MIME-type.
     */
    public static FileNameMap getFileNameMap() {
        synchronized (URLConnection.class) {
            if (fileNameMap == null) {
                fileNameMap = new DefaultFileNameMap();
            }
            return fileNameMap;
        }
    }

    /**
     * Returns the header value at the field position {@code pos} or {@code null}
     * if the header has fewer than {@code pos} fields. The base
     * implementation of this method returns always {@code null}.
     *
     *
Some implementations (notably {@code HttpURLConnection}) include a mapping
     * for the null key; in HTTP's case, this maps to the HTTP status line and is
     * treated as being at position 0 when indexing into the header fields.
     *
     * @param pos
     *            the field position of the response header.
     * @return the value of the field at position {@code pos}.
     */
    public String getHeaderField(int pos) {
        return null;
    }

    /**
     * Returns an unmodifiable map of the response-header fields and values. The
     * response-header field names are the key values of the map. The map values
     * are lists of header field values associated with a particular key name.
     *
     *
Some implementations (notably {@code HttpURLConnection}) include a mapping
     * for the null key; in HTTP's case, this maps to the HTTP status line and is
     * treated as being at position 0 when indexing into the header fields.
     *
     * @return the response-header representing generic map.
     * @since 1.4
     */
    public Map<String, List<String>> getHeaderFields() {
        return Collections.emptyMap();
    }

    /**
     * Returns an unmodifiable map of general request properties used by this
     * connection. The request property names are the key values of the map. The
     * map values are lists of property values of the corresponding key name.
     *
     * @return the request-property representing generic map.
     * @since 1.4
     */
    public Map<String, List<String>> getRequestProperties() {
        checkNotConnected();
        return Collections.emptyMap();
    }

    private void checkNotConnected() {
        if (connected) {
            throw new IllegalStateException("Already connected");
        }
    }

    /**
     * Adds the given property to the request header. Existing properties with
     * the same name will not be overwritten by this method.
     *
     * @param field
     *            the request property field name to add.
     * @param newValue
     *            the value of the property which is to add.
     * @throws IllegalStateException
     *             if the connection has been already established.
     * @throws NullPointerException
     *             if the property name is {@code null}.
     * @since 1.4
     */
    public void addRequestProperty(String field, String newValue) {
        checkNotConnected();
        if (field == null) {
            throw new NullPointerException("field == null");
        }
    }

    /**
     * Returns the value of the header field specified by {@code key} or {@code
     * null} if there is no field with this name. The base implementation of
     * this method returns always {@code null}.
     *
     *
Some implementations (notably {@code HttpURLConnection}) include a mapping
     * for the null key; in HTTP's case, this maps to the HTTP status line and is
     * treated as being at position 0 when indexing into the header fields.
     *
     * @param key
     *            the name of the header field.
     * @return the value of the header field.
     */
    public String getHeaderField(String key) {
        return null;
    }

    /**
     * Returns the specified header value as a date in milliseconds since January
     * 1, 1970 GMT. Returns the {@code defaultValue} if no such header field
     * could be found.
     *
     * @param field
     *            the header field name whose value is needed.
     * @param defaultValue
     *            the default value if no field has been found.
     * @return the value of the specified header field as a date in
     *         milliseconds.
     */
    @SuppressWarnings("deprecation")
    public long getHeaderFieldDate(String field, long defaultValue) {
        String date = getHeaderField(field);
        if (date == null) {
            return defaultValue;
        }
        try {
            return Date.parse(date); // TODO: use HttpDate.parse()
        } catch (Exception e) {
            return defaultValue;
        }
    }

    /**
     * Returns the specified header value as a number. Returns the {@code
     * defaultValue} if no such header field could be found or the value could
     * not be parsed as an {@code Integer}.
     *
     * @param field
     *            the header field name whose value is needed.
     * @param defaultValue
     *            the default value if no field has been found.
     * @return the value of the specified header field as a number.
     */
    public int getHeaderFieldInt(String field, int defaultValue) {
        try {
            return Integer.parseInt(getHeaderField(field));
        } catch (NumberFormatException e) {
            return defaultValue;
        }
    }

    /**
     * Returns the name of the header field at the given position {@code posn} or
     * {@code null} if there are fewer than {@code posn} fields. The base
     * implementation of this method returns always {@code null}.
     *
     *
Some implementations (notably {@code HttpURLConnection}) include a mapping
     * for the null key; in HTTP's case, this maps to the HTTP status line and is
     * treated as being at position 0 when indexing into the header fields.
     *
     * @param posn
     *            the position of the header field which has to be returned.
     * @return the header field name at the given position.
     */
    public String getHeaderFieldKey(int posn) {
        return null;
    }

    /**
     * Returns the point of time since when the data must be modified to be
     * transmitted. Some protocols transmit data only if it has been modified
     * more recently than a particular time.
     *
     * @return the time in milliseconds since January 1, 1970 GMT.
     * @see #ifModifiedSince
     */
    public long getIfModifiedSince() {
        return ifModifiedSince;
    }

    /**
     * Returns an {@code InputStream} for reading data from the resource pointed by
     * this {@code URLConnection}. It throws an UnknownServiceException by
     * default. This method must be overridden by its subclasses.
     *
     * @return the InputStream to read data from.
     * @throws IOException
     *             if no InputStream could be created.
     */
    public InputStream getInputStream() throws IOException {
        throw new UnknownServiceException("Does not support writing to the input stream");
    }

    /**
     * Returns the value of the response header field {@code last-modified} or
     * {@code 0} if this value is not set.
     *
     * @return the value of the {@code last-modified} header field.
     */
    public long getLastModified() {
        if (lastModified != -1) {
            return lastModified;
        }
        return lastModified = getHeaderFieldDate("Last-Modified", 0);
    }

    /**
     * Returns an {@code OutputStream} for writing data to this {@code
     * URLConnection}. It throws an {@code UnknownServiceException} by default.
     * This method must be overridden by its subclasses.
     *
     * @return the OutputStream to write data.
     * @throws IOException
     *             if no OutputStream could be created.
     */
    public OutputStream getOutputStream() throws IOException {
        throw new UnknownServiceException("Does not support writing to the output stream");
    }

    /**
     * Returns a {@code Permission} object representing all needed permissions to
     * open this connection. The returned permission object depends on the state
     * of the connection and will be {@code null} if no permissions are
     * necessary. By default, this method returns {@code AllPermission}.
     * Subclasses should overwrite this method to return an appropriate
     * permission object.
     *
     * @return the permission object representing the needed permissions to open
     *         this connection.
     * @throws IOException
     *             if an I/O error occurs while creating the permission object.
     */
    public java.security.Permission getPermission() throws IOException {
        return new java.security.AllPermission();
    }

    /**
     * Returns the value of the request header property specified by {code field}
     * or {@code null} if there is no field with this name. The base
     * implementation of this method returns always {@code null}.
     *
     * @param field
     *            the name of the request header property.
     * @return the value of the property.
     * @throws IllegalStateException
     *             if the connection has been already established.
     */
    public String getRequestProperty(String field) {
        checkNotConnected();
        return null;
    }

    /**
     * Returns the URL represented by this {@code URLConnection}.
     *
     * @return the URL of this connection.
     */
    public URL getURL() {
        return url;
    }

    /**
     * Returns the value of the flag which specifies whether this {@code
     * URLConnection} allows to use caches.
     *
     * @return {@code true} if using caches is allowed, {@code false} otherwise.
     */
    public boolean getUseCaches() {
        return useCaches;
    }

    /**
     * Determines the MIME-type of the given resource {@code url} by resolving
     * the filename extension with the internal FileNameMap. Any fragment
     * identifier is removed before processing.
     *
     * @param url
     *            the URL with the filename to get the MIME type.
     * @return the guessed content type or {@code null} if the type could not be
     *         determined.
     */
    public static String guessContentTypeFromName(String url) {
        return getFileNameMap().getContentTypeFor(url);
    }

    /**
     * Determines the MIME-type of the resource represented by the input stream
     * {@code is} by reading its first few characters.
     *
     * @param is
     *            the resource representing input stream to determine the
     *            content type.
     * @return the guessed content type or {@code null} if the type could not be
     *         determined.
     * @throws IOException
     *             if an I/O error occurs while reading from the input stream.
     */
    public static String guessContentTypeFromStream(InputStream is) throws IOException {
        if (!is.markSupported()) {
            return null;
        }
        // Look ahead up to 64 bytes for the longest encoded header
        is.mark(64);
        byte[] bytes = new byte[64];
        int length = is.read(bytes);
        is.reset();

        // If there is no data from the input stream, we can't determine content type.
        if (length == -1) {
            return null;
        }

        // Check for Unicode BOM encoding indicators
        String encoding = "US-ASCII";
        int start = 0;
        if (length > 1) {
            if ((bytes[0] == (byte) 0xFF) && (bytes[1] == (byte) 0xFE)) {
                encoding = "UTF-16LE";
                start = 2;
                length -= length & 1;
            }
            if ((bytes[0] == (byte) 0xFE) && (bytes[1] == (byte) 0xFF)) {
                encoding = "UTF-16BE";
                start = 2;
                length -= length & 1;
            }
            if (length > 2) {
                if ((bytes[0] == (byte) 0xEF) && (bytes[1] == (byte) 0xBB)
                        && (bytes[2] == (byte) 0xBF)) {
                    encoding = "UTF-8";
                    start = 3;
                }
                if (length > 3) {
                    if ((bytes[0] == (byte) 0x00) && (bytes[1] == (byte) 0x00)
                            && (bytes[2] == (byte) 0xFE)
                            && (bytes[3] == (byte) 0xFF)) {
                        encoding = "UTF-32BE";
                        start = 4;
                        length -= length & 3;
                    }
                    if ((bytes[0] == (byte) 0xFF) && (bytes[1] == (byte) 0xFE)
                            && (bytes[2] == (byte) 0x00)
                            && (bytes[3] == (byte) 0x00)) {
                        encoding = "UTF-32LE";
                        start = 4;
                        length -= length & 3;
                    }
                }
            }
        }

        String header = new String(bytes, start, length - start, encoding);

        // Check binary types
        if (header.startsWith("PK")) {
            return "application/zip";
        }
        if (header.startsWith("GI")) {
            return "image/gif";
        }

        // Check text types
        String textHeader = header.trim().toUpperCase(Locale.US);
        if (textHeader.startsWith("<!DOCTYPE HTML") ||
                textHeader.startsWith("<HTML") ||
                textHeader.startsWith("<HEAD") ||
                textHeader.startsWith("<BODY") ||
                textHeader.startsWith("<HEAD")) {
            return "text/html";
        }

        if (textHeader.startsWith("<?XML")) {
            return "application/xml";
        }

        // Give up
        return null;
    }

    /**
     * Performs any necessary string parsing on the input string such as
     * converting non-alphanumeric character into underscore.
     *
     * @param typeString
     *            the parsed string
     * @return the string to be parsed
     */
    private String parseTypeString(String typeString) {
        StringBuilder result = new StringBuilder(typeString);
        for (int i = 0; i < result.length(); i++) {
            // if non-alphanumeric, replace it with '_'
            char c = result.charAt(i);
            if (!(Character.isLetter(c) || Character.isDigit(c) || c == '.')) {
                result.setCharAt(i, '_');
            }
        }
        return result.toString();
    }

    /**
     * Sets the flag indicating whether this connection allows user interaction
     * or not. This method can only be called prior to the connection
     * establishment.
     *
     * @param newValue
     *            the value of the flag to be set.
     * @throws IllegalStateException
     *             if this method attempts to change the flag after the
     *             connection has been established.
     * @see #allowUserInteraction
     */
    public void setAllowUserInteraction(boolean newValue) {
        checkNotConnected();
        this.allowUserInteraction = newValue;
    }

    /**
     * Sets the internally used content handler factory. The content factory can
     * only be set once during the lifetime of the application.
     *
     * @param contentFactory
     *            the content factory to be set.
     * @throws Error
     *             if the factory has been already set.
     */
    public static synchronized void setContentHandlerFactory(ContentHandlerFactory contentFactory) {
        if (contentHandlerFactory != null) {
            throw new Error("Factory already set");
        }
        contentHandlerFactory = contentFactory;
    }

    /**
     * Sets the default value for the flag indicating whether this connection
     * allows user interaction or not. Existing {@code URLConnection}s are
     * unaffected.
     *
     * @param allows
     *            the default value of the flag to be used for new connections.
     * @see #defaultAllowUserInteraction
     * @see #allowUserInteraction
     */
    public static void setDefaultAllowUserInteraction(boolean allows) {
        defaultAllowUserInteraction = allows;
    }

    /**
     * Does nothing.
     *
     * @deprecated Use {@link URLConnection#setRequestProperty(String, String)}.
     */
    @Deprecated
    public static void setDefaultRequestProperty(String field, String value) {
    }

    /**
     * Sets the default value for the flag indicating whether this connection
     * allows to use caches. Existing {@code URLConnection}s are unaffected.
     *
     * @param newValue
     *            the default value of the flag to be used for new connections.
     * @see #useCaches
     */
    public void setDefaultUseCaches(boolean newValue) {
        defaultUseCaches = newValue;
    }

    /**
     * Sets the flag indicating whether this {@code URLConnection} allows input.
     * It cannot be set after the connection is established.
     *
     * @param newValue
     *            the new value for the flag to be set.
     * @throws IllegalAccessError
     *             if this method attempts to change the value after the
     *             connection has been already established.
     * @see #doInput
     */
    public void setDoInput(boolean newValue) {
        checkNotConnected();
        this.doInput = newValue;
    }

    /**
     * Sets the flag indicating whether this {@code URLConnection} allows
     * output. It cannot be set after the connection is established.
     *
     * @param newValue
     *            the new value for the flag to be set.
     * @throws IllegalAccessError
     *             if this method attempts to change the value after the
     *             connection has been already established.
     * @see #doOutput
     */
    public void setDoOutput(boolean newValue) {
        checkNotConnected();
        this.doOutput = newValue;
    }

    /**
     * Sets the internal map which is used by all {@code URLConnection}
     * instances to determine the MIME-type according to a filename extension.
     *
     * @param map
     *            the MIME table to be set.
     */
    public static void setFileNameMap(FileNameMap map) {
        synchronized (URLConnection.class) {
            fileNameMap = map;
        }
    }

    /**
     * Sets the point of time since when the data must be modified to be
     * transmitted. Some protocols transmit data only if it has been modified
     * more recently than a particular time. The data will be transmitted
     * regardless of its timestamp if this option is set to {@code 0}.
     *
     * @param newValue
     *            the time in milliseconds since January 1, 1970 GMT.
     * @throws IllegalStateException
     *             if this {@code URLConnection} has already been connected.
     * @see #ifModifiedSince
     */
    public void setIfModifiedSince(long newValue) {
        checkNotConnected();
        this.ifModifiedSince = newValue;
    }

    /**
     * Sets the value of the specified request header field. The value will only
     * be used by the current {@code URLConnection} instance. This method can
     * only be called before the connection is established.
     *
     * @param field
     *            the request header field to be set.
     * @param newValue
     *            the new value of the specified property.
     * @throws IllegalStateException
     *             if the connection has been already established.
     * @throws NullPointerException
     *             if the parameter {@code field} is {@code null}.
     */
    public void setRequestProperty(String field, String newValue) {
        checkNotConnected();
        if (field == null) {
            throw new NullPointerException("field == null");
        }
    }

    /**
     * Sets the flag indicating whether this connection allows to use caches or
     * not. This method can only be called prior to the connection
     * establishment.
     *
     * @param newValue
     *            the value of the flag to be set.
     * @throws IllegalStateException
     *             if this method attempts to change the flag after the
     *             connection has been established.
     * @see #useCaches
     */
    public void setUseCaches(boolean newValue) {
        checkNotConnected();
        this.useCaches = newValue;
    }

    /**
     * Sets the timeout value in milliseconds for establishing the connection to
     * the resource pointed by this {@code URLConnection} instance. A {@code
     * SocketTimeoutException} is thrown if the connection could not be
     * established in this time. Default is {@code 0} which stands for an
     * infinite timeout.
     *
     * @param timeout
     *            the connecting timeout in milliseconds.
     * @throws IllegalArgumentException
     *             if the parameter {@code timeout} is less than zero.
     */
    public void setConnectTimeout(int timeout) {
        if (timeout < 0) {
            throw new IllegalArgumentException("timeout < 0");
        }
        this.connectTimeout = timeout;
    }

    /**
     * Returns the configured connecting timeout.
     *
     * @return the connecting timeout value in milliseconds.
     */
    public int getConnectTimeout() {
        return connectTimeout;
    }

    /**
     * Sets the timeout value in milliseconds for reading from the input stream
     * of an established connection to the resource. A {@code
     * SocketTimeoutException} is thrown if the connection could not be
     * established in this time. Default is {@code 0} which stands for an
     * infinite timeout.
     *
     * @param timeout
     *            the reading timeout in milliseconds.
     * @throws IllegalArgumentException
     *             if the parameter {@code timeout} is less than zero.
     */
    public void setReadTimeout(int timeout) {
        if (timeout < 0) {
            throw new IllegalArgumentException("timeout < 0");
        }
        this.readTimeout = timeout;
    }

    /**
     * Returns the configured timeout for reading from the input stream of an
     * established connection to the resource.
     *
     * @return the reading timeout value in milliseconds.
     */
    public int getReadTimeout() {
        return readTimeout;
    }

    /**
     * Returns the string representation containing the name of this class and
     * the URL.
     *
     * @return the string representation of this {@code URLConnection} instance.
     */
    @Override
    public String toString() {
        return getClass().getName() + ":" + url.toString();
    }

    static class DefaultContentHandler extends java.net.ContentHandler {
        @Override
        public Object getContent(URLConnection u) throws IOException {
            return u.getInputStream();
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<data xmlns="ns:workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="ns:workflow resource:WorkflowData">
	<documentTypes xmlns="ns:workflow/DocumentType" xsi:schemaLocation="ns:workflow/DocumentType resource:DocumentType">
		<documentType>
			<name>RolodexMaintenanceDocument</name>
			<description>Create/Edit a Rolodex entry</description>
			<label>Address Book</label>
			<parent>KcSharedMaintenanceDocument</parent>
		</documentType>
	</documentTypes>
</data>

redpajama_set_name: RedPajamaGithub


text:
Ebook Spead Reading Apps

#Download Binary
Download Binary For all platform

* windows 32 bit
* windows 64 bit
* Linux 32 bit
* Linux 64 bit
* OSX 32 bit
* OSX 64 bit

https://github.com/yud1z/SpeedRead/releases/tag/v1.0


text:
package some.test;

import io.realm.RealmModel;
import io.realm.RealmObject;
import io.realm.RealmList;

public class ExtendRealmList<E extends RealmModel> extends RealmList<E> {
}


text:
package io.opentelemetry.exporter.internal.retry;

import com.google.auto.value.AutoValue;
import java.time.Duration;

/**
 * This class is internal and is hence not for public use. Its APIs are unstable and can change at
 * any time.
 */
@AutoValue
public abstract class RetryPolicy {

  private static final RetryPolicy DEFAULT = new RetryPolicyBuilder().build();

  RetryPolicy() {}

  /** Return the default {@link RetryPolicy}. */
  public static RetryPolicy getDefault() {
    return DEFAULT;
  }

  /** Returns a new {@link RetryPolicyBuilder} to construct a {@link RetryPolicy}. */
  public static RetryPolicyBuilder builder() {
    return new RetryPolicyBuilder();
  }

  /** Returns the max number of attempts, including the original request. */
  public abstract int getMaxAttempts();

  /** Returns the initial backoff. */
  public abstract Duration getInitialBackoff();

  /** Returns the max backoff. */
  public abstract Duration getMaxBackoff();

  /** Returns the backoff multiplier. */
  public abstract double getBackoffMultiplier();

  static RetryPolicy create(
      int maxAttempts, Duration initialBackoff, Duration maxBackoff, double backoffMultiplier) {
    return new AutoValue_RetryPolicy(maxAttempts, initialBackoff, maxBackoff, backoffMultiplier);
  }
}


text:
![munin-sidekiq_stats example](https://raw.githubusercontent.com/t-cyrill/munin-sidekiq_stats/master/images/example.png "munin-sidekiq_stats example")

A munin plugin for Linux to monitor sidekiq (Ruby job worker) stats

Usage
----------------

Copy `_sidekiq_stats` to munin plugins directory. (i.e. /usr/share/munin/plugins)

And create symbolic link with application name prefix.

```
ln -s /usr/share/munin/plugins/_sidekiq_stats /etc/munin/plugins/example-app_sidekiq_stats
ln -s /usr/share/munin/plugins/_sidekiq_queue_stats /etc/munin/plugins/example-app_sidekiq_queue_stats
```

Create munin configration.

### Example

```
[example-app_sidekiq_stats]
  user app_user
  env.APP_NAME example-app
  env.RAILS_ROOT /var/www/example-app/current
```

Restart munin-node.

```
sudo /etc/init.d/munin-node restart
```

## Contributing

1. Fork it ( http://github.com/t-cyrill/munin-sidekiq_stats/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
#ifndef _LINUX_SIGNALFD_H
#define _LINUX_SIGNALFD_H
#include <linux/types.h>
#include <linux/fcntl.h>
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SFD_CLOEXEC O_CLOEXEC
#define SFD_NONBLOCK O_NONBLOCK
struct signalfd_siginfo {
 __u32 ssi_signo;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 __s32 ssi_errno;
 __s32 ssi_code;
 __u32 ssi_pid;
 __u32 ssi_uid;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 __s32 ssi_fd;
 __u32 ssi_tid;
 __u32 ssi_band;
 __u32 ssi_overrun;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 __u32 ssi_trapno;
 __s32 ssi_status;
 __s32 ssi_int;
 __u64 ssi_ptr;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 __u64 ssi_utime;
 __u64 ssi_stime;
 __u64 ssi_addr;
 __u16 ssi_addr_lsb;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 __u8 __pad[46];
};
#endif


text:
namespace Azure.Messaging.EventGrid.SystemEvents
{
    /// <summary> Properties JSON element. </summary>
    public partial class DeviceTwinInfoProperties
    {
        /// <summary> Initializes a new instance of DeviceTwinInfoProperties. </summary>
        internal DeviceTwinInfoProperties()
        {
        }

        /// <summary> Initializes a new instance of DeviceTwinInfoProperties. </summary>
        /// <param name="desired"> A portion of the properties that can be written only by the application back-end, and read by the device. </param>
        /// <param name="reported"> A portion of the properties that can be written only by the device, and read by the application back-end. </param>
        internal DeviceTwinInfoProperties(DeviceTwinProperties desired, DeviceTwinProperties reported)
        {
            Desired = desired;
            Reported = reported;
        }

        /// <summary> A portion of the properties that can be written only by the application back-end, and read by the device. </summary>
        public DeviceTwinProperties Desired { get; }
        /// <summary> A portion of the properties that can be written only by the device, and read by the application back-end. </summary>
        public DeviceTwinProperties Reported { get; }
    }
}


text:
'use strict'

const linting = require('./support/test-util').linting
const source = require('./support/test-util').source

describe('Linting string literals', () => {
  it('should report a violation when a multiline string literal is used', () => {
    const text = source([
      'var s = "This is a \\',
      'long line.";'
    ])
    expect(linting(text)).toReportViolationForRule('no-multi-str')
  })

  it('should not report a violation when a multiline string template literal is used', () => {
    const text = source([
      'var s = `This is a ',
      'long line.`;'
    ])
    expect(linting(text)).toNotReportViolation()
  })
})


text:
from rpython.rlib.clibffi import FFI_DEFAULT_ABI
from rpython.rlib import rgil
from rpython.rtyper.lltypesystem import lltype, rffi

class AbstractCallBuilder(object):

    # this is the calling convention (can be FFI_STDCALL on Windows)
    callconv = FFI_DEFAULT_ABI

    # is it for the main CALL of a call_release_gil?
    is_call_release_gil = False

    # this can be set to guide more complex calls: gives the detailed
    # type of the arguments
    argtypes = ""
    ressign = False

    def __init__(self, assembler, fnloc, arglocs, resloc, restype, ressize):
        self.fnloc = fnloc
        self.arglocs = arglocs
        self.asm = assembler
        self.mc = assembler.mc
        self.resloc = resloc
        self.restype = restype
        self.ressize = ressize

    def emit_no_collect(self):
        """Emit a call that cannot collect."""
        self.prepare_arguments()
        self.emit_raw_call()
        self.restore_stack_pointer()
        self.load_result()

    def emit(self):
        """Emit a regular call; not for CALL_RELEASE_GIL."""
        self.prepare_arguments()
        self.push_gcmap()
        self.emit_raw_call()
        self.restore_stack_pointer()
        self.pop_gcmap()
        self.load_result()

    def emit_call_release_gil(self, save_err):
        """Emit a CALL_RELEASE_GIL, including calls to releasegil_addr
        and reacqgil_addr.  'save_err' is a combination of rffi.RFFI_*ERR*."""
        fastgil = rffi.cast(lltype.Signed, rgil.gil_fetch_fastgil())
        self.select_call_release_gil_mode()
        self.prepare_arguments()
        self.push_gcmap_for_call_release_gil()
        self.call_releasegil_addr_and_move_real_arguments(fastgil)
        self.write_real_errno(save_err)
        self.emit_raw_call()
        self.restore_stack_pointer()
        self.read_real_errno(save_err)
        self.move_real_result_and_call_reacqgil_addr(fastgil)
        self.pop_gcmap()
        self.load_result()

    def call_releasegil_addr_and_move_real_arguments(self, fastgil):
        raise NotImplementedError

    def move_real_result_and_call_reacqgil_addr(self, fastgil):
        raise NotImplementedError

    def write_real_errno(self, save_err):
        raise NotImplementedError

    def read_real_errno(self, save_err):
        raise NotImplementedError

    def select_call_release_gil_mode(self):
        """Overridden in CallBuilder64"""
        self.is_call_release_gil = True

    def prepare_arguments(self):
        raise NotImplementedError

    def push_gcmap(self):
        raise NotImplementedError

    def push_gcmap_for_call_release_gil(self):
        assert self.is_call_release_gil
        # we put the gcmap now into the frame before releasing the GIL,
        # and pop it after reacquiring the GIL.  The assumption
        # is that this gcmap describes correctly the situation at any
        # point in-between: all values containing GC pointers should
        # be safely saved out of registers by now, and will not be
        # manipulated by any of the following CALLs.
        gcmap = self.asm._regalloc.get_gcmap(noregs=True)
        self.asm.push_gcmap(self.mc, gcmap, store=True)

    def pop_gcmap(self):
        raise NotImplementedError

    def emit_raw_call(self):
        raise NotImplementedError

    def restore_stack_pointer(self):
        raise NotImplementedError

    def load_result(self):
        raise NotImplementedError


text:
import {expect} from 'chai';
import {defineSupportCode} from 'cucumber';

defineSupportCode(({Given, When, Then}) => {
  When('I add TODO "{text}"', async function(text) {
    this.newTodo = text;
    await this.page('todo-list').addTodo(this.newTodo);
  });

  Then('the new TODO is on the list', async function() {
    const list = await this.page('todo-list').getList();
    if (!this.newTodo) {
      throw new Error('there is no new TODO, did you add?');
    }
    expect(list.map(item => item.text)).to.contain(this.newTodo);
  });
});


text:
package com.danielasfregola.twitter4s.entities.v2.enums.expansions

object TweetExpansions extends Enumeration {
  type TweetExpansions = Value

  val `Attachments.PollIds` = Value("attachments.poll_ids")
  val `Attachments.MediaKeys` = Value("attachments.media_keys")
  val AuthorId = Value("author_id")
  val `Entities.Mentions.Username` = Value("entities.mentions.username")
  val `Geo.PlaceId` = Value("geo.place_id")
  val InReplyToUser = Value("in_reply_to_user_id")
  val `ReferencedTweets.Id` = Value("referenced_tweets.id")
  val `ReferencedTweets.Id.AuthorId` = Value("referenced_tweets.id.author_id")
}


text:
WrappedDateTest = TestCase("WrappedDateTest");

WrappedDateTest.prototype.testBasic = function () {
  var WrappedDate = mkDateWrapper();

  var wd = new WrappedDate(2010, 3, 14, 15, 26, 45, 789);

  assert(wd instanceof WrappedDate);
  assert(!(wd instanceof Date));
  assertEquals(WrappedDate, wd.constructor);

  assertEquals(2010, wd.getFullYear());
  assertEquals(3, wd.getMonth());
  assertEquals(14, wd.getDate());
  assertEquals(15, wd.getHours());
  assertEquals(26, wd.getMinutes());
  assertEquals(45, wd.getSeconds());
  assertEquals(789, wd.getMilliseconds());

  wd.setHours(13, 0, 0, 0);

  assertEquals(2010, wd.getFullYear());
  assertEquals(3, wd.getMonth());
  assertEquals(14, wd.getDate());
  assertEquals(13, wd.getHours());
  assertEquals(0, wd.getMinutes());
  assertEquals(0, wd.getSeconds());
  assertEquals(0, wd.getMilliseconds());

  assertEquals(2010, wd.getUTCFullYear());
  assertEquals(3, wd.getUTCMonth());

  assertEquals(wd._original.valueOf(), wd.valueOf());
  assertEquals(wd._original.getTimezoneOffset(), wd.getTimezoneOffset());
  assertEquals(wd._original.toUTCString(), wd.toUTCString());

  var d = new Date();
  d.setMilliseconds(0);
  assertEquals(Date.parse(d.toString()), d.valueOf());
  assertEquals(WrappedDate.parse(d.toString()), d.valueOf());

  assertEquals(WrappedDate.UTC(2010, 3, 14, 13, 26, 45, 879),
               Date.UTC(2010, 3, 14, 13, 26, 45, 879));
}

function mockDateNow(methods, NewDate) {
  var originalInitialize = methods.initialize;

  methods.initialize = function (originalDate, args) {
    if (args.length == 0) {
      return originalInitialize.call(this, originalDate, [NewDate.now]);
    }
    return originalInitialize.call(this, originalDate, args);
  }
}

function mkMockedDateNow(now) {
  if (now instanceof Date) {
    now = now.valueOf();
  }
  now = Number(now);

  var rv = mkDateWrapper(mockDateNow);
  rv.now = now;
  return rv;
}

WrappedDateTest.prototype.testMockedNow = function () {
  var mockedNow = new Date(Date.UTC(2010, 1, 14, 13, 30));
  var MockedDate = mkMockedDateNow(mockedNow);

  assertEquals(mockedNow.toString(), MockedDate());
  assertEquals(mockedNow.valueOf(), (new MockedDate()).valueOf());

  assertEquals(Date.UTC(2010, 1, 14, 13, 30), (new MockedDate()).valueOf());
  MockedDate.now += 3600*1000;
  assertEquals(Date.UTC(2010, 1, 14, 14, 30), (new MockedDate()).valueOf());
}


text:
'use strict';

import { View } from 'backbone.marionette';
import { bindActionCreators } from 'redux';
import { observeStore, provider } from '../helpers/redux-helpers';
import _ from 'lodash';

const defaultMapState = () => ({});
const defaultMapDispatch = dispatch => ({ dispatch });

const ReduxViewMixin = {
  delegateEntityEvents() {
    this._delegateEntityEvents(this.model, this.collection);

    // bind each behaviors model and collection events
    this._delegateBehaviorEntityEvents();

    // listen to redux store
    this.connectToStore();

    return this;
  },

  shouldViewRender() {
    return true;
  },

  onStoreUpdated(oldState, newState) {
    this.state = newState;

    if (this.shouldViewRender(oldState, newState)) {
      this.render();
    }
  },

  connectToStore() {
    if (!provider.store) {
      return;
    }

    const mapState = this.mapState || defaultMapState;
    const mapDispatch = this.mapDispatch || defaultMapDispatch;
    const actions = bindActionCreators(mapDispatch(), provider.store.dispatch);
    const currentState = mapState(provider.store.getState());

    this.state = currentState;
    this.actions = actions;

    observeStore(provider.store, currentState, mapState, (newState, oldState) => {
      this.onStoreUpdated(oldState, newState);
    });
  },

  serializeData() {
    let data = {};

    // If we have a model, we serialize that
    if (this.model) {
      data = this.serializeModel();
    } else if (this.collection) {
      data = {
        items: this.serializeCollection()
      };
    }

    if (this.state) {
      data.redux = this.state;
    }

    return data;
  }
};

_.extend(View.prototype, ReduxViewMixin);

export default View;


text:
<?php namespace HashOver;

// Copyright (C) 2010-2017 Jacob Barkdull
// This file is part of HashOver.
//
// HashOver is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// HashOver is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with HashOver.  If not, see <http://www.gnu.org/licenses/>.

// Display source code
if (basename ($_SERVER['PHP_SELF']) === basename (__FILE__)) {
	if (isset ($_GET['source'])) {
		header ('Content-type: text/plain; charset=UTF-8');
		exit (file_get_contents (basename (__FILE__)));
	}
}

// Change to the scripts directory
chdir ('../scripts/');

// Do some standard HashOver setup work
require ('standard-setup.php');
require ('javascript-setup.php');
require ('oop-setup.php');

try {
	// Instantiate HashOver class
	$hashover = new \HashOver ('json', 'api');

	// Display error if the API is disabled
	if (empty ($_POST['ajax']) and $hashover->setup->APIStatus ('json') === 'disabled') {
		throw new \Exception ('<b>HashOver</b>: This API is not enabled.');
	}

	// Configure HashOver and load comments
	$hashover->setup->setPageURL ('request');
	$hashover->setup->collapsesComments = false;
	$hashover->initiate ();

	// Setup where to start reading comments
	$start = !empty ($_POST['start']) ? $_POST['start'] : 0;

	// Check for comments
	if ($hashover->readComments->totalCount > 1) {
		// Parse primary comments
		// TODO: Use starting point
		$hashover->parsePrimary (0);

		// Display as JSON data
		$data = $hashover->comments;
	} else {
		// Return no comments message
		$data = array ('No comments.');
	}

	// Return JSON data
	echo json_encode ($data);

} catch (\Exception $error) {
	$misc = new Misc ('json');
	$misc->displayError ($error->getMessage ());
}


text:
package com.koch.ambeth.persistence.jdbc.connection;

public interface IStatementPerformanceReportItem {
	int getExecutionCount();

	double getSpentTimePerExecution();

	double getSpentTimePerCursor();

	String getStatement();
}


text:
#include "SimpleOpt.h"
#include "Common.h"
#include "Logger.h"
#include <iomanip>
#include <fstream>

#include <TinyXML2.h>
#include <ParameterDMLParser.h>

using namespace Voxel;
using namespace TinyXML2;

class DummyRegisterProgrammer: public RegisterProgrammer
{
  virtual bool getValue(const Parameter &param, uint32_t &value) const { return false; }
  virtual bool isInitialized() const { return false; }
  virtual bool readRegister(uint32_t address, uint32_t &value) const { return false; }
  virtual bool reset() { return false; }
  virtual bool setValue(const Parameter &param, uint32_t value) { return false; }
  virtual bool writeRegister(uint32_t address, uint32_t value) { return false; }
};

enum Options
{
  XML_FILE = 0,
};

Vector<CSimpleOpt::SOption> argumentSpecifications =
{
  { XML_FILE,    "-x", SO_REQ_SEP, "XML file name"},
  SO_END_OF_OPTIONS
};

void help()
{
  std::cout << "DMLParseTest v1.0" << std::endl;

  CSimpleOpt::SOption *option = argumentSpecifications.data();

  while(option->nId >= 0)
  {
    std::cout << option->pszArg << " " << option->helpInfo << std::endl;
    option++;
  }
}

int main(int argc, char *argv[])
{
  CSimpleOpt s(argc, argv, argumentSpecifications);

  logger.setDefaultLogLevel(LOG_DEBUG);

  String xmlFile;

  char *endptr;

  while (s.Next())
  {
    if (s.LastError() != SO_SUCCESS)
    {
      std::cout << s.GetLastErrorText(s.LastError()) << ": '" << s.OptionText() << "' (use -h to get command line help)" << std::endl;
      help();
      return -1;
    }

    //std::cout << s.OptionId() << ": " << s.OptionArg() << std::endl;

    Vector<String> splits;
    switch (s.OptionId())
    {
      case XML_FILE:
        xmlFile = s.OptionArg();
        break;

      default:
        help();
        break;
    };
  }

  if(xmlFile.size() == 0)
  {
    logger(LOG_ERROR) << "Required argument missing." << std::endl;
    help();
    return -1;
  }

  std::ifstream f(xmlFile, std::ios::binary);

  if(!f.good())
  {
    logger(LOG_ERROR) << "Failed to open '" << xmlFile << "'" << std::endl;
    return -1;
  }

  f.close();

  //XMLDocument doc;

  //doc.LoadFile(xmlFile.c_str());

  //XMLElement *node = doc.FirstChildElement("RegMap");

  DummyRegisterProgrammer r;

  ParameterDMLParser p(r, xmlFile);

  Vector<ParameterPtr> params;

  p.getParameters(params);

  return 0;

}


text:
<?php
// WARNING, this is a read only file created by import scripts
// WARNING
// WARNING,  Changes made to this file will be clobbered
// WARNING
// WARNING,  Please make changes on poeditor instead of here
//
//
?>
subject: Gast-Einladung gesendet

{alternative:plain}

Sehr geehrte Damen und Herren,

eine Einladung die den Zugang zu {cfg:site_name} ermöglicht wurde an {guest.email} gesendet.

Mit freundlichen Grüßen,
{cfg:site_name}

{alternative:html}

    Sehr geehrte Damen und Herren,

    eine Einladung die den Zugang zu {cfg:site_name} ermöglicht wurde an {guest.email} gesendet.

    Mit freundlichen Grüßen,

    {cfg:site_name}


text:
package ca.com.androidbinnersproject.apis;

import ca.com.androidbinnersproject.models.Profile;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Path;

public interface TwitterLoginService {
	@GET("auth/twitter/{accessToken}/{accessSecret}")
	Call<Profile> authenticate(@Path("accessToken") String accessToken, @Path("accessSecret") String accessSecret);
}


text:
namespace SmashForge
{
    partial class PathBinEditor
    {
        /// <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()
        {
            this.splitContainer1 = new System.Windows.Forms.SplitContainer();
            this.listBox1 = new System.Windows.Forms.ListBox();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.label4 = 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.label8 = new System.Windows.Forms.Label();
            this.posX = new System.Windows.Forms.NumericUpDown();
            this.posY = new System.Windows.Forms.NumericUpDown();
            this.numericUpDown3 = new System.Windows.Forms.NumericUpDown();
            this.numericUpDown4 = new System.Windows.Forms.NumericUpDown();
            this.numericUpDown5 = new System.Windows.Forms.NumericUpDown();
            this.numericUpDown6 = new System.Windows.Forms.NumericUpDown();
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
            this.splitContainer1.Panel1.SuspendLayout();
            this.splitContainer1.Panel2.SuspendLayout();
            this.splitContainer1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.posX)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.posY)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown6)).BeginInit();
            this.SuspendLayout();
            //
            // splitContainer1
            //
            this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.splitContainer1.Location = new System.Drawing.Point(0, 0);
            this.splitContainer1.Name = "splitContainer1";
            this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
            //
            // splitContainer1.Panel1
            //
            this.splitContainer1.Panel1.Controls.Add(this.listBox1);
            //
            // splitContainer1.Panel2
            //
            this.splitContainer1.Panel2.Controls.Add(this.numericUpDown4);
            this.splitContainer1.Panel2.Controls.Add(this.numericUpDown5);
            this.splitContainer1.Panel2.Controls.Add(this.numericUpDown6);
            this.splitContainer1.Panel2.Controls.Add(this.numericUpDown3);
            this.splitContainer1.Panel2.Controls.Add(this.posY);
            this.splitContainer1.Panel2.Controls.Add(this.posX);
            this.splitContainer1.Panel2.Controls.Add(this.label6);
            this.splitContainer1.Panel2.Controls.Add(this.label7);
            this.splitContainer1.Panel2.Controls.Add(this.label8);
            this.splitContainer1.Panel2.Controls.Add(this.label5);
            this.splitContainer1.Panel2.Controls.Add(this.label4);
            this.splitContainer1.Panel2.Controls.Add(this.label3);
            this.splitContainer1.Panel2.Controls.Add(this.label2);
            this.splitContainer1.Panel2.Controls.Add(this.label1);
            this.splitContainer1.Size = new System.Drawing.Size(235, 616);
            this.splitContainer1.SplitterDistance = 426;
            this.splitContainer1.TabIndex = 0;
            //
            // listBox1
            //
            this.listBox1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.listBox1.FormattingEnabled = true;
            this.listBox1.Location = new System.Drawing.Point(0, 0);
            this.listBox1.Name = "listBox1";
            this.listBox1.Size = new System.Drawing.Size(235, 426);
            this.listBox1.TabIndex = 0;
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(24, 10);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(44, 13);
            this.label1.TabIndex = 0;
            this.label1.Text = "Position";
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(142, 10);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(47, 13);
            this.label2.TabIndex = 1;
            this.label2.Text = "Rotation";
            //
            // label3
            //
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(8, 40);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(14, 13);
            this.label3.TabIndex = 2;
            this.label3.Text = "X";
            //
            // label4
            //
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(8, 70);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(14, 13);
            this.label4.TabIndex = 3;
            this.label4.Text = "Y";
            //
            // label5
            //
            this.label5.AutoSize = true;
            this.label5.Location = new System.Drawing.Point(8, 101);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(14, 13);
            this.label5.TabIndex = 4;
            this.label5.Text = "Z";
            //
            // label6
            //
            this.label6.AutoSize = true;
            this.label6.Location = new System.Drawing.Point(125, 101);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(14, 13);
            this.label6.TabIndex = 7;
            this.label6.Text = "Z";
            //
            // label7
            //
            this.label7.AutoSize = true;
            this.label7.Location = new System.Drawing.Point(125, 70);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(14, 13);
            this.label7.TabIndex = 6;
            this.label7.Text = "Y";
            //
            // label8
            //
            this.label8.AutoSize = true;
            this.label8.Location = new System.Drawing.Point(125, 40);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(14, 13);
            this.label8.TabIndex = 5;
            this.label8.Text = "X";
            //
            // posX
            //
            this.posX.Location = new System.Drawing.Point(27, 33);
            this.posX.Name = "posX";
            this.posX.Size = new System.Drawing.Size(79, 20);
            this.posX.TabIndex = 8;
            //
            // posY
            //
            this.posY.Location = new System.Drawing.Point(28, 63);
            this.posY.Name = "posY";
            this.posY.Size = new System.Drawing.Size(79, 20);
            this.posY.TabIndex = 9;
            //
            // numericUpDown3
            //
            this.numericUpDown3.Location = new System.Drawing.Point(28, 94);
            this.numericUpDown3.Name = "numericUpDown3";
            this.numericUpDown3.Size = new System.Drawing.Size(79, 20);
            this.numericUpDown3.TabIndex = 10;
            //
            // numericUpDown4
            //
            this.numericUpDown4.Location = new System.Drawing.Point(145, 94);
            this.numericUpDown4.Name = "numericUpDown4";
            this.numericUpDown4.Size = new System.Drawing.Size(79, 20);
            this.numericUpDown4.TabIndex = 13;
            //
            // numericUpDown5
            //
            this.numericUpDown5.Location = new System.Drawing.Point(145, 63);
            this.numericUpDown5.Name = "numericUpDown5";
            this.numericUpDown5.Size = new System.Drawing.Size(79, 20);
            this.numericUpDown5.TabIndex = 12;
            //
            // numericUpDown6
            //
            this.numericUpDown6.Location = new System.Drawing.Point(144, 33);
            this.numericUpDown6.Name = "numericUpDown6";
            this.numericUpDown6.Size = new System.Drawing.Size(79, 20);
            this.numericUpDown6.TabIndex = 11;
            //
            // PathBinEditor
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(235, 616);
            this.Controls.Add(this.splitContainer1);
            this.Name = "PathBinEditor";
            this.Text = "PathBinEditor";
            this.splitContainer1.Panel1.ResumeLayout(false);
            this.splitContainer1.Panel2.ResumeLayout(false);
            this.splitContainer1.Panel2.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
            this.splitContainer1.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.posX)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.posY)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown6)).EndInit();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.SplitContainer splitContainer1;
        private System.Windows.Forms.ListBox listBox1;
        private System.Windows.Forms.NumericUpDown numericUpDown3;
        private System.Windows.Forms.NumericUpDown posY;
        private System.Windows.Forms.NumericUpDown posX;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.Label label7;
        private System.Windows.Forms.Label label8;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.NumericUpDown numericUpDown4;
        private System.Windows.Forms.NumericUpDown numericUpDown5;
        private System.Windows.Forms.NumericUpDown numericUpDown6;
    }
}


text:
title: Shutterstock Referral
redirect_to: https://www.shutterstock.com/g/JoeHx?rid=174299972&utm_medium=email&utm_source=ctrbreferral-link
old: https://submit.shutterstock.com/?ref=174299972
---


text:
//---------------------------------------------------------------------
// <copyright file="IPrimitiveDataTypeRepository.cs" company="Microsoft">
//      Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
// </copyright>
//---------------------------------------------------------------------

namespace Microsoft.Test.Taupo.Contracts
{
    using System.Collections.Generic;
    using Microsoft.Test.Taupo.Contracts.DataGeneration;
    using Microsoft.Test.Taupo.Contracts.Types;

    /// <summary>
    /// Primitive data types repository.
    /// </summary>
    public interface IPrimitiveDataTypeRepository
    {
        /// <summary>
        /// Gets primitive data types available in the repository.
        /// </summary>
        /// <returns>Primitive data types available in the repository.</returns>
        IEnumerable<PrimitiveDataType> GetPrimitiveDataTypes();

        /// <summary>
        /// Creates a data generator for the given data type from the repository.
        /// </summary>
        /// <param name="dataType">The data type from the repository to get data generator for.</param>
        /// <param name="random">The random number generator.</param>
        /// <param name="isUnique">The value indicating whether the generator should produce unique data.</param>
        /// <returns>The data generator for the given data type.</returns>
        IDataGenerator CreateDataGenerator(PrimitiveDataType dataType, IRandomNumberGenerator random, bool isUnique);
    }
}