text:
/*
    Document   : index
    Created on : 28-oct-2013, 23:26:11
    Author     : jhonangel mireles
    Description:
        Purpose of the stylesheet follows.
*/

root {
    display: block;
}

.moduletable {
    padding: 0;
     color: #FFFFFF;
    font-size: 12px;
    font-weight: bold;
    position: absolute;
    top:90%;
    right: 10%;
    font-family: Helvetica,Arial,Sans-Serif;
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>themes on Website of RRMaximiliano</title>
    <link>https://example.com/categories/themes/</link>
    <description>Recent content in themes on Website of RRMaximiliano</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Mon, 11 Mar 2019 00:00:00 +0000</lastBuildDate><atom:link href="https://example.com/categories/themes/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Markdown Syntax Guide</title>
      <link>https://example.com/post/markdown-syntax/</link>
      <pubDate>Mon, 11 Mar 2019 00:00:00 +0000</pubDate>

      <guid>https://example.com/post/markdown-syntax/</guid>
      <description>
This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme.
</description>
    </item>

  </channel>
</rss>


text:
var config 	     = require('../../config.js');

module.exports = function(app) {
    // This route deals enables HTML5Mode by forwarding missing files to the index.html
    // Security: Free4All
    app.all('/*', function(req, res) {
      // Just send the index.html for other files to support HTML5Mode
      res.sendfile('index.html', { root: config.server.distFolder });
    });
};


text:
from __future__ import print_function, division, absolute_import

import numpy as np

from .common import *
from train.utils import preprocessImage, loadNetwork, predict, loadLabels
from constants import *

test_image = 234 * np.ones((MAX_WIDTH, MAX_HEIGHT, 3), dtype=np.uint8)

def testPreprocessing():
    image = preprocessImage(test_image, INPUT_WIDTH, INPUT_HEIGHT)
    # Check normalization
    assertEq(len(np.where(np.abs(image) > 1)[0]), 0)
    # Check resize
    assertEq(image.size, 3 * INPUT_WIDTH * INPUT_HEIGHT)
    # Check normalization on one element
    assertEq(image[0, 0, 0], ((234 / 255.) - 0.5) * 2)

def testPredict():
    model = loadNetwork(WEIGHTS_PTH, NUM_OUTPUT, MODEL_TYPE)
    x, y = predict(model, test_image)

def testLoadLabels():
    loadLabels(DATASET)
    dataset_no_trailing_slash = DATASET[:-1]
    folders = [DATASET, dataset_no_trailing_slash]
    loadLabels(folders)


text:
import os
import sys

if __name__ == "__main__":
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "generic_infosys.settings")

    from django.core.management import execute_from_command_line

    execute_from_command_line(sys.argv)


text:
<root>
  <item name='suppressed.ExistingExternalName java.lang.String foo()'>
    <annotation name='javax.annotation.Nonnull'/>
  </item>
  <item name='suppressed.SecondSuppression void second()'>
      <annotation name='java.lang.SuppressWarnings'>
          <val val="{DoesntMatterWhat, "SillyAssignment"}"/>
      </annotation>
  </item>
</root>


text:
<?php

/**
 * Root object
 *
 * @author Kirill Gusakov
 */
class InkRouter_Models_OrderInfo
{

    /**
     * Document's header information
     *
     * @var InkRouter_Models_HeaderInfo
     */
    private $headerInfo;

    /**
     * @var InkRouter_Models_PoInfo
     */
    private $poInfo;

    /**
     * @var InkRouter_Models_Order
     */
    private $order;

    /**
     * @var string
     */
    private $printCustomerId;

    /**
     * @return InkRouter_Models_HeaderInfo
     */
    public function getHeaderInfo()
    {
        return $this->headerInfo;
    }

    /**
     * @param InkRouter_Models_HeaderInfo $headerInfo
     * @return InkRouter_Models_OrderInfo
     */
    public function setHeaderInfo(InkRouter_Models_HeaderInfo $headerInfo)
    {
        $this->headerInfo = $headerInfo;
        return $this;
    }

    /**
     * @return InkRouter_Models_PoInfo
     */
    public function getPoInfo()
    {
        return $this->poInfo;
    }

    /**
     * @param InkRouter_Models_PoInfo $poInfo
     * @return InkRouter_Models_OrderInfo
     */
    public function setPoInfo(InkRouter_Models_PoInfo $poInfo)
    {
        $this->poInfo = $poInfo;
        return $this;
    }

    /**
     * @return InkRouter_Models_Order
     */
    public function getOrder()
    {
        return $this->order;
    }

    /**
     * @param InkRouter_Models_Order $order
     * @return InkRouter_Models_OrderInfo
     */
    public function setOrder(InkRouter_Models_Order $order)
    {
        $this->order = $order;
        return $this;
    }

    /**
     * @return string
     */
    public function getPrintCustomerId()
    {
        return $this->printCustomerId;
    }

    /**
     * @param string $printCustomerId
     * @return InkRouter_Models_OrderInfo
     */
    public function setPrintCustomerId($printCustomerId)
    {
        $this->printCustomerId = $printCustomerId;
        return $this;
    }

    /**
     * @param bool $root
     * @return string
     */
    public function pack($root = false)
    {
        $writer = new XMLWriter();
        $writer->openMemory();
        if ($root) {
           $writer->startDocument();
        }

        $writer->startElement('order_info');

        if (isset($this->headerInfo)) {
            $writer->writeRaw($this->headerInfo->pack());
        }

        if (isset($this->poInfo)) {
            $writer->writeRaw($this->poInfo->pack());
        }

        if (isset($this->order)) {
            $writer->writeRaw($this->order->pack());
        }

        if (isset($this->printCustomerId)) {
            $writer->writeElement('print_customer_id', $this->printCustomerId);
        }

        $writer->endElement();

        return $writer->outputMemory();
    }
}


text:
id }}'>

        id }}'>

                <svg xmlns='http://www.w3.org/2000/svg' width='8' height='14'
                     class='nb-summary-icon nb-summary-icon--small' preserveAspectRatio='xMidYMid' viewBox='0 0 8 14'>
                    <path fill-rule='evenodd' d='M1 1l5.398 5.714L1 12.429' class='cls-arrow-aquarium--round'/>
                </svg>
                {{ $model->question }}

                    {{ $model->answer }}

					id }});'>Изменить
					/
					id }}, 0);'>Удалить

                <input id='js-faq-question-{{ $model->id }}' type='hidden' value='Могу ли я скачивать музыку.'
                       name='faq[{{ $model->id }}][question]'/>
                <input id='js-faq-answer-{{ $model->id }}' type='hidden'
                       value='Для некоторых треков доступна загрузка. Ищите треки с пометкой.'
                       name='faq[{{ $model->id }}][answer]'/>

                        <input id='js-full-desc-question' type='text' class='nb-input' placeholder='Введите вопрос'
                               value='{{ $model->question }}'>

                        <textarea id='js-full-desc-answer' class='nb-textarea' placeholder='Введите ответ'>{{ $model->answer }}</textarea>

                    <button type='button' onclick='updateEditFAQInfo({{ $model->id }});'
                            class='nb-btn nb-btn--add-media create-full-description__btn--add-media'>Сохранить
                    </button>

                        id }});'
                           class='nb-link nb-create-question__editing__cancel__link'>Отменить


text:
package io.apicurio.hub.api.gitlab;

import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.zip.ZipInputStream;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;

import org.apache.commons.codec.binary.Base64;
import org.apache.http.Header;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.mashape.unirest.http.exceptions.UnirestException;
import com.mashape.unirest.request.HttpRequest;

import io.apicurio.hub.api.beans.GitLabAction;
import io.apicurio.hub.api.beans.GitLabAction.GitLabActionType;
import io.apicurio.hub.api.beans.GitLabCreateFileRequest;
import io.apicurio.hub.api.beans.GitLabGroup;
import io.apicurio.hub.api.beans.GitLabProject;
import io.apicurio.hub.api.beans.ResourceContent;
import io.apicurio.hub.api.beans.SourceCodeBranch;
import io.apicurio.hub.api.connectors.AbstractSourceConnector;
import io.apicurio.hub.api.connectors.SourceConnectorException;
import io.apicurio.hub.core.beans.ApiDesignResourceInfo;
import io.apicurio.hub.core.beans.LinkedAccountType;
import io.apicurio.hub.core.config.HubConfiguration;
import io.apicurio.hub.core.exceptions.ApiValidationException;
import io.apicurio.hub.core.exceptions.NotFoundException;

/**
 * Implementation of the GitLab source connector.
 *
 * @author eric.wittmann@gmail.com
 */
@ApplicationScoped
public class GitLabSourceConnector extends AbstractSourceConnector implements IGitLabSourceConnector {

    private static Logger logger = LoggerFactory.getLogger(GitLabSourceConnector.class);

    protected static final Object TOKEN_TYPE_PAT = "PAT";
    protected static final Object TOKEN_TYPE_OAUTH = "OAUTH";
    private static final int DEFAULT_PAGE_SIZE = 20;

    @Inject
    private HubConfiguration config;
    @Inject
    private GitLabResourceResolver resolver;

    private String apiUrl;

    /**
     * @see io.apicurio.hub.api.connectors.ISourceConnector#getType()
     */
    @Override
    public LinkedAccountType getType() {
        return LinkedAccountType.GitLab;
    }

    /**
     * @see AbstractSourceConnector#getBaseApiEndpointUrl()
     */
    @Override
    protected String getBaseApiEndpointUrl() {
        if (apiUrl == null) {
            apiUrl = this.config.getGitLabApiUrl();
        }
        return apiUrl;
    }

