text:
package org.apache.shindig.social.websockbackend.model.dto;

import java.util.Map;

import org.apache.shindig.social.opensocial.model.Address;
import org.apache.shindig.social.opensocial.model.MediaItem;

/**
 * Data transfer object containing media item information.
 */
public class MediaItemDTO extends ADataTransferObject implements MediaItem {
  private static final String MIME_TYPE_FIELD = MediaItem.Field.MIME_TYPE.toString();
  private static final String TYPE_FIELD = MediaItem.Field.TYPE.toString();
  private static final String URL_FIELD = MediaItem.Field.URL.toString();
  private static final String THUMB_FIELD = MediaItem.Field.THUMBNAIL_URL.toString();
  private static final String ALBUM_ID_FIELD = MediaItem.Field.ALBUM_ID.toString();
  private static final String CREATED_FIELD = MediaItem.Field.CREATED.toString();
  private static final String DESCRIPTION_FIELD = MediaItem.Field.DESCRIPTION.toString();
  private static final String DURATION_FIELD = MediaItem.Field.DURATION.toString();
  private static final String SIZE_FIELD = MediaItem.Field.FILE_SIZE.toString();
  private static final String ID_FIELD = MediaItem.Field.ID.toString();
  private static final String LANGUAGE_FIELD = MediaItem.Field.LANGUAGE.toString();
  private static final String UPDATED_FIELD = MediaItem.Field.LAST_UPDATED.toString();
  private static final String NUM_COMM_FIELD = MediaItem.Field.NUM_COMMENTS.toString();
  private static final String NUM_VIEWS_FIELD = MediaItem.Field.NUM_VIEWS.toString();
  private static final String NUM_VOTES_FIELD = MediaItem.Field.NUM_VOTES.toString();
  private static final String RATING_FIELD = MediaItem.Field.RATING.toString();
  private static final String START_TIME_FIELD = MediaItem.Field.START_TIME.toString();
  private static final String TAGGED_FIELD = MediaItem.Field.TAGGED_PEOPLE.toString();
  private static final String TAGS_FIELD = MediaItem.Field.TAGS.toString();
  private static final String TITLE_FIELD = MediaItem.Field.TITLE.toString();

  private static final String LOCATION_FIELD = MediaItem.Field.LOCATION.toString();

  /**
   * Creates an empty media item data transfer object.
   */
  public MediaItemDTO() {
    super();
  }

  /**
   * Creates a media item data transfer object using the given map for internal property storage.
   * The given map must not be null.
   *
   * @param props
   *          map to use for property storage
   */
  public MediaItemDTO(Map<String, Object> props) {
    super(props);
  }

  public String getMimeType() {
    String mimeType = null;
    final Object value = this.fProperties.get(MediaItemDTO.MIME_TYPE_FIELD);

    if (value != null) {
      mimeType = (String) value;
    }

    return mimeType;
  }

  public void setMimeType(String mimeType) {
    this.fProperties.put(MediaItemDTO.MIME_TYPE_FIELD, mimeType);
  }

  public Type getType() {
    Type type = null;
    String typeString = null;
    final Object value = this.fProperties.get(MediaItemDTO.TYPE_FIELD);

    if (value != null) {
      typeString = (String) value;
      type = Type.valueOf(typeString);
    }

    return type;
  }

  public void setType(Type type) {
    if (type != null) {
      this.fProperties.put(MediaItemDTO.TYPE_FIELD, type.name());
    } else {
      this.fProperties.put(MediaItemDTO.TYPE_FIELD, null);
    }
  }

  public String getUrl() {
    String url = null;
    final Object value = this.fProperties.get(MediaItemDTO.URL_FIELD);

    if (value != null) {
      url = (String) value;
    }

    return url;
  }

  public void setUrl(String url) {
    this.fProperties.put(MediaItemDTO.URL_FIELD, url);
  }

  public String getThumbnailUrl() {
    String tUrl = null;
    final Object value = this.fProperties.get(MediaItemDTO.THUMB_FIELD);

    if (value != null) {
      tUrl = (String) value;
    }

    return tUrl;
  }

  public void setThumbnailUrl(String url) {
    this.fProperties.put(MediaItemDTO.THUMB_FIELD, url);
  }

  public String getAlbumId() {
    String albumId = null;
    final Object value = this.fProperties.get(MediaItemDTO.ALBUM_ID_FIELD);

    if (value != null) {
      albumId = (String) value;
    }

    return albumId;
  }

  public void setAlbumId(String albumId) {
    this.fProperties.put(MediaItemDTO.ALBUM_ID_FIELD, albumId);
  }

  public String getCreated() {
    String created = null;
    final Object value = this.fProperties.get(MediaItemDTO.CREATED_FIELD);

    if (value != null) {
      created = (String) value;
    }

    return created;
  }

  public void setCreated(String created) {
    this.fProperties.put(MediaItemDTO.CREATED_FIELD, created);
  }

  public String getDescription() {
    String description = null;
    final Object value = this.fProperties.get(MediaItemDTO.DESCRIPTION_FIELD);

    if (value != null) {
      description = (String) value;
    }

    return description;
  }

  public void setDescription(String description) {
    this.fProperties.put(MediaItemDTO.DESCRIPTION_FIELD, description);
  }

  public String getDuration() {
    String duration = null;
    final Object value = this.fProperties.get(MediaItemDTO.DURATION_FIELD);

    if (value != null) {
      duration = (String) value;
    }

    return duration;
  }

  public void setDuration(String duration) {
    this.fProperties.put(MediaItemDTO.DURATION_FIELD, duration);
  }

  public String getFileSize() {
    String fileSize = null;
    final Object value = this.fProperties.get(MediaItemDTO.SIZE_FIELD);

    if (value != null) {
      fileSize = (String) value;
    }

    return fileSize;
  }

  public void setFileSize(String fileSize) {
    this.fProperties.put(MediaItemDTO.SIZE_FIELD, fileSize);
  }

  public String getId() {
    String id = null;
    final Object value = this.fProperties.get(MediaItemDTO.ID_FIELD);

    if (value != null) {
      id = (String) value;
    }

    return id;
  }

  public void setId(String id) {
    this.fProperties.put(MediaItemDTO.ID_FIELD, id);
  }

  public String getLanguage() {
    String language = null;
    final Object value = this.fProperties.get(MediaItemDTO.LANGUAGE_FIELD);

    if (value != null) {
      language = (String) value;
    }

    return language;
  }

  public void setLanguage(String language) {
    this.fProperties.put(MediaItemDTO.LANGUAGE_FIELD, language);
  }

  public String getLastUpdated() {
    String updated = null;
    final Object value = this.fProperties.get(MediaItemDTO.UPDATED_FIELD);

    if (value != null) {
      updated = (String) value;
    }

    return updated;
  }

  public void setLastUpdated(String lastUpdated) {
    this.fProperties.put(MediaItemDTO.UPDATED_FIELD, lastUpdated);
  }

  public Address getLocation() {
    AddressDTO add = null;

    @SuppressWarnings("unchecked")
    final Map<String, Object> locMap = (Map<String, Object>) this.fProperties
            .get(MediaItemDTO.LOCATION_FIELD);

    if (locMap != null) {
      add = new AddressDTO(locMap);
    }

    return add;
  }

  public void setLocation(Address location) {
    // TODO: set map implementation
    if (location != null) {
      AddressDTO dto = null;

      if (location instanceof AddressDTO) {
        dto = (AddressDTO) location;
      } else {
        dto = new AddressDTO();
        dto.setData(location);
      }

      this.fProperties.put(MediaItemDTO.LOCATION_FIELD, dto.propertyMap());
    } else {
      this.fProperties.put(MediaItemDTO.LOCATION_FIELD, null);
    }
  }

  public String getNumComments() {
    String comments = null;
    final Object value = this.fProperties.get(MediaItemDTO.NUM_COMM_FIELD);

    if (value != null) {
      comments = (String) value;
    }

    return comments;
  }

  public void setNumComments(String numComments) {
    this.fProperties.put(MediaItemDTO.NUM_COMM_FIELD, numComments);
  }

  public String getNumViews() {
    String views = null;
    final Object value = this.fProperties.get(MediaItemDTO.NUM_VIEWS_FIELD);

    if (value != null) {
      views = (String) value;
    }

    return views;
  }

  public void setNumViews(String numViews) {
    this.fProperties.put(MediaItemDTO.NUM_VIEWS_FIELD, numViews);
  }

  public String getNumVotes() {
    String votes = null;
    final Object value = this.fProperties.get(MediaItemDTO.NUM_VOTES_FIELD);

    if (value != null) {
      votes = (String) value;
    }

    return votes;
  }

  public void setNumVotes(String numVotes) {
    this.fProperties.put(MediaItemDTO.NUM_VOTES_FIELD, numVotes);
  }

  public String getRating() {
    String rating = null;
    final Object value = this.fProperties.get(MediaItemDTO.RATING_FIELD);

    if (value != null) {
      rating = (String) value;
    }

    return rating;
  }

  public void setRating(String rating) {
    this.fProperties.put(MediaItemDTO.RATING_FIELD, rating);
  }

  public String getStartTime() {
    String startTime = null;
    final Object value = this.fProperties.get(MediaItemDTO.START_TIME_FIELD);

    if (value != null) {
      startTime = (String) value;
    }

    return startTime;
  }

  public void setStartTime(String startTime) {
    this.fProperties.put(MediaItemDTO.START_TIME_FIELD, startTime);
  }

  public String getTaggedPeople() {
    String tagPeople = null;
    final Object value = this.fProperties.get(MediaItemDTO.TAGGED_FIELD);

    if (value != null) {
      tagPeople = (String) value;
    }

    return tagPeople;
  }

  public void setTaggedPeople(String taggedPeople) {
    this.fProperties.put(MediaItemDTO.TAGGED_FIELD, taggedPeople);
  }

  public String getTags() {
    String tags = null;
    final Object value = this.fProperties.get(MediaItemDTO.TAGS_FIELD);

    if (value != null) {
      tags = (String) value;
    }

    return tags;
  }

  public void setTags(String tags) {
    this.fProperties.put(MediaItemDTO.TAGS_FIELD, tags);
  }

  public String getTitle() {
    String title = null;
    final Object value = this.fProperties.get(MediaItemDTO.TITLE_FIELD);

    if (value != null) {
      title = (String) value;
    }

    return title;
  }

  public void setTitle(String title) {
    this.fProperties.put(MediaItemDTO.TITLE_FIELD, title);
  }

