text:
use std::any::{Any, TypeId};
use std::fmt::Debug;
use std::io::{Read, Write};
use std::mem;

#[cfg(feature = "timeouts")]
use std::io;
#[cfg(feature = "timeouts")]
use std::time::Duration;

use typeable::Typeable;

use header::Headers;
use http::RawStatus;
use url::Url;

use method;
use version;
use traitobject;

/// The trait provides an API for creating new `HttpMessage`s depending on the underlying HTTP
/// protocol.
pub trait Protocol {
    /// Creates a fresh `HttpMessage` bound to the given host, based on the given protocol scheme.
    fn new_message(&self, host: &str, port: u16, scheme: &str) -> ::Result<Box<HttpMessage>>;
}

/// Describes a request.
#[derive(Clone, Debug)]
pub struct RequestHead {
    /// The headers of the request
    pub headers: Headers,
    /// The method of the request
    pub method: method::Method,
    /// The URL of the request
    pub url: Url,
}

/// Describes a response.
#[derive(Clone, Debug)]
pub struct ResponseHead {
    /// The headers of the reponse
    pub headers: Headers,
    /// The raw status line of the response
    pub raw_status: RawStatus,
    /// The HTTP/2 version which generated the response
    pub version: version::HttpVersion,
}

/// The trait provides an API for sending an receiving HTTP messages.
pub trait HttpMessage: Write + Read + Send + Any + Typeable + Debug {
    /// Initiates a new outgoing request.
    ///
    /// Only the request's head is provided (in terms of the `RequestHead` struct).
    ///
    /// After this, the `HttpMessage` instance can be used as an `io::Write` in order to write the
    /// body of the request.
    fn set_outgoing(&mut self, head: RequestHead) -> ::Result<RequestHead>;
    /// Obtains the incoming response and returns its head (i.e. the `ResponseHead` struct)
    ///
    /// After this, the `HttpMessage` instance can be used as an `io::Read` in order to read out
    /// the response body.
    fn get_incoming(&mut self) -> ::Result<ResponseHead>;
    /// Set the read timeout duration for this message.
    #[cfg(feature = "timeouts")]
    fn set_read_timeout(&self, dur: Option<Duration>) -> io::Result<()>;
    /// Set the write timeout duration for this message.
    #[cfg(feature = "timeouts")]
    fn set_write_timeout(&self, dur: Option<Duration>) -> io::Result<()>;
    /// Closes the underlying HTTP connection.
    fn close_connection(&mut self) -> ::Result<()>;
    /// Returns whether the incoming message has a body.
    fn has_body(&self) -> bool;
}

impl HttpMessage {
    unsafe fn downcast_ref_unchecked<T: 'static>(&self) -> &T {
        mem::transmute(traitobject::data(self))
    }

    unsafe fn downcast_mut_unchecked<T: 'static>(&mut self) -> &mut T {
        mem::transmute(traitobject::data_mut(self))
    }

    unsafe fn downcast_unchecked<T: 'static>(self: Box<HttpMessage>) -> Box<T>  {
        let raw: *mut HttpMessage = mem::transmute(self);
        mem::transmute(traitobject::data_mut(raw))
    }
}

impl HttpMessage {
    /// Is the underlying type in this trait object a T?
    #[inline]
    pub fn is<T: Any>(&self) -> bool {
        (*self).get_type() == TypeId::of::<T>()
    }

    /// If the underlying type is T, get a reference to the contained data.
    #[inline]
    pub fn downcast_ref<T: Any>(&self) -> Option<&T> {
        if self.is::<T>() {
            Some(unsafe { self.downcast_ref_unchecked() })
        } else {
            None
        }
    }

    /// If the underlying type is T, get a mutable reference to the contained
    /// data.
    #[inline]
    pub fn downcast_mut<T: Any>(&mut self) -> Option<&mut T> {
        if self.is::<T>() {
            Some(unsafe { self.downcast_mut_unchecked() })
        } else {
            None
        }
    }

    /// If the underlying type is T, extract it.
    #[inline]
    pub fn downcast<T: Any>(self: Box<HttpMessage>)
            -> Result<Box<T>, Box<HttpMessage>> {
        if self.is::<T>() {
            Ok(unsafe { self.downcast_unchecked() })
        } else {
            Err(self)
        }
    }
}


text:
package com.qualogy.qafe.business.integration.adapter;

public class UnableToAdaptException extends RuntimeException {

	private static final long serialVersionUID = -3298695507878775472L;

	public UnableToAdaptException(String message) {
		super(message);
	}

	public UnableToAdaptException(Throwable cause) {
		super(cause);
	}

	public UnableToAdaptException(String message, Throwable cause) {
		super(message, cause);
	}

}

redpajama_set_name: RedPajamaGithub


text:
using std::vector; using std::string;

class ArgHandler
{
public:
	ArgHandler();
	virtual ~ArgHandler();
	void parse(int count, char* array[]);
	void setFilter(Filter* newFilter);
	void applyFilters();
	string getSaveLocation();
	string getLoadLocation();

private:
	int findArg(string input);
	bool startsWith(string input, string prefix);

	void blur(string nextArg);
	void help();
	void pixelate(string nextArg);
	void stamp(string nextArg);
	void target(string nextArg);

	static const int NUM_CMD;

	static const int BLUR;
	static const int HELP;
	static const int PIXELATE;
	static const int STAMP;
	static const int TARGET;

	int blurAmount, pixelateAmount;
	string saveLocation, loadLocation;

	struct Command {
		string shortForm;
		string longForm;
		string inputForm;
		string description;
		string defaultVal;
	};

	Command* cmdList;
	Filter* filter;
};

#endif


text:
package org.thingsboard.server.transport.coap.callback;

import org.eclipse.californium.core.coap.CoAP;
import org.eclipse.californium.core.server.resources.CoapExchange;
import org.thingsboard.server.common.transport.TransportServiceCallback;

public class CoapNoOpCallback implements TransportServiceCallback<Void> {
    private final CoapExchange exchange;

    public CoapNoOpCallback(CoapExchange exchange) {
        this.exchange = exchange;
    }

    @Override
    public void onSuccess(Void msg) {
    }

    @Override
    public void onError(Throwable e) {
        exchange.respond(CoAP.ResponseCode.INTERNAL_SERVER_ERROR);
    }
}


text:
<!DOCTYPE html>

        ID
        Customer Name
        Total(CNY)
        Total(USD)
        Total Invoiced(CNY)
        Total Invoiced(USD)
        Total Received(CNY)
        Total Received(USD)


text:
package org.springframework.security.web;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.security.web.util.matcher.RequestMatcher;

import javax.servlet.Filter;
import javax.servlet.http.HttpServletRequest;
import java.util.*;

/**
 * Standard implementation of {@code SecurityFilterChain}.
 *
 * @author Luke Taylor
 *
 * @since 3.1
 */
public final class DefaultSecurityFilterChain implements SecurityFilterChain {
	private static final Log logger = LogFactory.getLog(DefaultSecurityFilterChain.class);
	private final RequestMatcher requestMatcher;
	private final List<Filter> filters;

	public DefaultSecurityFilterChain(RequestMatcher requestMatcher, Filter... filters) {
		this(requestMatcher, Arrays.asList(filters));
	}

	public DefaultSecurityFilterChain(RequestMatcher requestMatcher, List<Filter> filters) {
		logger.info("Creating filter chain: " + requestMatcher + ", " + filters);
		this.requestMatcher = requestMatcher;
		this.filters = new ArrayList<>(filters);
	}

	public RequestMatcher getRequestMatcher() {
		return requestMatcher;
	}

	public List<Filter> getFilters() {
		return filters;
	}

	public boolean matches(HttpServletRequest request) {
		return requestMatcher.matches(request);
	}

	@Override
	public String toString() {
		return "[ " + requestMatcher + ", " + filters + "]";
	}
}


text:
module RuboCop
  module Cop
    module Lint
      # This cop checks for empty interpolation.
      #
      # @example
      #
      #   # bad
      #
      #   "result is #{}"
      #
      # @example
      #
      #   # good
      #
      #   "result is #{some_result}"
      class EmptyInterpolation < Cop
        MSG = 'Empty interpolation detected.'

        def on_dstr(node)
          node.each_child_node(:begin) do |begin_node|
            add_offense(begin_node) if begin_node.children.empty?
          end
        end

        def autocorrect(node)
          lambda do |collector|
            collector.remove(node.loc.expression)
          end
        end
      end
    end
  end
end


text:
// Type definitions for merkle 0.6
// Project: https://github.com/c-geek/merkle
// Definitions by: Yu Hsin Lu <https://github.com/kerol2r20>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

/// <reference types="node" />

/* =================== USAGE ===================

    import merkle = require("merkle");

    const stream = merkle('sha256');
    const merkleTree = stream.sync([1, 2, 3, 4, 5, 6, 7, 8]);
    merkleTree.root();

 =============================================== */

import stream = require("stream");

declare function merkle(
    hashname: "sha512" | "sha256" | "sha1" | "md5" | "ripemd160" | "whirlpool" | "none",
    useUpperCaseForHash?: boolean): MerkleStream;

declare class MerkleStream extends stream.Transform {
    sync(leaves: any[]): MerkleTree;
    async(leaves: any[], callback: (err: string, tree: MerkleTree) => void): void;
    json(): MerkleStream;
}

declare class MerkleTree {
    root(): string;
    level(level: number): number | undefined;
    depth(): number;
    levels(): number;
    nodes(): number;
}

export = merkle;


text:
package org.apache.ignite.internal.processors.cache.persistence.tree.io;

import java.nio.ByteBuffer;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.pagemem.PageUtils;
import org.apache.ignite.internal.processors.cache.CacheObject;
import org.apache.ignite.internal.processors.cache.mvcc.MvccUtils;
import org.apache.ignite.internal.processors.cache.mvcc.MvccVersion;
import org.apache.ignite.internal.processors.cache.persistence.CacheDataRow;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
import org.apache.ignite.internal.util.GridStringBuilder;

import static org.apache.ignite.internal.processors.cache.persistence.tree.io.DataPageIO.EntryPart.CACHE_ID;
import static org.apache.ignite.internal.processors.cache.persistence.tree.io.DataPageIO.EntryPart.EXPIRE_TIME;
import static org.apache.ignite.internal.processors.cache.persistence.tree.io.DataPageIO.EntryPart.KEY;
import static org.apache.ignite.internal.processors.cache.persistence.tree.io.DataPageIO.EntryPart.MVCC_INFO;
import static org.apache.ignite.internal.processors.cache.persistence.tree.io.DataPageIO.EntryPart.VALUE;
import static org.apache.ignite.internal.processors.cache.persistence.tree.io.DataPageIO.EntryPart.VERSION;

/**
 * Data pages IO.
 */
public class DataPageIO extends AbstractDataPageIO<CacheDataRow> {
    /** */
    public static final int MVCC_INFO_SIZE = 40;

    /** */
    public static final IOVersions<DataPageIO> VERSIONS = new IOVersions<>(
        new DataPageIO(1)
    );

    /**
     * @param ver Page format version.
     */
    protected DataPageIO(int ver) {
        super(T_DATA, ver);
    }