    /**
     * @see io.apicurio.hub.api.connectors.AbstractSourceConnector#parseExternalTokenResponse(java.lang.String)
     */
    @Override
    protected Map<String, String> parseExternalTokenResponse(String body) {
        try {
            Map<String, String> rval = new HashMap<>();
            JsonNode jsonNode = mapper.readTree(body);
            rval.put("access_token", jsonNode.get("access_token").asText());
            rval.put("token_type", jsonNode.get("token_type").asText());
            rval.put("refresh_token", jsonNode.get("refresh_token").asText());
            rval.put("scope", jsonNode.get("scope").asText());
            rval.put("created_at", jsonNode.get("created_at").asText());
            rval.put("id_token", jsonNode.get("id_token").asText());
            return rval;
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    /**
     * @see io.apicurio.hub.api.connectors.ISourceConnector#validateResourceExists(String)
     */
    @Override
    public ApiDesignResourceInfo validateResourceExists(String repositoryUrl) throws NotFoundException, SourceConnectorException, ApiValidationException {
        logger.debug("Validating the existence of resource {}", repositoryUrl);
        try {
            GitLabResource resource = resolver.resolve(repositoryUrl);

            if (resource == null) {
                throw new NotFoundException();
            }
            String content = getResourceContent(resource);

            ApiDesignResourceInfo info = ApiDesignResourceInfo.fromContent(content);
            if (info.getName() == null) {
                info.setName(resource.getResourcePath());
            }
            return info;
        } catch (NotFoundException nfe) {
            throw nfe;
        } catch (ApiValidationException ave) {
            throw ave;
        } catch (Exception e) {
            throw new SourceConnectorException("Error checking that a GitLab resource exists.", e);
        }
    }

    /**
     * Gets the content of the given GitLab resource.  This is done by querying for the
     * content using the GH API.
     *
     * @param resource
     */
    private String getResourceContent(GitLabResource resource) throws NotFoundException, SourceConnectorException {
        logger.debug("Getting resource content for: {}/{} - {}",
                resource.getGroup(), resource.getProject(), resource.getResourcePath());

        ResourceContent content = getResourceContentFromGitLab(resource);

        return content.getContent();
    }

    /**
     * Adds security information to the http request.
     * @param request
     */
    protected void addSecurity(HttpRequestBase request) throws SourceConnectorException {
        if (this.getExternalTokenType() == TOKEN_TYPE_PAT) {
            request.addHeader("PRIVATE-TOKEN", getExternalToken());
        }
        if (this.getExternalTokenType() == TOKEN_TYPE_OAUTH) {
            request.addHeader("Authorization", "Bearer " + getExternalToken());
        }
    }

    /**
     * @return the type of the external token (either private or oauth)
     */
    protected Object getExternalTokenType() {
        return TOKEN_TYPE_OAUTH;
    }

    /**
     * @see io.apicurio.hub.api.connectors.ISourceConnector#getResourceContent(String)
     */
    @Override
    public ResourceContent getResourceContent(String repositoryUrl) throws NotFoundException, SourceConnectorException {
        GitLabResource resource = resolver.resolve(repositoryUrl);
        return getResourceContentFromGitLab(resource);
    }

    /**
     * @see io.apicurio.hub.api.connectors.ISourceConnector#updateResourceContent(String, String, String, ResourceContent)
     */
    @Override
    public String updateResourceContent(String repositoryUrl, String commitMessage, String commitComment,
                                        ResourceContent content) throws SourceConnectorException {
        String rval = commitToGitLab(repositoryUrl, content.getContent(), commitMessage, false);
        if (commitComment != null && !commitComment.trim().isEmpty()) {
            addCommitComment(repositoryUrl, rval, commitComment);
        }
        return rval;
    }

    /**
     * Uses the GH API to add a commit comment.
     *
     * @param repositoryUrl
     * @param commitSha
     * @param commitComment
     * @throws UnirestException
     * @throws SourceConnectorException
     */
    private void addCommitComment(String repositoryUrl, String commitSha, String commitComment)
            throws SourceConnectorException {

        GitLabResource resource = resolver.resolve(repositoryUrl);

        String urlEncodedId = toEncodedId(resource);
        String addCommentUrl = this.endpoint("/api/v4/projects/:id/repository/commits/:sha/comments")
                .bind("id", urlEncodedId)
                .bind("sha", commitSha)
                .toString();

        // TODO reuse the HTTP client!!
        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
            HttpPost post = new HttpPost(addCommentUrl);
            addSecurity(post);
            // Set note as a form body parameter
            List<NameValuePair> nvps = new ArrayList<NameValuePair>();
            nvps.add(new BasicNameValuePair("note", commitComment));
            post.setEntity(new UrlEncodedFormEntity(nvps));

            try (CloseableHttpResponse response = httpClient.execute(post)) {
                if (response.getStatusLine().getStatusCode() != 201) {
                    throw new SourceConnectorException("Unexpected response from GitLab: " + response.getStatusLine().toString());
                }
            }
        } catch (IOException e) {
            throw new SourceConnectorException("Error adding comment to GitLab commit.", e);
        }
    }

    /**
     * @see io.apicurio.hub.api.connectors.ISourceConnector#createResourceContent(String, String, String)
     */
    @Override
    public void createResourceContent(String repositoryUrl, String commitMessage, String content) throws SourceConnectorException {
        commitToGitLab(repositoryUrl, content, commitMessage, true);
    }

    /**
     * @see IGitLabSourceConnector#getGroups()
     */
    @Override
    public Collection<GitLabGroup> getGroups() throws GitLabException, SourceConnectorException {
        logger.debug("Getting the GitLab groups for current user");

        Collection<GitLabGroup> rval = new HashSet<>();
        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {

            // Get the user's personal group
            HttpGet get = new HttpGet(this.endpoint("/api/v4/user").toString());
            get.addHeader("Accept", "application/json");
            addSecurity(get);
            try (CloseableHttpResponse response = httpClient.execute(get)) {
                if (response.getStatusLine().getStatusCode() != 200) {
                    throw new SourceConnectorException("Error getting GitLab user information: " + response.getStatusLine().getReasonPhrase());
                }
                try (InputStream contentStream = response.getEntity().getContent()) {
                    JsonNode node = mapper.readTree(contentStream);
                    if (node.isObject()) {
                        int id = node.get("id").asInt();
                        String username = node.get("username").asText();
                        String fullName = node.get("name").asText();
                        GitLabGroup glg = new GitLabGroup();
                        glg.setId(id);
                        glg.setName(fullName);
                        glg.setPath(username);
                        glg.setFull_path(username);
                        glg.setUserGroup(true);
                        rval.add(glg);
                    }
                }
            }

            // Now get all the groups the user has access to
            Endpoint endpoint = pagedEndpoint("/api/v4/groups", 1, DEFAULT_PAGE_SIZE);

            // Set the "all_available" and "min_access_level" params, if configured.
            String allAvailable = this.config.getGitLabGroupAllAvailable();
            if (allAvailable != null && !allAvailable.isEmpty()) {
                endpoint.queryParam("all_available", allAvailable);
            }
            String minAccessLevel = this.config.getGitLabGroupMinAccessLevel();
            if (minAccessLevel != null && !minAccessLevel.isEmpty()) {
                endpoint.queryParam("min_access_level", minAccessLevel);
            }

            Collection<GitLabGroup> groups = getAllGroups(httpClient, endpoint);
            rval.addAll(groups);
        } catch (IOException e) {
            throw new GitLabException("Error getting GitLab groups.", e);
        }
        return rval;
    }

    /**
     * Gets the full list of groups - handles paged results.
     * @param httpClient
     * @param endpoint
     * @throws IOException
     * @throws SourceConnectorException
     */
    private Collection<GitLabGroup> getAllGroups(CloseableHttpClient httpClient, Endpoint endpoint) throws IOException, SourceConnectorException {
        Collection<GitLabGroup> groups = new ArrayList<>();

        String nextPageUrl = addGroups(httpClient, endpoint, groups);
        while (nextPageUrl != null) {
            Endpoint nextEndpoint = new Endpoint(nextPageUrl);
            nextPageUrl = addGroups(httpClient, nextEndpoint, groups);
        }
        return groups;
    }

    /**
     * Queries the given endpoint, reads the resulting groups, adds all of the groups it finds
     * to the collection of groups, and then returns a URL of the next page of results.
     * @param httpClient
     * @param endpoint
     * @param groups
     * @throws IOException
     * @throws SourceConnectorException
     */
    private String addGroups(CloseableHttpClient httpClient, Endpoint endpoint,
            Collection<GitLabGroup> groups) throws IOException, SourceConnectorException {
        HttpGet get = new HttpGet(endpoint.toString());
        get.addHeader("Accept", "application/json");
        addSecurity(get);
        try (CloseableHttpResponse response = httpClient.execute(get)) {
            if (response.getStatusLine().getStatusCode() != 200) {
                throw new SourceConnectorException(
                        "Error getting GitLab groups: " + response.getStatusLine().getReasonPhrase());
            }
            try (InputStream contentStream = response.getEntity().getContent()) {
                JsonNode node = mapper.readTree(contentStream);
                if (node.isArray()) {
                    ArrayNode array = (ArrayNode) node;
                    array.forEach(obj -> {
                        JsonNode org = obj;
                        int id = org.get("id").asInt();
                        String name = org.get("name").asText();
                        String path = org.get("path").asText();
                        String fullPath = org.get("full_path").asText();
                        GitLabGroup glg = new GitLabGroup();
                        glg.setId(id);
                        glg.setName(name);
                        glg.setPath(path);
                        glg.setFull_path(fullPath);
                        groups.add(glg);
                    });
                }
            }
            Header linkHeader = response.getFirstHeader("Link");
            return getNextPage(linkHeader);
        }
    }

    /**
     * @see io.apicurio.hub.api.gitlab.IGitLabSourceConnector#getProjects(java.lang.String)
     */
    @Override
    public Collection<GitLabProject> getProjects(String group) throws GitLabException, SourceConnectorException {
        logger.debug("Getting the projects from group {}", group);

        Collection<GitLabProject> rval = new HashSet<>();
        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {

            // Get the user's personal group
//            String gitLabUsername = null;
            String gitLabUserId = null;
            HttpGet get = new HttpGet(this.endpoint("/api/v4/user").toString());
            get.addHeader("Accept", "application/json");
            addSecurity(get);
            try (CloseableHttpResponse response = httpClient.execute(get)) {
                if (response.getStatusLine().getStatusCode() != 200) {
                    throw new SourceConnectorException("Error getting GitLab user information: " + response.getStatusLine().getReasonPhrase());
                }
                try (InputStream contentStream = response.getEntity().getContent()) {
                    JsonNode node = mapper.readTree(contentStream);
                    if (node.isObject()) {
//                        gitLabUsername = node.get("username").asText();
                        gitLabUserId = node.get("id").asText();
                    }
                }
            }

            if (group != null && group.equalsIgnoreCase(gitLabUserId)) {
                // List all user projects
                //////////////////////////////
                Endpoint endpoint = pagedEndpoint("/api/v4/users/:user_id/projects", 1, DEFAULT_PAGE_SIZE).bind("user_id", gitLabUserId);
                Collection<GitLabProject> projects = getAllProjects(httpClient, endpoint);
                rval.addAll(projects);
            } else {
                // List all group projects
                //////////////////////////////
                String gid = toId(group);
                Endpoint endpoint = pagedEndpoint("/api/v4/groups/:group/projects", 1, DEFAULT_PAGE_SIZE).bind("group", gid);
                Collection<GitLabProject> projects = getAllProjects(httpClient, endpoint);
                rval.addAll(projects);
            }
        } catch (IOException e) {
            throw new GitLabException("Error getting GitLab repositories.", e);
        }
        return rval;
    }

    /**
     * Gets all of the projects using the given endpoint.  This handles paging by following the Link
     * HTTP header returned by GitLab.
     * @param httpClient
     * @param endpoint
     * @throws IOException
     * @throws SourceConnectorException
     */
    private Collection<GitLabProject> getAllProjects(CloseableHttpClient httpClient, Endpoint endpoint) throws IOException, SourceConnectorException {
        Collection<GitLabProject> projects = new ArrayList<>();

        String nextPageUrl = addProjects(httpClient, endpoint, projects);
        while (nextPageUrl != null) {
            Endpoint nextEndpoint = new Endpoint(nextPageUrl);
            nextPageUrl = addProjects(httpClient, nextEndpoint, projects);
        }
        return projects;
    }

    /**
     * Queries the given endpoint, reads the resulting projects, adds all of the projects it finds
     * to the collection of projects, and then returns a URL of the next page of results.
     * @param httpClient
     * @param endpoint
     * @param projects
     * @throws IOException
     * @throws SourceConnectorException
     */
    private String addProjects(CloseableHttpClient httpClient, Endpoint endpoint,
            Collection<GitLabProject> projects) throws IOException, SourceConnectorException {
        HttpGet get = new HttpGet(endpoint.toString());
        get.addHeader("Accept", "application/json");
        addSecurity(get);

        try (CloseableHttpResponse response = httpClient.execute(get)) {
            try (InputStream contentStream = response.getEntity().getContent()) {
                JsonNode node = mapper.readTree(contentStream);
                if (node.isArray()) {
                    ArrayNode array = (ArrayNode) node;
                    array.forEach(obj -> {
                        JsonNode project = obj;
                        int id = project.get("id").asInt();
                        String name = project.get("name").asText();
                        String path = project.get("path").asText();
                        String fullPath = project.get("path_with_namespace").asText();
                        GitLabProject glp = new GitLabProject();
                        glp.setId(id);
                        glp.setName(name);
                        glp.setPath(path);
                        glp.setFull_path(fullPath);
                        projects.add(glp);
                    });
                }
            }
            Header linkHeader = response.getFirstHeader("Link");
            return getNextPage(linkHeader);
        }
    }

    /**
     * @see io.apicurio.hub.api.gitlab.IGitLabSourceConnector#getBranches(java.lang.String)
     */
    @Override
    public Collection<SourceCodeBranch> getBranches(String projectId)
            throws GitLabException, SourceConnectorException {
        logger.debug("Getting the branches for {}", projectId);

        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
            Endpoint endpoint = pagedEndpoint("/api/v4/projects/:id/repository/branches", 1, DEFAULT_PAGE_SIZE)
                    .bind("id", toEncodedId(projectId));
            return getAllBranches(httpClient, endpoint);
        } catch (IOException e) {
            throw new GitLabException("Error getting GitLab branches.", e);
        }
    }