  /**
   * Sets the properties of this data transfer object to those of the given object. If the given
   * Object is null, all data is cleared.
   *
   * @param mediaItem
   *          media item object containing the data to set
   */
  public void setData(final MediaItem mediaItem) {
    if (mediaItem == null) {
      this.fProperties.clear();
      return;
    }

    this.fProperties.put(MediaItemDTO.ALBUM_ID_FIELD, mediaItem.getAlbumId());
    this.fProperties.put(MediaItemDTO.CREATED_FIELD, mediaItem.getCreated());
    this.fProperties.put(MediaItemDTO.DESCRIPTION_FIELD, mediaItem.getDescription());
    this.fProperties.put(MediaItemDTO.DURATION_FIELD, mediaItem.getDuration());
    this.fProperties.put(MediaItemDTO.ID_FIELD, mediaItem.getId());
    this.fProperties.put(MediaItemDTO.LANGUAGE_FIELD, mediaItem.getLanguage());

    this.setLocation(mediaItem.getLocation());

    this.fProperties.put(MediaItemDTO.MIME_TYPE_FIELD, mediaItem.getMimeType());
    this.fProperties.put(MediaItemDTO.NUM_COMM_FIELD, mediaItem.getNumComments());
    this.fProperties.put(MediaItemDTO.NUM_VIEWS_FIELD, mediaItem.getNumViews());
    this.fProperties.put(MediaItemDTO.NUM_VOTES_FIELD, mediaItem.getNumVotes());
    this.fProperties.put(MediaItemDTO.RATING_FIELD, mediaItem.getRating());
    this.fProperties.put(MediaItemDTO.SIZE_FIELD, mediaItem.getFileSize());
    this.fProperties.put(MediaItemDTO.START_TIME_FIELD, mediaItem.getStartTime());
    this.fProperties.put(MediaItemDTO.TAGGED_FIELD, mediaItem.getTaggedPeople());
    this.fProperties.put(MediaItemDTO.TAGS_FIELD, mediaItem.getTags());
    this.fProperties.put(MediaItemDTO.THUMB_FIELD, mediaItem.getThumbnailUrl());
    this.fProperties.put(MediaItemDTO.TITLE_FIELD, mediaItem.getTitle());

    this.setType(mediaItem.getType());

    this.fProperties.put(MediaItemDTO.UPDATED_FIELD, mediaItem.getLastUpdated());
    this.fProperties.put(MediaItemDTO.URL_FIELD, mediaItem.getUrl());
  }
}


text:
#include "HTTPSocket.h"
#include "Group.h"
#include "Extensions.h"
#include <cstdio>

#define MAX_HEADERS 100
#define MAX_HEADER_BUFFER_SIZE 4096
#define FORCE_SLOW_PATH false

#include <iostream>

namespace uWS {

// UNSAFETY NOTE: assumes *end == '\r' (might unref end pointer)
char *getHeaders(char *buffer, char *end, Header *headers, size_t maxHeaders) {
    for (unsigned int i = 0; i < maxHeaders; i++) {
        for (headers->key = buffer; (*buffer != ':') & (*buffer > 32); *(buffer++) |= 32);
        if (*buffer == '\r') {
            if ((buffer != end) & (buffer[1] == '\n') & (i > 0)) {
                headers->key = nullptr;
                return buffer + 2;
            } else {
                return nullptr;
            }
        } else {
            headers->keyLength = buffer - headers->key;
            for (buffer++; (*buffer == ':' || *buffer < 33) && *buffer != '\r'; buffer++);
            headers->value = buffer;
            buffer = (char *) memchr(buffer, '\r', end - buffer); //for (; *buffer != '\r'; buffer++);
            if (buffer /*!= end*/ && buffer[1] == '\n') {
                headers->valueLength = buffer - headers->value;
                buffer += 2;
                headers++;
            } else {
                return nullptr;
            }
        }
    }
    return nullptr;
}

// UNSAFETY NOTE: assumes 24 byte input length
static void base64(unsigned char *src, char *dst) {
    static const char *b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
    for (int i = 0; i < 18; i += 3) {
        *dst++ = b64[(src[i] >> 2) & 63];
        *dst++ = b64[((src[i] & 3) << 4) | ((src[i + 1] & 240) >> 4)];
        *dst++ = b64[((src[i + 1] & 15) << 2) | ((src[i + 2] & 192) >> 6)];
        *dst++ = b64[src[i + 2] & 63];
    }
    *dst++ = b64[(src[18] >> 2) & 63];
    *dst++ = b64[((src[18] & 3) << 4) | ((src[19] & 240) >> 4)];
    *dst++ = b64[((src[19] & 15) << 2)];
    *dst++ = '=';
}

template <bool isServer>
void HttpSocket<isServer>::onData(uS::Socket s, char *data, int length) {
    HttpSocket httpSocket(s);
    HttpSocket::Data *httpData = httpSocket.getData();

    httpSocket.cork(true);

    if (httpData->contentLength) {
        httpData->missedDeadline = false;
        if (httpData->contentLength >= length) {
            getGroup<isServer>(s)->httpDataHandler(httpData->outstandingResponsesTail, data, length, httpData->contentLength -= length);
            return;
        } else {
            getGroup<isServer>(s)->httpDataHandler(httpData->outstandingResponsesTail, data, httpData->contentLength, 0);
            data += httpData->contentLength;
            length -= httpData->contentLength;
            httpData->contentLength = 0;
        }
    }

    if (FORCE_SLOW_PATH || httpData->httpBuffer.length()) {
        if (httpData->httpBuffer.length() + length > MAX_HEADER_BUFFER_SIZE) {
            httpSocket.onEnd(s);
            return;
        }

        httpData->httpBuffer.reserve(httpData->httpBuffer.length() + length + WebSocketProtocol<uWS::CLIENT>::CONSUME_POST_PADDING);
        httpData->httpBuffer.append(data, length);
        data = (char *) httpData->httpBuffer.data();
        length = httpData->httpBuffer.length();
    }

    char *end = data + length;
    char *cursor = data;
    *end = '\r';
    Header headers[MAX_HEADERS];
    do {
        char *lastCursor = cursor;
        if ((cursor = getHeaders(cursor, end, headers, MAX_HEADERS))) {
            HttpRequest req(headers);

            if (isServer) {
                headers->valueLength = std::max<int>(0, headers->valueLength - 9);
                httpData->missedDeadline = false;
                if (req.getHeader("upgrade", 7)) {
                    if (getGroup<SERVER>(s)->httpUpgradeHandler) {
                        getGroup<SERVER>(s)->httpUpgradeHandler(HttpSocket<isServer>(s), req);
                    } else {
                        Header secKey = req.getHeader("sec-websocket-key", 17);
                        Header extensions = req.getHeader("sec-websocket-extensions", 24);
                        Header subprotocol = req.getHeader("sec-websocket-protocol", 22);
                        if (secKey.valueLength == 24) {
                            bool perMessageDeflate;
                            httpSocket.upgrade(secKey.value, extensions.value, extensions.valueLength,
                                               subprotocol.value, subprotocol.valueLength, &perMessageDeflate);
                            getGroup<SERVER>(s)->removeHttpSocket(s);
                            s.enterState<WebSocket<SERVER>>(new WebSocket<SERVER>::Data(perMessageDeflate, httpData));
                            getGroup<SERVER>(s)->addWebSocket(s);
                            s.cork(true);
                            getGroup<SERVER>(s)->connectionHandler(WebSocket<SERVER>(s), req);
                            s.cork(false);
                            delete httpData;
                        } else {
                            httpSocket.onEnd(s);
                        }
                    }
                    return;
                } else {
                    if (getGroup<SERVER>(s)->httpRequestHandler) {

                        HttpResponse *res = HttpResponse::allocateResponse(httpSocket, httpData);
                        if (httpData->outstandingResponsesTail) {
                            httpData->outstandingResponsesTail->next = res;
                        } else {
                            httpData->outstandingResponsesHead = res;
                        }
                        httpData->outstandingResponsesTail = res;

                        Header contentLength;
                        if (req.getMethod() != HttpMethod::METHOD_GET && (contentLength = req.getHeader("content-length", 14))) {
                            httpData->contentLength = atoi(contentLength.value);
                            size_t bytesToRead = std::min<int>(httpData->contentLength, end - cursor);
                            getGroup<SERVER>(s)->httpRequestHandler(res, req, cursor, bytesToRead, httpData->contentLength -= bytesToRead);
                            cursor += bytesToRead;
                        } else {
                            getGroup<SERVER>(s)->httpRequestHandler(res, req, nullptr, 0, 0);
                        }

                        if (s.isClosed() || s.isShuttingDown()) {
                            return;
                        }
                    } else {
                        httpSocket.onEnd(s);
                        return;
                    }
                }
            } else {
                if (req.getHeader("upgrade", 7)) {
                    s.enterState<WebSocket<CLIENT>>(new WebSocket<CLIENT>::Data(false, httpData));

                    httpSocket.cancelTimeout();
                    httpSocket.setUserData(httpData->httpUser);
                    getGroup<CLIENT>(s)->addWebSocket(s);
                    s.cork(true);
                    getGroup<CLIENT>(s)->connectionHandler(WebSocket<CLIENT>(s), req);
                    s.cork(false);

                    if (!(s.isClosed() || s.isShuttingDown())) {
                        WebSocketProtocol<CLIENT> *kws = (WebSocketProtocol<CLIENT> *) ((WebSocket<CLIENT>::Data *) s.getSocketData());
                        kws->consume(cursor, end - cursor, s);
                    }

                    delete httpData;
                } else {
                    httpSocket.onEnd(s);
                }
                return;
            }
        } else {
            if (!httpData->httpBuffer.length()) {
                if (length > MAX_HEADER_BUFFER_SIZE) {
                    httpSocket.onEnd(s);
                } else {
                    httpData->httpBuffer.append(lastCursor, end - lastCursor);
                }
            }
            return;
        }
    } while(cursor != end);

    httpSocket.cork(false);
    httpData->httpBuffer.clear();
}

// todo: make this into a transformer and make use of sendTransformed
template <bool isServer>
void HttpSocket<isServer>::upgrade(const char *secKey, const char *extensions, size_t extensionsLength,
                                   const char *subprotocol, size_t subprotocolLength, bool *perMessageDeflate) {

    uS::SocketData::Queue::Message *messagePtr;

    if (isServer) {
        *perMessageDeflate = false;
        std::string extensionsResponse;
        if (extensionsLength) {
            Group<isServer> *group = getGroup<isServer>(*this);
            ExtensionsNegotiator<uWS::SERVER> extensionsNegotiator(group->extensionOptions);
            extensionsNegotiator.readOffer(std::string(extensions, extensionsLength));
            extensionsResponse = extensionsNegotiator.generateOffer();
            if (extensionsNegotiator.getNegotiatedOptions() & PERMESSAGE_DEFLATE) {
                *perMessageDeflate = true;
            }
        }

        unsigned char shaInput[] = "XXXXXXXXXXXXXXXXXXXXXXXX258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
        memcpy(shaInput, secKey, 24);
        unsigned char shaDigest[SHA_DIGEST_LENGTH];
        SHA1(shaInput, sizeof(shaInput) - 1, shaDigest);

        char upgradeBuffer[1024];
        memcpy(upgradeBuffer, "HTTP/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: ", 97);
        base64(shaDigest, upgradeBuffer + 97);
        memcpy(upgradeBuffer + 125, "\r\n", 2);
        size_t upgradeResponseLength = 127;
        if (extensionsResponse.length()) {
            memcpy(upgradeBuffer + upgradeResponseLength, "Sec-WebSocket-Extensions: ", 26);
            memcpy(upgradeBuffer + upgradeResponseLength + 26, extensionsResponse.data(), extensionsResponse.length());
            memcpy(upgradeBuffer + upgradeResponseLength + 26 + extensionsResponse.length(), "\r\n", 2);
            upgradeResponseLength += 26 + extensionsResponse.length() + 2;
        }
        if (subprotocolLength) {
            memcpy(upgradeBuffer + upgradeResponseLength, "Sec-WebSocket-Protocol: ", 24);
            memcpy(upgradeBuffer + upgradeResponseLength + 24, subprotocol, subprotocolLength);
            memcpy(upgradeBuffer + upgradeResponseLength + 24 + subprotocolLength, "\r\n", 2);
            upgradeResponseLength += 24 + subprotocolLength + 2;
        }
        static char stamp[] = "Sec-WebSocket-Version: 13\r\nWebSocket-Server: uWebSockets\r\n\r\n";
        memcpy(upgradeBuffer + upgradeResponseLength, stamp, sizeof(stamp) - 1);
        upgradeResponseLength += sizeof(stamp) - 1;

        messagePtr = allocMessage(upgradeResponseLength, upgradeBuffer);
    } else {
        messagePtr = allocMessage(getData()->httpBuffer.length(), getData()->httpBuffer.data());
        getData()->httpBuffer.clear();
    }

    bool wasTransferred;
    if (write(messagePtr, wasTransferred)) {
        if (!wasTransferred) {
            freeMessage(messagePtr);
        } else {
            messagePtr->callback = nullptr;
        }
    } else {
        freeMessage(messagePtr);
    }
}

template <bool isServer>
void HttpSocket<isServer>::onEnd(uS::Socket s) {
    if (!s.isShuttingDown()) {
        if (isServer) {
            getGroup<isServer>(s)->removeHttpSocket(HttpSocket<isServer>(s));
            getGroup<isServer>(s)->httpDisconnectionHandler(HttpSocket<isServer>(s));
        }
    } else {
        s.cancelTimeout();
    }

    Data *httpSocketData = (Data *) s.getSocketData();

    s.close();

    while (!httpSocketData->messageQueue.empty()) {
        uS::SocketData::Queue::Message *message = httpSocketData->messageQueue.front();
        if (message->callback) {
            message->callback(nullptr, message->callbackData, true, nullptr);
        }
        httpSocketData->messageQueue.pop();
    }

    while (httpSocketData->outstandingResponsesHead) {
        getGroup<isServer>(s)->httpCancelledRequestHandler(httpSocketData->outstandingResponsesHead);
        HttpResponse *next = httpSocketData->outstandingResponsesHead->next;
        delete httpSocketData->outstandingResponsesHead;
        httpSocketData->outstandingResponsesHead = next;
    }

    if (httpSocketData->preAllocatedResponse) {
        delete httpSocketData->preAllocatedResponse;
    }

    if (!isServer) {
        s.cancelTimeout();
        getGroup<CLIENT>(s)->errorHandler(httpSocketData->httpUser);
    }

    delete httpSocketData;
}

template struct HttpSocket<SERVER>;
template struct HttpSocket<CLIENT>;

}

