text:
package vanh4509;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.UUID;

import spacesettlers.actions.AbstractAction;
import spacesettlers.actions.DoNothingAction;
import spacesettlers.actions.MoveToObjectAction;
import spacesettlers.actions.PurchaseCosts;
import spacesettlers.actions.PurchaseTypes;
import spacesettlers.clients.*;
import spacesettlers.graphics.SpacewarGraphics;
import spacesettlers.objects.AbstractActionableObject;
import spacesettlers.objects.AbstractObject;
import spacesettlers.objects.Asteroid;
import spacesettlers.objects.Base;
import spacesettlers.objects.Beacon;
import spacesettlers.objects.Ship;
import spacesettlers.objects.powerups.SpaceSettlersPowerupEnum;
import spacesettlers.objects.resources.ResourcePile;
import spacesettlers.simulator.Toroidal2DPhysics;
import spacesettlers.utilities.Position;
import spacesettlers.utilities.Vector2D;

/**
 * Manages the bias value for every asteroid in the game field.
 *
 * Handles two representations of knowledge, one propositional
 * model that looks at all asteroids as potential candidates for
 * mining, and another relational representation that only
 * considers asteroids we're closest to.
 *
 * @author Shelby Vanhooser, Nick Sparks
 */
public class AsteroidManager extends Object {

    // --------------------- Class Variable Declarations ---------------------

    private boolean useStdKRep; // changes the knowledge representation used during play
    private String friendlyTeamName = null; // our team name. Used in alternate KR

    private static final double ASTEROID_SCALE_FACTOR = 1.002; // A scaling factor to determine how sensitive the ship is to asteroids

    private static final double ASTEROID_OFFSET_FACTOR = 0.0; // A scalar offset that determines how sensitive the ship is to asteroids

    private static final double MAXIMUM_ASTEROID_VALUE = 707.0; // maximum possible asteroid value.
                                                                // calculated by assuming maximum valued asteroid to be all-metal and of maximum area
                                                                // (15^2 * PI) * METALS_DENSITY (0.45)

	HashMap<UUID, Double> asteroidWeights; // map for standard KR. tracks all asteroids and their bias values, denoted as weights
    HashMap<UUID, Double> teamToAsteroidWeightsMap; // map for the alternate KR. tracks asteroids we're closest to

    UUID maxWeightUUID = null; // stores the UUID of the most valuable asteroid tracked

    // ------------------------ Weight Updating Methods ----------------------------

    /**
     * Updates the weights of each asteroid based on KR used.
     *
     * The weight of each asteroid is determined by its distance
     * from the current ship and its value.
     *
     * @param space the current simulation
     * @param ship the current ship
     *
     * @return (void)
     */
	public void updateWeights(Toroidal2DPhysics space,
        Ship ship) {

        double maxWeight = -1.0;

        maxWeightUUID = null;
        friendlyTeamName = ship.getTeamName();

        // scrub the hashmaps and start over
        asteroidWeights.clear();
        teamToAsteroidWeightsMap.clear();

        if (useStdKRep) {
            // standard knowledge representation
            for (Asteroid ast : space.getAsteroids()) {
                // weight is value / distance. only consider stationary asteroids
                if (ast != null && ast.isMineable() && ast.isAlive() && ast.getPosition().getTranslationalVelocity().getMagnitude() == 0.0){
                    double value = ast.getResources().getTotal();
                    double distance = space.findShortestDistance(ship.getPosition(), ast.getPosition());
                    double weight = getAsteroidWeight(distance, value);

                    // update the maps
                    asteroidWeights.put(ast.getId(), new Double(weight));

                    // update max uuid
                    maxWeightUUID = weight > maxWeight ? ast.getId() : maxWeightUUID;
                }
            }
        } else {
            // alternative knowledge representation
            for (Asteroid ast : space.getAsteroids()) {
                String closestTeamName = null;
                double closestDistance = Double.MAX_VALUE;

                if (ast != null && ast.isMineable() && ast.isAlive() && ast.getPosition().getTranslationalVelocity().getMagnitude() == 0.0) {
                    // for each asteroid, find the ship closest to it
                    for (Ship s : space.getShips()) {
                        double distance = space.findShortestDistance(s.getPosition(), ast.getPosition());

                        if (distance < closestDistance) {
                            closestDistance = distance;
                            closestTeamName = s.getTeamName();
                        }
                    }
                    // update the map
                    double weight = getAsteroidWeight(closestDistance, ast.getResources().getTotal());

                    // we only care if we're the closest
                    if (friendlyTeamName.equals(closestTeamName)) {
                        // update max uuid and weight
                        maxWeightUUID = weight > maxWeight ? ast.getId() : maxWeightUUID;
                        teamToAsteroidWeightsMap.put(ast.getId(), weight);
                    }
                }
            }
        }
	}

    /**
     * Calculates the weight of an asteroid given its distance and value
     *
     * @param distance the distance from the ship
     * @param value the total number of resources on the asteroid
     *
     * @return bias weight of asteroid
     */
    private double getAsteroidWeight(double distance,
        double value) {
        return (value / MAXIMUM_ASTEROID_VALUE) / distance * ASTEROID_SCALE_FACTOR + ASTEROID_OFFSET_FACTOR;
    }

    // --------------------- Value Exporting Methods -----------------------

    /**
     * Returns the asteroid with the highest weight
     * as determined by updateWeights.
     *
     * @param space the current simulation
     *
     * @return best Asteroid for the ship to mine
     */
	public Asteroid getBestAsteroid(Toroidal2DPhysics space) {
        //System.out.println(maxWeightUUID);
        return (Asteroid) space.getObjectById(maxWeightUUID);
	}

    /**
     * Returns the bias value of the best asteroid as determined by updateWeights.
     *
     * @return bias value of the most enticing asteroid
     */
    public double getBiasOfBestAsteroid(){
        if(maxWeightUUID == null){
            return -1.0;
        } else if (useStdKRep) {
            return asteroidWeights.get(maxWeightUUID).doubleValue();
        } else {
            return teamToAsteroidWeightsMap.get(maxWeightUUID).doubleValue();
        }
    }

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

    /**
     * Default constructor. Uses standard KR.
     */
    public AsteroidManager() {
        this(true);
    }

