text:
package com.google.security.zynamics.binnavi.disassembly.views;

import com.google.security.zynamics.binnavi.disassembly.CCodeNodeHelpers;
import com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress;
import com.google.security.zynamics.binnavi.disassembly.INaviCodeNode;
import com.google.security.zynamics.binnavi.disassembly.INaviFunctionNode;
import com.google.security.zynamics.binnavi.disassembly.INaviViewNode;

/**
 * Contains helper classes for working with views.
 */
public final class CViewHelpers {
  /**
   * You are not supposed to instantiate this class.
   */
  private CViewHelpers() {
  }

  /**
   * Determines whether a given view contains a node with a given address.
   *
   * @param view The view to search through.
   * @param address The address to search for.
   *
   * @return True, if the view contains the given address. False, otherwise.
   */
  public static boolean containsAddress(final INaviView view, final UnrelocatedAddress address) {
    for (final INaviViewNode node : view.getGraph().getNodes()) {
      if (node instanceof INaviFunctionNode) {
        final INaviFunctionNode fnode = (INaviFunctionNode) node;

        if (fnode.getFunction().getAddress().equals(address.getAddress())) {
          return true;
        }
      } else if (node instanceof INaviCodeNode) {
        final INaviCodeNode cnode = (INaviCodeNode) node;

        if (CCodeNodeHelpers.containsAddress(cnode, address.getAddress())) {
          return true;
        }
      }
    }

    return false;
  }
}


text:
package com.ensoft.restafari.network.rest.request;

import com.android.volley.Request;
import com.ensoft.restafari.network.processor.ResponseProcessor;

public class RequestConfiguration
{
	private final Class<? extends Request> requestClass;
	private final Class<?> responseClass;
	private final Class<? extends ResponseProcessor> processorClass;

	public RequestConfiguration( Class<? extends Request> requestClass, Class<? extends ResponseProcessor> processorClass, Class<?> responseClass )
	{
		this.requestClass = requestClass;
		this.processorClass = processorClass;
		this.responseClass = responseClass;
	}

	public RequestConfiguration( Class<? extends Request> requestClass, Class<? extends ResponseProcessor> processorClass )
	{
		this( requestClass, processorClass, null );
	}

	public RequestConfiguration( Class<? extends Request> requestClass )
	{
		this( requestClass, null, null );
	}

	public Class<?> getResponseClass()
	{
		return responseClass;
	}

	public Class<? extends Request> getRequestClass()
	{
		return requestClass;
	}

	public Class<? extends ResponseProcessor> getProcessorClass()
	{
		return processorClass;
	}
}

redpajama_set_name: RedPajamaGithub


text:
<?php

require_once('../../_include.php');

$config = SimpleSAML_Configuration::getInstance();

$session = SimpleSAML_Session::getInstance();

SimpleSAML_Logger::info('WS-Fed - SP.initSLO: Accessing WS-Fed SP initSLO script');

if (!$config->getBoolean('enable.wsfed-sp', false))
	SimpleSAML_Utilities::fatalError($session->getTrackID(), 'NOACCESS');

if (isset($_REQUEST['RelayState'])) {
	$returnTo = $_REQUEST['RelayState'];
} else {
	SimpleSAML_Utilities::fatalError($session->getTrackID(), 'NORELAYSTATE');
}

if (isset($session) ) {

	try {

		$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();

		$idpentityid = $session->getIdP();
		$spentityid = isset($_GET['spentityid']) ? $_GET['spentityid'] : $metadata->getMetaDataCurrentEntityID();

		/**
		 * Create a logout request
		 */

		$session->doLogout();

		SimpleSAML_Logger::info('WS-Fed - SP.initSLO: SP (' . $spentityid . ') is sending logout request to IdP (' . $idpentityid . ')');

		$idpmeta = $metadata->getMetaData($idpentityid, 'wsfed-idp-remote');

		SimpleSAML_Utilities::redirect($idpmeta['prp'], array(
			'wa' => 'wsignout1.0',
			'wct' =>  gmdate('Y-m-d\TH:i:s\Z', time()),
			'wtrealm' => $spentityid,
			'wctx' => $returnTo
		));

	} catch(Exception $exception) {
		SimpleSAML_Utilities::fatalError($session->getTrackID(), 'CREATEREQUEST', $exception);
	}

} else {

	SimpleSAML_Logger::info('WS-Fed - SP.initSLO: User is already logged out. Go back to relaystate');
	SimpleSAML_Utilities::redirect($returnTo);

}

?>


text:
                <a href="<?= esc_url(home_url('/')); ?>"><img src="<?php echo get_stylesheet_directory_uri() ?>/assets/images/logo-dancefloor.png" alt="Dancefloor logo" class="ui image medium" />

infos@dancefloorgenevasalsa.ch

+41 78 657 50 56

        <?php dynamic_sidebar('sidebar-footer'); ?>


text:
/* THIS FILE IS AUTOGENERATED FROM NativeOSFileInternals.webidl BY Codegen.py - DO NOT EDIT */

#ifndef mozilla_dom_NativeOSFileInternalsBinding_h
#define mozilla_dom_NativeOSFileInternalsBinding_h

#include "js/RootingAPI.h"
#include "jspubtd.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/Nullable.h"

namespace mozilla {
namespace dom {

struct NativeOSFileReadOptionsAtoms;
struct NativePropertyHooks;
class ProtoAndIfaceCache;

} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {

struct NativeOSFileReadOptions : public DictionaryBase
{
  Optional<Nullable<uint64_t>> mBytes;
  Optional<nsString> mEncoding;

  NativeOSFileReadOptions();

  explicit inline NativeOSFileReadOptions(const FastDictionaryInitializer& )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

  explicit inline NativeOSFileReadOptions(const NativeOSFileReadOptions& aOther)
  {
    *this = aOther;
  }

  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const NativeOSFileReadOptions& aOther);

private:
  static bool
  InitIds(JSContext* cx, NativeOSFileReadOptionsAtoms* atomsCache);
};

namespace binding_detail {
struct FastNativeOSFileReadOptions : public NativeOSFileReadOptions
{
  inline FastNativeOSFileReadOptions()
    : NativeOSFileReadOptions(FastDictionaryInitializer())
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_NativeOSFileInternalsBinding_h


text:
<?php declare(strict_types=1);

namespace Limoncello\Application\Authorization;

/**
 * @package Limoncello\Application
 */
interface ContextProperties extends RequestProperties
{
    /** Context key */
    const CTX_CONTAINER = self::REQ_FIRST - 1;

