text:
function Out-HashString
{
<#
.SYNOPSIS
    Convert an hashtable or and OrderedDictionary to a string

.DESCRIPTION
    Convert an hashtable or and OrderedDictionary to a string

.PARAMETER InputObject
    The object that is to be converted

.PARAMETER PreSpacing
    Number of spaces used for indentation

.EXAMPLE
    $hashObject = @{
        Name = "Tore"
        Goal = "Rule the World"
    }
    $hashObject | Out-HashString

    This will convert the hashtable to the following string
    @{
        Name = "Tore"
        Goal = "Rule the World"
    }

.INPUTS
    Hashtable

.OUTPUTS
    string

.NOTES
    Author:  Tore Groneng
    Website: www.firstpoint.no
    Twitter: @ToreGroneng
#>
[cmdletbinding()]
Param(
    [Parameter(ValueFromPipeLine)]
    $InputObject
    ,
    [string]$PreSpacing = "    "
)
Begin
{
    $f = $MyInvocation.InvocationName
    Write-Verbose -Message "$f - START"
    $newLine = [environment]::NewLine

    if ($PreSpacing)
    {
        $endspaceCount = $PreSpacing.Length - 4
        if ($endspaceCount -lt 0){$endspaceCount = 0}
        $endspace = " " * $endspaceCount
        $beginSpace = " " * $endspaceCount
    }
}
Process
{
    $out = "@{"

    $out = $out + $newLine
    $preSpace = $PreSpacing

    if (-not $InputObject -or $InputObject.keys.count -eq 0) {return "@{}"}

    foreach ($key in $InputObject.Keys)
    {
        Write-Verbose -Message "$f -  Processing key [$key]"

        if ($key.Contains('$'))
        {
            $DisplayKey = "'$key'"
        }

        $value = $InputObject.$key
        $objType = $value.GetType().Name
        Write-Verbose -Message "$f -  ObjectType = $objType"

        $mode = "stringValue"

        if ($objType -eq "Hashtable" -or $objType -eq "OrderedDictionary")
        {
            $mode = "hashtable"
        }

        if ($value -is [array])
        {
            if ($value[0])
            {
                $arrayType = $value[0].GetType().Name
                Write-Verbose -Message "$f -  arrayType is [$arrayType]"

                if ($arrayType -eq "Hashtable" -or $arrayType -eq "OrderedDictionary")
                {
                    $mode = "HashTableValue"
                }
                else
                {
                    $mode = "ArrayValue"
                }
            }
        }

        Write-Verbose -Message "$f -  Mode is [$mode]"
        if ($DisplayKey)
        {
            $key = $DisplayKey
            $DisplayKey = $null
        }

        $out += "$PreSpacing$key = "

        switch ($mode)
        {
            'stringValue'
            {
                $out += '"' + $value + '"' + $newLine
            }

            'hashtable'
            {
                $stringValue = Out-HashString -InputObject $value -PreSpacing "$PreSpacing    "
                $out += $stringValue + $newLine
            }

            'HashTableValue'
            {
                $stringValue = ""
                foreach ($arrayHash in $value)
                {
                    $hashString = Out-HashString -InputObject $arrayHash -PreSpacing "$PreSpacing    "
                    $hash = "    $hashString"
                    $hash = "$hash," + $newLine
                    $stringValue += $hash
                }
                $separatorIndex = $stringValue.LastIndexOf(",")
                $stringValue = $stringValue.Remove($separatorIndex,1)
                $out += $stringValue
            }

            'ArrayValue'
            {
                $out += '"' +($value -join '","') + '"' + $newLine
            }

            Default {}
        }
    }
    $out += "$endspace}"
    $out
}
}


text:
package shef.nlp.supple.prolog.cafe;
import jp.ac.kobe_u.cs.prolog.lang.*;
import jp.ac.kobe_u.cs.prolog.builtin.*;

/*
 * *** Please do not edit ! ***
 * @(#) PRED_count_edges_1.java
 * @procedure count_edges/1 in plcafe_supple_io.pl
 */

/*
 * @version Prolog Cafe 0.8 November 2003
 * @author Mutsunori Banbara (banbara@kobe-u.ac.jp)
 * @author Naoyuki Tamura    (tamura@kobe-u.ac.jp)
 */

public class PRED_count_edges_1 extends Predicate {
    static SymbolTerm f1 = SymbolTerm.makeSymbol("edge", 10);
    static SymbolTerm f3 = SymbolTerm.makeSymbol(",", 2);
    static SymbolTerm f4 = SymbolTerm.makeSymbol(";", 2);
    static SymbolTerm f5 = SymbolTerm.makeSymbol("retract", 1);
    static SymbolTerm f6 = SymbolTerm.makeSymbol("count_edges_number", 1);
    static SymbolTerm f9 = SymbolTerm.makeSymbol("is", 2);
    static IntegerTerm s10 = new IntegerTerm(0);
    static SymbolTerm f13 = SymbolTerm.makeSymbol("+", 2);
    static IntegerTerm s14 = new IntegerTerm(1);
    static SymbolTerm f17 = SymbolTerm.makeSymbol("assert", 1);

    public Term arg1;

    public PRED_count_edges_1(Term a1, Predicate cont) {
        arg1 = a1;
        this.cont = cont;
    }

    public PRED_count_edges_1(){}
    public void setArgument(Term[] args, Predicate cont) {
        arg1 = args[0];
        this.cont = cont;
    }

    public Predicate exec(Prolog engine) {
        engine.setB0();
        Term a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15;
        Predicate p1;
        a1 = arg1.dereference();

        Term[] h2 = {new VariableTerm(engine), new VariableTerm(engine), new VariableTerm(engine), new VariableTerm(engine), new VariableTerm(engine), new VariableTerm(engine), new VariableTerm(engine), new VariableTerm(engine), new VariableTerm(engine), new VariableTerm(engine)};
        a2 = new StructureTerm(f1, h2);
        a7 = new VariableTerm(engine);
        Term[] h7 = {a7};
        a6 = new StructureTerm(f6, h7);
        Term[] h8 = {a6};
        a5 = new StructureTerm(f5, h8);
        Term[] h11 = {a7, s10};
        a8 = new StructureTerm(f9, h11);
        Term[] h12 = {a5, a8};
        a4 = new StructureTerm(f4, h12);
        a11 = new VariableTerm(engine);
        Term[] h15 = {a7, s14};
        a12 = new StructureTerm(f13, h15);
        Term[] h16 = {a11, a12};
        a10 = new StructureTerm(f9, h16);
        Term[] h18 = {a11};
        a14 = new StructureTerm(f6, h18);
        Term[] h19 = {a14};
        a13 = new StructureTerm(f17, h19);
        Term[] h20 = {a10, a13};
        a9 = new StructureTerm(f3, h20);
        Term[] h21 = {a4, a9};
        a3 = new StructureTerm(f3, h21);
        Term[] h22 = {a1};
        a15 = new StructureTerm(f6, h22);
        p1 = new PRED_retract_1(a15, cont);
        return new PRED_foreach_2(a2, a3, p1);
    }

    public int arity() { return 1; }

    public String toString() {
        return "count_edges(" + arg1 + ")";
    }
}

redpajama_set_name: RedPajamaGithub


text:
DocFX Flavored Markdown
==========================================