    /**
     * Constructor. Allows you to switch between KRs.
     *
     * @param useStd whether you want to use the standard knowledge representation
     */
    public AsteroidManager(boolean useStd) {
        this.useStdKRep = useStd;
        asteroidWeights = new HashMap<UUID, Double>();
        teamToAsteroidWeightsMap = new HashMap<UUID, Double>();
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>onPopState property - BodyElement class - polymer_app_layout.behaviors library - Dart API</title>

    <base href="../..">

    <link href='https://fonts.googleapis.com/css?family=Source+Code+Pro|Roboto:500,400italic,300,400' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="static-assets/prettify.css">
    <link rel="stylesheet" href="static-assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="static-assets/styles.css">

    <meta name="description" content="API docs for the onPopState property from the BodyElement class, for the Dart programming language.">
    <link rel="icon" href="static-assets/favicon.png">

            <button id="sidenav-left-toggle" type="button"> </button>

polymer_app_layout_template

polymer_app_layout.behaviors

BodyElement

onPopState

onPopState

polymer_app_layout_template

polymer_app_layout.behaviors

BodyElement

onPopState

property
 onPopState

polymer_app_layout_template

polymer_app_layout.behaviors

BodyElement

Constants

blurEvent

errorEvent

focusEvent

hashChangeEvent

loadEvent

messageEvent

offlineEvent

onlineEvent

popStateEvent

resizeEvent

scrollEvent

storageEvent

unloadEvent

Properties

attributes

baseUri

borderEdge

childNodes

children

classes

className

client

clientHeight

clientLeft

clientTop

clientWidth

contentEdge

contentEditable

contextMenu

dataset

dir

documentOffset

draggable

dropzone

firstChild

hidden

id

innerHtml

inputMethodContext

isContentEditable

lang

lastChild

localName

marginEdge

namespaceUri

nextElementSibling

nextNode

nodeName

nodes

nodeType

nodeValue

offset

offsetHeight

offsetLeft

offsetParent

offsetTop

offsetWidth

on

onAbort

onBeforeCopy

onBeforeCut

onBeforePaste

onBlur

onCanPlay

onCanPlayThrough

onChange

onClick

onContextMenu

onCopy

onCut

onDoubleClick

onDrag

onDragEnd

onDragEnter

onDragLeave

onDragOver

onDragStart

onDrop

onDurationChange

onEmptied

onEnded

onError

onFocus

onFullscreenChange

onFullscreenError

onHashChange

onInput

onInvalid

onKeyDown

onKeyPress

onKeyUp

onLoad

onLoadedData

onLoadedMetadata

onMessage

onMouseDown

onMouseEnter

onMouseLeave

onMouseMove

onMouseOut

onMouseOver

onMouseUp

onMouseWheel

onOffline

onOnline

onPaste

onPause

onPlay

onPlaying

onPopState

onRateChange

onReset

onResize

onScroll

onSearch

onSeeked

onSeeking

onSelect

onSelectStart

onStalled

onStorage

onSubmit

onSuspend

onTimeUpdate

onTouchCancel

onTouchEnd

onTouchEnter

onTouchLeave

onTouchMove

onTouchStart

onTransitionEnd

onUnload

onVolumeChange

onWaiting

outerHtml

ownerDocument

paddingEdge

parent

parentNode

previousElementSibling

previousNode

scrollHeight

scrollLeft

scrollTop

scrollWidth

shadowRoot

spellcheck

style

tabIndex

tagName

text

title

translate

xtag

Constructors

BodyElement

created

Methods

addEventListener

animate

append

appendHtml

appendText

attached

attributeChanged

blur

click

clone

contains

createFragment

createShadowRoot

detached

dispatchEvent

enteredView

focus

getAnimationPlayers

getAttribute

getAttributeNS

getBoundingClientRect

getClientRects

getComputedStyle

getDestinationInsertionPoints

getElementsByClassName

getNamespacedAttributes

hasChildNodes

insertAdjacentElement

insertAdjacentHtml

insertAdjacentText

insertAllBefore

insertBefore

leftView

matches

matchesWithAncestors

offsetTo

query

queryAll

querySelector

querySelectorAll

remove

removeEventListener

replaceWith

requestFullscreen

requestPointerLock

scrollIntoView

setAttribute

setAttributeNS

setInnerHtml

toString

        ElementStream<PopStateEvent>
        onPopState

            read-only

Stream of popstate events handled by this BodyElement.

                  polymer_app_layout_template 0.1.0 api docs

                •

                •

                  cc license

redpajama_set_name: RedPajamaGithub


text:
	local suite = test.declare("vs2010_filters")
	local vc2010 = premake.vstudio.vc2010

--
-- Setup/teardown
--

	local sln, prj

	function suite.setup()
		_ACTION = "vs2010"
		sln = test.createsolution()
	end

	local function prepare(group)
		prj = test.getproject(sln)
		vc2010.filterGroups(prj)
	end

--
-- Check contents of the different file groups.
--

	function suite.itemGroup_onClInclude()
		files { "hello.h" }
		prepare()
		test.capture [[
<ItemGroup>
	<ClInclude Include="hello.h" />
</ItemGroup>
		]]
	end

	function suite.itemGroup_onResourceSection()
		files { "hello.rc" }
		prepare()
		test.capture [[
<ItemGroup>
	<ResourceCompile Include="hello.rc" />
</ItemGroup>
		]]
	end

	function suite.itemGroup_onNoneSection()
		files { "hello.txt" }
		prepare()
		test.capture [[
<ItemGroup>
	<None Include="hello.txt" />
</ItemGroup>
		]]
	end

	function suite.itemGroup_onMixed()
		files { "hello.c", "hello.h", "hello.rc", "hello.txt" }
		prepare()
		test.capture [[
<ItemGroup>
	<None Include="hello.txt" />
</ItemGroup>
<ItemGroup>
	<ClInclude Include="hello.h" />
</ItemGroup>
<ItemGroup>
	<ClCompile Include="hello.c" />
</ItemGroup>
<ItemGroup>
	<ResourceCompile Include="hello.rc" />
</ItemGroup>
		]]
	end

--
-- Files with a build rule go into a custom build section.
--

	function suite.itemGroup_onBuildRule()
		files { "hello.cg" }
		filter "files:**.cg"
			buildcommands { "cgc $(InputFile)" }
			buildoutputs { "$(InputName).obj" }
		prepare("CustomBuild")
		test.capture [[
<ItemGroup>
	<CustomBuild Include="hello.cg" />
</ItemGroup>
		]]
	end

	function suite.itemGroup_onSingleConfigBuildRule()
		files { "hello.cg" }
		filter { "Release", "files:**.cg" }
			buildcommands { "cgc $(InputFile)" }
			buildoutputs { "$(InputName).obj" }
		prepare("CustomBuild")
		test.capture [[
<ItemGroup>
	<CustomBuild Include="hello.cg" />
</ItemGroup>
		]]
	end

--
-- Files located at the root (in the same folder as the project) do not
-- need a filter identifier.
--

	function suite.noFilter_onRootFiles()
		files { "hello.c", "goodbye.c" }
		prepare()
		test.capture [[
<ItemGroup>
	<ClCompile Include="goodbye.c" />
	<ClCompile Include="hello.c" />
</ItemGroup>
		]]
	end

--
-- Check the filter with a real path.
--

	function suite.filter_onRealPath()
		files { "src/hello.c", "hello.h" }
		prepare()
		test.capture [[
<ItemGroup>
	<ClInclude Include="hello.h" />
</ItemGroup>
<ItemGroup>
	<ClCompile Include="src\hello.c">
		<Filter>src</Filter>
	</ClCompile>
</ItemGroup>
		]]
	end

--
-- Check the filter with a virtual path.
--

	function suite.filter_onVpath()
		files { "src/hello.c", "hello.h" }
		vpaths { ["Source Files"] = "**.c" }
		prepare()
		test.capture [[
<ItemGroup>
	<ClInclude Include="hello.h" />
</ItemGroup>
<ItemGroup>
	<ClCompile Include="src\hello.c">
		<Filter>Source Files</Filter>
	</ClCompile>
</ItemGroup>
		]]
	end

--
-- Check handling of files using custom rules.
--

	function suite.filter_onCustomRule()
		rules "Animation"
		files { "hello.dae" }

		rule "Animation"
		fileExtension ".dae"

		prepare()
		test.capture [[
<ItemGroup>
	<Animation Include="hello.dae" />
</ItemGroup>
		]]
	end


text:
Este guia vai te ensinar como construir, do zero, um aplicativo simples usando Ember.

Nós vamos cobrir estas etapas:

  1. Instalando o Ember.
  2. Criando um novo aplicativo.
  3. Definindo uma rota.
  4. Escrevendo um componente de UI (Interface com usuário).
  5. Construindo seu aplicativo para ser instalado ("deployed") em produção.

## Instalando o Ember

Você pode instalar o Ember com um único comando usando npm, o gerenciador de pacotes do Node.js. Digite o seguinte comando em seu terminal:

```sh
npm install -g ember-cli@2.4
```

Não tem npm? [Aprenda a instalar Node. js e npm aqui](https://docs.npmjs.com/getting-started/installing-node).

## Criando um novo aplicativo

Uma vez instalado Ember através do npm, você terá acesso a um novo comando `ember` em seu terminal. Você pode usar o comando `ember new` para criar um novo aplicativo.

```sh
ember new ember-quickstart
```

Este comando irá criar um novo diretório chamado `ember-quickstart` e configurar um novo aplicativo de Ember dentro dela. De cara, seu aplicativo irá incluir:

* Um servidor para desenvolvimento.
* Compilação de "Template".
* "Minificação" de arquivos JavaScript e CSS.
* Funcionalidades ES2015 através da biblioteca Babel.

Ao fornecer, em um pacote integrado, tudo que você precisa para construir aplicações web prontas para produção, Ember faz com que seja uma moleza começar novos projetos.

Vamos ver se tudo está funcionando corretamente. `cd` para o diretório de aplicativo `ember-quickstart` e iniciar o servidor de desenvolvimento, digitando:

```sh
cd ember-quickstart
ember serve
```

Após alguns segundo, você deverá ver a seguinte saída:

```text
Livereload server on http://localhost:49152
Serving on http://localhost:4200/
```

(Se quiser parar o servidor, digite Ctrl-C a qualquer hora no seu terminal)

Abra [http://localhost:4200/](http://localhost:4200) em seu navegador. Você deve ver uma página que diz "Welcome do Ember" e não muito mais. Parabéns! Você acabou de criar e iniciar seu primeiro aplicativo em Ember.

Alterne para o seu editor e abra `app/templates/application.hbs`. Isto se chama o template do `aplicativo` e está sempre na tela enquanto o usuário tem seu aplicativo carregado.

In your editor, change the text inside the `<h2>` from `Welcome to
Ember` to `PeopleTracker` and save the file. Observe que o Ember detecta a mudança que você acabou de fazer e recarrega automaticamente a página para você em segundo plano. Você verá que "Welcome to Ember" mudou para "PeopleTracker".

## Definindo uma Rota

Vamos construir um aplicativo que mostra uma lista de cientistas. Para isso, o primeiro passo é criar uma rota. Por enquanto, você pode pensar em rotas como sendo diferentes páginas que compõem o seu aplicativo.

Ember vem com *geradores* que automatizam o código padrão para tarefas comuns. Para gerar uma rota, digite o seguinte em seu terminal:

```sh
ember generate route scientists
```

Você verá na saída algo assim:

```text
installing route
  create app/routes/scientists.js
  create app/templates/scientists.hbs
updating router
  add route scientists
installing route-test
  create tests/unit/routes/scientists-test.js
```

Isso é Ember dizendo que criou:

  1. Um template a ser exibido quando o usuário visita `/scientists`.
  2. Um objeto `Route` (Rota) que busca o model usado por esse "template".
  3. Uma inserção no roteador do aplicativo (localizado em `app/router.js`).
  4. Um teste unitário para esta rota.

Abra o template recém-criado em `app/templates/scientists.hbs` e adicione o seguinte HTML:

```app/templates/scientists.hbs

## Lista de Cientistas

    <br />No seu navegador, abra
    [http://localhost:4200/scientists](http://localhost:4200/scientists). You should
    see the `<h2>` you put in the `scientists.hbs` template, right below the
    `<h2>` from our `application.hbs` template.

    Agora que temos o "template" `scientists` sendo apresentado, vamos dar a ele alguns dados para mostrar. Para isso, especificamos um _model_ (modelo) para aquela rota, editando `app/routes/scientists.js`.

    Vamos pegar o código criado pelo gerador e adicionar um método `model()` à `Route` (Rota):

     ```app/routes/scientists.js{+4,+5,+6}
    import Ember from 'ember';

    export default Ember.Route.extend({
      model() {
        return ['Marie Curie', 'Mae Jemison', 'Albert Hofmann'];
      }
    });

(Este código exemplifica usos das funcionalidades mais recentes em JavaScript, algumas que talvez não lhe sejam muito familiares. Saiba mais com este [resumo das funcionalidades mais novas do JavaScript](https://ponyfoo.com/articles/es6).)

No método `model()` de uma rota, você deve retornar qualquer dado que queira tornar disponível para a "template". Se precisar buscar dados assíncronamente, o método `model()` suporta qualquer biblioteca que use [Promessas ("Promises") JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).

Agora vamos dizer para o Ember como transformar aquele vetor ("array") de strings em HTML. Abra o "template" `scientists` e adicione um código Handlebars que itere o vetor e o imprima:

```app/templates/scientists.hbs{+3,+4,+5,+6,+7}

## Lista de Cientistas

{#each model as |scientist|}

* {{scientist}} {{/each}}

    <br />Here, we use the `each` helper to loop over each item in the array we
    provided from the `model()` hook and print it inside an `<li>` element.

    ## Create a UI Component

    As your application grows and you notice you are sharing UI elements
    between multiple pages (or using them multiple times on the same page),
    Ember makes it easy to refactor your templates into reusable components.

    Let's create a `people-list` component that we can use
    in multiple places to show a list of people.

    As usual, there's a generator that makes this easy for us. Make a new
    component by typing:

    ```sh
    ember generate component people-list

Copy and paste the `scientists` template into the `people-list` component's template and edit it to look as follows:

```app/templates/components/people-list.hbs

## {{title}}

{{#each people as |person|}}

* {{person}} {{/each}}

    <br />Note that we've changed the title from a hard-coded string ("List of
    Scientists") to a dynamic property (`{{title}}`). We've also renamed
    `scientist` to the more-generic `person`, decreasing the coupling of our
    component to where it's used.

    Save this template and switch back to the `scientists` template. Replace all
    our old code with our new componentized version. Components look like
    HTML tags but instead of using angle brackets (`<tag>`) they use double
    curly braces (`{{component}}`). We're going to tell our component:

    1. What title to use, via the `title` attribute.
    2. What array of people to use, via the `people` attribute. We'll
       provide this route's `model` as the list of people.

    ```app/templates/scientists.hbs{-1,-2,-3,-4,-5,-6,-7,+8}

List of Scientists

      {{#each model as |scientist|}}

{{scientist}}

      {{/each}}

    {{people-list title="List of Scientists" people=model}}

Go back to your browser and you should see that the UI looks identical. The only difference is that now we've componentized our list into a version that's more reusable and more maintainable.

You can see this in action if you create a new route that shows a different list of people. As an exercise for the reader, you may try to create a `programmers` route that shows a list of famous programmers. By re-using the `people-list` component, you can do it in almost no code at all.

## Building For Production

Now that we've written our application and verified that it works in development, it's time to get it ready to deploy to our users. To do so, run the following command:

```sh
ember build --env production
```

O comando `build` empacota todos seus TDK(assets) que compõem o seu aplicativo—JavaScript, templates, CSS, web fonts, imagens, e mais.

In this case, we told Ember to build for the production environment via the `--env` flag. This creates an optimized bundle that's ready to upload to your web host. Once the build finishes, you'll find all of the concatenated and minified assets in your application's `dist/` directory.

The Ember community values collaboration and building common tools that everyone relies on. If you're interested in deploying your app to production in a fast and reliable way, check out the [Ember CLI Deploy](http://ember-cli.github.io/ember-cli-deploy/) addon.


text:
class Bool : public Number<bool>
{
  public:
    bool cast(const char *s) const
    {
        return (val != "false") || std::strtol(data(), NULL, 0);
    }
};

#endif


text:
namespace mojo {

template <>
struct EnumTraits<media::mojom::CdmKeyStatus,
                  media::CdmKeyInformation::KeyStatus> {
  static media::mojom::CdmKeyStatus ToMojom(
      media::CdmKeyInformation::KeyStatus key_status);

  static bool FromMojom(media::mojom::CdmKeyStatus input,
                        media::CdmKeyInformation::KeyStatus* out);
};

template <>
struct StructTraits<media::mojom::CdmKeyInformationDataView,
                    std::unique_ptr<media::CdmKeyInformation>> {
  static const std::vector<uint8_t>& key_id(
      const std::unique_ptr<media::CdmKeyInformation>& input) {
    return input->key_id;
  }

  static media::CdmKeyInformation::KeyStatus status(
      const std::unique_ptr<media::CdmKeyInformation>& input) {
    return input->status;
  }

  static uint32_t system_code(
      const std::unique_ptr<media::CdmKeyInformation>& input) {
    return input->system_code;
  }

  static bool Read(media::mojom::CdmKeyInformationDataView input,
                   std::unique_ptr<media::CdmKeyInformation>* output);
};

}  // namespace mojo

#endif  // MEDIA_MOJO_MOJOM_CDM_KEY_INFORMATION_MOJOM_TRAITS_H_


text:
package named

import (
	"testing"

	"github.com/golib/assert"
)

func Test_Basename(t *testing.T) {
	it := assert.New(t)

	testCases := []struct {
		in       string
		expected string
	}{
		{"", ""},
		{"filename", "filename"},
		{"filename.ext", "filename"},
		{"file.name.ext", "file.name"},
		{"/path/to/filename", "filename"},
		{"/path/to/filename.ext", "filename"},
		{"/path/to/file.name.ext", "file.name"},
		{"/path/to.ext/filename.ext", "filename"},
		{"/path/to.ext/file.name.ext", "file.name"},
	}
	for i, testCase := range testCases {
		it.Equal(testCase.expected, Basename(testCase.in), "Case(#%d)", i)
	}
}


text:
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var error_1 = require("./error");
/** Regular expression used to parse a Dsn. */
var DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/;
/** Error message */
var ERROR_MESSAGE = 'Invalid Dsn';
/** The Sentry Dsn, identifying a Sentry instance and project. */
var Dsn = /** @class */ (function () {
    /** Creates a new Dsn component */
    function Dsn(from) {
        if (typeof from === 'string') {
            this._fromString(from);
        }
        else {
            this._fromComponents(from);
        }
        this._validate();
    }
    /**
     * Renders the string representation of this Dsn.
     *
     * By default, this will render the public representation without the password
     * component. To get the deprecated private representation, set `withPassword`
     * to true.
     *
     * @param withPassword When set to true, the password will be included.
     */
    Dsn.prototype.toString = function (withPassword) {
        if (withPassword === void 0) { withPassword = false; }
        var _a = this, host = _a.host, path = _a.path, pass = _a.pass, port = _a.port, projectId = _a.projectId, protocol = _a.protocol, user = _a.user;
        return (protocol + "://" + user + (withPassword && pass ? ":" + pass : '') +
            ("@" + host + (port ? ":" + port : '') + "/" + (path ? path + "/" : path) + projectId));
    };
    /** Parses a string into this Dsn. */
    Dsn.prototype._fromString = function (str) {
        var match = DSN_REGEX.exec(str);
        if (!match) {
            throw new error_1.SentryError(ERROR_MESSAGE);
        }
        var _a = tslib_1.__read(match.slice(1), 6), protocol = _a[0], user = _a[1], _b = _a[2], pass = _b === void 0 ? '' : _b, host = _a[3], _c = _a[4], port = _c === void 0 ? '' : _c, lastPath = _a[5];
        var path = '';
        var projectId = lastPath;
        var split = projectId.split('/');
        if (split.length > 1) {
            path = split.slice(0, -1).join('/');
            projectId = split.pop();
        }
        if (projectId) {
            var projectMatch = projectId.match(/^\d+/);
            if (projectMatch) {
                projectId = projectMatch[0];
            }
        }
        this._fromComponents({ host: host, pass: pass, path: path, projectId: projectId, port: port, protocol: protocol, user: user });
    };
    /** Maps Dsn components into this instance. */
    Dsn.prototype._fromComponents = function (components) {
        this.protocol = components.protocol;
        this.user = components.user;
        this.pass = components.pass || '';
        this.host = components.host;
        this.port = components.port || '';
        this.path = components.path || '';
        this.projectId = components.projectId;
    };
    /** Validates this Dsn and throws on error. */
    Dsn.prototype._validate = function () {
        var _this = this;
        ['protocol', 'user', 'host', 'projectId'].forEach(function (component) {
            if (!_this[component]) {
                throw new error_1.SentryError(ERROR_MESSAGE + ": " + component + " missing");
            }
        });
        if (!this.projectId.match(/^\d+$/)) {
            throw new error_1.SentryError(ERROR_MESSAGE + ": Invalid projectId " + this.projectId);
        }
        if (this.protocol !== 'http' && this.protocol !== 'https') {
            throw new error_1.SentryError(ERROR_MESSAGE + ": Invalid protocol " + this.protocol);
        }
        if (this.port && isNaN(parseInt(this.port, 10))) {
            throw new error_1.SentryError(ERROR_MESSAGE + ": Invalid port " + this.port);
        }
    };
    return Dsn;
}());
exports.Dsn = Dsn;
//# sourceMappingURL=dsn.js.map


text:
'use strict';

const pkg = require('../package.json');

module.exports = {
  NAME: pkg.name,
  VERSION: pkg.version
};


text:
require 'spec_helper'

describe "Default User" do
  it "should be return unlocked by default" do
    a = User.create(name: "Default User")
    expect(a.is_locked?).to eq(false)
  end
end

describe "Locked User" do
  it "should be return locked" do
    a = User.create(name: "Locked User")
    a.lock
    expect(a.reload.is_locked?).to eq(true)
  end
end

describe "Unlocked User" do
  it "should be return unlocked" do
    a = User.create(name: "Unlocked User")
    a.lock
    a.unlock
    expect(a.reload.is_locked?).to eq(false)
  end
end

describe "To Be Modified Locked User" do
  it "should be return unlocked" do
    a = User.create(name: "Locked User")
    a.lock
    a.reload
    a.name = "To Be Modified Locked User"
    expect(a.save).to eq(false)
  end
end

describe "Locked User ID" do
  it "should be same as locked id" do
    a = User.create(name: "Locked User")
    a.lock
    a.reload
    expect(a.locker.locked_id).to eq(a.id)
  end
end

describe "Locked User Model" do
  it "should be same as locked type" do
    a = User.create(name: "Locked User")
    a.lock
    a.reload
    expect(a.locker.locked_type).to eq("User")
  end
end

describe "Locked User Model" do
  it "should be same as locked type" do
    a = User.create(name: "Locked User")
    a.lock
    id = a.locker.id
    a.lock
    expect(id).to eq(a.locker.id)
  end
end


text:
Novo no Material UI? Get up to speed quickly with our curated list of learning resources.

## Your first component

The following code snippet demonstrates a basic Material UI app that features a `<Button>` component:

```jsx
import * as React from 'react';
import Button from '@mui/material/Button';

function App() {
  return <Button variant="contained">Hello World</Button>;
}
```

In the interactive demo below, try changing the code and see how it affects the output. (Hint: change `variant` to `"outlined"` and `color` to `"secondary"`. For more options, see the [`Button` component page](/material-ui/react-button/).)

{{"demo": "../usage/Usage.js", "hideToolbar": true, "bg": true}}

## Projetos de exemplo

Visit the [example projects](/material-ui/getting-started/example-projects/) page to see how we recommend implementing Material UI with various React libraries and frameworks like Next.js, Gatsby, Create React App, and more.

## Modelos

Check out our [selection of basic templates](/material-ui/getting-started/templates/) to get started building your next app more quickly.

## Recursos recomendados

Beyond our official documentation, there are countless members of our community who create fantastic tutorials and guides for working with Material UI.

The following is a curated list of some of the best third-party resources we've found for learning how to build beautiful apps with our components.

### Grátis

- [**Material UI v5 Crash Course**](https://www.youtube.com/watch?v=o1chMISeTC0) video by Laith Harb: everything you need to know to start building with the latest version of Material UI.

- [**React + Material UI - From Zero to Hero**](https://www.youtube.com/playlist?list=PLDxCaNaYIuUlG5ZqoQzFE27CUOoQvOqnQ) video series by The Atypical Developer: build along with this in-depth series, from basic installation through advanced component implementation.

- [**Next.js 11 Setup with Material UI v5**](https://www.youtube.com/watch?v=IFaFFmPYyMI) by Leo Roese: learn how to integrate Material UI into your Next.js app, using Emotion as the style engine.

- [**Material UI v5 Crash Course + Intro to React (2022 Edition)**](https://www.youtube.com/watch?v=_W3uuxDnySQ) by Anthony Sistilli: how and why to use Material UI, plus guidance on theming and style customization.

- [**Material UI v5 Tutorial Playlist**](https://www.youtube.com/playlist?list=PLlR2O33QQkfXnZMMZC0y22gLayBbB1UQd) by Nikhil Thadani (Indian Coders): a detailed playlist covering almost every component of Material UI with Create React App.

- [**The Clever Dev**](https://www.youtube.com/channel/UCb6AZy0_D1y661PMZck3jOw) and [**The Smart Devpreneur**](https://smartdevpreneur.com/category/javascript/material-ui/) by Jon M: dozens of high-quality videos and articles digging deep into the nuts and bolts of Material UI.


text:
ace.define("ace/snippets/velocity.snippets",["require","exports","module"], function(require, exports, module){module.exports = "# macro\nsnippet #macro\n\t#macro ( ${1:macroName} ${2:\\$var1, [\\$var2, ...]} )\n\t\t${3:## macro code}\n\t#end\n# foreach\nsnippet #foreach\n\t#foreach ( ${1:\\$item} in ${2:\\$collection} )\n\t\t${3:## foreach code}\n\t#end\n# if\nsnippet #if\n\t#if ( ${1:true} )\n\t\t${0}\n\t#end\n# if ... else\nsnippet #ife\n\t#if ( ${1:true} )\n\t\t${2}\n\t#else\n\t\t${0}\n\t#end\n#import\nsnippet #import\n\t#import ( \"${1:path/to/velocity/format}\" )\n# set\nsnippet #set\n\t#set ( $${1:var} = ${0} )\n";

});

ace.define("ace/snippets/velocity",["require","exports","module","ace/snippets/velocity.snippets"], function(require, exports, module){"use strict";
exports.snippetText = require("./velocity.snippets");
exports.scope = "velocity";
exports.includeScopes = ["html", "javascript", "css"];

});                (function() {
                    ace.require(["ace/snippets/velocity"], function(m) {
                        if (typeof module == "object" && typeof exports == "object" && module) {
                            module.exports = m;
                        }
                    });
                })();


text:
package de.lessvoid.nifty.loaderv2.types;

import java.io.IOException;
import java.util.logging.Logger;

import de.lessvoid.nifty.Nifty;
import de.lessvoid.nifty.tools.StringHelper;

public class RegisterMouseCursorType extends XmlBaseType {
  public String output(final int offset) {
    return StringHelper.whitespace(offset) + "<registerMouseCursor> " + super.output(offset);
  }

  public void materialize(final Nifty nifty, final Logger log) {
    try {
      nifty.getNiftyMouse().registerMouseCursor(getId(), getFilename(), getHotspotX(), getHotspotY());
      log.fine("Registering mouseCursor with id [" + getId() + "]");
    } catch (IOException e) {
      log.warning("Error registering mouse cursor: " + e.getMessage());
    }
  }

  private String getId() {
    return getAttributes().get("id");
  }

  private String getFilename() {
    return getAttributes().get("filename");
  }

  private int getHotspotX() {
    return getAttributes().getAsInteger("hotspotX", 0);
  }

  private int getHotspotY() {
    return getAttributes().getAsInteger("hotspotY", 0);
  }
}


text:
namespace LvEdEngine
{

    class Model3dBuilder;
    //--------------------------------------------------
    class XmlModelFactory : public ResourceFactory
    {
    public:
        XmlModelFactory(ID3D11Device* device);
        virtual bool LoadResource(Resource* resource, const WCHAR * filename);
        virtual void ProcessXml(xml_node * root, Model3dBuilder * builder) = 0;
    protected:
        ID3D11Device* m_device;
        void ParseError(const char * fmt, ...);
        int m_parseErrors;
    };
};


text:
#pragma once
#include <aws/waf/WAF_EXPORTS.h>
#include <aws/waf/model/FieldToMatch.h>
#include <aws/waf/model/TextTransformation.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace WAF
{
namespace Model
{

  /**
   *
This is AWS WAF Classic documentation. For more information,
   * see AWS
   * WAF Classic in the developer guide.

 For the latest version of AWS
   * WAF, use the AWS WAFV2 API and see the AWS
   * WAF Developer Guide. With the latest version, AWS WAF has a single set of
   * endpoints for regional and global use.

Specifies the part of a
   * web request that you want AWS WAF to inspect for cross-site scripting attacks
   * and, if you want AWS WAF to inspect a header, the name of the
   * header.

See Also:
   AWS
   * API Reference

   */
  class AWS_WAF_API XssMatchTuple
  {
  public:
    XssMatchTuple();
    XssMatchTuple(Aws::Utils::Json::JsonView jsonValue);
    XssMatchTuple& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
Specifies where in a web request to look for cross-site scripting
     * attacks.

     */
    inline const FieldToMatch& GetFieldToMatch() const{ return m_fieldToMatch; }

    /**
     *
Specifies where in a web request to look for cross-site scripting
     * attacks.

     */
    inline bool FieldToMatchHasBeenSet() const { return m_fieldToMatchHasBeenSet; }

    /**
     *
Specifies where in a web request to look for cross-site scripting
     * attacks.

     */
    inline void SetFieldToMatch(const FieldToMatch& value) { m_fieldToMatchHasBeenSet = true; m_fieldToMatch = value; }

    /**
     *
Specifies where in a web request to look for cross-site scripting
     * attacks.

     */
    inline void SetFieldToMatch(FieldToMatch&& value) { m_fieldToMatchHasBeenSet = true; m_fieldToMatch = std::move(value); }

    /**
     *
Specifies where in a web request to look for cross-site scripting
     * attacks.

     */
    inline XssMatchTuple& WithFieldToMatch(const FieldToMatch& value) { SetFieldToMatch(value); return *this;}

    /**
     *
Specifies where in a web request to look for cross-site scripting
     * attacks.

     */
    inline XssMatchTuple& WithFieldToMatch(FieldToMatch&& value) { SetFieldToMatch(std::move(value)); return *this;}

    /**
     *
Text transformations eliminate some of the unusual formatting that attackers
     * use in web requests in an effort to bypass AWS WAF. If you specify a
     * transformation, AWS WAF performs the transformation on FieldToMatch
     * before inspecting it for a match.

You can only specify a single type of
     * TextTransformation.

 CMD_LINE

When you're concerned that
     * attackers are injecting an operating system command line command and using
     * unusual formatting to disguise some or all of the command, use this option to
     * perform the following transformations:

Delete the following
     * characters: \ " ' ^

Delete spaces before the following
     * characters: / (

Replace the following characters with a space:
     * , ;

Replace multiple spaces with one space

     *
Convert uppercase letters (A-Z) to lowercase (a-z)

     * COMPRESS_WHITE_SPACE

Use this option to replace the following
     * characters with a space character (decimal 32):

\f, formfeed,
     * decimal 12

\t, tab, decimal 9

\n, newline,
     * decimal 10

\r, carriage return, decimal 13

     *
\v, vertical tab, decimal 11

non-breaking space, decimal
     * 160

 COMPRESS_WHITE_SPACE also replaces multiple
     * spaces with one space.

 HTML_ENTITY_DECODE

Use this option
     * to replace HTML-encoded characters with unencoded characters.
     * HTML_ENTITY_DECODE performs the following operations:

     *
Replaces (ampersand)quot; with "

     *
Replaces (ampersand)nbsp; with a non-breaking space, decimal
     * 160

Replaces (ampersand)lt; with a "less than"
     * symbol

Replaces (ampersand)gt; with
     * >

Replaces characters that are represented in
     * hexadecimal format, (ampersand)#xhhhh;, with the corresponding
     * characters

Replaces characters that are represented in decimal
     * format, (ampersand)#nnnn;, with the corresponding characters

     *

 LOWERCASE

Use this option to convert uppercase
     * letters (A-Z) to lowercase (a-z).

 URL_DECODE

Use this
     * option to decode a URL-encoded value.

 NONE

Specify
     * NONE if you don't want to perform any text transformations.

     */
    inline const TextTransformation& GetTextTransformation() const{ return m_textTransformation; }

    /**
     *
Text transformations eliminate some of the unusual formatting that attackers
     * use in web requests in an effort to bypass AWS WAF. If you specify a
     * transformation, AWS WAF performs the transformation on FieldToMatch
     * before inspecting it for a match.

You can only specify a single type of
     * TextTransformation.

 CMD_LINE

When you're concerned that
     * attackers are injecting an operating system command line command and using
     * unusual formatting to disguise some or all of the command, use this option to
     * perform the following transformations:

Delete the following
     * characters: \ " ' ^

Delete spaces before the following
     * characters: / (

Replace the following characters with a space:
     * , ;

Replace multiple spaces with one space

     *
Convert uppercase letters (A-Z) to lowercase (a-z)

     * COMPRESS_WHITE_SPACE

Use this option to replace the following
     * characters with a space character (decimal 32):

\f, formfeed,
     * decimal 12

\t, tab, decimal 9

\n, newline,
     * decimal 10

\r, carriage return, decimal 13

     *
\v, vertical tab, decimal 11

non-breaking space, decimal
     * 160

 COMPRESS_WHITE_SPACE also replaces multiple
     * spaces with one space.

 HTML_ENTITY_DECODE

Use this option
     * to replace HTML-encoded characters with unencoded characters.
     * HTML_ENTITY_DECODE performs the following operations:

     *
Replaces (ampersand)quot; with "

     *
Replaces (ampersand)nbsp; with a non-breaking space, decimal
     * 160

Replaces (ampersand)lt; with a "less than"
     * symbol

Replaces (ampersand)gt; with
     * >

Replaces characters that are represented in
     * hexadecimal format, (ampersand)#xhhhh;, with the corresponding
     * characters

Replaces characters that are represented in decimal
     * format, (ampersand)#nnnn;, with the corresponding characters

     *

 LOWERCASE

Use this option to convert uppercase
     * letters (A-Z) to lowercase (a-z).

 URL_DECODE

Use this
     * option to decode a URL-encoded value.

 NONE

Specify
     * NONE if you don't want to perform any text transformations.

     */
    inline bool TextTransformationHasBeenSet() const { return m_textTransformationHasBeenSet; }

    /**
     *
Text transformations eliminate some of the unusual formatting that attackers
     * use in web requests in an effort to bypass AWS WAF. If you specify a
     * transformation, AWS WAF performs the transformation on FieldToMatch
     * before inspecting it for a match.

You can only specify a single type of
     * TextTransformation.

 CMD_LINE

When you're concerned that
     * attackers are injecting an operating system command line command and using
     * unusual formatting to disguise some or all of the command, use this option to
     * perform the following transformations:

Delete the following
     * characters: \ " ' ^

Delete spaces before the following
     * characters: / (

Replace the following characters with a space:
     * , ;

Replace multiple spaces with one space

     *
Convert uppercase letters (A-Z) to lowercase (a-z)

     * COMPRESS_WHITE_SPACE

Use this option to replace the following
     * characters with a space character (decimal 32):

\f, formfeed,
     * decimal 12

\t, tab, decimal 9

\n, newline,
     * decimal 10

\r, carriage return, decimal 13

     *
\v, vertical tab, decimal 11

non-breaking space, decimal
     * 160

 COMPRESS_WHITE_SPACE also replaces multiple
     * spaces with one space.

 HTML_ENTITY_DECODE

Use this option
     * to replace HTML-encoded characters with unencoded characters.
     * HTML_ENTITY_DECODE performs the following operations:

     *
Replaces (ampersand)quot; with "

     *
Replaces (ampersand)nbsp; with a non-breaking space, decimal
     * 160

Replaces (ampersand)lt; with a "less than"
     * symbol

Replaces (ampersand)gt; with
     * >

Replaces characters that are represented in
     * hexadecimal format, (ampersand)#xhhhh;, with the corresponding
     * characters

Replaces characters that are represented in decimal
     * format, (ampersand)#nnnn;, with the corresponding characters

     *

 LOWERCASE

Use this option to convert uppercase
     * letters (A-Z) to lowercase (a-z).

 URL_DECODE

Use this
     * option to decode a URL-encoded value.

 NONE

Specify
     * NONE if you don't want to perform any text transformations.

     */
    inline void SetTextTransformation(const TextTransformation& value) { m_textTransformationHasBeenSet = true; m_textTransformation = value; }

    /**
     *
Text transformations eliminate some of the unusual formatting that attackers
     * use in web requests in an effort to bypass AWS WAF. If you specify a
     * transformation, AWS WAF performs the transformation on FieldToMatch
     * before inspecting it for a match.

You can only specify a single type of
     * TextTransformation.

 CMD_LINE

When you're concerned that
     * attackers are injecting an operating system command line command and using
     * unusual formatting to disguise some or all of the command, use this option to
     * perform the following transformations:

Delete the following
     * characters: \ " ' ^

Delete spaces before the following
     * characters: / (

Replace the following characters with a space:
     * , ;

Replace multiple spaces with one space

     *
Convert uppercase letters (A-Z) to lowercase (a-z)

     * COMPRESS_WHITE_SPACE

Use this option to replace the following
     * characters with a space character (decimal 32):

\f, formfeed,
     * decimal 12

\t, tab, decimal 9

\n, newline,
     * decimal 10

\r, carriage return, decimal 13

     *
\v, vertical tab, decimal 11

non-breaking space, decimal
     * 160

 COMPRESS_WHITE_SPACE also replaces multiple
     * spaces with one space.

 HTML_ENTITY_DECODE

Use this option
     * to replace HTML-encoded characters with unencoded characters.
     * HTML_ENTITY_DECODE performs the following operations:

     *
Replaces (ampersand)quot; with "

     *
Replaces (ampersand)nbsp; with a non-breaking space, decimal
     * 160

Replaces (ampersand)lt; with a "less than"
     * symbol

Replaces (ampersand)gt; with
     * >

Replaces characters that are represented in
     * hexadecimal format, (ampersand)#xhhhh;, with the corresponding
     * characters

Replaces characters that are represented in decimal
     * format, (ampersand)#nnnn;, with the corresponding characters

     *

 LOWERCASE

Use this option to convert uppercase
     * letters (A-Z) to lowercase (a-z).

 URL_DECODE

Use this
     * option to decode a URL-encoded value.

 NONE

Specify
     * NONE if you don't want to perform any text transformations.

     */
    inline void SetTextTransformation(TextTransformation&& value) { m_textTransformationHasBeenSet = true; m_textTransformation = std::move(value); }

    /**
     *
Text transformations eliminate some of the unusual formatting that attackers
     * use in web requests in an effort to bypass AWS WAF. If you specify a
     * transformation, AWS WAF performs the transformation on FieldToMatch
     * before inspecting it for a match.

You can only specify a single type of
     * TextTransformation.

 CMD_LINE

When you're concerned that
     * attackers are injecting an operating system command line command and using
     * unusual formatting to disguise some or all of the command, use this option to
     * perform the following transformations:

Delete the following
     * characters: \ " ' ^

Delete spaces before the following
     * characters: / (

Replace the following characters with a space:
     * , ;

Replace multiple spaces with one space

     *
Convert uppercase letters (A-Z) to lowercase (a-z)

     * COMPRESS_WHITE_SPACE

Use this option to replace the following
     * characters with a space character (decimal 32):

\f, formfeed,
     * decimal 12

\t, tab, decimal 9

\n, newline,
     * decimal 10

\r, carriage return, decimal 13

     *
\v, vertical tab, decimal 11

non-breaking space, decimal
     * 160

 COMPRESS_WHITE_SPACE also replaces multiple
     * spaces with one space.

 HTML_ENTITY_DECODE

Use this option
     * to replace HTML-encoded characters with unencoded characters.
     * HTML_ENTITY_DECODE performs the following operations:

     *
Replaces (ampersand)quot; with "

     *
Replaces (ampersand)nbsp; with a non-breaking space, decimal
     * 160

Replaces (ampersand)lt; with a "less than"
     * symbol

Replaces (ampersand)gt; with
     * >

Replaces characters that are represented in
     * hexadecimal format, (ampersand)#xhhhh;, with the corresponding
     * characters

Replaces characters that are represented in decimal
     * format, (ampersand)#nnnn;, with the corresponding characters

     *

 LOWERCASE

Use this option to convert uppercase
     * letters (A-Z) to lowercase (a-z).

 URL_DECODE

Use this
     * option to decode a URL-encoded value.

 NONE

Specify
     * NONE if you don't want to perform any text transformations.

     */
    inline XssMatchTuple& WithTextTransformation(const TextTransformation& value) { SetTextTransformation(value); return *this;}

    /**
     *
Text transformations eliminate some of the unusual formatting that attackers
     * use in web requests in an effort to bypass AWS WAF. If you specify a
     * transformation, AWS WAF performs the transformation on FieldToMatch
     * before inspecting it for a match.

You can only specify a single type of
     * TextTransformation.

 CMD_LINE

When you're concerned that
     * attackers are injecting an operating system command line command and using
     * unusual formatting to disguise some or all of the command, use this option to
     * perform the following transformations:

Delete the following
     * characters: \ " ' ^

Delete spaces before the following
     * characters: / (

Replace the following characters with a space:
     * , ;

Replace multiple spaces with one space

     *
Convert uppercase letters (A-Z) to lowercase (a-z)

     * COMPRESS_WHITE_SPACE

Use this option to replace the following
     * characters with a space character (decimal 32):

\f, formfeed,
     * decimal 12

\t, tab, decimal 9

\n, newline,
     * decimal 10

\r, carriage return, decimal 13

     *
\v, vertical tab, decimal 11

non-breaking space, decimal
     * 160

 COMPRESS_WHITE_SPACE also replaces multiple
     * spaces with one space.

 HTML_ENTITY_DECODE

Use this option
     * to replace HTML-encoded characters with unencoded characters.
     * HTML_ENTITY_DECODE performs the following operations:

     *
Replaces (ampersand)quot; with "

     *
Replaces (ampersand)nbsp; with a non-breaking space, decimal
     * 160

Replaces (ampersand)lt; with a "less than"
     * symbol

Replaces (ampersand)gt; with
     * >

Replaces characters that are represented in
     * hexadecimal format, (ampersand)#xhhhh;, with the corresponding
     * characters

Replaces characters that are represented in decimal
     * format, (ampersand)#nnnn;, with the corresponding characters

     *

 LOWERCASE

Use this option to convert uppercase
     * letters (A-Z) to lowercase (a-z).

 URL_DECODE

Use this
     * option to decode a URL-encoded value.

 NONE

Specify
     * NONE if you don't want to perform any text transformations.

     */
    inline XssMatchTuple& WithTextTransformation(TextTransformation&& value) { SetTextTransformation(std::move(value)); return *this;}

  private:

    FieldToMatch m_fieldToMatch;
    bool m_fieldToMatchHasBeenSet = false;

    TextTransformation m_textTransformation;
    bool m_textTransformationHasBeenSet = false;
  };

} // namespace Model
} // namespace WAF
} // namespace Aws


text:
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;

namespace ScoreBoard
{
    public class DateConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            DateTime date = (DateTime)value;
            if (date.Equals(DateTime.Today))
            {
                return "Today";
            }
            return date.Day.ToString().PadLeft(2, '0') + @"/" + date.Month.ToString().PadLeft(2, '0') + "-" + date.Year;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

}


text:
package br.com.arbo.steamside.api.kids;

import br.com.arbo.opersys.username.Username;
import br.com.arbo.steamside.kids.Kid;
import br.com.arbo.steamside.kids.KidImpl;
import br.com.arbo.steamside.kids.KidName;
import br.com.arbo.steamside.types.CollectionName;

public class KidDTO
{

	public static KidDTO valueOf(Kid kid)
	{
		KidDTO dto = new KidDTO();
		dto.name = kid.getName().name;
		dto.user = kid.getUser().username();
		dto.inventory = kid.getCollection().value;
		dto.id = dto.name;
		return dto;
	}

	public Kid toKid()
	{
		return new KidImpl(
			new KidName(name),
			new Username(user),
			requireInventory());
	}

	private CollectionName requireInventory()
	{
		try
		{
			return new CollectionName(inventory);
		}
		catch (NullPointerException ex)
		{
			throw new RuntimeException(
				"Please select the games your kid can play");
		}
	}

	public String id;
	public String name;
	public String user;
	public String inventory;

}


text:
<link rel="import" href="./../styles/shared-styles.html">
<link rel="import" href="./../web-socket/web-socket.html">
<link rel="import" href="./../error-page/error-page.html">

<dom-module id="job-log">
  <template>

    <web-socket
      id="buildWebSocket"
      url="ws://localhost:8082"
      message="getJobInfo"
      on-response="getData"
      on-error="getError"
      on-closed="getError"
      on-send="startLoadData"></web-socket>

    <error-page hidden="{{!errorText}}">{{errorText}}</error-page>

    <array-selector id="headerSelector" items="{{textHeaders}}" selected="{{selectedHeaders}}" multi></array-selector>
    <array-selector id="subHeaderSelector" items="{{textSubHeaders}}" selected="{{selectedSubHeaders}}" multi></array-selector>
    <array-selector id="textSelector" items="{{textConsole}}" selected="{{selectedText}}" multi></array-selector>

      <template id="globalTemplate" is="dom-repeat" items="{{selectedHeaders}}" as="headerRoot">
          <paper-material class="card" elevation="1">

[[headerRoot.header]]

            <template id="subHeaderTemplate" is="dom-repeat" items="{{selectedSubHeaders}}" as="subheaderRoot">
              <template is="dom-if" if="{{getSubHeader(subheaderRoot, headerRoot)}}">

[[subheaderRoot.subheader]]

                <iron-collapse id="collapse" tabindex="0">

                    <template is="dom-repeat" items="[[selectedText]]" as="textRoot">
                      <template is="dom-if" if="{{getText(textRoot, subheaderRoot, headerRoot)}}">

[[getNumber()]]

[[textRoot.text]]

                      </template>
                    </template>

                </iron-collapse>
              </template>
            </template>

          </paper-material>
      </template>

    </template>

  </template>

</dom-module>


text:
package br.gov.servicos.importador;

import br.gov.servicos.cms.Conteudo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.springframework.core.io.Resource;

import java.io.File;
import java.io.FilenameFilter;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyObject;
import static org.mockito.Mockito.mock;

@RunWith(MockitoJUnitRunner.class)
public class ImportadorParaConteudoDePaginasTest {

    @Mock
    ConteudoParser parser;

    @Mock
    RepositorioCartasServico cartasServico;

    @Test
    public void deveConverterPaginasEmConteudos() throws Exception {
        Resource dir = mock(Resource.class);
        given(cartasServico.get("conteudo/paginas-especiais")).willReturn(dir);
        File dirF = mock(File.class);
        given(dir.getFile()).willReturn(dirF);
        given(dirF.listFiles(any(FilenameFilter.class))).willReturn(new File[]{new File("acessibilidade.md"), new File("mapa-do-site.md")});

        given(parser.conteudoHtml(anyObject())).willReturn("
Acessibilidade

Parágrafo um.

Parágrafo dois.
");
        given(parser.titulo(anyObject())).willReturn("Acessibilidade");
        given(parser.conteudo(anyObject())).willReturn("Parágrafo um. Parágrafo dois.");

        Conteudo c = new ImportadorParaConteudoDePaginas(parser).importar(cartasServico).findFirst().get();

        assertThat(c.getId(), is("acessibilidade"));
        assertThat(c.getTipoConteudo(), is("conteudo"));
        assertThat(c.getNome(), is("Acessibilidade"));
        assertThat(c.getConteudo(), is("Parágrafo um. Parágrafo dois."));
        assertThat(c.getHtml(), is("
Acessibilidade

Parágrafo um.

Parágrafo dois.
"));
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:layout_height="match_parent"
	android:layout_width="match_parent">

	<LinearLayout
		android:id="@+id/blur"
		android:layout_width="match_parent"
		android:layout_height="match_parent"
		android:background="#000000"
		android:alpha="0.5"
		android:elevation="1dp"
		android:visibility="gone"/>

	<ImageButton
		android:layout_height="56dp"
		android:layout_width="56dp"
		android:src="@drawable/delete"
		android:background="@drawable/networkqa"
		android:layout_alignParentBottom="true"
		android:layout_centerHorizontal="true"
		android:layout_marginBottom="30dp"
		android:elevation="2dp"
		android:id="@+id/uninstall"/>

	<TableLayout
		android:id="@+id/theLayout"
		android:layout_height="match_parent"
		android:layout_width="match_parent"
		android:orientation="vertical"/>

</RelativeLayout>


text:
id: 1616
title: 'NaNoWriMo: Day 3'
date: 2009-11-04T06:52:28+00:00
author: Vicki
layout: post
guid: http://blog.vickiboykis.com/wlb/?p=1616
permalink: /2009/11/nanowrimo-day-3/
categories:
  - Uncategorized
tags:
  - NaNoWriMo
---
[<img class="aligncenter size-full wp-image-1600" title="Page_1" src="https://raw.githubusercontent.com/veekaybee/wlb/gh-pages/assets/images/2009/11/Page_1.jpg" alt="Page_1" width="500" height="100" />](https://raw.githubusercontent.com/veekaybee/wlb/gh-pages/assets/images/2009/11/Page_1.jpg)

I’m up to **7,657** words, and, with your feedback am navigating through a wedding reception where Michael is sitting at a tableful of pregnant women. It’s a little slow going right now, so I’m really trying to hurry him through so he can finally get on that plane to Israel!

**Questions for today:**

1. If you’ve been set up with someone you’ve never seen before, what were your expectations for the meeting?

2. Do you know anyone who is scared of dogs?  Why are they scared of them, and how do they express it?


text:
<?php

class ProdutoDao
{
    private $conexao;

    public function __construct($conexao)
    {
        $this->conexao = $conexao;
    }

    public function listaProdutos()
    {
        $produtos = [];
        $query = "select p.*, c.nome as categoria_nome from produtos p join categorias c on c.id = p.categoria_id";
        $resultado = mysqli_query($this->conexao, $query);
        while ($produto_array = mysqli_fetch_assoc($resultado)) {
            $categoria = new Categoria();
            $categoria->setId($produto_array['categoria_id']);
            $categoria->setNome($produto_array['categoria_nome']);

            $id = $produto_array['id'];
            $nome = $produto_array['nome'];
            $preco = $produto_array['preco'];
            $descricao = $produto_array['descricao'];
            $usado = $produto_array['usado'];

            $produto = new Produto($nome, $preco, $descricao, $categoria, $usado);
            $produto->setId($id);

            array_push($produtos, $produto);
        }

        return $produtos;
    }

    public function buscaProduto($id)
    {
        $id = mysqli_escape_string($this->conexao, $id);

        $query = "select * from produtos where id = {$id}";
        $resultado = mysqli_query($this->conexao, $query);
        $produto_array = mysqli_fetch_assoc($resultado);

        $categoria = new Categoria();
        $categoria->setId($produto_array['categoria_id']);

        $id = $produto_array['id'];
        $nome = $produto_array['nome'];
        $preco = $produto_array['preco'];
        $descricao = $produto_array['descricao'];
        $usado = $produto_array['usado'];

        $produto = new Produto($nome, $preco, $descricao, $categoria, $usado);
        $produto->setId($id);

        return $produto;
    }

    public function insereProduto(Produto $produto)
    {
        $nome = mysqli_escape_string($this->conexao, $produto->getNome());
        $preco = mysqli_escape_string($this->conexao, $produto->getPreco());
        $descricao = mysqli_escape_string($this->conexao, $produto->getDescricao());
        $categoria_id = mysqli_escape_string($this->conexao, $produto->getCategoria()->getId());
        $usado = mysqli_escape_string($this->conexao, $produto->isUsado());

        $query = "insert into produtos (nome, preco, descricao, categoria_id, usado) values ('{$nome}', {$preco}, '{$descricao}', {$categoria_id}, {$usado})";
        return mysqli_query($this->conexao, $query);
    }

    public function alteraProduto(Produto $produto)
    {
        $id = mysqli_escape_string($this->conexao, $produto->getId());
        $nome = mysqli_escape_string($this->conexao, $produto->getNome());
        $preco = mysqli_escape_string($this->conexao, $produto->getPreco());
        $descricao = mysqli_escape_string($this->conexao, $produto->getDescricao());
        $categoria_id = mysqli_escape_string($this->conexao, $produto->getCategoria()->getId());
        $usado = mysqli_escape_string($this->conexao, $produto->isUsado());

        $query = "update produtos set nome = '{$nome}', preco = {$preco}, descricao = '{$descricao}', categoria_id = {$categoria_id} , usado = {$usado} where id = {$id}";
        return mysqli_query($this->conexao, $query);
    }

    public function removeProduto($id)
    {
        $query = "delete from produtos where id = {$id}";
        return mysqli_query($this->conexao, $query);
    }
}


text:
import mxnet as mx
from mxnet.gluon.model_zoo import vision
squeezenet = vision.squeezenet_v1(pretrained=True, ctx=mx.cpu())

# To export, you need to hybridize your gluon model,
squeezenet.hybridize()

# SqueezeNet's input pattern is 224 pixel X 224 pixel images. Prepare a fake image,
fake_image = mx.nd.random.uniform(shape=(1,3,224,224), ctx=mx.cpu())

# Run the model once.
result = squeezenet(fake_image)

# Now you can export the model. You can use a path if you want 'models/squeezenet'.
squeezenet.export('squeezenet')

# snippet-end:[deeplens.python.deeplens_frameworks_mxnet.export_model_gluon_api]

# snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.]
# snippet-sourcedescription:[deeplens_frameworks_mxnet.py demonstrates how to create an inference Lambda function on an AWS DeepLens model.]
# snippet-keyword:[Python]
# snippet-sourcesyntax:[python]
# snippet-sourcesyntax:[python]
# snippet-keyword:[AWS Lambda]
# snippet-keyword:[Code Sample]
# snippet-keyword:[AWS DeepLens]
# snippet-service:[deeplens]
# snippet-sourcetype:[full-example]
# snippet-sourcedate:[2019-01-07]
# snippet-sourceauthor:[AWS]


text:
{% extends "sentry/bases/modal.html" %}

{% load crispy_forms_tags %}
{% load i18n %}

{% block title %}{% trans "Recover Account" %} | {{ block.super }}{% endblock %}

{% block main %}

{% trans "Recover Account" %}

{% blocktrans %}We have sent an email to the address registered with this account containing further instructions to reset your password.{% endblocktrans %}

{% endblock %}


text:
import re
import textwrap

from pkg_resources import parse_version
from setuptools import __version__ as SETUPTOOLS_VERSION
import sympy as sm
from sympy.core.function import AppliedUndef
from sympy.utilities.iterables import iterable
from sympy.physics.mechanics import dynamicsymbols

SYMPY_VERSION = sm.__version__

def sympy_equal_to_or_newer_than(version, installed_version=None):
    """Returns true if the installed version of SymPy is equal to or newer
    than the provided version string."""

    if installed_version is None:
        v = SYMPY_VERSION
    else:
        v = installed_version

    if v.endswith('-git') and \
            parse_version(SETUPTOOLS_VERSION) >= parse_version('8.0'):

        msg = ('You are using an older development version of SymPy with a '
               'non-PEP440 compliant version number: {}. Please install '
               'setuptools < 8.0 or a newer development version of SymPy.')
        raise ValueError(msg.format(v))

    return parse_version(v) >= parse_version(version)

def sympy_newer_than(version):
    """Returns true if the installed version of SymPy is newer than the
    provided version string."""
    return parse_version(SYMPY_VERSION) > parse_version(version)

def wrap_and_indent(lines, indentation=4, width=79, continuation=None,
                    comment=None):
    """Returns a single string in which the lines have been indented and
    wrapped into a block of text.

    Parameters
    ==========
    indentation : integer
        The number of characters to indent.
    width : integer
        The maximum line width.
    continuation : string
        The continuation characters.
    comment : string
        The character that designates a comment line.

    """

    if continuation is None:
        cont_len = 0
    else:
        cont_len = len(continuation)

    if comment is None:
        comment_len = 0
    else:
        comment_len = len(comment)

    # TODO : This will indent any lines that only contain a new line. Which
    # may not be preferable.
    new_lines = []

    # TODO : The Octave printer has ".*" and "./" as operators and this doesn't
    # deal with that.
    # add whitespace before and after [*/] binary operands between
    # subexpressions and input/output
    pattern = re.compile('(\w\])([*/])(\w)')
    for line in lines:
        if line != '\n':
            line = pattern.sub(lambda m: ' '.join(m.groups()), line)
            wrapped = textwrap.wrap(line,
                                    width=width-indentation-cont_len-comment_len,
                                    break_long_words=False)
            if continuation:
                last = wrapped[-1]
                wrapped = [l + continuation for l in wrapped[:-1]]
                wrapped.append(last)

            if comment:
                for i, l in enumerate(wrapped[1:]):
                    wrapped[i + 1] = comment + ' ' + l
        else:
            wrapped = [line]
        new_lines += wrapped
    spacer = '\n' + ' ' * indentation
    return ' ' * indentation + spacer.join(new_lines)

# This is a copy of the function in SymPy. It doesn't exist in SymPy 0.7.4
# so we keep it here for now.
def find_dynamicsymbols(expression, exclude=None):
    """Find all dynamicsymbols in expression.

    >>> from sympy.physics.mechanics import dynamicsymbols, find_dynamicsymbols
    >>> x, y = dynamicsymbols('x, y')
    >>> expr = x + x.diff()*y
    >>> find_dynamicsymbols(expr)
    set([x(t), y(t), Derivative(x(t), t)])

    If the optional ``exclude`` kwarg is used, only dynamicsymbols
    not in the iterable ``exclude`` are returned.

    >>> find_dynamicsymbols(expr, [x, y])
    set([Derivative(x(t), t)])
    """
    t_set = set([dynamicsymbols._t])
    if exclude:
        if iterable(exclude):
            exclude_set = set(exclude)
        else:
            raise TypeError("exclude kwarg must be iterable")
    else:
        exclude_set = set()
    return set([i for i in expression.atoms(AppliedUndef, sm.Derivative) if
                i.free_symbols == t_set]) - exclude_set

class PyDyDeprecationWarning(DeprecationWarning):
    pass

class PyDyImportWarning(ImportWarning):
    pass

class PyDyFutureWarning(FutureWarning):
    pass

class PyDyUserWarning(UserWarning):
    pass


text:
package xmlschema

import (
	"encoding/xml"
)

type Import struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema import"`
}

type Union struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema union"`
}

type MinInclusive struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema minInclusive"`
}

type Assertion struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema assertion"`
}

type AnyAttribute struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema anyAttribute"`
}

type Redefine struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema redefine"`
}

type Notation struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema notation"`
}

type Restriction struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema restriction"`
}

type MaxExclusive struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema maxExclusive"`
}

type MaxInclusive struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema maxInclusive"`
}

type TotalDigits struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema totalDigits"`
}

type AttributeGroup struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema attributeGroup"`
}

type ComplexContent struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema complexContent"`
}

type Choice struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema choice"`
}

type Field struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema field"`
}

type Pattern struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema pattern"`
}

type Schema struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema schema"`
}

type Sequence struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema sequence"`
}

type Include struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema include"`
}