    /**
     * Gets all branches using the given endpoint.  Handles paging by following the Link HTTP header
     * returned by GitLab.
     * @param httpClient
     * @param endpoint
     * @throws IOException
     * @throws SourceConnectorException
     */
    private Collection<SourceCodeBranch> getAllBranches(CloseableHttpClient httpClient, Endpoint endpoint) throws IOException, SourceConnectorException {
        Collection<SourceCodeBranch> branches = new ArrayList<>();

        String nextPageUrl = addBranches(httpClient, endpoint, branches);
        while (nextPageUrl != null) {
            Endpoint nextEndpoint = new Endpoint(nextPageUrl);
            nextPageUrl = addBranches(httpClient, nextEndpoint, branches);
        }
        return branches;
    }

    /**
     * Queries the given endpoint, reads the resulting branches, adds all of the branches it finds
     * to the collection of branches, and then returns a URL of the next page of results.
     * @param httpClient
     * @param endpoint
     * @param branches
     * @throws IOException
     * @throws SourceConnectorException
     */
    private String addBranches(CloseableHttpClient httpClient, Endpoint endpoint,
            Collection<SourceCodeBranch> branches) throws IOException, SourceConnectorException {
        HttpGet get = new HttpGet(endpoint.toString());
        get.addHeader("Accept", "application/json");
        addSecurity(get);

        try (CloseableHttpResponse response = httpClient.execute(get)) {
            try (InputStream contentStream = response.getEntity().getContent()) {
                JsonNode node = mapper.readTree(contentStream);
                if (node.isArray()) {
                    ArrayNode array = (ArrayNode) node;
                    array.forEach(obj -> {
                        JsonNode branch = obj;
                        SourceCodeBranch glBranch = new SourceCodeBranch();
                        glBranch.setName(branch.get("name").asText());
                        glBranch.setCommitId(branch.get("commit").get("id").asText());
                        branches.add(glBranch);
                    });
                }
            }
            Header linkHeader = response.getFirstHeader("Link");
            return getNextPage(linkHeader);
        }
    }

    /**
     * Convenience for getting an endpoint with the page and page size configured.
     * @param path
     * @param page
     * @param perPage
     */
    private Endpoint pagedEndpoint(String path, int page, int perPage){
        return this.endpoint(path)
                .queryParam("page", String.valueOf(page))
                .queryParam("per_page", String.valueOf(perPage));
    }

    /**
     * @see AbstractSourceConnector#addSecurityTo(HttpRequest)
     */
    @Override
    protected void addSecurityTo(HttpRequest request) throws SourceConnectorException {
        // TODO: not currently supported because we're not using Unirest as our HTTP client.  We'll convert *all* clients to use Apache HTTP Client soon and this method will change
    }

    /**
     * Commits new repository file content to GitLab.
     * @param repositoryUrl
     * @param content
     * @param commitMessage
     * @param create
     * @throws SourceConnectorException
     */
    private String commitToGitLab(String repositoryUrl, String content, String commitMessage, boolean create) throws SourceConnectorException {

        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
            GitLabResource resource = resolver.resolve(repositoryUrl);

            String contentUrl = this.endpoint("/api/v4/projects/:id/repository/commits")
                    .bind("id", toEncodedId(resource))
                    .toString();

            HttpPost post = new HttpPost(contentUrl);
            post.addHeader("Content-Type", "application/json");
            addSecurity(post);

            GitLabCreateFileRequest body = new GitLabCreateFileRequest();
            body.setBranch(resource.getBranch());
            body.setCommitMessage(commitMessage);

            body.setActions(new ArrayList<>());
            GitLabAction action = new GitLabAction();
            String b64Content = Base64.encodeBase64String(content.getBytes(StandardCharsets.UTF_8));
            action.setGitLabAction(GitLabActionType.UPDATE);
            if (create) {
                action.setGitLabAction(GitLabActionType.CREATE);
            }
            action.setFilePath(resource.getResourcePath());
            action.setContent(b64Content);
            action.setEncoding("base64");
            body.getActions().add(action);

            // Set the POST body
            post.setEntity(new StringEntity(mapper.writeValueAsString(body),StandardCharsets.UTF_8));

            try (CloseableHttpResponse response = httpClient.execute(post)) {
                if (response.getStatusLine().getStatusCode() != 201) {
                    throw new SourceConnectorException("Unexpected response from GitLab: " + response.getStatusLine().toString());
                }
                try (InputStream contentStream = response.getEntity().getContent()) {
                    JsonNode node = mapper.readTree(contentStream);
                    return node.get("id").asText();
                }
            }
        } catch (IOException e) {
            throw new SourceConnectorException("Error creating GitLab resource content.", e);
        }
    }

    /**
     * Gets the actual content of a resource.  Returns the raw content and the commit id.
     * @param resource
     * @throws NotFoundException
     * @throws SourceConnectorException
     */
    private ResourceContent getResourceContentFromGitLab(GitLabResource resource) throws NotFoundException, SourceConnectorException {
        try (CloseableHttpClient httpClient = HttpClients.createSystem()) {
            String getContentUrl = this.endpoint("/api/v4/projects/:id/repository/files/:path")
                    .bind("id", toEncodedId(resource))
                    .bind("path", toEncodedPath(resource))
                    .queryParam("ref", resource.getBranch())
                    .toString();

            HttpGet get = new HttpGet(getContentUrl);
            get.addHeader("Accept", "application/json");
            get.addHeader("Cache-Control", "no-cache");
            get.addHeader("Postman-Token", "4d2517bb-72d0-9175-1cbe-04d61e9258a0");
            get.addHeader("DNT", "1");
            get.addHeader("Accept-Language", "en-US,en;q=0.8");

            try {
                addSecurity(get);
            } catch (Exception e) {
                // If adding security fails, just go ahead and try without security.  If it's a public
                // repository then this will work.  If not, then it will fail with a 404.
            }

            try (CloseableHttpResponse response = httpClient.execute(get)) {
                if (response.getStatusLine().getStatusCode() == 404) {
                    throw new NotFoundException();
                }
                if (response.getStatusLine().getStatusCode() != 200) {
                    throw new SourceConnectorException("Unexpected response from GitLab: " + response.getStatusLine().toString());
                }

                try (InputStream contentStream = response.getEntity().getContent()) {
                    Map<String, Object> jsonContent = mapper.readerFor(Map.class).readValue(contentStream);
                    String b64Content = jsonContent.get("content").toString();
                    String content = new String(Base64.decodeBase64(b64Content), StandardCharsets.UTF_8);
                    ResourceContent rval = new ResourceContent();

                    rval.setContent(content);
                    rval.setSha(jsonContent.get("commit_id").toString());

                    return rval;
                }
            }
        } catch (IOException e) {
            throw new SourceConnectorException("Error getting GitLab resource content.", e);
        }
    }

    /**
     * @see io.apicurio.hub.api.connectors.ISourceConnector#createPullRequestFromZipContent(java.lang.String, java.lang.String, java.util.zip.ZipInputStream)
     */
    @Override
    public String createPullRequestFromZipContent(String repositoryUrl, String commitMessage,
            ZipInputStream generatedContent) throws SourceConnectorException {
        return null;
    }

    private String toId(String value) {
        try {
            return URLEncoder.encode(value, StandardCharsets.UTF_8.name())
                    .replaceAll("\\+", "%20");
        } catch (UnsupportedEncodingException e) {
            return value;
        }
    }

    private String toEncodedId(GitLabResource resource) {
        return toEncodedId(resource.getGroup(), resource.getProject());
    }

    private String toEncodedId(String project) {
        return toId(String.format("%s",project));
    }

    private String toEncodedId(String group, String project) {
        return toId(String.format("%s/%s", group, project));
    }

    private String toEncodedPath(GitLabResource resource) {
        return toId(resource.getResourcePath());
    }

    private String getNextPage(Header linkHeader) {
        if (linkHeader != null) {
            String linkValue = linkHeader.getValue();
            if (linkValue != null) {
                String[] links = linkValue.split(",");
                for (String link : links) {
                    link = link.trim();
                    int idx = link.indexOf(">; rel=\"");
                    if (idx > 0) {
                        String label = link.substring(idx + 8, link.length() - 1);
                        if (label.equals("next")) {
                            return link.substring(1, idx);
                        }
                    }
                }
            }
        }
        return null;
    }
}


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