DocFX supports `DocFX Flavored Markdown`, or DFM. It supports all [GitHub Flavored Markdown](https://guides.github.com/features/mastering-markdown/) syntax with 2 exceptions when resolving [list](#differences-between-dfm-and-gfm). Also, DFM adds new syntax to support additional functionalities, including cross reference and file inclusion.

## Yaml Header

Yaml header in DFM is considered as the metadata for the Markdown file. It will transform to `yamlheader` tag when processed.
Yaml header MUST be the first thing in the file and MUST take the form of valid YAML set between triple-dashed lines. Here is a basic example:

```md
---
uid: A.md
title: A
---
```

## Cross Reference

Cross reference allows you to link to another topic by using its unique identifier (called UID) instead of using its file path.

For conceptual Markdown files UID can be defined by adding a `uid` metadata in YAML header:

```md
---
uid: uid_of_the_file
---

This is a conceptual topic with `uid` specified.
```

For reference topics, UIDs are auto generated from source code and can be found in generated YAML files.

You can use one of the following syntax to cross reference a topic with UID defined:

1. Markdown link: `[link_text](xref:uid_of_the_topic)`
2. Auto link: `<xref:uid_of_the_topic>`
3. Shorthand form: `@uid_of_the_topic`

All will render to:

```html
<a href="url_of_the_topic">link_text</a>
```

If `link_text` is not specified, DocFX will extract the title from the target topic and use it as the link text.

For more information, see [cross reference](../tutorial/links_and_cross_references.md#using-cross-reference).

## File Inclusion
DFM adds syntax to include other file parts into current file, the included file will also be considered as in DFM syntax.

There are two types of file inclusion: Inline and block, as similar to inline code span and block code.

> [!NOTE]
> YAML header is **NOT** supported when the file is an inclusion.

### Inline
Inline file inclusion is in the following syntax, in which `<title>` stands for the title of the included file, and `<filepath>` stands for the file path of the included file. The file path can be either absolute or relative.`<filepath>` can be wrapped by `'` or `"`.

> [!NOTE]
> For inline file inclusion, the file included will be considered as containing only inline tags, for example,
> `###header` inside the file will not transfer since `<h3>` is a block tag, while `[a](b)` will transform to
> `<a href='b'>a</a>` since `<a>` is an inline tag.

```md
...Other inline contents... [!include[<title>](<filepath>)]
```
### Block
Block file inclusion must be in a single line and with no prefix characters before the start `[`. Content inside the included file will transform using DFM syntax.
```md
[!include[<title>](<filepath>)]
```

## Section definition
User may need to define section. Mostly used for code table.
Give an example below.

    > [!div class="tabbedCodeSnippets" data-resources="OutlookServices.Calendar"]
    > ```cs
    > <cs code text>
    > ```
    > ```javascript
    > <js code text>
    > ```

The above blockquote Markdown text will transform to section html as in the following:
```html
<div class="tabbedCodeSnippets" data-resources="OutlookServices.Calendar">
  <pre><code>cs code text</code></pre>
  <pre><code>js code text</code></pre>
</div>
```

## Code Snippet
Allows you to insert code with code language specified. The content of specified code path will expand.

```md
[!code-<language>[<name>](<codepath><queryoption><queryoptionvalue> "<title>")]
```

* __`<language>`__ can be made up of any number of character and '-'. However, the recommended value should follow [Highlight.js language names and aliases](http://highlightjs.readthedocs.org/en/latest/css-classes-reference.html#language-names-and-aliases).
* __`<codepath>`__ is the relative path in file system which indicates the code snippet file that you want to expand.
* __`<queryoption>`__ and __`<queryoptionvalue>`__ are used together to retrieve part of the code snippet file in the line range or tag name way. We have 2 query string options to represent these two ways:

|                          | query string using `#`                 | query string using `?`
|--------------------------|----------------------------------------|-----------------------------------------------
| 1. line range            | `#L{startlinenumber}-L{endlinenumber}` | `?start={startlinenumber}&end={endlinenumber}`
| 2. tagname               | `#{tagname}`                           | `?name={tagname}`
| 3. multiple region range | _Unsupported_                          | `?range={rangequerystring}`
| 4. highlight lines       | _Unsupported_                          | `?highlight={rangequerystring}`
| 5. dedent                | _Unsupported_                          | `?dedent={dedentlength}`
* In `?` query string, the whole file will be included if none of the first three option is specified.
* If `dedent` isn't specified, the maximum common indent will be trimmed automatically.
* __`<title>`__ can be omitted.

### Code Snippet Sample
```md
[!code-csharp[Main](Program.cs)]

[!code[Main](Program.cs#L12-L16 "This is source file")]
[!code-vb[Main](../Application/Program.vb#testsnippet "This is source file")]

[!code[Main](index.xml?start=5&end=9)]
[!code-javascript[Main](../jquery.js?name=testsnippet)]
[!code[Main](index.xml?range=2,5-7,9-) "This includes the lines 2, 5, 6, 7 and lines 9 to the last line"]
[!code[Main](index.xml?highlight=2,5-7,9-) "This includes the whole file with lines 2,5-7,9- highlighted"]
```

### Tag Name Representation in Code Snippet Source File
DFM currently only supports the following __`<language>`__ values to be able to retrieve by tag name:
* C#: cs, csharp
* VB: vb, vbnet
* C++: cpp, c++
* F#: fsharp
* XML: xml
* Html: html
* SQL: sql
* Javascript: javascript

## Note (Warning/Tip/Important)
Using specific syntax inside block quote to indicate the following content is Note.

```
> [!NOTE]
> <note content>
> [!WARNING]
> <warning content>
```

The above content will be transformed to the following html:

```
<div class="NOTE">
  <h5>NOTE</h5>
  <p>note content</p>
</div>
<div class="WARNING">
  <h5>WARNING</h5>
  <p>WARNING content</p>
</div>
```

Here are all the supported note types with the styling of the default theme applied:

> [!NOTE]
> This is a note which needs your attention, but it's not super important.

> [!TIP]
> This is a note which needs your attention, but it's not super important.

> [!WARNING]
> This is a warning containing some important message.

> [!IMPORTANT]
> This is a warning containing some important message.

> [!CAUTION]
> This is a warning containing some important message.

## Differences between DFM and GFM

### List

DFM list item always uses the first character in the first line to decide whether it is in the list item, but GFM does not.
For example:

Case 1:
```md
* a
  * b
    * c

  text
```

`a` starts at column 3, `b` starts at column 5, `c` starts at column 7.

| `text` will be | in DFM, `text` starts at column | in GFM, `text` starts at column |
| ------ | --- | --- |
| paragraph | 1 | 1 |
| part of item a | 2 ~ 3 (> 1 and <= 3) | 2 ~ 4 |
| part of item b | 4 ~ 5 (> 3 and <= 6) | 5 ~ 6 |
| part of item c | 6 or more (> 6) | 7 or more |
| part of item c and code | 11 (7 + 4) | 13 |

Case 2:
```md
1. a
   2. b
      3. c

   text
```

`a` starts at column 4, `b` starts at column 7, `c` starts at column 10.

| `text` will be | in DFM, `text` starts at column | in GFM, `text` starts at column |
| ------ | --- | --- |
| paragraph | 1 | 1 |
| part of item a | 2 ~ 4 (> 1 and <= 4) | 2 ~ 4 |
| part of item b | 5 ~ 7 (> 4 and <= 7) | 5 ~ 8 |
| part of item c | 8 or more (> 7) | 9 or more |
| part of item c and code | 14 (10 + 4) | 15 |

### List after paragraph

In GFM, list after paragraph must be separated by two or more new line character.
In DFM, one new line also works.

For example:
```md
text
1. a
2. b
```
In GFM, it will be rendered as one paragraph with content `text 1. a 2. b`.
In DFM, it will be rendered as a paragraph (with content `text`) and a list.

## Differences introduced by DFM syntax

> [!Warning]
> Please note that DFM introduces more syntax to support more functionalities. When GFM does not support them, preview the
> Markdown file inside *GFM Preview* can lead to different results.

### YAML header

In GFM, YAML header must start at the very beginning of the Markdown file.
In DFM, YAML header contains more powerful meanings. Refer to [Yaml Header](#yaml-header) for details.

```md
...some text...

---
a: b
---
```

In GFM, it would be rendered as `<hr>a: b<hr>`.
In DFM, it would be rendered as a YAML header.

If you want to get `<hr>` in html in DFM, please use:
```md
- - -
***
* * *
```
or change content to make it not in YAML format:
```md
---
a\: b
---
```

### Text after block extension

Some block extension in DFM cannot be recognized in GFM.
In GFM, it would be treated as a part of paragraph.
Then, following content would be treated as a part of paragraph.

For example:
```md
> [!NOTE]
>     This is code.
```

In GFM, it will be rendered as a paragraph with content `[!NOTE] This is code.` in blockquote.
In DFM, it will be rendered as a code in note.


text:
<?php

namespace App\Http\Controllers\Auth;

use App\Custom\Exception\ValidateException;
use App\Custom\Request\RequestMessage;
use App\Repositories\UserRepository;
use App\User;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;
use Socialite;

class RegisterController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Register Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles the registration of new users as well as their
    | validation and creation. By default this controller uses a trait to
    | provide this functionality without requiring any additional code.
    |
    */

    use RegistersUsers;

    /**
     * Where to redirect users after registration.
     *
     * @var string
     */
    protected $redirectTo = '/dashboard';

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest');
    }

    /**
     * Get a validator for an incoming registration request.
     *
     * @param  array $data
     * @return \Illuminate\Contracts\Validation\Validator
     */
    protected function validator(array $data)
    {
        return Validator::make($data, [
            'name' => 'required|max:255',
            'email' => 'required|email|max:255|unique:users',
            'password' => 'required|min:6|confirmed',
        ]);
    }

    /**
     * Create a new user instance after a valid registration.
     *
     * @param  array $data
     * @return User
     */
    protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => $data['password'],
        ]);
    }

    public function index(Request $request)
    {
        if ($request->isMethod('POST')) {
            $all = $request->all();

            $validate = $this->validator($all);

            if ($validate->fails()) {
                return RequestMessage::warning($validate->errors());
            }

            $user = $this->create($all);
            $this->guard()->login($user);

            return RequestMessage::success(['route' => route('dashboard_index'), 'msg' => 'Cadastro realizado!']);
        }

        return view('auth.register');
    }

    /**
     * Redirect the user to the GitHub authentication page.
     *
     * @return Response
     */

    public function redirectToProvider()
    {
        return Socialite::driver('facebook')->redirect();
    }

    /**
     * Obtain the user information from GitHub.
     *
     * @return Response
     */
    public function handleProviderCallback()
    {
        $userReturned = Socialite::driver('facebook')->stateless()->user();

        $userRepository = new UserRepository();
        $getUser = $userRepository->createOrGetSocialUser($userReturned);

        $this->guard()->login($getUser);

        return redirect()->route('dashboard_index');
    }

    public function createPassword(Request $request)
    {
        if ($request->isMethod('POST')) {
            $all = $request->all();

            $validate = Validator::make($all, [
                'password' => 'required|min:6|confirmed',
            ]);

            if ($validate->fails()) {
                return RequestMessage::warning($validate->errors());
            }

            $email = session('email');
            session()->forget('email');

            $userRepository = new UserRepository();
            $user = $userRepository->getUserByEmail($email);
            $user->password = $all['password'];
            $user->save();

            $this->guard()->login($user);

            return RequestMessage::success(['route' => route('dashboard_index')]);
        }

        return view('auth.register_pass');
    }
}


text:
sensu_roles Cookbook
====================

This cookbook makes sensu monitor, sensu client.

Requirements
------------

TODO: add some descriptions if requirements exists.

#### packages