type Key struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema key"`
}

type Appinfo struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema appinfo"`
}

type Annotation struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema annotation"`
}

type XML struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema XML"`
}

type Enumeration struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema enumeration"`
}

type ComplexType struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema complexType"`
}

type Facet struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema facet"`
}

type MinExclusive struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema minExclusive"`
}

type MinLength struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema minLength"`
}

type ExplicitTimezone struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema explicitTimezone"`
}

type Override struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema override"`
}

type Group struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema group"`
}

type Attribute struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema attribute"`
}

type SimpleType struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema simpleType"`
}

type Length struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema length"`
}

type All struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema all"`
}

type Documentation struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema documentation"`
}

type XMLSchemaStructures struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema XMLSchemaStructures"`
}

type MaxLength struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema maxLength"`
}

type SimpleContent struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema simpleContent"`
}

type DefaultOpenContent struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema defaultOpenContent"`
}

type Element struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema element"`
}

type Any struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema any"`
}

type Selector struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema selector"`
}

type Unique struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema unique"`
}

type Keyref struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema keyref"`
}

type List struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema list"`
}

type OpenContent struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema openContent"`
}

type WhiteSpace struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema whiteSpace"`
}