namespace Org.Apache.CuratorNet.Framework.API
{
    public interface IGetChildrenBuilder :
        IWatchable<IBackgroundPathable<List<String>>>,
        IBackgroundPathable<List<String>>,
        IStatable<IWatchPathable<List<String>>>
    {
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
org.apache.tools.ant.taskdefs.optional.jsp.compilers (Apache Ant API)
</TITLE>

<META NAME="date" CONTENT="2013-07-08">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../../stylesheet.css" TITLE="Style">

org.apache.tools.ant.taskdefs.optional.jsp.compilers

Interfaces

JspCompilerAdapter

Classes

DefaultJspCompilerAdapter

JasperC

JspCompilerAdapterFactory


text:
package com.bernardomg.tabletop.dice.test.unit.notation.operation;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

import com.bernardomg.tabletop.dice.notation.DiceNotationExpression;
import com.bernardomg.tabletop.dice.notation.operand.IntegerOperand;
import com.bernardomg.tabletop.dice.notation.operation.BinaryOperation;
import com.bernardomg.tabletop.dice.notation.operation.MultiplicationOperation;

@DisplayName("Tests for MultiplicationOperation")
public final class TestMultiplicationOperation {

    public TestMultiplicationOperation() {
        super();
    }

    @Test
    @DisplayName("The text expression is generated correctly for negatives")
    public final void test_TextExpression_Negatives() {
        final BinaryOperation operation;    // Tested operation
        final DiceNotationExpression left;  // Left operand
        final DiceNotationExpression right; // Right operand

        left = new IntegerOperand(-1);
        right = new IntegerOperand(-2);

        operation = new MultiplicationOperation(left, right);

        Assertions.assertEquals("-1*-2", operation.getExpression());
    }

    @Test
    @DisplayName("The text expression is generated correctly")
    public final void test_TextExpression_Positives() {
        final BinaryOperation operation;    // Tested operation
        final DiceNotationExpression left;  // Left operand
        final DiceNotationExpression right; // Right operand

        left = new IntegerOperand(1);
        right = new IntegerOperand(2);

        operation = new MultiplicationOperation(left, right);

        Assertions.assertEquals("1*2", operation.getExpression());
    }

}


text:
'use strict';
var async = require('async');

module.exports = function(Payment) {

  Payment.observe('before save', function(ctx, next) {
    var model = ctx.instance;

    async.parallel({
      update: updateModel.bind(null, model),
      process: processPayment.bind(null, model)
    });

    next();
  });

  var updateModel = function(model, cb) {
    model.mlId = model.id;
    model.unsetAttribute('id');

    cb();
  }

  var processPayment = function(model, cb) {
    var mp = Payment.app.mp;

    mp.getPayment(model.mlId, function (err, data) {
      handlePaymentInfo(err, data, cb, model);
      cb();
    });
  }

  function handlePaymentInfo(err, data, cb, model) {
    if(err) {
      throw new err;
    }

    console.log(data.response.collection);
    model.updateAll({ id: model.id }, data.response.collection, function(err, results) {
      if(err) {
        cb(err);
      }

      console.log(results);
    });
  }

};


text:
What are you slated for today? Keep track of it all with this handy Pebble app.

Now with tests!


text:
package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation;

import retrofit2.Retrofit;
import com.google.common.reflect.TypeToken;
import com.microsoft.azure.CloudException;
import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ILRRequestResource;
import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.Validator;
import java.io.IOException;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.Path;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.Response;
import rx.functions.Func1;
import rx.Observable;

/**
 * An instance of this class provides access to all the operations defined
 * in ItemLevelRecoveryConnections.
 */
public class ItemLevelRecoveryConnectionsInner {
    /** The Retrofit service to perform REST calls. */
    private ItemLevelRecoveryConnectionsService service;
    /** The service client containing this operation class. */
    private RecoveryServicesBackupClientImpl client;

    /**
     * Initializes an instance of ItemLevelRecoveryConnectionsInner.
     *
     * @param retrofit the Retrofit instance built from a Retrofit Builder.
     * @param client the instance of the service client containing this operation class.
     */
    public ItemLevelRecoveryConnectionsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) {
        this.service = retrofit.create(ItemLevelRecoveryConnectionsService.class);
        this.client = client;
    }

    /**
     * The interface defining all the services for ItemLevelRecoveryConnections to be
     * used by Retrofit to perform actually REST calls.
     */
    interface ItemLevelRecoveryConnectionsService {
        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ItemLevelRecoveryConnections revoke" })
        @POST("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/revokeInstantItemRecovery")
        Observable<Response<ResponseBody>> revoke(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("fabricName") String fabricName, @Path("containerName") String containerName, @Path("protectedItemName") String protectedItemName, @Path("recoveryPointId") String recoveryPointId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ItemLevelRecoveryConnections provision" })
        @POST("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/provisionInstantItemRecovery")
        Observable<Response<ResponseBody>> provision(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("fabricName") String fabricName, @Path("containerName") String containerName, @Path("protectedItemName") String protectedItemName, @Path("recoveryPointId") String recoveryPointId, @Query("api-version") String apiVersion, @Body ILRRequestResource resourceILRRequest, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

    }

    /**
     * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer displaying all recoverable files and folders. This is an asynchronous operation.
     *
     * @param vaultName The name of the Recovery Services vault.
     * @param resourceGroupName The name of the resource group associated with the Recovery Services vault.
     * @param fabricName The fabric name associated with the backup items. The value allowed is Azure.
     * @param containerName The container name associated with the backup items.
     * @param protectedItemName The name of the backup items whose files or folders will be restored.
     * @param recoveryPointId The string that identifies the recovery point. The iSCSI connection will be revoked for this protected data.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     */
    public void revoke(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId) {
        revokeWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId).toBlocking().single().body();
    }

    /**
     * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer displaying all recoverable files and folders. This is an asynchronous operation.
     *
     * @param vaultName The name of the Recovery Services vault.
     * @param resourceGroupName The name of the resource group associated with the Recovery Services vault.
     * @param fabricName The fabric name associated with the backup items. The value allowed is Azure.
     * @param containerName The container name associated with the backup items.
     * @param protectedItemName The name of the backup items whose files or folders will be restored.
     * @param recoveryPointId The string that identifies the recovery point. The iSCSI connection will be revoked for this protected data.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<Void> revokeAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, final ServiceCallback<Void> serviceCallback) {
        return ServiceFuture.fromResponse(revokeWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId), serviceCallback);
    }

    /**
     * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer displaying all recoverable files and folders. This is an asynchronous operation.
     *
     * @param vaultName The name of the Recovery Services vault.
     * @param resourceGroupName The name of the resource group associated with the Recovery Services vault.
     * @param fabricName The fabric name associated with the backup items. The value allowed is Azure.
     * @param containerName The container name associated with the backup items.
     * @param protectedItemName The name of the backup items whose files or folders will be restored.
     * @param recoveryPointId The string that identifies the recovery point. The iSCSI connection will be revoked for this protected data.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceResponse} object if successful.
     */
    public Observable<Void> revokeAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId) {
        return revokeWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId).map(new Func1<ServiceResponse<Void>, Void>() {
            @Override
            public Void call(ServiceResponse<Void> response) {
                return response.body();
            }
        });
    }