- `sensu` - sensu_roles depends on [sensu-chef](https://github.com/sensu/sensu-chef) cookbook.

Attributes
----------
TODO: List your cookbook attributes here.

e.g.
#### sensu_roles::default

    Key
    Type
    Description
    Default

    <tt>['sensu_roles']['bacon']</tt>
    Boolean
    whether to include bacon
    <tt>true</tt>

Usage
-----
#### sensu_roles::monitor

```json
{
  "name":"sensu_monitor",
  "run_list": [
    "recipe[sensu_roles::monitor]"
  ]
}
```

#### sensu_roles::client

```json
{
  "name":"sensu_client",
  "run_list": [
    "recipe[sensu_roles::client]"
  ]
}
```

Contributing
------------
TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.

e.g.
1. Fork the repository on Github
2. Create a named feature branch (like `add_component_x`)
3. Write your change
4. Write tests for your change (if applicable)
5. Run the tests, ensuring they all pass
6. Submit a Pull Request using Github

License and Authors
-------------------
Authors: TODO: List authors


text:
from __future__ import unicode_literals

from django.db import models, migrations
import datetime
from django.utils.timezone import utc

class Migration(migrations.Migration):

    dependencies = [
        ('account', '0019_auto_20150609_1406'),
    ]

    operations = [
        migrations.AlterField(
            model_name='user',
            name='key_expires',
            field=models.DateTimeField(default=datetime.datetime(2015, 6, 10, 9, 43, 20, 501730, tzinfo=utc)),
        ),
    ]


text:
.. _es-guide-reference-mapping-nested-type:

===========
Nested Type
===========

Nested objects/documents allow to map certain sections in the document indexed as nested allowing to query them as if they are separate docs joining with the parent owning doc.

Note
    This feature is experimental and might require reindexing the data if using it.

One of the problems when indexing inner objects that occur several times in a doc is that "cross object" search match will occur, for example:

.. code-block:: js

    {
        "obj1" : [
            {
                "name" : "blue",
                "count" : 4
            },
            {
                "name" : "green",
                "count" : 6
            }
        ]
    }

Searching for name set to blue and count higher than 5 will match the doc, because in the first element the name matches blue, and in the second element, count matches "higher than 5".

Nested mapping allow to map certain inner objects (usually multi instance ones), for example:

.. code-block:: js

    {
        "type1" : {
            "properties" : {
                "obj1" : {
                    "type" : "nested"
                }
            }
        }
    }

The above will cause all **obj1** to be indexed as a nested doc. The mapping is similar in nature to setting **type** to **object**, except that its **nested**.

The **nested** object fields can also be automatically added to the immediate parent by setting **include_in_parent** to true, and also included in the root object by setting **include_in_root** to true.

Nested docs will also automatically use the root doc **_all** field.

Searching on nested docs can be done using either the :ref:`nested query <es-guide-reference-query-dsl-nested-query>`  or :ref:`nested filter <es-guide-reference-query-dsl-nested-filter>`.

Internal Implementation
-----------------------

Internally, nested objects are indexed as additional documents, but, since they can be guaranteed to be indexed within the same "block", it allows for extremely fast joining with parent docs.

Those internal nested documents are automatically masked away when doing operations against the index (like searching with a match_all query), and they bubble out when using the nested query.


text:
package org.tll.canyon.webapp.action;

import java.util.Map;

import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.mock.web.MockHttpServletRequest;
import org.tll.canyon.Constants;
import org.tll.canyon.webapp.action.AssetHitStatController;
import org.tll.canyon.webapp.action.BaseControllerTestCase;

public class AssetHitStatControllerTest extends BaseControllerTestCase {

    public void testHandleRequest() throws Exception {
        AssetHitStatController c =
            (AssetHitStatController) ctx.getBean("assetHitStatController");
        ModelAndView mav = c.handleRequest(new MockHttpServletRequest(),
                                           (HttpServletResponse) null);
        Map m = mav.getModel();
        assertNotNull(m.get(Constants.ASSETHITSTAT_LIST));
        assertEquals(mav.getViewName(), "assetHitStatList");
    }
}


text:
using System;
using System.Windows.Forms;

namespace Microsoft.Web.Management.Client.Win32
{
    public class ManagementTabPage : TabPage
    {
        protected override void OnRightToLeftChanged(
            EventArgs e
            )
        { }

        protected override CreateParams CreateParams { get; }
        public bool RightToLeftLayout { get; set; }
    }
}


text:
package com.meisolsson.githubsdk.model.request;

import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import com.google.auto.value.AutoValue;
import com.squareup.moshi.JsonAdapter;
import com.squareup.moshi.Moshi;

@AutoValue
public abstract class RequestMarkdown implements Parcelable {

    public static final String MODE_MARKDOWN = "markdown";
    public static final String MODE_GFM = "gfm";

    @NonNull
    public abstract String text();

    @Nullable
    public abstract String mode();

    @Nullable
    public abstract String context();

    public static JsonAdapter<RequestMarkdown> jsonAdapter(Moshi moshi){
        return new AutoValue_RequestMarkdown.MoshiJsonAdapter(moshi);
    }

    public static Builder builder() {
        return new AutoValue_RequestMarkdown.Builder();
    }

    @AutoValue.Builder
    public abstract static class Builder {
        public abstract Builder text(@NonNull String text);

        public abstract Builder mode(@Nullable String mode);

        public abstract Builder context(@Nullable String context);

        public abstract RequestMarkdown build();
    }
}


text:
package parser

import (
	"bytes"
	"regexp"
	"strconv"

	"github.com/gomarkdown/markdown/ast"
)

// Parsing of inline elements

var (
	urlRe    = `((https?|ftp):\/\/|\/)[-A-Za-z0-9+&@#\/%?=~_|!:,.;\(\)]+`
	anchorRe = regexp.MustCompile(`^(<a\shref="` + urlRe + `"(\stitle="[^"<>]+")?\s?>` + urlRe + `<\/a>)`)

	// TODO: improve this regexp to catch all possible entities:
	htmlEntityRe = regexp.MustCompile(`&[a-z]{2,5};`)
)

// Inline parses text within a block.
// Each function returns the number of consumed chars.
func (p *Parser) Inline(currBlock ast.Node, data []byte) {
	// handlers might call us recursively: enforce a maximum depth
	if p.nesting >= p.maxNesting || len(data) == 0 {
		return
	}
	p.nesting++
	beg, end := 0, 0

	n := len(data)
	for end < n {
		handler := p.inlineCallback[data[end]]
		if handler == nil {
			end++
			continue
		}
		consumed, node := handler(p, data, end)
		if consumed == 0 {
			// no action from the callback
			end++
			continue
		}
		// copy inactive chars into the output
		ast.AppendChild(currBlock, newTextNode(data[beg:end]))
		if node != nil {
			ast.AppendChild(currBlock, node)
		}
		beg = end + consumed
		end = beg
	}

	if beg < n {
		if data[end-1] == '\n' {
			end--
		}
		ast.AppendChild(currBlock, newTextNode(data[beg:end]))
	}
	p.nesting--
}

// single and double emphasis parsing
func emphasis(p *Parser, data []byte, offset int) (int, ast.Node) {
	data = data[offset:]
	c := data[0]

	n := len(data)
	if n > 2 && data[1] != c {
		// whitespace cannot follow an opening emphasis;
		// strikethrough only takes two characters '~~'
		if isSpace(data[1]) {
			return 0, nil
		}
		if p.extensions&SuperSubscript != 0 && c == '~' {
			// potential subscript, no spaces, except when escaped, helperEmphasis does
			// not check that for us, so walk the bytes and check.
			ret := skipUntilChar(data[1:], 0, c)
			if ret == 0 {
				return 0, nil
			}
			ret++ // we started with data[1:] above.
			for i := 1; i < ret; i++ {
				if isSpace(data[i]) && !isEscape(data, i) {
					return 0, nil
				}
			}
			sub := &ast.Subscript{}
			sub.Literal = data[1:ret]
			return ret + 1, sub
		}
		ret, node := helperEmphasis(p, data[1:], c)
		if ret == 0 {
			return 0, nil
		}

		return ret + 1, node
	}

	if n > 3 && data[1] == c && data[2] != c {
		if isSpace(data[2]) {
			return 0, nil
		}
		ret, node := helperDoubleEmphasis(p, data[2:], c)
		if ret == 0 {
			return 0, nil
		}

		return ret + 2, node
	}

	if n > 4 && data[1] == c && data[2] == c && data[3] != c {
		if c == '~' || isSpace(data[3]) {
			return 0, nil
		}
		ret, node := helperTripleEmphasis(p, data, 3, c)
		if ret == 0 {
			return 0, nil
		}

		return ret + 3, node
	}

	return 0, nil
}

func codeSpan(p *Parser, data []byte, offset int) (int, ast.Node) {
	data = data[offset:]

	// count the number of backticks in the delimiter
	nb := skipChar(data, 0, '`')

	// find the next delimiter
	i, end := 0, 0
	for end = nb; end < len(data) && i < nb; end++ {
		if data[end] == '`' {
			i++
		} else {
			i = 0
		}
	}

	// no matching delimiter?
	if i < nb && end >= len(data) {
		return 0, nil
	}

	// trim outside whitespace
	fBegin := nb
	for fBegin < end && data[fBegin] == ' ' {
		fBegin++
	}

	fEnd := end - nb
	for fEnd > fBegin && data[fEnd-1] == ' ' {
		fEnd--
	}

	// render the code span
	if fBegin != fEnd {
		code := &ast.Code{}
		code.Literal = data[fBegin:fEnd]
		return end, code
	}

	return end, nil
}

// newline preceded by two spaces becomes <br>
func maybeLineBreak(p *Parser, data []byte, offset int) (int, ast.Node) {
	origOffset := offset
	offset = skipChar(data, offset, ' ')

	if offset < len(data) && data[offset] == '\n' {
		if offset-origOffset >= 2 {
			return offset - origOffset + 1, &ast.Hardbreak{}
		}
		return offset - origOffset, nil
	}
	return 0, nil
}

// newline without two spaces works when HardLineBreak is enabled
func lineBreak(p *Parser, data []byte, offset int) (int, ast.Node) {
	if p.extensions&HardLineBreak != 0 {
		return 1, &ast.Hardbreak{}
	}
	return 0, nil
}

type linkType int

const (
	linkNormal linkType = iota
	linkImg
	linkDeferredFootnote
	linkInlineFootnote
	linkCitation
)

func isReferenceStyleLink(data []byte, pos int, t linkType) bool {
	if t == linkDeferredFootnote {
		return false
	}
	return pos < len(data)-1 && data[pos] == '[' && data[pos+1] != '^'
}

func maybeImage(p *Parser, data []byte, offset int) (int, ast.Node) {
	if offset < len(data)-1 && data[offset+1] == '[' {
		return link(p, data, offset)
	}
	return 0, nil
}

func maybeInlineFootnoteOrSuper(p *Parser, data []byte, offset int) (int, ast.Node) {
	if offset < len(data)-1 && data[offset+1] == '[' {
		return link(p, data, offset)
	}

	if p.extensions&SuperSubscript != 0 {
		ret := skipUntilChar(data[offset:], 1, '^')
		if ret == 0 {
			return 0, nil
		}
		for i := offset; i < offset+ret; i++ {
			if isSpace(data[i]) && !isEscape(data, i) {
				return 0, nil
			}
		}
		sup := &ast.Superscript{}
		sup.Literal = data[offset+1 : offset+ret]
		return ret + 1, sup
	}

	return 0, nil
}

// '[': parse a link or an image or a footnote or a citation
func link(p *Parser, data []byte, offset int) (int, ast.Node) {
	// no links allowed inside regular links, footnote, and deferred footnotes
	if p.insideLink && (offset > 0 && data[offset-1] == '[' || len(data)-1 > offset && data[offset+1] == '^') {
		return 0, nil
	}

	var t linkType
	switch {
	// special case: ![^text] == deferred footnote (that follows something with
	// an exclamation point)
	case p.extensions&Footnotes != 0 && len(data)-1 > offset && data[offset+1] == '^':
		t = linkDeferredFootnote
	// ![alt] == image
	case offset >= 0 && data[offset] == '!':
		t = linkImg
		offset++
	// [@citation], [@-citation], [@?citation], [@!citation]
	case p.extensions&Mmark != 0 && len(data)-1 > offset && data[offset+1] == '@':
		t = linkCitation
	// [text] == regular link
	// ^[text] == inline footnote
	// [^refId] == deferred footnote
	case p.extensions&Footnotes != 0:
		if offset >= 0 && data[offset] == '^' {
			t = linkInlineFootnote
			offset++
		} else if len(data)-1 > offset && data[offset+1] == '^' {
			t = linkDeferredFootnote
		}
	default:
		t = linkNormal
	}

	data = data[offset:]

	if t == linkCitation {
		return citation(p, data, 0)
	}

	var (
		i                               = 1
		noteID                          int
		title, link, linkID, altContent []byte
		textHasNl                       = false
	)

	if t == linkDeferredFootnote {
		i++
	}

	// look for the matching closing bracket
	for level := 1; level > 0 && i < len(data); i++ {
		switch {
		case data[i] == '\n':
			textHasNl = true

		case data[i-1] == '\\':
			continue

		case data[i] == '[':
			level++

		case data[i] == ']':
			level--
			if level <= 0 {
				i-- // compensate for extra i++ in for loop
			}
		}
	}

	if i >= len(data) {
		return 0, nil
	}

	txtE := i
	i++
	var footnoteNode ast.Node

	// skip any amount of whitespace or newline
	// (this is much more lax than original markdown syntax)
	i = skipSpace(data, i)

	// inline style link
	switch {
	case i < len(data) && data[i] == '(':
		// skip initial whitespace
		i++

		i = skipSpace(data, i)

		linkB := i
		brace := 0

		// look for link end: ' " )
	findlinkend:
		for i < len(data) {
			switch {
			case data[i] == '\\':
				i += 2

			case data[i] == '(':
				brace++
				i++

			case data[i] == ')':
				if brace <= 0 {
					break findlinkend
				}
				brace--
				i++

			case data[i] == '\'' || data[i] == '"':
				break findlinkend

			default:
				i++
			}
		}

		if i >= len(data) {
			return 0, nil
		}
		linkE := i

		// look for title end if present
		titleB, titleE := 0, 0
		if data[i] == '\'' || data[i] == '"' {
			i++
			titleB = i
			titleEndCharFound := false

		findtitleend:
			for i < len(data) {
				switch {
				case data[i] == '\\':
					i++

				case data[i] == data[titleB-1]: // matching title delimiter
					titleEndCharFound = true

				case titleEndCharFound && data[i] == ')':
					break findtitleend
				}
				i++
			}

			if i >= len(data) {
				return 0, nil
			}

			// skip whitespace after title
			titleE = i - 1
			for titleE > titleB && isSpace(data[titleE]) {
				titleE--
			}

			// check for closing quote presence
			if data[titleE] != '\'' && data[titleE] != '"' {
				titleB, titleE = 0, 0
				linkE = i
			}
		}

		// remove whitespace at the end of the link
		for linkE > linkB && isSpace(data[linkE-1]) {
			linkE--
		}

		// remove optional angle brackets around the link
		if data[linkB] == '<' {
			linkB++
		}
		if data[linkE-1] == '>' {
			linkE--
		}

		// build escaped link and title
		if linkE > linkB {
			link = data[linkB:linkE]
		}

		if titleE > titleB {
			title = data[titleB:titleE]
		}

		i++

	// reference style link
	case isReferenceStyleLink(data, i, t):
		var id []byte
		altContentConsidered := false

		// look for the id
		i++
		linkB := i
		i = skipUntilChar(data, i, ']')

		if i >= len(data) {
			return 0, nil
		}
		linkE := i

		// find the reference
		if linkB == linkE {
			if textHasNl {
				var b bytes.Buffer

				for j := 1; j < txtE; j++ {
					switch {
					case data[j] != '\n':
						b.WriteByte(data[j])
					case data[j-1] != ' ':
						b.WriteByte(' ')
					}
				}

				id = b.Bytes()
			} else {
				id = data[1:txtE]
				altContentConsidered = true
			}
		} else {
			id = data[linkB:linkE]
		}

		// find the reference with matching id
		lr, ok := p.getRef(string(id))
		if !ok {
			return 0, nil
		}

		// keep link and title from reference
		linkID = id
		link = lr.link
		title = lr.title
		if altContentConsidered {
			altContent = lr.text
		}
		i++

	// shortcut reference style link or reference or inline footnote
	default:
		var id []byte

		// craft the id
		if textHasNl {
			var b bytes.Buffer

			for j := 1; j < txtE; j++ {
				switch {
				case data[j] != '\n':
					b.WriteByte(data[j])
				case data[j-1] != ' ':
					b.WriteByte(' ')
				}
			}

			id = b.Bytes()
		} else {
			if t == linkDeferredFootnote {
				id = data[2:txtE] // get rid of the ^
			} else {
				id = data[1:txtE]
			}
		}

		footnoteNode = &ast.ListItem{}
		if t == linkInlineFootnote {
			// create a new reference
			noteID = len(p.notes) + 1

			var fragment []byte
			if len(id) > 0 {
				if len(id) < 16 {
					fragment = make([]byte, len(id))
				} else {
					fragment = make([]byte, 16)
				}
				copy(fragment, slugify(id))
			} else {
				fragment = append([]byte("footnote-"), []byte(strconv.Itoa(noteID))...)
			}

			ref := &reference{
				noteID:   noteID,
				hasBlock: false,
				link:     fragment,
				title:    id,
				footnote: footnoteNode,
			}

			p.notes = append(p.notes, ref)
			p.refsRecord[string(ref.link)] = struct{}{}

			link = ref.link
			title = ref.title
		} else {
			// find the reference with matching id
			lr, ok := p.getRef(string(id))
			if !ok {
				return 0, nil
			}

			if t == linkDeferredFootnote && !p.isFootnote(lr) {
				lr.noteID = len(p.notes) + 1
				lr.footnote = footnoteNode
				p.notes = append(p.notes, lr)
				p.refsRecord[string(lr.link)] = struct{}{}
			}

			// keep link and title from reference
			link = lr.link
			// if inline footnote, title == footnote contents
			title = lr.title
			noteID = lr.noteID
			if len(lr.text) > 0 {
				altContent = lr.text
			}
		}

		// rewind the whitespace
		i = txtE + 1
	}

	var uLink []byte
	if t == linkNormal || t == linkImg {
		if len(link) > 0 {
			var uLinkBuf bytes.Buffer
			unescapeText(&uLinkBuf, link)
			uLink = uLinkBuf.Bytes()
		}

		// links need something to click on and somewhere to go
		if len(uLink) == 0 || (t == linkNormal && txtE <= 1) {
			return 0, nil
		}
	}

	// call the relevant rendering function
	switch t {
	case linkNormal:
		link := &ast.Link{
			Destination: normalizeURI(uLink),
			Title:       title,
			DeferredID:  linkID,
		}
		if len(altContent) > 0 {
			ast.AppendChild(link, newTextNode(altContent))
		} else {
			// links cannot contain other links, so turn off link parsing
			// temporarily and recurse
			insideLink := p.insideLink
			p.insideLink = true
			p.Inline(link, data[1:txtE])
			p.insideLink = insideLink
		}
		return i, link

	case linkImg:
		image := &ast.Image{
			Destination: uLink,
			Title:       title,
		}
		ast.AppendChild(image, newTextNode(data[1:txtE]))
		return i + 1, image

	case linkInlineFootnote, linkDeferredFootnote:
		link := &ast.Link{
			Destination: link,
			Title:       title,
			NoteID:      noteID,
			Footnote:    footnoteNode,
		}
		if t == linkDeferredFootnote {
			link.DeferredID = data[2:txtE]
		}
		if t == linkInlineFootnote {
			i++
		}
		return i, link

	default:
		return 0, nil
	}
}

func (p *Parser) inlineHTMLComment(data []byte) int {
	if len(data) < 5 {
		return 0
	}
	if data[0] != '<' || data[1] != '!' || data[2] != '-' || data[3] != '-' {
		return 0
	}
	i := 5
	// scan for an end-of-comment marker, across lines if necessary
	for i < len(data) && !(data[i-2] == '-' && data[i-1] == '-' && data[i] == '>') {
		i++
	}
	// no end-of-comment marker
	if i >= len(data) {
		return 0
	}
	return i + 1
}

func stripMailto(link []byte) []byte {
	if bytes.HasPrefix(link, []byte("mailto://")) {
		return link[9:]
	} else if bytes.HasPrefix(link, []byte("mailto:")) {
		return link[7:]
	} else {
		return link
	}
}

// autolinkType specifies a kind of autolink that gets detected.
type autolinkType int

// These are the possible flag values for the autolink renderer.
const (
	notAutolink autolinkType = iota
	normalAutolink
	emailAutolink
)

// '<' when tags or autolinks are allowed
func leftAngle(p *Parser, data []byte, offset int) (int, ast.Node) {
	data = data[offset:]

	if p.extensions&Mmark != 0 {
		id, consumed := IsCallout(data)
		if consumed > 0 {
			node := &ast.Callout{}
			node.ID = id
			return consumed, node
		}
	}

	altype, end := tagLength(data)
	if size := p.inlineHTMLComment(data); size > 0 {
		end = size
	}
	if end <= 2 {
		return end, nil
	}
	if altype == notAutolink {
		htmlTag := &ast.HTMLSpan{}
		htmlTag.Literal = data[:end]
		return end, htmlTag
	}

	var uLink bytes.Buffer
	unescapeText(&uLink, data[1:end+1-2])
	if uLink.Len() <= 0 {
		return end, nil
	}
	link := uLink.Bytes()
	node := &ast.Link{
		Destination: link,
	}
	if altype == emailAutolink {
		node.Destination = append([]byte("mailto:"), link...)
	}
	ast.AppendChild(node, newTextNode(stripMailto(link)))
	return end, node
}

// '\\' backslash escape
var escapeChars = []byte("\\`*_{}[]()#+-.!:|&<>~^")

func escape(p *Parser, data []byte, offset int) (int, ast.Node) {
	data = data[offset:]

	if len(data) <= 1 {
		return 2, nil
	}

	if p.extensions&NonBlockingSpace != 0 && data[1] == ' ' {
		return 2, &ast.NonBlockingSpace{}
	}

	if p.extensions&BackslashLineBreak != 0 && data[1] == '\n' {
		return 2, &ast.Hardbreak{}
	}

	if bytes.IndexByte(escapeChars, data[1]) < 0 {
		return 0, nil
	}

	return 2, newTextNode(data[1:2])
}

func unescapeText(ob *bytes.Buffer, src []byte) {
	i := 0
	for i < len(src) {
		org := i
		for i < len(src) && src[i] != '\\' {
			i++
		}

		if i > org {
			ob.Write(src[org:i])
		}

		if i+1 >= len(src) {
			break
		}

		ob.WriteByte(src[i+1])
		i += 2
	}
}

// '&' escaped when it doesn't belong to an entity
// valid entities are assumed to be anything matching &#?[A-Za-z0-9]+;
func entity(p *Parser, data []byte, offset int) (int, ast.Node) {
	data = data[offset:]

	end := skipCharN(data, 1, '#', 1)
	end = skipAlnum(data, end)

	if end < len(data) && data[end] == ';' {
		end++ // real entity
	} else {
		return 0, nil // lone '&'
	}

	ent := data[:end]
	// undo & escaping or it will be converted to &amp; by another
	// escaper in the renderer
	if bytes.Equal(ent, []byte("&")) {
		ent = []byte{'&'}
	}

	return end, newTextNode(ent)
}

func linkEndsWithEntity(data []byte, linkEnd int) bool {
	entityRanges := htmlEntityRe.FindAllIndex(data[:linkEnd], -1)
	return entityRanges != nil && entityRanges[len(entityRanges)-1][1] == linkEnd
}

// hasPrefixCaseInsensitive is a custom implementation of
//     strings.HasPrefix(strings.ToLower(s), prefix)
// we rolled our own because ToLower pulls in a huge machinery of lowercasing
// anything from Unicode and that's very slow. Since this func will only be
// used on ASCII protocol prefixes, we can take shortcuts.
func hasPrefixCaseInsensitive(s, prefix []byte) bool {
	if len(s) < len(prefix) {
		return false
	}
	delta := byte('a' - 'A')
	for i, b := range prefix {
		if b != s[i] && b != s[i]+delta {
			return false
		}
	}
	return true
}

var protocolPrefixes = [][]byte{
	[]byte("http://"),
	[]byte("https://"),
	[]byte("ftp://"),
	[]byte("file://"),
	[]byte("mailto:"),
}

const shortestPrefix = 6 // len("ftp://"), the shortest of the above

func maybeAutoLink(p *Parser, data []byte, offset int) (int, ast.Node) {
	// quick check to rule out most false hits
	if p.insideLink || len(data) < offset+shortestPrefix {
		return 0, nil
	}
	for _, prefix := range protocolPrefixes {
		endOfHead := offset + 8 // 8 is the len() of the longest prefix
		if endOfHead > len(data) {
			endOfHead = len(data)
		}
		if hasPrefixCaseInsensitive(data[offset:endOfHead], prefix) {
			return autoLink(p, data, offset)
		}
	}
	return 0, nil
}

func autoLink(p *Parser, data []byte, offset int) (int, ast.Node) {
	// Now a more expensive check to see if we're not inside an anchor element
	anchorStart := offset
	offsetFromAnchor := 0
	for anchorStart > 0 && data[anchorStart] != '<' {
		anchorStart--
		offsetFromAnchor++
	}

	anchorStr := anchorRe.Find(data[anchorStart:])
	if anchorStr != nil {
		anchorClose := &ast.HTMLSpan{}
		anchorClose.Literal = anchorStr[offsetFromAnchor:]
		return len(anchorStr) - offsetFromAnchor, anchorClose
	}

	// scan backward for a word boundary
	rewind := 0
	for offset-rewind > 0 && rewind <= 7 && isLetter(data[offset-rewind-1]) {
		rewind++
	}
	if rewind > 6 { // longest supported protocol is "mailto" which has 6 letters
		return 0, nil
	}

	origData := data
	data = data[offset-rewind:]

	if !isSafeLink(data) {
		return 0, nil
	}

	linkEnd := 0
	for linkEnd < len(data) && !isEndOfLink(data[linkEnd]) {
		linkEnd++
	}

	// Skip punctuation at the end of the link
	if (data[linkEnd-1] == '.' || data[linkEnd-1] == ',') && data[linkEnd-2] != '\\' {
		linkEnd--
	}

	// But don't skip semicolon if it's a part of escaped entity:
	if data[linkEnd-1] == ';' && data[linkEnd-2] != '\\' && !linkEndsWithEntity(data, linkEnd) {
		linkEnd--
	}

	// See if the link finishes with a punctuation sign that can be closed.
	var copen byte
	switch data[linkEnd-1] {
	case '"':
		copen = '"'
	case '\'':
		copen = '\''
	case ')':
		copen = '('
	case ']':
		copen = '['
	case '}':
		copen = '{'
	default:
		copen = 0
	}

	if copen != 0 {
		bufEnd := offset - rewind + linkEnd - 2

		openDelim := 1

		/* Try to close the final punctuation sign in this same line;
		 * if we managed to close it outside of the URL, that means that it's
		 * not part of the URL. If it closes inside the URL, that means it
		 * is part of the URL.
		 *
		 * Examples:
		 *
		 *      foo http://www.pokemon.com/Pikachu_(Electric) bar
		 *              => http://www.pokemon.com/Pikachu_(Electric)
		 *
		 *      foo (http://www.pokemon.com/Pikachu_(Electric)) bar
		 *              => http://www.pokemon.com/Pikachu_(Electric)
		 *
		 *      foo http://www.pokemon.com/Pikachu_(Electric)) bar
		 *              => http://www.pokemon.com/Pikachu_(Electric))
		 *
		 *      (foo http://www.pokemon.com/Pikachu_(Electric)) bar
		 *              => foo http://www.pokemon.com/Pikachu_(Electric)
		 */

		for bufEnd >= 0 && origData[bufEnd] != '\n' && openDelim != 0 {
			if origData[bufEnd] == data[linkEnd-1] {
				openDelim++
			}

			if origData[bufEnd] == copen {
				openDelim--
			}

			bufEnd--
		}

		if openDelim == 0 {
			linkEnd--
		}
	}

	var uLink bytes.Buffer
	unescapeText(&uLink, data[:linkEnd])

	if uLink.Len() > 0 {
		node := &ast.Link{
			Destination: uLink.Bytes(),
		}
		ast.AppendChild(node, newTextNode(uLink.Bytes()))
		return linkEnd, node
	}

	return linkEnd, nil
}

func isEndOfLink(char byte) bool {
	return isSpace(char) || char == '<'
}

var validUris = [][]byte{[]byte("http://"), []byte("https://"), []byte("ftp://"), []byte("mailto://")}
var validPaths = [][]byte{[]byte("/"), []byte("./"), []byte("../")}

func isSafeLink(link []byte) bool {
	nLink := len(link)
	for _, path := range validPaths {
		nPath := len(path)
		linkPrefix := link[:nPath]
		if nLink >= nPath && bytes.Equal(linkPrefix, path) {
			if nLink == nPath {
				return true
			} else if isAlnum(link[nPath]) {
				return true
			}
		}
	}

	for _, prefix := range validUris {
		// TODO: handle unicode here
		// case-insensitive prefix test
		nPrefix := len(prefix)
		if nLink > nPrefix {
			linkPrefix := bytes.ToLower(link[:nPrefix])
			if bytes.Equal(linkPrefix, prefix) && isAlnum(link[nPrefix]) {
				return true
			}
		}
	}

	return false
}

// return the length of the given tag, or 0 is it's not valid
func tagLength(data []byte) (autolink autolinkType, end int) {
	var i, j int

	// a valid tag can't be shorter than 3 chars
	if len(data) < 3 {
		return notAutolink, 0
	}

	// begins with a '<' optionally followed by '/', followed by letter or number
	if data[0] != '<' {
		return notAutolink, 0
	}
	if data[1] == '/' {
		i = 2
	} else {
		i = 1
	}

	if !isAlnum(data[i]) {
		return notAutolink, 0
	}

	// scheme test
	autolink = notAutolink

	// try to find the beginning of an URI
	for i < len(data) && (isAlnum(data[i]) || data[i] == '.' || data[i] == '+' || data[i] == '-') {
		i++
	}

	if i > 1 && i < len(data) && data[i] == '@' {
		if j = isMailtoAutoLink(data[i:]); j != 0 {
			return emailAutolink, i + j
		}
	}

	if i > 2 && i < len(data) && data[i] == ':' {
		autolink = normalAutolink
		i++
	}

	// complete autolink test: no whitespace or ' or "
	switch {
	case i >= len(data):
		autolink = notAutolink
	case autolink != notAutolink:
		j = i

		for i < len(data) {
			if data[i] == '\\' {
				i += 2
			} else if data[i] == '>' || data[i] == '\'' || data[i] == '"' || isSpace(data[i]) {
				break
			} else {
				i++
			}

		}

		if i >= len(data) {
			return autolink, 0
		}
		if i > j && data[i] == '>' {
			return autolink, i + 1
		}

		// one of the forbidden chars has been found
		autolink = notAutolink
	}
	i += bytes.IndexByte(data[i:], '>')
	if i < 0 {
		return autolink, 0
	}
	return autolink, i + 1
}

// look for the address part of a mail autolink and '>'
// this is less strict than the original markdown e-mail address matching
func isMailtoAutoLink(data []byte) int {
	nb := 0

	// address is assumed to be: [-@._a-zA-Z0-9]+ with exactly one '@'
	for i, c := range data {
		if isAlnum(c) {
			continue
		}

		switch c {
		case '@':
			nb++

		case '-', '.', '_':
			break

		case '>':
			if nb == 1 {
				return i + 1
			}
			return 0
		default:
			return 0
		}
	}

	return 0
}

// look for the next emph char, skipping other constructs
func helperFindEmphChar(data []byte, c byte) int {
	i := 0

	for i < len(data) {
		for i < len(data) && data[i] != c && data[i] != '`' && data[i] != '[' {
			i++
		}
		if i >= len(data) {
			return 0
		}
		// do not count escaped chars
		if i != 0 && data[i-1] == '\\' {
			i++
			continue
		}
		if data[i] == c {
			return i
		}

		if data[i] == '`' {
			// skip a code span
			tmpI := 0
			i++
			for i < len(data) && data[i] != '`' {
				if tmpI == 0 && data[i] == c {
					tmpI = i
				}
				i++
			}
			if i >= len(data) {
				return tmpI
			}
			i++
		} else if data[i] == '[' {
			// skip a link
			tmpI := 0
			i++
			for i < len(data) && data[i] != ']' {
				if tmpI == 0 && data[i] == c {
					tmpI = i
				}
				i++
			}
			i++
			for i < len(data) && (data[i] == ' ' || data[i] == '\n') {
				i++
			}
			if i >= len(data) {
				return tmpI
			}
			if data[i] != '[' && data[i] != '(' { // not a link
				if tmpI > 0 {
					return tmpI
				}
				continue
			}
			cc := data[i]
			i++
			for i < len(data) && data[i] != cc {
				if tmpI == 0 && data[i] == c {
					return i
				}
				i++
			}
			if i >= len(data) {
				return tmpI
			}
			i++
		}
	}
	return 0
}

func helperEmphasis(p *Parser, data []byte, c byte) (int, ast.Node) {
	i := 0

	// skip one symbol if coming from emph3
	if len(data) > 1 && data[0] == c && data[1] == c {
		i = 1
	}

	for i < len(data) {
		length := helperFindEmphChar(data[i:], c)
		if length == 0 {
			return 0, nil
		}
		i += length
		if i >= len(data) {
			return 0, nil
		}

		if i+1 < len(data) && data[i+1] == c {
			i++
			continue
		}

		if data[i] == c && !isSpace(data[i-1]) {

			if p.extensions&NoIntraEmphasis != 0 {
				if !(i+1 == len(data) || isSpace(data[i+1]) || isPunctuation(data[i+1])) {
					continue
				}
			}

			emph := &ast.Emph{}
			p.Inline(emph, data[:i])
			return i + 1, emph
		}
	}

	return 0, nil
}

func helperDoubleEmphasis(p *Parser, data []byte, c byte) (int, ast.Node) {
	i := 0

	for i < len(data) {
		length := helperFindEmphChar(data[i:], c)
		if length == 0 {
			return 0, nil
		}
		i += length

		if i+1 < len(data) && data[i] == c && data[i+1] == c && i > 0 && !isSpace(data[i-1]) {
			var node ast.Node = &ast.Strong{}
			if c == '~' {
				node = &ast.Del{}
			}
			p.Inline(node, data[:i])
			return i + 2, node
		}
		i++
	}
	return 0, nil
}

func helperTripleEmphasis(p *Parser, data []byte, offset int, c byte) (int, ast.Node) {
	i := 0
	origData := data
	data = data[offset:]

	for i < len(data) {
		length := helperFindEmphChar(data[i:], c)
		if length == 0 {
			return 0, nil
		}
		i += length

		// skip whitespace preceded symbols
		if data[i] != c || isSpace(data[i-1]) {
			continue
		}

		switch {
		case i+2 < len(data) && data[i+1] == c && data[i+2] == c:
			// triple symbol found
			strong := &ast.Strong{}
			em := &ast.Emph{}
			ast.AppendChild(strong, em)
			p.Inline(em, data[:i])
			return i + 3, strong
		case i+1 < len(data) && data[i+1] == c:
			// double symbol found, hand over to emph1
			length, node := helperEmphasis(p, origData[offset-2:], c)
			if length == 0 {
				return 0, nil
			}
			return length - 2, node
		default:
			// single symbol found, hand over to emph2
			length, node := helperDoubleEmphasis(p, origData[offset-1:], c)
			if length == 0 {
				return 0, nil
			}
			return length - 1, node
		}
	}
	return 0, nil
}

// math handle inline math wrapped with '$'
func math(p *Parser, data []byte, offset int) (int, ast.Node) {
	data = data[offset:]

	// too short, or block math
	if len(data) <= 2 || data[1] == '$' {
		return 0, nil
	}

	// find next '$'
	var end int
	for end = 1; end < len(data) && data[end] != '$'; end++ {
	}

	// $ not match
	if end == len(data) {
		return 0, nil
	}

	// create inline math node
	math := &ast.Math{}
	math.Literal = data[1:end]
	return end + 1, math
}

func newTextNode(d []byte) *ast.Text {
	return &ast.Text{ast.Leaf{Literal: d}}
}

func normalizeURI(s []byte) []byte {
	return s // TODO: implement
}


text:
<?php

/**
 * @namespace
 */
namespace Bluz\View\Helper;

use Bluz\View\View;

return

/**
 * @author ErgallM
 *
 * @param string $text
 * @param string|array $href
 * @param array $attributes HTML attributes
 * @return \Closure
 */
function ($text, $href, array $attributes = []) {
    /** @var View $this */
    // if href is settings for url helper
    if (is_array($href)) {
        $href = call_user_func_array(array($this, 'url'), $href);
    }

    // href can be null, if access is denied
    if (null === $href) return '';

    if ($href == $this->getApplication()->getRequest()->getRequestUri()) {
        if (isset($attributes['class'])) {
            $attributes['class'] .= ' on';
        } else {
            $attributes['class'] = 'on';
        }
    }
    $attrs = [];

    foreach ($attributes as $attr => $value) {
        $attrs[] = $attr . '="' . $value . '"';
    }

    return '' . $this->__($text) . '';
};


text:
import React from 'react'
import {connect} from 'react-redux'
import agent from '../shared/agent'
import Profile from '../shared/containers/profile'

class ProfilePage extends React.Component {
  componentWillMount() {
    this.props.onLoad(
      Promise.all([
        agent.Profile.get(this.props.match.params.username),
        agent.Articles.byAuthor(this.props.match.params.username),
      ]),
    )
  }

  componentWillUnmount() {
    this.props.onUnload()
  }

  render() {
    return <Profile profile={this.props.profile} activeTab="mine" />
  }
}

function mapStateToProps(state) {
  return {
    profile: state.profile,
  }
}

function mapDispatchToProps(dispatch) {
  return {
    onLoad: payload => dispatch({type: 'PROFILE_PAGE_LOADED', payload}),
    onUnload: () => dispatch({type: 'PROFILE_PAGE_UNLOADED'}),
  }
}

export default connect(mapStateToProps, mapDispatchToProps)(ProfilePage)


text:
import { createAction } from 'redux-actions';

import {
	HEADER_UPDATE_CONTENT,
} from '../constants/ActionTypes';

const UpdateContent = createAction(HEADER_UPDATE_CONTENT);

const ActionHeader = {
	UpdateContent: UpdateContent
};

export { ActionHeader }


text:
@interface SpeechManager : NSObject

+(instancetype)shareInstance;
-(void)setRole:(Role)aRole;
-(void)TouchSpeak;
-(void)DeadSpeak;
@end


text:
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateClassifiedCategoriesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('classified_categories',
            function (Blueprint $table)
            {
                $table->increments('id');
                $table->string('name', 40);
                $table->string('slug', 40);
                $table->timestamps();
                $table->softDeletes();

                $table->index(['name', 'slug']);
            }
        );
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('classified_categories');
    }
}