type FractionDigits struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/XMLSchema fractionDigits"`
}


text:
import { LetterUu32 } from "../../";

export = LetterUu32;


text:
<?php
/**
 * Created by IntelliJ IDEA.
 * User: wuzesheng
 * Date: 3/24/14
 * Time: 9:59 AM
 */

namespace FDS\credential;

class BasicFDSCredential extends  GalaxyFDSCredential {

  private $access_id;
  private $access_secret;

  public function __construct($access_id, $access_secret) {
    $this->access_id = $access_id;
    $this->access_secret = $access_secret;
  }

  public function getGalaxyAccessId()
  {
    return $this->access_id;
  }

  public function getGalaxyAccessSecret()
  {
    return $this->access_secret;
  }
}


text:
'use strict';

let battle;
const assert = require('assert');

describe('Iron Ball', function () {
	afterEach(function () {
		battle.destroy();
	});

	it('should reduce halve the holder\'s speed', function () {
		battle = BattleEngine.Battle.construct();
		battle.join('p1', 'Guest 1', 1, [{species: "Smeargle", ability: 'owntempo', item: 'ironball', moves: ['bestow']}]);
		battle.join('p2', 'Guest 2', 1, [{species: "Aerodactyl", ability: 'pressure', moves: ['stealthrock']}]);
		let speed = battle.p2.active[0].getStat('spe');
		battle.commitDecisions();
		assert.strictEqual(battle.p2.active[0].getStat('spe'), battle.modify(speed, 0.5));
	});

	it('should negate Ground immunities and deal neutral type effectiveness to Flying-type Pokemon', function () {
		battle = BattleEngine.Battle.construct();
		battle.join('p1', 'Guest 1', 1, [{species: "Smeargle", ability: 'owntempo', item: 'laggingtail', moves: ['earthquake']}]);
		battle.join('p2', 'Guest 2', 1, [
			{species: "Aerodactyl", ability: 'pressure', item: 'ironball', moves: ['stealthrock']},
			{species: "Tropius", ability: 'harvest', item: 'ironball', moves: ['leechseed']}
		]);
		battle.commitDecisions();
		// Earthquake neutral on Aerodactyl
		assert.ok(!battle.log[battle.lastMoveLine + 1].startsWith('|-supereffective|'));
		assert.notStrictEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp);
		battle.choose('p2', 'switch 2');
		battle.commitDecisions();
		// Earthquake neutral on Tropius
		assert.ok(!battle.log[battle.lastMoveLine + 1].startsWith('|-resisted|'));
		assert.notStrictEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp);
	});

	it('should not deal neutral type effectiveness to Flying-type Pokemon in Gravity', function () {
		battle = BattleEngine.Battle.construct();
		battle.join('p1', 'Guest 1', 1, [{species: "Smeargle", ability: 'owntempo', item: 'laggingtail', moves: ['earthquake', 'gravity']}]);
		battle.join('p2', 'Guest 2', 1, [
			{species: "Aerodactyl", ability: 'shellarmor', item: 'ironball', moves: ['stealthrock']},
			{species: "Tropius", ability: 'shellarmor', item: 'ironball', moves: ['leechseed']}
		]);
		// Set up Gravity
		battle.choose('p1', 'move 2');
		battle.choose('p2', 'move 1');

		battle.commitDecisions();
		// Earthquake supereffective on Aerodactyl
		assert.ok(battle.log[battle.lastMoveLine + 1].startsWith('|-supereffective|'));
		assert.notStrictEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp);
		battle.choose('p2', 'switch 2');
		battle.commitDecisions();
		// Earthquake not very effective on Tropius
		assert.ok(battle.log[battle.lastMoveLine + 1].startsWith('|-resisted|'));
		assert.notStrictEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp);
	});

	it('should negate artificial Ground immunities and deal normal type effectiveness', function () {
		battle = BattleEngine.Battle.construct();
		battle.join('p1', 'Guest 1', 1, [{species: "Smeargle", ability: 'owntempo', item: 'laggingtail', moves: ['earthquake']}]);
		battle.join('p2', 'Guest 2', 1, [
			{species: "Rotom", ability: 'levitate', item: 'ironball', moves: ['rest']},
			{species: "Parasect", ability: 'levitate', item: 'ironball', moves: ['rest']}
		]);
		battle.commitDecisions();
		assert.ok(battle.log[battle.lastMoveLine + 1].startsWith('|-supereffective|'));
		assert.notStrictEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp);
		battle.choose('p2', 'switch 2');
		battle.commitDecisions();
		assert.ok(battle.log[battle.lastMoveLine + 1].startsWith('|-resisted|'));
		assert.notStrictEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp);
	});

	it('should ground Pokemon that are airborne', function () {
		battle = BattleEngine.Battle.construct();
		battle.join('p1', 'Guest 1', 1, [{species: "Smeargle", ability: 'owntempo', moves: ['spore']}]);
		battle.join('p2', 'Guest 2', 1, [{species: "Thundurus", ability: 'prankster', item: 'ironball', moves: ['electricterrain']}]);
		battle.commitDecisions();
		assert.strictEqual(battle.p2.active[0].status, '');
	});
});


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using SystemsRx.Extensions;
using SystemsRx.Infrastructure.Extensions;
using EcsRx.Components;
using EcsRx.Components.Database;
using EcsRx.Components.Lookups;
using EcsRx.Entities;
using EcsRx.Examples.Application;
using EcsRx.Examples.ExampleApps.Performance.Components.Specific;
using EcsRx.Examples.ExampleApps.Performance.Helper;
using EcsRx.Extensions;