    /** {@inheritDoc} */
    @Override protected void writeRowData(long pageAddr, int dataOff, int payloadSize, CacheDataRow row,
        boolean newRow) throws IgniteCheckedException {
        long addr = pageAddr + dataOff;

        int cacheIdSize = row.cacheId() != 0 ? 4 : 0;
        int mvccInfoSize = row.mvccCoordinatorVersion() > 0 ? MVCC_INFO_SIZE : 0;

        if (newRow) {
            PageUtils.putShort(addr, 0, (short)payloadSize);
            addr += 2;

            if (mvccInfoSize > 0) {
                assert MvccUtils.mvccVersionIsValid(row.mvccCoordinatorVersion(), row.mvccCounter(), row.mvccOperationCounter());

                // xid_min.
                PageUtils.putLong(addr, 0, row.mvccCoordinatorVersion());
                PageUtils.putLong(addr, 8, row.mvccCounter());
                PageUtils.putInt(addr, 16, row.mvccOperationCounter() | (row.mvccTxState() << MVCC_HINTS_BIT_OFF));

                assert row.newMvccCoordinatorVersion() == 0
                    || MvccUtils.mvccVersionIsValid(row.newMvccCoordinatorVersion(), row.newMvccCounter(), row.newMvccOperationCounter());

                // xid_max.
                PageUtils.putLong(addr, 20, row.newMvccCoordinatorVersion());
                PageUtils.putLong(addr, 28, row.newMvccCounter());
                PageUtils.putInt(addr, 36, row.newMvccOperationCounter() | (row.newMvccTxState() << MVCC_HINTS_BIT_OFF));

                addr += mvccInfoSize;
            }

            if (cacheIdSize != 0) {
                PageUtils.putInt(addr, 0, row.cacheId());

                addr += cacheIdSize;
            }

            addr += row.key().putValue(addr);
        }
        else
            addr += (2 + mvccInfoSize + cacheIdSize  + row.key().valueBytesLength(null));

        addr += row.value().putValue(addr);

        CacheVersionIO.write(addr, row.version(), false);
        addr += CacheVersionIO.size(row.version(), false);

        PageUtils.putLong(addr, 0, row.expireTime());
    }

    /** {@inheritDoc} */
    @Override protected void writeFragmentData(CacheDataRow row, ByteBuffer buf, int rowOff,
        int payloadSize) throws IgniteCheckedException {
        final int keySize = row.key().valueBytesLength(null);

        final int valSize = row.value().valueBytesLength(null);

        int written = writeFragment(row, buf, rowOff, payloadSize,
            MVCC_INFO, keySize, valSize);
        written += writeFragment(row, buf, rowOff + written, payloadSize - written,
            CACHE_ID, keySize, valSize);
        written += writeFragment(row, buf, rowOff + written, payloadSize - written,
            KEY, keySize, valSize);
        written += writeFragment(row, buf, rowOff + written, payloadSize - written,
            EXPIRE_TIME, keySize, valSize);
        written += writeFragment(row, buf, rowOff + written, payloadSize - written,
            VALUE, keySize, valSize);
        written += writeFragment(row, buf, rowOff + written, payloadSize - written,
            VERSION, keySize, valSize);

        assert written == payloadSize;
    }

    /**
     * Try to write fragment data.
     *
     * @param row Row.
     * @param buf Byte buffer.
     * @param rowOff Offset in row data bytes.
     * @param payloadSize Data length that should be written in this fragment.
     * @param type Type of the part of entry.
     * @param keySize Key size.
     * @param valSize Value size.
     * @return Actually written data.
     * @throws IgniteCheckedException If fail.
     */
    private int writeFragment(
        final CacheDataRow row,
        final ByteBuffer buf,
        final int rowOff,
        final int payloadSize,
        final EntryPart type,
        final int keySize,
        final int valSize
    ) throws IgniteCheckedException {
        if (payloadSize == 0)
            return 0;

        final int prevLen;
        final int curLen;

        int cacheIdSize = row.cacheId() == 0 ? 0 : 4;
        int mvccInfoSize = row.mvccCoordinatorVersion() > 0 ? MVCC_INFO_SIZE : 0;

        switch (type) {
            case MVCC_INFO:
                prevLen = 0;
                curLen = mvccInfoSize;

                break;

            case CACHE_ID:
                prevLen = mvccInfoSize;
                curLen = mvccInfoSize + cacheIdSize;

                break;

            case KEY:
                prevLen = mvccInfoSize + cacheIdSize;
                curLen = mvccInfoSize + cacheIdSize + keySize;

                break;

            case EXPIRE_TIME:
                prevLen = mvccInfoSize + cacheIdSize + keySize;
                curLen = mvccInfoSize + cacheIdSize + keySize + 8;

                break;

            case VALUE:
                prevLen = mvccInfoSize + cacheIdSize + keySize + 8;
                curLen = mvccInfoSize + cacheIdSize + keySize + valSize + 8;

                break;

            case VERSION:
                prevLen = mvccInfoSize + cacheIdSize + keySize + valSize + 8;
                curLen = mvccInfoSize + cacheIdSize + keySize + valSize + CacheVersionIO.size(row.version(), false) + 8;

                break;

            default:
                throw new IllegalArgumentException("Unknown entry part type: " + type);
        }

        if (curLen <= rowOff)
            return 0;

        final int len = Math.min(curLen - rowOff, payloadSize);

        if (type == EXPIRE_TIME)
            writeExpireTimeFragment(buf, row.expireTime(), rowOff, len, prevLen);
        else if (type == CACHE_ID)
            writeCacheIdFragment(buf, row.cacheId(), rowOff, len, prevLen);
        else if (type == MVCC_INFO)
            writeMvccInfoFragment(buf,
                row.mvccCoordinatorVersion(),
                row.mvccCounter(),
                row.mvccOperationCounter() | (row.mvccTxState() << MVCC_HINTS_BIT_OFF),
                row.newMvccCoordinatorVersion(),
                row.newMvccCounter(),
                row.newMvccOperationCounter() | (row.newMvccTxState() << MVCC_HINTS_BIT_OFF),
                len);
        else if (type != VERSION) {
            // Write key or value.
            final CacheObject co = type == KEY ? row.key() : row.value();

            co.putValue(buf, rowOff - prevLen, len);
        }
        else
            writeVersionFragment(buf, row.version(), rowOff, len, prevLen);

        return len;
    }

    /**
     * @param pageAddr Page address.
     * @param dataOff Data offset.
     * @param ver New version.
     */
    public void updateVersion(long pageAddr, int dataOff, MvccVersion ver) {
        long addr = pageAddr + dataOff;

        updateVersion(addr, ver.coordinatorVersion(), ver.counter(), ver.operationCounter());
    }

    /**
     * @param pageAddr Page address.
     * @param itemId Item ID.
     * @param pageSize Page size.
     * @param mvccCrd Mvcc coordinator.
     * @param mvccCntr Mvcc counter.
     * @param mvccOpCntr Operation counter.
     */
    public void updateVersion(long pageAddr, int itemId, int pageSize, long mvccCrd, long mvccCntr, int mvccOpCntr) {
        int dataOff = getDataOffset(pageAddr, itemId, pageSize);

        long addr = pageAddr + dataOff + (isFragmented(pageAddr, dataOff) ? 10 : 2);

        updateVersion(addr, mvccCrd, mvccCntr, mvccOpCntr);
    }

    /**
     * @param addr Address.
     * @param mvccCrd Mvcc coordinator.
     * @param mvccCntr Mvcc counter.
     */
    private void updateVersion(long addr, long mvccCrd, long mvccCntr, int mvccOpCntr) {
        PageUtils.putLong(addr, 0, mvccCrd);
        PageUtils.putLong(addr, 8, mvccCntr);
        PageUtils.putInt(addr, 16, mvccOpCntr);
    }

    /**
     * @param pageAddr Page address.
     * @param dataOff Data offset.
     * @param newVer New version.
     */
    public void updateNewVersion(long pageAddr, int dataOff, MvccVersion newVer, byte newTxState) {
        long addr = pageAddr + dataOff;

        updateNewVersion(addr, newVer.coordinatorVersion(), newVer.counter(),
            (newVer.operationCounter() & ~MVCC_HINTS_MASK) | ((int)newTxState << MVCC_HINTS_BIT_OFF));
    }

    /**
     * @param pageAddr Page address.
     * @param itemId Item ID.
     * @param pageSize Page size.
     * @param mvccCrd Mvcc coordinator.
     * @param mvccCntr Mvcc counter.
     * @param mvccOpCntr Operation counter.
     */
    public void updateNewVersion(long pageAddr, int itemId, int pageSize, long mvccCrd, long mvccCntr, int mvccOpCntr) {
        int dataOff = getDataOffset(pageAddr, itemId, pageSize);

        long addr = pageAddr + dataOff + (isFragmented(pageAddr, dataOff) ? 10 : 2);

        updateNewVersion(addr, mvccCrd, mvccCntr, mvccOpCntr);
    }

    /**
     * @param pageAddr Page address.
     * @param itemId Item ID.
     * @param pageSize Page size.
     * @param txState Tx state hint.
     */
    public void updateTxState(long pageAddr, int itemId, int pageSize, byte txState) {
        int dataOff = getDataOffset(pageAddr, itemId, pageSize);

        long addr = pageAddr + dataOff + (isFragmented(pageAddr, dataOff) ? 10 : 2);

        int opCntr = mvccOperationCounter(addr, 0);

        mvccOperationCounter(addr, 0, ((int)txState << MVCC_HINTS_BIT_OFF) | (opCntr & ~MVCC_HINTS_MASK));
    }

    /**
     * @param pageAddr Page address.
     * @param itemId Item ID.
     * @param pageSize Page size.
     * @param txState Tx state hint.
     */
    public void updateNewTxState(long pageAddr, int itemId, int pageSize, byte txState) {
        int dataOff = getDataOffset(pageAddr, itemId, pageSize);

        long addr = pageAddr + dataOff + (isFragmented(pageAddr, dataOff) ? 10 : 2);

        int opCntr = newMvccOperationCounter(addr, 0);

        newMvccOperationCounter(addr, 0, ((int)txState << MVCC_HINTS_BIT_OFF) | (opCntr & ~MVCC_HINTS_MASK));
    }

    /**
     * Marks row removed.
     *
     * @param addr Address.
     * @param mvccCrd Mvcc coordinator.
     * @param mvccCntr Mvcc counter.
     */
    private void updateNewVersion(long addr, long mvccCrd, long mvccCntr, int mvccOpCntr) {
        // Skip xid_min.
        addr += 20;

        PageUtils.putLong(addr, 0, mvccCrd);
        PageUtils.putLong(addr, 8, mvccCntr);
        PageUtils.putInt(addr, 16, mvccOpCntr);
    }

    /**
     * Returns MVCC coordinator number.
     *
     * @param pageAddr Page address.
     * @param dataOff Data offset.
     * @return MVCC coordinator number.
     */
    public long mvccCoordinator(long pageAddr, int dataOff) {
        long addr = pageAddr + dataOff;

        return PageUtils.getLong(addr, 0);
    }

    /**
     * Returns MVCC counter value.
     *
     * @param pageAddr Page address.
     * @param dataOff Data offset.
     * @return MVCC counter value.
     */
    public long mvccCounter(long pageAddr, int dataOff) {
        long addr = pageAddr + dataOff;

        return PageUtils.getLong(addr, 8);
    }

    /**
     * Returns MVCC operation counter value.
     *
     * @param pageAddr Page address.
     * @param dataOff Data offset.
     * @return MVCC counter value.
     */
    public int mvccOperationCounter(long pageAddr, int dataOff) {
        long addr = pageAddr + dataOff;

        return PageUtils.getInt(addr, 16);
    }

    /**
     * Sets MVCC operation counter value.
     *
     * @param pageAddr Page address.
     * @param dataOff Data offset.
     * @param opCntr MVCC counter value.
     */
    public void mvccOperationCounter(long pageAddr, int dataOff, int opCntr) {
        long addr = pageAddr + dataOff;

        PageUtils.putInt(addr, 16, opCntr);
    }

    /**
     * Returns new MVCC coordinator number.
     *
     * @param pageAddr Page address.
     * @param dataOff Data offset.
     * @return New MVCC coordinator number.
     */
    public long newMvccCoordinator(long pageAddr, int dataOff) {
        long addr = pageAddr + dataOff;

        // Skip xid_min.
        addr += 20;

        return PageUtils.getLong(addr, 0);
    }

    /**
     * Returns new MVCC counter value.
     *
     * @param pageAddr Page address.
     * @param dataOff Data offset.
     * @return New MVCC counter value.
     */
    public long newMvccCounter(long pageAddr, int dataOff) {
        long addr = pageAddr + dataOff;

        // Skip xid_min.
        addr += 20;

        return PageUtils.getLong(addr, 8);
    }

    /**
     * Returns MVCC operation counter value.
     *
     * @param pageAddr Page address.
     * @param dataOff Data offset.
     * @return MVCC counter value.
     */
    public int newMvccOperationCounter(long pageAddr, int dataOff) {
        long addr = pageAddr + dataOff;

        // Skip xid_min.
        addr += 20;

        return PageUtils.getInt(addr, 16);
    }