text:
package org.lwjgl.opengl;

/**
 * Native bindings to the GLX_ARB_create_context_profile extension.
 *
 *
Adds an attribute to {@link GLXARBCreateContext}, specifying the GL profile requested for a context of OpenGL 3.2 or later.

 *
 *
Requires {@link GLX14 GLX 1.4} and {@link GL32 OpenGL 3.2}.

 */
public final class GLXARBCreateContextProfile {

    /** Accepted as an attribute name in {@code attrib_list}. */
    public static final int GLX_CONTEXT_PROFILE_MASK_ARB = 0x9126;

    /** Accepted as bits in the attribute value for {@link #GLX_CONTEXT_PROFILE_MASK_ARB CONTEXT_PROFILE_MASK_ARB} in {@code attrib_list}. */
    public static final int
        GLX_CONTEXT_CORE_PROFILE_BIT_ARB          = 0x1,
        GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB = 0x2;

    /** GLX error. */
    public static final int GLXBadProfileARB = 13;

    private GLXARBCreateContextProfile() {}

}


text:
import context  from './context';
import * as STP from './setup';
import Reddit   from './reddit';
const ctxt = context();
const { expectjs, warn } = ctxt;

const state = {};
const S     = state;

describe("Market",function(){
    this.timeout(15000);

    before(() => {
	S.stp  = STP.commonSetup(ctxt);
    });

    describe("updateVendorRoot",function() {

	before(() => {
	    S.mkt = S.stp.cmkt.market({state : S.stp.marketState});
	    return S.mkt.write()
		.then(() => S.mkt.deploy())
		.then(function(){
		    S.mktHistory = {
			postDeploy           : false,
			postAddVendor        : false,
			postUpdateVendorRoot : false
		    };
		    S.mktHistory.postDeploy = S.mkt.syncState();
		    S.vnd = S.stp.cmkt.vendor({
			state        : S.stp.vendorState
		    });
		    S.oldMKTNode = S.mkt.node.multihash().toString('hex');
		    return S.vnd.write();
		})
		.then(() => S.vnd.deploy())
		.then(() => S.mkt.addVendor({vendor : S.vnd}))
		.then(() => {
		    S.mktHistory.postAddVendor = S.mkt.syncState();
		    S.subn = S.vnd.Subn({state : S.stp.subnState});
		    return S.subn.write();
		})
	    	.then(() => S.subn.deploy({price : S.stp.contractPrice}))
		.then(() => S.vnd.addSubscription({subscription : S.subn}))
		.then(() => S.mkt.updateVendorRoot({vendor : S.vnd}))
		.then(() => {
		    S.mktHistory.postUpdateVendorRoot = S.mkt.syncState();
		}).catch(warn);
	});

	it("market retains same number of links",() => {
	    expectjs(S.mkt.node.links).to.have.length(1);
	});

	it("market node changes",() => {
	    expectjs(S.mkt.node.multihash().toString('hex')).to.not.be(S.oldMKTNode);
	});

	// deploy has vendor-rights
	it("postDeploy contract ipfsAddress and local ipfsAddress are in-sync",() => {
	    expectjs(S.mktHistory.postDeploy).to.be(true);
	});

	// addVendor has vendor-rights
	it("postAddVendor contract ipfsAddress and localIPFSAddress are in-sync",() => {
	    expectjs(S.mktHistory.postAddVendor).to.be(true);
	});

	// updateVendorRoot does not have vendor-rights, TODO : if profile and market owner are the
	// same, then update both automatically
	it("contract ipfsAddress still equals oldMarketIPFSAddress",() => {
	    expectjs(S.mktHistory.postUpdateVendorRoot).to.be(false);
	});

	describe("getVendors",() => {

	    before(() => {
		return S.mkt.getVendors().then(_vendors => {
		    S.vendors = _vendors;
		}).catch(console.warn);
	    });

	    it("returns vendors",() => {
		expectjs(S.vendors.length).to.be(1);
		expectjs(S.vendors[0].state).to.eql(S.vnd.state);
	    });

	    it("sets vendorCache.vendors",() => {
		expectjs(S.mkt.vendorCache.vendors).to.be(S.vendors);
	    });

	    it("sets vendorCache.marketHash",() => {
		expectjs(S.mkt.vendorCache.marketHash).to.be(S.mkt.node.multihash().toString('hex'));
	    });

	    it("runs really fast with the cache",function(){
		this.timeout(20);
		return S.mkt.getVendors().then(_vendors => {
		    expectjs(S.vendors[0].state).to.eql(_vendors[0].state);
		}).catch(console.warn);
	    });

	});

	describe("updateMarketRoot",() => {

	    before(() => {
		return S.mkt.updateMarketRoot();
	    });

	    it("local ipfsAddress and contract ipfsAddress match",() => {
		expectjs(S.mkt.syncState()).to.be(true);
	    });

	});

	describe("toMarketItem",() => {

	    let marketItem;
	    before(() => {
		marketItem = S.mkt.toMarketItem();
	    });

	    it("has name field",() => {
		expectjs(marketItem.name).to.be(S.mkt.state.name);
		expectjs(S.mkt.state.name.length).to.be.greaterThan(0);
	    });

	    it("has ownerAddress field",() => {
		expectjs(marketItem.ownerAddress).to.be(S.mkt.state.ownerAddress);
		expectjs(S.mkt.state.ownerAddress.length).to.be.greaterThan(0);
	    });

	    it("has marketHash",() => {
		expectjs(marketItem.marketHash).to.be(S.mkt.node.multihash().toString('hex'));
	    });

	    it("has source",() => {
		expectjs(marketItem.source).to.be(S.mkt.state.source);
		expectjs(marketItem.source.length).to.be.greaterThan(0);
	    });

	    it("has readMe",() => {
		expectjs(marketItem.readMe).to.be(S.mkt.state.readMe);
		expectjs(marketItem.readMe.length).to.be.greaterThan(0);
	    });

	    it("has externalLink",() => {
		expectjs(marketItem.externalLink).to.be(S.mkt.state.externalLink);
		expectjs(marketItem.externalLink.length).to.be.greaterThan(0);
	    });

	});

    });

    describe("fromMultihash",() => {

	before(() => {
	    S.mkt = S.stp.cmkt.market({state : S.stp.marketState,ownerAddress : S.stp.ownerAddress});
	    return S.mkt.write()
		.then(function(_node){
		    S.writeNode = _node;
		    return S.stp.cmkt.marketFromMultihash(S.writeNode.multihash());
		})
		.then(function(_readMkt){
		    S.readMkt = _readMkt;
		}).catch(warn);
	});

	it("has ownerAddress",() => {
	    expectjs(S.mkt.state.ownerAddress).to.be(S.readMkt.state.ownerAddress);
	    expectjs(S.readMkt.state.ownerAddress).to.be.a('string');
	    expectjs(S.readMkt.state.ownerAddress.length).to.be.greaterThan(0);
	});

	it("has name",() => {
	    expectjs(S.mkt.state.name).to.be(S.readMkt.state.name);
	    expectjs(S.readMkt.state.name).to.be.a('string');
	});

	it("has node",() => {
	    expectjs(S.mkt).to.have.key('node');
	    expectjs(S.readMkt.node.multihash()).to.be.a(Buffer);
	});

	it("has instance",() => {
	    expectjs(S.readMkt).to.have.key('instance');
	    expectjs(S.readMkt.instance).to.have.key('address');
	});

    });

    describe("fromEthAddress",() => {

	before(() => {
	    return ctxt.Market.fromEthAddress({
		web3 : S.stp.web3,
		ipfs : S.stp.ipfs,
		ethAddress  : S.mkt.instance.address
	    }).then(mkt => {
		S.ethAddressMkt = mkt;
	    }).catch(console.warn);
	});

	it("creates an object of type Market",() => {
	    expectjs(S.ethAddressMkt).to.be.a(ctxt.Market);
	});

    });

});