namespace EcsRx.Examples.ExampleApps.Performance
{
    public class EntityPerformanceApplication : EcsRxConsoleApplication
    {
        private IComponent[] _availableComponents;
        private Type[] _availableComponentTypes;
        private readonly RandomGroupFactory _groupFactory = new RandomGroupFactory();
        private static readonly int EntityCount = 100000;

        private List<IEntity> _entities;

        protected override void BindSystems()
        {}

        protected override void ApplicationStarted()
        {
            var componentNamespace = typeof(Component1).Namespace;
            _availableComponentTypes = _groupFactory.GetComponentTypes
                .Where(x => x.Namespace == componentNamespace)
                .ToArray();

            _availableComponents = _availableComponentTypes
                .Select(x => Activator.CreateInstance(x) as IComponent)
                .ToArray();

            var componentDatabase = Container.Resolve<IComponentDatabase>();
            var componentTypeLookup = Container.Resolve<IComponentTypeLookup>();

            _entities = new List<IEntity>();
            for (var i = 0; i < EntityCount; i++)
            {
                var entity = new Entity(i, componentDatabase, componentTypeLookup);
                entity.AddComponents(_availableComponents);
                _entities.Add(entity);
            }

            var timeTaken = ProcessEntities();

            Console.WriteLine($"Finished In: {timeTaken.Milliseconds}ms");
        }