    /**
     * Sets MVCC new operation counter value.
     *
     * @param pageAddr Page address.
     * @param dataOff Data offset.
     * @param opCntr MVCC operation counter value.
     */
    public void newMvccOperationCounter(long pageAddr, int dataOff, int opCntr) {
        long addr = pageAddr + dataOff;

        // Skip xid_min.
        addr += 20;

        PageUtils.putInt(addr, 16, opCntr);
    }

    /**
     * @param buf Byte buffer.
     * @param ver Version.
     * @param rowOff Row offset.
     * @param len Length.
     * @param prevLen previous length.
     */
    private void writeVersionFragment(ByteBuffer buf, GridCacheVersion ver, int rowOff, int len, int prevLen) {
        int verSize = CacheVersionIO.size(ver, false);

        assert len <= verSize: len;

        if (verSize == len) { // Here we check for equality but not <= because version is the last.
            // Here we can write version directly.
            CacheVersionIO.write(buf, ver, false);
        }
        else {
            // We are in the middle of cache version.
            ByteBuffer verBuf = ByteBuffer.allocate(verSize);

            verBuf.order(buf.order());

            CacheVersionIO.write(verBuf, ver, false);

            buf.put(verBuf.array(), rowOff - prevLen, len);
        }
    }

    /**
     * @param buf Byte buffer.
     * @param expireTime Expire time.
     * @param rowOff Row offset.
     * @param len Length.
     * @param prevLen previous length.
     */
    private void writeExpireTimeFragment(ByteBuffer buf, long expireTime, int rowOff, int len, int prevLen) {
        int size = 8;
        if (size <= len)
            buf.putLong(expireTime);
        else {
            ByteBuffer timeBuf = ByteBuffer.allocate(size);

            timeBuf.order(buf.order());

            timeBuf.putLong(expireTime);

            buf.put(timeBuf.array(), rowOff - prevLen, len);
        }
    }

    /**
     * @param buf Buffer.
     * @param cacheId Cache ID.
     * @param rowOff Row offset.
     * @param len Length.
     * @param prevLen Prev length.
     */
    private void writeCacheIdFragment(ByteBuffer buf, int cacheId, int rowOff, int len, int prevLen) {
        if (cacheId == 0)
            return;

        int size = 4;

        if (size <= len)
            buf.putInt(cacheId);
        else {
            ByteBuffer cacheIdBuf = ByteBuffer.allocate(size);

            cacheIdBuf.order(buf.order());

            cacheIdBuf.putInt(cacheId);

            buf.put(cacheIdBuf.array(), rowOff - prevLen, len);
        }
    }

    /**
     * @param buf Byte buffer.
     * @param mvccCrd Coordinator version.
     * @param mvccCntr Counter.
     * @param mvccOpCntr Operation counter.
     * @param newMvccCrd New coordinator version.
     * @param newMvccCntr New counter version.
     * @param newMvccOpCntr New operation counter.
     * @param len Length.
     */
    private void writeMvccInfoFragment(ByteBuffer buf, long mvccCrd, long mvccCntr, int mvccOpCntr, long newMvccCrd,
        long newMvccCntr, int newMvccOpCntr, int len) {
        if (mvccCrd == 0)
            return;

        assert len >= MVCC_INFO_SIZE : "Mvcc info should fit on the one page!";

        assert MvccUtils.mvccVersionIsValid(mvccCrd, mvccCntr, mvccOpCntr);

        // xid_min.
        buf.putLong(mvccCrd);
        buf.putLong(mvccCntr);
        buf.putInt(mvccOpCntr);

        assert newMvccCrd == 0 || MvccUtils.mvccVersionIsValid(newMvccCrd, newMvccCntr, newMvccOpCntr);

        // xid_max.
        buf.putLong(newMvccCrd);
        buf.putLong(newMvccCntr);
        buf.putInt(newMvccOpCntr);
    }

    /** {@inheritDoc} */
    @Override protected void printPage(long addr, int pageSize, GridStringBuilder sb) throws IgniteCheckedException {
        sb.a("DataPageIO [\n");
        printPageLayout(addr, pageSize, sb);
        sb.a("\n]");
    }

    /**
     *
     */
    enum EntryPart {
        /** */
        KEY,

        /** */
        VALUE,

        /** */
        VERSION,

        /** */
        EXPIRE_TIME,

        /** */
        CACHE_ID,

        /** */
        MVCC_INFO
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Jonell Alvi Resume">
    <meta name="author" content="Jonell Alvi">

    <title>Jonell Alvi's Resume</title>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

    <link href="css/freelancer.min.css" rel="stylesheet">

    <link href="css/cv.css" rel="stylesheet">

    <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css">

    <link rel="icon" href="img/favicon.ico" type="image/x-icon">

    <object data="cv.pdf" type="application/pdf" width="100%" height="1000px">
    alt : cv.pdf
    </object>


text:
#include <netresolve-private.h>
#include <unistd.h>
#include <string.h>
#include <poll.h>
#include <sys/eventfd.h>

const char *
netresolve_query_state_to_string(enum netresolve_state state)
{
	switch (state) {
	case NETRESOLVE_STATE_NONE:
		return "none";
	case NETRESOLVE_STATE_SETUP:
		return "setup";
	case NETRESOLVE_STATE_WAITING:
		return "waiting";
	case NETRESOLVE_STATE_WAITING_MORE:
		return "waiting-more";
	case NETRESOLVE_STATE_RESOLVED:
		return "resolved";
	case NETRESOLVE_STATE_DONE:
		return "done";
	case NETRESOLVE_STATE_ERROR:
		return "error";
	case NETRESOLVE_STATE_FAILED:
		return "failed";
	}

	abort();
}

static void
clear_timeout(netresolve_query_t query, int *tfd)
{
	if (*tfd == -1)
		return;

	netresolve_remove_timeout(query, *tfd);
	*tfd = -1;
}

static void
cleanup_query(netresolve_query_t query)
{
	struct netresolve_backend *backend = query->backend ? *query->backend : NULL;

	clear_timeout(query, &query->delayed_fd);
	clear_timeout(query, &query->timeout_fd);
	clear_timeout(query, &query->partial_timeout_fd);

	if (backend && backend->data) {
		if (backend->cleanup)
			backend->cleanup(query);
		free(backend->data);
		backend->data = NULL;
	}
}

void
netresolve_query_set_state(netresolve_query_t query, enum netresolve_state state)
{
	enum netresolve_state old_state = query->state;

	if (state == old_state)
		return;

	debug_query(query, "state: %s -> %s",
			netresolve_query_state_to_string(old_state), netresolve_query_state_to_string(state));

	query->state = state;

	/* Entering state... */
	switch (state) {
	case NETRESOLVE_STATE_NONE:
		free(query->request.dns_name);
		free(query->response.paths);
		free(query->response.nodename);
		free(query->response.servname);
		netresolve_service_list_free(query->services);
		memset(&query->response, 0, sizeof query->response);
		break;
	case NETRESOLVE_STATE_SETUP:
		{
			struct netresolve_backend *backend = *query->backend;
			void (*setup)(netresolve_query_t query, char **settings);

			if (query->request.dns_srv_lookup && !query->request.protocol)
				query->request.protocol = IPPROTO_TCP;

			setup = backend->setup[query->request.type];
			if (setup) {
				setup(query, backend->settings + 1);
				if (query->state == NETRESOLVE_STATE_SETUP)
					netresolve_query_set_state(query, query->request.timeout ? NETRESOLVE_STATE_WAITING : NETRESOLVE_STATE_FAILED);
				if (query->state == NETRESOLVE_STATE_ERROR)
					netresolve_query_set_state(query, NETRESOLVE_STATE_FAILED);
			} else
				netresolve_query_set_state(query, NETRESOLVE_STATE_FAILED);
		}
		break;
	case NETRESOLVE_STATE_WAITING:
		if (query->request.timeout > 0)
			query->timeout_fd = netresolve_add_timeout_ms(query, query->request.timeout);
		break;
	case NETRESOLVE_STATE_WAITING_MORE:
		if (query->request.partial_timeout == 0)
			netresolve_query_set_state(query, NETRESOLVE_STATE_DONE);
		if (query->request.partial_timeout > 0)
			query->partial_timeout_fd = netresolve_add_timeout_ms(query, query->request.partial_timeout);
		break;
	case NETRESOLVE_STATE_RESOLVED:
		if (old_state == NETRESOLVE_STATE_SETUP) {
			if ((query->delayed_fd = eventfd(1, EFD_NONBLOCK)) == -1) {
				error("can't create eventfd");
				abort();
			}
			netresolve_watch_fd(query, query->delayed_fd, POLLIN);
		}
		break;
	case NETRESOLVE_STATE_DONE:
		cleanup_query(query);

		/* Restart with the next *mandatory* backend. */
		while (*++query->backend) {
			if ((*query->backend)->mandatory) {
				netresolve_query_set_state(query, NETRESOLVE_STATE_SETUP);
				break;
			}
		}

		if (query->callback)
			query->callback(query, query->user_data);
		break;
	case NETRESOLVE_STATE_ERROR:
		break;
	case NETRESOLVE_STATE_FAILED:
		if (query->response.pathcount)
			error("Failed reply has data.");

		cleanup_query(query);

		/* Restart with the next backend. */
		if (*++query->backend) {
			netresolve_query_set_state(query, NETRESOLVE_STATE_SETUP);
			break;
		}

		if (query->callback)
			query->callback(query, query->user_data);
		break;
	}
}

netresolve_query_t
netresolve_query_new(netresolve_t context, enum netresolve_request_type type)
{
	struct netresolve_query *queries = &context->queries;
	netresolve_query_t query;

	if (!(query = calloc(1, sizeof *query)))
		return NULL;

	query->previous = queries->previous;
	query->next = queries;
	query->previous->next = query->next->previous = query;

	query->context = context;
	query->sources.previous = query->sources.next = &query->sources;

	if (!context->backends)
		netresolve_set_backend_string(context, secure_getenv("NETRESOLVE_BACKENDS"));
	if (!context->backends || !*context->backends)
		abort();

	query->delayed_fd = -1;
	query->timeout_fd = -1;
	query->partial_timeout_fd = -1;
	query->backend = context->backends;
	memcpy(&query->request, &context->request, sizeof context->request);

	query->request.type = type;

	debug_query(query, "created", type);

	return query;
}

netresolve_query_t
netresolve_query( netresolve_t context, netresolve_query_callback callback, void *user_data,
		enum netresolve_option type, ...)
{
	static netresolve_t default_context = NULL;
	netresolve_query_t query;
	va_list ap;

	/* Use a static context if none is provided. */
	if (!context) {
		if (!default_context)
			default_context = netresolve_context_new();
		context = default_context;
	}
	if (!context)
		return NULL;

	if (!(query = netresolve_query_new(context, type)))
		return NULL;

	query->callback = callback;
	query->user_data = user_data;

	va_start(ap, type);
	if (!netresolve_request_set_options_from_va(&query->request, ap)) {
		netresolve_query_free(query);
		va_end(ap);
		return NULL;
	}
	va_end(ap);

	if (context->config.force_family)
		query->request.family = context->config.force_family;

	/* Install default callbacks for first query in blocking mode. */
	if (!context->callbacks.watch_fd)
		netresolve_epoll_install(context, &context->epoll, NULL);

	netresolve_query_set_state(query, NETRESOLVE_STATE_SETUP);

	/* Wait for the context in blocking mode. */
	if (context->callbacks.user_data == &context->epoll)
		netresolve_epoll_wait(context);