text:
import random, socket, sys
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

MAX = 65535
PORT = 1060

if 2 <= len(sys.argv) <= 3 and sys.argv[1] == 'server':
    interface = sys.argv[2] if len(sys.argv) > 2 else ''
    s.bind((interface, PORT))
    print 'Listening at', s.getsockname()
    while True:
        data, address = s.recvfrom(MAX)
        if random.randint(0, 1):
            print 'The client at', address, 'says:', repr(data)
            s.sendto('Your data was %d bytes' % len(data), address)
        else:
            print 'Pretending to drop packet from', address

elif len(sys.argv) == 3 and sys.argv[1] == 'client':
    hostname = sys.argv[2]
    s.connect((hostname, PORT))
    print 'Client socket name is', s.getsockname()
    delay = 0.1
    while True:
        s.send('This is another message')
        print 'Waiting up to', delay, 'seconds for a reply'
        s.settimeout(delay)
        try:
            data = s.recv(MAX)
        except socket.timeout:
            delay *= 2  # wait even longer for the next request
            if delay > 2.0:
                raise RuntimeError('I think the server is down')
        else:
            break   # we are done, and can stop looping

    print 'The server says', repr(data)

else:
    print >>sys.stderr, 'usage: udp_remote.py server [ <interface> ]'
    print >>sys.stderr, '   or: udp_remote.py client <host>'
    sys.exit(2)