        private TimeSpan ProcessEntities()
        {
            EntityDatabase.Collections.ForEachRun(x => x.RemoveAllEntities());
            GC.Collect();
            var timer = Stopwatch.StartNew();

            for (var i = 0; i < EntityCount; i++)
            { ProcessEntity(_entities[i]); }

            timer.Stop();
            return TimeSpan.FromMilliseconds(timer.ElapsedMilliseconds);
        }

        public void ProcessEntity(IEntity entity)
        {
            // Called just to make sure the method runs
            bool ignore;

            if(entity.HasAllComponents(_availableComponentTypes))
            { ignore = true; }

            var component1 = entity.GetComponent<Component1>();
            var component2 = entity.GetComponent<Component2>();
            var component3 = entity.GetComponent<Component3>();
            var component4 = entity.GetComponent<Component4>();
            var component5 = entity.GetComponent<Component5>();
            var component6 = entity.GetComponent<Component6>();
            var component7 = entity.GetComponent<Component7>();
            var component8 = entity.GetComponent<Component8>();
            var component9 = entity.GetComponent<Component9>();
            var component10 = entity.GetComponent<Component10>();
            var component11 = entity.GetComponent<Component11>();
            var component12 = entity.GetComponent<Component12>();
            var component13 = entity.GetComponent<Component13>();
            var component14 = entity.GetComponent<Component14>();
            var component15 = entity.GetComponent<Component15>();
            var component16 = entity.GetComponent<Component16>();
            var component17 = entity.GetComponent<Component17>();
            var component18 = entity.GetComponent<Component18>();
            var component19 = entity.GetComponent<Component19>();
            var component20 = entity.GetComponent<Component20>();

            // Stop optimizing away the usages
            if(component1 == null) { }
            if(component2 == null) { }
            if(component3 == null) { }
            if(component4 == null) { }
            if(component5 == null) { }
            if(component6 == null) { }
            if(component7 == null) { }
            if(component8 == null) { }
            if(component9 == null) { }
            if(component10 == null) { }
            if(component11 == null) { }
            if(component12 == null) { }
            if(component13 == null) { }
            if(component14 == null) { }
            if(component15 == null) { }
            if(component16 == null) { }
            if(component17 == null) { }
            if(component18 == null) { }
            if(component19 == null) { }
            if(component20 == null) { }
        }
    }
}