    /** Context key */
    const CTX_LAST = self::CTX_CONTAINER;
}


text:
using Imagination.BusinessLogic;
using Imagination.Documentation;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Net;

namespace Imagination.Controllers
{
    [RouteDocumentation(Route = "/configuration", DisplayName = "Configuration", Summary = "Retrieve server configuration for the current organisation.")]
    [RouteDocumentation(Route = "/configuration/bootstrap", DisplayName = "Bootstrap Configuration", Summary = "Retrieve bootstrap server connection information that a client can use to connect to.")]
    [Authorize()]
    [Route("/configuration")]
    public class ConfigurationController: ControllerBase
    {
        [MethodDocumentation(
            Summary = "Retrieve links to configurable endpoints.",
            ResponseTypes = new[] { typeof(ServiceModels.Configuration) },
            StatusCodes = new[] { HttpStatusCode.OK, }
        )]
        [HttpGet]
        public IActionResult GetConfiguration()
        {
            IActionResult result;
            ServiceModels.Configuration response = new ServiceModels.Configuration();
            string rootUrl = Request.GetRootUrl();
            response.AddLink<ServiceModels.Bootstrap>(Request,"bootstrap", string.Concat(rootUrl, "/configuration/bootstrap"));
            result = Request.GetObjectResult(response);
            return result;
        }