text: pub use anyhow::{bail, ensure, Context as _, Result};


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

namespace Kuria\Dom;

class XmlDocumentTest extends DomContainerTest
{
    protected function initializeOptions(): array
    {
        return [
            'encoded_string_element_query' => '/list/item[@id="1"]/alias',
            'context_node_query' => '/list/item[@id="1"]',
            'query' => '//alias',
            'query.expected_results' => 3,
            'context_query' => './alias',
            'context_query.expected_results' => 2,
            'remove_query' => '/list/item[@id="2"]',
            'prepend_child_target_query' => '/list',
            'insert_after_target_query' => '/list/item[@id="1"]',
            'remove_all_target_query' => '/list',
        ];
    }

    function testShouldEscape()
    {
        $dom = $this->createContainer();

        $this->assertSame(
            '<item url="http://example.com/?foo=bar&amp;lorem=ipsum">Test</item>',
            $dom->escape('<item url="http://example.com/?foo=bar&lorem=ipsum">Test</item>')
        );
    }

    function testShouldGetRoot()
    {
        /** @var XmlFragment $dom */
        $dom = $this->getContainer();

        $this->assertInstanceOf('DOMElement', $dom->getRoot());
        $this->assertSame('list', $dom->getRoot()->tagName);
    }

    function testShouldThrowExceptionOnMissingRoot()
    {
        /** @var XmlFragment $dom */
        $dom = $this->createContainer();
        $dom->loadEmpty();

        $this->expectException(\RuntimeException::class);
        $this->expectExceptionMessage('The root element was not found');

        $dom->getRoot();
    }

    protected function assertValidMinimalOutput(string $output, string $encoding = DomContainer::INTERNAL_ENCODING): void
    {
        $this->assertRegExp(sprintf('{<\?xml[^>]*encoding="%s"}i', preg_quote($encoding)), $output);
    }

    protected function assertValidSampleOutput(string $output, string $encoding = DomContainer::INTERNAL_ENCODING): void
    {
        $this->assertContains('<list>', $output, '', true);
        $this->assertContains('<item id="1">', $output, '', true);
        $this->assertContains('<item id="2">', $output, '', true);
        $this->assertContains('<alias>', $output, '', true);
        $this->assertContains('<position>', $output, '', true);
    }

    protected function assertValidEmptyOutput(string $output, string $encoding = DomContainer::INTERNAL_ENCODING): void
    {
        $this->assertRegExp('~^<\?xml[^>]*\?>\s*$~', $output);
    }

    protected function assertValidOutputWithContextNode(string $output, string $encoding = DomContainer::INTERNAL_ENCODING): void
    {
        $this->assertNotContains('<?xml', $output, '', true);
        $this->assertNotContains('<list>', $output, '', true);
        $this->assertNotContains('<item id="2">', $output, '', true);
        $this->assertContains('<item id="1">', $output, '', true);
        $this->assertContains('<alias>', $output, '', true);
        $this->assertContains('<position>', $output, '', true);
    }

    protected function assertValidOutputWithContextNodeChildrenOnly(string $output, string $encoding = DomContainer::INTERNAL_ENCODING): void
    {
        $this->assertNotContains('<?xml', $output, '', true);
        $this->assertNotContains('<list>', $output, '', true);
        $this->assertNotContains('<item id="1">', $output, '', true);
        $this->assertNotContains('<item id="2">', $output, '', true);
        $this->assertContains('<alias>', $output, '', true);
        $this->assertContains('<position>', $output, '', true);
    }

    protected function createContainer()
    {
        return new XmlDocument();
    }

    protected function getSampleContent(string $encoding = DomContainer::INTERNAL_ENCODING): string
    {
        return <<<XML
<?xml version="1.0" encoding="{$encoding}"?>
<list>
    <item id="1">
        <alias>{$this->getEncodedTestString($encoding)}</alias>
        <alias>Lorem</alias>
        <position>3</position>
    </item>
    <item id="2">
        <alias>Foo</alias>
        <position>3</position>
    </item>
</list>
XML;
    }

    protected function getInvalidSampleContent(string $encoding = DomContainer::INTERNAL_ENCODING): string
    {
        return <<<XML
<?xml version="1.0" encoding="{$encoding}"?>
<list>
    <item>
        <alias>{$this->getEncodedTestString($encoding)}</alias <!-- the syntax error is here -->
        <position>3</position>
    </item>
</list>
XML;
    }
}


text:
package org.tanrabad.survey.repository;

import android.support.annotation.NonNull;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.tanrabad.survey.entity.lookup.Subdistrict;

import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class InMemorySubdistrictRepositoryTest {

    private InMemorySubdistrictRepository subdistrictRepository = InMemorySubdistrictRepository.getInstance();

    @Before
    public void setUp() throws Exception {
        subdistrictRepository.save(stubSubdistrict());
    }

    protected Subdistrict stubSubdistrict() {
        Subdistrict subdistrict = new Subdistrict();
        subdistrict.setCode("100101");
        subdistrict.setName("พระบรมมหาราชวัง");
        subdistrict.setDistrictCode("1001");
        return subdistrict;
    }

    @After
    public void tearDown() {
        subdistrictRepository.delete(stubSubdistrict());
    }

    @Test
    public void testEveryCallGetInstanceMustGotSameInstance() throws Exception {
        assertEquals(subdistrictRepository, InMemorySubdistrictRepository.getInstance());
    }

    @Test
    public void testFindBySubdistrictCode() throws Exception {
        assertEquals(stubSubdistrict(), subdistrictRepository.findByCode(stubSubdistrict().getCode()));
        assertEquals(null, subdistrictRepository.findByCode("777000"));
    }

    @Test
    public void testUpdate() throws Exception {
        Subdistrict subdistrictNewName = stubSubdistrict();
        subdistrictNewName.setName("บางเขน");
        subdistrictRepository.update(subdistrictNewName);
        assertEquals(subdistrictNewName, subdistrictRepository.findByCode(stubSubdistrict().getCode()));
    }

    @Test
    public void testDelete() throws Exception {
        subdistrictRepository.save(stubOtherSubdistrict());
        assertTrue(subdistrictRepository.delete(stubOtherSubdistrict()));
    }

    @NonNull
    protected Subdistrict stubOtherSubdistrict() {
        Subdistrict subdistrict = new Subdistrict();
        subdistrict.setCode("401010");
        return subdistrict;
    }

    @Test(expected = InMemorySubdistrictRepository.SubdistrictRepositoryException.class)
    public void testDeleteNotExistSubdistrict() throws Exception {
        assertFalse(subdistrictRepository.delete(stubOtherSubdistrict()));
    }

    @Test
    public void testFindByDistrictCode() throws Exception {
        List<Subdistrict> subdistricts = subdistrictRepository.findByDistrictCode("1001");
        assertEquals(1, subdistricts.size());
        assertTrue(subdistricts.contains(stubSubdistrict()));

        List<Subdistrict> emptySubdistrict = subdistrictRepository.findByDistrictCode("1000");
        assertTrue(emptySubdistrict.isEmpty());
    }
}


text:
require 'loggability'
require 'securerandom'

require 'arborist' unless defined?( Arborist )
require 'arborist/mixins'

