text:
    name, sample, 1, 10000, 50)

#define ANGLE_HISTOGRAM_MEDIUM_TIMES(name, sample) ANGLE_HISTOGRAM_CUSTOM_TIMES( \
    name, sample, 10, 180000, 50)

// Use this macro when times can routinely be much longer than 10 seconds.
#define ANGLE_HISTOGRAM_LONG_TIMES(name, sample) ANGLE_HISTOGRAM_CUSTOM_TIMES( \
    name, sample, 1, 3600000, 50)

// Use this macro when times can routinely be much longer than 10 seconds and
// you want 100 buckets.
#define ANGLE_HISTOGRAM_LONG_TIMES_100(name, sample) ANGLE_HISTOGRAM_CUSTOM_TIMES( \
    name, sample, 1, 3600000, 100)

// For folks that need real specific times, use this to select a precise range
// of times you want plotted, and the number of buckets you want used.
#define ANGLE_HISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count) \
    ANGLE_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count)

#define ANGLE_HISTOGRAM_COUNTS(name, sample) ANGLE_HISTOGRAM_CUSTOM_COUNTS( \
    name, sample, 1, 1000000, 50)

#define ANGLE_HISTOGRAM_COUNTS_100(name, sample) \
    ANGLE_HISTOGRAM_CUSTOM_COUNTS(name, sample, 1, 100, 50)

#define ANGLE_HISTOGRAM_COUNTS_10000(name, sample) \
    ANGLE_HISTOGRAM_CUSTOM_COUNTS(name, sample, 1, 10000, 50)

#define ANGLE_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) \
    ANGLEPlatformCurrent()->histogramCustomCounts(\
      name, sample, min, max, bucket_count)

#define ANGLE_HISTOGRAM_PERCENTAGE(name, under_one_hundred) \
    ANGLE_HISTOGRAM_ENUMERATION(name, under_one_hundred, 101)

#define ANGLE_HISTOGRAM_BOOLEAN(name, sample) \
    ANGLEPlatformCurrent()->histogramBoolean(name, sample)

#define ANGLE_HISTOGRAM_ENUMERATION(name, sample, boundary_value) \
    ANGLEPlatformCurrent()->histogramEnumeration(name, sample, boundary_value)

#define ANGLE_HISTOGRAM_MEMORY_KB(name, sample) ANGLE_HISTOGRAM_CUSTOM_COUNTS( \
    name, sample, 1000, 500000, 50)

#define ANGLE_HISTOGRAM_MEMORY_MB(name, sample) ANGLE_HISTOGRAM_CUSTOM_COUNTS( \
    name, sample, 1, 1000, 50)

#define ANGLE_HISTOGRAM_SPARSE_SLOWLY(name, sample) \
    ANGLEPlatformCurrent()->histogramSparse(name, sample)

// Scoped class which logs its time on this earth as a UMA statistic. This is
// recommended for when you want a histogram which measures the time it takes
// for a method to execute. This measures up to 10 seconds.
#define SCOPED_ANGLE_HISTOGRAM_TIMER(name) \
    SCOPED_ANGLE_HISTOGRAM_TIMER_EXPANDER(name, false, __COUNTER__)

// Similar scoped histogram timer, but this uses ANGLE_HISTOGRAM_LONG_TIMES_100,
// which measures up to an hour, and uses 100 buckets. This is more expensive
// to store, so only use if this often takes >10 seconds.
#define SCOPED_ANGLE_HISTOGRAM_LONG_TIMER(name) \
    SCOPED_ANGLE_HISTOGRAM_TIMER_EXPANDER(name, true, __COUNTER__)

// This nested macro is necessary to expand __COUNTER__ to an actual value.
#define SCOPED_ANGLE_HISTOGRAM_TIMER_EXPANDER(name, is_long, key) \
    SCOPED_ANGLE_HISTOGRAM_TIMER_UNIQUE(name, is_long, key)

#define SCOPED_ANGLE_HISTOGRAM_TIMER_UNIQUE(name, is_long, key)                              \
    class ScopedHistogramTimer##key                                                          \
    {                                                                                \
      public:                                                                                \
        ScopedHistogramTimer##key() : constructed_(ANGLEPlatformCurrent()->currentTime()) {} \
        ~ScopedHistogramTimer##key()                                                         \
        {                                                                                \
            if (constructed_ == 0)                                                           \
                return;                                                                      \
            double elapsed = ANGLEPlatformCurrent()->currentTime() - constructed_;           \
            int elapsedMS = static_cast<int>(elapsed * 1000.0);                              \
            if (is_long)                                                                     \
            {                                                                                \
                ANGLE_HISTOGRAM_LONG_TIMES_100(name, elapsedMS);                             \
            }                                                                                \
            else                                                                             \
            {                                                                                \
                ANGLE_HISTOGRAM_TIMES(name, elapsedMS);                                      \
            }                                                                                \
        }                                                                                \
                                                                                \
      private:                                                                               \
        double constructed_;                                                                 \
    } scoped_histogram_timer_##key

#endif  // BASE_METRICS_HISTOGRAM_MACROS_H_


text:
//  Boost string_algo library sequence.hpp header file  ---------------------------//

//  Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
//    (See accompanying file LICENSE_1_0.txt or copy at
//          http://www.boost.org/LICENSE_1_0.txt)

//  See http://www.boost.org/ for updates, documentation, and revision history.

#ifndef AUTOBOOST_STRING_DETAIL_SEQUENCE_HPP
#define AUTOBOOST_STRING_DETAIL_SEQUENCE_HPP

#include <autoboost/algorithm/string/config.hpp>
#include <autoboost/mpl/bool.hpp>
#include <autoboost/mpl/logical.hpp>
#include <autoboost/range/begin.hpp>
#include <autoboost/range/end.hpp>

#include <autoboost/algorithm/string/sequence_traits.hpp>

namespace autoboost {
    namespace algorithm {
        namespace detail {

//  insert helpers  -------------------------------------------------//

            template< typename InputT, typename ForwardIteratorT >
            inline void insert(
                InputT& Input,
                AUTOBOOST_STRING_TYPENAME InputT::iterator At,
                ForwardIteratorT Begin,
                ForwardIteratorT End )
            {
                Input.insert( At, Begin, End );
            }

            template< typename InputT, typename InsertT >
            inline void insert(
                InputT& Input,
                AUTOBOOST_STRING_TYPENAME InputT::iterator At,
                const InsertT& Insert )
            {
                ::autoboost::algorithm::detail::insert( Input, At, ::autoboost::begin(Insert), ::autoboost::end(Insert) );
            }

//  erase helper  ---------------------------------------------------//

            // Erase a range in the sequence
            /*
                Returns the iterator pointing just after the erase subrange
            */
            template< typename InputT >
            inline typename InputT::iterator erase(
                InputT& Input,
                AUTOBOOST_STRING_TYPENAME InputT::iterator From,
                AUTOBOOST_STRING_TYPENAME InputT::iterator To )
            {
                return Input.erase( From, To );
            }

//  replace helper implementation  ----------------------------------//

            // Optimized version of replace for generic sequence containers
            // Assumption: insert and erase are expensive
            template< bool HasConstTimeOperations >
            struct replace_const_time_helper
            {
                template< typename InputT, typename ForwardIteratorT >
                void operator()(
                    InputT& Input,
                    AUTOBOOST_STRING_TYPENAME InputT::iterator From,
                    AUTOBOOST_STRING_TYPENAME InputT::iterator To,
                    ForwardIteratorT Begin,
                    ForwardIteratorT End )
                {
                    // Copy data to the container ( as much as possible )
                    ForwardIteratorT InsertIt=Begin;
                    AUTOBOOST_STRING_TYPENAME InputT::iterator InputIt=From;
                    for(; InsertIt!=End && InputIt!=To; InsertIt++, InputIt++ )
                    {
                        *InputIt=*InsertIt;
                    }

                    if ( InsertIt!=End )
                    {
                        // Replace sequence is longer, insert it
                        Input.insert( InputIt, InsertIt, End );
                    }
                    else
                    {
                        if ( InputIt!=To )
                        {
                            // Replace sequence is shorter, erase the rest
                            Input.erase( InputIt, To );
                        }
                    }
                }
            };

            template<>
            struct replace_const_time_helper< true >
            {
                // Const-time erase and insert methods -> use them
                template< typename InputT, typename ForwardIteratorT >
                void operator()(
                    InputT& Input,
                    AUTOBOOST_STRING_TYPENAME InputT::iterator From,
                    AUTOBOOST_STRING_TYPENAME InputT::iterator To,
                    ForwardIteratorT Begin,
                    ForwardIteratorT End )
                {
                    AUTOBOOST_STRING_TYPENAME InputT::iterator At=Input.erase( From, To );
                    if ( Begin!=End )
                    {
                        if(!Input.empty())
                        {
                            Input.insert( At, Begin, End );
                        }
                        else
                        {
                            Input.insert( Input.begin(), Begin, End );
                        }
                    }
                }
            };

            // No native replace method
            template< bool HasNative >
            struct replace_native_helper
            {
                template< typename InputT, typename ForwardIteratorT >
                void operator()(
                    InputT& Input,
                    AUTOBOOST_STRING_TYPENAME InputT::iterator From,
                    AUTOBOOST_STRING_TYPENAME InputT::iterator To,
                    ForwardIteratorT Begin,
                    ForwardIteratorT End )
                {
                    replace_const_time_helper<
                        autoboost::mpl::and_<
                            has_const_time_insert<InputT>,
                            has_const_time_erase<InputT> >::value >()(
                        Input, From, To, Begin, End );
                }
            };

            // Container has native replace method
            template<>
            struct replace_native_helper< true >
            {
                template< typename InputT, typename ForwardIteratorT >
                void operator()(
                    InputT& Input,
                    AUTOBOOST_STRING_TYPENAME InputT::iterator From,
                    AUTOBOOST_STRING_TYPENAME InputT::iterator To,
                    ForwardIteratorT Begin,
                    ForwardIteratorT End )
                {
                    Input.replace( From, To, Begin, End );
                }
            };

//  replace helper  -------------------------------------------------//

            template< typename InputT, typename ForwardIteratorT >
            inline void replace(
                InputT& Input,
                AUTOBOOST_STRING_TYPENAME InputT::iterator From,
                AUTOBOOST_STRING_TYPENAME InputT::iterator To,
                ForwardIteratorT Begin,
                ForwardIteratorT End )
            {
                replace_native_helper< has_native_replace<InputT>::value >()(
                    Input, From, To, Begin, End );
            }

            template< typename InputT, typename InsertT >
            inline void replace(
                InputT& Input,
                AUTOBOOST_STRING_TYPENAME InputT::iterator From,
                AUTOBOOST_STRING_TYPENAME InputT::iterator To,
                const InsertT& Insert )
            {
                if(From!=To)
                {
                    ::autoboost::algorithm::detail::replace( Input, From, To, ::autoboost::begin(Insert), ::autoboost::end(Insert) );
                }
                else
                {
                    ::autoboost::algorithm::detail::insert( Input, From, ::autoboost::begin(Insert), ::autoboost::end(Insert) );
                }
            }

        } // namespace detail
    } // namespace algorithm
} // namespace autoboost

#endif  // AUTOBOOST_STRING_DETAIL_SEQUENCE_HPP

redpajama_set_name: RedPajamaGithub


text:
from django import forms

class UploadFileForm(forms.Form):
    target = forms.FileField()


text:
---
type: doc
layout: reference
category: "JavaScript"
title: "JavaScript Modules"
---

# JavaScript Modules

Kotlin allows you to compile your Kotlin projects to JavaScript modules for popular module systems. Here is
the list of available options:

1. Plain. Don't compile for any module system. As usual, you can access a module by its name in the global scope.
   This option is used by default.
2. [Asynchronous Module Definition (AMD)](https://github.com/amdjs/amdjs-api/wiki/AMD), which is in particular
   used by require.js library.
3. [CommonJS](http://wiki.commonjs.org/wiki/Modules/1.1) convention, widely used by node.js/npm
   (`require` function and `module.exports` object)
4. Unified Module Definitions (UMD), which is compatible with both *AMD* and *CommonJS*, and works as "plain"
   when neither *AMD* nor *CommonJS* is available at runtime.

## Choosing the Target Module System

Choosing the target module system depends on your build environment:

### From IntelliJ IDEA

Setup per module:
Open File -> Project Structure..., find your module in Modules and select "Kotlin" facet under it. Choose appropriate
module system in "Module kind" field.

Setup for the whole project:
Open File -> Settings, select "Build, Execution, Deployment" -> "Compiler" -> "Kotlin compiler". Choose appropriate
module system in "Module kind" field.

### From Maven

To select module system when compiling via Maven, you should set `moduleKind` configuration property, i.e. your
`pom.xml` should look like this:

``` xml
<plugin>
    <artifactId>kotlin-maven-plugin</artifactId>
    <groupId>org.jetbrains.kotlin</groupId>
    <version>${kotlin.version}</version>
    <executions>
        <execution>
            <id>compile</id>
            <goals>
                <goal>js</goal>
            </goals>
        </execution>
    </executions>
    <!-- Insert these lines -->
    <configuration>
        <moduleKind>commonjs</moduleKind>
    </configuration>
    <!-- end of inserted text -->
</plugin>
```

Available values are: `plain`, `amd`, `commonjs`, `umd`.

### From Gradle

To select module system when compiling via Gradle, you should set `moduleKind` property, i.e.

``` groovy
compileKotlin2Js.kotlinOptions.moduleKind = "commonjs"
```

Available values are similar to Maven.

## `@JsModule` annotation

To tell Kotlin that an `external` class, package, function or property is a JavaScript module, you can use `@JsModule`
annotation. Consider you have the following CommonJS module called "hello":

``` javascript
module.exports.sayHello = function(name) { alert("Hello, " + name); }
```

You should declare it like this in Kotlin:

``` kotlin
@JsModule("hello")
external fun sayHello(name: String)
```

### Applying `@JsModule` to packages

Some JavaScript libraries export packages (namespaces) instead of functions and classes.
In terms of JavaScript, it's an object that has members that *are* classes, functions and properties.
Importing these packages as Kotlin objects often looks unnatural.
The compiler allows to map imported JavaScript packages to Kotlin packages, using the following notation:

``` kotlin
@file:JsModule("extModule")
package ext.jspackage.name

external fun foo()

external class C
```

where the corresponding JavaScript module is declared like this:

``` javascript
module.exports = {
    foo:  { /* some code here */ },
    C:  { /* some code here */ }
}
```

Important: files marked with `@file:JsModule` annotation can't declare non-external members.
The example below produces compile-time error:

``` kotlin
@file:JsModule("extModule")
package ext.jspackage.name

external fun foo()

fun bar() = "!" + foo() + "!" // error here
```

### Importing deeper package hierarchies

In the previous example the JavaScript module exports a single package.
However, some JavaScript libraries export multiple packages from within a module.
This case is also supported by Kotlin, though you have to declare a new `.kt` file for each package you import.

For example, let's make our example a bit more complicated:

``` javascript
module.exports = {
    mylib: {
        pkg1: {
            foo: function() { /* some code here */ },
            bar: function() { /* some code here */ }
        },
        pkg2: {
            baz: function() { /* some code here */ }
        }
    }
}
```

To import this module in Kotlin, you have to write two Kotlin source files:

```kotlin
@file:JsModule("extModule")
@file:JsQualifier("mylib.pkg1")
package extlib.pkg1

external fun foo()

external fun bar()
```

and

```kotlin
@file:JsModule("extModule")
@file:JsQualifier("mylib.pkg2")
package extlib.pkg2

external fun baz()
```

### `@JsNonModule` annotation

When a declaration has `@JsModule`, you can't use it from Kotlin code when you don't compile it to a JavaScript module.
Usually, developers distribute their libraries both as JavaScript modules and downloadable `.js` files that you
can copy to project's static resources and include via `<script>` element. To tell Kotlin that it's ok
to use a `@JsModule` declaration from non-module environment, you should put `@JsNonModule` declaration. For example,
given JavaScript code:

``` javascript
function topLevelSayHello(name) { alert("Hello, " + name); }
if (module && module.exports) {
    module.exports = topLevelSayHello;
}
```

can be described like this:

```kotlin
@JsModule("hello")
@JsNonModule
@JsName("topLevelSayHello")
external fun sayHello(name: String)
```

### Notes

Kotlin is distributed with `kotlin.js` standard library as a single file, which is itself compiled as an UMD module, so
you can use it with any module system described above. Also it is available on NPM as [`kotlin` package](https://www.npmjs.com/package/kotlin)


text:
from datetime import timedelta

from dimagi.utils.logging import notify_error, notify_exception

from corehq import toggles
from corehq.apps.celery import task
from corehq.apps.formplayer_api.smsforms.api import (
    FormplayerInterface,
    TouchformsError,
)
from corehq.apps.sms.api import (
    MessageMetadata,
    send_sms,
    send_sms_to_verified_number,
)
from corehq.apps.sms.models import PhoneNumber
from corehq.apps.sms.util import format_message_list
from corehq.apps.smsforms.app import (
    _responses_to_text,
    get_events_from_responses,
)
from corehq.apps.smsforms.models import (
    SQLXFormsSession,
    XFormsSessionSynchronization,
)
from corehq.apps.smsforms.util import critical_section_for_smsforms_sessions
from corehq.messaging.scheduling.util import utcnow
from corehq.util.celery_utils import no_result_task
from corehq.util.metrics import metrics_counter

@no_result_task(serializer='pickle', queue='background_queue')
def send_first_message(domain, recipient, phone_entry_or_number, session, responses, logged_subevent, workflow):
    # This try/except section is just here (temporarily) to support future refactors
    # If any of these notify, they should be replaced with a comment as to why the two are different
    # so that someone refactoring in the future will know that this or that param is necessary.
    try:
        if session.workflow != workflow:
            # see if we can eliminate the workflow arg
            notify_error('Exploratory: session.workflow != workflow', details={
                'session.workflow': session.workflow, 'workflow': workflow})
        if session.connection_id != recipient.get_id:
            # see if we can eliminate the recipient arg
            notify_error('Exploratory: session.connection_id != recipient.get_id', details={
                'session.connection_id': session.connection_id, 'recipient.get_id': recipient.get_id,
                'recipient': recipient
            })
        if session.related_subevent != logged_subevent:
            # see if we can eliminate the logged_subevent arg
            notify_error('Exploratory: session.related_subevent != logged_subevent', details={
                'session.connection_id': session.connection_id, 'logged_subevent': logged_subevent})
    except Exception:
        # The above running is not mission critical, so if it errors just leave a message in the log
        # for us to follow up on.
        # Absence of the message below and messages above ever notifying
        # will indicate that we can remove these args.
        notify_exception(None, "Error in section of code that's just supposed help inform future refactors")

    if toggles.ONE_PHONE_NUMBER_MULTIPLE_CONTACTS.enabled(domain):
        if not XFormsSessionSynchronization.claim_channel_for_session(session):
            send_first_message.apply_async(
                args=(domain, recipient, phone_entry_or_number, session, responses, logged_subevent, workflow),
                countdown=60
            )
            return

    metrics_counter('commcare.smsforms.session_started', 1, tags={'domain': domain, 'workflow': workflow})

    if len(responses) > 0:
        text_responses = _responses_to_text(responses)
        message = format_message_list(text_responses)
        events = get_events_from_responses(responses)
        metadata = MessageMetadata(
            workflow=workflow,
            xforms_session_couch_id=session.couch_id,
            messaging_subevent_id=logged_subevent.pk
        )

        if isinstance(phone_entry_or_number, PhoneNumber):
            send_sms_to_verified_number(
                phone_entry_or_number,
                message,
                metadata,
                logged_subevent=logged_subevent,
                events=events
            )
        else:
            send_sms(
                domain,
                recipient,
                phone_entry_or_number,
                message,
                metadata
            )
    logged_subevent.completed()

@no_result_task(serializer='pickle', queue='reminder_queue')
def handle_due_survey_action(domain, contact_id, session_id):
    with critical_section_for_smsforms_sessions(contact_id):
        session = SQLXFormsSession.by_session_id(session_id)
        if (
            not session
            or not session.session_is_open
            or session.current_action_due > utcnow()
        ):
            return

        if toggles.ONE_PHONE_NUMBER_MULTIPLE_CONTACTS.enabled(domain):
            if not XFormsSessionSynchronization.claim_channel_for_session(session):
                from .management.commands import handle_survey_actions

                # Unless we release this lock, handle_survey_actions will be unable to requeue this task
                # for the default duration of 1h, which we don't want
                handle_survey_actions.Command.get_enqueue_lock(session_id, session.current_action_due).release()
                return

        if session_is_stale(session):
            # If a session is having some unrecoverable errors that aren't benefitting from
            # being retried, those errors should show up in sentry log and the fix should
            # be dealt with. In terms of the current session itself, we just close it out
            # to allow new sessions to start.
            session.mark_completed(False)
            return

        if session.current_action_is_a_reminder:
            # Resend the current question in the open survey to the contact
            p = PhoneNumber.get_phone_number_for_owner(session.connection_id, session.phone_number)
            if p:
                subevent = session.related_subevent
                metadata = MessageMetadata(
                    workflow=session.workflow,
                    xforms_session_couch_id=session._id,
                    messaging_subevent_id=subevent.pk if subevent else None
                )
                resp = FormplayerInterface(session.session_id, domain).current_question()
                send_sms_to_verified_number(
                    p,
                    resp.event.text_prompt,
                    metadata,
                    logged_subevent=subevent
                )

            session.move_to_next_action()
            session.save()
        else:
            close_session.delay(contact_id, session_id)

@task(serializer='pickle', queue='reminder_queue', bind=True, max_retries=3, default_retry_delay=15 * 60)
def close_session(self, contact_id, session_id):
    with critical_section_for_smsforms_sessions(contact_id):
        session = SQLXFormsSession.by_session_id(session_id)
        try:
            session.close(force=False)
        except TouchformsError as e:
            try:
                self.retry(exc=e)
            except TouchformsError as e:
                raise e
            finally:
                # Eventually the session needs to get closed
                session.mark_completed(False)
                return

def session_is_stale(session):
    return utcnow() > (session.start_time + timedelta(minutes=SQLXFormsSession.MAX_SESSION_LENGTH * 2))


text:
.ui-buttons {
  display: inline-flex; }
  .ui-buttons.fill {
    display: flex;
    width: 100%; }
    .ui-buttons.fill .btn {
      flex: 1 0; }
  .ui-buttons .btn {
    display: flex;
    justify-content: center;
    align-items: center; }
  .ui-buttons .btn.align-left {
    justify-content: flex-start; }
  .ui-buttons .btn.align-right {
    justify-content: flex-end; }

/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */
html {
  font-family: sans-serif;
  line-height: 1.15;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%; }

body {
  margin: 0; }

article,
aside,
footer,
header,
nav,
section {
  display: block; }

h1 {
  font-size: 2em;
  margin: 0.67em 0; }

figcaption,
figure,
main {
  display: block; }

figure {
  margin: 1em 40px; }

hr {
  box-sizing: content-box;
  height: 0;
  overflow: visible; }

pre {
  font-family: monospace, monospace;
  font-size: 1em; }

a {
  background-color: transparent;
  -webkit-text-decoration-skip: objects; }

a:active,
a:hover {
  outline-width: 0; }

abbr[title] {
  border-bottom: none;
  text-decoration: underline;
  text-decoration: underline dotted; }

b,
strong {
  font-weight: inherit; }

b,
strong {
  font-weight: bolder; }

code,
kbd,
samp {
  font-family: monospace, monospace;
  font-size: 1em; }

dfn {
  font-style: italic; }

mark {
  background-color: #ff0;
  color: #000; }

small {
  font-size: 80%; }

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline; }

sub {
  bottom: -0.25em; }

sup {
  top: -0.5em; }

audio,
video {
  display: inline-block; }

audio:not([controls]) {
  display: none;
  height: 0; }

img {
  border-style: none; }

svg:not(:root) {
  overflow: hidden; }

button,
input,
optgroup,
select,
textarea {
  font-family: sans-serif;
  font-size: 100%;
  line-height: 1.15;
  margin: 0; }

button,
input {
  overflow: visible; }

button,
select {
  text-transform: none; }

button,
html [type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button; }

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0; }

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText; }

fieldset {
  border: 1px solid #c0c0c0;
  margin: 0 2px;
  padding: 0.35em 0.625em 0.75em; }

legend {
  box-sizing: border-box;
  color: inherit;
  display: table;
  max-width: 100%;
  padding: 0;
  white-space: normal; }

progress {
  display: inline-block;
  vertical-align: baseline; }

textarea {
  overflow: auto; }

[type="checkbox"],
[type="radio"] {
  box-sizing: border-box;
  padding: 0; }

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
  height: auto; }