	return query;
}

netresolve_query_t
netresolve_query_forward(netresolve_t context,
		const char *nodename, const char *servname,
		netresolve_query_callback callback, void *user_data)
{
	return netresolve_query(context, callback, user_data,
			NETRESOLVE_REQUEST_FORWARD,
			NETRESOLVE_OPTION_NODE_NAME, nodename,
			NETRESOLVE_OPTION_SERVICE_NAME, servname,
			NULL);
}

netresolve_query_t
netresolve_query_reverse(netresolve_t context,
		int family, const void *address, int ifindex, int protocol, int port,
		netresolve_query_callback callback, void *user_data)
{
	enum netresolve_option address_option;

	switch (family) {
	case AF_INET:
		address_option = NETRESOLVE_OPTION_IP4_ADDRESS;
		break;
	case AF_INET6:
		address_option = NETRESOLVE_OPTION_IP6_ADDRESS;
		break;
	default:
		return NULL;
	}

	return netresolve_query(context, callback, user_data,
			NETRESOLVE_REQUEST_REVERSE,
			address_option, address,
			NETRESOLVE_OPTION_IFINDEX, ifindex,
			NETRESOLVE_OPTION_PROTOCOL, protocol,
			NETRESOLVE_OPTION_PORT, port,
			NULL);
}

netresolve_query_t
netresolve_query_dns(netresolve_t context,
		const char *dname, int cls, int type,
		netresolve_query_callback callback, void *user_data)
{
	return netresolve_query(context, callback, user_data,
			NETRESOLVE_REQUEST_DNS,
			NETRESOLVE_OPTION_DNS_NAME, dname,
			NETRESOLVE_OPTION_DNS_CLASS, cls,
			NETRESOLVE_OPTION_DNS_TYPE, type,
			NULL);
}

static bool
dispatch_timeout(netresolve_query_t query, int *tfd, enum netresolve_state state, int fd, int events)
{
	if (fd != *tfd)
		return false;

	clear_timeout(query, tfd);
	netresolve_query_set_state(query, state);

	return true;
}

/* netresolve_query_dispatch:
 *
 * This internal function is called by the netresolve context object to hand
 * over file descriptor events to a query. The query must return `false` if
 * it didn't handle the query so that the context can pass it to the next
 * query.
 */
bool
netresolve_query_dispatch(netresolve_query_t query, int fd, int events)
{
	struct netresolve_backend *backend = query->backend ? *query->backend : NULL;

	switch (query->state) {
	case NETRESOLVE_STATE_WAITING_MORE:
		if (dispatch_timeout(query, &query->partial_timeout_fd, NETRESOLVE_STATE_DONE, fd, events)) {
			debug_query(query, "partial result timed out");
			return true;
		}
		/* fall through */
	case NETRESOLVE_STATE_WAITING:
		if (dispatch_timeout(query, &query->timeout_fd, NETRESOLVE_STATE_FAILED, fd, events)) {
			debug_query(query, "result timed out");
			return true;
		}
		if (backend && backend->dispatch) {
			backend->dispatch(query, fd, events);
			if (query->state == NETRESOLVE_STATE_RESOLVED)
				netresolve_query_set_state(query, NETRESOLVE_STATE_DONE);
			if (query->state == NETRESOLVE_STATE_ERROR)
				netresolve_query_set_state(query, NETRESOLVE_STATE_FAILED);
			return true;
		}
		debug_query(query, "event received, not dispatched: fd=%d events=%d", fd, events);
		return false;
	case NETRESOLVE_STATE_RESOLVED:
		return dispatch_timeout(query, &query->delayed_fd, NETRESOLVE_STATE_DONE, fd, events);
	case NETRESOLVE_STATE_DONE:
		return netresolve_connect_dispatch(query, fd, events);
	default:
		break;
	}

	debug_query(query, "unexpected event: fd=%d events=%d", fd, events);
	return false;
}

/* netresolve_query_free:
 *
 * Call this function when you are finished with the netresolve query and
 * don't need to access it any more. It cancels the query if it hasn't been
 * finished yet, and performs internal cleanups. Don't use the query handle
 * after calling it.
 */
void
netresolve_query_free(netresolve_query_t query)
{
	cleanup_query(query);

	netresolve_query_set_state(query, NETRESOLVE_STATE_NONE);

	query->previous->next = query->next;
	query->next->previous = query->previous;

	free(query->request.nodename);
	free(query->request.servname);
	free(query->request.dns_name);
	free(query);
}

/* netresolve_query_get_count:
 *
 * Forward query: Retrieve a number of address objects available in the query
 * result.
 */
size_t
netresolve_query_get_count(netresolve_query_t query)
{
	return query->response.pathcount;
}

/* netresolve_query_get_node_info:
 *
 * Forward query: Retrieve node related address information.
 */
void
netresolve_query_get_node_info(netresolve_query_t query, size_t idx,
		int *family, const void **address, int *ifindex)
{
	assert (idx < query->response.pathcount);

	if (family)
		*family = query->response.paths[idx].node.family;
	if (address)
		*address = &query->response.paths[idx].node.address;
	if (ifindex)
		*ifindex = query->response.paths[idx].node.ifindex;
}

/* netresolve_query_get_service_info:
 *
 * Forward query: Retrieve service related address information.
 */
void
netresolve_query_get_service_info(netresolve_query_t query, size_t idx,
		int *socktype, int *protocol, int *port)
{
	assert (idx < query->response.pathcount);

	if (socktype)
		*socktype = query->response.paths[idx].service.socktype;
	if (protocol)
		*protocol = query->response.paths[idx].service.protocol;
	if (port)
		*port = query->response.paths[idx].service.port;
}

/* netresolve_query_get_aux_info:
 *
 * Forward query: Retreive auxiliary address information.
 */
void
netresolve_query_get_aux_info(netresolve_query_t query, size_t idx,
		int *priority, int *weight, int *ttl)
{
	assert (idx < query->response.pathcount);

	if (priority)
		*priority = query->response.paths[idx].priority;
	if (weight)
		*weight = query->response.paths[idx].weight;
	if (ttl)
		*ttl = query->request.clamp_ttl >= 0 ? query->request.clamp_ttl : query->response.paths[idx].ttl;
}

/* netresolve_query_get_node_name:
 *
 * Forward query: Retrieve the canonical name.
 *
 * Reverse query: Retrieve the node name.
 */
const char *
netresolve_query_get_node_name(const netresolve_query_t query)
{
	if (query->response.nodename)
		return query->response.nodename;
	if (query->state != NETRESOLVE_STATE_DONE)
		return NULL;
	if (query->request.type != NETRESOLVE_REQUEST_FORWARD)
		return NULL;
	return query->request.nodename ? query->request.nodename : "localhost";
}

/* netresolve_query_get_service_name:
 *
 * Reverse query: Retrieve the service name.
 */
const char *
netresolve_query_get_service_name(const netresolve_query_t query)
{
	return query->response.servname;
}

/* netresolve_query_get_dns_answer:
 *
 * DNS query: Retrieve the DNS answer.
 */
const void *
netresolve_query_get_dns_answer(const netresolve_query_t query, size_t *size)
{
	if (size)
		*size = query->response.dns.length;

	return query->response.dns.answer;
}

bool
netresolve_query_get_secure(const netresolve_query_t query)
{
	return query->response.security == NETRESOLVE_SECURITY_SECURE;
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>JSDoc: Class: component UserChangeUsername</title>

    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">

Class: component UserChangeUsername

component UserChangeUsername

Allows user to change username

Constructor

new component UserChangeUsername()

Source:

        ChangeUsername.jsx, line 1

Home

Classes

component UserChangePassword

component UserChangeUsername

component UserEmail

component UserLogin

component UserRegister

component UserSettings

    Documentation generated by JSDoc 3.4.0 on Fri Feb 26 2016 22:51:12 GMT-0500 (EST)


text:
package com.ocdsoft.bacta.soe.json.schema;

import com.fasterxml.jackson.databind.JsonNode;
import com.sun.codemodel.JDefinedClass;
import com.sun.codemodel.JFieldVar;
import org.jsonschema2pojo.AbstractAnnotator;

/**
 * Created by kburkhardt on 12/29/14.
 */
public class SoeAnnotator extends AbstractAnnotator {

    @Override
    public void propertyField(JFieldVar field, JDefinedClass clazz, String propertyName, JsonNode propertyNode) {

        JsonNode unicodeDiscovery = propertyNode.get("isUnicode");

        if (unicodeDiscovery != null) {
            if(unicodeDiscovery.asBoolean()) {
                //field.annotate(UnicodeString.class);
            }
        }
    }
}


text:
"use strict";
import Model from "./HatenaModel";
import Client from "./HatenaClient";
export { Model, Client };


text:
#ifndef BOOST_PREDEF_COMPILER_DIGITALMARS_H
#define BOOST_PREDEF_COMPILER_DIGITALMARS_H

#include <boost/predef/version_number.h>
#include <boost/predef/make.h>

/*`
[heading `BOOST_COMP_DMC`]

[@http://en.wikipedia.org/wiki/Digital_Mars Digital Mars] compiler.
Version number available as major, minor, and patch.

[table
    [[__predef_symbol__] [__predef_version__]]

    [[`__DMC__`] [__predef_detection__]]

    [[`__DMC__`] [V.R.P]]
    ]
 */

#define BOOST_COMP_DMC BOOST_VERSION_NUMBER_NOT_AVAILABLE

#if defined(__DMC__)
#   undef BOOST_COMP_DMC
#   define BOOST_COMP_DMC BOOST_PREDEF_MAKE_0X_VRP(__DMC__)
#endif

#if BOOST_COMP_DMC
#   define BOOST_COMP_DMC_AVAILABLE
#endif

#define BOOST_COMP_DMC_NAME "Digital Mars"

#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_DMC,BOOST_COMP_DMC_NAME)

#endif


text:
NSString *const MISTDebugShouldReloadNotification = @"MISTDebugShouldReload";

@implementation MSTDebugger

@synthesize serverPort = _serverPort;

+ (instancetype)defaultDebugger {
    static MSTDebugger *_defaultDebugger = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _defaultDebugger = [[self alloc] init];
    });
    return _defaultDebugger;
}

- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

- (instancetype)init {
    self = [super init];
    if (self) {
        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(didReceiveData:)
                                                     name:MISTDebugSocketDidRecivedDataNotification
                                                   object:nil];
        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(configDidChanged:)
                                                     name:MISTDebugConfigDidChangedNotification
                                                   object:nil];
    }
    return self;
}

- (void)didReceiveData:(NSNotification *)notification {
    NSString *data = notification.userInfo[MISTDebugSocketDataKey];
    if ([data isEqualToString:@"refresh"]) {
        if ([MSTDebugConfig sharedConfig].localTemplateMode) {
            dispatch_async(dispatch_get_main_queue(), ^{
                [[NSNotificationCenter defaultCenter] postNotificationName:MISTDebugShouldReloadNotification object:nil];
            });
        }
    }
}

- (void)configDidChanged:(NSNotification *)notification {
    dispatch_async(dispatch_get_main_queue(), ^{
        [[NSNotificationCenter defaultCenter] postNotificationName:MISTDebugShouldReloadNotification object:nil];
        NSString *notice = [NSString stringWithFormat:@"%@", [MSTDebugConfig sharedConfig].localTemplateMode ? @"本地模版" : @"网关模版"];
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:notice delegate:nil cancelButtonTitle:nil otherButtonTitles:nil];
        [alert show];

        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [alert dismissWithClickedButtonIndex:0 animated:YES];
        });
    });
}

- (void)startWithDownloader:(Class)downloaderClass {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
    if (![downloaderClass instancesRespondToSelector:@selector(downloadTemplates:completion:options:)]) {
#pragma clang diagnostic pop
        MSTDLog(@"Failed to start debug mode, Template downloader must implement [downloadTemplates:completion:options:]");
        return;
    }
    [MSTDebugConfig sharedConfig];
    [MSTDebugConnection startServer];
    [[MSTDebugDownloader sharedInstance] startWithDownloader:downloaderClass];
}

# pragma mark - Getter

- (UInt16)clientPort {
    return _clientPort ?: 10002;
}

//- (UInt16)serverPort {
//    return _serverPort ?: 10001;
//}

- (void)setServerPort:(UInt16)serverPort {
    _serverPort = serverPort;

    [[MSTDebugConfig sharedConfig] updateServerPort:serverPort];
}

@end