redpajama_set_name: RedPajamaGithub


text:
#ifndef RLE_H
#define RLE_H

#include "util.h"

/* Encode the data using a run-length encoding such that a sequence of two
 * identical symbols is followed by a repeat length. A pointer to the newly
 * allocated output array is passed to *output and its length is returned.
 */
size_t rle(symbol *data, symbol **output, size_t length, size_t symbols);

/* Decode the data encoded using the run-length encoding. A pointer to
 * the newly allocated output array is passed to *output and its length is
 * returned.
 */
size_t unrle(symbol *data, symbol **output, size_t length, size_t symbols);

#endif


text:
package prefilter

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"net/http"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime/middleware"
)

// NewGetPrefilterParams creates a new GetPrefilterParams object
// no default values defined in spec.
func NewGetPrefilterParams() GetPrefilterParams {

	return GetPrefilterParams{}
}

// GetPrefilterParams contains all the bound params for the get prefilter operation
// typically these are obtained from a http.Request
//
// swagger:parameters GetPrefilter
type GetPrefilterParams struct {

	// HTTP Request Object
	HTTPRequest *http.Request `json:"-"`
}

// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewGetPrefilterParams() beforehand.
func (o *GetPrefilterParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
	var res []error

	o.HTTPRequest = r

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}


text:
package com.udacity.silver.grading;

public class ClassCode {

    private final String code;

    public ClassCode(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }
}


text:
package de.mround.searchbooster.api.xml;

import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

/**
 * RequestIndexBuilder builds XML-Requests of type Index, defined in the
 * build-in XML-Schema (see {@link SearchBoosterXML#getSchema()}).
 *
 * @author Kai Torben Ohlhus
 */
public final class RequestIndexBuilder {

    /**
     * Private constructor avoids instantiation.
     */
    private RequestIndexBuilder() {
    }

    /**
     * This method creates a new Document skeleton for all possible flavors of
     * Requests for the index.
     *
     * @return a new Document skeleton for all possible flavors of Requests for
     *         the index
     * @throws ParserConfigurationException
     *             if the
     *             {@link javax.xml.parsers.DocumentBuilderFactory#newInstance()}
     *             implementation is not available or cannot be instantiated.
     */
    protected static Document create() throws ParserConfigurationException {
	Document document = RequestBuilder.create();

	Element Index = document.createElement("Index");
	document.getElementsByTagName("Request").item(0).appendChild(Index);

	return document;
    }
}


text:
package com.vzome.core.construction;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

import com.vzome.core.algebra.AlgebraicField;
import com.vzome.core.algebra.AlgebraicVector;

/**
 * @author Scott Vorthmann
 */
public abstract class Point extends Construction
{
    private AlgebraicVector mLocation;

    protected Point( AlgebraicField field )
    {
        super( field );
    }

    protected boolean setStateVariable( AlgebraicVector loc, boolean impossible )
    {
        if ( impossible ) {
            // don't attempt to access other params
            if ( isImpossible() )
                return false;
            setImpossible( true );
            return true;
        }
        if ( loc .equals( mLocation )
        && ! isImpossible() )
            return false;
        mLocation = loc;
        setImpossible( false );
        return true;
    }

    public AlgebraicVector getLocation()
    {
        return mLocation;
    }

    @Override
    public Element getXml( Document doc )
    {
        Element result = doc .createElement( "point" );
        result .setAttribute( "at", getLocation() .getVectorExpression( AlgebraicField .ZOMIC_FORMAT ) );
        return result;
    }

    @Override
    public String toString()
    {
        return "point at " + mLocation;
    }
}


text:
Nehan.Padding = (function(){
  /**
     @memberof Nehan
     @class Padding
     @classdesc abstraction of padding.
     @extends {Nehan.Edge}
  */
  function Padding(){
    Nehan.Edge.call(this, "padding");
  }
  Nehan.Class.extend(Padding, Nehan.Edge);

  /**
     @memberof Nehan.Padding
     @override
     @return {Nehan.Padding}
  */
  Padding.prototype.clone = function(){
    return this.copyTo(new Padding());
  };

  return Padding;
})();


text:
#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property float autoSizeScaleX;
@property float autoSizeScaleY;

@property (strong, nonatomic) UIWindow *window;

+ (instancetype)sharedAppDelegate;

- (void)NIMLoginAction;
-(void)NIMLoginout;
- (void)NIMLoginAutoAction;

@end


text:
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Dapper;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Zoxive.HttpLoadTesting.Client.Domain.GraphStats.Dtos;
using Zoxive.HttpLoadTesting.Client.Domain.GraphStats.Services;
using Zoxive.HttpLoadTesting.Client.Domain.HttpStatusResult.Repositories;
using Zoxive.HttpLoadTesting.Client.Framework.Model;

namespace Zoxive.HttpLoadTesting.Client.Pages
{
    public class LineGraphModel : PageModel
    {
        private readonly IGraphStatsService _graphStatsService;
        private readonly IResultRepository _resultRepository;

        public LineGraphModel(IGraphStatsService graphStatsService, IResultRepository resultRepository)
        {
            _graphStatsService = graphStatsService;
            _resultRepository = resultRepository;
        }

        public async Task OnGetAsync([FromQuery] Filters filters)
        {
            filters.Period ??= 1m;

            var graphStatus = _graphStatsService.Get(filters);
            var distincts = _resultRepository.GetDistincts(filters);

            await Task.WhenAll(graphStatus, distincts);

            GraphStatus = (await graphStatus).AsList();
            Distincts = await distincts;
            Filters = filters;
        }

        public HttpStatusResultDistincts? Distincts { get; private set;}
        public Filters? Filters { get; set; }
        public IReadOnlyList<GraphStatDto> GraphStatus { get; private set; } = ArraySegment<GraphStatDto>.Empty;
    }
}


text:
import java.io.BufferedReader;
import java.io.InputStreamReader;
import javax.naming.*;
import javax.jms.*;

public class MySender {
    public static void main(String[] args) {
        try
        {   //Create and start connection
            InitialContext ctx=new InitialContext();
            QueueConnectionFactory f=(QueueConnectionFactory)ctx.lookup("myQueueConnectionFactory");
            QueueConnection con=f.createQueueConnection();
            con.start();
            //2) create queue session
            QueueSession ses=con.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
            //3) get the Queue object
            Queue t=(Queue)ctx.lookup("myQueue");
            //4)create QueueSender object
            QueueSender sender=ses.createSender(t);
            //5) create TextMessage object
            TextMessage msg=ses.createTextMessage();

            //6) write message
            BufferedReader b=new BufferedReader(new InputStreamReader(System.in));
            while(true)
            {
                System.out.println("Enter Msg, end to terminate:");
                String s=b.readLine();
                if (s.equals("end"))
                    break;
                msg.setText(s);
                //7) send message
                sender.send(msg);
                System.out.println("Message successfully sent.");
            }
            //8) connection close
            con.close();
        }catch(Exception e){System.out.println(e);}
    }
}


text:
'denotes_[]'([static,dynamic]).

'denotes_$VAR'([dynamic]).

'denotes_.'([static,dynamic],[static,dynamic],[static,dynamic]).
'denotes_.'([dynamic],[static,dynamic],[dynamic]).
'denotes_.'([static,dynamic],[dynamic],[dynamic]).
'denotes_.'([dynamic],[dynamic],[dynamic]).


text:
using Umbraco.Cms.Core.Persistence.Repositories;
using Umbraco.Cms.Core.Scoping;

namespace Umbraco.Cms.Core.Services;

public class PropertyTypeUsageService : IPropertyTypeUsageService
{
    private readonly IPropertyTypeUsageRepository _propertyTypeUsageRepository;
    private readonly ICoreScopeProvider _scopeProvider;

    public PropertyTypeUsageService(
        IPropertyTypeUsageRepository propertyTypeUsageRepository,
        ICoreScopeProvider scopeProvider)
    {
        _propertyTypeUsageRepository = propertyTypeUsageRepository;
        _scopeProvider = scopeProvider;
    }

    /// <inheritdoc/>
    public bool HasSavedPropertyValues(string propertyTypeAlias)
    {
        using ICoreScope scope = _scopeProvider.CreateCoreScope(autoComplete: true);
        return _propertyTypeUsageRepository.HasSavedPropertyValues(propertyTypeAlias);
    }
}


text:
namespace System.ComponentModel.DataAnnotations
{
    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter,
        AllowMultiple = false)]
    public sealed class UrlAttribute : DataTypeAttribute
    {
        public UrlAttribute()
            : base(DataType.Url)
        {
            // Set DefaultErrorMessage not ErrorMessage, allowing user to set
            // ErrorMessageResourceType and ErrorMessageResourceName to use localized messages.
            DefaultErrorMessage = SR.UrlAttribute_Invalid;
        }

        public override bool IsValid(object value)
        {
            if (value == null)
            {
                return true;
            }

            return value is string valueAsString &&
                (valueAsString.StartsWith("http://", StringComparison.OrdinalIgnoreCase)
                || valueAsString.StartsWith("https://", StringComparison.OrdinalIgnoreCase)
                || valueAsString.StartsWith("ftp://", StringComparison.OrdinalIgnoreCase));
        }
    }
}


text:
                            <img
                            {{if logo_width}}
                            width="{{var logo_width}}"
                            {{else}}
                            width="165"
                            {{/if}}

                            {{if logo_height}}
                            height="{{var logo_height}}"
                            {{else}}
                            height="48"
                            {{/if}}

                            src="{{if logo_url}}{{var logo_url}}{{else}}{{skin url="images/logo_email.gif" _area='frontend'}}{{/if}}"
                            alt="{{var logo_alt}}"
                            border="0"/>

								Hello {{var customer.name}},

								your account has been activated.

								To log in when visiting our site just click Login or
								My Account at the top of every page, and then enter your e-mail address and password.