text:
<!DOCTYPE html>

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

  <title>Restaurant Guide</title>

  <link href='https://fonts.googleapis.com/css?family=Raleway:400,300,500,700,900' rel='stylesheet' type='text/css'>

  <link href="assets/fonts/iconfont/material-icons.css" rel="stylesheet">

  <link href="assets/fonts/font-awesome/css/font-awesome.min.css" rel="stylesheet">

  <link href="assets/magnific-popup/magnific-popup.css" rel="stylesheet">

  <link href="assets/flexSlider/flexslider.css" rel="stylesheet">

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

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

  <link href="assets/css/shortcodes/shortcodes.css" rel="stylesheet">

  <link href="style.css" rel="stylesheet">

  <link href="assets/css/skins/restaurant.css" rel="stylesheet">

            Copyright © 2017 Restaurant Guide   |    Designed for WARP


text:
<!DOCTYPE html>
<title>DeviceOrientation-014-001-Readonly check: DeviceOrientation.compassCalibrated is readonly or not.</title>
<link rel="stylesheet" href="resources/style.css"/>

This exists in only an old implementation of the spec. and has been removed now.


text:
package com.github.sonarperl.highlighter;

import com.github.sonarperl.TestPerlVisitorRunner;
import com.github.sonarperl.TestUtils;
import org.junit.Before;
import org.junit.Test;
import org.sonar.api.batch.fs.internal.DefaultInputFile;
import org.sonar.api.batch.fs.internal.TestInputFileBuilder;
import org.sonar.api.batch.sensor.highlighting.TypeOfText;
import org.sonar.api.batch.sensor.internal.SensorContextTester;