text:
package com.badlogic.gdx.tests.bullet;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Application.ApplicationType;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.Mesh;
import com.badlogic.gdx.graphics.PerspectiveCamera;
import com.badlogic.gdx.graphics.VertexAttribute;
import com.badlogic.gdx.graphics.VertexAttributes;
import com.badlogic.gdx.graphics.VertexAttributes.Usage;
import com.badlogic.gdx.graphics.g3d.Model;
import com.badlogic.gdx.graphics.g3d.ModelBatch;
import com.badlogic.gdx.graphics.g3d.lights.DirectionalLight;
import com.badlogic.gdx.graphics.g3d.lights.Lights;
import com.badlogic.gdx.graphics.g3d.lights.PointLight;
import com.badlogic.gdx.graphics.g3d.loader.ObjLoader;
import com.badlogic.gdx.graphics.g3d.materials.ColorAttribute;
import com.badlogic.gdx.graphics.g3d.materials.FloatAttribute;
import com.badlogic.gdx.graphics.g3d.materials.Material;
import com.badlogic.gdx.graphics.g3d.shaders.DefaultShader;
import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
import com.badlogic.gdx.graphics.glutils.ShaderProgram;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Quaternion;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.math.collision.Ray;
import com.badlogic.gdx.physics.bullet.Bullet;
import com.badlogic.gdx.physics.bullet.btIDebugDraw;
import com.badlogic.gdx.physics.bullet.btIDebugDraw.DebugDrawModes;
import com.badlogic.gdx.physics.bullet.btRigidBody;
import com.badlogic.gdx.physics.bullet.btTransform;
import com.badlogic.gdx.physics.bullet.gdxBullet;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.Disposable;
import com.badlogic.gdx.utils.SharedLibraryLoader;

/** @author xoppa */
public class BaseBulletTest extends BulletTest {
	// Set this to the path of the lib to use it on desktop instead of default lib.
	private final static String customDesktopLib = null;//"D:\\Data\\code\\android\\libs\\libgdx\\extensions\\gdx-bullet\\jni\\vs\\gdxBullet\\x64\\Debug\\gdxBullet.dll";

	private static boolean initialized = false;
	public static void init() {
		if (initialized) return;
		// Need to initialize bullet before using it.
		if (Gdx.app.getType() == ApplicationType.Desktop && customDesktopLib != null)
			System.load(customDesktopLib);
		else
			Bullet.init();
		Gdx.app.log("Bullet", "Version = "+gdxBullet.btGetVersion());
		initialized = true;
	}

	public Lights lights = new Lights(0.2f, 0.2f, 0.2f).add(
		new DirectionalLight().set(0.8f, 0.8f, 0.8f, -0.5f, -1f, -0.7f)
	);

	public BulletWorld world;
	public ObjLoader objLoader = new ObjLoader();
	public ModelBuilder modelBuilder = new ModelBuilder();
	public ModelBatch modelBatch;
	public Array<Disposable> disposables = new Array<Disposable>();
	private int debugMode = DebugDrawModes.DBG_NoDebug;

	public BulletWorld createWorld() {
		return new BulletWorld();
	}

	@Override
	public void create () {
		init();
		modelBatch = new ModelBatch();

		world = createWorld();
		world.performanceCounter = performanceCounter;

		final float width = Gdx.graphics.getWidth();
		final float height = Gdx.graphics.getHeight();
		if (width > height)
			camera = new PerspectiveCamera(67f, 3f * width / height, 3f);
		else
			camera = new PerspectiveCamera(67f, 3f, 3f * height / width);
		camera.position.set(10f, 10f, 10f);
		camera.lookAt(0, 0, 0);
		camera.update();

		// Create some simple models
		final Model groundModel = modelBuilder.createRect(20f, 0f, -20f, -20f, 0f, -20f, -20f, 0f, 20f, 20f, 0f, 20f, 0, 1, 0,
			new Material(ColorAttribute.createDiffuse(Color.WHITE), ColorAttribute.createSpecular(Color.WHITE), FloatAttribute.createShininess(16f)),
			Usage.Position | Usage.Normal);
		disposables.add(groundModel);
		final Model boxModel = modelBuilder.createBox(1f, 1f, 1f,
			new Material(ColorAttribute.createDiffuse(Color.WHITE), ColorAttribute.createSpecular(Color.WHITE), FloatAttribute.createShininess(64f)),
			Usage.Position | Usage.Normal);
		disposables.add(boxModel);

		// Add the constructors
		world.addConstructor("ground", new BulletConstructor(groundModel, 0f)); // mass = 0: static body
		world.addConstructor("box", new BulletConstructor(boxModel, 1f)); // mass = 1kg: dynamic body
		world.addConstructor("staticbox", new BulletConstructor(boxModel, 0f)); // mass = 0: static body
	}

	@Override
	public void dispose () {
		world.dispose();
		world = null;

		for (Disposable disposable : disposables)
			disposable.dispose();
		disposables.clear();

		super.dispose();
	}

	@Override
	public void render () {
		render(true);
	}

	public void render(boolean update) {
		fpsCounter.put(Gdx.graphics.getFramesPerSecond());

		if (update)
			update();

		beginRender(true);

		renderWorld();

		Gdx.gl.glDisable(GL10.GL_DEPTH_TEST);
		if (debugMode != DebugDrawModes.DBG_NoDebug)
			world.setDebugMode(debugMode, camera.combined);
		Gdx.gl.glEnable(GL10.GL_DEPTH_TEST);

		performance.setLength(0);
		performance.append("FPS: ").append(fpsCounter.value).append(", Bullet: ")
			.append((int)(performanceCounter.load.value*100f)).append("%");
	}

	protected void beginRender(boolean lighting) {
		Gdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
		Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
		camera.update();
	}

	protected void renderWorld() {
		modelBatch.begin(camera);
		world.render(modelBatch, lights);
		modelBatch.end();
	}

	public void update() {
		world.update();
	}

	public BulletEntity shoot(final float x, final float y) {
		return shoot(x,y,30f);
	}

	public BulletEntity shoot(final float x, final float y, final float impulse) {
		return shoot("box", x, y, impulse);
	}

	public BulletEntity shoot(final String what, final float x, final float y, final float impulse) {
		// Shoot a box
		Ray ray = camera.getPickRay(x, y);
		BulletEntity entity = world.add(what, ray.origin.x, ray.origin.y, ray.origin.z);
		entity.setColor(0.5f + 0.5f * (float)Math.random(), 0.5f + 0.5f * (float)Math.random(), 0.5f + 0.5f * (float)Math.random(), 1f);
		((btRigidBody)entity.body).applyCentralImpulse(ray.direction.scl(impulse));
		return entity;
	}

	public void setDebugMode(final int mode) {
		world.setDebugMode(debugMode = mode, camera.combined);
	}

	public void toggleDebugMode() {
		if (world.getDebugMode() == DebugDrawModes.DBG_NoDebug)
			setDebugMode(DebugDrawModes.DBG_DrawWireframe);
		else if (world.renderMeshes)
			world.renderMeshes = false;
		else {
			world.renderMeshes = true;
			setDebugMode(DebugDrawModes.DBG_NoDebug);
		}
	}

	@Override
	public boolean longPress (float x, float y) {
		toggleDebugMode();
		return true;
	}

	@Override
	public boolean keyUp (int keycode) {
		if (keycode == Keys.ENTER) {
			toggleDebugMode();
			return true;
		}
		return super.keyUp(keycode);
	}
}


text:
Feature vectors of images with MobileNet V1 (depth multiplier 0.50) trained on ImageNet (ILSVRC-2012-CLS).

<!-- dataset: imagenet-ilsvrc-2012-cls -->
<!-- asset-path: legacy -->
<!-- task: image-feature-vector -->
<!-- network-architecture: mobilenet-v1 -->
<!-- fine-tunable: true -->
<!-- format: hub -->

## Overview