    /**
     * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer displaying all recoverable files and folders. This is an asynchronous operation.
     *
     * @param vaultName The name of the Recovery Services vault.
     * @param resourceGroupName The name of the resource group associated with the Recovery Services vault.
     * @param fabricName The fabric name associated with the backup items. The value allowed is Azure.
     * @param containerName The container name associated with the backup items.
     * @param protectedItemName The name of the backup items whose files or folders will be restored.
     * @param recoveryPointId The string that identifies the recovery point. The iSCSI connection will be revoked for this protected data.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceResponse} object if successful.
     */
    public Observable<ServiceResponse<Void>> revokeWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId) {
        if (vaultName == null) {
            throw new IllegalArgumentException("Parameter vaultName is required and cannot be null.");
        }
        if (resourceGroupName == null) {
            throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
        }
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (fabricName == null) {
            throw new IllegalArgumentException("Parameter fabricName is required and cannot be null.");
        }
        if (containerName == null) {
            throw new IllegalArgumentException("Parameter containerName is required and cannot be null.");
        }
        if (protectedItemName == null) {
            throw new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.");
        }
        if (recoveryPointId == null) {
            throw new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        return service.revoke(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, protectedItemName, recoveryPointId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
                @Override
                public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<Void> clientResponse = revokeDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<Void> revokeDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
        return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter())
                .register(202, new TypeToken<Void>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens File Explorer which displays the recoverable files and folders. This is an asynchronous operation. To get the provisioning status, call GetProtectedItemOperationResult API.
     *
     * @param vaultName The name of the Recovery Services vault.
     * @param resourceGroupName The name of the resource group associated with the Recovery Services vault.
     * @param fabricName The fabric name associated with the backup items.
     * @param containerName The container name associated with the backup items.
     * @param protectedItemName The name of the backup item whose files or folders are to be restored.
     * @param recoveryPointId The recovery point ID for backup data. The iSCSI connection will be provisioned for this backup data.
     * @param resourceILRRequest The resource Item Level Recovery (ILR) request.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     */
    public void provision(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, ILRRequestResource resourceILRRequest) {
        provisionWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, resourceILRRequest).toBlocking().single().body();
    }

    /**
     * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens File Explorer which displays the recoverable files and folders. This is an asynchronous operation. To get the provisioning status, call GetProtectedItemOperationResult API.
     *
     * @param vaultName The name of the Recovery Services vault.
     * @param resourceGroupName The name of the resource group associated with the Recovery Services vault.
     * @param fabricName The fabric name associated with the backup items.
     * @param containerName The container name associated with the backup items.
     * @param protectedItemName The name of the backup item whose files or folders are to be restored.
     * @param recoveryPointId The recovery point ID for backup data. The iSCSI connection will be provisioned for this backup data.
     * @param resourceILRRequest The resource Item Level Recovery (ILR) request.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<Void> provisionAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, ILRRequestResource resourceILRRequest, final ServiceCallback<Void> serviceCallback) {
        return ServiceFuture.fromResponse(provisionWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, resourceILRRequest), serviceCallback);
    }

    /**
     * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens File Explorer which displays the recoverable files and folders. This is an asynchronous operation. To get the provisioning status, call GetProtectedItemOperationResult API.
     *
     * @param vaultName The name of the Recovery Services vault.
     * @param resourceGroupName The name of the resource group associated with the Recovery Services vault.
     * @param fabricName The fabric name associated with the backup items.
     * @param containerName The container name associated with the backup items.
     * @param protectedItemName The name of the backup item whose files or folders are to be restored.
     * @param recoveryPointId The recovery point ID for backup data. The iSCSI connection will be provisioned for this backup data.
     * @param resourceILRRequest The resource Item Level Recovery (ILR) request.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceResponse} object if successful.
     */
    public Observable<Void> provisionAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, ILRRequestResource resourceILRRequest) {
        return provisionWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, resourceILRRequest).map(new Func1<ServiceResponse<Void>, Void>() {
            @Override
            public Void call(ServiceResponse<Void> response) {
                return response.body();
            }
        });
    }

    /**
     * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens File Explorer which displays the recoverable files and folders. This is an asynchronous operation. To get the provisioning status, call GetProtectedItemOperationResult API.
     *
     * @param vaultName The name of the Recovery Services vault.
     * @param resourceGroupName The name of the resource group associated with the Recovery Services vault.
     * @param fabricName The fabric name associated with the backup items.
     * @param containerName The container name associated with the backup items.
     * @param protectedItemName The name of the backup item whose files or folders are to be restored.
     * @param recoveryPointId The recovery point ID for backup data. The iSCSI connection will be provisioned for this backup data.
     * @param resourceILRRequest The resource Item Level Recovery (ILR) request.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceResponse} object if successful.
     */
    public Observable<ServiceResponse<Void>> provisionWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, ILRRequestResource resourceILRRequest) {
        if (vaultName == null) {
            throw new IllegalArgumentException("Parameter vaultName is required and cannot be null.");
        }
        if (resourceGroupName == null) {
            throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
        }
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (fabricName == null) {
            throw new IllegalArgumentException("Parameter fabricName is required and cannot be null.");
        }
        if (containerName == null) {
            throw new IllegalArgumentException("Parameter containerName is required and cannot be null.");
        }
        if (protectedItemName == null) {
            throw new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.");
        }
        if (recoveryPointId == null) {
            throw new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        if (resourceILRRequest == null) {
            throw new IllegalArgumentException("Parameter resourceILRRequest is required and cannot be null.");
        }
        Validator.validate(resourceILRRequest);
        return service.provision(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, protectedItemName, recoveryPointId, this.client.apiVersion(), resourceILRRequest, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
                @Override
                public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<Void> clientResponse = provisionDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<Void> provisionDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
        return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter())
                .register(202, new TypeToken<Void>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

}


text:
{% load static wagtailuserbar compress base_tags %}
{% is_nightmode as nightmode %}

<!DOCTYPE html>

  <meta charset="utf-8"/>
  <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  <title>{% block title_prefix %}{% endblock %}{% block title %}{% if self.seo_title %}{{ self.seo_title }}{% else %}
    {{ self.title }}{% endif %}{% endblock %}{% block title_suffix %}{% endblock %}</title>
  <meta name="description" content=""/>
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
  <meta name="theme-color" content="#141E24"/>
  {# Facebook post image #}
  <meta property="og:image" content="https://uwcs.co.uk/static/favicon-180.png"/>

  {# Global stylesheets #}
  {% if nightmode %}
    {% compress css %}
      <link href="{% static 'scss/app-dark.scss' %}" rel="stylesheet" type="text/x-scss"/>
    {% endcompress %}
  {% else %}
    {% compress css %}
      <link href="{% static 'scss/app.scss' %}" rel="stylesheet" type="text/x-scss"/>
    {% endcompress %}
  {% endif %}
  <link rel="stylesheet" type="text/css"
        href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
  <link href="https://fonts.googleapis.com/css?family=Muli:400,400i,700,700i|Montserrat:500|Ubuntu+Mono" rel="stylesheet">

  {% block extra_css %}
    {# Override this in templates to add extra stylesheets #}
  {% endblock %}

  <link rel="shortcut icon" href="/static/favicon.ico">
  <link rel="icon" sizes="16x16 32x32 64x64" href="/static/favicon.ico">
  <link rel="icon" type="image/png" sizes="196x196" href="/static/favicon-192.png">
  <link rel="icon" type="image/png" sizes="160x160" href="/static/favicon-160.png">
  <link rel="icon" type="image/png" sizes="96x96" href="/static/favicon-96.png">
  <link rel="icon" type="image/png" sizes="64x64" href="/static/favicon-64.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16.png">
  <link rel="apple-touch-icon" href="/static/favicon-57.png">
  <link rel="apple-touch-icon" sizes="114x114" href="/static/favicon-114.png">
  <link rel="apple-touch-icon" sizes="72x72" href="/static/favicon-72.png">
  <link rel="apple-touch-icon" sizes="144x144" href="/static/favicon-144.png">
  <link rel="apple-touch-icon" sizes="60x60" href="/static/favicon-60.png">
  <link rel="apple-touch-icon" sizes="120x120" href="/static/favicon-120.png">
  <link rel="apple-touch-icon" sizes="76x76" href="/static/favicon-76.png">
  <link rel="apple-touch-icon" sizes="152x152" href="/static/favicon-152.png">
  <link rel="apple-touch-icon" sizes="180x180" href="/static/favicon-180.png">
  <meta name="msapplication-TileColor" content="#FFFFFF">
  <meta name="msapplication-TileImage" content="/static/favicon-144.png">
  <meta name="msapplication-config" content="/static/browserconfig.xml">

{% wagtailuserbar %}

  {% get_site_root as site_root %}

    {% top_menu parent=site_root calling_page=request.path %}

    {% block content %}{% endblock %}

    {% footer parent=site_root %}

{# Global javascript #}

{% block extra_js %}
  {# Override this in templates to add extra javascript #}
{% endblock %}


text:
import os
import shutil
import unittest
from collections import namedtuple

from conans.util.files import save, load
from conans.client.cmd.export import _replace_scm_data_in_conanfile
from conans.client.loader import _parse_file
from conans.test.utils.test_files import temp_folder
from conans.model.scm import SCMData

class ReplaceSCMDataInConanfileTest(unittest.TestCase):
    conanfile = """
from conans import ConanFile

class ConanLib(ConanFile):
    name = "lib"
    version = "0.1"
    scm = {{"revision": "{revision}",
           "type": "git",
           "url": "{url}"}}

    {after_scm}

{after_recipe}
"""

    def run(self, *args, **kwargs):
        self.tmp_folder = temp_folder()
        self.conanfile_path = os.path.join(self.tmp_folder, 'conanfile.py')
        try:
            super(ReplaceSCMDataInConanfileTest, self).run(*args, **kwargs)
        finally:
            shutil.rmtree(self.tmp_folder)

    def _do_actual_test(self, scm_data, after_scm, after_recipe):
        target_conanfile = self.conanfile.format(url=scm_data['url'],
                                                 revision=scm_data['revision'],
                                                 after_scm=after_scm,
                                                 after_recipe=after_recipe)
        save(self.conanfile_path, content=self.conanfile.format(url='auto', revision='auto',
                                                                after_scm=after_scm,
                                                                after_recipe=after_recipe))
        scm_data = SCMData(conanfile=namedtuple('_', 'scm')(scm=scm_data))
        _replace_scm_data_in_conanfile(self.conanfile_path, scm_data)
        self.assertEqual(load(self.conanfile_path), target_conanfile)
        _parse_file(self.conanfile_path)  # Check that the resulting file is valid python code.

    def test_conanfile_after_scm(self):
        scm_data = {'type': 'git',
                    'url': 'url_value',
                    'revision': 'revision_value'}
        after_scm = 'attrib = 23'
        after_recipe = ''
        self._do_actual_test(scm_data=scm_data, after_scm=after_scm, after_recipe=after_recipe)

    def test_conanfile_after_scm_and_recipe(self):
        scm_data = {'type': 'git',
                    'url': 'url_value',
                    'revision': 'revision_value'}
        after_scm = 'attrib = 23'
        after_recipe = 'another = 23'
        self._do_actual_test(scm_data=scm_data, after_scm=after_scm, after_recipe=after_recipe)

    def test_conanfile_after_recipe(self):
        scm_data = {'type': 'git',
                    'url': 'url_value',
                    'revision': 'revision_value'}
        after_scm = ''
        after_recipe = 'another = 23'
        self._do_actual_test(scm_data=scm_data, after_scm=after_scm, after_recipe=after_recipe)

    def test_conanfile_none(self):
        scm_data = {'type': 'git',
                    'url': 'url_value',
                    'revision': 'revision_value'}
        after_scm = ''
        after_recipe = ''
        self._do_actual_test(scm_data=scm_data, after_scm=after_scm, after_recipe=after_recipe)


text:
layout: post
date: '2015-06-16'
title: "Weddington Way JS Collection 862613 Sleeveless Floor-Length Aline/Princess"
category: Weddington Way
tags: [Weddington Way,Aline/Princess ,Scoop Neck,Floor-Length,Sleeveless]
---
### Weddington Way JS Collection 862613
Just **$279.99**
###   Sleeveless Floor-Length Aline/Princess

BRANDS	Weddington Way

Silhouette	Aline/Princess

Neckline	Scoop Neck

Hemline/Train	Floor-Length

Sleeve	Sleeveless

Buy it: [https://www.readybrides.com/en/weddington-way/16859-weddington-way-js-collection-862613.html](https://www.readybrides.com/en/weddington-way/16859-weddington-way-js-collection-862613.html)


text:
package rx.internal.operators;

import static org.junit.Assert.assertFalse;

import java.util.Collections;
import java.util.NoSuchElementException;
import java.util.concurrent.atomic.AtomicBoolean;

import org.junit.Test;

import rx.Observable;
import rx.Single;
import rx.functions.Action0;
import rx.observers.TestSubscriber;

public class OnSubscribeSingleTest {

    @Test
    public void testJustSingleItemObservable() {
        TestSubscriber<String> subscriber = TestSubscriber.create();
        Single<String> single = Observable.just("Hello World!").toSingle();
        single.subscribe(subscriber);

        subscriber.assertReceivedOnNext(Collections.singletonList("Hello World!"));
    }

    @Test
    public void testErrorObservable() {
        TestSubscriber<String> subscriber = TestSubscriber.create();
        IllegalArgumentException error = new IllegalArgumentException("Error");
        Single<String> single = Observable.<String>error(error).toSingle();
        single.subscribe(subscriber);

        subscriber.assertError(error);
    }

    @Test
    public void testJustTwoEmissionsObservableThrowsError() {
        TestSubscriber<String> subscriber = TestSubscriber.create();
        Single<String> single = Observable.just("First", "Second").toSingle();
        single.subscribe(subscriber);

        subscriber.assertError(IllegalArgumentException.class);
    }

    @Test
    public void testEmptyObservable() {
        TestSubscriber<String> subscriber = TestSubscriber.create();
        Single<String> single = Observable.<String>empty().toSingle();
        single.subscribe(subscriber);

        subscriber.assertError(NoSuchElementException.class);
    }

    @Test
    public void testRepeatObservableThrowsError() {
        TestSubscriber<String> subscriber = TestSubscriber.create();
        Single<String> single = Observable.just("First", "Second").repeat().toSingle();
        single.subscribe(subscriber);

        subscriber.assertError(IllegalArgumentException.class);
    }

    @Test
    public void testShouldUseUnsafeSubscribeInternallyNotSubscribe() {
        TestSubscriber<String> subscriber = TestSubscriber.create();
        final AtomicBoolean unsubscribed = new AtomicBoolean(false);
        Single<String> single = Observable.just("Hello World!").doOnUnsubscribe(new Action0() {

            @Override
            public void call() {
                unsubscribed.set(true);
            }}).toSingle();
        single.unsafeSubscribe(subscriber);
        subscriber.assertCompleted();
        assertFalse(unsubscribed.get());
    }
}


text:
package org.assertj.core.api.double_;

import static junit.framework.Assert.assertSame;
import static org.mockito.MockitoAnnotations.initMocks;

import java.util.Comparator;

import org.assertj.core.api.DoubleAssert;
import org.assertj.core.api.DoubleAssertBaseTest;
import org.junit.Before;
import org.mockito.Mock;

/**
 * Tests for <code>{@link DoubleAssert#usingComparator(java.util.Comparator)}</code>.
 *
 * @author Joel Costigliola
 */
public class DoubleAssert_usingComparator_Test extends DoubleAssertBaseTest {

  @Mock
  private Comparator<Double> comparator;

  @Before
  public void before() {
    initMocks(this);
  }

  @Override
  protected DoubleAssert invoke_api_method() {
    // in that, we don't care of the comparator, the point to check is that we switch correctly of comparator
    return assertions.usingComparator(comparator);
  }

  @Override
  protected void verify_internal_effects() {
    assertSame(getObjects(assertions).getComparator(), comparator);
    assertSame(getDoubles(assertions).getComparator(), comparator);
  }
}


text:
require "test_helper"
require "shrine/plugins/dynamic_storage"

describe Shrine::Plugins::DynamicStorage do
  before do
    @uploader = uploader { plugin :dynamic_storage }
    @shrine   = @uploader.class
  end

  it "allows registering a storage with a regex" do
    @shrine.storage(/store_(\w+)/) { |match| match[1].to_sym }

    assert_equal :foo, @shrine.new(:store_foo).storage
    assert_equal :bar, @shrine.new(:store_bar).storage
  end

  it "allows saved storage resolvers to be inherited" do
    @shrine.storage(/store/) { |match| Shrine::Storage::Memory.new }
    subclass = Class.new(@shrine)
    refute_equal subclass.storages[:store], subclass.find_storage(:store)
  end

  it "doesn't clear registered storage resolvers when reapplying" do
    @shrine.storage(/store/) { |match| Shrine::Storage::Memory.new }
    @shrine.plugin :dynamic_storage
    refute_equal @shrine.storages[:store], @shrine.find_storage(:store)
  end

  it "delegates to default behaviour when storage wasn't found" do
    assert_instance_of Shrine::Storage::Memory, @uploader.class.new(:store).storage
  end
end


text:
<?php

namespace DCarbone\PHPFHIRGenerated\R4\PHPFHIRTests\FHIRElement\FHIRBackboneElement\FHIRExplanationOfBenefit;

use PHPUnit\Framework\TestCase;
use DCarbone\PHPFHIRGenerated\R4\FHIRElement\FHIRBackboneElement\FHIRExplanationOfBenefit\FHIRExplanationOfBenefitDetail;

/**
 * Class FHIRExplanationOfBenefitDetailTest
 * @package \DCarbone\PHPFHIRGenerated\R4\PHPFHIRTests\FHIRElement\FHIRBackboneElement\FHIRExplanationOfBenefit
 */
class FHIRExplanationOfBenefitDetailTest extends TestCase
{
    public function testCanConstructTypeNoArgs()
    {
        $type = new FHIRExplanationOfBenefitDetail();
        $this->assertInstanceOf('\DCarbone\PHPFHIRGenerated\R4\FHIRElement\FHIRBackboneElement\FHIRExplanationOfBenefit\FHIRExplanationOfBenefitDetail', $type);
    }
}


text:
[![Build Status](https://travis-ci.org/evetion/sqlite_unchanged.svg?branch=master)](https://travis-ci.org/evetion/sqlite_unchanged)
PoC for checking if SQLite database has been changed by hardcoding file change counter in header.

## Description
For a header description, see https://www.sqlite.org/fileformat2.html#section_1_2_6.

The file change counter and wal modes are hardcoded:

offset | size | description
-------|------|------------
18 | 1 | File format write version. Set to 1
19 | 1 | File format read version. Set to 1
24 | 4 | File change counter. Set to 2147483647

For each write transaction an sqlite database will have its file change counter incremented, thus providing a means to check if the database has been changed. Only in the non-default WAL mode this header might not be incremented, but this results in the file format version being set to 2, which we can also check. Changing back to legacy mode will increase the file change counter as well.

The only collision occurs if the file change counter overflows and returns to its hardcoded value after 2.147.483.647 write transactions.

## Usage
```
sqlite_unchanged [-s | -c ] [file]
        -s or --set:   store header in db
        -c or --check: compare header with stored header
        file: filename or path
```

```
./sqlite_unchanged -c test.sqlite
File is not original.
```

```
./sqlite_unchanged -s test.sqlite
Hardcoded values set, will now check for validity.
File is original.
```

```
./sqlite_unchanged -c test.sqlite
File is original.
```


text:
@interface ChangelogViewController : UIViewController

@end


text:
package com.ibm.nmon.gui.parse;

import com.ibm.nmon.gui.main.NMONVisualizerGui;

import java.awt.GridBagConstraints;
import javax.swing.SwingConstants;

import javax.swing.DefaultComboBoxModel;

import javax.swing.JPanel;
import javax.swing.JOptionPane;
import javax.swing.JComboBox;
import javax.swing.JLabel;

import com.ibm.nmon.gui.Styles;

/**
 * Dialog to get the JVM name and hostname for a particular verbose GC file.
 *
 * @see com.ibm.nmon.gui.main.NMONVisualizerGui#getDataForGCParse(String)
 */
public final class VerboseGCPreParser extends BaseParserDialog {
    private static final long serialVersionUID = 647178802418910814L;

    private JComboBox<String> jvmNames;

    public VerboseGCPreParser(NMONVisualizerGui gui) {
        super(gui, "Missing GC Information");
    }

    @Override
    protected void addComponents(JPanel content, GridBagConstraints labelConstraints,
            GridBagConstraints fieldConstraints) {
        jvmNames = new JComboBox<String>();
        jvmNames.setEditable(true);

        JLabel nameLabel = new JLabel("JVM Name:");
        nameLabel.setFont(Styles.LABEL);
        nameLabel.setHorizontalAlignment(SwingConstants.TRAILING);

        content.add(nameLabel, labelConstraints);
        content.add(jvmNames, fieldConstraints);
    }

    @Override
    protected boolean validateOK() {
        String jvmName = getJVMName();

        if ((jvmName == null) || "".equals(jvmName)) {
            JOptionPane.showMessageDialog(VerboseGCPreParser.this, "JVM Name" + " is required", "Missing Value",
                    JOptionPane.ERROR_MESSAGE);

            return false;
        }
        else {
            return true;
        }
    }

    @Override
    protected void beforeDispose() {
        boolean existing = false;
        DefaultComboBoxModel<String> model = (DefaultComboBoxModel<String>) jvmNames.getModel();

        for (int i = 0; i < model.getSize(); i++) {
            if (model.getElementAt(i).equals(jvmNames.getSelectedItem())) {
                existing = true;
                break;
            }
        }

        if (!existing) {
            model.addElement((String) jvmNames.getSelectedItem());
        }
    }

    public String getJVMName() {
        String name = (String) jvmNames.getSelectedItem();

        if (name == null) {
            name = "";
        }

        return name.trim();
    }

    public void setJVMName(String jvmName) {
        jvmNames.setSelectedItem(jvmName);
    }
}


text:
From openresty/openresty:1.13.6.1-0-centos

COPY conf/nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
COPY conf/dns.conf /etc/dns/dns.conf
COPY . /var/lib/httpdns


text:
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var React = _interopRequireWildcard(require("react"));

var _createSvgIcon = _interopRequireDefault(require("./createSvgIcon"));

/**
 * @ignore - internal component.
 */
var _default = (0, _createSvgIcon.default)(React.createElement("path", {
  d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
}), 'RadioButtonUnchecked');

exports.default = _default;


text:
verzamelend
===========

[![Build Status](https://travis-ci.org/steenzout/verzamelend.svg?branch=master)](https://travis-ci.org/steenzout/verzamelend)
[![Code Health](https://landscape.io/github/steenzout/verzamelend/master/landscape.png)](https://landscape.io/github/steenzout/verzamelend/master)
[![Coverage Status](https://coveralls.io/repos/steenzout/verzamelend/badge.png?branch=master)](https://coveralls.io/r/steenzout/verzamelend?branch=master)
[![Requirements Status](https://requires.io/github/steenzout/verzamelend/requirements.png?branch=master)](https://requires.io/github/steenzout/verzamelend/requirements/?branch=master)

- [git](http://git-scm.com) for version control
- [pip](http://www.pip-installer.org/en/latest/) to manage Python packages
- [tox](http://tox.readthedocs.org/en/latest/) for automation and setup development environments
- [Sphinx](http://sphinx-doc.org) for documentation

verzamelend
-----------

This is the directory which will hold your files.

Rename "company" with your company's name or product.

In this empty project the company package is a namespace package,
meaning it was defined in another repository.

You may not need to do this but it's here to make an example of how to define namespace packages,
what to add on the __init__.py file and in the setup.py file.

docs
----

Directory where you'll store the [Sphinx](http://sphinx-doc.org) configuration files and
where the documentation will be generated.

.gitignore
----------

File where you specify which files [Git](http://en.wikipedia.org/wiki/Git_(software)) should ignore.

A generic file has been provided.

You can use [gitignore.io](http://www.gitignore.io) to
produce other files that will better suit your development environment.

For more information, you can check "[git-scm.com : gitignore](http://git-scm.com/docs/gitignore)".

LICENSE
-------

The Apache 2 license.

Feel free to replace for another license that will be more suitable to the purpose of your project.

pytest.ini
----------

The [pytest](https://pytest.org/latest/index.html) configuration file.

You can read
"[pytest : Changing standard (Python) test discovery](https://pytest.org/latest/example/pythoncollection.html)"
for more information on how to use this file to customize [pytest](https://pytest.org/latest/index.html)'s behavior.

README.md
---------

This file.

Check "[here](http://daringfireball.net/projects/markdown/syntax)" for help
with [Markdown](http://daringfireball.net/projects/markdown/) syntax.

requirements.txt
----------------

On this file you specify the list of packages the project depends.

Read "[pip : Requirement Files](http://www.pip-installer.org/en/latest/user_guide.html#requirements-files)"
to understand how you can properly use this file to define your project's dependencies.

setup.py
--------

The setup script whre you'll describe the project / product, authors, maintainers and
information on how to distribute it.

Read "[Python : 2. Writing the Setup Script](http://docs.python.org/2/distutils/setupscript.html)",
for more information.

tests
-----

The directory where you should add your unit tests.

test-requirements.txt
---------------------

On this file you specify the list of packages the project needs to run its tests.

An example of the possible contents of this file has been provided.

Read "[pip : Requirement Files](http://www.pip-installer.org/en/latest/user_guide.html#requirements-files)"
to understand how you can properly use this file to define your project's test dependencies.

tox.ini
-------

The [tox](http://tox.readthedocs.org/en/latest/) configuration file.

It contains basic information about your project and test environments.

I recommend [installling tox](http://tox.readthedocs.org/en/latest/install.html) and
use it to run your tests and generate the documentation.

```
# run the tests
$ tox

# generate the documentation
$ tox -e docs
```


text:
namespace base {
class FilePath;
class Time;
class TimeDelta;
}  // namespace base

namespace download {

// We keep a count of how often various events occur in the
// histogram "Download.Counts".
enum DownloadCountTypes {
  // Stale enum values left around so that values passed to UMA don't
  // change.
  DOWNLOAD_COUNT_UNUSED_0 = 0,
  DOWNLOAD_COUNT_UNUSED_1,
  DOWNLOAD_COUNT_UNUSED_2,
  DOWNLOAD_COUNT_UNUSED_3,
  DOWNLOAD_COUNT_UNUSED_4,

  // Downloads that made it to DownloadResourceHandler
  UNTHROTTLED_COUNT,

  // Downloads that actually complete.
  COMPLETED_COUNT,

  // Downloads that are cancelled before completion (user action or error).
  CANCELLED_COUNT,

  // Downloads that are started.
  START_COUNT,

  // Downloads that were interrupted by the OS.
  INTERRUPTED_COUNT,

  // (Deprecated) Write sizes for downloads.
  // This is equal to the number of samples in Download.WriteSize histogram.
  DOWNLOAD_COUNT_UNUSED_10,

  // (Deprecated) Counts iterations of the BaseFile::AppendDataToFile() loop.
  // This is equal to the number of samples in Download.WriteLoopCount
  // histogram.
  DOWNLOAD_COUNT_UNUSED_11,

  // Counts interruptions that happened at the end of the download.
  INTERRUPTED_AT_END_COUNT,

  // Counts errors due to writes to BaseFiles that have been detached already.
  // This can happen when saving web pages as complete packages. It happens
  // when we get messages to append data to files that have already finished and
  // been detached, but haven't yet been removed from the list of files in
  // progress.
  APPEND_TO_DETACHED_FILE_COUNT,

  // (Deprecated) Counts the number of instances where the downloaded file is
  // missing after a successful invocation of ScanAndSaveDownloadedFile().
  DOWNLOAD_COUNT_UNUSED_14,

  // (Deprecated) Count of downloads with a strong ETag and specified
  // 'Accept-Ranges: bytes'.
  DOWNLOAD_COUNT_UNUSED_15,

  // Count of downloads that didn't have a valid WebContents at the time it was
  // interrupted.
  INTERRUPTED_WITHOUT_WEBCONTENTS,

  // Count of downloads that supplies a strong validator (implying byte-wise
  // equivalence) and has a 'Accept-Ranges: bytes' header. These downloads are
  // candidates for partial resumption.
  STRONG_VALIDATOR_AND_ACCEPTS_RANGES,

  // (Deprecated) Count of downloads that uses parallel download requests.
  USES_PARALLEL_REQUESTS,

  // Count of new downloads.
  NEW_DOWNLOAD_COUNT,

  // Count of new downloads that are started in normal profile.
  NEW_DOWNLOAD_COUNT_NORMAL_PROFILE,

  // Downloads that are actually completed in normal profile.
  COMPLETED_COUNT_NORMAL_PROFILE,

  // Downloads that are completed with a content length mismatch error.
  COMPLETED_WITH_CONTENT_LENGTH_MISMATCH_COUNT,

  // After a download is interrupted with a content length mismatch error, more
  // bytes are received when resuming the download.
  MORE_BYTES_RECEIVED_AFTER_CONTENT_LENGTH_MISMATCH_COUNT,

  // After a download is interrupted with a content length mismatch error, no
  // bytes are received when resuming the download.
  NO_BYTES_RECEIVED_AFTER_CONTENT_LENGTH_MISMATCH_COUNT,

  // Count of downloads that requested target determination.
  DETERMINE_DOWNLOAD_TARGET_COUNT,

  // Count of downloads that has target determination completed.
  DOWNLOAD_TARGET_DETERMINED_COUNT,

  // A cross origin download without a content disposition header.
  CROSS_ORIGIN_DOWNLOAD_WITHOUT_CONTENT_DISPOSITION,

  // Count of attempts that triggered the download flow, before any network
  // requests are sent.
  DOWNLOAD_TRIGGERED_COUNT,

  // Count of attempts for manual download resumption.
  MANUAL_RESUMPTION_COUNT,

  // Count of attempts for auto download resumption.
  AUTO_RESUMPTION_COUNT,

  // Count of download attempts that are dropped due to content settings or
  // request limiter before DownloadItem is created.
  DOWNLOAD_DROPPED_COUNT,

  DOWNLOAD_COUNT_TYPES_LAST_ENTRY
};

// Enum for in-progress download DB, used in histogram
// "Download.InProgressDB.Counts".
enum InProgressDBCountTypes {
  // Count of initialization attempts.
  kInitializationCount = 0,

  // Count of initialization attempts that succeeded.
  kInitializationSucceededCount = 1,

  // Count of initialization attempts that failed.
  kInitializationFailedCount = 2,

  // Count of load attempts that succeeded.
  kLoadSucceededCount = 3,

  // Count of load attempts that failed.
  kLoadFailedCount = 4,

  // Count of in-progress cache migration attempts.
  kCacheMigrationCount = 5,

  // Count of in-progress cache migration attempts that succeeded.
  kCacheMigrationSucceededCount = 6,

  // Count of in-progress cache migration attempts that failed.
  kCacheMigrationFailedCount = 7,

  kMaxValue = kCacheMigrationFailedCount
};

// Events for user scheduled downloads. Used in histograms, don't reuse or
// remove items. Keep in sync with DownloadLaterEvent in enums.xml.
enum class DownloadLaterEvent {
  // Schedule is added during download target determination process.
  kScheduleAdded = 0,
  // Scheduled is changed from the UI after download is scheduled.
  kScheduleChanged = 1,
  // Scheduled is removed during resumption.
  kScheduleRemoved = 2,
  kMaxValue = kScheduleRemoved
};

// Increment one of the above counts.
COMPONENTS_DOWNLOAD_EXPORT void RecordDownloadCount(DownloadCountTypes type);

// Record download count with download source.
COMPONENTS_DOWNLOAD_EXPORT void RecordDownloadCountWithSource(
    DownloadCountTypes type,
    DownloadSource download_source);

// Record metrics when a new download is started.
COMPONENTS_DOWNLOAD_EXPORT void RecordNewDownloadStarted(
    net::NetworkChangeNotifier::ConnectionType connection_type,
    DownloadSource download_source);

// Record COMPLETED_COUNT and how long the download took.
COMPONENTS_DOWNLOAD_EXPORT void RecordDownloadCompleted(
    int64_t download_len,
    bool is_parallelizable,
    net::NetworkChangeNotifier::ConnectionType connection_type,
    DownloadSource download_source);

// Record INTERRUPTED_COUNT, |reason|, |received| and |total| bytes.
COMPONENTS_DOWNLOAD_EXPORT void RecordDownloadInterrupted(
    DownloadInterruptReason reason,
    int64_t received,
    int64_t total,
    bool is_parallelizable,
    bool is_parallel_download_enabled,
    DownloadSource download_source);

// Record a dangerous download accept event.
COMPONENTS_DOWNLOAD_EXPORT void RecordDangerousDownloadAccept(
    DownloadDangerType danger_type,
    const base::FilePath& file_path);

// Records various metrics at the start of a download resumption.
COMPONENTS_DOWNLOAD_EXPORT void RecordDownloadResumption(
    DownloadInterruptReason reason,
    bool user_resume);

// Records whenever a download hits max auto-resumption limit.
COMPONENTS_DOWNLOAD_EXPORT void RecordAutoResumeCountLimitReached(
    DownloadInterruptReason reason);

// Returns the type of download.
COMPONENTS_DOWNLOAD_EXPORT DownloadContent
DownloadContentFromMimeType(const std::string& mime_type_string,
                            bool record_content_subcategory);

// Records the mime type of the download.
COMPONENTS_DOWNLOAD_EXPORT void RecordDownloadMimeType(
    const std::string& mime_type);

// Records the mime type of the download for normal profile.
COMPONENTS_DOWNLOAD_EXPORT void RecordDownloadMimeTypeForNormalProfile(
    const std::string& mime_type);

// Record the number of completed unopened downloads when a download is opened.
COMPONENTS_DOWNLOAD_EXPORT void RecordOpensOutstanding(int size);

// Record overall bandwidth stats at the file end.
// Does not count in any hash computation or file open/close time.
COMPONENTS_DOWNLOAD_EXPORT void RecordFileBandwidth(
    size_t length,
    base::TimeDelta elapsed_time);

// Increment one of the count for parallelizable download.
COMPONENTS_DOWNLOAD_EXPORT void RecordParallelizableDownloadCount(
    DownloadCountTypes type,
    bool is_parallel_download_enabled);

// Records the actual total number of requests sent for a parallel download,
// including the initial request.
COMPONENTS_DOWNLOAD_EXPORT void RecordParallelDownloadRequestCount(
    int request_count);

// Record the result of a download file rename.
COMPONENTS_DOWNLOAD_EXPORT void RecordDownloadFileRenameResultAfterRetry(
    base::TimeDelta time_since_first_failure,
    DownloadInterruptReason interrupt_reason);

enum SavePackageEvent {
  // The user has started to save a page as a package.
  SAVE_PACKAGE_STARTED,

  // The save package operation was cancelled.
  SAVE_PACKAGE_CANCELLED,

  // The save package operation finished without being cancelled.
  SAVE_PACKAGE_FINISHED,

  // The save package tried to write to an already completed file.
  SAVE_PACKAGE_WRITE_TO_COMPLETED,

  // The save package tried to write to an already failed file.
  SAVE_PACKAGE_WRITE_TO_FAILED,

  // Instead of using save package API, used download API to save non HTML
  // format files.
  SAVE_PACKAGE_DOWNLOAD_ON_NON_HTML,

  SAVE_PACKAGE_LAST_ENTRY
};

COMPONENTS_DOWNLOAD_EXPORT void RecordSavePackageEvent(SavePackageEvent event);

// Enumeration for histogramming purposes.
// These values are written to logs.  New enum values can be added, but existing
// enums must never be renumbered or deleted and reused.
enum DownloadConnectionSecurity {
  DOWNLOAD_SECURE = 0,  // Final download url and its redirects all use https
  DOWNLOAD_TARGET_INSECURE =
      1,  // Final download url uses http, redirects are all
          // https
  DOWNLOAD_REDIRECT_INSECURE =
      2,  // Final download url uses https, but at least
          // one redirect uses http
  DOWNLOAD_REDIRECT_TARGET_INSECURE =
      3,                      // Final download url uses http, and at
                              // least one redirect uses http
  DOWNLOAD_TARGET_OTHER = 4,  // Final download url uses a scheme not present in
                              // this enumeration
  DOWNLOAD_TARGET_BLOB = 5,   // Final download url uses blob scheme
  DOWNLOAD_TARGET_DATA = 6,   //  Final download url uses data scheme
  DOWNLOAD_TARGET_FILE = 7,   //  Final download url uses file scheme
  DOWNLOAD_TARGET_FILESYSTEM = 8,  //  Final download url uses filesystem scheme
  DOWNLOAD_TARGET_FTP = 9,         // Final download url uses ftp scheme
  DOWNLOAD_CONNECTION_SECURITY_MAX
};

enum class DownloadMetricsCallsite {
  // Called from within DownloadItem initialization.
  kDownloadItem = 0,

  // Called from within MixedContentDownloadBlocking (as part of
  // ChromeDownloadManagerDelegate).
  kMixContentDownloadBlocking,
};

COMPONENTS_DOWNLOAD_EXPORT DownloadConnectionSecurity
CheckDownloadConnectionSecurity(const GURL& download_url,
                                const std::vector<GURL>& url_chain);

// Records a download's mime-type and security state. This is a short-lived
// metric recorded in multiple callsites to investigate discrepancies in other
// metrics.
COMPONENTS_DOWNLOAD_EXPORT void RecordDownloadValidationMetrics(
    DownloadMetricsCallsite callsite,
    DownloadConnectionSecurity state,
    DownloadContent file_type);

COMPONENTS_DOWNLOAD_EXPORT void RecordDownloadConnectionSecurity(
    const GURL& download_url,
    const std::vector<GURL>& url_chain);

COMPONENTS_DOWNLOAD_EXPORT void RecordDownloadHttpResponseCode(
    int response_code,
    bool is_background_mode);

COMPONENTS_DOWNLOAD_EXPORT void RecordInProgressDBCount(
    InProgressDBCountTypes type);

COMPONENTS_DOWNLOAD_EXPORT void RecordDuplicateInProgressDownloadIdCount(
    int count);

// Records the interrupt reason that causes download to restart.
COMPONENTS_DOWNLOAD_EXPORT void RecordResumptionRestartReason(
    DownloadInterruptReason reason);

// Records the interrupt reason that causes download to restart.
COMPONENTS_DOWNLOAD_EXPORT void RecordResumptionStrongValidators(
    DownloadInterruptReason reason);

COMPONENTS_DOWNLOAD_EXPORT void RecordDownloadManagerCreationTimeSinceStartup(
    base::TimeDelta elapsed_time);

COMPONENTS_DOWNLOAD_EXPORT void RecordDownloadManagerMemoryUsage(
    size_t bytes_used);

COMPONENTS_DOWNLOAD_EXPORT void RecordParallelRequestCreationFailure(
    DownloadInterruptReason reason);

// Record download later events.
COMPONENTS_DOWNLOAD_EXPORT void RecordDownloadLaterEvent(
    DownloadLaterEvent event);

#if defined(OS_ANDROID)
enum class BackgroudTargetDeterminationResultTypes {
  // Target determination succeeded.
  kSuccess = 0,

  // Target path doesn't exist.
  kTargetPathMissing = 1,

  // Path reservation failed.
  kPathReservationFailed = 2,

  kMaxValue = kPathReservationFailed
};

// Records whether download target determination is successfully completed in
// reduced mode.
COMPONENTS_DOWNLOAD_EXPORT void RecordBackgroundTargetDeterminationResult(
    BackgroudTargetDeterminationResultTypes type);
#endif  // defined(OS_ANDROID)

#if defined(OS_WIN)
// Records the OS error code when moving a file on Windows.
COMPONENTS_DOWNLOAD_EXPORT void RecordWinFileMoveError(int os_error);
#endif  // defined(OS_WIN)
}  // namespace download

#endif  // COMPONENTS_DOWNLOAD_PUBLIC_COMMON_DOWNLOAD_STATS_H_


text:
using System.Runtime.Serialization;
using VsixMvcAppResult.Models.Common;

namespace VsixMvcAppResult.Models.Membership
{
    [DataContract]
    public class DataResultUserSearch : baseDataResult<DataResultUserList>, IDataResultModel<DataResultUserList>
    {
    }
}


text:
package org.drools.core.command.runtime.rule;

import org.drools.core.command.impl.GenericCommand;
import org.drools.core.command.impl.KnowledgeCommandContext;
import org.drools.core.util.StringUtils;
import org.drools.core.xml.jaxb.util.JaxbUnknownAdapter;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.rule.EntryPoint;
import org.kie.api.runtime.rule.FactHandle;
import org.kie.internal.command.Context;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

@XmlAccessorType(XmlAccessType.NONE)
public class DeleteObjectCommand
        implements GenericCommand<Void> {

    @XmlAttribute(name="object")
    @XmlJavaTypeAdapter(JaxbUnknownAdapter.class)
    private Object object;

    @XmlAttribute(name="entry-point")
    private String entryPoint = "DEFAULT";

    public DeleteObjectCommand() {
    }

    public DeleteObjectCommand( Object object, String entryPoint ) {
        this.object = object;
        if ( ! StringUtils.isEmpty( this.entryPoint ) ) {
            this.entryPoint = entryPoint;
        }
    }

    public Void execute(Context context) {
        KieSession ksession = ((KnowledgeCommandContext) context).getKieSession();
        EntryPoint ep = ksession.getEntryPoint( entryPoint );
        if ( ep != null ) {
            FactHandle handle = ksession.getEntryPoint( entryPoint ).getFactHandle( object );
            ksession.delete( handle );
        }
        return null;
    }

    public Object getObject() {
        return this.object;
    }

    public String getEntryPointId() {
        return entryPoint;
    }

    public String toString() {
        return "session.entryPoints(" + ((this.entryPoint == null ) ? "DEFAULT" : this.entryPoint) + ").delete( " + object + " );";
    }

}