import java.io.File;
import java.nio.charset.StandardCharsets;
import java.util.List;

import static org.assertj.core.api.Assertions.assertThat;

public class PerlHighlighterTest {

    private SensorContextTester context;

    private File file;

    @Before
    public void scanFile() {
        String dir = "src/test/resources/com/github/sonarperl/plugins/perl";

        file = new File(dir, "/perlHighlighter.pl");
        DefaultInputFile inputFile = new TestInputFileBuilder("moduleKey", file.getName())
                .initMetadata(TestUtils.fileContent(file, StandardCharsets.UTF_8))
                .build();

        context = SensorContextTester.create(new File(dir));
        context.fileSystem().add(inputFile);

        PerlHighlighter perlHighlighter = new PerlHighlighter(context, inputFile);
        TestPerlVisitorRunner.scanFile(file, perlHighlighter);
    }

    @Test
    public void keyword() {
        // sub
        checkOnRange(7, 0, 3, TypeOfText.KEYWORD);
    }

    @Test
    public void stringLiteral() {
        // "some string"
        checkOnRange(5, 5, 13, TypeOfText.STRING);
    }

    @Test
    public void comment() {
        // # this is a comment
        checkOnRange(3, 0, 19, TypeOfText.COMMENT);
    }

    /**
     * Checks the highlighting of a range of columns. The first column of a line has index 0.
     * The range is the columns of the token.
     */
    private void checkOnRange(int line, int firstColumn, int length, TypeOfText expectedTypeOfText) {
        // check that every column of the token is highlighted (and with the expected type)
        for (int column = firstColumn; column < firstColumn + length; column++) {
            checkInternal(line, column, "", expectedTypeOfText);
        }

        // check that the column before the token is not highlighted
        if (firstColumn != 0) {
            checkInternal(line, firstColumn - 1, " (= before the token)", null);
        }

        // check that the column after the token is not highlighted
        checkInternal(line, firstColumn + length, " (= after the token)", null);
    }

    /**
     * Checks the highlighting of one column. The first column of a line has index 0.
     */
    private void check(int line, int column, TypeOfText expectedTypeOfText) {
        checkInternal(line, column, "", expectedTypeOfText);
    }

    private void checkInternal(int line, int column, String messageComplement, TypeOfText expectedTypeOfText) {
        String componentKey = "moduleKey:" + file.getName();
        List<TypeOfText> foundTypeOfTexts = context.highlightingTypeAt(componentKey, line, column);

        int expectedNumberOfTypeOfText = expectedTypeOfText == null ? 0 : 1;
        String message = "number of TypeOfTexts at line " + line + " and column " + column + messageComplement;
        assertThat(foundTypeOfTexts).as(message).hasSize(expectedNumberOfTypeOfText);
        if (expectedNumberOfTypeOfText > 0) {
            message = "found TypeOfTexts at line " + line + " and column " + column + messageComplement;
            assertThat(foundTypeOfTexts.get(0)).as(message).isEqualTo(expectedTypeOfText);
        }
    }

}


text:
class ConversationChannel < ApplicationCable::Channel
  def subscribed
    stream_from "ConversationChannel:#{params[:id]}"
  end
end


text:
#ifndef KEYSBEHAVIOUR_H
#define KEYSBEHAVIOUR_H

#include "mge/behaviours/AbstractBehaviour.hpp"

/**
 * KeysBehaviour allows you to move an object using the keyboard in its own local space.
 * Left right turns, forward back moves.
 */
class KeysBehaviour : public AbstractBehaviour
{
	public:
		KeysBehaviour(float pMoveSpeed = 5, float pTurnSpeed = 100);
		virtual ~KeysBehaviour();
		virtual void update( float pStep );

    private:
        float _moveSpeed;
        float _turnSpeed;
};

#endif // KEYSBEHAVIOUR_H


text:
using System;
using System.Web.Mvc;
using CompareCloudware.Web.FluentSecurity.ServiceLocation;

namespace CompareCloudware.Web.FluentSecurity
{
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
    public class HandleSecurityAttribute : ActionFilterAttribute
    {
        internal ISecurityHandler Handler { get; private set; }

        public HandleSecurityAttribute() : this(ServiceLocator.Current.Resolve<ISecurityHandler>()) { }

        public HandleSecurityAttribute(ISecurityHandler securityHandler)
        {
            Handler = securityHandler;
        }

        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            var actionName = filterContext.ActionDescriptor.ActionName;
            var controllerName = filterContext.ActionDescriptor.ControllerDescriptor.ControllerType.FullName;

            var securityContext = SecurityContext.Current;
            securityContext.Data.RouteValues = filterContext.RouteData.Values;

            var overrideResult = Handler.HandleSecurityFor(controllerName, actionName, securityContext);
            if (overrideResult != null) filterContext.Result = overrideResult;
        }
    }
}


text:
package org.apache.causeway.core.config.validators;

import java.util.Optional;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

import org.hibernate.validator.internal.constraintvalidators.bv.PatternValidator;
import org.springframework.stereotype.Component;

@Component
public class PatternOptionalStringConstraintValidator
        implements ConstraintValidator<javax.validation.constraints.Pattern, Optional<String>> {

    private final PatternValidator patternValidator = new PatternValidator();

    public PatternOptionalStringConstraintValidator(){
    }

    @Override
    public void initialize(javax.validation.constraints.Pattern constraintAnnotation) {
        patternValidator.initialize(constraintAnnotation);
    }

    @Override
    public boolean isValid(
            final Optional<String> value,
            final ConstraintValidatorContext context) {
        if(!value.isPresent()) {
            return true;
        }
        return patternValidator.isValid(value.get(), context);
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">

    <link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Lato:400,300' rel='stylesheet' type='text/css'>

    <link href='css/flexslider.css' rel='stylesheet' type='text/css'>
    <link href='css/owl.carousel.css' rel='stylesheet' type='text/css'>
    <link href='css/magnific-popup.css' rel='stylesheet' type='text/css'>
    <link href="css/animate.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="css/style.css">

    <title>Quick</title>

                    Flexible. creative. responsive

We are quick

creative agency

Clean & flexible

More Detail

                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse" aria-expanded="false">
                        Toggle navigation

                    </button>
                    Quick

Home

About

Team

Services

Work

Blog

Contact

About us

We are a creative agency located in Usa.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,

Creative

Lorem ipsum dolor sit amet, consectetur adipiscing elit.ullamcorper diam nec augue semper, in dignissim.

Clean & Modern

Lorem ipsum dolor sit amet, consectetur adipiscing elit.ullamcorper diam nec augue semper, in dignissim.

100% Responsive

Lorem ipsum dolor sit amet, consectetur adipiscing elit.ullamcorper diam nec augue semper, in dignissim.

Good design is finding that perfect balance between the way something looks and how it functions.

                    Let's find it

Meet the team

Jenelia Smith

Founder

Daniel Smith

Team Manager

Hardik Smith

UX Designer

Steve Smith

Developer

Testimonials

 Immediately received personal feedback from the creator of the theme. Incredibly fast, incredibly good. Great service!

-Michael CC

 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur pellentesque neque eget diam posuere porta. Quisque ut nulla at nunc vehicula lacinia.

-Rakesh sharma

 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur pellentesque neque eget diam posuere porta. Quisque ut nulla at nunc vehicula lacinia.

-Rakesh sharma

                    Hire us Now

Our Services

Web Design

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ullamcorper diam nec augue semper, in dignissim.

Psd Design

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ullamcorper diam nec augue semper, in dignissim.

Quick response

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ullamcorper diam nec augue semper, in dignissim.

Fully responsive Design

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ullamcorper diam nec augue semper, in dignissim.

Our Portfolio

We believe on our work.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s

Project title

wordpress/HTML5

Project title

wordpress/HTML5

Project title

wordpress/HTML5

Project title

wordpress/HTML5

Project title

wordpress/HTML5

Project title

wordpress/HTML5

Project title

wordpress/HTML5

Project title

wordpress/HTML5

Project title

wordpress/HTML5

3450

Projects Complete

345

Happy Clients

6000

Working Hours

Latest news

Blog post title

                            27 August 2014

Lorem Ipsum is simply dummy text of the printing and typesetting industry

Read More

Blog post title

                            27 August 2014

Lorem Ipsum is simply dummy text of the printing and typesetting industry

Read More

Blog post title

                            27 August 2014

Lorem Ipsum is simply dummy text of the printing and typesetting industry

Read More

Blog post title

                            27 August 2014

Lorem Ipsum is simply dummy text of the printing and typesetting industry

Read More

Blog post title

                            27 August 2014

Lorem Ipsum is simply dummy text of the printing and typesetting industry

Read More

Blog post title

                            27 August 2014

Lorem Ipsum is simply dummy text of the printing and typesetting industry

Read More

                    Read all blog posts

Keep in touch

We are ready to start your project? Give us a call or drop us a line.

                    <form>

                                    Name *
                                    <input class="form-control" type="text" placeholder="Name">

                                    Email Address *
                                    <input class="form-control" type="email" placeholder="Email">

                                    Phone Number *
                                    <input class="form-control" type="tel" placeholder="Phone Number">

                                    Message*
                                    <textarea class="form-control" rows="5" placeholder="Message"></textarea>

                                    <button type="submit" class="btn btn-lg btn-cta">Send Message</button>

                    </form>

Our Office

Address: 302012 Street Name, City Name

Phone: (141) 456-7890

Email: support@quick.com

Monday - Friday :  9:30 AM - 5:30 PM

Saturday - Sunday:  Closed

Elsewhere

facebook

twitter

google plus

linkedin

dribbble

pinterest

Terms of use

Privacy and policy

Copyright © 2016. Quick.


text:
<?php

use Illuminate\Support\ServiceProvider;

class RepositoryServiceProvider extends ServiceProvider {

    public function register() {
        $prefix = 'Database';
        $this->app->bind('CommentRepositoryInterface', $prefix.'CommentRepository');
        $this->app->bind('PresentationRepositoryInterface', $prefix.'PresentationRepository');
        $this->app->bind('ReviewRepositoryInterface', $prefix.'ReviewRepository');
    }

}