# An observer subscription to node events.
class Arborist::Subscription
	extend Loggability
	include Arborist::HashUtilities

	# Loggability API -- log to the Arborist logger
	log_to :arborist

	### Instantiate a new Subscription object given an +event+ pattern
	### and event +criteria+.
	def initialize( event_type=nil, criteria={}, negative_criteria={}, &callback )
		@callback   = callback
		@event_type = event_type
		@criteria   = stringify_keys( criteria )
		@negative_criteria = stringify_keys( negative_criteria )

		self.check_callback

		@id         = self.generate_id
	end

	######
	public
	######

	# The callable that should be called when the subscription receives a matching event
	attr_reader :callback

	# A unique identifier for this subscription request.
	attr_reader :id

	# The Arborist event pattern that this subscription handles.
	attr_reader :event_type

	# Node selection attributes to require
	attr_reader :criteria

	# Node selection attributes to exclude
	attr_reader :negative_criteria

	### Add the given +criteria+ hash to the #negative_criteria.
	def exclude( criteria )
		criteria = stringify_keys( criteria )
		self.negative_criteria.merge!( criteria )
	end

	### Check to make sure the subscription will function as it's set up.
	def check_callback
		raise LocalJumpError, "requires a callback block" unless self.callback
	end

	### Publish any of the specified +events+ which match the subscription.
	def on_events( *events )
		events.flatten.each do |event|
			if self.interested_in?( event )
				self.log.debug "Calling %p for a %s event" % [ self.callback, event.type ]
				self.callback.call( self.id, event )
			end
		end
	end

	### Return a String representation of the object suitable for debugging.
	def inspect
		return "#<%p:%#x [%s] for %s events matching: %p %s-> %p>" % [
			self.class,
			self.object_id * 2,
			self.id,
			self.event_type,
			self.criteria,
			self.negative_criteria.empty? ? '' : "(but not #{self.negative_criteria.inspect}",
			self.callback,
		]
	end

	### Create an identifier for this subscription object.
	def generate_id
		return SecureRandom.uuid
	end

	### Returns +true+ if the receiver is interested in publishing the specified +event+.
	def interested_in?( event )
		self.log.debug "Testing %p against type = %p and criteria = %p but not %p" %
			[ event, self.event_type, self.criteria, self.negative_criteria ]
		rval = event.match( self )
		self.log.debug "  event %s match." % [ rval ? "did" : "did NOT" ]
		return rval
	end
	alias_method :is_interested_in?, :interested_in?

end # class Arborist::Subscription


text:
namespace enterprise_connectors {

// A BinaryUploadService::Request implementation that gets the content of a
// to-be-printed web page through a base::ReadOnlySharedMemoryRegion.
class PagePrintAnalysisRequest
    : public safe_browsing::BinaryUploadService::Request {
 public:
  PagePrintAnalysisRequest(
      const AnalysisSettings& analysis_settings,
      base::ReadOnlySharedMemoryRegion page,
      safe_browsing::BinaryUploadService::ContentAnalysisCallback callback);
  ~PagePrintAnalysisRequest() override;

  void GetRequestData(DataCallback callback) override;

 private:
  base::ReadOnlySharedMemoryRegion page_;
};

}  // namespace enterprise_connectors

#endif  // CHROME_BROWSER_ENTERPRISE_CONNECTORS_ANALYSIS_PAGE_PRINT_ANALYSIS_REQUEST_H_


text:
Object.defineProperty(exports, "__esModule", { value: true });
var types_1 = require("@sentry/types");
var utils_1 = require("@sentry/utils");
/** Noop transport */
var NoopTransport = /** @class */ (function () {
    function NoopTransport() {
    }
    /**
     * @inheritDoc
     */
    NoopTransport.prototype.sendEvent = function (_) {
        return utils_1.SyncPromise.resolve({
            reason: "NoopTransport: Event has been skipped because no Dsn is configured.",
            status: types_1.Status.Skipped,
        });
    };
    /**
     * @inheritDoc
     */
    NoopTransport.prototype.close = function (_) {
        return utils_1.SyncPromise.resolve(true);
    };
    return NoopTransport;
}());
exports.NoopTransport = NoopTransport;
//# sourceMappingURL=noop.js.map


text:
package com.sun.tools.doclets.internal.toolkit.taglets;

import com.sun.javadoc.*;
import com.sun.tools.doclets.internal.toolkit.util.*;

/**
 * An inline Taglet representing the inheritDoc tag. This tag should only
 * be used with a method.  It is used to inherit documentation from overriden
 * and implemented methods.
 *
 * This code is not part of an API.
 * It is implementation that is subject to change.
 * Do not use it as an API
 *
 * @author Jamie Ho
 * @since 1.4
 */

public class InheritDocTaglet extends BaseInlineTaglet {

    /**
     * The inline tag that would appear in the documentation if
     * the writer wanted documentation to be inherited.
     */
    public static final String INHERIT_DOC_INLINE_TAG = "{@inheritDoc}";

    /**
     * Construct a new InheritDocTaglet.
     */
    public InheritDocTaglet () {
        name = "inheritDoc";
    }

    /**
     * Will return false because this inline tag may
     * only appear in Methods.
     * @return false since this is not a method.
     */
    public boolean inField() {
        return false;
    }

    /**
     * Will return false because this inline tag may
     * only appear in Methods.
     * @return false since this is not a method.
     */
    public boolean inConstructor() {
        return false;
    }

    /**
     * Will return false because this inline tag may
     * only appear in Methods.
     * @return false since this is not a method.
     */
    public boolean inOverview() {
        return false;
    }

    /**
     * Will return false because this inline tag may
     * only appear in Methods.
     * @return false since this is not a method.
     */
    public boolean inPackage() {
        return false;
    }

    /**
     * Will return false because this inline tag may
     * only appear in Methods.
     * @return false since this is not a method.
     */
    public boolean inType() {
        return false;
    }

    /**
     * Given a MethodDoc item, a Tag in the
     * MethodDoc item and a String, replace all occurances
     * of @inheritDoc with documentation from it's superclass or superinterface.
     *
     * @param writer the writer that is writing the output.
     * @param md the {@link MethodDoc} that we are documenting.
     * @param holderTag the tag that holds the inheritDoc tag.
     * @param isFirstSentence true if we only want to inherit the first sentence.
     */
    private TagletOutput retrieveInheritedDocumentation(TagletWriter writer,
            MethodDoc md, Tag holderTag, boolean isFirstSentence) {
        TagletOutput replacement = writer.getTagletOutputInstance();

        Taglet inheritableTaglet = holderTag == null ?
            null : writer.configuration().tagletManager.getTaglet(holderTag.name());
        if (inheritableTaglet != null &&
            !(inheritableTaglet instanceof InheritableTaglet)) {
                //This tag does not support inheritence.
                writer.configuration().message.warning(md.position(),
                "doclet.noInheritedDoc", md.name() + md.flatSignature());
         }
        DocFinder.Output inheritedDoc =
            DocFinder.search(new DocFinder.Input(md,
                (InheritableTaglet) inheritableTaglet, holderTag,
                isFirstSentence, true));
        if (inheritedDoc.isValidInheritDocTag == false) {
            writer.configuration().message.warning(md.position(),
                "doclet.noInheritedDoc", md.name() + md.flatSignature());
        } else if (inheritedDoc.inlineTags.length > 0) {
            replacement = writer.commentTagsToOutput(inheritedDoc.holderTag,
                inheritedDoc.holder, inheritedDoc.inlineTags, isFirstSentence);
        }
        return replacement;
    }

    /**
     * Given the Tag representation of this custom
     * tag, return its string representation, which is output
     * to the generated page.
     * @param tag the Tag representation of this custom tag.
     * @param tagletWriter the taglet writer for output.
     * @return the TagletOutput representation of this Tag.
     */
    public TagletOutput getTagletOutput(Tag tag, TagletWriter tagletWriter) {
        if (! (tag.holder() instanceof MethodDoc)) {
            return tagletWriter.getOutputInstance();
        }
        return tag.name().equals("@inheritDoc") ?
                retrieveInheritedDocumentation(tagletWriter, (MethodDoc) tag.holder(), null, tagletWriter.isFirstSentence) :
                retrieveInheritedDocumentation(tagletWriter, (MethodDoc) tag.holder(), tag, tagletWriter.isFirstSentence);
    }
}


text:
import { Type } from "@angular/core";
import { ConfirmationDialogComponent } from "./confirmation-dialog.component";
export * from "./confirmation-dialog.component";
export const CONFIRMATION_DIALOG_DIRECTIVES: Type<any>[] = [
  ConfirmationDialogComponent
];


text:
package org.kie.workbench.common.dmn.client.editors.expressions.types.function.supplementary.pmml;

import java.util.Optional;
import java.util.function.Supplier;

import org.kie.workbench.common.dmn.api.definition.model.LiteralExpression;
import org.kie.workbench.common.dmn.client.editors.expressions.types.literal.LiteralExpressionUIModelMapper;
import org.kie.workbench.common.dmn.client.widgets.grid.controls.list.ListSelectorView;
import org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridCell;
import org.uberfire.ext.wires.core.grids.client.model.GridData;
import org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCellValue;

public class LiteralExpressionPMMLUIModelMapper extends LiteralExpressionUIModelMapper {

    private String placeHolder;

    public LiteralExpressionPMMLUIModelMapper(final Supplier<GridData> uiModel,
                                              final Supplier<Optional<LiteralExpression>> dmnModel,
                                              final ListSelectorView.Presenter listSelector,
                                              final double lineHeight,
                                              final String placeHolder) {
        super(uiModel,
              dmnModel,
              listSelector,
              lineHeight);
        this.placeHolder = placeHolder;
    }

    @Override
    public void fromDMNModel(final int rowIndex,
                             final int columnIndex) {
        dmnModel.get().ifPresent(literalExpression -> {
            uiModel.get().setCell(rowIndex,
                                  columnIndex,
                                  () -> new DMNGridCell<>(new BaseGridCellValue<>(literalExpression.getText().getValue(),
                                                                                placeHolder)));
        });
    }
}


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

public class StatePredatorReturnHome : StatePredatorNotStunned
{
    #region implemented abstract members of State

    public override State Init(GameObject gameObject, IDictionary<string, State> states)
    {
        base.Init(gameObject, states);

        Transition returnHomeToHold = new TransitionPredatorReturnHomeToHold();
        Transitions.Add("ReturnHome->Hold", returnHomeToHold);
        returnHomeToHold.Init(gameObject, states);

        Transition returnHomeToPatrol = new TransitionPredatorReturnHomeToPatrol();
        Transitions.Add("ReturnHome->Patrol", returnHomeToPatrol);
        returnHomeToPatrol.Init(gameObject, states);

        Transition returnHomeToPursuit = new TransitionPredatorReturnHomeToPursuit();
        Transitions.Add("ReturnHome->Pursuit", returnHomeToPursuit);
        returnHomeToPursuit.Init(gameObject, states);

        Action = new StateActionPredatorReturnHome().Init(gameObject, Transitions);
        EntryAction = new TransitionActionPredatorReturnHomeEntry().Init(gameObject);
        ExitAction = new TransitionActionNull().Init(gameObject);

        return this;
    }

    #endregion
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Drake: MultibodyPlantTester Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen_extra.css" rel="stylesheet" type="text/css"/>

     Home

     Installation

     Gallery

API Documentation

      C++
      Python

Resources

      Getting Help
      Tutorials
      Python Bindings
      For Developers
      Credits

     GitHub

Drake

  Drake C++ Documentation

  <form id="ddg-search-form" class="wy_form" action="https://duckduckgo.com/" method="get">
   <input type="text" name="q" placeholder="Search C++ API only…">
   <input type="hidden" name="sites" value="drake.mit.edu/doxygen_cxx">
  </form>
  <form id="ddg-search-form" class="wy_form" action="https://duckduckgo.com/" method="get">
   <input type="text" name="q" placeholder="Search all of Drake…">
   <input type="hidden" name="sites" value="drake.mit.edu">
  </form>

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Public Member Functions |
Static Public Member Functions |
List of all members

MultibodyPlantTester Class Reference

#include <drake/multibody/benchmarks/kuka_iiwa_robot/drake_kuka_iiwa_robot.h>

Public Member Functions

 	MultibodyPlantTester ()=delete

Static Public Member Functions

template<typename T >

static std::unique_ptr< MultibodyPlant< T > > 	CreateMultibodyPlantFromTree (std::unique_ptr< internal::MultibodyTree< T >> tree, double time_step=0.)

Constructor & Destructor Documentation

◆ MultibodyPlantTester()

          MultibodyPlantTester
          (
          	)

delete

Member Function Documentation

◆ CreateMultibodyPlantFromTree()

          static std::unique_ptr<MultibodyPlant<T> > CreateMultibodyPlantFromTree
          (
          std::unique_ptr< internal::MultibodyTree< T >>
          tree,

          double
          time_step = 0.

          )

static

The documentation for this class was generated from the following file:

drake/multibody/benchmarks/kuka_iiwa_robot/drake_kuka_iiwa_robot.h

drake

multibody

MultibodyPlantTester