        [MethodDocumentation(
            Summary = "Retrieve bootstrap configuration for a client to use to connect to the Device Server.",
            ResponseTypes = new[] { typeof(ServiceModels.Bootstrap) },
            StatusCodes = new[] { HttpStatusCode.OK, HttpStatusCode.NotFound }
        )]
        [HttpGet("bootstrap")]
        public IActionResult GetBootstrapConfiguration()
        {
            IActionResult result;
            Model.BootstrapServer bootstrapServer = BusinessLogicFactory.Configuration.GetBootstrapServer(User.GetOrganisationID());
            if (bootstrapServer == null)
                result = new NotFoundResult();
            else
            {
                ServiceModels.Bootstrap response = new ServiceModels.Bootstrap(bootstrapServer);
                result = Request.GetObjectResult(response);
            }
            return result;
        }

    }
}


text:
Card will take *any* credit card form and make it the best part of the checkout process (without you changing anything). Everything is created with pure CSS, HTML, and Javascript — no images required.

![card](http://i.imgur.com/qG3TenO.gif)

## Usage

To use, you'll need to include the correct CSS and Javascript files into your HTML. You can find the necessary files at `/lib/js/card.js` and `/lib/css/card.css` and include them in your HTML like so.

```html
<!-- in HEAD -->
<link rel="stylesheet" href="/path/to/card.css">
<!-- at the end of BODY -->
<script src="/path/to/jquery.js"></script>
<script src="/path/to/card.js"></script>
```

Once you've included those files, you can initialize Card.

```javascript
$('form').card({
    // a selector or jQuery object for the container
    // where you want the card to appear
    container: '.card-wrapper', // *required*
    numberInput: 'input#number', // optional — default input[name="number"]
    expiryInput: 'input#expiry', // optional — default input[name="expiry"]
    cvcInput: 'input#cvc', // optional — default input[name="cvc"]
    nameInput: 'input#name', // options - defaults input[name="name"]

    width: 200, // optional — default 350px
    formatting: true // optional - default true
});
```

## Development

To contribute, follow this steps:

```bash
$ git clone git@github.com:jessepollak/card.git
$ cd card
$ git submodule init
$ git submodule update
$ npm install
$ gulp watch
```

Now, if you go to localhost:8080/example in your browser, you should see the demo page.


text:
package edu.berkeley.cs.amplab.spark.indexedrdd.util

/**
 * A simple, fixed-size bit set implementation. This implementation is fast because it avoids
 * safety/bound checking.
 */
class BitSet(numBits: Int) extends Serializable {

  private val words = new Array[Long](bit2words(numBits))
  private val numWords = words.length

  /**
   * Compute the capacity (number of bits) that can be represented
   * by this bitset.
   */
  def capacity: Int = numWords * 64

  /**
   * Set all the bits up to a given index
   */
  def setUntil(bitIndex: Int) {
    val wordIndex = bitIndex >> 6 // divide by 64
    var i = 0
    while(i < wordIndex) { words(i) = -1; i += 1 }
    if(wordIndex < words.size) {
      // Set the remaining bits (note that the mask could still be zero)
      val mask = ~(-1L << (bitIndex & 0x3f))
      words(wordIndex) |= mask
    }
  }

  /**
   * Compute the bit-wise AND of the two sets returning the
   * result.
   */
  def &(other: BitSet): BitSet = {
    val newBS = new BitSet(math.max(capacity, other.capacity))
    val smaller = math.min(numWords, other.numWords)
    assert(newBS.numWords >= numWords)
    assert(newBS.numWords >= other.numWords)
    var ind = 0
    while( ind < smaller ) {
      newBS.words(ind) = words(ind) & other.words(ind)
      ind += 1
    }
    newBS
  }

  /**
   * Compute the bit-wise OR of the two sets returning the
   * result.
   */
  def |(other: BitSet): BitSet = {
    val newBS = new BitSet(math.max(capacity, other.capacity))
    assert(newBS.numWords >= numWords)
    assert(newBS.numWords >= other.numWords)
    val smaller = math.min(numWords, other.numWords)
    var ind = 0
    while( ind < smaller ) {
      newBS.words(ind) = words(ind) | other.words(ind)
      ind += 1
    }
    while( ind < numWords ) {
      newBS.words(ind) = words(ind)
      ind += 1
    }
    while( ind < other.numWords ) {
      newBS.words(ind) = other.words(ind)
      ind += 1
    }
    newBS
  }

  /**
   * Compute the symmetric difference by performing bit-wise XOR of the two sets returning the
   * result.
   */
  def ^(other: BitSet): BitSet = {
    val newBS = new BitSet(math.max(capacity, other.capacity))
    val smaller = math.min(numWords, other.numWords)
    var ind = 0
    while (ind < smaller) {
      newBS.words(ind) = words(ind) ^ other.words(ind)
      ind += 1
    }
    if (ind < numWords) {
      Array.copy( words, ind, newBS.words, ind, numWords - ind )
    }
    if (ind < other.numWords) {
      Array.copy( other.words, ind, newBS.words, ind, other.numWords - ind )
    }
    newBS
  }

  /**
   * Compute the difference of the two sets by performing bit-wise AND-NOT returning the
   * result.
   */
  def andNot(other: BitSet): BitSet = {
    val newBS = new BitSet(capacity)
    val smaller = math.min(numWords, other.numWords)
    var ind = 0
    while (ind < smaller) {
      newBS.words(ind) = words(ind) & ~other.words(ind)
      ind += 1
    }
    if (ind < numWords) {
      Array.copy( words, ind, newBS.words, ind, numWords - ind )
    }
    newBS
  }

  /**
   * Sets the bit at the specified index to true.
   * @param index the bit index
   */
  def set(index: Int) {
    val bitmask = 1L << (index & 0x3f)  // mod 64 and shift
    words(index >> 6) |= bitmask        // div by 64 and mask
  }

  def unset(index: Int) {
    val bitmask = 1L << (index & 0x3f)  // mod 64 and shift
    words(index >> 6) &= ~bitmask        // div by 64 and mask
  }

  /**
   * Return the value of the bit with the specified index. The value is true if the bit with
   * the index is currently set in this BitSet; otherwise, the result is false.
   *
   * @param index the bit index
   * @return the value of the bit with the specified index
   */
  def get(index: Int): Boolean = {
    val bitmask = 1L << (index & 0x3f)   // mod 64 and shift
    (words(index >> 6) & bitmask) != 0  // div by 64 and mask
  }

  /**
   * Get an iterator over the set bits.
   */
  def iterator = new Iterator[Int] {
    var ind = nextSetBit(0)
    override def hasNext: Boolean = ind >= 0
    override def next() = {
      val tmp = ind
      ind  = nextSetBit(ind + 1)
      tmp
    }
  }

  /** Return the number of bits set to true in this BitSet. */
  def cardinality(): Int = {
    var sum = 0
    var i = 0
    while (i < numWords) {
      sum += java.lang.Long.bitCount(words(i))
      i += 1
    }
    sum
  }

  /**
   * Returns the index of the first bit that is set to true that occurs on or after the
   * specified starting index. If no such bit exists then -1 is returned.
   *
   * To iterate over the true bits in a BitSet, use the following loop:
   *
   *  for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i+1)) {
   *    // operate on index i here
   *  }
   *
   * @param fromIndex the index to start checking from (inclusive)
   * @return the index of the next set bit, or -1 if there is no such bit
   */
  def nextSetBit(fromIndex: Int): Int = {
    var wordIndex = fromIndex >> 6
    if (wordIndex >= numWords) {
      return -1
    }

    // Try to find the next set bit in the current word
    val subIndex = fromIndex & 0x3f
    var word = words(wordIndex) >> subIndex
    if (word != 0) {
      return (wordIndex << 6) + subIndex + java.lang.Long.numberOfTrailingZeros(word)
    }

    // Find the next set bit in the rest of the words
    wordIndex += 1
    while (wordIndex < numWords) {
      word = words(wordIndex)
      if (word != 0) {
        return (wordIndex << 6) + java.lang.Long.numberOfTrailingZeros(word)
      }
      wordIndex += 1
    }

    -1
  }

  private[spark] def toImmutableBitSet: ImmutableBitSet = {
    new ImmutableBitSet(numBits, ImmutableVector.fromArray(words))
  }

  /** Return the number of longs it would take to hold numBits. */
  private def bit2words(numBits: Int) = ((numBits - 1) >> 6) + 1
}


text:
#ifndef _POPPLER_LINK_EXTRACTOR_H_
#define _POPPLER_LINK_EXTRACTOR_H_

#include <Object.h>
#include <OutputDev.h>

#include <QtCore/QList>

namespace Poppler
{

class Link;
class PageData;

class LinkExtractorOutputDev : public OutputDev
{
  public:
    LinkExtractorOutputDev(PageData *data);
    virtual ~LinkExtractorOutputDev();

    // inherited from OutputDev
    virtual GBool upsideDown() { return gFalse; }
    virtual GBool useDrawChar() { return gFalse; }
    virtual GBool interpretType3Chars() { return gFalse; }
    virtual void processLink(::AnnotLink *link);

    // our stuff
    QList< Link* > links();

  private:
    PageData *m_data;
    double m_pageCropWidth;
    double m_pageCropHeight;
    QList< Link* > m_links;
};

}

#endif


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const types_1 = require("../discriminator/types");
const compile_1 = require("../../compile");
const util_1 = require("../../compile/util");
const error = {
    message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag
        ? `tag "${tagName}" must be string`
        : `value of tag "${tagName}" must be in oneOf`,
    params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._) `{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`,
};
const def = {
    keyword: "discriminator",
    type: "object",
    schemaType: "object",
    error,
    code(cxt) {
        const { gen, data, schema, parentSchema, it } = cxt;
        const { oneOf } = parentSchema;
        if (!it.opts.discriminator) {
            throw new Error("discriminator: requires discriminator option");
        }
        const tagName = schema.propertyName;
        if (typeof tagName != "string")
            throw new Error("discriminator: requires propertyName");
        if (schema.mapping)
            throw new Error("discriminator: mapping is not supported");
        if (!oneOf)
            throw new Error("discriminator: requires oneOf keyword");
        const valid = gen.let("valid", false);
        const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(tagName)}`);
        gen.if((0, codegen_1._) `typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName }));
        cxt.ok(valid);
        function validateMapping() {
            const mapping = getMapping();
            gen.if(false);
            for (const tagValue in mapping) {
                gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`);
                gen.assign(valid, applyTagSchema(mapping[tagValue]));
            }
            gen.else();
            cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName });
            gen.endIf();
        }
        function applyTagSchema(schemaProp) {
            const _valid = gen.name("valid");
            const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid);
            cxt.mergeEvaluated(schCxt, codegen_1.Name);
            return _valid;
        }
        function getMapping() {
            var _a;
            const oneOfMapping = {};
            const topRequired = hasRequired(parentSchema);
            let tagRequired = true;
            for (let i = 0; i < oneOf.length; i++) {
                let sch = oneOf[i];
                if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {
                    sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, sch === null || sch === void 0 ? void 0 : sch.$ref);
                    if (sch instanceof compile_1.SchemaEnv)
                        sch = sch.schema;
                }
                const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];
                if (typeof propSch != "object") {
                    throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`);
                }
                tagRequired = tagRequired && (topRequired || hasRequired(sch));
                addMappings(propSch, i);
            }
            if (!tagRequired)
                throw new Error(`discriminator: "${tagName}" must be required`);
            return oneOfMapping;
            function hasRequired({ required }) {
                return Array.isArray(required) && required.includes(tagName);
            }
            function addMappings(sch, i) {
                if (sch.const) {
                    addMapping(sch.const, i);
                }
                else if (sch.enum) {
                    for (const tagValue of sch.enum) {
                        addMapping(tagValue, i);
                    }
                }
                else {
                    throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`);
                }
            }
            function addMapping(tagValue, i) {
                if (typeof tagValue != "string" || tagValue in oneOfMapping) {
                    throw new Error(`discriminator: "${tagName}" values must be unique strings`);
                }
                oneOfMapping[tagValue] = i;
            }
        }
    },
};
exports.default = def;
//# sourceMappingURL=index.js.map


text:
layout: post
title: Copiando arquivos para dentro do container
date: 2019-04-03T12:00:00.000+00:00
image: "https://res.cloudinary.com/jesstemporal/image/upload/v1640360835/covers/colinha_igmf4s.png"
comments: true
type: post
lang: pt
translated: "/copying-files-into-a-container"
tags:
- colinha
- docker
- container
- containers
description: Aprenda a copiar arquivos para dentro do container Docker

---
---

Read [this post in English](https://jtemporal.com/copying-files-into-a-container/).

---

Às vezes volumes não funcionam e a gente precisa copiar coisas para dentro do container. É sério! Você deve estar se perguntando, "_como uma tecnologia que todo mundo usa, não funciona?!"_

Tá, tá... Eu sei que isso tá parecendo aquelas histórias de "funciona na minha máquina" invertido. Mas vou explicar, no começo do ano eu estava trabalhando com um computador provisório. Infelizmente, eu não tinha poderes de administrador desse computador, o que me impedia de fazer certas coisas, inclusive de dar permissão ao Docker para compartilhar volumes com o sistema de arquivos do Windows.

Ah sim, talvez seja importante mencionar que eu só descobri como copiar arquivos para dentro de container que tá rodando, pois o Windows tem todas essas paradas de permissão.

Então bora lá!

## Materiais

Para essa colinha você vai precisar de:

* Um container Docker rodando
* Um arquivo que você quer copiar para dentro do Docker
* Conhecimentos básicos de Docker

## Descobrindo o container

Dependendo de como você inicie o seu container você não vai saber o nome dele, então vamos primeiro conferir isso. Como trabalho com ciência e análise de dados, é muito comum me encontrar com um container do Jupyter rodando, é esse que vou usar aqui. Para pegar o nome do container precisamos listar os containers que estão de pé:

Aqui no meu caso, temos um resultado assim:

    CONTAINER ID        IMAGE                          NAMES
    11b8af1aeb43        jupyter/datascience-notebook   relaxed_hypatia

Eu expliquei como montar esse comando que só mostra o ID do container, a imagem sendo usada e o nome do container [nessa colinha aqui](https://jtemporal.com/brincando-com-a-listagem-de-containers-docker/). Com isso sabemos que o meu container de interesse se chama `relaxed_hypatia`.

## Descobrindo para onde mandar os dados

Bem se, como eu, você normalmente mapearia volumes para compartilhar os dados com seu container provavelmente já sabe para onde mandar os dados. No entanto, se você não faz isso ou é uma imagem nova que você está usando pela primeira vez, sua missão é descobrir para onde mandar os arquivos. Geralmente essa informação está na documentação da imagem.

No caso das imagens do Projeto Jupyter, existe uma pasta tradicional para mapear os volumes que essa: `/home/jovyan/work`. Vou mandar os dados pra lá, então quando você tiver rodando aí pro seu container, lembre-se de substituir esse caminho, para o caminho do seu container.

## Finalmente copiando os dados

Agora que você já descobriu o lugar para onde quer mandar os dados e o nome do container, chegou a hora de finalmente colocar os dados lá no container. Se você brinca de copiar arquivos pra lá e pra cá pelo terminal, deve ter o costume de usar o comando `cp`. Mas caso não tenha, o `cp` (de _copy_) é o Ctrl+C Ctrl+V do terminal, ele faz um cópia de um arquivo em um lugar para outro lugar. Por exemplo, vamos supor que tenho a seguinte situação:

    pasta1/						pasta2/
    └── arquivo_A.txt

E que eu quero copiar o `arquivo_A.txt` para a `pasta2`, tudo isso pelo terminal. Então eu poderia fazer apenas o seguinte:

    cp pasta1/arquivo_A.txt pasta2

E o resultado disso seria:

    pasta1/					pasta2/
    └── arquivo_A.txt			└── arquivo_A.txt

E dá para fazer a mesma coisa com o container. O Docker tem a versão dele chamado `docker cp` que funciona de forma análoga ao `cp` do terminal. Com a pequena diferença que o caminho de destino é formado assim: `nome_do_container:caminho/de/destino`. Então vamos copiar o arquivo `dados.csv` para dentro do meu `relaxed_hypatia`:

    docker cp dados.csv relaxed_hypatia:/home/jovyan/work/dados.csv

E aí eu consigo ver os meus dados lá dentro do meu container. Como no meu caso eu tô rodando um container do Jupyter eu consigo ver esse arquivo lá na minha interface:

Legal né? Você pode seguir a mesma filosofia para retirar dados de dentro do container para sua máquina local, basta inverter a ordem dos caminhos.

## Considerações finais

Uma coisa muito importante de lembrar, containers foram feitos para serem efêmeros, então lembre-se de se certificar que esta mantendo um backup dos seus dados. Afinal, depois de removido um container não tem mais como recuperar os dados que estavam lá dentro.

Outro motivo que um amigo me ensinou recentemente a favor de copiar os dados para dentro do container é que manter volumes atualizados quando seu container faz muitos processos de leitura e escrita é extremamente custoso. Então, se você tem um arquivo grande que não muda, como um arquivo de dados, ou um processo que faz muita leitura e escrita, como um servidor rails, vale a pena considerar entre copiar os arquivos para dentro do container ou até mesmo fazer uma imagem ja com esses arquivos. Lembre-se sempre de pesar os pontos a favor e os pontos contra volumes na próxima vez que for usar containers.

---

Por hoje é só pessoal. Xêro!


text:
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
// BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

use super::{ImageId, Image, MultiImage, Buffer};
use std::{slice, ptr};
use std::path::PathBuf;
use std::os::raw::c_char;
use std::ffi::CStr;
use image;

#[no_mangle]
pub extern "C" fn image_free_id(id: *mut ImageId) {
    let _ = unsafe { Box::from_raw(id) };
}

#[no_mangle]
pub extern "C" fn image_free(id: *mut Image) {
    let _ = unsafe { Box::from_raw(id) };
}

#[no_mangle]
pub extern "C" fn image_free_multi(id: *mut MultiImage) {
    let _ = unsafe { Box::from_raw(id) };
}

#[no_mangle]
pub extern "C" fn image_open_path(path: *const c_char) -> *mut ImageId {
    let path: &CStr = unsafe { CStr::from_ptr(path) };
    let path: &str = match path.to_str() {
        Ok(path) => path,
        Err(_) => return ptr::null_mut(),
    };
    Box::into_raw(Box::new(ImageId::File(PathBuf::from(path))))
}

#[no_mangle]
pub extern "C" fn image_open_buffer(buf: *const u8, len: usize) -> *mut ImageId {
    let slice = unsafe { slice::from_raw_parts(buf, len) };
    let id = ImageId::Borrowed(slice as *const [u8]);
    Box::into_raw(Box::new(id))
}

#[no_mangle]
pub extern "C" fn image_open_buffer_copy(buf: *const u8, len: usize) -> *mut ImageId {
    let slice = unsafe { slice::from_raw_parts(buf, len) };
    let mut vec = Vec::with_capacity(len);
    unsafe { vec.set_len(len) };
    (&mut vec[..]).copy_from_slice(slice);
    let id = ImageId::Owned(Buffer::Boxed(vec.into_boxed_slice()));
    Box::into_raw(Box::new(id))
}

#[no_mangle]
pub extern "C" fn image_open_buffer_owned(buf: *const u8, len: usize, free: fn(*const u8, usize)) -> *mut ImageId {
    let id = ImageId::Owned(Buffer::Allocated(buf, len, free));
    Box::into_raw(Box::new(id))
}

#[no_mangle]
pub extern "C" fn image_load_png(id: *const ImageId) -> *mut Image {
    let id = unsafe { &*id };
    Box::into_raw(match Image::load(id, image::PNG) {
        Ok(img) => Box::new(img),
        Err(_) => return ptr::null_mut(),
    })
}

#[no_mangle]
pub extern "C" fn image_load_jpg(id: *const ImageId) -> *mut Image {
    let id = unsafe { &*id };
    Box::into_raw(match Image::load(id, image::JPEG) {
        Ok(img) => Box::new(img),
        Err(_) => return ptr::null_mut(),
    })
}

#[no_mangle]
pub extern "C" fn image_load_gif(id: *const ImageId) -> *mut Image {
    let id = unsafe { &*id };
    Box::into_raw(match Image::load(id, image::GIF) {
        Ok(img) => Box::new(img),
        Err(_) => return ptr::null_mut(),
    })
}

#[no_mangle]
pub extern "C" fn image_load_webp(id: *const ImageId) -> *mut Image {
    let id = unsafe { &*id };
    Box::into_raw(match Image::load(id, image::WEBP) {
        Ok(img) => Box::new(img),
        Err(_) => return ptr::null_mut(),
    })
}

#[no_mangle]
pub extern "C" fn image_load_ppm(id: *const ImageId) -> *mut Image {
    let id = unsafe { &*id };
    Box::into_raw(match Image::load(id, image::PPM) {
        Ok(img) => Box::new(img),
        Err(_) => return ptr::null_mut(),
    })
}

#[no_mangle]
pub extern "C" fn image_load_bmp(id: *const ImageId) -> *mut Image {
    let id = unsafe { &*id };
    Box::into_raw(match Image::load(id, image::BMP) {
        Ok(img) => Box::new(img),
        Err(_) => return ptr::null_mut(),
    })
}

#[no_mangle]
pub extern "C" fn image_load_ico(id: *const ImageId) -> *mut Image {
    let id = unsafe { &*id };
    Box::into_raw(match Image::load(id, image::ICO) {
        Ok(img) => Box::new(img),
        Err(_) => return ptr::null_mut(),
    })
}

#[no_mangle]
pub extern "C" fn image_load_multi_gif(id: *mut ImageId) -> *mut MultiImage {
    let id = unsafe { Box::from_raw(id) };
    Box::into_raw(match MultiImage::new(*id) {
        Ok(img) => Box::new(img),
        Err(_) => return ptr::null_mut(),
    })
}

#[no_mangle]
pub extern "C" fn image_get_frame(image: *const Image) -> *const image::Frame {
    unsafe { &(*image).frame }
}

#[no_mangle]
pub extern "C" fn image_get_frame_multi(image: *mut MultiImage, index: u32, delay: *mut u16) -> *const image::Frame {
    let image: &mut MultiImage = unsafe { &mut *image };
    let frame = match image.request_frame(index as usize) {
        Some(frame) => {
            frame as *const _
        },
        None => return ptr::null(),
    };
    unsafe { *delay = image.delay };
    frame
}

#[no_mangle]
pub extern "C" fn image_get_size(image: *const Image, width: *mut u32, height: *mut u32) {
    unsafe {
        let image: &Image = &*image;
        *width = image.frame.buffer().width();
        *height = image.frame.buffer().height();
    }
}

#[no_mangle]
pub extern "C" fn image_get_multi_size(image: *const MultiImage, width: *mut u32, height: *mut u32) {
    unsafe {
        let image: &MultiImage = &*image;
        *width = image.width;
        *height = image.height;
    }
}

#[no_mangle]
pub extern "C" fn image_get_frame_buffer(frame: *const image::Frame, buffer: *mut *const u8) {
    unsafe {
        let frame: &image::Frame = &*frame;
        *buffer = (&frame.buffer()[(0, 0)]) as *const image::Rgba<u8> as *const u8
    }
}


text:
export PYTHONPATH=".:$PYTHONPATH"
export DJANGO_SETTINGS_MODULE="test_settings"

usage() {
    echo "USAGE: $0 [command]"
    echo "  test - run the waffle tests"
    echo "  lint - run flake8"
    echo "  shell - open the Django shell"
    echo "  makemigrations - create a schema migration"
    exit 1
}

CMD="$1"
shift

case "$CMD" in
    "test" )
        DJANGO_SETTINGS_MODULE=test_settings django-admin test waffle $@ ;;
    "lint" )
        flake8 waffle $@ ;;
    "shell" )
        django-admin shell $@ ;;
    "makemigrations" )
        django-admin makemigrations waffle $@ ;;
    "makemessages" )
        export DJANGO_SETTINGS_MODULE= && cd waffle && django-admin makemessages --all && cd - ;;
    "compilemessages" )
        export DJANGO_SETTINGS_MODULE= && cd waffle && django-admin compilemessages && cd - ;;
    "find_uncommitted_translations" )
        git diff --exit-code -G "^(msgid|msgstr)" || (echo "Please run ./run.sh makemessages and commit the updated django.po file." && false) ;;
    * )
        usage ;;
esac


text:
package org.hisp.dhis.dxf2.dataset.tasks;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.SessionFactory;
import org.hisp.dhis.dbms.DbmsUtils;
import org.hisp.dhis.dxf2.common.ImportOptions;
import org.hisp.dhis.dxf2.dataset.CompleteDataSetRegistrationExchangeService;
import org.hisp.dhis.scheduling.JobConfiguration;
import org.hisp.dhis.security.SecurityContextRunnable;

import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;

/**
 * @author Halvdan Hoem Grelland
 */
public class ImportCompleteDataSetRegistrationsTask
    extends SecurityContextRunnable
{
    Log log = LogFactory.getLog( ImportCompleteDataSetRegistrationsTask.class );

    public static final String FORMAT_JSON = "json", FORMAT_XML = "xml";

    private String format;

    private InputStream input;

    private Path tmpFile;

    private ImportOptions importOptions;

    private JobConfiguration id;

    private SessionFactory sessionFactory;

    // -------------------------------------------------------------------------
    // Dependencies
    // -------------------------------------------------------------------------

    private CompleteDataSetRegistrationExchangeService registrationService;

    // -------------------------------------------------------------------------
    // Constructors
    // -------------------------------------------------------------------------

    public ImportCompleteDataSetRegistrationsTask( CompleteDataSetRegistrationExchangeService registrationService,
        SessionFactory sessionFactory, InputStream input, Path tmpFile, ImportOptions importOptions, String format, JobConfiguration id )
    {
        this.registrationService = registrationService;
        this.sessionFactory = sessionFactory;
        this.input = input;
        this.tmpFile = tmpFile;
        this.importOptions = importOptions;
        this.format = format;
        this.id = id;
    }

    // -------------------------------------------------------------------------
    // SecurityContextRunnable implementation
    // -------------------------------------------------------------------------

    @Override
    public void call()
    {
        try
        {
            if ( FORMAT_XML.equals( format ) )
            {
                registrationService.saveCompleteDataSetRegistrationsXml( input, importOptions, id );
            }
            else if ( FORMAT_JSON.equals( format ) )
            {
                registrationService.saveCompleteDataSetRegistrationsJson( input, importOptions, id );
            }
        }
        finally
        {
            cleanUpTmpFile( tmpFile );
        }
    }

    @Override
    public void before()
    {
        DbmsUtils.bindSessionToThread( sessionFactory );
    }

    @Override
    public void after()
    {
        DbmsUtils.unbindSessionFromThread( sessionFactory );
    }

    // -------------------------------------------------------------------------
    // Supportive methods
    // -------------------------------------------------------------------------

    private void cleanUpTmpFile( Path tmpFile )
    {
        if ( tmpFile == null )
        {
            return;
        }

        try
        {
            Files.deleteIfExists( tmpFile );
        }
        catch ( IOException ignored )
        {
            // Intentionally ignored
            log.warn( "Deleting temporary file failed: " + tmpFile, ignored );
        }
    }
}


text:
import sys
import re

"""Baby Names exercise

Define the extract_names() function below and change main()
to call it.

For writing regex, it's nice to include a copy of the target
text for inspiration.

Here's what the html looks like in the baby.html files:
...

Popularity in 1990

....

1	Michael	Jessica

2	Christopher	Ashley

3	Matthew	Brittany
...

Suggested milestones for incremental development:
 -Extract the year and print it
 -Extract the names and rank numbers and just print them
 -Get the names data into a dict and print it
 -Build the [year, 'name rank', ... ] list and print it
 -Fix main() to use the extract_names list
"""

def _get_names_with_rank(iterable):
    it = iter(iterable)
    while True:
        ranked_pair = next(it).groups()
        yield '%s %s' % (ranked_pair[1], ranked_pair[0])
        yield '%s %s' % (ranked_pair[2], ranked_pair[0])

def extract_names(filename):
    """
    Given a file name for baby.html, returns a list starting with the year string
    followed by the name-rank strings in alphabetical order.
    ['2006', 'Aaliyah 91', Aaron 57', 'Abagail 895', ' ...]
    """
    with open(filename, 'r') as f:
        html = f.read()
    year = re.search('Popularity in (\d{4})', html).groups(0)[0]
    name_info = re.finditer(r'
(\d+)	(\w+)	(\w+)	', html)
    ranked_names_by_year = [name for name in _get_names_with_rank(name_info)]
    ranked_names_by_year.append(year)
    ranked_names_by_year.sort()
    return ranked_names_by_year

def main():
    # This command-line parsing code is provided.
    # Make a list of command line arguments, omitting the [0] element
    # which is the script itself.
    args = sys.argv[1:]

    if not args:
        print('usage: [--summaryfile] file [file ...]')
        sys.exit(1)

    # Notice the summary flag and remove it from args if it is present.
    summary = False
    if args[0] == '--summaryfile':
        summary = True
        del args[0]

        # +++your code here+++
        # For each filename, get the names, then either print the text output
        # or write it to a summary file
    for filename in args:
        names = '\n'.join(extract_names(filename))
        if summary:
            with open('%s.summary' % filename, 'w') as f:
                f.write(names)
        else:
            print(names)

if __name__ == '__main__':
    main()


text:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
using OpenQA.Selenium;

namespace Selenium.Internal.SeleniumEmulation
{
    /// <summary>
    /// Provides a set of methods designed to help selecting options in select lists.
    /// </summary>
    internal class SeleniumSelect
    {
        private string findOption;
        private IWebDriver driver;
        private IWebElement select;

        /// <summary>
        /// Initializes a new instance of the <see cref="SeleniumSelect"/> class.
        /// </summary>
        /// <param name="finder">An <see cref="ElementFinder"/> used in finding options.</param>
        /// <param name="driver">An <see cref="IWebDriver"/> used to drive the browser.</param>
        /// <param name="locator">A locator used to find options.</param>
        public SeleniumSelect(ElementFinder finder, IWebDriver driver, string locator)
        {
            this.driver = driver;

            this.findOption = "return (" + JavaScriptLibrary.GetSeleniumScript("findOption.js") + ").apply(null, arguments)";

            this.select = finder.FindElement(driver, locator);
            if (this.select.TagName.ToLowerInvariant() != "select")
            {
                throw new SeleniumException("Element is not a select element: " + locator);
            }
        }

        /// <summary>
        /// Gets a collection of elements representing all options for the select list.
        /// </summary>
        public ReadOnlyCollection<IWebElement> AllOptions
        {
            get
            {
                return this.select.FindElements(By.TagName("option"));
            }
        }

        /// <summary>
        /// Gets a collection of elements representing all currently selected options for the select list.
        /// </summary>
        public ReadOnlyCollection<IWebElement> SelectedOptions
        {
            get
            {
                List<IWebElement> toReturn = new List<IWebElement>();

                foreach (IWebElement option in this.select.FindElements(By.TagName("option")))
                {
                    if (option.Selected)
                    {
                        toReturn.Add(option);
                    }
                }

                return toReturn.AsReadOnly();
            }
        }

        /// <summary>
        /// Gets a value indicating whether the select list supports multiple selections.
        /// </summary>
        private bool IsMultiple
        {
            get
            {
                string multipleValue = this.select.GetAttribute("multiple");
                bool multiple = multipleValue == "true" || multipleValue == "multiple";
                return multiple;
            }
        }

        /// <summary>
        /// Selects the indicated option.
        /// </summary>
        /// <param name="optionLocator">The locator to use to find the option to select.</param>
        public void SetSelected(string optionLocator)
        {
            if (this.IsMultiple)
            {
                foreach (IWebElement opt in this.select.FindElements(By.TagName("option")))
                {
                    if (opt.Selected)
                    {
                        opt.Click();
                    }
                }
            }

            IWebElement option = this.LocateOption(optionLocator);
            if (option != null)
            {
                option.Click();
            }
        }

        /// <summary>
        /// Adds a selection to the currently selected options.
        /// </summary>
        /// <param name="optionLocator">The locator to use to find the option to select.</param>
        public void AddSelection(string optionLocator)
        {
            this.AssertSupportsMultipleSelections();

            IWebElement option = this.LocateOption(optionLocator);
            if (option != null)
            {
                option.Click();
            }
        }

        /// <summary>
        /// Deselects a currently selected option.
        /// </summary>
        /// <param name="optionLocator">The locator to use to find the option to select.</param>
        public void RemoveSelection(string optionLocator)
        {
            this.AssertSupportsMultipleSelections();

            IWebElement option = this.LocateOption(optionLocator);
            if (option != null && option.Selected)
            {
                option.Click();
            }
        }

        private IWebElement LocateOption(string optionLocator)
        {
            IWebElement option = null;
            try
            {
                option = ((IJavaScriptExecutor)this.driver).ExecuteScript(this.findOption, this.select, optionLocator) as IWebElement;
            }
            catch (InvalidOperationException)
            {
            }

            return option;
        }

        private void AssertSupportsMultipleSelections()
        {
            if (!this.IsMultiple)
            {
                throw new SeleniumException("You may only add a selection to a select that supports multiple selections");
            }
        }
    }
}


text:
import { combineReducers } from 'redux';
import PoliciesReducer from './reducer_policies';
import PolicyReducer from './reducer_active_policy';

const rootReducer = combineReducers({
  policies: PoliciesReducer,
  activePolicy: PolicyReducer
});

export default rootReducer;


text:
<?xml version="1.0" encoding="UTF-8"?>
<Benchmark xmlns="http://checklists.nist.gov/xccdf/1.2" id="xccdf_moc.elpmaxe.www_benchmark_test">
  <status>accepted</status>
  <version>1.0</version>
  <Rule selected="true" id="xccdf_moc.elpmaxe.www_rule_1">
    <title>Ensure that file exists and it is not executable</title>
    <description><xhtml:object xmlns:xhtml="http://www.w3.org/1999/xhtml" id="#xccdf:value:asdfg"/></description>
    <fix system="urn:xccdf:fix:script:sh">
	<instance/>
	touch test_file
        chmod a-x test_file
    </fix>
    <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
      <check-content-ref href="test_remediation_simple.oval.xml" name="oval:moc.elpmaxe.www:def:1"/>
    </check>
  </Rule>
</Benchmark>


text:
/**
 *
 */
package net.freecoder.restdemo.dao.impl;

import java.util.List;

import net.freecoder.restdemo.dao.ReplyKeywordDao;
import net.freecoder.restdemo.model.ReferenceType;
import net.freecoder.restdemo.model.WlsReplyKeyword;

import org.hibernate.criterion.LogicalExpression;
import org.hibernate.criterion.MatchMode;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.hibernate.criterion.SimpleExpression;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author JiTing
 */
@Repository
@Transactional
public class ReplyKeywordDaoImpl extends CommonDaoImpl<WlsReplyKeyword>
		implements ReplyKeywordDao {

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

	@Override
	public List<WlsReplyKeyword> getListByWxAccountIdAndRefType(
			String wxAccountId, ReferenceType refType) {
		SimpleExpression like = Restrictions.like("refType",
				refType.toString(), MatchMode.START);
		SimpleExpression exp = Restrictions.eq("wlsWxAccountId", wxAccountId);
		LogicalExpression and = Restrictions.and(exp, like);
		Order order = Order.desc("appLastModifyTime");
		return find(WlsReplyKeyword.class, and, order);
	}

	/**
	 * This method will delete original replies before save.
	 */
	@Override
	@Transactional(propagation = Propagation.REQUIRED)
	public String save(WlsReplyKeyword entity) {
		WlsReplyKeyword[] arrEntity = new WlsReplyKeyword[] { entity };
		return this.saveAll(entity.getWlsWxAccountId(), arrEntity)[0];
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED)
	public String[] saveAll(String wxAccountId, WlsReplyKeyword[] entities) {
		if (entities == null || entities.length == 0) {
			logger.debug("Skip saving blank array of entities.");
			return null;
		}

		String groupName = entities[0].getKeywordGroup();
		deleteByGroup(wxAccountId, groupName);
		currentSession().flush();

		// create new replies.
		String[] retId = new String[entities.length];
		for (int i = 0; i < entities.length; i++) {
			this.createTime(entities[i]);
			retId[i] = currentSession().save(entities[i]).toString();
		}
		return retId;
	}

	@Override
	public List<WlsReplyKeyword> getByKeyword(String wxAccountId, String keyword) {
		SimpleExpression eq = Restrictions.eq("keyword", keyword);
		SimpleExpression eq2 = Restrictions.eq("wlsWxAccountId", wxAccountId);
		LogicalExpression and = Restrictions.and(eq, eq2);
		return find(WlsReplyKeyword.class, and);
	}

	@Override
	public void deleteByGroup(String wxAccountId, String groupName) {
		String hql = "delete from WlsReplyKeyword as kw where kw.keywordGroup = ? and kw.wlsWxAccountId = ?";
		currentSession().createQuery(hql).setString(0, groupName)
				.setString(1, wxAccountId).executeUpdate();
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.cuuuurzel.gollivewallpaper"
    android:versionCode="8"
    android:versionName="2" >

    <uses-sdk
        android:minSdkVersion="10"
        android:targetSdkVersion="18" />

    <uses-feature android:name="android.software.live_wallpaper" />

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.SET_WALLPAPER" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/glider"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <service
            android:name="com.cuuuurzel.gollivewallpaper.GolWallpaper"
            android:label="@string/wallpaper_gol"
            android:permission="android.permission.BIND_WALLPAPER" >
            <intent-filter>
                <action android:name="android.service.wallpaper.WallpaperService" />
            </intent-filter>

            <meta-data
                android:name="android.service.wallpaper"
                android:resource="@xml/gol" />
        </service>

        <activity
            android:name="com.cuuuurzel.gollivewallpaper.GolSettings"
            android:exported="true"
            android:label="@string/gol_settings"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.cuuuurzel.gollivewallpaper.GolSettingsGrid"
            android:exported="true"
            android:label="@string/gol_settings_grid"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme" >
        </activity>
    </application>

</manifest>


text:
namespace type_traits {

template <class, class T>
struct rebind_traits {
  using type = T;
};

template <class T, class TName, class _>
struct rebind_traits<T, named<TName, _>> {
  using type = named<TName, T>;
};

template <class T, class D, class U>
struct rebind_traits<std::unique_ptr<T, D>, U> {
  using type = std::unique_ptr<U, D>;
};

template <class T, class D, class TName, class _>
struct rebind_traits<std::unique_ptr<T, D>, named<TName, _>> {
  using type = named<TName, std::unique_ptr<T, D>>;
};

template <class T, class U>
struct rebind_traits<std::shared_ptr<T>, U> {
  using type = std::shared_ptr<U>;
};

template <class T, class TName, class _>
struct rebind_traits<std::shared_ptr<T>, named<TName, _>> {
  using type = named<TName, std::shared_ptr<T>>;
};

template <class T, class U>
struct rebind_traits<std::weak_ptr<T>, U> {
  using type = std::weak_ptr<U>;
};

template <class T, class TName, class _>
struct rebind_traits<std::weak_ptr<T>, named<TName, _>> {
  using type = named<TName, std::weak_ptr<T>>;
};

template <class T, class U>
struct rebind_traits<boost::shared_ptr<T>, U> {
  using type = boost::shared_ptr<U>;
};

template <class T, class TName, class _>
struct rebind_traits<boost::shared_ptr<T>, named<TName, _>> {
  using type = named<TName, boost::shared_ptr<T>>;
};

template <class T, class U>
using rebind_traits_t = typename rebind_traits<T, U>::type;

}  // type_traits

#endif