[type="search"] {
  -webkit-appearance: textfield;
  outline-offset: -2px; }

[type="search"]::-webkit-search-cancel-button,
[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none; }

::-webkit-file-upload-button {
  -webkit-appearance: button;
  font: inherit; }

details,
menu {
  display: block; }

summary {
  display: list-item; }

canvas {
  display: inline-block; }

template {
  display: none; }

[hidden] {
  display: none; }

.btn-dark {
  color: #fff;
  background-color: #1B1C20;
  border-color: #1B1C20; }
  .btn-dark:hover {
    color: #fff;
    background-color: #040404;
    border-color: black; }
  .btn-dark:focus, .btn-dark.focus {
    box-shadow: 0 0 0 2px rgba(27, 28, 32, 0.5); }
  .btn-dark.disabled, .btn-dark:disabled {
    background-color: #1B1C20;
    border-color: #1B1C20; }
  .btn-dark:active, .btn-dark.active,
  .show > .btn-dark.dropdown-toggle {
    color: #fff;
    background-color: #040404;
    background-image: none;
    border-color: black; }

.btn-aged {
  color: #fff;
  background-color: #c4c4c4;
  border-color: #c4c4c4; }
  .btn-aged:hover {
    color: #fff;
    background-color: #ababab;
    border-color: #a5a5a5; }
  .btn-aged:focus, .btn-aged.focus {
    box-shadow: 0 0 0 2px rgba(196, 196, 196, 0.5); }
  .btn-aged.disabled, .btn-aged:disabled {
    background-color: #c4c4c4;
    border-color: #c4c4c4; }
  .btn-aged:active, .btn-aged.active,
  .show > .btn-aged.dropdown-toggle {
    color: #fff;
    background-color: #ababab;
    background-image: none;
    border-color: #a5a5a5; }

.btn-faint {
  color: #fff;
  background-color: #eaeaea;
  border-color: #eaeaea; }
  .btn-faint:hover {
    color: #fff;
    background-color: #d1d1d1;
    border-color: #cbcbcb; }
  .btn-faint:focus, .btn-faint.focus {
    box-shadow: 0 0 0 2px rgba(234, 234, 234, 0.5); }
  .btn-faint.disabled, .btn-faint:disabled {
    background-color: #eaeaea;
    border-color: #eaeaea; }
  .btn-faint:active, .btn-faint.active,
  .show > .btn-faint.dropdown-toggle {
    color: #fff;
    background-color: #d1d1d1;
    background-image: none;
    border-color: #cbcbcb; }

.btn.btn-tiny {
  padding: 0.15rem 0.25rem;
  font-size: 0.75rem;
  border-radius: 0.2rem; }

.btn.btn-huge {
  padding: 1rem 2.5rem;
  font-size: 1.75rem;
  border-radius: 0.4rem; }

.btn {
  display: inline-block;
  font-weight: normal;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border-radius: 0.25rem;
  transition: all 0.2s ease-in-out; }
  .btn:focus, .btn:hover {
    text-decoration: none; }
  .btn:focus, .btn.focus {
    outline: 0;
    box-shadow: 0 0 0 2px rgba(2, 117, 216, 0.25); }
  .btn.disabled, .btn:disabled {
    cursor: not-allowed;
    opacity: .65; }
  .btn:active, .btn.active {
    background-image: none; }

a.btn.disabled,
fieldset[disabled] a.btn {
  pointer-events: none; }

.btn-primary {
  color: #fff;
  background-color: #0275d8;
  border-color: #0275d8; }
  .btn-primary:hover {
    color: #fff;
    background-color: #025aa5;
    border-color: #01549b; }
  .btn-primary:focus, .btn-primary.focus {
    box-shadow: 0 0 0 2px rgba(2, 117, 216, 0.5); }
  .btn-primary.disabled, .btn-primary:disabled {
    background-color: #0275d8;
    border-color: #0275d8; }
  .btn-primary:active, .btn-primary.active,
  .show > .btn-primary.dropdown-toggle {
    color: #fff;
    background-color: #025aa5;
    background-image: none;
    border-color: #01549b; }

.btn-secondary {
  color: #373a3c;
  background-color: #fff;
  border-color: #ccc; }
  .btn-secondary:hover {
    color: #373a3c;
    background-color: #e6e6e6;
    border-color: #adadad; }
  .btn-secondary:focus, .btn-secondary.focus {
    box-shadow: 0 0 0 2px rgba(204, 204, 204, 0.5); }
  .btn-secondary.disabled, .btn-secondary:disabled {
    background-color: #fff;
    border-color: #ccc; }
  .btn-secondary:active, .btn-secondary.active,
  .show > .btn-secondary.dropdown-toggle {
    color: #373a3c;
    background-color: #e6e6e6;
    background-image: none;
    border-color: #adadad; }

.btn-info {
  color: #fff;
  background-color: #5bc0de;
  border-color: #5bc0de; }
  .btn-info:hover {
    color: #fff;
    background-color: #31b0d5;
    border-color: #2aabd2; }
  .btn-info:focus, .btn-info.focus {
    box-shadow: 0 0 0 2px rgba(91, 192, 222, 0.5); }
  .btn-info.disabled, .btn-info:disabled {
    background-color: #5bc0de;
    border-color: #5bc0de; }
  .btn-info:active, .btn-info.active,
  .show > .btn-info.dropdown-toggle {
    color: #fff;
    background-color: #31b0d5;
    background-image: none;
    border-color: #2aabd2; }

.btn-success {
  color: #fff;
  background-color: #5cb85c;
  border-color: #5cb85c; }
  .btn-success:hover {
    color: #fff;
    background-color: #449d44;
    border-color: #419641; }
  .btn-success:focus, .btn-success.focus {
    box-shadow: 0 0 0 2px rgba(92, 184, 92, 0.5); }
  .btn-success.disabled, .btn-success:disabled {
    background-color: #5cb85c;
    border-color: #5cb85c; }
  .btn-success:active, .btn-success.active,
  .show > .btn-success.dropdown-toggle {
    color: #fff;
    background-color: #449d44;
    background-image: none;
    border-color: #419641; }

.btn-warning {
  color: #fff;
  background-color: #f0ad4e;
  border-color: #f0ad4e; }
  .btn-warning:hover {
    color: #fff;
    background-color: #ec971f;
    border-color: #eb9316; }
  .btn-warning:focus, .btn-warning.focus {
    box-shadow: 0 0 0 2px rgba(240, 173, 78, 0.5); }
  .btn-warning.disabled, .btn-warning:disabled {
    background-color: #f0ad4e;
    border-color: #f0ad4e; }
  .btn-warning:active, .btn-warning.active,
  .show > .btn-warning.dropdown-toggle {
    color: #fff;
    background-color: #ec971f;
    background-image: none;
    border-color: #eb9316; }

.btn-danger {
  color: #fff;
  background-color: #d9534f;
  border-color: #d9534f; }
  .btn-danger:hover {
    color: #fff;
    background-color: #c9302c;
    border-color: #c12e2a; }
  .btn-danger:focus, .btn-danger.focus {
    box-shadow: 0 0 0 2px rgba(217, 83, 79, 0.5); }
  .btn-danger.disabled, .btn-danger:disabled {
    background-color: #d9534f;
    border-color: #d9534f; }
  .btn-danger:active, .btn-danger.active,
  .show > .btn-danger.dropdown-toggle {
    color: #fff;
    background-color: #c9302c;
    background-image: none;
    border-color: #c12e2a; }

.btn-outline-primary {
  color: #0275d8;
  background-image: none;
  background-color: transparent;
  border-color: #0275d8; }
  .btn-outline-primary:hover {
    color: #fff;
    background-color: #0275d8;
    border-color: #0275d8; }
  .btn-outline-primary:focus, .btn-outline-primary.focus {
    box-shadow: 0 0 0 2px rgba(2, 117, 216, 0.5); }
  .btn-outline-primary.disabled, .btn-outline-primary:disabled {
    color: #0275d8;
    background-color: transparent; }
  .btn-outline-primary:active, .btn-outline-primary.active,
  .show > .btn-outline-primary.dropdown-toggle {
    color: #fff;
    background-color: #0275d8;
    border-color: #0275d8; }

.btn-outline-secondary {
  color: #ccc;
  background-image: none;
  background-color: transparent;
  border-color: #ccc; }
  .btn-outline-secondary:hover {
    color: #fff;
    background-color: #ccc;
    border-color: #ccc; }
  .btn-outline-secondary:focus, .btn-outline-secondary.focus {
    box-shadow: 0 0 0 2px rgba(204, 204, 204, 0.5); }
  .btn-outline-secondary.disabled, .btn-outline-secondary:disabled {
    color: #ccc;
    background-color: transparent; }
  .btn-outline-secondary:active, .btn-outline-secondary.active,
  .show > .btn-outline-secondary.dropdown-toggle {
    color: #fff;
    background-color: #ccc;
    border-color: #ccc; }

.btn-outline-info {
  color: #5bc0de;
  background-image: none;
  background-color: transparent;
  border-color: #5bc0de; }
  .btn-outline-info:hover {
    color: #fff;
    background-color: #5bc0de;
    border-color: #5bc0de; }
  .btn-outline-info:focus, .btn-outline-info.focus {
    box-shadow: 0 0 0 2px rgba(91, 192, 222, 0.5); }
  .btn-outline-info.disabled, .btn-outline-info:disabled {
    color: #5bc0de;
    background-color: transparent; }
  .btn-outline-info:active, .btn-outline-info.active,
  .show > .btn-outline-info.dropdown-toggle {
    color: #fff;
    background-color: #5bc0de;
    border-color: #5bc0de; }

.btn-outline-success {
  color: #5cb85c;
  background-image: none;
  background-color: transparent;
  border-color: #5cb85c; }
  .btn-outline-success:hover {
    color: #fff;
    background-color: #5cb85c;
    border-color: #5cb85c; }
  .btn-outline-success:focus, .btn-outline-success.focus {
    box-shadow: 0 0 0 2px rgba(92, 184, 92, 0.5); }
  .btn-outline-success.disabled, .btn-outline-success:disabled {
    color: #5cb85c;
    background-color: transparent; }
  .btn-outline-success:active, .btn-outline-success.active,
  .show > .btn-outline-success.dropdown-toggle {
    color: #fff;
    background-color: #5cb85c;
    border-color: #5cb85c; }

.btn-outline-warning {
  color: #f0ad4e;
  background-image: none;
  background-color: transparent;
  border-color: #f0ad4e; }
  .btn-outline-warning:hover {
    color: #fff;
    background-color: #f0ad4e;
    border-color: #f0ad4e; }
  .btn-outline-warning:focus, .btn-outline-warning.focus {
    box-shadow: 0 0 0 2px rgba(240, 173, 78, 0.5); }
  .btn-outline-warning.disabled, .btn-outline-warning:disabled {
    color: #f0ad4e;
    background-color: transparent; }
  .btn-outline-warning:active, .btn-outline-warning.active,
  .show > .btn-outline-warning.dropdown-toggle {
    color: #fff;
    background-color: #f0ad4e;
    border-color: #f0ad4e; }

.btn-outline-danger {
  color: #d9534f;
  background-image: none;
  background-color: transparent;
  border-color: #d9534f; }
  .btn-outline-danger:hover {
    color: #fff;
    background-color: #d9534f;
    border-color: #d9534f; }
  .btn-outline-danger:focus, .btn-outline-danger.focus {
    box-shadow: 0 0 0 2px rgba(217, 83, 79, 0.5); }
  .btn-outline-danger.disabled, .btn-outline-danger:disabled {
    color: #d9534f;
    background-color: transparent; }
  .btn-outline-danger:active, .btn-outline-danger.active,
  .show > .btn-outline-danger.dropdown-toggle {
    color: #fff;
    background-color: #d9534f;
    border-color: #d9534f; }

.btn-link {
  font-weight: normal;
  color: #0275d8;
  border-radius: 0; }
  .btn-link, .btn-link:active, .btn-link.active, .btn-link:disabled {
    background-color: transparent; }
  .btn-link, .btn-link:focus, .btn-link:active {
    border-color: transparent; }
  .btn-link:hover {
    border-color: transparent; }
  .btn-link:focus, .btn-link:hover {
    color: #014c8c;
    text-decoration: underline;
    background-color: transparent; }
  .btn-link:disabled {
    color: #818a91; }
    .btn-link:disabled:focus, .btn-link:disabled:hover {
      text-decoration: none; }

.btn-lg, .btn-group-lg > .btn {
  padding: 0.75rem 1.5rem;
  font-size: 1.25rem;
  border-radius: 0.3rem; }

.btn-sm, .btn-group-sm > .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 0.2rem; }

.btn-block {
  display: block;
  width: 100%; }

.btn-block + .btn-block {
  margin-top: 0.5rem; }

input[type="submit"].btn-block,
input[type="reset"].btn-block,
input[type="button"].btn-block {
  width: 100%; }

.btn-group,
.btn-group-vertical {
  position: relative;
  display: inline-flex;
  vertical-align: middle; }
  .btn-group > .btn,
  .btn-group-vertical > .btn {
    position: relative;
    flex: 0 1 auto; }
    .btn-group > .btn:hover,
    .btn-group-vertical > .btn:hover {
      z-index: 2; }
    .btn-group > .btn:focus, .btn-group > .btn:active, .btn-group > .btn.active,
    .btn-group-vertical > .btn:focus,
    .btn-group-vertical > .btn:active,
    .btn-group-vertical > .btn.active {
      z-index: 2; }
  .btn-group .btn + .btn,
  .btn-group .btn + .btn-group,
  .btn-group .btn-group + .btn,
  .btn-group .btn-group + .btn-group,
  .btn-group-vertical .btn + .btn,
  .btn-group-vertical .btn + .btn-group,
  .btn-group-vertical .btn-group + .btn,
  .btn-group-vertical .btn-group + .btn-group {
    margin-left: -1px; }

.btn-toolbar {
  display: flex;
  justify-content: flex-start; }
  .btn-toolbar .input-group {
    width: auto; }

.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
  border-radius: 0; }

.btn-group > .btn:first-child {
  margin-left: 0; }
  .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
    border-bottom-right-radius: 0;
    border-top-right-radius: 0; }

.btn-group > .btn:last-child:not(:first-child),
.btn-group > .dropdown-toggle:not(:first-child) {
  border-bottom-left-radius: 0;
  border-top-left-radius: 0; }

.btn-group > .btn-group {
  float: left; }

.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
  border-radius: 0; }

.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child,
.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
  border-bottom-right-radius: 0;
  border-top-right-radius: 0; }

.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {
  border-bottom-left-radius: 0;
  border-top-left-radius: 0; }

.btn-group .dropdown-toggle:active,
.btn-group.open .dropdown-toggle {
  outline: 0; }

.btn + .dropdown-toggle-split {
  padding-right: 0.75rem;
  padding-left: 0.75rem; }
  .btn + .dropdown-toggle-split::after {
    margin-left: 0; }

.btn-sm + .dropdown-toggle-split, .btn-group-sm > .btn + .dropdown-toggle-split {
  padding-right: 0.375rem;
  padding-left: 0.375rem; }

.btn-lg + .dropdown-toggle-split, .btn-group-lg > .btn + .dropdown-toggle-split {
  padding-right: 1.125rem;
  padding-left: 1.125rem; }

.btn-group-vertical {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center; }
  .btn-group-vertical .btn,
  .btn-group-vertical .btn-group {
    width: 100%; }
  .btn-group-vertical > .btn + .btn,
  .btn-group-vertical > .btn + .btn-group,
  .btn-group-vertical > .btn-group + .btn,
  .btn-group-vertical > .btn-group + .btn-group {
    margin-top: -1px;
    margin-left: 0; }

.btn-group-vertical > .btn:not(:first-child):not(:last-child) {
  border-radius: 0; }

.btn-group-vertical > .btn:first-child:not(:last-child) {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0; }

.btn-group-vertical > .btn:last-child:not(:first-child) {
  border-top-right-radius: 0;
  border-top-left-radius: 0; }

.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
  border-radius: 0; }

.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child,
.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0; }

.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {
  border-top-right-radius: 0;
  border-top-left-radius: 0; }

[data-toggle="buttons"] > .btn input[type="radio"],
[data-toggle="buttons"] > .btn input[type="checkbox"],
[data-toggle="buttons"] > .btn-group > .btn input[type="radio"],
[data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] {
  position: absolute;
  clip: rect(0, 0, 0, 0);
  pointer-events: none; }


text:
<?php

use Eyewitness\Eye\Eye;
use Illuminate\Support\Facades\Route;

Route::group([
        'prefix' => config('eyewitness.base_uri', 'eyewitness'),
        'middleware' => (Eye::laravelVersionIs('>=', '5.2.0') ? [config('eyewitness.route_middleware')] : []),
        'namespace' => 'Eyewitness\Eye\Http\Controllers'
], function () {
    Route::get('/',         ['as' => 'eyewitness.login',             'uses' => 'AuthController@login']);
    Route::post('/',        ['as' => 'eyewitness.authenticate',      'uses' => 'AuthController@authenticate']);
    Route::post('logout',   ['as' => 'eyewitness.logout',            'uses' => 'AuthController@logout']);
});


text:
name             'msysgit'
maintainer       'Hirotaka Kato'
maintainer_email 'HirotakaKato@users.noreply.github.com'
license          'MIT'
description      'Installs/Configures Git for Windows'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version          '1.9.2'
supports         'windows'
depends          'ansicon'


text:
package org.picocontainer.defaults;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

import junit.framework.TestCase;

import org.picocontainer.ComponentAdapter;
import org.picocontainer.MutablePicoContainer;
import org.picocontainer.Parameter;
import org.picocontainer.PicoContainer;
import org.picocontainer.PicoVisitor;

/**
 * @author Michael Rimov
 */
public class TraversalCheckingVisitorTestCase extends TestCase {

    private MutablePicoContainer pico;

    private MutablePicoContainer child;

    private ComponentAdapter parentAdapter;

    private ComponentAdapter childAdapter;

    protected void setUp() throws Exception {
        super.setUp();

        pico = new DefaultPicoContainer();
        parentAdapter = pico.registerComponent(new SetterInjectionComponentAdapter(StringBuffer.class, StringBuffer.class, null));

        child = pico.makeChildContainer();

        childAdapter = child.registerComponent(new ConstructorInjectionComponentAdapter(ArrayList.class, ArrayList.class,
            new Parameter[] {
            new ConstantParameter(new Integer(3))
        }));
    }

    protected void tearDown() throws Exception {
        super.tearDown();
        child = null;
        pico = null;
        parentAdapter = null;
        childAdapter = null;
    }

    public void testVisitComponentAdapter() {
        final int numExpectedComponentAdapters = 2;
        final List allAdapters = new ArrayList();

        Set knownAdapters = new HashSet();
        knownAdapters.add(parentAdapter);
        knownAdapters.add(childAdapter);

        PicoVisitor containerCollector = new TraversalCheckingVisitor() {
            public void visitComponentAdapter(ComponentAdapter adapter) {
                super.visitComponentAdapter(adapter); //Calls checkTraversal for us.
                allAdapters.add(adapter);
            }
        };
        containerCollector.traverse(pico);

        assertEquals(numExpectedComponentAdapters, allAdapters.size());

        for (Iterator i = allAdapters.iterator(); i.hasNext(); ) {
            boolean knownAdapter = knownAdapters.remove(i.next());
            assertTrue("Encountered unknown adapter in collection: " + allAdapters.toString(), knownAdapter);
        }

        assertTrue("All adapters should match known adapters.", knownAdapters.size() == 0);
    }

    public void testVisitContainer() {
        final List allContainers = new ArrayList();
        final int expectedNumberOfContainers = 2;

        PicoVisitor containerCollector = new TraversalCheckingVisitor() {
            public void visitContainer(PicoContainer pico) {
                super.visitContainer(pico); //Calls checkTraversal for us.
                allContainers.add(pico);
            }
        };

        containerCollector.traverse(pico);

        assertTrue(allContainers.size() == expectedNumberOfContainers);

        Set knownContainers = new HashSet();
        knownContainers.add(pico);
        knownContainers.add(child);
        for (Iterator i = allContainers.iterator(); i.hasNext(); ) {
            PicoContainer oneContainer = (PicoContainer) i.next();
            boolean knownContainer = knownContainers.remove(oneContainer);
            assertTrue("Found a picocontainer that wasn't previously expected.", knownContainer);
        }

        assertTrue("All containers must match what is returned by traversal.",
            knownContainers.size() == 0);

    }

    public void testVisitParameter() {
        final List allParameters = new ArrayList();

        PicoVisitor containerCollector = new TraversalCheckingVisitor() {
            public void visitParameter(Parameter param) {
                super.visitParameter(param); //Calls checkTraversal for us.
                allParameters.add(param);
            }
        };

        containerCollector.traverse(pico);

        assertTrue(allParameters.size() == 1);
        assertTrue(allParameters.get(0) instanceof ConstantParameter);
        assertTrue( ( (ConstantParameter) allParameters.get(0)).resolveInstance(null, null, null) instanceof Integer);
        assertEquals(3, ( (Integer) ( (ConstantParameter) allParameters.get(0)).resolveInstance(null, null,
            null)).intValue());
    }

}


text:
module RailsAutocomplete
  class Query
    def initialize(model_class, options = {})
      @model_class = model_class
      @options = options
    end

    def search(term)
      field = options[:field]
      search_type = (options[:search_type].presence || :starts_with).to_sym

      term = case search_type
        when :starts_with then "#{term}%"
        when :ends_with then "%#{term}"
        else raise "Unknow search type #{search_type}"
      end

      model_class.where("lower(#{field}) LIKE ?", term).select(:id, field)
    end

    private
      attr_reader :model_class, :options
  end
end


text:
class GURL;

namespace net {

class ProxyInfo;
class ProxyServer;

// Delegate for setting up a connection.
class NET_EXPORT ProxyDelegate {
 public:
  ProxyDelegate() {
  }

  virtual ~ProxyDelegate() {
  }

  // Called as the proxy is being resolved for |url| for a |method| request.
  // The caller may pass an empty string to get method agnostic resoulution.
  // Allows the delegate to override the proxy resolution decision made by
  // ProxyResolutionService. The delegate may override the decision by modifying
  // the ProxyInfo |result|.
  virtual void OnResolveProxy(const GURL& url,
                              const std::string& method,
                              const ProxyRetryInfoMap& proxy_retry_info,
                              ProxyInfo* result) = 0;

  // Called when use of |bad_proxy| fails due to |net_error|. |net_error| is
  // the network error encountered, if any, and OK if the fallback was
  // for a reason other than a network error (e.g. the proxy service was
  // explicitly directed to skip a proxy).
  virtual void OnFallback(const ProxyServer& bad_proxy,
                          int net_error) = 0;

 private:
  DISALLOW_COPY_AND_ASSIGN(ProxyDelegate);
};

}  // namespace net

#endif  // NET_BASE_PROXY_DELEGATE_H_


text:
/* tslint:disable:no-bitwise */

export class Candidates {

    private _value = 512;

    public get(candidate?: number): number | boolean {
        return typeof candidate === 'undefined' ? this._value : !!((1 << candidate) & this._value);
    }

    public set(candidate?: number): void {
        this._value = typeof candidate === 'undefined' ? 512 : (1 << candidate) ^ this._value;
    }

    public unset(candidate?: number): void {
        this._value = typeof candidate === 'undefined' ? 0 : ~(1 << candidate) & this._value;
    }

    public some(): boolean {
        return this._value > 0;
    }

    public none(): boolean {
        return this._value === 0;
    }

}


text:
/* ----------------------------------------------------
   created with http://www.codeandweb.com/texturepacker
   ----------------------------------------------------
   $TexturePacker:SmartUpdate:f11cfb16709aeaaaadb3f4fdba1e76e5:e1dd84566bbda258d73b5be63c28e8bb:8ef7a5523759848b8f2b1093d16b33ea$
   ----------------------------------------------------

   usage:

   replace {-spritename-} with the sprite you like to use

*/

.sprite {display:inline-block; overflow:hidden; background-repeat: no-repeat;background-image:url(texture.png);}

.fangkuang {width:771px; height:632px; background-position: -1px -1px}
.lang {width:597px; height:342px; background-position: -1px -635px}
.lang_1 {width:265px; height:367px; background-position: -600px -720px}
.lang_hua {width:226px; height:72px; background-position: -554px -1165px}
.pangbai1a {width:855px; height:50px; background-position: -1px -1239px}
.pangbai1b {width:855px; height:50px; background-position: -1px -1291px}
.zhu1 {width:551px; height:246px; background-position: -1px -979px}
.zhu2 {width:179px; height:237px; background-position: -774px -1px}
.zhu3 {width:173px; height:239px; background-position: -774px -240px}
.zhu3_1 {width:172px; height:237px; background-position: -774px -481px}
.zhu3_hua {width:377px; height:74px; background-position: -554px -1089px}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the DITA Open Toolkit project.

Copyright 2011 Jarno Elovirta

See the accompanying LICENSE file for applicable license.
-->
<plugin id="org.dita.javahelp">
  <transtype name="javahelp" extends="base-html" desc="JavaHelp">
    <param name="args.javahelp.map" desc="Specifies the name of the ditamap file for a JavaHelp project." type="file"/>
    <param name="args.javahelp.toc" desc="Specifies the name of the file containing the TOC in your JavaHelp output." type="file"/>
  </transtype>
  <require plugin="org.dita.xhtml"/>
  <feature extension="dita.conductor.target.relative" file="conductor.xml"/>
</plugin>


text:
<?php

$maindir = "../../../";
include($maindir."conexion/config.inc.php");

  require_once($maindir."funciones/check_session.php");

  require_once($maindir."funciones/timeout.php");

  if(!isset( $_SESSION['user_id'] ))  {
    header('Location: '.$maindir.'login/logout.php?code=100');
    exit();
  }

  try{
    $cod_periodo = $_POST['cod_periodo'];
    $cod_estado = $_POST['cod_estado'];
    $no_empleado = $_POST['no_empleado'];
    $cod_carga = $_POST['cod_carga'];
    $anio = $_POST['anio'];

    $queryString = "SELECT N_Identidad FROM empleado e WHERE no_empleado='".$no_empleado."'";
    $query = mysql_query($queryString);
    $row = mysql_fetch_assoc($query);

    $dni_empleado = $row['N_Identidad'];

    $mensaje = actualizarCarga($cod_carga,$cod_periodo,$cod_estado,$no_empleado,$dni_empleado,$anio);
    echo $mensaje;
  }catch(PDOExecption $e){
    $mensaje = "<strong>¡Error! </strong> Error al actualizar la carga.";
    $codMensaje = 0;
    echo $mensaje;
    http_response_code(500);
  }

  function actualizarCarga($cod_carga,$cod_periodo,$cod_estado,$no_empleado,$dni_empleado,$anio){
    $queryString = "UPDATE ca_cargas_academicas SET cod_periodo=".$cod_periodo.", cod_estado=".$cod_estado.
                   ", no_empleado='".$no_empleado."', dni_empleado='".$dni_empleado."', anio=".$anio.
                   " WHERE codigo=".$cod_carga;

    $query = mysql_query($queryString);

    if($query){
      $mensaje = "<strong>¡Éxito! </strong> Se ha actualizado la carga.";
    }
    else{
      $mensaje = "<strong>¡Error! </strong> Error al actualizar la carga.";
      http_response_code(400);
    }
    return $mensaje;
  }
?>


text:
package org.springframework.cloud.task.batch.listener.support;

import java.util.Date;
import java.util.Objects;

import org.springframework.batch.core.JobParameter;

/**
 * This is a JobParameter DTO created so that a
 * {@link org.springframework.batch.core.JobParameter} can be serialized into Json without
 * having to add mixins to an ObjectMapper.
 *
 * @author Glenn Renfro
 */
public class JobParameterEvent {

	private Object parameter;

	private boolean identifying;

	public JobParameterEvent() {
	}

	public JobParameterEvent(JobParameter jobParameter) {
		this.parameter = jobParameter.getValue();
		this.identifying = jobParameter.isIdentifying();
	}

	public boolean isIdentifying() {
		return this.identifying;
	}

	/**
	 * @return the value contained within this JobParameter.
	 */
	public Object getValue() {

		if (this.parameter != null && this.parameter.getClass().isInstance(Date.class)) {
			return new Date(((Date) this.parameter).getTime());
		}
		else {
			return this.parameter;
		}
	}

	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof JobParameterEvent)) {
			return false;
		}

		if (this == obj) {
			return true;
		}

		JobParameterEvent rhs = (JobParameterEvent) obj;
		return Objects.equals(this.parameter, rhs.parameter);
	}

	@Override
	public String toString() {
		return this.parameter == null ? null : this.parameter.toString();
	}

	@Override
	public int hashCode() {
		final int BASE_HASH = 7;
		final int MULTIPLIER_HASH = 21;
		return BASE_HASH + MULTIPLIER_HASH * this.parameter.hashCode();
	}

}


text:
@interface PodsDummy_Pods_ObjectiveGoal : NSObject
@end
@implementation PodsDummy_Pods_ObjectiveGoal
@end


text:
package com.renren.mobile.chat.ui.contact;

public class C_ContactsParse {

}


text:
#include "matchingAlgorithm.h"

namespace TripRipper
{
  MatchingAlgorithm::MatchingAlgorithm()
  {
  }

  MatchingAlgorithm::~MatchingAlgorithm()
  {
  }
}


text:
"use strict";

var webpack = require("webpack");
var Directory = require("./inc/Directory");

var config = {
    entry: "./ui/Router.jsx",
    resolve: {
        extensions: ["", ".js", ".jsx"]
    },
    output: {
        path: "./public/",
        filename: "bundle.js"
    },
    module: {
        loaders: [
            {
                test: /(models\/.*|inc)\/.*\.js$/,
                exclude: /node_modules/,
                loader: "babel-loader",
                query: {
                    presets: ["es2015", "react"]
                }
            },{
                test: /\.css$/,
                loader: "style-loader!css-loader"
            },{
                test: /\.jsx$/,
                exclude: /node_modules/,
                loader: "babel-loader",
                query: {
                    presets: ["es2015", "react"]
                }
            }
        ]
    },
    plugins: [
        new webpack.DefinePlugin({
            "process.env": {
                NODE_ENV: JSON.stringify(process.env.NODE_ENV || ""),
                __BROWSER: true
            }
        })
    ]
};

if (process.env.NODE_ENV === "production") {
    config.plugins.push(new webpack.optimize.OccurenceOrderPlugin());
    config.plugins.push(
        new webpack.optimize.UglifyJsPlugin({
            compress: {
                warnings: false
            },
            mangle: {
                except: Directory.names()
            }
        })
    );
}
else {
    // config.devtool = "source-map";
    config.devtool = "eval-cheap-module-source-map";
}

require("./redis/client").disconnect();

module.exports = config;


text:
Sinatra app for extracting dependencies from `Carthage`, `Carthage.private` and `Carthage.resolved` files for [Libraries.io](https://libraries.io) over http.

It uses [rogdl](https://libraries.io/rubygems/rogdl) to do the heavy lifting of parsing the files.

## Development

Source hosted at [GitHub](http://github.com/librariesio/carthage_parser).
Report issues/feature requests on [GitHub Issues](http://github.com/librariesio/carthage_parser/issues). Follow us on Twitter [@librariesio](https://twitter.com/librariesio). We also hangout on [Gitter](https://gitter.im/librariesio/carthage_parser).

### Getting Started

New to Ruby? No worries! You can follow these instructions to install a local server, or you can use the included Vagrant setup.

#### Installing a Local Server

First things first, you'll need to install Ruby 2.5.0. I recommend using the excellent [rbenv](https://github.com/sstephenson/rbenv),
and [ruby-build](https://github.com/sstephenson/ruby-build)

```bash
rbenv install 2.5.0
rbenv global 2.5.0
```

## Tests

Tests can be ran with `bundle exec rake`

### Note on Patches/Pull Requests

 * Fork the project.
 * Make your feature addition or bug fix.
 * Add tests for it. This is important so I don't break it in a
   future version unintentionally.
 * Add documentation if necessary.
 * Commit, do not change procfile, version, or history.
 * Send a pull request. Bonus points for topic branches.

## Copyright

Copyright (c) 2016 Andrew Nesbitt. See [LICENSE](https://github.com/librariesio/carthage_parser/blob/master/LICENSE) for details.


text:
This package contains the Looker visualizations that are built on top of [Airbnb's visx](https://airbnb.io/visx/) charting primitives.
As Looker Visualization Components are designed to be library agnostic, in the long term we will support multiple variations of our core visualizations depending on library preference.

## Installation

If you are working with Looker Visualizations Components, you will likely not need to reference the this package directly. But if you would like to import any of our Visx charts to extend or use outside of the context you can install them with npm or Yarn:

- **npm:** `npm install @looker/visualizations-visx`
- **Yarn:** `yarn add @looker/visualizations-visx`

You'll also need to satisfy a few peer dependencies - Looker/components, React, & Styled Components:

- **npm:** `npm install @looker/components react react-dom styled-components`
- **Yarn:** `yarn add @looker/components react react-dom styled-components`

## Getting Started

```jsx
import { Area, Line, Scatter, Sparkline } from '@looker/visualizations-visx'
```

Please see the documentation for [@looker/visualizations](https://github.com/looker-open-source/components/tree/main/packages/visualizations) for instructions on getting started with Looker Visualization Components. After that, be sure to check out the [Looker Developer Portal](https://developers.looker.com/components/visualization-components) to see more configuration options, or view the [extension framework documentation](https://docs.looker.com/data-modeling/extension-framework/vis-components) for more advanced usage.


text:
#include <memory>
#include <string>

#include BOSS_WEBRTC_U_api__candidate_h //original-code:"api/candidate.h"
#include BOSS_WEBRTC_U_api__jsepicecandidate_h //original-code:"api/jsepicecandidate.h"
#include BOSS_WEBRTC_U_api__jsepsessiondescription_h //original-code:"api/jsepsessiondescription.h"
#include BOSS_WEBRTC_U_p2p__base__p2pconstants_h //original-code:"p2p/base/p2pconstants.h"
#include BOSS_WEBRTC_U_p2p__base__port_h //original-code:"p2p/base/port.h"
#include BOSS_WEBRTC_U_pc__mediasession_h //original-code:"pc/mediasession.h"
#include BOSS_WEBRTC_U_pc__sessiondescription_h //original-code:"pc/sessiondescription.h"
#include BOSS_WEBRTC_U_pc__webrtcsdp_h //original-code:"pc/webrtcsdp.h"
#include BOSS_WEBRTC_U_rtc_base__gunit_h //original-code:"rtc_base/gunit.h"
#include BOSS_WEBRTC_U_rtc_base__ptr_util_h //original-code:"rtc_base/ptr_util.h"
#include BOSS_WEBRTC_U_rtc_base__stringencode_h //original-code:"rtc_base/stringencode.h"

using cricket::MediaProtocolType;
using ::testing::Values;
using webrtc::IceCandidateCollection;
using webrtc::IceCandidateInterface;
using webrtc::JsepIceCandidate;
using webrtc::JsepSessionDescription;
using webrtc::SdpType;
using webrtc::SessionDescriptionInterface;

static const char kCandidateUfrag[] = "ufrag";
static const char kCandidatePwd[] = "pwd";
static const char kCandidateUfragVoice[] = "ufrag_voice";
static const char kCandidatePwdVoice[] = "pwd_voice";
static const char kCandidateUfragVideo[] = "ufrag_video";
static const char kCandidatePwdVideo[] = "pwd_video";
static const char kCandidateFoundation[] = "a0+B/1";
static const uint32_t kCandidatePriority = 2130706432U;  // pref = 1.0
static const uint32_t kCandidateGeneration = 2;

// This creates a session description with both audio and video media contents.
// In SDP this is described by two m lines, one audio and one video.
static cricket::SessionDescription* CreateCricketSessionDescription() {
  cricket::SessionDescription* desc(new cricket::SessionDescription());
  // AudioContentDescription
  std::unique_ptr<cricket::AudioContentDescription> audio(
      new cricket::AudioContentDescription());

  // VideoContentDescription
  std::unique_ptr<cricket::VideoContentDescription> video(
      new cricket::VideoContentDescription());

  audio->AddCodec(cricket::AudioCodec(103, "ISAC", 16000, 0, 0));
  desc->AddContent(cricket::CN_AUDIO, MediaProtocolType::kRtp, audio.release());

  video->AddCodec(cricket::VideoCodec(120, "VP8"));
  desc->AddContent(cricket::CN_VIDEO, MediaProtocolType::kRtp, video.release());

  EXPECT_TRUE(desc->AddTransportInfo(cricket::TransportInfo(
      cricket::CN_AUDIO,
      cricket::TransportDescription(
          std::vector<std::string>(), kCandidateUfragVoice, kCandidatePwdVoice,
          cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_NONE, NULL))));
  EXPECT_TRUE(desc->AddTransportInfo(cricket::TransportInfo(
      cricket::CN_VIDEO,
      cricket::TransportDescription(
          std::vector<std::string>(), kCandidateUfragVideo, kCandidatePwdVideo,
          cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_NONE, NULL))));
  return desc;
}

class JsepSessionDescriptionTest : public testing::Test {
 protected:
  virtual void SetUp() {
    int port = 1234;
    rtc::SocketAddress address("127.0.0.1", port++);
    cricket::Candidate candidate(cricket::ICE_CANDIDATE_COMPONENT_RTP, "udp",
                                 address, 1, "", "", "local", 0, "1");
    candidate_ = candidate;
    const std::string session_id =
        rtc::ToString(rtc::CreateRandomId64());
    const std::string session_version =
        rtc::ToString(rtc::CreateRandomId());
    jsep_desc_ = rtc::MakeUnique<JsepSessionDescription>(SdpType::kOffer);
    ASSERT_TRUE(jsep_desc_->Initialize(CreateCricketSessionDescription(),
        session_id, session_version));
  }

  std::string Serialize(const SessionDescriptionInterface* desc) {
    std::string sdp;
    EXPECT_TRUE(desc->ToString(&sdp));
    EXPECT_FALSE(sdp.empty());
    return sdp;
  }

  std::unique_ptr<SessionDescriptionInterface> DeSerialize(
      const std::string& sdp) {
    auto jsep_desc = rtc::MakeUnique<JsepSessionDescription>(SdpType::kOffer);
    EXPECT_TRUE(webrtc::SdpDeserialize(sdp, jsep_desc.get(), nullptr));
    return std::move(jsep_desc);
  }

  cricket::Candidate candidate_;
  std::unique_ptr<JsepSessionDescription> jsep_desc_;
};

// Test that number_of_mediasections() returns the number of media contents in
// a session description.
TEST_F(JsepSessionDescriptionTest, CheckSessionDescription) {
  EXPECT_EQ(2u, jsep_desc_->number_of_mediasections());
}

// Test that we can add a candidate to a session description without MID.
TEST_F(JsepSessionDescriptionTest, AddCandidateWithoutMid) {
  JsepIceCandidate jsep_candidate("", 0, candidate_);
  EXPECT_TRUE(jsep_desc_->AddCandidate(&jsep_candidate));
  const IceCandidateCollection* ice_candidates = jsep_desc_->candidates(0);
  ASSERT_TRUE(ice_candidates != NULL);
  EXPECT_EQ(1u, ice_candidates->count());
  const IceCandidateInterface* ice_candidate = ice_candidates->at(0);
  ASSERT_TRUE(ice_candidate != NULL);
  candidate_.set_username(kCandidateUfragVoice);
  candidate_.set_password(kCandidatePwdVoice);
  EXPECT_TRUE(ice_candidate->candidate().IsEquivalent(candidate_));
  EXPECT_EQ(0, ice_candidate->sdp_mline_index());
  EXPECT_EQ(0u, jsep_desc_->candidates(1)->count());
}

// Test that we can add and remove candidates to a session description with
// MID. Removing candidates requires MID (transport_name).
TEST_F(JsepSessionDescriptionTest, AddAndRemoveCandidatesWithMid) {
  // mid and m-line index don't match, in this case mid is preferred.
  std::string mid = "video";
  JsepIceCandidate jsep_candidate(mid, 0, candidate_);
  EXPECT_TRUE(jsep_desc_->AddCandidate(&jsep_candidate));
  EXPECT_EQ(0u, jsep_desc_->candidates(0)->count());
  const IceCandidateCollection* ice_candidates = jsep_desc_->candidates(1);
  ASSERT_TRUE(ice_candidates != NULL);
  EXPECT_EQ(1u, ice_candidates->count());
  const IceCandidateInterface* ice_candidate = ice_candidates->at(0);
  ASSERT_TRUE(ice_candidate != NULL);
  candidate_.set_username(kCandidateUfragVideo);
  candidate_.set_password(kCandidatePwdVideo);
  EXPECT_TRUE(ice_candidate->candidate().IsEquivalent(candidate_));
  // The mline index should have been updated according to mid.
  EXPECT_EQ(1, ice_candidate->sdp_mline_index());

  std::vector<cricket::Candidate> candidates(1, candidate_);
  candidates[0].set_transport_name(mid);
  EXPECT_EQ(1u, jsep_desc_->RemoveCandidates(candidates));
  EXPECT_EQ(0u, jsep_desc_->candidates(0)->count());
  EXPECT_EQ(0u, jsep_desc_->candidates(1)->count());
}

TEST_F(JsepSessionDescriptionTest, AddCandidateAlreadyHasUfrag) {
  candidate_.set_username(kCandidateUfrag);
  candidate_.set_password(kCandidatePwd);
  JsepIceCandidate jsep_candidate("audio", 0, candidate_);
  EXPECT_TRUE(jsep_desc_->AddCandidate(&jsep_candidate));
  const IceCandidateCollection* ice_candidates = jsep_desc_->candidates(0);
  ASSERT_TRUE(ice_candidates != NULL);
  EXPECT_EQ(1u, ice_candidates->count());
  const IceCandidateInterface* ice_candidate = ice_candidates->at(0);
  ASSERT_TRUE(ice_candidate != NULL);
  candidate_.set_username(kCandidateUfrag);
  candidate_.set_password(kCandidatePwd);
  EXPECT_TRUE(ice_candidate->candidate().IsEquivalent(candidate_));

  EXPECT_EQ(0u, jsep_desc_->candidates(1)->count());
}

// Test that we can not add a candidate if there is no corresponding media
// content in the session description.
TEST_F(JsepSessionDescriptionTest, AddBadCandidate) {
  JsepIceCandidate bad_candidate1("", 55, candidate_);
  EXPECT_FALSE(jsep_desc_->AddCandidate(&bad_candidate1));

  JsepIceCandidate bad_candidate2("some weird mid", 0, candidate_);
  EXPECT_FALSE(jsep_desc_->AddCandidate(&bad_candidate2));
}

// Tests that repeatedly adding the same candidate, with or without credentials,
// does not increase the number of candidates in the description.
TEST_F(JsepSessionDescriptionTest, AddCandidateDuplicates) {
  JsepIceCandidate jsep_candidate("", 0, candidate_);
  EXPECT_TRUE(jsep_desc_->AddCandidate(&jsep_candidate));
  EXPECT_EQ(1u, jsep_desc_->candidates(0)->count());

  // Add the same candidate again.  It should be ignored.
  EXPECT_TRUE(jsep_desc_->AddCandidate(&jsep_candidate));
  EXPECT_EQ(1u, jsep_desc_->candidates(0)->count());

  // Create a new candidate, identical except that the ufrag and pwd are now
  // populated.
  candidate_.set_username(kCandidateUfragVoice);
  candidate_.set_password(kCandidatePwdVoice);
  JsepIceCandidate jsep_candidate_with_credentials("", 0, candidate_);

  // This should also be identified as redundant and ignored.
  EXPECT_TRUE(jsep_desc_->AddCandidate(&jsep_candidate_with_credentials));
  EXPECT_EQ(1u, jsep_desc_->candidates(0)->count());
}

// Test that we can serialize a JsepSessionDescription and deserialize it again.
TEST_F(JsepSessionDescriptionTest, SerializeDeserialize) {
  std::string sdp = Serialize(jsep_desc_.get());

  auto parsed_jsep_desc = DeSerialize(sdp);
  EXPECT_EQ(2u, parsed_jsep_desc->number_of_mediasections());

  std::string parsed_sdp = Serialize(parsed_jsep_desc.get());
  EXPECT_EQ(sdp, parsed_sdp);
}

// Tests that we can serialize and deserialize a JsepSesssionDescription
// with candidates.
TEST_F(JsepSessionDescriptionTest, SerializeDeserializeWithCandidates) {
  std::string sdp = Serialize(jsep_desc_.get());

  // Add a candidate and check that the serialized result is different.
  JsepIceCandidate jsep_candidate("audio", 0, candidate_);
  EXPECT_TRUE(jsep_desc_->AddCandidate(&jsep_candidate));
  std::string sdp_with_candidate = Serialize(jsep_desc_.get());
  EXPECT_NE(sdp, sdp_with_candidate);

  auto parsed_jsep_desc = DeSerialize(sdp_with_candidate);
  std::string parsed_sdp_with_candidate = Serialize(parsed_jsep_desc.get());

  EXPECT_EQ(sdp_with_candidate, parsed_sdp_with_candidate);
}

// TODO(zhihuang): Modify these tests. These are used to verify that after
// adding the candidates, the connection_address field is set correctly. Modify
// those so that the "connection address" is tested directly.
// Tests serialization of SDP with only IPv6 candidates and verifies that IPv6
// is used as default address in c line according to preference.
TEST_F(JsepSessionDescriptionTest, SerializeSessionDescriptionWithIPv6Only) {
  // Stun has a high preference than local host.
  cricket::Candidate candidate1(
      cricket::ICE_CANDIDATE_COMPONENT_RTP, "udp",
      rtc::SocketAddress("::1", 1234), kCandidatePriority, "", "",
      cricket::STUN_PORT_TYPE, kCandidateGeneration, kCandidateFoundation);
  cricket::Candidate candidate2(
      cricket::ICE_CANDIDATE_COMPONENT_RTP, "udp",
      rtc::SocketAddress("::2", 1235), kCandidatePriority, "", "",
      cricket::LOCAL_PORT_TYPE, kCandidateGeneration, kCandidateFoundation);

  JsepIceCandidate jice1("audio", 0, candidate1);
  JsepIceCandidate jice2("audio", 0, candidate2);
  JsepIceCandidate jice3("video", 0, candidate1);
  JsepIceCandidate jice4("video", 0, candidate2);
  ASSERT_TRUE(jsep_desc_->AddCandidate(&jice1));
  ASSERT_TRUE(jsep_desc_->AddCandidate(&jice2));
  ASSERT_TRUE(jsep_desc_->AddCandidate(&jice3));
  ASSERT_TRUE(jsep_desc_->AddCandidate(&jice4));
  std::string message = Serialize(jsep_desc_.get());

  // Should have a c line like this one.
  EXPECT_NE(message.find("c=IN IP6 ::1"), std::string::npos);
  // Shouldn't have a IP4 c line.
  EXPECT_EQ(message.find("c=IN IP4"), std::string::npos);
}

// Tests serialization of SDP with both IPv4 and IPv6 candidates and
// verifies that IPv4 is used as default address in c line even if the
// preference of IPv4 is lower.
TEST_F(JsepSessionDescriptionTest,
       SerializeSessionDescriptionWithBothIPFamilies) {
  cricket::Candidate candidate_v4(
      cricket::ICE_CANDIDATE_COMPONENT_RTP, "udp",
      rtc::SocketAddress("192.168.1.5", 1234), kCandidatePriority, "", "",
      cricket::STUN_PORT_TYPE, kCandidateGeneration, kCandidateFoundation);
  cricket::Candidate candidate_v6(
      cricket::ICE_CANDIDATE_COMPONENT_RTP, "udp",
      rtc::SocketAddress("::1", 1234), kCandidatePriority, "", "",
      cricket::LOCAL_PORT_TYPE, kCandidateGeneration, kCandidateFoundation);

  JsepIceCandidate jice_v4("audio", 0, candidate_v4);
  JsepIceCandidate jice_v6("audio", 0, candidate_v6);
  JsepIceCandidate jice_v4_video("video", 0, candidate_v4);
  JsepIceCandidate jice_v6_video("video", 0, candidate_v6);
  ASSERT_TRUE(jsep_desc_->AddCandidate(&jice_v4));
  ASSERT_TRUE(jsep_desc_->AddCandidate(&jice_v6));
  ASSERT_TRUE(jsep_desc_->AddCandidate(&jice_v4_video));
  ASSERT_TRUE(jsep_desc_->AddCandidate(&jice_v6_video));
  std::string message = Serialize(jsep_desc_.get());

  // Should have a c line like this one.
  EXPECT_NE(message.find("c=IN IP4 192.168.1.5"), std::string::npos);
  // Shouldn't have a IP6 c line.
  EXPECT_EQ(message.find("c=IN IP6"), std::string::npos);
}

// Tests serialization of SDP with both UDP and TCP candidates and
// verifies that UDP is used as default address in c line even if the
// preference of UDP is lower.
TEST_F(JsepSessionDescriptionTest,
       SerializeSessionDescriptionWithBothProtocols) {
  // Stun has a high preference than local host.
  cricket::Candidate candidate1(
      cricket::ICE_CANDIDATE_COMPONENT_RTP, "tcp",
      rtc::SocketAddress("::1", 1234), kCandidatePriority, "", "",
      cricket::STUN_PORT_TYPE, kCandidateGeneration, kCandidateFoundation);
  cricket::Candidate candidate2(
      cricket::ICE_CANDIDATE_COMPONENT_RTP, "udp",
      rtc::SocketAddress("fe80::1234:5678:abcd:ef12", 1235), kCandidatePriority,
      "", "", cricket::LOCAL_PORT_TYPE, kCandidateGeneration,
      kCandidateFoundation);

  JsepIceCandidate jice1("audio", 0, candidate1);
  JsepIceCandidate jice2("audio", 0, candidate2);
  JsepIceCandidate jice3("video", 0, candidate1);
  JsepIceCandidate jice4("video", 0, candidate2);
  ASSERT_TRUE(jsep_desc_->AddCandidate(&jice1));
  ASSERT_TRUE(jsep_desc_->AddCandidate(&jice2));
  ASSERT_TRUE(jsep_desc_->AddCandidate(&jice3));
  ASSERT_TRUE(jsep_desc_->AddCandidate(&jice4));
  std::string message = Serialize(jsep_desc_.get());

  // Should have a c line like this one.
  EXPECT_NE(message.find("c=IN IP6 fe80::1234:5678:abcd:ef12"),
            std::string::npos);
  // Shouldn't have a IP4 c line.
  EXPECT_EQ(message.find("c=IN IP4"), std::string::npos);
}

// Tests serialization of SDP with only TCP candidates and verifies that
// null IPv4 is used as default address in c line.
TEST_F(JsepSessionDescriptionTest, SerializeSessionDescriptionWithTCPOnly) {
  // Stun has a high preference than local host.
  cricket::Candidate candidate1(
      cricket::ICE_CANDIDATE_COMPONENT_RTP, "tcp",
      rtc::SocketAddress("::1", 1234), kCandidatePriority, "", "",
      cricket::STUN_PORT_TYPE, kCandidateGeneration, kCandidateFoundation);
  cricket::Candidate candidate2(
      cricket::ICE_CANDIDATE_COMPONENT_RTP, "tcp",
      rtc::SocketAddress("::2", 1235), kCandidatePriority, "", "",
      cricket::LOCAL_PORT_TYPE, kCandidateGeneration, kCandidateFoundation);

  JsepIceCandidate jice1("audio", 0, candidate1);
  JsepIceCandidate jice2("audio", 0, candidate2);
  JsepIceCandidate jice3("video", 0, candidate1);
  JsepIceCandidate jice4("video", 0, candidate2);
  ASSERT_TRUE(jsep_desc_->AddCandidate(&jice1));
  ASSERT_TRUE(jsep_desc_->AddCandidate(&jice2));
  ASSERT_TRUE(jsep_desc_->AddCandidate(&jice3));
  ASSERT_TRUE(jsep_desc_->AddCandidate(&jice4));

  std::string message = Serialize(jsep_desc_.get());
  EXPECT_EQ(message.find("c=IN IP6 ::3"), std::string::npos);
  // Should have a c line like this one when no any default exists.
  EXPECT_NE(message.find("c=IN IP4 0.0.0.0"), std::string::npos);
}

// Tests that the connection address will be correctly set when the Candidate is
// removed.
TEST_F(JsepSessionDescriptionTest, RemoveCandidateAndSetConnectionAddress) {
  cricket::Candidate candidate1(
      cricket::ICE_CANDIDATE_COMPONENT_RTP, "udp",
      rtc::SocketAddress("::1", 1234), kCandidatePriority, "", "",
      cricket::LOCAL_PORT_TYPE, kCandidateGeneration, kCandidateFoundation);
  candidate1.set_transport_name("audio");

  cricket::Candidate candidate2(
      cricket::ICE_CANDIDATE_COMPONENT_RTP, "tcp",
      rtc::SocketAddress("::2", 1235), kCandidatePriority, "", "",
      cricket::LOCAL_PORT_TYPE, kCandidateGeneration, kCandidateFoundation);
  candidate2.set_transport_name("audio");

  cricket::Candidate candidate3(
      cricket::ICE_CANDIDATE_COMPONENT_RTP, "udp",
      rtc::SocketAddress("192.168.1.1", 1236), kCandidatePriority, "", "",
      cricket::LOCAL_PORT_TYPE, kCandidateGeneration, kCandidateFoundation);
  candidate3.set_transport_name("audio");

  JsepIceCandidate jice1("audio", 0, candidate1);
  JsepIceCandidate jice2("audio", 0, candidate2);
  JsepIceCandidate jice3("audio", 0, candidate3);

  size_t audio_index = 0;
  auto media_desc =
      jsep_desc_->description()->contents()[audio_index].media_description();

  ASSERT_TRUE(jsep_desc_->AddCandidate(&jice1));
  ASSERT_TRUE(jsep_desc_->AddCandidate(&jice2));
  ASSERT_TRUE(jsep_desc_->AddCandidate(&jice3));

  std::vector<cricket::Candidate> candidates;
  EXPECT_EQ("192.168.1.1:1236", media_desc->connection_address().ToString());

  candidates.push_back(candidate3);
  ASSERT_TRUE(jsep_desc_->RemoveCandidates(candidates));
  EXPECT_EQ("[::1]:1234", media_desc->connection_address().ToString());

  candidates.clear();
  candidates.push_back(candidate2);
  ASSERT_TRUE(jsep_desc_->RemoveCandidates(candidates));
  EXPECT_EQ("[::1]:1234", media_desc->connection_address().ToString());

  candidates.clear();
  candidates.push_back(candidate1);
  ASSERT_TRUE(jsep_desc_->RemoveCandidates(candidates));
  EXPECT_EQ("0.0.0.0:9", media_desc->connection_address().ToString());
}

class EnumerateAllSdpTypesTest : public ::testing::Test,
                                 public ::testing::WithParamInterface<SdpType> {
};

TEST_P(EnumerateAllSdpTypesTest, TestIdentity) {
  SdpType type = GetParam();

  const char* str = webrtc::SdpTypeToString(type);
  EXPECT_EQ(type, webrtc::SdpTypeFromString(str));
}

INSTANTIATE_TEST_CASE_P(JsepSessionDescriptionTest,
                        EnumerateAllSdpTypesTest,
                        Values(SdpType::kOffer,
                               SdpType::kPrAnswer,
                               SdpType::kAnswer));


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/res-auto"
    android:id="@+id/coordinatorLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <android.support.v7.widget.Toolbar
            android:id="@+id/more_info_tool_bar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="@color/colorPrimary">

            <ImageView
                android:layout_width="@dimen/toolbar_image_height"
                android:layout_height="@dimen/toolbar_image_height"
                android:layout_marginBottom="@dimen/toolbar_image_margin"
                android:layout_marginStart="@dimen/toolbar_image_margin"
                android:layout_marginTop="@dimen/toolbar_image_margin"
                android:contentDescription="@string/accessibility_logo"
                android:src="@mipmap/ic_launcher" />

            <TextView
                android:id="@+id/user_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/toolbar_title_left_margin"
                android:text="@string/profile_menu"
                android:textAppearance="@style/TextAppearance.Toolbar" />
        </android.support.v7.widget.Toolbar>
    </android.support.design.widget.AppBarLayout>

    <android.support.v4.widget.NestedScrollView
        android:id="@+id/myScrollingContent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        ads:layout_behavior="@string/appbar_scrolling_view_behavior">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <de.hdodenhof.circleimageview.CircleImageView xmlns:app="http://schemas.android.com/apk/res-auto"
                android:id="@+id/profile_image"
                android:layout_width="96dp"
                android:layout_height="96dp"
                android:layout_gravity="center_horizontal"
                android:paddingTop="24dp"
                android:src="@drawable/ic_perm_identity_black_24px"
                app:civ_border_color="@color/picker_red"
                app:civ_border_width="2dp" />

            <TextView
                android:id="@+id/profile_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:paddingTop="32dp"
                android:textAppearance="@style/TextAppearance.Toolbar" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:paddingTop="48dp">

                <ImageView
                    android:id="@+id/feedback"
                    android:layout_width="0dp"
                    android:layout_height="32dp"
                    android:layout_weight="1"
                    android:background="?attr/selectableItemBackground"
                    android:clickable="true"
                    android:contextClickable="true"
                    android:src="@drawable/ic_envelope" />

                <ImageView
                    android:id="@+id/invite"
                    android:layout_width="0dp"
                    android:layout_height="32dp"
                    android:layout_weight="1"
                    android:background="?attr/selectableItemBackground"
                    android:clickable="true"
                    android:src="@drawable/ic_share" />

                <ImageView
                    android:id="@+id/rate_the_app"
                    android:layout_width="0dp"
                    android:layout_height="32dp"
                    android:layout_weight="1"
                    android:background="?attr/selectableItemBackground"
                    android:clickable="true"
                    android:src="@drawable/ic_favorites" />

                <ImageView
                    android:id="@+id/about"
                    android:layout_width="0dp"
                    android:layout_height="32dp"
                    android:layout_weight="1"
                    android:background="?attr/selectableItemBackground"
                    android:clickable="true"
                    android:src="@drawable/ic_information" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:paddingTop="12dp">

                <TextView
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:gravity="center"
                    android:text="@string/feedback_string" />

                <TextView
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:gravity="center"
                    android:text="@string/invite" />

                <TextView
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:gravity="center"
                    android:text="@string/rate" />

                <TextView
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:gravity="center"
                    android:text="@string/about" />

            </LinearLayout>

            <Button
                android:id="@+id/logout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="20dp"
                android:layout_marginLeft="40dp"
                android:layout_marginRight="40dp"
                android:layout_marginTop="100dp"
                android:background="@color/tw__composer_white"
                android:includeFontPadding="false"
                android:minHeight="32dp"
                android:minWidth="32dp"
                android:text="@string/logout"
                android:textAppearance="@style/TextAppearance.Toolbar"
                android:textColor="@color/grey" />
            <com.google.android.gms.ads.AdView
                android:id="@+id/adView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_alignParentBottom="true"
                ads:adUnitId="@string/banner_ad_unit_id"
                ads:adSize="BANNER">
            </com.google.android.gms.ads.AdView>
        </LinearLayout>
    </android.support.v4.widget.NestedScrollView>

</android.support.design.widget.CoordinatorLayout>


text:
<?php

namespace Ugosansh\Bundle\Image\ApiBundle\Form;

use Symfony\Component\Form\Form;
use Symfony\Component\HttpFoundation\Request;
use Ugosansh\Component\Image\Upload\Uploader;
use Ugosansh\Component\Image\ImageInterface;

/**
 * Form handler application
 */
class FormHandler
{
    /**
     * @var array
     */
    protected $methods;

    /**
     * @var Uploader
     */
    protected $uploader;

    /**
     * __construct
     *
     * @param array $methods Allowed methods
     */
    public function __construct(array $methods = [])
    {
        $this->methods = empty($methods) ? ['POST', 'PUT'] : $methods;
    }

    /**
     * validate
     *
     * @param Form    $form    Form
     * @param Request $request Request
     *
     * @return boolean
     */
    public function validate(Form $form, Request $request)
    {
        if ($this->hasMethod($request->getMethod())) {
            if ($request->getMethod() != 'POST') {
                $form->submit($request);
            } else {
                $form->handleRequest($request);
            }

            return $form->isValid();
        }

        return false;
    }

    /**
     * processing validation
     * By default, validate form
     *
     * @param Form    $form    Form
     * @param Request $request Request
     *
     * @return mixed
     */
    public function process(Form $form, Request $request)
    {
        return $this->validate($form, $request);
    }

    /**
     * Get array of form errors
     *
     * @param Form $form
     *
     * @return array
     */
    public function getErrors(Form $form) {
        $errors = [];

        foreach ($form->getErrors() as $key => $error) {
            if ($form->isRoot()) {
                $errors['#'][] = $error->getMessage();
            } else {
                $errors[] = $error->getMessage();
            }
        }

        foreach ($form->all() as $child) {
            if (!$child->isValid()) {
                $errors[$child->getName()] = $this->getErrors($child);
            }
        }

        return $errors;
    }

    /**
     * addMethod
     *
     * @param string $method
     *
     * @return FormHandler
     */
    public function addMethod($method)
    {
        if (!$this->hasMethod($method)) {
            $this->methods[] = $methods;
        }
    }

    /**
     * hasMethod
     *
     * @param string $method
     *
     * @return boolean
     */
    public function hasMethod($method)
    {
        return in_array($method, $this->methods);
    }

    /**
     * setMethods
     *
     * @param array $methods
     *
     * @return FormHandler
     */
    public function setMethods(array $methods)
    {
        $this->methods = $methods;

        return $this;
    }

    /**
     * getMethods
     *
     * @return array
     */
    public function getMethods()
    {
        return $this->methods;
    }

    /**
     * Set uploader
     *
     * @param Uploader $uploader
     *
     * @return FormHandler
     */
    public function setUploader(Uploader $uploader)
    {
        $this->uploader = $uploader;

        return $this;
    }

}


text:
package org.valkyriercp.sample.dataeditor.ui;

import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;
import org.jdesktop.swingx.*;
import org.jdesktop.swingx.icon.EmptyIcon;
import org.jdesktop.swingx.painter.BusyPainter;
import org.jdesktop.swingx.painter.ImagePainter;
import org.springframework.core.io.Resource;
import org.valkyriercp.application.splash.MonitoringSplashScreen;
import org.valkyriercp.progress.ProgressMonitor;
import org.valkyriercp.util.WindowUtils;

import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.geom.Ellipse2D;
import java.awt.geom.RoundRectangle2D;
import java.io.IOException;

public class DataEditorSplash implements MonitoringSplashScreen {
	private JXBusyLabel busyLabel = new JXBusyLabel(new Dimension(180, 180));
	private JXLabel titleLabel = new JXLabel("Data Editor");
	private JProgressBar progressBar = new JProgressBar();
	private JXLabel progressLabel = new JXLabel();
	private JXFrame frame;

	private Resource image;

	public DataEditorSplash() {
		BusyPainter painter = new BusyPainter(new RoundRectangle2D.Float(0, 0,
				28.0f, 8.6f, 10.0f, 10.0f), new Ellipse2D.Float(15.0f, 15.0f,
				70.0f, 70.0f));
		painter.setTrailLength(4);
		painter.setPoints(8);
		painter.setFrame(7);
		painter.setHighlightColor(new Color(30, 42, 102));
		busyLabel.setPreferredSize(new Dimension(100, 100));
		busyLabel.setIcon(new EmptyIcon(100, 100));
		busyLabel.setBusyPainter(painter);
		busyLabel.setDelay(75);

		titleLabel.setFont(titleLabel.getFont().deriveFont(30f));
		titleLabel.setForeground(Color.BLACK);
		progressBar.setStringPainted(true);
		progressBar.setPreferredSize(new Dimension(170, 20));
		// titleLabel.setBackground(new Color(0x425DA9));
		// titleLabel.setOpaque(false);
		// progressLabel.setBackground(new Color(0x425DA9));
	}

	public ProgressMonitor getProgressMonitor() {
		return new ProgressMonitor() {
			private int currentWork = 0;

			public void taskStarted(String name, int totalWork) {
				progressBar.setMaximum(totalWork);
				progressBar.setValue(0);
				this.currentWork = 0;
				busyLabel.setBusy(true);
			}

			public void subTaskStarted(String name) {
				// progressBar.setString(name);
			}

			public void worked(int work) {
				currentWork += work;
				progressBar.setValue(currentWork);
			}

			public void done() {
				busyLabel.setBusy(false);
			}

			public boolean isCanceled() {
				return false;
			}

			public void setCanceled(boolean b) {
			}
		};
	}

	protected Component createContentPane() {
		JXPanel panel = new JXPanel(new FormLayout(
				"center:200px:nogrow, left:3dlu:nogrow, fill:200px:nogrow",
				"center:200px:nogrow, center:20px:nogrow"));
		JXPanel ip = new JXPanel();
		try {
			ImagePainter imagePainter = new ImagePainter(ImageIO.read(image
					.getInputStream()));
			imagePainter.setScaleToFit(true);
			ip.setBackgroundPainter(imagePainter);
			// ip.setImage(ImageIO.read(image.getInputStream()));

		} catch (IOException e) {
			e.printStackTrace();
		}
		// ip.setStyle(JXImagePanel.Style.SCALED);
		// panel.setBackground(new Color(0x425DA9));
		panel.add(busyLabel, new CellConstraints(1, 1));
		JXPanel panel2 = new JXPanel(new FormLayout("center:195px:nogrow",
				"center:98px:nogrow, center:4dlu:nogrow, center:98px:nogrow"));
		// panel2.setBackground(new Color(0x425DA9));
		panel2.add(titleLabel, new CellConstraints(1, 1));
		panel2.setOpaque(false);
		panel.add(progressBar, new CellConstraints(1, 2, 3, 1));
		panel.add(panel2, new CellConstraints(3, 1));
		panel.add(ip, new CellConstraints(1, 1, 3, 1, CellConstraints.FILL,
				CellConstraints.FILL));
		panel.setBorder(BorderFactory.createLineBorder(Color.black, 4));
		return panel;
	}

	public void splash() {
		frame = new JXFrame();
		frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
		frame.setUndecorated(true);
		frame.setRootPane(new JXRootPane());
		frame.getRootPaneExt().setDoubleBuffered(true);
		frame.getRootPaneExt().setBackground(new Color(255, 255, 255, 255));
		frame.getRootPaneExt().setOpaque(false);
		frame.getContentPane().add(createContentPane());
		frame.pack();
		WindowUtils.centerOnScreen(frame);
		try {
			UIManager
					.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
		} catch (Exception e) {
			e.printStackTrace();
		}
		SwingUtilities.updateComponentTreeUI(frame);
		frame.setVisible(true);
	}

	public void dispose() {
		if (frame != null) {
			frame.dispose();
			frame = null;
		}
	}

	public void setImage(Resource image) {
		this.image = image;
	}
}