          C++

          Python

          GitHub


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

<TITLE>
DrawerLayout.LayoutParams
</TITLE>

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

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

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

android.support.v4.widget

Class DrawerLayout.LayoutParams

java.lang.Object
  ViewGroup.MarginLayoutParams
      android.support.v4.widget.DrawerLayout.LayoutParams

Enclosing class:
DrawerLayout

public static class DrawerLayout.LayoutParams
extends ViewGroup.MarginLayoutParams

Field Summary

 int
gravity

Constructor Summary

DrawerLayout.LayoutParams(Context c,
                          AttributeSet attrs)

DrawerLayout.LayoutParams(DrawerLayout.LayoutParams source)

DrawerLayout.LayoutParams(int width,
                          int height,
                          int gravity)

DrawerLayout.LayoutParams(ViewGroup.LayoutParams source)

DrawerLayout.LayoutParams(ViewGroup.MarginLayoutParams source)

Method Summary

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

gravity

public int gravity

Constructor Detail

DrawerLayout.LayoutParams

public DrawerLayout.LayoutParams(Context c,
                                 AttributeSet attrs)

DrawerLayout.LayoutParams

public DrawerLayout.LayoutParams(int width,
                                 int height,
                                 int gravity)

DrawerLayout.LayoutParams

public DrawerLayout.LayoutParams(DrawerLayout.LayoutParams source)

DrawerLayout.LayoutParams

public DrawerLayout.LayoutParams(ViewGroup.LayoutParams source)

DrawerLayout.LayoutParams

public DrawerLayout.LayoutParams(ViewGroup.MarginLayoutParams source)

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
var express = require('express')
var app = express()
var server = require('http').createServer(app)
var io = require('socket.io').listen(server)
var coremidi = require('coremidi')()

app.use(express.static(__dirname + '/public'))
app.use(express.logger())

app.get('/', function(req,res) {res.sendfile('index.html')})
io.sockets.on('connection', function(socket) {
  socket.on('key', playNote)
})

function playNote(note) {
  console.log(note)
  coremidi.write([150, note, 127])
}

server.listen(3000)
console.log('listening on 3000')


text:
.bluediv{
display:block;

background:url('../../images/parisbg.jpg') #339933;
background-position:right 50%;
position:relative;
z-index:10000;
overflow:hidden;
}

.whitediv{
display:block;
background:url('../../images/palmbgg.png') #e9e9e9;
background-position:1000px 50%;
position:absolute;
right:0px;
top:0px;
z-index:100;
overflow:hidden;
}
.palmbgcontainer{
display:block;
background:url('../../images/palmbg.jpg') #fff;
background-position:0px 50%;
position:absolute;
left:-750px;
}

.loader{display:block; position:absolute;}
img.logointro{position:absolute; right:95px; top:10%; opacity:0;}

img.couple{height:100%; position:absolute; bottom:-8px; left:-220px; z-index:100;}
img.leaf{width:40%; position:absolute; top:0px; left:-220px; z-index:100;}

img.girl{height:110%; position:absolute; bottom:-12%; left:-420px; z-index:100; opacity:0;}
img.girl2{height:110%; position:absolute; bottom:-12%; left:-420px; z-index:100; opacity:0;}
img.girl-car{height:98%; position:absolute; bottom:0px; left:-420px; z-index:100; opacity:0;}
img.car{width:130%; position:absolute; bottom:-70px; left:-45%; z-index:50; opacity:0;}
img.girl-cruise{height:100%; position:absolute; bottom:-10%; left:-420px; z-index:100; opacity:0;}
img.dubai{height:110%; position:absolute; bottom:-10%;top:-10%; left:-200px; z-index:10; opacity:0;}
img.plane{height:100%; position:absolute; bottom:-10%;top:-10%; left:-100px; z-index:10; opacity:0;}
img.road{height:100%; position:absolute; top:0px; right:-400px; z-index:10; opacity:0;}
img.cruise{height:150%; position:absolute; bottom:-10%; right:-100px; z-index:10; opacity:0;}

img.full-cruise{height:100%; position:absolute; bottom:0%; left:-420px; z-index:100; opacity:0;}
img.full-car{height:100%; position:absolute; bottom:0px; left:-420px; z-index:100; opacity:0;}
img.full-flight{height:100%; position:absolute; bottom:0%; left:-320px; z-index:100; opacity:0;}
img.full-hotel{height:100%; position:absolute; bottom:0%; left:-220px; z-index:100; opacity:0;}
img.full-vacations{height:100%; position:absolute; bottom:0px; left:-220px; z-index:100;}

.full-insetshadow{box-shadow: inset 0 0 150px rgba(0,0,0,0.5); height:100%; width:100%; position:absolute; top:0px; left:0px; z-index:200;}

.bck01 {background:#FFF; background:rgba(255,255,255,0.9); padding:20px; margin-top:-50px;}
@media (min-width: 992px)  {
.bck01 {background:#FFF; background:rgba(255,255,255,0.9); padding:50px; margin-top:-25px;}
}

.tabscontainer{position:absolute; border:0px solid #fff; right:-60px; top:35%; opacity:0; text-align:center; color:white; text-transform:uppercase; font-size:12px; font-family:"Lato"; font-weight:700;}
.aniflights{ width:90px; height:60px; text-align:center; position:absolute; float:left; left:-110px; margin-top:-10px;}
.aniflights img{display:block;width:20px;height:21px;background:url('../../images/sprite.png') 0px -180px; margin:0 auto;}
.anihotels{ width:90px; height:60px; text-align:center; position:absolute; float:left; left:-110px; margin-top:-10px;}
.anihotels img{display:block;width:15px;height:21px;background:url('../../images/sprite.png') -28px -180px; margin:0 auto;}
.anivacations{ width:90px; height:60px; text-align:center; position:absolute; float:left; left:-110px; margin-top:-10px;}
.anivacations img{display:block;width:26px;height:21px;background:url('../../images/sprite.png') -48px -180px; margin:0 auto;}
.anicars{ width:90px; height:60px; text-align:center; position:absolute; float:left; left:-110px; margin-top:-10px;}
.anicars img{display:block;width:28px;height:21px;background:url('../../images/sprite.png') -78px -180px; margin:0 auto;}
.anicruises{ width:90px; height:60px; text-align:center; position:absolute; float:left; left:-110px; margin-top:-10px;}
.anicruises img{display:block;width:30px;height:21px;background:url('../../images/sprite.png') -110px -180px; margin:0 auto;}

.social{display:block; width:200px; color:white; position:absolute; right:50px; bottom:5%; opacity:0; text-align:center;}
.social a{color:white;}

.b1, .b2, .b3, .b4, .b5 {opacity:0;}

.tabs{display:block; width:20px; color:white; position:absolute; right:100px; top:36%; opacity:0;}
.tabs a{color:#fff;}

.tabs li {list-style-type:none;}
.tabs li a{display:block;  color:#ccc; width:10px; height:10px; background:rgba(0,0,0,0.2); margin-bottom:50px; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px;}
.tabs li a.active{background:#fff; color:#fff;}

#tab1{width:300px; position:absolute; z-index:1000; top:35%; left:30%; opacity:0;}
#tab2{width:300px; position:absolute; z-index:1000; top:35%; left:30%; opacity:1;}
#tab3{width:300px; position:absolute; z-index:1000; top:35%; left:30%; opacity:1;}
#tab4{width:300px; position:absolute; z-index:1000; top:35%; left:30%; opacity:1;}
#tab5{width:300px; position:absolute; z-index:1000; top:35%; left:30%; opacity:1;}

@media (max-width: 320px)  {
img.logointro{top:5%!important;}
.tabscontainer{top:30%!important;}
.tabs li a{margin-bottom:30px!important;}

#tab1,#tab2,#tab3,#tab4,#tab5{top:25%!important;}

}

.btn-search2 {
  /*color: #333333;
  background-color: #ffffff;
  border-color: #cccccc;
  */
	text-transform:uppercase;
	margin-top:12px;

	border: 1px solid #d75124;
	background: #e35121;
	background: -webkit-gradient(linear, left top, left bottom, from(#ff6633), to(#e35121));
	background: -webkit-linear-gradient(top, #ff6633, #e35121);
	background: -moz-linear-gradient(top, #ff6633, #e35121);
	background: -ms-linear-gradient(top, #ff6633, #e35121);
	background: -o-linear-gradient(top, #ff6633, #e35121);
	padding: 7.5px 20px;
	-webkit-border-radius: 3px;
	-moz-border-radius: 3px;
	border-radius: 3px;
	-webkit-box-shadow: rgba(0,0,0,0.18) 0 1px 0;
	-moz-box-shadow: rgba(0,0,0,0.18) 0 1px 0;
	box-shadow: rgba(0,0,0,0.18) 0 1px 0;
	text-shadow: rgba(0,0,0,.4) 0 -1px 0;
	color:#ffffff;
	font-size: 13px;
	font-family: Helvetica, Arial, Sans-Serif;
	text-decoration: none;
	vertical-align: middle;

	font-family:"Open Sans";
	font-weight:700;

-webkit-transition:.3s;-moz-transition:.3s;transition:.3s
}
.btn-search2:hover{
	/*color:#be3507;*/
	color:#ffffff;
	/*text-shadow: rgba(255,255,255,.4) 0 1px 0;*/
	text-shadow: rgba(0,0,0,.4) 0 -1px 0;

	background: #ff6633;
	background: -webkit-gradient(linear, left top, left bottom, from(#e35121), to(#ff6633));
	background: -webkit-linear-gradient(top, #e35121, #ff6633);
	background: -moz-linear-gradient(top, #e35121, #ff6633);
	background: -ms-linear-gradient(top, #e35121, #ff6633);
	background: -o-linear-gradient(top, #e35121, #ff6633);

}

@media (max-width: 768px)  {

.whitediv{
display:block;
background:url('../../images/palmbgg.png') #fff;
background-position:1000px 50%;
position:absolute;
right:0px;
top:0px;
z-index:100;
overflow:hidden;
}

img.logointro{width:50px;position:absolute; left:10px; top:10%; opacity:0;}

.social{display:none;}

.tabs{display:block; width:100px; color:white; position:absolute; right:-13px; top:36%; opacity:0; border:0px solid #fff;}
.tabs li {list-style-type:none; margin-left:-30px;}
.tabs li a{display:block;  width:10px; height:10px; background:rgba(0,0,0,0.0); margin-bottom:50px; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px;}
.tabs li a.active{background:none; }

.tabscontainer{ width:100%; position:absolute; left:0px; border:0px solid #fff;  top:35%; opacity:0; text-align:center; color:white; text-transform:uppercase; font-size:11px; font-family:"Lato"; font-weight:700; letter-spacing:-0.5px;}
.aniflights{ width:80px; height:60px; text-align:center; position:relative; float:left; left:0px; margin-top:-10px;}
.aniflights img{display:block;width:20px;height:21px;background:url('../../images/sprite.png') 0px -180px; margin:0 auto;}
.anihotels{ width:80px; height:60px; text-align:center; position:relative; float:left; left: 0px; margin-top:-10px;}
.anihotels img{display:block;width:15px;height:21px;background:url('../../images/sprite.png') -28px -180px; margin:0 auto;}
.anivacations{ width:80px; height:60px; text-align:center; position:relative; float:left; left:0px; margin-top:-10px;}
.anivacations img{display:block;width:24px;height:21px;background:url('../../images/sprite.png') -49px -180px; margin:0 auto;}
.anicars{ width:80px; height:60px; text-align:center; position:relative; float:left; left:0px; margin-top:-10px;}
.anicars img{display:block;width:28px;height:21px;background:url('../../images/sprite.png') -78px -180px; margin:0 auto;}
.anicruises{ width:80px; height:60px; text-align:center; position:relative; float:left; left:0px; margin-top:-10px;}
.anicruises img{display:block;width:30px;height:21px;background:url('../../images/sprite.png') -110px -180px; margin:0 auto;}

#tab1{width:90%; position:absolute; z-index:100; top:35%; left:10px; opacity:0;}
#tab2{width:90%; position:absolute; z-index:100; top:35%; left:10px; opacity:1;}
#tab3{width:90%; position:absolute; z-index:100; top:35%; left:10px; opacity:1;}
#tab4{width:90%; position:absolute; z-index:100; top:35%; left:10px; opacity:1;}
#tab5{width:90%; position:absolute; z-index:100; top:35%; left:10px; opacity:1;}

}