MobileNet V1 is a family of neural network architectures for efficient
on-device  image classification, originally published by

  * Andrew G. Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang,
    Tobias Weyand, Marco Andreetto, Hartwig Adam:
    ["MobileNets: Efficient Convolutional Neural Networks for
    Mobile Vision Applications"](https://arxiv.org/abs/1704.04861), 2017.

Mobilenets come in various sizes controlled by a multiplier for the
depth (number of features) in the convolutional layers. They can also be
trained for various sizes of input images to control inference speed.
This TF-Hub module uses the TF-Slim implementation of
`mobilenet_v1_050`
with a depth multiplier of 0.5 and an input size of
224x224 pixels.

The module contains a trained instance of the network, packaged to get
[feature vectors from images](https://www.tensorflow.org/hub/common_signatures/images#feature-vector).
If you want the full model including the classification it was originally
trained for, use module
[`google/imagenet/mobilenet_v1_050_224/classification/1`](https://tfhub.dev/google/imagenet/mobilenet_v1_050_224/classification/1)
instead.

## Training

The checkpoint exported into this module was `mobilenet_v1_2018_02_22/mobilenet_v1_0.5_224/mobilenet_v1_0.5_224.ckpt` downloaded
from
[MobileNet pre-trained models](https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet_v1.md).
Its weights were originally obtained by training on the ILSVRC-2012-CLS
dataset for image classification ("Imagenet").

## Usage

This module implements the common signature for computing
[image feature vectors](https://www.tensorflow.org/hub/common_signatures/images#feature-vector).
It can be used like

```python
module = hub.Module("https://tfhub.dev/google/imagenet/mobilenet_v1_050_224/feature_vector/1")
height, width = hub.get_expected_image_size(module)
images = ...  # A batch of images with shape [batch_size, height, width, 3].
features = module(images)  # Features with shape [batch_size, num_features].
```

...or using the signature name `image_feature_vector`. The output for each image
in the batch is a feature vector of size `num_features` = 512.

For this module, the size of the input image is fixed to
`height` x `width` = 224 x 224 pixels.
The input `images` are expected to have color values in the range [0,1],
following the
[common image input](https://www.tensorflow.org/hub/common_signatures/images#input)
conventions.

## Fine-tuning

Consumers of this module can [fine-tune](https://www.tensorflow.org/hub/tf1_hub_module#fine-tuning) it.
This requires importing the graph version with tag set `{"train"}`
in order to operate batch normalization in training mode.


text:
package es.caib.zkib.jxpath.ri.compiler;

/**
 * Implementation of {@link Expression} for the operation "<=".
 *
 * @author Dmitri Plotnikov
 * @version $Revision: 1.1 $ $Date: 2009-04-03 08:13:14 $
 */
public class CoreOperationLessThanOrEqual extends
        CoreOperationRelationalExpression {

    /**
     * Create a new CoreOperationLessThanOrEqual.
     * @param arg1 left Expression
     * @param arg2 right Expression
     */
    public CoreOperationLessThanOrEqual(Expression arg1, Expression arg2) {
        super(new Expression[] { arg1, arg2 });
    }

    protected boolean evaluateCompare(int compare) {
        return compare <= 0;
    }

    public String getSymbol() {
        return "<=";
    }
}


text:
package foxtrot;

/**
 * Implementations of this interface run
 * {@link Task}s in a thread that is not the Event Dispatch Thread. <br />
 * Implementations should extend {@link AbstractWorkerThread}.
 *
 * @version $Revision: 255 $
 */
public interface WorkerThread
{
    /**
     * Starts this WorkerThread, responsible for running {@link Task}s (not in the
     * Event Dispatch Thread).
     * Applets can stop threads used by implementations of this WorkerThread in any moment,
     * and this method also can be used to restart this WorkerThread
     * if it results that it is not alive anymore.
     *
     * @see #isAlive
     */
    public void start();

    /**
     * Returns whether this WorkerThread is alive. It is not enough to return
     * whether this WorkerThread has been started, because Applets can stop threads
     * used by implementations of this WorkerThread in any moment.
     * If this WorkerThread is not alive, it must be restarted.
     *
     * @see #start
     */
    public boolean isAlive();

    /**
     * Returns whether the current thread is a thread used by the implementation of
     * this WorkerThread to run {@link Task}s.
     */
    public boolean isWorkerThread();

    /**
     * Posts a Task to be run by this WorkerThread in a thread that is not the
     * Event Dispatch Thread. This method must be called from the
     * Event Dispatch Thread and should return immediately.
     * Implementations should check if this WorkerThread {@link #isAlive} to guarantee
     * that the posted Task will be executed by this WorkerThread.
     *
     * @see #runTask
     */
    public void postTask(Task task);

    /**
     * Runs the given Task. This method must be called by a thread that is not the
     * Event Dispatch Thread, and must execute the task in the same thread of the
     * caller, synchronously.
     *
     * @see #postTask
     */
    public void runTask(Task task);
}


text:
<!doctype html>

        <meta charset="utf-8">
        <link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css">

        <title>jquery.cookie Test Suite</title>

jquery.cookie Test Suite


text:
<?php
/**
 * Created by PhpStorm.
 * User: jesserosato
 * Date: 6/7/14
 * Time: 4:05 PM
 */

namespace ListsIO\Bundle\ListBundle\Controller;

use ListsIO\Bundle\ListBundle\Entity\LIOList;
use ListsIO\Bundle\ListBundle\Entity\LIOListItem;
use ListsIO\Bundle\ListBundle\Entity\LIOListLike;
use ListsIO\Bundle\ListBundle\Entity\LIOListView;
use ListsIO\Bundle\UserBundle\Entity\User;
use ListsIO\Controller\Controller as BaseController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\HttpException;

class Controller extends BaseController {

    /**
     * @return LIOList
     */
    protected function newList()
    {
        $this->requireAuthentication();
        $list = new LIOList();
        $list->setUser($this->getUser());
        $list->addListItem(new LIOListItem());
        $this->saveEntity($list);
        return $list;
    }

    /**
     * @param LIOList $list
     * @return LIOListLike
     * @throws \Symfony\Component\HttpKernel\Exception\HttpException
     */
    public function newListLike(LIOList $list)
    {
        $this->requireAuthentication();
        if ($this->listIsLikedByUser($list, $this->getUser())) {
            throw new HttpException(409, 'You already liked this list.');
        }
        $like = new LIOListLike();
        $like->setList($list);
        $like->setUser($this->getUser());
        $this->saveEntity($like);
        return $like;
    }

    /**
     * @param Request $request
     * @param LIOList $list
     * @param User $user
     * @return LIOListView
     */
    public function newListView(Request $request, LIOList $list, User $user = null) {
        /** @var LIOListView $listView */
        $listView = new LIOListView();
        $listView->setList($list);
        // Author views should not count towards list views.
        if ( ! empty($user)) {
            if ($list->getUser()->getId() != $user->getId()) {
                $listView->setUser($user);
            }
        } else {
            $listView->setAnonymousIdentifier($request->headers->get('User-Agent'), $request->getClientIp());
        }
        $this->saveEntity($listView);
        return $listView;
    }

    /**
     * @param $id
     * @return LIOList
     * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
     */
    protected function loadList($id)
    {
        $list = $this->loadEntityFromId('ListsIOListBundle:LIOList', $id);
        if (empty($list)) {
            throw $this->createNotFoundException("Unable to find list.");
        }
        return $list;
    }

    protected function loadListItem($itemId)
    {
        $listItem = $this->loadEntityFromId('ListsIOListBundle:LIOListItem', $itemId);
        if (empty($listItem)) {
            throw $this->createNotFoundException("Unable to load list item to save it.");
        }
        return $listItem;
    }

    /**
     * Figure out whether the user has liked this list before.
     * @param LIOList $list
     * @param User $user
     * @return bool
     */
    public function listIsLikedByUser(LIOList $list, User $user = null) {
        if (empty($user)) {
            return false;
        }
        $repo = $this->getDoctrine()->getRepository('ListsIO\Bundle\ListBundle\Entity\LIOListLike');
        $listLikes = $repo->findOneBy(
            array(
                'list'   => $list,
                'user'   => $user
            )
        );
        return !! (count($listLikes));
    }

}


text:
<?php

namespace Component\Search;

use Elasticsearch\Client;
use Elasticsearch\ClientBuilder;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;

/**
 * Class ElasticSearch.
 */
class ElasticSearch
{
    /**
     * @var array
     */
    protected $configuration = [];

    /**
     * @var LoggerInterface
     */
    protected $logger;

    /**
    * @var Elasticsearch\Client
    */
    private static $client = null;

    /**
     *
     * @param array $configuration application
     * @param LoggerInterface $logger
     *
     */
    public function __construct($configuration, LoggerInterface $logger = null)
    {
        $this->configuration = $configuration;
        $this->logger = $logger;
    }

    /**
     *
     * @return array
     *
     */
    protected function getHosts()
    {
        $hosts = [];
        foreach($this->configuration['clients'] as $host)
        {
            $hosts[] = $host['scheme'] . "://" .  $host['host'] . ":" . $host['port'];
        }
        return $hosts;
    }

    /**
     *
     * @return Elasticsearch\Client
     *
     */
    public function getInstance()
    {
        if (is_null(self::$client)) {
            $defaultHandler = ClientBuilder::defaultHandler(
                ['max_handles' => $this->configuration['max_handles']]
            );

            self::$client = ClientBuilder::create()
                        ->setHosts($this->getHosts())
                        ->setRetries($this->configuration['retries'])
                        ->setHandler($defaultHandler)
                        ->setLogger($this->logger)
                        ->build();
        }
        return self::$client;
    }
}


text:
/*
 Usage:
 bin/eclairjs.sh examples/mllib/ranking_metrics_example.js  [<path to file>]
 */

var RankingMetrics = require('eclairjs/mllib/evaluation').RankingMetrics;
var RegressionMetrics = require('eclairjs/mllib/evaluation').RegressionMetrics;
var ALS = require('eclairjs/mllib/recommendation/ALS');
var Rating = require('eclairjs/mllib/recommendation/Rating');
var List = require('eclairjs/List');
var Tuple = require('eclairjs/Tuple');
var PairRDD = require('eclairjs/PairRDD');

function run(sc) {

    var data = data = sc.textFile(filename);

    var ratings = data.map(function (line, Rating) {
        var arr = line.split("::");
        var r = new Rating(parseInt(arr[0]),
            parseInt(arr[1]),
            parseFloat(arr[2]) - 2.5);
        return r;
    }, [Rating]).cache();

    var model = ALS.train(ratings, 10, 10, 0.01);
    var userRecs = model.recommendProductsForUsers(10);

    var userRecommendedScaled = userRecs.map(function (val, Rating, Tuple) {
        var myRating = Rating; // FIXME: For now make a copy to pass to inner lambda
        var newRatings = val[1].map(function (r) {
            var newRating = Math.max(Math.min(r.rating(), 1.0), 0.0);
            return new Rating(r.user(), r.product(), newRating);
        });

        return new Tuple(val[0], newRatings);
    }, [Rating, Tuple]);

    var userRecommended = PairRDD.fromRDD(userRecommendedScaled);

    var binarizedRatings = ratings.map(function (r, Rating) {
        var binaryRating = 0.0;
        if (r.rating() > 0.0) {
            binaryRating = 1.0;
        }

        return new Rating(r.user(), r.product(), binaryRating);
    }, [Rating]);

    var userMovies = binarizedRatings.groupBy(function (r) {
        return r.user();
    });

    var userMoviesList = userMovies.mapValues(function (docs, List) {
        var products = new List();
        docs.forEach(function (r) {
            if (r.rating() > 0.0) {
                products.add(r.product());
            }
        });
        return products;
    }, [List]);

    var userRecommendedList = userRecommended.mapValues(function (docs, List) {
        var products = new List();
        docs.forEach(function (r) {
            products.add(r.product());
        });
        return products;
    }, [List]);

    var relevantDocs = userMoviesList.join(userRecommendedList).values();

    var metrics = RankingMetrics.of(relevantDocs);

// Precision and NDCG at k
    [1, 3, 5].forEach(function (k) {
        print("Precision at " + k + " = " + metrics.precisionAt(k));
        print("NDCG at " + k + " = " + metrics.ndcgAt(k));
    });

    print("Mean average precision = " + metrics.meanAveragePrecision());

    var userProducts = ratings.map(function (r, Tuple) {
        return new Tuple(r.user(), r.product());
    }, [Tuple]);

    var predictions = PairRDD.fromRDD(model.predict(userProducts).map(function (r, Tuple) {
        return new Tuple(new Tuple(r.user(), r.product()), r.rating());
    }, [Tuple]));

    var ratesAndPreds = PairRDD.fromRDD(ratings.map(function (r, Tuple) {
        return new Tuple(new Tuple(r.user(), r.product()), r.rating());
    }, [Tuple])).join(predictions).values();

// Create regression metrics object
    var regressionMetrics = new RegressionMetrics(ratesAndPreds);
    var ret = {};
    ret.RMSE = regressionMetrics.rootMeanSquaredError();
    ret.r2 = regressionMetrics.r2();
    return ret;

}

/*
 check if SparkContext is defined, if it is we are being run from Unit Test
 */
var filename = ((typeof args !== "undefined") && (args.length > 1)) ? args[1] : "examples/data/mllib/sample_movielens_data.txt";

if (typeof sparkContext === 'undefined') {
    var SparkConf = require('eclairjs/SparkConf');
    var SparkContext = require('eclairjs/SparkContext');
    var conf = new SparkConf().setAppName("Ranking Metrics Example");
    var sc = new SparkContext(conf);
    var result = run(sc);
    // Root mean squared error
    print("RMSE = " + result.RMSE);

    // R-squared
    print("R-squared = " + result.r2);

    sc.stop();
}


text:
package org.terasology.input.binds.interaction;

import org.terasology.input.BindButtonEvent;
import org.terasology.input.DefaultBinding;
import org.terasology.input.InputType;
import org.terasology.input.Keyboard;
import org.terasology.input.RegisterBindButton;

/**
 */
@RegisterBindButton(id = "frob", description = "Use Target")
@DefaultBinding(type = InputType.KEY, id = Keyboard.KeyId.E)
public class FrobButton extends BindButtonEvent {
}


text:
import React, {Component, PropTypes} from 'react';
import {connect} from 'react-redux';
import Helmet from 'react-helmet';
import {FormattedMessage} from 'react-intl';
import LoginForm from 'grommet/components/LoginForm';
import Dropzone from 'react-dropzone';
import Notification from 'grommet/components/Notification';
import AvatarEditor from 'react-avatar-editor';
import Layer from 'grommet/components/Layer';
import Button from 'grommet/components/Button';
import Heading from 'grommet/components/Heading';
import Footer from 'grommet/components/Footer';
import Form from 'grommet/components/Form';
import FormField from 'grommet/components/FormField';
import FormFields from 'grommet/components/FormFields';
import TextInput from 'grommet/components/TextInput';
import Header from 'grommet/components/Header';
import AvatarCropper from '../../../User/components/AvatarCropper'
import { editUser } from '../../../User/UserActions'
import { addGuideInfo } from '../../../Guide/GuideActions'

export class UploadProfilePicture extends Component {

    constructor(props) {
        super(props);

        this.state = {
          avatar: null,
          hasAvatar: false,
          submitPressed: false,
          hideDropzone: false,
          description: "",
          ct1: "",
          ct2: "",
          ct3: "",
          ct1Description: "",
          ct2Description: "",
          ct3Description: "",
        };
    }

    submitAvatar = () => {
      this.props.addAvatar({cuid: this.props.user.user.cuid, avatar: this.state.avatar})
      this.setState({hideDropzone: true, submitPressed: true})
    }

    cancelAvatar = () => {
      this.setState({avatar: null, hideDropzone: false, submitPressed: false})
    }

    handleSubmit = () => {
      const { description, ct1, ct2, ct3, ct1Description, ct2Description, ct3Description } = this.state

      console.log("state", this.state)

      if ( description && ct1 && ct2 && ct3 && ct1Description && ct2Description && ct3Description ) {
        let characterTraits = []
        let characterTraitDescription = []

        characterTraits.push(ct1, ct2, ct3)
        characterTraitDescription.push(ct1Description, ct2Description, ct3Description)

        const guideInfo = {
          description,
          characterTraits,
          characterTraitDescription,
          userCuid: this.props.user.user.cuid
        }

        console.log(guideInfo)

        this.props.addGuideInfo(guideInfo)

      }
    }

    render() {

        const styles = {

            wrapper: {
                display: "inline-block",
                margin: "auto",
                textAlign: "left"
            }
        };

        let cropper
        let submit

        if(!this.props.user.avatar) {
          if(!this.state.hideDropzone) {
            cropper = (

                  <Heading strong={true}
                    align='center'
                    margin='medium'>
                    Upload a picture of your awesome self!
                  </Heading>
                  <AvatarCropper saveImage={(avatar) => this.setState({ avatar, hideDropzone: true })} />

            )
          }
        }

        //UI State 2: show avatar and prompt for upload
        if(this.state.avatar) {
          submit = (

              <Heading strong={true}
                align='center'
                margin='medium'>
                You look great!
              </Heading>
              <Heading strong={false}
                align='center'
                margin='medium'
                tag='h2'>
                Do you want to keep this nice photo as your profile picture?
              </Heading>

                  <Button primary label="Submit" onClick={this.submitAvatar} />

                  <Button label="Cancel" onClick={this.cancelAvatar} />

          )
        }

        if(this.props.user.avatar || this.state.submitPressed) {
          //user already has an avatar, lets show description box and 3 question boxes
          cropper = (

              <Heading strong={true}
                align='center'
                margin='medium'
                tag='h1'>
                Awesome!
              </Heading>

              <Form>

                  <Heading>
                    Tell me about you
                  </Heading>

                  <FormField label='Description'>
                    <textarea
                    name="aboutMe"
                    cols="40"
                    value={this.state.description}
                    placeholder="Introduce yourself!"
                    onChange={(event) => this.setState({description: event.target.value})}
                    rows="5"></textarea>
                  </FormField>

                  <Heading style={{ marginTop: '2rem' }}>
                  Three of your best character traits
                  </Heading>

                  <FormField label='First character trait'>
                    <TextInput name="ct1" placeHolder="e.g. Adventurous, Open Minded, Sporty.." onDOMChange={(event) => this.setState({ct1: event.target.value})} />
                  </FormField>
                  <FormField label='Describe this character trait'>
                    <textarea
                    name="ct1Description"
                    onChange={(event) => this.setState({ct1Description: event.target.value})}
                    cols="40"
                    placeholder="e.g. If you like adventures, I'm your type of guide. Caves, suspension bridges - you name it... "
                    rows="5"></textarea>
                  </FormField>

                  <FormField label='Second character trait'>
                    <TextInput name="ct2" placeHolder="e.g. Adventurous, Open Minded, Sporty.." onDOMChange={(event) => this.setState({ct2: event.target.value})} />
                  </FormField>
                  <FormField label="Describe this character trait">
                    <textarea
                    name="ct2Description"
                    onChange={(event) => this.setState({ct2Description: event.target.value})}
                    cols="40"
                    placeholder="e.g. If you like adventures, I'm your type of guide. Caves, suspension bridges - you name it... "
                    rows="5"></textarea>
                  </FormField>

                  <FormField label='Third character trait'>
                    <TextInput name="ct3" placeHolder="e.g. Adventurous, Open Minded, Sporty.." onDOMChange={(event) => this.setState({ct3: event.target.value})} />
                  </FormField>
                  <FormField label="Describe this character trait">
                    <textarea
                    name="ct3Description"
                    onChange={(event) => this.setState({ct3Description: event.target.value})}
                    cols="40"
                    placeholder="e.g. If you like adventures, I'm your type of guide. Caves, suspension bridges - you name it... "
                    rows="5"></textarea>
                  </FormField>
              </Form>

                <Button label='Submit'
                  type='submit'
                  primary={true}
                  onClick={this.handleSubmit} />

          )

          submit = ""

        }

        return (

                <Helmet title={"Initial Page Wizard"}/>

                  {cropper}
                  {submit}

        );
    }

}

// Retrieve data from store as props
const mapStateToProps = (store) => {
    return {
        user: store.user,
    };
};

const mapDispatchToProps = (dispatch) => {
    return {
        addGuideInfo: (guideInfo) => {
            dispatch(addGuideInfo(guideInfo));
        },
        addAvatar: (user) => {
            dispatch(editUser(user));
        }
    }
};

export default connect(mapStateToProps, mapDispatchToProps)(UploadProfilePicture);


text:
angular.module('hojeEhDiaDeRuaApp', [])

.constant('diaDeRuaURL', {'url': '/hojeehdiaderua/queRuaEhHoje'})

.config(['$httpProvider', ($httpProvider) => {
    $httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
}])

.controller('diaDeRuaController', ['$scope', '$http', 'diaDeRuaURL', ($scope, $http, diaDeRuaURL) => {
     $http.get(diaDeRuaURL.url)
        .success((data) => {
            $scope.diaderua = data;
        })
        .error((data, status) => {
            $scope.diaderua = data;
        });
}])


text:
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >

<suite name="Suite1" verbose="1" >
      <test name="Contacts">
        <classes>
            <class name="ru.stqa.pft.addressbook.tests.UserCreationTest" />
            <class name="ru.stqa.pft.addressbook.tests.UserModificationTest" />
            <class name="ru.stqa.pft.addressbook.tests.UserDeletionTest" />
        </classes>
    </test>
</suite>


text:
// ********************************************************************************************************
// Product Name: DotSpatial.Positioning.dll
// Description:  A library for managing GPS connections.
// ********************************************************************************************************
//
// The Original Code is from http://gps3.codeplex.com/ version 3.0
//
// The Initial Developer of this original code is Jon Pearson. Submitted Oct. 21, 2010 by Ben Tombs (tidyup)
//
// Contributor(s): (Open source contributors should list themselves and their modifications here).
// -------------------------------------------------------------------------------------------------------
// |    Developer             |    Date    |                             Comments
// |--------------------------|------------|--------------------------------------------------------------
// | Tidyup  (Ben Tombs)      | 10/21/2010 | Original copy submitted from modified GPS.Net 3.0
// | Shade1974 (Ted Dunsford) | 10/22/2010 | Added file headers reviewed formatting with resharper.
// ********************************************************************************************************

using System;

namespace DotSpatial.Positioning
{
    /// <summary>
    /// Represents a Garmin $PGRMF sentence.
    /// </summary>
    public sealed class PgrmfSentence : NmeaSentence, IUtcDateTimeSentence, IPositionSentence, IFixModeSentence,
                                        IFixMethodSentence, ISpeedSentence, IBearingSentence, IPositionDilutionOfPrecisionSentence
    {
        #region Constructors

        /// <summary>
        /// Creates a Garmin $PGRMF sentence from the specified parameters
        /// </summary>
        /// <param name="sentence">The sentence.</param>
        /// <param name="commandWord">The command word.</param>
        /// <param name="words">The words.</param>
        /// <param name="validChecksum">The valid checksum.</param>
        internal PgrmfSentence(string sentence, string commandWord, string[] words, string validChecksum)
            : base(sentence, commandWord, words, validChecksum)
        { SetPropertiesFromSentence(); }

        /// <summary>
        /// Creates a Garmin $PGRMF sentence from the specified string
        /// </summary>
        /// <param name="sentence">The sentence.</param>
        public PgrmfSentence(string sentence)
            : base(sentence)
        { SetPropertiesFromSentence(); }

        #endregion Constructors

        #region Overrides

        /// <summary>
        /// OnSentenceChanged event handler
        /// </summary>
        private new void SetPropertiesFromSentence()
        {
           /*
                Garmin produces several embedded GPS systems. They are easy to setup because Garmin provides a nice utility for uploading configuration data to the GPS.
                You first load the utility to a PC. Connect the PC to the GPS through one of the serial ports. The utility will check each baud rate until it communicates with the GPS.
                The common configuration parameters are output sentences from the GPS unit, the communication baud rate with a host, and the required pulse per second.
                Each sentence is preceded with a '$' symbol and ends with a line-feed character. At one sentence per second, the following is out put in four seconds:

                $PGRMF, 223, 424798, 041203, 215945, 13, 0000.0000, N, 00000.0000, W, A, 2, 0, 62, 2, 1*3B
                $PGRMF, 223, 424799, 041203, 215946, 13, 0000.0000, N, 00000.0000, W, A, 2, 0, 62, 2, 1*39
                $PGRMF, 223, 424800, 041203, 215947, 13, 0000.0000, N, 00000.0000, W, A, 2, 0, 62, 2, 1*34
                $PGRMF, 223, 424801, 041203, 215948, 13, 0000.0000, N, 00000.0000, W, A, 2, 0, 62, 2, 1*35

                The sentence is proprietary to the Garmin GPS Global Positioning System and is translated below.

                $PGRMF
                <0>  GPS week number (0 - 1023)
                <1>  GPS seconds (0 - 604799)
                <2>  UTC date of position fix, ddmmyy format
                <3>  UTC time of position fix, hhmmss format
                <4>  GPS leap second count
                <5>  Latitude, ddmm.mmmm format (leading zeros will be transmitted)
                <6>  Latitude hemisphere, N or S
                <7>  Longitude, dddmm.mmmm format (leading zeros will be transmitted)
                <8>  Longitude hemisphere, E or W
                <9>  Mode, M = manual, A = automatic
                <10> Fix type, 0 = no fix, 1 = 2D fix, 2 = 3D fix
                <11> Speed over ground, 0 to 1051 kilometers/hour
                <12> Course over ground, 0 to 359 degrees, true
                <13> Position dilution of precision, 0 to 9 (rounded to nearest integer value)
                <14> Time dilution of precision, 0 to 9 (rounded to nearest integer value)
                *hh <CR><LF>
             */

            // TODO: Convert GPS week number/seconds to UTC date/time

            UtcDateTime = ParseUtcDateTime(3, 2);
            Position = ParsePosition(5, 6, 7, 8);
            FixMode = ParseFixMode(9);
            FixMethod = ParseFixMethod(10, false);
            Bearing = ParseAzimuth(12);
            Speed = ParseSpeed(11, SpeedUnit.KilometersPerHour);
            PositionDilutionOfPrecision = ParseDilution(13);
        }

        #endregion Overrides

        #region Properties

        /// <summary>
        /// Represents an NMEA sentence which contains date and time in UTC.
        /// </summary>
        public DateTime UtcDateTime { get; private set; }

        /// <summary>
        /// Represents an NMEA sentence which contains a position.
        /// </summary>
        public Position Position { get; private set; }

        /// <summary>
        /// Gets the fix mode
        /// </summary>
        public FixMode FixMode { get; private set; }

        /// <summary>
        /// The Fix Method.
        /// </summary>
        /// <inheritdocs/>
        public FixMethod FixMethod { get; private set; }

        /// <summary>
        /// The Speed
        /// </summary>
        /// <inheritdocs/>
        public Speed Speed { get; private set; }

        /// <summary>
        /// the Bearing
        /// </summary>
        /// <inheritdocs/>
        public Azimuth Bearing { get; private set; }

        /// <summary>
        /// The Position Dilution of Precision (PDOP)
        /// </summary>
        /// <inheritdocs/>
        public DilutionOfPrecision PositionDilutionOfPrecision { get; private set; }

        #endregion
    }
}


text:
package seelog

import (
	"errors"
	"fmt"
	"strconv"
	"strings"
	"unicode"
	"unicode/utf8"
)

// FormatterSymbol is a special symbol used in config files to mark special format aliases.
const (
	FormatterSymbol = '%'
)
const (
	formatterSymbolString   = "%"
	formatterParameterStart = '('
	formatterParameterEnd   = ')'
)

// These are the time and date formats that are used when %Date or %Time format aliases are used.
const (
	DateDefaultFormat = "2006-01-02"
	TimeFormat        = "15:04:05"
)

var DefaultMsgFormat = "%Ns [%Level] %Msg%n"

var defaultformatter *formatter
var msgonlyformatter *formatter

func init() {
	var err error
	defaultformatter, err = newFormatter(DefaultMsgFormat)
	if err != nil {
		fmt.Println("Error during defaultformatter creation: " + err.Error())
	}
	msgonlyformatter, err = newFormatter("%Msg")
	if err != nil {
		fmt.Println("Error during msgonlyformatter creation: " + err.Error())
	}
}

// FormatterFunc represents one formatter object that starts with '%' sign in the 'format' attribute
// of the 'format' config item. These special symbols are replaced with context values or special
// strings when message is written to byte receiver.
//
// Check https://github.com/cihub/seelog/wiki/Formatting for details.
// Full list (with descriptions) of formatters: https://github.com/cihub/seelog/wiki/Format-reference
//
// FormatterFunc takes raw log message, level, log context and returns a string, number (of any type) or any object
// that can be evaluated as string.
type FormatterFunc func(message string, level LogLevel, context LogContextInterface) interface{}

// FormatterFuncCreator is a factory of FormatterFunc objects. It is used to generate parameterized
// formatters (such as %Date or %EscM) and custom user formatters.
type FormatterFuncCreator func(param string) FormatterFunc

var formatterFuncs = map[string]FormatterFunc{
	"Level":     formatterLevel,
	"Lev":       formatterLev,
	"LEVEL":     formatterLEVEL,
	"LEV":       formatterLEV,
	"l":         formatterl,
	"Msg":       formatterMsg,
	"FullPath":  formatterFullPath,
	"File":      formatterFile,
	"RelFile":   formatterRelFile,
	"Func":      FormatterFunction,
	"FuncShort": FormatterFunctionShort,
	"Line":      formatterLine,
	"Time":      formatterTime,
	"UTCTime":   formatterUTCTime,
	"Ns":        formatterNs,
	"UTCNs":     formatterUTCNs,
	"n":         formattern,
	"t":         formattert,
}

var formatterFuncsParameterized = map[string]FormatterFuncCreator{
	"Date":    createDateTimeFormatterFunc,
	"UTCDate": createUTCDateTimeFormatterFunc,
	"EscM":    createANSIEscapeFunc,
}

func errorAliasReserved(name string) error {
	return fmt.Errorf("cannot use '%s' as custom formatter name. Name is reserved", name)
}

// RegisterCustomFormatter registers a new custom formatter factory with a given name. If returned error is nil,
// then this name (prepended by '%' symbol) can be used in 'format' attributes in configuration and
// it will be treated like the standard parameterized formatter identifiers.
//
// RegisterCustomFormatter needs to be called before creating a logger for it to take effect. The general recommendation
// is to call it once in 'init' func of your application or any initializer func.
//
// For usage examples, check https://github.com/cihub/seelog/wiki/Custom-formatters.
//
// Name must only consist of letters (unicode.IsLetter).
//
// Name must not be one of the already registered standard formatter names
// (https://github.com/cihub/seelog/wiki/Format-reference) and previously registered
// custom format names. To avoid any potential name conflicts (in future releases), it is recommended
// to start your custom formatter name with a namespace (e.g. 'MyCompanySomething') or a 'Custom' keyword.
func RegisterCustomFormatter(name string, creator FormatterFuncCreator) error {
	if _, ok := formatterFuncs[name]; ok {
		return errorAliasReserved(name)
	}
	if _, ok := formatterFuncsParameterized[name]; ok {
		return errorAliasReserved(name)
	}
	formatterFuncsParameterized[name] = creator
	return nil
}

// formatter is used to write messages in a specific format, inserting such additional data
// as log level, date/time, etc.
type formatter struct {
	fmtStringOriginal string
	fmtString         string
	formatterFuncs    []FormatterFunc
}

// newFormatter creates a new formatter using a format string
func newFormatter(formatString string) (*formatter, error) {
	newformatter := new(formatter)
	newformatter.fmtStringOriginal = formatString

	err := newformatter.buildFormatterFuncs()
	if err != nil {
		return nil, err
	}

	return newformatter, nil
}

func (formatter *formatter) buildFormatterFuncs() error {
	formatter.formatterFuncs = make([]FormatterFunc, 0)
	var fmtString string
	for i := 0; i < len(formatter.fmtStringOriginal); i++ {
		char := formatter.fmtStringOriginal[i]
		if char != FormatterSymbol {
			fmtString += string(char)
			continue
		}

		isEndOfStr := i == len(formatter.fmtStringOriginal)-1
		if isEndOfStr {
			return fmt.Errorf("format error: %v - last symbol", formatterSymbolString)
		}

		isDoubledFormatterSymbol := formatter.fmtStringOriginal[i+1] == FormatterSymbol
		if isDoubledFormatterSymbol {
			fmtString += formatterSymbolString
			i++
			continue
		}

		function, nextI, err := formatter.extractFormatterFunc(i + 1)
		if err != nil {
			return err
		}

		fmtString += "%v"
		i = nextI
		formatter.formatterFuncs = append(formatter.formatterFuncs, function)
	}

	formatter.fmtString = fmtString
	return nil
}

func (formatter *formatter) extractFormatterFunc(index int) (FormatterFunc, int, error) {
	letterSequence := formatter.extractLetterSequence(index)
	if len(letterSequence) == 0 {
		return nil, 0, fmt.Errorf("format error: lack of formatter after %v. At %v", formatterSymbolString, index)
	}

	function, formatterLength, ok := formatter.findFormatterFunc(letterSequence)
	if ok {
		return function, index + formatterLength - 1, nil
	}

	function, formatterLength, ok = formatter.findFormatterFuncParametrized(letterSequence, index)
	if ok {
		return function, index + formatterLength - 1, nil
	}

	return nil, 0, errors.New("format error: unrecognized formatter at " + strconv.Itoa(index) + ": " + letterSequence)
}

func (formatter *formatter) extractLetterSequence(index int) string {
	letters := ""

	bytesToParse := []byte(formatter.fmtStringOriginal[index:])
	runeCount := utf8.RuneCount(bytesToParse)
	for i := 0; i < runeCount; i++ {
		rune, runeSize := utf8.DecodeRune(bytesToParse)
		bytesToParse = bytesToParse[runeSize:]

		if unicode.IsLetter(rune) {
			letters += string(rune)
		} else {
			break
		}
	}
	return letters
}

func (formatter *formatter) findFormatterFunc(letters string) (FormatterFunc, int, bool) {
	currentVerb := letters
	for i := 0; i < len(letters); i++ {
		function, ok := formatterFuncs[currentVerb]
		if ok {
			return function, len(currentVerb), ok
		}
		currentVerb = currentVerb[:len(currentVerb)-1]
	}

	return nil, 0, false
}

func (formatter *formatter) findFormatterFuncParametrized(letters string, lettersStartIndex int) (FormatterFunc, int, bool) {
	currentVerb := letters
	for i := 0; i < len(letters); i++ {
		functionCreator, ok := formatterFuncsParameterized[currentVerb]
		if ok {
			paramter := ""
			parameterLen := 0
			isVerbEqualsLetters := i == 0 // if not, then letter goes after formatter, and formatter is parameterless
			if isVerbEqualsLetters {
				userParamter := ""
				userParamter, parameterLen, ok = formatter.findparameter(lettersStartIndex + len(currentVerb))
				if ok {
					paramter = userParamter
				}
			}

			return functionCreator(paramter), len(currentVerb) + parameterLen, true
		}

		currentVerb = currentVerb[:len(currentVerb)-1]
	}

	return nil, 0, false
}

func (formatter *formatter) findparameter(startIndex int) (string, int, bool) {
	if len(formatter.fmtStringOriginal) == startIndex || formatter.fmtStringOriginal[startIndex] != formatterParameterStart {
		return "", 0, false
	}

	endIndex := strings.Index(formatter.fmtStringOriginal[startIndex:], string(formatterParameterEnd)) + startIndex
	if endIndex == -1 {
		return "", 0, false
	}

	length := endIndex - startIndex + 1

	return formatter.fmtStringOriginal[startIndex+1 : endIndex], length, true
}

// Format processes a message with special formatters, log level, and context. Returns formatted string
// with all formatter identifiers changed to appropriate values.
func (formatter *formatter) Format(message string, level LogLevel, context LogContextInterface) string {
	if len(formatter.formatterFuncs) == 0 {
		return formatter.fmtString
	}

	params := make([]interface{}, len(formatter.formatterFuncs))
	for i, function := range formatter.formatterFuncs {
		params[i] = function(message, level, context)
	}

	return fmt.Sprintf(formatter.fmtString, params...)
}

func (formatter *formatter) String() string {
	return formatter.fmtStringOriginal
}

//=====================================================

const (
	wrongLogLevel   = "WRONG_LOGLEVEL"
	wrongEscapeCode = "WRONG_ESCAPE"
)

var levelToString = map[LogLevel]string{
	TraceLvl:    "Trace",
	DebugLvl:    "Debug",
	InfoLvl:     "Info",
	WarnLvl:     "Warn",
	ErrorLvl:    "Error",
	CriticalLvl: "Critical",
	Off:         "Off",
}

var levelToShortString = map[LogLevel]string{
	TraceLvl:    "Trc",
	DebugLvl:    "Dbg",
	InfoLvl:     "Inf",
	WarnLvl:     "Wrn",
	ErrorLvl:    "Err",
	CriticalLvl: "Crt",
	Off:         "Off",
}

var levelToShortestString = map[LogLevel]string{
	TraceLvl:    "t",
	DebugLvl:    "d",
	InfoLvl:     "i",
	WarnLvl:     "w",
	ErrorLvl:    "e",
	CriticalLvl: "c",
	Off:         "o",
}

func formatterLevel(message string, level LogLevel, context LogContextInterface) interface{} {
	levelStr, ok := levelToString[level]
	if !ok {
		return wrongLogLevel
	}
	return levelStr
}

func formatterLev(message string, level LogLevel, context LogContextInterface) interface{} {
	levelStr, ok := levelToShortString[level]
	if !ok {
		return wrongLogLevel
	}
	return levelStr
}

func formatterLEVEL(message string, level LogLevel, context LogContextInterface) interface{} {
	return strings.ToTitle(formatterLevel(message, level, context).(string))
}

func formatterLEV(message string, level LogLevel, context LogContextInterface) interface{} {
	return strings.ToTitle(formatterLev(message, level, context).(string))
}

func formatterl(message string, level LogLevel, context LogContextInterface) interface{} {
	levelStr, ok := levelToShortestString[level]
	if !ok {
		return wrongLogLevel
	}
	return levelStr
}

func formatterMsg(message string, level LogLevel, context LogContextInterface) interface{} {
	return message
}

func formatterFullPath(message string, level LogLevel, context LogContextInterface) interface{} {
	return context.FullPath()
}

func formatterFile(message string, level LogLevel, context LogContextInterface) interface{} {
	return context.FileName()
}

func formatterRelFile(message string, level LogLevel, context LogContextInterface) interface{} {
	return context.ShortPath()
}

func FormatterFunction(message string, level LogLevel, context LogContextInterface) interface{} {
	return context.Func()
}

func FormatterFunctionShort(message string, level LogLevel, context LogContextInterface) interface{} {
	f := context.Func()
	spl := strings.Split(f, ".")
	return spl[len(spl)-1]
}

func formatterLine(message string, level LogLevel, context LogContextInterface) interface{} {
	return context.Line()
}

func formatterTime(message string, level LogLevel, context LogContextInterface) interface{} {
	return context.CallTime().Format(TimeFormat)
}

func formatterUTCTime(message string, level LogLevel, context LogContextInterface) interface{} {
	return context.CallTime().UTC().Format(TimeFormat)
}

func formatterNs(message string, level LogLevel, context LogContextInterface) interface{} {
	return context.CallTime().UnixNano()
}

func formatterUTCNs(message string, level LogLevel, context LogContextInterface) interface{} {
	return context.CallTime().UTC().UnixNano()
}

func formattern(message string, level LogLevel, context LogContextInterface) interface{} {
	return "\n"
}

func formattert(message string, level LogLevel, context LogContextInterface) interface{} {
	return "\t"
}

func createDateTimeFormatterFunc(dateTimeFormat string) FormatterFunc {
	format := dateTimeFormat
	if format == "" {
		format = DateDefaultFormat
	}
	return func(message string, level LogLevel, context LogContextInterface) interface{} {
		return context.CallTime().Format(format)
	}
}

func createUTCDateTimeFormatterFunc(dateTimeFormat string) FormatterFunc {
	format := dateTimeFormat
	if format == "" {
		format = DateDefaultFormat
	}
	return func(message string, level LogLevel, context LogContextInterface) interface{} {
		return context.CallTime().UTC().Format(format)
	}
}

func createANSIEscapeFunc(escapeCodeString string) FormatterFunc {
	return func(message string, level LogLevel, context LogContextInterface) interface{} {
		if len(escapeCodeString) == 0 {
			return wrongEscapeCode
		}

		return fmt.Sprintf("%c[%sm", 0x1B, escapeCodeString)
	}
}