If you have any questions about your account or any other matter, please feel free to contact us at {{config path='trans_email/ident_support/email'}} or by phone at {{config path='general/store_information/phone'}}.

Thanks again!


text:
<!DOCTYPE HTML>

<title>CSS 2.1 Test Suite: Test for float placement rules (reference)</title>
<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org" />
<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />

H


text:
import os
import random

import dashie.core as base

@base.dashiefunc
async def d(message, client, *args, **kwargs):
    '''
    **{0}d** <*x*>d<*y*>
    Rolls <*x*> dice with <*y*> sides.
    *Example: `{0}d 2d6`*
    '''
    try:
        params = message.content.split()
        dice = int(params[1][:params[1].find('d')])
        sides = int(params[1][params[1].find('d') + 1:])

        if dice > 999 or sides > 999:
            await client.send_message(message.channel,
                                      ':no_entry_sign: One of your commands had more than three digits. I must ask you to limit this roll.')
        else:

            # Generate random numbers, append to list.
            rolls = []
            for x in range(0, dice):
                rolls.append(random.randint(1, sides))

            # If the list only has 1 die, just print that number.
            if len(rolls) == 1:
                await client.send_message(message.channel, '{}: {}'.format(message.author.display_name, str(rolls[0])))

            # Otherwise, print the list, and the list's sum.
            else:
                msg = '{}: {} | {} of possible {}'.format(
                    message.author.display_name,
                    str(rolls),
                    str(sum(rolls)),
                    str(dice * sides)
                )

                if len(msg) > 2000:
                    await client.send_message(message.channel,
                                              'The result for that roll ended up being more than 2000 characters, so I couldn\'t send it.')
                else:
                    await client.send_message(message.channel, msg)

    except (IndexError, ValueError):
        # user did not format command correctly
        await client.send_message(message.channel,
                                  '{}: You must specify the number of dice and the faces each dice has seperated with a d. For example: .d 1d6 rolls one six-sided die. .d 5d2 rolls 5 2-sided die.'.format(
                                      message.author.display_name))

@base.dashiefunc
async def choice(message, client):
    '''
    **{0}choice** [*one*; *two*...]
    Randomly choses an option from a semicolon-seperated list.
    *Example: `{0}choice CacoBot is Life; CacoBot is Love`*
    '''

    choices = message.content.split(None, 1)
    if len(choices) > 1:
        choices = choices[1].split(';')
        if len(choices) > 1:
            await client.send_message(message.channel,
                                      '{}: {}'.format(message.author.display_name, random.choice(choices).strip()))
        else:
            await client.send_message(message.channel,
                                      ':no_entry_sign: {}: You have provided only one choice to select from.'.format(
                                          message.author.display_name))
    else:
        await client.send_message(message.channel, ':no_entry_sign: {}: You have provided no choices'.format(
            message.author.display_name))

@base.dashiefunc
async def later(message, client, *args, **kwargs):
    '''
    **{0}later**
    Posts a Spongebob title card referring to a later time.
    *Example: `{0}later`*
    '''
    pics = os.listdir('later')
    await client.send_file(message.channel, 'later/' + random.choice(pics))


text:
#ifndef QXCBWINDOW_H
#define QXCBWINDOW_H

#include <qpa/qplatformwindow.h>
#include <QtGui/QSurfaceFormat>
#include <QtGui/QImage>

#include <xcb/xcb.h>
#include <xcb/sync.h>

#include "qxcbobject.h"

QT_BEGIN_NAMESPACE

class QXcbScreen;
class QXcbEGLSurface;
class QIcon;
class QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow
{
public:
    enum NetWmState {
        NetWmStateAbove = 0x1,
        NetWmStateBelow = 0x2,
        NetWmStateFullScreen = 0x4,
        NetWmStateMaximizedHorz = 0x8,
        NetWmStateMaximizedVert = 0x10,
        NetWmStateModal = 0x20,
        NetWmStateStaysOnTop = 0x40,
        NetWmStateDemandsAttention = 0x80
    };

    Q_DECLARE_FLAGS(NetWmStates, NetWmState)

    QXcbWindow(QWindow *window);
    ~QXcbWindow();

    void setGeometry(const QRect &rect);

    QMargins frameMargins() const;

    void setVisible(bool visible);
    void setWindowFlags(Qt::WindowFlags flags);
    void setWindowState(Qt::WindowState state);
    WId winId() const;
    void setParent(const QPlatformWindow *window);

    bool isExposed() const;
    bool isEmbedded(const QPlatformWindow *parentWindow) const;
    QPoint mapToGlobal(const QPoint &pos) const;
    QPoint mapFromGlobal(const QPoint &pos) const;

    void setWindowTitle(const QString &title);
    void setWindowIcon(const QIcon &icon);
    void raise();
    void lower();
    void propagateSizeHints();

    void requestActivateWindow();

#if XCB_USE_MAEMO_WINDOW_PROPERTIES
    void handleContentOrientationChange(Qt::ScreenOrientation orientation);
#endif

    bool setKeyboardGrabEnabled(bool grab);
    bool setMouseGrabEnabled(bool grab);

    void setCursor(xcb_cursor_t cursor);

    QSurfaceFormat format() const;

    void windowEvent(QEvent *event);

    bool startSystemResize(const QPoint &pos, Qt::Corner corner);

    void setOpacity(qreal level);
    void setMask(const QRegion &region);

    void setAlertState(bool enabled);
    bool isAlertState() const { return m_alertState; }

    xcb_window_t xcb_window() const { return m_window; }
    uint depth() const { return m_depth; }
    QImage::Format imageFormat() const { return m_imageFormat; }

    bool handleGenericEvent(xcb_generic_event_t *event, long *result)  Q_DECL_OVERRIDE;

    void handleExposeEvent(const xcb_expose_event_t *event) Q_DECL_OVERRIDE;
    void handleClientMessageEvent(const xcb_client_message_event_t *event) Q_DECL_OVERRIDE;
    void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) Q_DECL_OVERRIDE;
    void handleMapNotifyEvent(const xcb_map_notify_event_t *event) Q_DECL_OVERRIDE;
    void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) Q_DECL_OVERRIDE;
    void handleButtonPressEvent(const xcb_button_press_event_t *event) Q_DECL_OVERRIDE;
    void handleButtonReleaseEvent(const xcb_button_release_event_t *event) Q_DECL_OVERRIDE;
    void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) Q_DECL_OVERRIDE;

    void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) Q_DECL_OVERRIDE;
    void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) Q_DECL_OVERRIDE;
    void handleFocusInEvent(const xcb_focus_in_event_t *event) Q_DECL_OVERRIDE;
    void handleFocusOutEvent(const xcb_focus_out_event_t *event) Q_DECL_OVERRIDE;
    void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE;

    QXcbWindow *toWindow() Q_DECL_OVERRIDE;

    void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers);

    void updateSyncRequestCounter();
    void updateNetWmUserTime(xcb_timestamp_t timestamp);

#if defined(XCB_USE_EGL)
    QXcbEGLSurface *eglSurface() const;
#endif

private:
    void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0);
    NetWmStates netWmStates();
    void setNetWmStates(NetWmStates);

    void setNetWmWindowFlags(Qt::WindowFlags flags);
    void setMotifWindowFlags(Qt::WindowFlags flags);

    void updateMotifWmHintsBeforeMap();
    void updateNetWmStateBeforeMap();

    void setTransparentForMouseEvents(bool transparent);
    void updateDoesNotAcceptFocus(bool doesNotAcceptFocus);

    QRect windowToWmGeometry(QRect r) const;
    void sendXEmbedMessage(xcb_window_t window, quint32 message,
                           quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0);
    void handleXEmbedMessage(const xcb_client_message_event_t *event);

    void create();
    void destroy();

    void show();
    void hide();

    QXcbScreen *m_screen;

    xcb_window_t m_window;

    uint m_depth;
    QImage::Format m_imageFormat;

    xcb_sync_int64_t m_syncValue;
    xcb_sync_counter_t m_syncCounter;

    Qt::WindowState m_windowState;

    xcb_gravity_t m_gravity;

    bool m_mapped;
    bool m_transparent;
    bool m_usingSyncProtocol;
    bool m_deferredActivation;
    bool m_deferredExpose;
    bool m_configureNotifyPending;
    bool m_embedded;
    bool m_alertState;
    xcb_window_t m_netWmUserTimeWindow;

    QSurfaceFormat m_format;

    mutable bool m_dirtyFrameMargins;
    mutable QMargins m_frameMargins;

#if defined(XCB_USE_EGL)
    mutable QXcbEGLSurface *m_eglSurface;
#endif

    QRegion m_exposeRegion;

    xcb_visualid_t m_visualId;
    int m_lastWindowStateEvent;
};

QT_END_NAMESPACE

#endif


text:
/****
Boby
****/
body {
  background-color: #fff;
}

/******
General
******/
/* Theme Font Color */
.theme-font {
  color: #E26A6A !important;
}

/* Pace - Page Progress */
.pace .pace-progress {
  background: #E26A6A;
}

/* Theme Light Portlet */
.portlet.light .btn.btn-circle.btn-icon-only.btn-default {
  border-color: #bbc2ce;
}
.portlet.light .btn.btn-circle.btn-icon-only.btn-default > i {
  font-size: 13px;
  color: #a6b0bf;
}
.portlet.light .btn.btn-circle.btn-icon-only.btn-default:hover, .portlet.light .btn.btn-circle.btn-icon-only.btn-default.active {
  color: #fff;
  background: #E26A6A;
  border-color: #E26A6A;
}
.portlet.light .btn.btn-circle.btn-icon-only.btn-default:hover > i, .portlet.light .btn.btn-circle.btn-icon-only.btn-default.active > i {
  color: #fff;
}

/******
Page Header
******/
.page-header {
  background-color: #fff;
  /* Page Header Top */
  /* Page Header Menu */
}
.page-header .page-header-top {
  /* Top menu */
}
.page-header .page-header-top.fixed {
  background: #fff !important;
  box-shadow: 0px 0px 10px 1px rgba(50, 50, 50, 0.2);
}
.page-header .page-header-top .top-menu .navbar-nav {
  /* Top Links */
  /* Separator */
  /* Extended Dropdowns */
  /* Notification */
  /* Inbox */
  /* Tasks */
  /* User */
  /* Language */
  /* Dark version */
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown .separator {
  border-right: 1px solid #E3E8EC;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown > .dropdown-toggle > i {
  color: #C1CCD1;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown > .dropdown-toggle:hover {
  background-color: #fff;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown > .dropdown-toggle:hover > i {
  color: #a4b4bb;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown > .dropdown-toggle .badge.badge-default {
  background-color: #f36a5a;
  color: #ffffff;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown.open .dropdown-toggle {
  background-color: #fff;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown.open .dropdown-toggle > i {
  color: #a4b4bb;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-separator .separator {
  border-right: 1px solid #E3E8EC;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-extended .dropdown-menu:after {
  border-bottom-color: #f7f8fa;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-extended .dropdown-menu > li.external {
  background: #f7f8fa;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-extended .dropdown-menu > li.external > h3 {
  color: #6f949c;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-extended .dropdown-menu > li.external > a {
  color: #5b9bd1;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-extended .dropdown-menu > li.external > a:hover {
  color: #3175af;
  text-decoration: none;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-extended .dropdown-menu .dropdown-menu-list > li > a {
  border-bottom: 1px solid #EFF2F6 !important;
  color: #222222;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-extended .dropdown-menu .dropdown-menu-list > li > a:hover {
  background: #f8f9fa;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-notification .dropdown-menu .dropdown-menu-list > li > a .time {
  background: #f1f1f1;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-notification .dropdown-menu .dropdown-menu-list > li > a:hover .time {
  background: #e4e4e4;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-inbox > .dropdown-toggle > .circle {
  background-color: #E26A6A;
  color: #ffffff;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-inbox > .dropdown-toggle > .corner {
  border-color: transparent #E26A6A transparent transparent;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-inbox .dropdown-menu .dropdown-menu-list .subject .from {
  color: #5b9bd1;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-tasks .dropdown-menu .dropdown-menu-list .progress {
  background-color: #dfe2e9;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-user > .dropdown-toggle > .username {
  color: #8ea3b6;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-user > .dropdown-toggle > i {
  color: #8ea3b6;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-user > .dropdown-menu {
  width: 195px;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-user:hover > .dropdown-toggle > .username,
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-user:hover > .dropdown-toggle > i, .page-header .page-header-top .top-menu .navbar-nav > li.dropdown-user.open > .dropdown-toggle > .username,
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-user.open > .dropdown-toggle > i {
  color: #7089a2;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-language > .dropdown-toggle > .langname {
  color: #8ea3b6;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-language:hover > .dropdown-toggle > .langname, .page-header .page-header-top .top-menu .navbar-nav > li.dropdown-language.open > .dropdown-toggle > .langname {
  color: #7089a2;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu {
  background: #2e343b;
  border: 0;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu:after {
  border-bottom-color: #2e343b;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu > li.external {
  background: #272c33;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu > li.external > h3 {
  color: #a2abb7;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu > li.external > a:hover {
  color: #87b6dd;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu.dropdown-menu-default > li a,
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu .dropdown-menu-list > li a {
  color: #aaafb7;
  border-bottom: 1px solid #3b434c !important;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu.dropdown-menu-default > li a > i,
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu .dropdown-menu-list > li a > i {
  color: #6FA7D7;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu.dropdown-menu-default > li a:hover,
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu .dropdown-menu-list > li a:hover {
  background: #373e47;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu.dropdown-menu-default > li a {
  border-bottom: 0 !important;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu.dropdown-menu-default > li.divider {
  background: #3b434c;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-notification.dropdown-dark .dropdown-menu .dropdown-menu-list > li > a .time {
  background: #23272d;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-notification.dropdown-dark .dropdown-menu .dropdown-menu-list > li > a:hover .time {
  background: #181b1e;
}
.page-header .page-header-menu {
  background: #444d58;
  /* Default Mega Menu */
  /* Light Mega Menu */
  /* Header seaech box */
}
.page-header .page-header-menu.fixed {
  box-shadow: 0px 0px 10px 1px rgba(68, 77, 88, 0.2);
}
.page-header .page-header-menu .hor-menu .navbar-nav {
  /* Mega menu content */
  /* Classic menu */
}
.page-header .page-header-menu .hor-menu .navbar-nav > li.mega-menu-dropdown > .dropdown-menu {
  box-shadow: 5px 5px rgba(85, 97, 111, 0.2);
}
.page-header .page-header-menu .hor-menu .navbar-nav > li.mega-menu-dropdown > .dropdown-menu .mega-menu-content .mega-menu-submenu li > h3 {
  color: #ced5de;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li > a {
  color: #BCC2CB;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li > a > i {
  color: #BCC2CB;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li.open > a,
.page-header .page-header-menu .hor-menu .navbar-nav > li > a:hover {
  color: #ffffff;
  background: #55616f !important;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li.open > a > i,
.page-header .page-header-menu .hor-menu .navbar-nav > li > a:hover > i {
  color: #ffffff;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li.active > a,
.page-header .page-header-menu .hor-menu .navbar-nav > li.active > a:hover, .page-header .page-header-menu .hor-menu .navbar-nav > li.current > a,
.page-header .page-header-menu .hor-menu .navbar-nav > li.current > a:hover {
  color: #f1f1f1;
  background: #4E5966;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li.active > a > i,
.page-header .page-header-menu .hor-menu .navbar-nav > li.active > a:hover > i, .page-header .page-header-menu .hor-menu .navbar-nav > li.current > a > i,
.page-header .page-header-menu .hor-menu .navbar-nav > li.current > a:hover > i {
  color: #BCC2CB;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu {
  box-shadow: 5px 5px rgba(85, 97, 111, 0.2);
  background: #55616f;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li > a {
  color: #ced5de;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li > a > i {
  color: #6fa7d7;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li:hover > a {
  color: #ced5de;
  background: #5d6b7a;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li:hover > a > i {
  color: #6fa7d7;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.active > a,
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.active > a:hover, .page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.current > a,
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.current > a:hover {
  color: #ced5de;
  background: #5d6b7a;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.active > a > i,
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.active > a


text:
/**
 * authenticator.js
 */
var passport=require('passport');

/**
 * Configures a web server for authentication with passport
 */
var Authenticator={
	/**
	 * Configures authentication
	 * @param app			the express web server configuration
	 * @param authenticator	the authenticator object with the following structure:
	 * 						{
	 * 							serializeUser: function(user, callback) {},
	 * 							deserializeUser: function(user, callback) {},
	 * 							local: {
	 * 								authenticate: function(req, username, password, callback) {}'
	 * 							},
	 * 							google: {},
	 * 							facebook: {}
	 * 						}
	 */
	configure: function(app, authenticator) {
		if(!app) {
			console.log('ERROR: Missing web server => aborting authentication configuration !');
			return;
		} else if(!authenticator) {
			console.log('ERROR: Missing authenticator => aborting authentication configuration !');
			return;
		} else if(!authenticator.local && !authenticator.google && !authenticator.facebook) {
			console.log('ERROR: Missing authentication function => aborting authentication configuration !');
			return;
		}

		// save user data in session
		console.log('Authentication: configuring passport ...');
		// serialize user
		var serializeUser=authenticator.serializeUser || function(user, callback) {
			if(user.password!=undefined) user.password=null;
			callback && callback(user);
		};
		passport.serializeUser(function(user, done) {serializeUser(user, function(serializedUser) {done(null, serializedUser);});});
		// deserialize user
		var deserializeUser=authenticator.deserializeUser || function(user, callback) {
			callback && callback(user);
		};
		passport.deserializeUser(function(user, done) {deserializeUser(user, function(deserializedUser) {done(null, deserializedUser);});});
		// initialize passport
		app.use(passport.initialize());
		app.use(passport.session());

		// configure local authentication
		if(authenticator.local) {
			console.log('Local Authentication');
			var localAuthenticator=require('./local');
			localAuthenticator.configure(authenticator.local);
			app.use(localAuthenticator.getRoutes(authenticator.local));
		}

		// configure google authentication
		if(authenticator.google) {
			console.log('Google Authentication');
			var googleAuthenticator=require('./google');
			googleAuthenticator.configure(authenticator.google);
			app.use(googleAuthenticator.getRoutes(authenticator.google));
		}

		// configure facebook authentication
		if(authenticator.facebook) {
			console.log('Facebook Authentication');
			var facebookAuthenticator=require('./facebook');
			facebookAuthenticator.configure(authenticator.facebook);
			app.use(facebookAuthenticator.getRoutes(authenticator.facebook));
		}
	}
};

module.exports=Authenticator;


text:
package xworker.html.bootstrap.widgets;

import org.xmeta.ActionContext;
import org.xmeta.Thing;

import xworker.html.HtmlUtil;

public class alertActions {
    public static Object toHtml(ActionContext actionContext){
        Thing self = actionContext.getObject("self");

        String html = "
\n";

        for(Thing child : self.getChilds()){
            String code = (String) child.doAction("toHtml", actionContext);
            if(code != null){
                html = html + "  " + HtmlUtil.getIdentString(code, "  ") + "\n";
            }
        }
        html = html + "
";

        return html;
    }

}


text:
STRTprep (https://github.com/shka/STRTprep) is an open-source software package for preprocess and analysis of STRT RNA-seq data. The first version was for the preprocessing and quality-check purposes, and the version 2 contains automated statistical tests of the differential expression. This package can run on both Linux and OSX.

Edit two files to describe your experiment and study design, and run the pipeline as below, then you can finish from preprocess of raw reads until differential expression tests. Enjoy more further downstream analysis!

```bash
# STEP 1: Installation
## pause; decide name and the location of your project - now './STRTprep2.test'
git clone https://github.com/shka/STRTprep.git STRTprep2.test
cd STRTprep2.test
bin/install.sh
. bin/setup.sh
## pause; choose reference genome and transcriptome - now hg19 and RefSeq
bin/index_hg19_ercc92_ynbA_u13369.sh
bin/index_refGene.sh hg19 src/ebwt/hg19_ercc_ynbA_u13369/ref

# STEP 2: Design of your experiments
## pause; edit conf.yaml and src/samples.csv

# STEP 3: Preprocessing & quality check
rake -m -j `gnproc` qc > qc.log 2>&1
## pause; check qc.log & out/byGene/samples.xls

# STEP 4: Differential expression analysis
rake gene > gene.log 2>&1
## pause; check gene.log, out/byGene/diffexp.xls & out/byGene/plugins_*
##        go back to the step 2 when you would like to compare more

# DONE! Enjoy more further analysis!
```

> This document is for the version 2, but version 3 beta (branch `v3dev`) is ongoing; the version 3 will provide TFE-based quantification to analyze novel genes/start-sites including long-noncoding RNAs.

## Table of contents

1. [Installation of STRTprep](install.md)
2. [Protocol of preprocessing and analysis](protocol.md)
3. [Interpretation of the results](result.md)

## Notation

> Sentences with a vertical box at the left like this are usually tips or pitfalls.

```bash
Sentences within a box are codes; usually these are commands to be executed on your bash console.
```


text:
#import "SectionViewCell.h"

@implementation SectionViewCell
- (IBAction)switchChanged:(UISwitch *)sender
{
    if ([[self delegate] respondsToSelector:@selector(didToggleSectionViewCell:tag:)]) {
        [[self delegate] didToggleSectionViewCell:[sender isOn] tag:[self tag]];
    }
}

- (void)setEnabled:(BOOL)enabled
{
    [[self enableSwitch] setOn:enabled];
}

@end


text:
namespace nova::renderer {
    using namespace rhi;

    RX_LOG("PipelineReflection", logger);

    std::unordered_map<std::string, RhiResourceBindingDescription> get_all_descriptors(const RhiGraphicsPipelineState& pipeline_state) {
        std::unordered_map<std::string, RhiResourceBindingDescription> bindings;

        get_shader_module_descriptors(pipeline_state.vertex_shader.source, ShaderStage::Vertex, bindings);

        if(pipeline_state.geometry_shader) {
            get_shader_module_descriptors(pipeline_state.geometry_shader->source, ShaderStage::Geometry, bindings);
        }
        if(pipeline_state.pixel_shader) {
            get_shader_module_descriptors(pipeline_state.pixel_shader->source, ShaderStage::Pixel, bindings);
        }

        return bindings;
    }

    void get_shader_module_descriptors(const std::vector<uint32_t>& spirv,
                                       const ShaderStage shader_stage,
                                       std::unordered_map<std::string, RhiResourceBindingDescription>& bindings) {
        const spirv_cross::Compiler shader_compiler{spirv.data(), spirv.size()};
        const spirv_cross::ShaderResources& resources = shader_compiler.get_shader_resources();

        for(const auto& resource : resources.separate_images) {
            add_resource_to_bindings(bindings, shader_stage, shader_compiler, resource, DescriptorType::Texture);
        }

        for(const auto& resource : resources.separate_samplers) {
            add_resource_to_bindings(bindings, shader_stage, shader_compiler, resource, DescriptorType::Sampler);
        }

        for(const auto& resource : resources.uniform_buffers) {
            add_resource_to_bindings(bindings, shader_stage, shader_compiler, resource, DescriptorType::UniformBuffer);
        }

        for(const auto& resource : resources.storage_buffers) {
            add_resource_to_bindings(bindings, shader_stage, shader_compiler, resource, DescriptorType::StorageBuffer);
        }
    }

    void add_resource_to_bindings(std::unordered_map<std::string, RhiResourceBindingDescription>& bindings,
                                  const ShaderStage shader_stage,
                                  const spirv_cross::Compiler& shader_compiler,
                                  const spirv_cross::Resource& resource,
                                  const DescriptorType type) {
        const uint32_t set_idx = shader_compiler.get_decoration(resource.id, spv::DecorationDescriptorSet);
        const uint32_t binding_idx = shader_compiler.get_decoration(resource.id, spv::DecorationBinding);

        RhiResourceBindingDescription new_binding = {};
        new_binding.set = set_idx;
        new_binding.binding = binding_idx;
        new_binding.type = type;
        new_binding.count = 1;
        new_binding.stages = shader_stage;

        logger->debug("Pipeline reflection found resource %s of type %s in binding %u.%u",
                        resource.name.c_str(),
                        descriptor_type_to_string(type),
                        set_idx,
                        binding_idx);

        const spirv_cross::SPIRType& type_information = shader_compiler.get_type(resource.type_id);
        if(!type_information.array.empty()) {
            new_binding.count = type_information.array[0];
            // All arrays are unbounded until I figure out how to use SPIRV-Cross to detect unbounded arrays
            new_binding.is_unbounded = true;
        }

        const std::string& resource_name = resource.name.c_str();

        if(auto* binding = bindings.find(resource_name)) {
            // Existing binding. Is it the same as our binding?
            RhiResourceBindingDescription& existing_binding = *binding;
            if(existing_binding != new_binding) {
                // They have two different bindings with the same name. Not allowed
                logger->error("You have two different uniforms named %s in different shader stages. This is not allowed. Use unique names",
                              resource.name);

            } else {
                // Same binding, probably at different stages - let's fix that
                existing_binding.stages |= shader_stage;
            }

        } else {
            // Totally new binding!
            bindings.insert(resource_name, new_binding);
        }
    }
} // namespace nova::renderer


text:
echo "[`date +'%Y-%m-%d %H:%M:%S'`] Installing node modules..."

# Define error handling function
handle_error()
{
  echo "[`date +'%Y-%m-%d %H:%M:%S'`] ERROR: $1" >&2
  exit 1
}

cd `dirname $0`/.. || handle_error "Can't change directory to .."
npm install || handle_error "Can't instal node module!"


text:
package Controle;

import Entidade.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;
import java.net.URI;
import java.util.regex.Matcher;
import java.io.IOException;

public class Captura {
    private Entidade.Pedido Pedido;
    private List<Entidade.Recurso> ListaRecursos = new ArrayList<Entidade.Recurso>();
    private List<Entidade.Pagina> ListaPaginas = new ArrayList<Entidade.Pagina>();

    public Captura(Entidade.Pedido lPedido) {
        this.Pedido = lPedido;
    }

    public void Iniciar() throws IOException {
        //===========
        //Url Inicial
        URI mainUrl = null;
        try{mainUrl = new URI(Pedido.getDominio());}catch(Exception ex){
            return;
        }

        List<Entidade.Pagina> listaSubPaginas = new ArrayList<Entidade.Pagina>();
        List<Entidade.Pagina> listaSubPaginasAux = new ArrayList<Entidade.Pagina>();
        //=========================
        //Verificar todos os niveis
        for(int i=0; i<= Pedido.getNivel(); i++){
            listaSubPaginasAux = listaSubPaginas;
            listaSubPaginas = new ArrayList<Pagina>();
            //==============
            //Primeiro Nivel
            if(i == 0)
                listaSubPaginasAux.add(new Pagina(Pedido.getDominio()));
            //========================================
            //Obter os links/subPaginas das SubPaginas
            int subAtual = 0;

            for (Pagina pagina : listaSubPaginasAux) {
                subAtual += 1;
                Tela.Console.mostrarMensagem("[" + subAtual + "/" + listaSubPaginasAux.size() + "]--Pagina Atual = " + pagina.getUrl());
                Solicitacao solicitacao = Comum.Funcao.socketRequest(pagina.getUrl());
                Tela.Console.mostrarMensagem("Tempo Carregamneto = " + solicitacao.getTempoCarregamento());
                //=========================================
                //Obter lista de recursos para pagina atual
                ObterRecursos(solicitacao,pagina);
                //=========================
                //Obter 'href' da tag '<a>'
                for (String strLink : solicitacao.getHtml().split(Pattern.quote("<a")))
                {
                    try{
                        strLink = strLink.split(Pattern.quote("</a>"))[0];
                        strLink = strLink.split(Pattern.quote("href=\""))[1];
                        strLink = strLink.split(Pattern.quote("\""))[0];
                        strLink = strLink.trim();
                        //===========
                        //Validar Url
                        if(!Url.Validar(strLink))
                            continue;
                        //==============
                        //Estruturar Url
                        strLink = Url.Estruturar(strLink, mainUrl);
                        //==================================
                        //Verificar se está no mesmo dominio
                        URI curUrl = new URI(strLink);
                        if(curUrl.getHost().equals(mainUrl.getHost())){
                            Pagina pag = new Pagina(strLink, solicitacao.getTempoCarregamento());
                            if(!listaSubPaginas.contains(pag)){
                                //========================
                                //Adicionar pagina a lista
                                listaSubPaginas.add(pag);
                                //Debug
                                //Tela.Console.mostrarMensagem("Link Adicionado = " + strLink);
                            }
                        }
                    }catch (Exception ex){
                        //Tela.Console.mostrarMensagem("Erro <a:" + strLink);
                        //ex.printStackTrace();
                    }
                };
            }
            Tela.Console.mostrarMensagem("--Numero de SubPaginas = " + listaSubPaginas.size());
            //Adicionar a lista principal
            for (Pagina pagina : listaSubPaginas) {
                if(!ListaPaginas.contains(pagina)){
                    ListaPaginas.add(pagina);
                }
            };
        }
        //======================
        //Finalizou pedido atual
        Tela.Console.mostrarMensagem("--Finalizou Url = " + Pedido.getDominio());
        //==================================
        //Gerar/Salvar arquivo xml Resultado
        Tela.Console.mostrarMensagem("Salvando arquivo resultado...");
        Dados.Resultado dadosResultado = new Dados.Resultado(ListaRecursos, ListaPaginas, Pedido);
        dadosResultado.Salvar();
        //=========================
        //Apagar arquivo xml Pedido
        Tela.Console.mostrarMensagem("Deletando arquivo pedido...");
        Dados.Pedido.Apagar(Pedido.getId());
    }

    private Recurso ObterInformacao(Recurso lRecurso){
        Recurso recursoRetorno = lRecurso;
        Tela.Console.mostrarMensagem("Fazendo request...");
        Solicitacao solicitacao = Comum.Funcao.socketRequest(lRecurso.getUrl());

        //============================
        //Atualizar tempo carregamento
        recursoRetorno.setTempoCarregamento(solicitacao.getTempoCarregamento());

        int tamanhoArquivo = 0;
        int qtdCaracteres = 0;                                   //(?:\/\*(?:[\s\S]*?)\*\/)|(?:([\s;])+\/\/(?:.*)$)
        //====================================
        //Remover todos comentarios do arquivo
        Tela.Console.mostrarMensagem("Removendo comentarios...");
        String semComentarios = solicitacao.getHtml().replaceAll("/(?:\\/\\*(?:[\\s\\S]*?)\\*\\/)|(?:([\\s;])+\\/\\/(?:.*)$)", ""); //.replaceAll("(?:/\\*(?:[^*]|(?:\\*+[^*/]))*\\*+/)|(?://.*)","");
        //=================================================
        //Contar tamanho do arquivo e quantidade caracteres
        tamanhoArquivo = solicitacao.getHtml().getBytes().length - semComentarios.getBytes().length;
        qtdCaracteres = solicitacao.getHtml().length() - semComentarios.length();
        recursoRetorno.setDiferencaTamanho(tamanhoArquivo);
        recursoRetorno.setQuantidadeCaracteres(qtdCaracteres);
        //Debug
        Tela.Console.mostrarMensagem("qtdCaracteres = " + qtdCaracteres + " Num kbs = " + tamanhoArquivo/1024);
        return recursoRetorno;
    }

    private void ObterRecursos(Solicitacao lSolicitacao, Pagina lPagina){
        Solicitacao solicitacao = lSolicitacao;
        URI paginaUrl = null;
        try{paginaUrl = new URI(lPagina.getUrl());}catch(Exception ex){
            return;
        }
        //==================================
        //Obter <script src="URL"> </script>
        for (String strScript : solicitacao.getHtml().split(Pattern.quote("<script")))
        {
            try{
                strScript = strScript.split(Pattern.quote("</script>"))[0];
                if(strScript.contains("src=")){
                    strScript = strScript.split(Pattern.quote("src=\""))[1];
                    strScript = strScript.split(Pattern.quote("\""))[0];
                    strScript = Url.Estruturar(strScript, paginaUrl);
                    Recurso recurso = new Recurso(strScript, "Script", lPagina);
                    if(!ListaRecursos.contains(recurso)){
                        //==========================================
                        //Adicionar a lista de recursos e obter info
                        ObterInformacao(recurso);
                        ListaRecursos.add(recurso);
                        Tela.Console.mostrarMensagem("Script= " + strScript);
                    }
                }else{
                    //Script Direto (sem url/src)
                }
            }catch (Exception ex){
                //Tela.Console.mostrarMensagem("Erro <script:" + strScript);
            }
        };
        //========================================================================
        //Obter 'href' da tag '<link rel="stylesheet" type="text/css" href="URL">'
        for (String strLink : solicitacao.getHtml().split(Pattern.quote("<link")))
        {
            try{
                strLink = strLink.split(Pattern.quote(">"))[0];
                if(strLink.contains("href=")){
                    strLink = strLink.split(Pattern.quote("href=\""))[1];
                    strLink = strLink.split(Pattern.quote("\""))[0];
                    strLink = Url.Estruturar(strLink, paginaUrl);
                    //===========================
                    //Filtrar apenas arquivos CSS
                    if(!strLink.contains(".css"))
                        continue;
                    Recurso recurso = new Recurso(strLink, "Style", lPagina);
                    if(!ListaRecursos.contains(recurso)){
                        //==========================================
                        //Adicionar a lista de recursos e obter info
                        ObterInformacao(recurso);
                        ListaRecursos.add(recurso);
                        Tela.Console.mostrarMensagem("Style= " + strLink);
                    }
                }
            }catch (Exception ex){
                //Tela.Console.mostrarMensagem("Erro <link:" + strLink);
            }
        };
        //==============================================
        //Obter 'src' da tag '<style src="URL"></style>'
        for (String strStyle : solicitacao.getHtml().split(Pattern.quote("<style")))
        {
            try{
                strStyle = strStyle.split(Pattern.quote("</style>"))[0];
                if(strStyle.contains("src=")){
                    strStyle = strStyle.split(Pattern.quote("src=\""))[1];
                    strStyle = strStyle.split(Pattern.quote("\""))[0];
                    strStyle = Url.Estruturar(strStyle, paginaUrl);
                    //===========================
                    //Filtrar apenas arquivos CSS
                    if(!strStyle.contains(".css"))
                        continue;
                    Recurso recurso = new Recurso(strStyle, "Style", lPagina);
                    if(!ListaRecursos.contains(recurso)){
                        //==========================================
                        //Adicionar a lista de recursos e obter info
                        ObterInformacao(recurso);
                        ListaRecursos.add(recurso);
                        //Tela.Console.mostrarMensagem("Style= " +strStyle);
                    }
                }else{
                    //Style Direto (sem url/src)
                }
            }catch (Exception ex){
                //Tela.Console.mostrarMensagem("Erro <style:" + strStyle);
            }
        };

    }
}


text:
class BingWallpaperProvider : public WallpaperProvider
{
public:
    BingWallpaperProvider();
private:
    void do_getWallpapers(WallpaperDelegatePtr delegate,
                          unsigned int max_wallpapers);

};

#endif // BINGWALLPAPERPROVIDER_H


text:
namespace TypeSql.Antlr3.ST.Language
{
    using AntlrReaderStream = Antlr.Runtime.ANTLRReaderStream;
    using RecognitionException = Antlr.Runtime.RecognitionException;
    using TextReader = System.IO.TextReader;

    partial class AngleBracketTemplateLexer
    {
        protected string currentIndent = null;
        protected StringTemplate self;

        public AngleBracketTemplateLexer( StringTemplate self, TextReader r )
            : this( new AntlrReaderStream( r ) )
        {
            this.self = self;
        }

        public override void ReportError( RecognitionException e )
        {
            self.Error( "<...> chunk lexer error", e );
        }

        public override string[] TokenNames
        {
            get
            {
                return TemplateParser.tokenNames;
            }
        }

        bool UpcomingAtEND( int i )
        {
            return input.LA( i ) == '<'
                && input.LA( i + 1 ) == '@'
                && input.LA( i + 2 ) == 'e'
                && input.LA( i + 3 ) == 'n'
                && input.LA( i + 4 ) == 'd'
                && input.LA( i + 5 ) == '>';
        }
    }

}


text:
package org.axonframework.mongo.eventsourcing.eventstore;

import com.mongodb.BasicDBObject;
import com.mongodb.MongoClient;
import de.flapdoodle.embed.mongo.MongodExecutable;
import de.flapdoodle.embed.mongo.MongodProcess;
import org.axonframework.commandhandling.model.ConcurrencyException;
import org.axonframework.common.jdbc.PersistenceExceptionResolver;
import org.axonframework.eventsourcing.eventstore.BatchingEventStorageEngineTest;
import org.axonframework.eventsourcing.eventstore.EventStoreException;
import org.axonframework.mongo.eventsourcing.eventstore.documentpercommit.DocumentPerCommitStorageStrategy;
import org.axonframework.mongo.utils.MongoLauncher;
import org.axonframework.serialization.upcasting.event.EventUpcasterChain;
import org.axonframework.serialization.upcasting.event.NoOpEventUpcasterChain;
import org.axonframework.serialization.xml.XStreamSerializer;
import org.junit.*;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.io.IOException;

import static org.axonframework.eventsourcing.eventstore.EventStoreTestUtils.createEvent;

/**
 * @author Rene de Waele
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:META-INF/spring/mongo-context_doc_per_commit.xml"})
public class MongoEventStorageEngineTest_DocPerCommit extends BatchingEventStorageEngineTest {
    private static final Logger logger = LoggerFactory.getLogger(MongoEventStorageEngineTest_DocPerCommit.class);

    private static MongodExecutable mongoExe;
    private static MongodProcess mongod;

    private MongoEventStorageEngine testSubject;

    @BeforeClass
    public static void start() throws IOException {
        mongoExe = MongoLauncher.prepareExecutable();
        mongod = mongoExe.start();
    }

    @AfterClass
    public static void shutdown() {
        if (mongod != null) {
            mongod.stop();
        }
        if (mongoExe != null) {
            mongoExe.stop();
        }
    }

    @Autowired
    private ApplicationContext context;

    private DefaultMongoTemplate mongoTemplate;

    @Before
    public void setUp() {
        try {
            MongoClient mongoClient = context.getBean(MongoClient.class);
            testSubject = context.getBean(MongoEventStorageEngine.class);
            mongoTemplate = new DefaultMongoTemplate(mongoClient);
            mongoTemplate.eventCollection().deleteMany(new BasicDBObject());
            mongoTemplate.snapshotCollection().deleteMany(new BasicDBObject());
            setTestSubject(testSubject);
        } catch (Exception e) {
            logger.error("No Mongo instance found. Ignoring test.");
            Assume.assumeNoException(e);
        }
    }

    @Test
    @Override
    public void testUniqueKeyConstraintOnEventIdentifier() {
        logger.info("Unique event identifier is not currently guaranteed in the Mongo Event Storage Engine");
    }

    @Test(expected = ConcurrencyException.class)
    @Override
    public void testStoreDuplicateEventWithoutExceptionResolver() {
        testSubject.appendEvents(createEvent(0));
        testSubject.appendEvents(createEvent(0));
    }

    @DirtiesContext
    @Test(expected = EventStoreException.class)
    @Override
    public void testStoreDuplicateEventWithExceptionTranslator() {
        testSubject = createEngine((PersistenceExceptionResolver) null);
        testSubject.appendEvents(createEvent(0));
        testSubject.appendEvents(createEvent(0));
    }

    @Override
    protected MongoEventStorageEngine createEngine(EventUpcasterChain upcasterChain) {
        return new MongoEventStorageEngine(new XStreamSerializer(), upcasterChain, mongoTemplate,
                                           new DocumentPerCommitStorageStrategy());
    }

    @Override
    protected MongoEventStorageEngine createEngine(PersistenceExceptionResolver persistenceExceptionResolver) {
        return new MongoEventStorageEngine(new XStreamSerializer(), NoOpEventUpcasterChain.INSTANCE,
                                           persistenceExceptionResolver, 100, mongoTemplate,
                                           new DocumentPerCommitStorageStrategy());
    }
}


text:
// Copyright (c) 2017, Nicola Prezza.  All rights reserved.
// Use of this source code is governed
// by a MIT license that can be found in the LICENSE file.

/*
 * ContextAutomata.h
 *
 *  Created on: Jul 14, 2014
 *      Author: nicola
 */

#ifndef CONTEXTAUTOMATA_H_
#define CONTEXTAUTOMATA_H_

#include "includes.hpp"
#include "BackwardFileIterator.h"
#include "BackwardStringIterator.h"
#include "PartialSums.h"
#include "DynamicString.h"

namespace bwtil {

class ContextAutomata {

public:

	ContextAutomata(){};

	//ASSUMPTION: alphabet is {0,...,sigma-1}, where 0 is the terminator character (appearing only at the end of file)
	ContextAutomata(uint64_t k, BackwardIterator * bfr, bool verbose){

		init(bfr, verbose);
		build(k, bfr, verbose);

	}

	//overhead : k will be chosen such that the automaton will require approximately space n*overhead/100 bits, where n is the text length
	ContextAutomata(BackwardIterator * bfr, uint64_t overhead, bool verbose){
		init(bfr, verbose);

		//detect optimal k and build automaton

		if(verbose) cout << "\n Allowed memory overhead for the automaton = " << overhead << "%" << endl;
		if(verbose) cout << " Detecting optimal k ... " << endl;

		uint64_t _k = optimalK(overhead, bfr, verbose);

		if(verbose) cout << " Done. Optimal k = " << _k << endl;

		build( _k , bfr, verbose);

	}

	//default 5% of overhead
	ContextAutomata(BackwardIterator * bfr, bool verbose){

		init(bfr, verbose);

		//detect optimal k and build automaton
		//default 5% of overhead

		if(verbose) cout << "\n Allowed memory overhead for the automaton = 5%" << endl;
		if(verbose) cout << " Detecting optimal k ... " << endl;

		uint64_t _k = optimalK(5, bfr, verbose);

		if(verbose) cout << " Done. Optimal k = " << _k << endl;

		build( _k , bfr, verbose);

	}

	//jump from current state following the edge labeled with s. WARNING: alphabet must be {0,...,sigma-1}
	void goTo(symbol s){

		current_state = edge(current_state, s);

		if(current_state==null_ptr){
			cout << "ERROR (ContextAutomata) : using non-initialized edge.\n";
			exit(0);
		}

	};

	void goToASCII(symbol s){

		current_state = edge(current_state, ASCIItoCode(s) );

		if(current_state==null_ptr){
			cout << "ERROR (ContextAutomata) : using non-initialized edge.\n";
			exit(0);
		}

	};

	ulint currentState(){return current_state;};//return current state number
	ulint numberOfStates(){return number_of_k_mers;};

	void rewind(){current_state=0;};//return to initial state

	symbol ASCIItoCode(symbol c){return remapping[c];}
	symbol CodeToASCII(symbol c){return inverse_remapping[c];}

	symbol ASCIItoCodeNoTerminator(symbol c){if(c==0) return 0;  return remapping[c]-1;}
	symbol CodeToASCIINoTerminator(symbol c){return inverse_remapping[c+1];}

	uint64_t alphabetSize(){return sigma;}//included terminator

	ulint textLength(){return n;};

	uint64_t contextLength(){return k;}

private:

	//return true with probability p
	bool flip_coin(double p){

		return ((double)rand()/(double)RAND_MAX) <= p;

	}

	uint64_t optimalK(uint64_t overhead, BackwardIterator * bfr, bool verbose){

		//strategy: sample randomly n/log n characters of the text (in contiguous blocks of size B)
		//and try k=1,... until suitable k is found. There will be at most log_sigma n iterations, so work is linear.

		ulint B = 1000; //number of characters per block

		if(n<B)
			B = n;

		vector<symbol> sampled_text;

		srand(time(NULL));

		ulint nr_of_blocks = n/B;//total number of blocks in the text
		ulint sampled_n = n/(uint64_t)log2(n);//expected size of sampled text
		ulint nr_of_sampled_blocks = sampled_n/B;//expected number of sampled blocks
		double p = (double)nr_of_sampled_blocks/(double)nr_of_blocks;//probability that a block is sampled

		int perc,last_perc=-1;
		if(verbose)
			cout << "  Sampling text ... " << endl;

		ulint pos = n-1;//current position in the text
		while(not bfr->begin()){

			if(((n-1)-pos)%B==0){

				if(pos+1 >= B ){//if there are at least B characters to be sampled

					if((n-1)-pos==0 or flip_coin(p)){//randomly decide if sample the block

						for(uint64_t i=0;i<B;i++)	//sample B characters
							sampled_text.push_back( bfr->read() );

					}

				}

				perc = (100*((n-1)-pos))/n;

				if(perc>last_perc and (perc%5)==0 and verbose){
					cout << "  " << perc << "% done." << endl;
					last_perc=perc;
				}

			}

			bfr->read();//skip character on text
			pos--;

		}

		bfr->rewind();

		if(verbose)
			cout << "\n  Sampled text size = " << sampled_text.size() << endl;

		/*
		 * Extimate number of bits in memory for each context:
		 * O(sigma * log n) bits for each context.
		 *
		 * Structures in memory:
		 *
		 * vector<uint64_t > prefix_nr;
		 * vector<vector<uint64_t> > edges;
		 * CumulativeCounters * counters;
		 * DynamicString ** dynStrings;
		 * ulint * lengths;
		 *
		 */

		PartialSums sample_cumulative_counter = PartialSums(sigma,n);//sample of cumulative counter to extimate its memory consumption
		dynamic_string_t sample_dynstring;

		ulint bits_per_k_mer =
				8 * sizeof(dynamic_string_t *) + //pointers to DynamicStrings
				sample_cumulative_counter.bitSize()  + //cumulative counters
				sample_dynstring.bitSize() + //DynamicStrings
				8*sizeof(vector<uint64_t >) + //vector prefix_nr
				8*sizeof(uint64_t) + //content of vector prefix_nr
				8*sizeof(ulint); //lengths

		ulint bits_per_k_1_mer =
				8*sizeof(vector<uint64_t>) + //vector edges
				8*sigma*sizeof(uint64_t); //content of vector edges

		uint64_t log_n = log2(n+1);

		if(verbose) cout << "  Extimated number of bits per k-mer: " << bits_per_k_mer << endl;
		if(verbose) cout << "  Extimated number of bits per (k-1)-mer: " << bits_per_k_1_mer << endl;

		ulint nr_of_k_mers;
		ulint nr_of_k_1_mers=1;//number of (k-1)-mers

		// we want the highest k such that nr_of_contexts*bits_per_context <= n * (overhead/100)

		uint64_t _k = 1;//start from k=1.
		nr_of_k_mers=numberOfContexts( _k, sampled_text);

		if(verbose) cout << "  Number of " << _k << "-mers : " << nr_of_k_mers << endl;

		while( _k < log_n and (nr_of_k_mers * bits_per_k_mer + nr_of_k_1_mers * bits_per_k_1_mer <= (n * overhead)/100) ){

			_k++;

			nr_of_k_1_mers = nr_of_k_mers;
			nr_of_k_mers=numberOfContexts( _k, sampled_text);

			if(verbose) cout << "  Number of " << _k << "-mers : " << nr_of_k_mers << endl;

		}

		if(_k > 1)//we found the first _k above the threshold, so decrease _k.
			_k--;
		else
			_k = 1;//minimum k is 1

		return _k;

	}

	/*
	 * number of contexts of length k in the sampled text
	 */
	ulint numberOfContexts(uint64_t k, vector<symbol> sampled_text){

		sigma_pow_k_minus_one = 1;
		for(uint64_t i=0;i<k-1;i++)
			sigma_pow_k_minus_one *= sigma;

		ulint q = n/(log2(n)*log2(n)) + 1;//hash size: n/log^2 n

		vector<set<ulint> > H = vector<set<ulint> >( q,set<ulint>() );//the hash

		ulint context = (ulint)0;//first context

		H.at(context%q).insert(context);

		for(ulint i=0;i<sampled_text.size();i++){

			context = shift(context, ASCIItoCode(sampled_text.at(i)) );

			H.at(context%q).insert(context);

		}

		vector<ulint> k_mers;

		for(ulint i=0;i<q;i++)
			for (std::set<ulint>::iterator it=H.at(i).begin(); it!=H.at(i).end(); ++it)
				k_mers.push_back(*it);

		return k_mers.size();

	}

	void init(BackwardIterator * bfr, bool verbose){

		if(verbose) cout << "\n*** Building context automaton ***\n\n";

		bwIt = bfr;

		n = bwIt->length();
		null_ptr = ~((uint64_t)0);

		if(verbose) cout << " Text length is " << n << endl;

		remapping = vector<uint64_t>(256);
		inverse_remapping = vector<symbol>(256);

		for(uint64_t i=0;i<256;i++){
			remapping[i]=empty;
			inverse_remapping[i]=0;
		}

		if(verbose) cout << "\n scanning file to detect alphabet ... " << endl;

		vector<symbol> alphabet = vector<symbol>();

		ulint symbols_read=0;
		vector<bool> inserted = vector<bool>(256,false);

		int perc,last_perc=-1;

		while(not bwIt->begin()){

			symbol s = bwIt->read();

			if(s==0){

				cout << "ERROR while reading input text : the text contains a 0x0 byte.\n";
				exit(0);

			}

			if(not inserted.at(s)){
				inserted.at(s) = true;
				alphabet.push_back(s);
			}

			perc = (100*symbols_read)/n;

			if(perc>last_perc and (perc%5)==0 and verbose){
				cout << " " << perc << "% done." << endl;
				last_perc=perc;
			}

			symbols_read++;

		}

		if(verbose) cout << " done.\n\n Sorting alphabet ... " << flush;

		std::sort(alphabet.begin(),alphabet.end());

		if(verbose) cout << "done. Alphabet size: sigma = " << alphabet.size() << endl;

		sigma = 1;//code 0x0 is for the terminator

		//if(verbose) cout << "\n Alphabet = { ";

		for (uint64_t i=0;i<alphabet.size();i++){

			if(remapping[alphabet.at(i)]==empty){//new symbol

				remapping[alphabet.at(i)] = sigma;
				sigma++;

			}

			//if(verbose) cout << alphabet.at(i) << ' ';

		}

		//if(verbose) cout << "}\n\n";

		if(verbose) cout << "\n Alphabet (ASCII codes) = { ";

		for (uint64_t i=0;i<alphabet.size();i++)
			if(verbose) cout << (ulint)alphabet.at(i) << ' ';

		if(verbose) cout << "}" << endl;

		TERMINATOR = 0;

		for(uint64_t i=1;i<256;i++)
			if(remapping[i]!=empty)
				inverse_remapping[remapping[i]] = i;

		inverse_remapping[TERMINATOR] = 0;//0 is the terminator appended in the file

		bwIt->rewind();

	}

	void build(uint64_t k, BackwardIterator * bfr, bool verbose){

		this->k=k;
		this->bwIt = bfr;

		sigma_pow_k_minus_one = 1;
		for(uint64_t i=0;i<k-1;i++)
			sigma_pow_k_minus_one *= sigma;

		ulint q = n/(log2(n)*log2(n)) + 1;//hash size: n/log^2 n

		vector<set<ulint> > H = vector<set<ulint> >( q,set<ulint>() );//the hash

		if(verbose) cout << "\n detecting k-mers ... " << endl;

		ulint context = (ulint)0;//first context

		H.at(context%q).insert(context);

		int perc,last_perc=-1;
		ulint symbols_read=0;

		while(not bfr->begin()){

			context = shift(context, ASCIItoCode(bfr->read()) );

			H.at(context%q).insert(context);

			perc = (100*symbols_read)/n;

			if(perc>last_perc and (perc%5)==0 and verbose){
				cout << " " << perc << "% done." << endl;
				last_perc=perc;
			}

			symbols_read++;

		}

		bfr->rewind();

		if(verbose) cout << " done.\n\n sorting k-mers ... " << flush;

		vector<ulint> k_mers;

		for(ulint i=0;i<q;i++)
			for (std::set<ulint>::iterator it=H.at(i).begin(); it!=H.at(i).end(); ++it)
				k_mers.push_back(*it);

		std::sort(k_mers.begin(),k_mers.end());

		number_of_k_mers = k_mers.size();

		if(verbose) cout << "done. " << k_mers.size() << " nonempty contexts of length k = " << k << " (including contexts containing terminator character)"  << endl;

		if(verbose) cout << " building automaton edges ... "<< endl;

		uint64_t nr_of_prefixes=0;
		prefix_nr.push_back(nr_of_prefixes);

		for(uint64_t i=1;i<number_of_k_mers;i++){

			if( prefix(k_mers.at(i)) == prefix(k_mers.at(i-1)) )
				prefix_nr.push_back(nr_of_prefixes);
			else{

				nr_of_prefixes++;
				prefix_nr.push_back(nr_of_prefixes);

			}

		}

		nr_of_prefixes++;

		edges = vector<vector<uint64_t> >(nr_of_prefixes, vector<uint64_t>(sigma,null_ptr)  );

		context = (ulint)0;//first context
		current_state = 0;

		perc=0;
		last_perc=-1;
		symbols_read=0;

		ulint context_from;
		ulint context_to;

		for(ulint i = 0;i<number_of_k_mers;i++ ){//for each k-mer

			context_from = k_mers.at(i);

			for(symbol s = 0;s<sigma;s++){//for each symbol

				if( edge(i,s) == null_ptr ){//edge does not exist: create it

					context_to = shift(context_from, s );

					//search context position and store new pointer

					setEdge(i, s, searchContext(context_to, k_mers));

				}

			}

			perc = (100*i)/number_of_k_mers;
			if(verbose and perc>last_perc and perc%10==0){

				last_perc=perc;
				cout << " " << perc << "% Done." << endl;

			}

		}

		rewind();//go back to initial state

		if(verbose) cout << " done." << endl;
		if(verbose) cout << "\nContext automaton completed." << endl;

	}

	static const uint64_t empty = 256;

	symbol TERMINATOR=0;//0x0

	BackwardIterator * bwIt = NULL;

	vector<symbol> inverse_remapping;//from symbol -> to char (file)
	vector<uint64_t> remapping;//from char (file) -> to symbols in {0,...,sigma-1}

	ulint current_state = 0;
	uint64_t null_ptr = 0;

	vector<uint64_t > prefix_nr;//for each k_mer, address of its prefix in the array edges
	vector<vector<uint64_t> > edges;//sigma edges for each (k-1)-mer

	ulint prefix(ulint context){ return (context - (context%sigma))/sigma; }
	ulint shift(ulint context, symbol s){ return prefix(context) + ((ulint)s)*sigma_pow_k_minus_one;	}

	uint64_t edge(uint64_t state, symbol s){ return edges.at( prefix_nr.at(state) ).at(s); }
	void setEdge(uint64_t state, symbol s, uint64_t value){ edges.at( prefix_nr.at(state) ).at(s) = value; }
	uint64_t searchContext(ulint context, vector<ulint> k_mers){ return std::lower_bound(k_mers.begin(),k_mers.end(),context) - k_mers.begin(); }

	ulint number_of_k_mers = 0;

	uint64_t sigma = 0;//alphabet size
	uint64_t k = 0;//context length
	ulint sigma_pow_k_minus_one = 0;
	ulint n = 0;

};

} /* namespace bwtil */
#endif /* CONTEXTAUTOMATA_H_ */


text:
#include "generator/translator.hpp"

#include "generator/collector_interface.hpp"
#include "generator/emitter_interface.hpp"
#include "generator/intermediate_data.hpp"
#include "generator/osm_element.hpp"

#include "base/assert.hpp"

using namespace feature;

namespace generator
{
Translator::Translator(std::shared_ptr<EmitterInterface> emitter, cache::IntermediateDataReader & cache,
                       std::shared_ptr<FeatureMakerBase> maker, FilterCollection const & filters,
                       CollectorCollection const & collectors)
  : m_filters(filters)
  , m_collectors(collectors)
  , m_tagsEnricher(cache)
  , m_featureMaker(maker)
  , m_emitter(emitter)
  , m_cache(cache)
{
  CHECK(m_emitter, ());
}

Translator::Translator(std::shared_ptr<EmitterInterface> emitter, cache::IntermediateDataReader & cache,
                       std::shared_ptr<FeatureMakerBase> maker)
  : Translator(emitter, cache, maker, {} /* filters */, {} /* collectors */) {}

void Translator::Emit(OsmElement & element)
{
  if (!m_filters.IsAccepted(element))
    return;

  Preprocess(element);
  m_tagsEnricher(element);
  m_collectors.Collect(element);
  m_featureMaker->Add(element);
  FeatureBuilder feature;
  while (m_featureMaker->GetNextFeature(feature))
  {
    if (!m_filters.IsAccepted(feature))
      continue;

    m_collectors.CollectFeature(feature, element);
    m_emitter->Process(feature);
  }
}

bool Translator::Finish()
{
  m_collectors.Save();
  return m_emitter->Finish();
}

void Translator::GetNames(std::vector<std::string> & names) const
{
  m_emitter->GetNames(names);
}

void Translator::AddCollector(std::shared_ptr<CollectorInterface> collector)
{
  m_collectors.Append(collector);
}

void Translator::AddFilter(std::shared_ptr<FilterInterface> filter)
{
  m_filters.Append(filter);
}
}  // namespace generator