text:
  - Remove `FluentBundle.addMessages`.

    Use `FluentBundle.addResource` instead, combined with a `FluentResource`
    instance.

  - Remove `FluentBundle.messages`.

    The list of messages in the bundle should not be inspected. If you need
    to do it, please use the tooling parser from `@fluent/syntax`.

  - Change the shape returned by `FluentBundle.getMessage`.

    The method now returns the following shape:

        {value: Pattern | null, attributes: Record<string, Pattern>}

  - The internal representtion of `Pattern` is private.

    Raw messages returned from `getMessage` have their values and attributes
    stored in a `Pattern` type. The internal representation of this type is
    private and implementation-specific. It should not be inspected nor used
    for any purposes. The implementation may change without a warning in
    future releases. `Patterns` are black boxes and are meant to be used as
    arguments to `formatPattern`.

  - Rename `FluentBundle.format` to `formatPattern`.

    `formatPattern` only accepts valid `Patterns` as the first argument. In
    practice, you'll want to first retrieve a raw message from the bundle via
    `getMessage`, and then format the value (if present) and the attributes
    separately.

    ```js
    let message = bundle.getMessage("hello");
    if (message.value) {
        bundle.formatPattern(message.value, {userName: "Alex"});
    }
    ```

    The list of all attributes defined in the message can be obtained with
    `Object.keys(message.attributes)`.

  - Throw from `formatPattern` when `errors` are not passed as an argument.

    The old `format()` method would silence all errors if the thrid argument,
    the `errors` array was not given. `formatPattern` changes this behavior
    to throwing on the first encountered error and interrupting the
    formatting.

    ```js
    try {
        bundle.formatPattern(message.value, args);
    } catch (err) {
        // Handle the error yourself.
    }
    ```

    It's still possible to pass the `errors` array as the third argument to
    `formatPattern`. All errors encountered during the formatting will be
    then appended to the array. In this scenario, `formatPattern` is
    guaranteed to never throw because of errors in the translation.

    ```js
    let errorrs = [];
    bundle.formatPattern(message.value, args, errors);
    for (let error of errors) {
        // Report errors.
    }
    ```

### `FluentResource` API

  - Remove the static `FluentResource.fromString` method.

    Parse resources by using the constructor: `new FluentResource(text)`.

  - Do not extend `Map`.

    `FluentResources` are now instances of their own class only.

  - Add `FluentResource.body`.

    The `body` field is an array storing the resource's parsed messages and
    terms.

### `FluentType` API

  - `FluentNumber` must be instantiated with a number.

    The constructor doesn't call `parseFloat` on the passed value anymore.

  - `FluentDateTime` must be instantiated with a number.

    The constructor doesn't call `new Date()` on the passed value anymore.
    The date is stored as the numerical timestamp, in milliseconds since the
    epoch.

### Formatting Changes

  - Report errors from instantiating Intl objects used for formatting.
  - Report errors from functions, including built-in functions.
  - Format numbers and dates to safe defaults in case or errors. (#410)
  - When a transform function is given, transform only `TextElements`.

## @fluent/bundle 0.13.0 (July 25, 2019)

  - Rename `fluent` to `@fluent/bundle`.

## fluent 0.13.0 (July 25, 2019)

  - Support Fluent Syntax 1.0.

    Syntax 1.0 is the same as Syntax 0.9, and the support for it in this
    release continues to be the same as in `fluent` 0.12. This note is meant
    to clearly indicate that `fluent` supports the first stable version of
    the Syntax specification.

  - Improve the fallback string in case of expression errors.

    Unresolved expressions are now printed with braces around them, e.g.
    `{missing}` rather than `missing` (#368). References to missing message
    attributes now fall back to `{messageId.attributeName}` (#370).

  - Remove the `ftl` dedent helper.

    The `ftl` dedent helper has moved to its own package, `@fluent/dedent`.
    Note that its behavior has changed slightly, too. See the
    [README][dedent-readme] for details.

    [dedent-readme]: https://www.npmjs.com/package/@fluent/dedent

## fluent 0.12.0 (March 26, 2019)

This release of `fluent` brings support for version 0.9 of the Fluent Syntax
spec. The `FluentBundle` API remains unchanged. Files written in valid Syntax
0.8 may parse differently in this release. See the compatibility note below.

  - Implement Fluent Syntax 0.9.

    Most of the changes introduced in Syntax 0.9 affect the full tooling AST
    and thus do not apply to the `fluent` package which uses a different data
    structure for the result of the parsing, optimized for the runtime
    performance.

    Syntax features deprecated in Syntax 0.8 have been removed in Syntax 0.9.
    The support for them have been removed in this release of `fluent` too.

    Consult the full Syntax 0.9 [changelog][chlog0.9] for details.

    [chlog0.9]: https://github.com/projectfluent/fluent/releases/tag/v0.9.0

### Backward-incompatible changes:

- `VariantLists` are no longer valid syntax.

## fluent 0.11.0 (February 15, 2019)

  - Add the `allowOverrides` option to `FluentBundle.addResource`. (#332)

    `FluentBundle.addResource` and `FluentBundle.addMessages` now both accept
    an `options` object as the last argument. The `allowOverrides` option may
    be used to control whether it's allowed to override existing mesages or
    terms with new values. The default is `false`.

## fluent 0.10.0 (December 13, 2018)

This release of `fluent` brings support for version 0.8 of the Fluent Syntax
spec. The `FluentBundle` API remains unchanged. Files written in valid Syntax
0.7 may parse differently in this release. See the compatibility note below.

  - Implement Fluent Syntax 0.8. (#303)

    This is only a quick summary of the spec changes in Syntax 0.8. Consult the
    full [changelog][chlog0.8] for details.

    [chlog0.8]: https://github.com/projectfluent/fluent/releases/tag/v0.8.0

    In multiline `Patterns`, all common indent is now removed from each
    indented line in the final value of the pattern.

    ```properties
    multiline =
        This message has 2 spaces of indent
          on the second line of its value.
    ```

    `Terms` can now be parameterized via the call expression syntax. Only
    variables defined between the parentheses in the message a term is used in
    will be available inside of it.

    ```properties
    # A parametrized Term with a Pattern as a value.
    -thing = { $article ->
       *[definite] the thing
        [indefinite] a thing
    }

    this = This is { -thing(article: "indefinite") }.
    ```

    `VariantLists` are now deprecated and will be removed from the Syntax
    before version 1.0.

    All escapes sequences can only be used in `StringLiterals` now (see below).
    `\UHHHHHH` is a new escape sequence format suitable for codepoints above
    U+FFFF, e.g. `{"\U01F602"}`.

### Backward-incompatible changes:

  - The backslash character (`\`) is now considered a regular character in
    `TextElements`. It's no longer possible to use escape sequences in
    `TextElements`. Please use `StringLiterals` instead, e.g. `{"\u00A0"}`.
  - The closing curly brace character (`}`) is not allowed in `TextElements`
    now. Please use `StringLiterals` instead: `{"}"}`.

## fluent 0.9.1 (October 23, 2018)

  - Forbid messages with `null` values and no attributes. (#299)

    Fix a parser behavior which caused it to parse messages without values
    nor attributes as `"message-id": null`. This skewed the return values of
    `FluentBundle.hasMessage` which would report `true` for messages which
    were `null`. This, in turn, would break code which assumed
    `FluentBundle.getMessage` would always return non-`null` values if it was
    guarded by a call to `hasMessage` first.

## fluent 0.9.0 (October 23, 2018)

This release of `fluent` brings support for version 0.7 of the Fluent Syntax
spec. The `FluentBundle` API remains unchanged. Files written in valid Syntax
0.6 may parse differently in this release. See the compatibility note below.

  - Implement Fluent Syntax 0.7. (#287)

    The major new feature of Syntax 0.7 is the relaxation of the indentation
    requirement for all non-text elements of patterns. It's finally possible
    to leave the closing brace of select expressions unindented:

        emails = { $unread_email_count ->
            [one] You have one unread email.
           *[other] You have { $unread_email_count } unread emails.
        }

    Consult the [changelog](https://github.com/projectfluent/fluent/releases/tag/v0.7.0)
    to learn about other changes in Syntax 0.7.

  - Re-write the runtime parser. (#289)

    Syntax 0.7 was an opportunity to completely re-write the runtime parser,
    which was originally created in the pre-0.1 era of Fluent. It's now less
    than a half of the code size of the old parser and also slightly faster.

    The parser takes an optimistic approach to parsing. It focuses on
    minimizing the number of false negatives at the expense of increasing the
    risk of false positives. In other words, it aims at parsing valid Fluent
    messages with a success rate of 100%, but it may also parse a few invalid
    messages which the reference parser would reject. The parser doesn't
    perform strict validation of the all productions of the Fluent grammar.
    It may thus produce entries which wouldn't make sense in the real world.
    For best results users are advised to validate translations with the
    `fluent-syntax` parser pre-runtime (e.g. by using Pontoon or
    `compare-locales`).

### Backward-incompatible changes

  - Variant keys can now be either numbers (as previously) or identifiers.
    Variant keys with spaces in them produce syntax errors, e.g. `[New York]`.
  - `CR` is not a valid EOL character anymore. Please use `LF` or `CRLF`.
  - `Tab` is not recognized as syntax whitespace. It can only be used in
    translation content.

## fluent 0.8.1 (September 27, 2018)

  - Expose `FluentResource` as an export. (#286)

  `FluentResource` is a data structure representing a parsed Fluent document.
  It can be used to cache resources which can then be added to `FluentBundle`
  via the `addResource` method. To create a `FluentResource` given a string
  of Fluent translations, use the static `FluentResource.fromString` method.

  ```js
  let resource = FluentResource.fromString(text);
  bundle.addResource(resource);
  ```

  The undocumented `_parse` export was also removed in favor of
  `FluentResource.fromString`.

## fluent 0.8.0 (August 20, 2018)

  - Rename `MessageContext` to `FluentBundle`. (#222)

    The following renames have been made to the public API:

    - Rename `MessageContext` to `FluentBundle`.
    - Rename `MessageArgument` to `FluentType`.
    - Rename `MessageNumberArgument` to `FluentNumber`.
    - Rename `MessageDateTimeArgument` to `FluentDateTime`.

  - Move `mapContext*` functions to [`fluent-sequence`][]. (#273)

    The `mapContextSync` and `mapContextAsync` functions previously exported
    by the `fluent` package have been moved to the new [`fluent-sequence`][]
    package. [`fluent-sequence`][] 0.1.0 corresponds to the exact
    implementation of these functions from `fluent` 0.7.0.

    In later versions of [`fluent-sequence`][], these functions are called
    `mapBundleSync` and `mapBundleAsync`.

[`fluent-sequence`]: https://www.npmjs.com/package/fluent-sequence

## fluent 0.7.0 (July 24, 2018)

  - Implement support for Fluent Syntax 0.6.

    Syntax 0.6 keeps the syntax unchanged and makes many small changes to the
    previousl underspecified areas of the spec. The runtime parser now
    supports Unicode escapes and properly trims whitespace in TextElements.

  - Add `FluentResource`. (#244)

    `FluentResource` is a class representing a parsed Fluent document. It was
    added with caching in mind. It's now possible to parse a Fluent document
    inton an instance of `FluentResouce` once and use it to construct new
    `MessageContexts`. For this end, `MessageContext` now has the
    `addResource` method which takes an instance of `FluentResource`.

  - Add the `transform` option to `MessageContext`. (#213)

    `MessageContext` now accepts a new option, `transform`, which may be a
    function. If passed it will be used to transform the string parts of
    patterns. This may be used to implement programmatic transformations of
    translations, e.g. to create pseudo-localizations.

  - Drop support for IE and old evergreen browsers. (#133)

    Currently supported are: Firefox 52+, Chrome 55+, Edge 15+, Safari 10.1+,
    iOS Safari 10.3+ and node 8.9+.

  - Move `CachedSyncIterable` and `CachedAsyncIterable` to a dependency.

    They are now available from the `cached-iterable` package. `fluent`
    depends on it for running tests.

## fluent 0.6.4 (April 11, 2018)

  - Minor optimization to bidirectionality isolation
  - Added error logging when attempting an already registered message id

## fluent 0.6.3 (February 9, 2018)

  - Update sinon to 4.2.2

## fluent 0.6.2 (February 8, 2018)

  - Correctly parse empty comment lines. (#149)
  - Forbid null attribute and variant values. (part of #150)

## fluent 0.6.0 (January 31, 2018)

  - Implement Fluent Syntax 0.5.

    - Add support for terms.
    - Add support for `#`, `##` and `###` comments.
    - Remove support for tags.
    - Add support for `=` after the identifier in message and term
      defintions.
    - Forbid newlines in string expressions.
    - Allow trailing comma in call expression argument lists.

    In fluent 0.6.x the new Syntax 0.5 is supported alongside the old Syntax
    0.4. This should make migrations easier. The parser will correctly parse
    Syntax 0.4 comments (prefixed with `//`), sections and message
    definitions without the `=` after the identifier. The one exception are
    tags which are no longer supported. Please use attributed defined on
    terms instead.

  - Add `mapContextAsync`. (#125)

    This is the async counterpart to mapContextSync. Given an async iterable
    of `MessageContext` instances and an array of ids (or a single id), it
    maps each identifier to the first `MessageContext` which contains the
    message for it.

    An ordered interable of `MessageContext` instances can represent the
    current negotiated fallback chain of languages. This iterable can be used
    to find the best existing translation for a given identifier.

    The iterable of `MessageContexts` can now be async, allowing code like
    this:

    ```js
    async formatString(id, args) {
        const bundle = await mapContextAsync(bundles, id);

        if (bundle === null) {
            return id;
        }

        const msg = bundle.getMessage(id);
        return bundle.format(msg, args);
    }
    ```

    The iterable of `MessageContexts` should always be wrapped in
    `CachedIterable` to optimize subsequent calls to `mapContextSync` and
    `mapContextAsync`.

    Because `mapContextAsync` uses asynchronous iteration you'll likely need
    the regenerator runtime provided by `babel-polyfill` to run the `compat`
    builds of `fluent`.

  - Expose the `ftl` dedent helper.

    The `ftl` template literal tag can be used to conveniently include FTL
    snippets in other code. It strips the common indentation from the snippet
    allowing it to be indented on the level dictated by the current code
    indentation.

    ```js
    bundle.addMessages(ftl`
        foo = Foo
        bar = Bar
    );
    ```

  - Remove `MessageContext.formatToParts`.

    It's only use-case was passing React elements as arguments to
    translations which is now possible thanks to DOM overlays (#101).

  - Rename `FluentType.valueOf` to `FluentType.toString1.

    Without `MessageContext.formatToParts`, all use-cases for
    `FluentType.valueOf` boil down to stringification.

  - Remove `FluentType.isTypeOf`.

    fluent-react's markup overlays (#101) removed the dependency on fluent's
    `FluentType` which was hardcoded as an import from fluent/compat. Without
    this dependency all imports from fluent are in the hands of developers
    again and they can decide to use the ES2015+ or the compat builds as they
    wish. As long as they do it consistently, regular instanceof checks will
    work well.

## fluent 0.4.2 (November 27, 2017)

  - Add touchNext to CachedIterable.

    This allows the user of CachedIterable to trigger construction of an
    element yielded from the generator early.

  - Add the static FluentType.isTypeOf method.

    In some cases, bundlers such as Webpack would break the instanceof
    FluentType check. The new FluentType.isTypeOf static method can be used
    instead to guarantee the proper behavior.

  - Catch errors thrown by Intl formatters.

## fluent 0.4.1 (June 22, 2017)

  - Introduce mapContextSync and CachedIterable.

    An ordered iterable of MessageContext instances can represent the
    current negotiated fallback chain of languages.  This iterable can be
    used to find the best existing translation for a given identifier.

    The mapContext* methods can be used to find the first MessageContext in
    the given iterable which contains the translation with the given
    identifier.  If the iterable is ordered according to the result of
    a language negotiation the returned MessageContext contains the best
    available translation.

    A simple function which formats translations based on the identifier
    might be implemented as follows:

        getString(id, args) {
            const bundle = mapContextSync(bundles, id);

            if (bundle === null) {
                return id;
            }

            const msg = bundle.getMessage(id);
            return bundle.format(msg, args);
        }

    In order to pass an iterator to mapContext*, wrap it in CachedIterable.
    This allows multiple calls to mapContext* without advancing and
    eventually depleting the iterator.

        function *generateMessages() {
            // Some lazy logic for yielding MessageContexts.
            yield *[bundle1, bundle2];
        }

        const bundles = new CachedIterable(generateMessages());
        const bundle = mapContextSync(bundles, id);

## fluent 0.4.0 (May 17th, 2017)

  - Added MessageContext.hasMessage and MessageContext.getMessage methods.

    Using the MessageContext.messages map for getting raw messages is
    deprecated now.  Instead, use the two dedicated methods: hasMessage and
    getMessage.

    Before:

        const msg = bundle.messages.get(id);
        const txt = bundle.format(msg);

    Now:

        const msg = bundle.getMessage(id);
        const txt = bundle.format(msg);

  - The compat build is now transpiled using rollup-plugin-babel.

    This ensures that the "use strict" pragma is scoped to the UMD wrapper.  It
    also correctly parses the top-level "this" keyword (which the previous
    setup turned into "undefined").

## fluent 0.3.1

  - MessageContext takes one locale (a string) or an array of locales.
  - Add the "module" field to package.json for ES modules-compatible bundlers.

## fluent 0.3.0

  - Support Fluent Syntax 0.3

    Added support for tags and indented multiline text. Removed quoted values.

## fluent 0.2.2

### Breaking changes

  - (ef99a62) Remove the custom `Intl.PluralRules` polyfill

    You'll need to provide your own polyfill or use `fluent-intl-polyfill`.

  - (1a4f2a8) Make fluent and fluent-syntax separate packages

    Install the `fluent-syntax` package to use the AST parser.

### New features

  - (73fbab8) Add `MessageContext.formatToParts`
  - (2f51e27) Export `FluentNumber` as `MessageArgument`
  - (de01c8b) Provide a compat version using babel-preset-latest

    Use it by importing from `fluent/compat'

### Other

  - (44fa872) Remove a special case for `FluentNumber` in `SelectExpression`
  - (7dfa787) Remove namespaces from keywords
  - (2fff487) Use `FluentNumber`'s value when matching `FluentKeywords`
  - (b4bcbdd) Remove tests which were causing parsing errors
  - (0f35313) Name the AMD module 'fluent'

## fluent 0.2.1

  - (d247e5d) npm install fluent
  - (d00fe3a) Remove `JunkEntries` from the RuntimeParser

## fluent 0.2.0

  - (1f86c8f) Update the AST parser to Syntax 0.2
  - (679ca3e) Update the Runtime parser to Syntax 0.2
  - (d3681d7) Update the resolver to Syntax 0.2.
  - (bfea90e) Rename `Entity` to `Message`
  - (5efd0f9) Remove `FTLList`
  - (282cccb) Add `JunkEntry` to AST parser
  - (a78a32a) Add `lineNumber` and `columnNumber` to SyntaxErrors
  - (e0245f4) Always print JSON in tools/parse
  - (5d788b7) Move the AST parser to src/syntax

## fluent 0.1.0

  - (0d38714) Fluent.js 0.1

    The initial release based on l20n.js c3e35c4.


text:
'use strict';

var path = require('path');
var FBOAuth2 = require('./fboauth2');

exports.authType = 'facebook';

try {
	var configPath = path.normalize(__dirname + '/../../../config/waterlock.js');
	var config = require(configPath)
		.waterlock;
} catch (e) {
	throw 'waterlock not installed';
}

var method = {};
if (typeof config.authMethod[0] === 'object') {
	for (var i = 0; i < config.authMethod.length; i++) {
		if (config.authMethod[i].name === 'waterlock-facebook-auth') {
			method = config.authMethod[i];
		}
	}
} else {
	method = config.authMethod;
}

var fbOAuth2Url;

if (method.redirectUri) {
	fbOAuth2Url = method.redirectUri;
} else {
	if (config.pluralizeEndpoints) {
		fbOAuth2Url = config.baseUrl + '/auths/facebook_oauth2';
	} else {
		fbOAuth2Url = config.baseUrl + '/auth/facebook_oauth2';
	}
}

exports.config = config;
exports.authConfig = method;
exports.fb = new FBOAuth2(method.appId, method.appSecret, fbOAuth2Url);

exports.actions = require('./controllers');

exports.model = require('./models');

redpajama_set_name: RedPajamaGithub


text:
from Models.SoftmaxPredictor import SoftmaxPredictor
from TrainingData.data_sets.save_load_data import load_bimodal_data_set
from Eval.functions import results_to_disk, write_preds_to_file, plot_2D_embeddings, plot_metric
from Eval.functions import get_f1_and_classification_report

def run():

    for training_condition in ['context', 'context_stress', 'context_phonology']:

        # load data set with dimensionality-reduced word embeddings obtained from bimodal auto encoder
        # trained in 'train_bimodal_auto_encoder.py'
        data_set = load_bimodal_data_set(training_condition)

        # softmax model for predicting words from the right context
        softmax = SoftmaxPredictor(data_set=data_set,
                                   n_next_words=2000,
                                   learning_rate=0.008,
                                   input_size=500)
        # train the model
        softmax.train()

        # get word embeddings
        embeddings = softmax.embeddings_over_epochs[-1]

        # write predicted categories to file -- files can be used for additional processing, e.g. significance testing
        # on predictions made at two different stages in the training process
        write_preds_to_file(embeddings, '10-NN', '%s_10-NN_after_stage2' % training_condition)

        # append 10-NN results obtained from word embeddings to file
        micro_f1, macro_f1, classification_report = get_f1_and_classification_report(embeddings, '10-NN')
        results_to_disk(micro_f1, macro_f1, classification_report, epoch=softmax.epochs,
                        condition=training_condition, training_stage='AFTER STAGE 2', newfile=False)

        # plot word embeddings, reduced to two dimensions via the T-SNE algorithm
        plot_2D_embeddings(embeddings, training_condition, training_stage='after_stage_2')

        # plot accuracy over all training epochs
        plot_metric(plot_name='%s_softmax' % training_condition, plot_type='micro_f1_over_epochs',
                    ys=softmax.f1_over_epochs, label='micro_f1')

        # plot training error over all training epochs
        plot_metric(plot_name='%s_softmax' % training_condition, plot_type='training_error_over_epochs',
                    ys=softmax.training_error_over_epochs, label='training_error')

if __name__ == '__main__':
    run()


text:
namespace mrubybind {

//#include "mrubybind.dat"

const char Type<int>::TYPE_NAME[] = "Fixnum";
const char Type<unsigned int>::TYPE_NAME[] = "Fixnum";
const char Type<float>::TYPE_NAME[] = "Float";
const char Type<double>::TYPE_NAME[] = "Float";
const char Type<const char*>::TYPE_NAME[] = "String";
const char Type<std::string>::TYPE_NAME[] = "String";
const char Type<const std::string>::TYPE_NAME[] = "String";
const char Type<const std::string&>::TYPE_NAME[] = "String";
const char Type<bool>::TYPE_NAME[] = "Bool";
const char Type<void*>::TYPE_NAME[] = "Voidp";
const char Type<MrubyRef>::TYPE_NAME[] = "MrubyRef";
const char TypeFuncBase::TYPE_NAME[] = "Func";
const char TypeClassBase::TYPE_NAME[] = "CppClass";

const char* untouchable_table = "__ untouchable table __";
const char* untouchable_object = "__ untouchable object __";
const char* untouchable_last_exception = "__ untouchable last exception __";

mrb_value raise(mrb_state *mrb, int parameter_index,
                const char* required_type_name, mrb_value value) {
  const char * argument_class_name = mrb_obj_classname(mrb, value);
  mrb_raisef(mrb, E_TYPE_ERROR, "can't convert %S into %S, argument %S(%S)",
             mrb_str_new_cstr(mrb, argument_class_name),
             mrb_str_new_cstr(mrb, required_type_name),
             mrb_fixnum_value(parameter_index + 1), value);
  return mrb_nil_value();
}

mrb_value raisenarg(mrb_state *mrb, mrb_value func_name, int narg, int nparam) {
  mrb_raisef(mrb, E_ARGUMENT_ERROR, "'%S': wrong number of arguments (%S for %S)",
             func_name,
             mrb_fixnum_value(narg),
             mrb_fixnum_value(nparam));
  return mrb_nil_value();
}

void
MrubyBind::mrb_define_class_method_raw(mrb_state *mrb, struct RClass *c, mrb_sym mid, struct RProc *p)
{
  mrb_define_class_method(mrb, c, mrb_sym2name(mrb, mid), NULL, MRB_ARGS_ANY()); // Dummy registration.
  mrb_define_method_raw(mrb, ((RObject*)c)->c, mid, p);
}

MrubyBind::MrubyBind(mrb_state* mrb) : mrb_(mrb), mod_(mrb_->kernel_module) {
  Initialize();
}

MrubyBind::MrubyBind(mrb_state* mrb, RClass* mod) : mrb_(mrb), mod_(mod) {
  Initialize();
}

MrubyBind::~MrubyBind() {
  mrb_gc_arena_restore(mrb_, arena_index_);
}

void MrubyBind::Initialize() {
  arena_index_ = mrb_gc_arena_save(mrb_);
  mrb_sym sym_mrubybind = mrb_intern_cstr(mrb_, "MrubyBind");
  RClass* mrubybind = mrb_define_module(mrb_, "MrubyBind");
  if (mrb_const_defined(mrb_, mrb_obj_value(mrb_->kernel_module),
                        sym_mrubybind)) {
    avoid_gc_table_ = mrb_obj_iv_get(mrb_, (RObject*)mrubybind,
                                     mrb_intern_cstr(mrb_, untouchable_table));
  } else {
    mrb_const_set(mrb_, mrb_obj_value(mrb_->kernel_module), sym_mrubybind, mrb_obj_value(mrubybind));

    {
        avoid_gc_table_ = mrb_ary_new(mrb_);
        mrb_obj_iv_set(mrb_, (RObject*)mrubybind,
                   mrb_intern_cstr(mrb_, untouchable_table), avoid_gc_table_);
        std::shared_ptr<MrubyBindStatus> mrbs = std::make_shared<MrubyBindStatus>(mrb_, avoid_gc_table_);
        mrubybind::MrubyBind b(mrb_);
        b.bind_class<std::shared_ptr<MrubyBindStatus> >("MrubyBind", "MrubyBindStatusPtr");
        mrb_value msbpv = Type<std::shared_ptr<MrubyBindStatus> >::ret(mrb_, mrbs);
        mrb_obj_iv_set(mrb_, (RObject*)mrubybind,
                       mrb_intern_cstr(mrb_, untouchable_object), msbpv);
    }
  }
}

std::vector<std::string> MrubyBind::SplitModule(const char* module_name)
{
    std::vector<std::string> splited;
    if(!module_name){
        return splited;
    }
    std::string str(module_name);
    std::string d("::");
    size_t c = 0, f, dsz = d.size();
    while((f = str.find(d, c)) != std::string::npos){
        splited.push_back(str.substr(c, f - c));
        c = f + dsz;
    }
    splited.push_back(str.substr(c, str.size() - c));
    return splited;
}

struct RClass* MrubyBind::DefineModule(const char* module_name)
{
    std::vector<std::string> modules = SplitModule(module_name);
    struct RClass* last_module = nullptr;
    for(size_t i = 0 ; i < modules.size() ; i++){
        auto m = modules[i];
        if(i == 0){
            if(mrb_const_defined_at(mrb_, mrb_obj_value(mrb_->object_class), mrb_intern_cstr(mrb_, m.c_str()))){
                mrb_value mdl = mrb_const_get(mrb_, mrb_obj_value(mrb_->object_class), mrb_intern_cstr(mrb_, m.c_str()));
                last_module = mrb_class_ptr(mdl);
            }
            else {
                last_module = mrb_define_module(mrb_, m.c_str());
            }
        }
        else{
            if(mrb_const_defined_at(mrb_, mrb_obj_value(mrb_->object_class), mrb_intern_cstr(mrb_, m.c_str()))){
                mrb_value mdl = mrb_const_get(mrb_, mrb_obj_value(last_module), mrb_intern_cstr(mrb_, m.c_str()));
                last_module = mrb_class_ptr(mdl);
            }
            else {
                last_module = mrb_define_module_under(mrb_, last_module, m.c_str());
            }
        }
    }
    return last_module;
}

struct RClass* MrubyBind::DefineClass(const char* module_name, const char* class_name)
{
    struct RClass * tc;
    mrb_value mod = mrb_obj_value(mod_);
    std::string name;
    if(module_name){
      name = module_name;
      name += "::";
      name += class_name;
      tc = mrb_define_class(mrb_, name.c_str(), mrb_->object_class);
      struct RClass * mdp = DefineModule(module_name);
      mod = mrb_obj_value(mdp);
      mrb_define_const(mrb_, mdp, class_name, mrb_obj_value(tc));
    }
    else
    {
      name = class_name;
      tc = mrb_define_class(mrb_, class_name, mrb_->object_class);
    }
    return tc;
}

struct RClass* MrubyBind::GetClass(const char* class_name) {
  mrb_value mod = mrb_obj_value(mod_);
  mrb_value klass_v = mrb_const_get(mrb_, mod, mrb_intern_cstr(mrb_, class_name));
  return mrb_class_ptr(klass_v);
}

struct RClass* MrubyBind::GetClass(const char* module_name, const char* class_name) {
  mrb_value mod = mrb_obj_value(mod_);
  if(module_name){
    mod = mrb_obj_value(DefineModule(module_name));
  }
  mrb_value klass_v = mrb_const_get(mrb_, mod, mrb_intern_cstr(mrb_, class_name));
  return mrb_class_ptr(klass_v);
}

void MrubyBind::BindInstanceMethod(
    const char* class_name, const char* method_name,
    mrb_value original_func_v,
    mrb_value (*binder_func)(mrb_state*, mrb_value)) {
  BindInstanceMethod(NULL,
    class_name, method_name,
    original_func_v,
    binder_func);
}

void MrubyBind::BindInstanceMethod(const char* module_name,
                          const char* class_name, const char* method_name,
                          mrb_value original_func_v,
                          mrb_value (*binder_func)(mrb_state*, mrb_value))
{
  mrb_sym method_name_s = mrb_intern_cstr(mrb_, method_name);
  mrb_value env[] = {
    original_func_v, // 0: c function pointer
    mrb_symbol_value(method_name_s), // 1: method name
  };
  struct RProc* proc = mrb_proc_new_cfunc_with_env(mrb_, binder_func, 2, env);
  struct RClass* klass = GetClass(module_name, class_name);
  mrb_define_method_raw(mrb_, klass, method_name_s, proc);
}

MrubyRef load_string(mrb_state* mrb, std::string code)
{
    mrubybind::MrubyArenaStore mas(mrb);

    RClass* mrubybind = mrb_define_module(mrb, "MrubyBind");
    mrb->exc = NULL;
    mrb_value r = mrb_load_string(mrb,
                    code.c_str());
    if(mrb->exc){
        mrb_obj_iv_set(mrb, (RObject*)mrubybind,
                       mrb_intern_cstr(mrb, untouchable_last_exception), mrb_obj_value(mrb->exc));
        r = mrb_nil_value();
    }
    else{
        mrb_obj_iv_set(mrb, (RObject*)mrubybind,
                       mrb_intern_cstr(mrb, untouchable_last_exception), mrb_nil_value());
    }

    return MrubyRef(mrb, r);
}

MrubyRef::MrubyRef(){

}

MrubyRef::MrubyRef(mrb_state* mrb, const mrb_value& v){
    this->mrb = mrb;
    mrb_value* p = new mrb_value();
    *p = v;
    this->v = std::shared_ptr<mrb_value>(p, set_avoid_gc<mrb_value>(mrb, v));
}

MrubyRef::~MrubyRef(){

}

bool MrubyRef::is_living() const{
    return MrubyBindStatus::is_living(mrb);
}

mrb_state* MrubyRef::get_mrb() const{
    return this->mrb;
}

mrb_value MrubyRef::get_v() const{
    if(v.get()){
        return *(this->v.get());
    }
    return mrb_nil_value();
}

bool MrubyRef::empty() const{
    if(!v.get()){
        return true;
    }
    return false;
}

bool MrubyRef::test() const{
    if(v.get()){
        mrb_value v = *(this->v.get());
        return mrb_test(v);
    }
    return false;
}

bool MrubyRef::obj_equal(const MrubyRef& r) const{
    if(!empty() && !r.empty()){
        return mrb_obj_equal(mrb, get_v(), r.get_v());
    }
    else{
        return empty() == r.empty();
    }
}

std::string MrubyRef::to_s() const{
    if(v.get()){
        MrubyArenaStore mas(mrb);
        mrb_value v = *(this->v.get());
        if(mrb_string_p(v)){
            return std::string(RSTRING_PTR(v), RSTRING_LEN(v));
        }
        else{
            v = mrb_funcall(mrb, v, "to_s", 0);
            return std::string(RSTRING_PTR(v), RSTRING_LEN(v));
        }
    }
    else{
        return "";
    }
}

int MrubyRef::to_i() const{
    if(v.get()){
        mrb_value v = *(this->v.get());
        if(mrb_fixnum_p(v)){
            return mrb_fixnum(v);
        }
        else{
            v = mrb_funcall(mrb, v, "to_i", 0);
            return mrb_fixnum(v);
        }
    }
    else{
        return 0;
    }
}

float MrubyRef::to_float() const{
    if(v.get()){
        mrb_value v = *(this->v.get());
        if(mrb_float_p(v)){
            return mrb_float(v);
        }
        else{
            v = mrb_funcall(mrb, v, "to_f", 0);
            return mrb_float(v);
        }
    }
    else{
        return 0.0f;
    }
}

double MrubyRef::to_double() const{
    if(v.get()){
        mrb_value v = *(this->v.get());
        if(mrb_float_p(v)){
            return mrb_float(v);
        }
        else{
            v = mrb_funcall(mrb, v, "to_f", 0);
            return (double)mrb_float(v);
        }
    }
    else{
        return 0.0;
    }
}

MrubyRef MrubyRef::call(std::string name){
    MrubyArenaStore mas(mrb);
    return MrubyRef(mrb, mrb_funcall(mrb, *(this->v.get()), name.c_str(), 0));
}

}  // namespace mrubybind


text:
using System;

namespace Braintree
{
    public class ApplePayCard : PaymentMethod
    {
        public virtual string CardType { get; protected set; }
        public virtual string Last4 { get; protected set; }
        public virtual string ExpirationMonth { get; protected set; }
        public virtual string ExpirationYear { get; protected set; }
        public virtual string Token { get; protected set; }
        public virtual string PaymentInstrumentName { get; protected set; }
        public virtual string SourceDescription { get; protected set; }
        public virtual bool? IsDefault { get; protected set; }
        public virtual bool? IsExpired { get; protected set; }
        public virtual string ImageUrl { get; protected set; }
        public virtual string CustomerId { get; protected set; }
        public virtual DateTime? CreatedAt { get; protected set; }
        public virtual DateTime? UpdatedAt { get; protected set; }
        public virtual Subscription[] Subscriptions { get; protected set; }

        protected internal ApplePayCard(NodeWrapper node, IBraintreeGateway gateway)
        {
            CardType = node.GetString("card-type");
            Last4 = node.GetString("last-4");
            ExpirationMonth = node.GetString("expiration-month");
            ExpirationYear = node.GetString("expiration-year");
            Token = node.GetString("token");
            PaymentInstrumentName = node.GetString("payment-instrument-name");
            SourceDescription = node.GetString("source-description");
            IsDefault = node.GetBoolean("default");
            IsExpired = node.GetBoolean("expired");
            ImageUrl = node.GetString("image-url");
            CustomerId = node.GetString("customer-id");

            CreatedAt = node.GetDateTime("created-at");
            UpdatedAt = node.GetDateTime("updated-at");

            var subscriptionXmlNodes = node.GetList("subscriptions/subscription");
            Subscriptions = new Subscription[subscriptionXmlNodes.Count];
            for (int i = 0; i < subscriptionXmlNodes.Count; i++)
            {
                Subscriptions[i] = new Subscription(subscriptionXmlNodes[i], gateway);
            }
        }

        [Obsolete("Mock Use Only")]
        protected internal ApplePayCard() { }
    }
}


text:
class D3DObjectLine : public D3DObject
{
public:
   D3DObjectLine();

   static void BeginCache();
   virtual void Draw(D3DDevice *d3d);
   static void EndCache(D3DDevice *d3d);

   void Setup(FLOAT x1, FLOAT y1, FLOAT x2, FLOAT y2, DWORD color);

private:
   FLOAT _x1, _y1, _x2, _y2;
   DWORD _color;

private:
   struct Vertex
   {
      FLOAT x, y;
      DWORD color;
   };

   static TArray<Vertex> _cache;
   static bool _cache_enabled;
};

#endif  // __EVAS_DIRECT3D_OBJECT_LINE_H__


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

<title>BillboardParticleBatch.Config (libgdx API)</title>
<meta name="date" content="2016-02-02">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

				libgdx API

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

com.badlogic.gdx.graphics.g3d.particles.batches

Class BillboardParticleBatch.Config

java.lang.Object

com.badlogic.gdx.graphics.g3d.particles.batches.BillboardParticleBatch.Config

Enclosing class:

BillboardParticleBatch

public static class BillboardParticleBatch.Config
extends java.lang.Object

Constructor Summary

Constructors

Constructor and Description

Config()

Config(boolean useGPU,
      ParticleShader.AlignMode mode)

Method Summary

Methods inherited from class java.lang.Object

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

Constructor Detail

Config

public Config()

Config

public Config(boolean useGPU,
              ParticleShader.AlignMode mode)

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

libgdx API

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

				Copyright © 2010-2013 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)


text:
FROM node:slim
ADD . /app
WORKDIR /app
CMD npm start


text:
<?php

namespace Fannan\EnvelopesModule\Test\Unit\Log;

class LogModelTest extends \TestCase
{

}


text:
<!DOCTYPE html>

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

    <title>پنل مدیریت بوت استرپ</title>

    <link href="../client/bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">

    <link href="../client/bower_components/metisMenu/dist/metisMenu.min.css" rel="stylesheet">

    <link href="../client/dist/css/sb-admin-2.css" rel="stylesheet">

    <link href="../client/bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

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

          </button>
          ورژن ۲.۰

                    جان دو

                      دیروز

لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده

                    جان دو 2

                      دیروز

لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده

                    جان دو 3

                      دیروز

لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده

                  همه ی پیغام ها

                      کار اول
                      ۴۰٪ انجام شده

                        ۴۰٪ انجام شده

                      کار دوم
                      ۲۰٪ انجام شده

                        ۲۰٪ اجام شده

                      کار سوم
                      ۶۰٪ انجام شده

                        ۶۰٪ انجام شده

                      کار چهارم
                      ۸۰٪ انجام شده

                        ۸۰٪ انجام شده

                  همه ی کارها

                     دیدگاه های جدید
                    ۴ دقیقه پیش

                     ۴ دنبال کننده
                    ۱۲ دقیقه پیش

                     پیغام ارسال شد
                    ۴ دقیقه قبل

                     کار جدید
                    ۸ دقیقه قبل

                     سرور
                    ۲ دقیقه قبل

                  همه ی هشدار ها

 حساب کاربری

 تنظیمات

 خروج

                    <button class="btn btn-default" type="button">

                    </button>

                  <input type="text" class="form-control" placeholder="جستجو...">

                 داشبورد

                 چارت ها

                    چارت فلوت

                    موریس جی چارت

                 جدول ها

                 فرم ها

                 المان های یو آی

                    پنل و سر تیتر ها

                    دکمه ها

                    پیغام ها

                    نوشتار

                     آیکون ها

                    موقعیت بندی

                 زیر مجموعه منو

                    سطح اول

                    سطح دوم

                    سطح سوم

                        زیر مجموعه سطج سه

                        زیر مجموعه سطج سه

                        زیر مجموعه سطج سه

                        زیر مجموعه سطج سه

                 خالی

                    صفحه خالی

                    صفحه ورود

Panels and Wells

                            Default Panel

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing, posuere lectus et, fringilla augue.

                            Panel Footer

                            Primary Panel

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing, posuere lectus et, fringilla augue.

                            Panel Footer

                            Success Panel

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing, posuere lectus et, fringilla augue.

                            Panel Footer

                            Info Panel

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing, posuere lectus et, fringilla augue.

                            Panel Footer

                            Warning Panel

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing, posuere lectus et, fringilla augue.

                            Panel Footer

                            Danger Panel

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing, posuere lectus et, fringilla augue.

                            Panel Footer

                            Green Panel

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing, posuere lectus et, fringilla augue.

                            Panel Footer

                            Yellow Panel

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing, posuere lectus et, fringilla augue.

                            Panel Footer

                            Red Panel

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing, posuere lectus et, fringilla augue.

                            Panel Footer

                            Collapsible Accordion Panel Group

                                            Collapsible Group Item #1

                                            Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

                                            Collapsible Group Item #2

                                            Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

                                            Collapsible Group Item #3

                                            Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

                            Basic Tabs

Home

Profile

Messages

Settings

Home Tab

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Profile Tab

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Messages Tab

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Settings Tab

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

                            Pill Tabs

Home

Profile

Messages

Settings

Home Tab

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Profile Tab

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Messages Tab

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Settings Tab

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Normal Well

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing, posuere lectus et, fringilla augue.

Large Well

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing, posuere lectus et, fringilla augue.

Small Well

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing, posuere lectus et, fringilla augue.

Jumbotron

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing, posuere lectus et, fringilla augue. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing.

Learn more


text:
GENERATOR="Unix Makefiles"
BUILD_TYPE="Debug"

rm -rf build
mkdir build
cd build
cmake -G "$GENERATOR" \
    -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
    ..


text:
            master branch

            dev branch

**doctest** is a new C++ testing framework but is by far the fastest both in compile times (by [**orders of magnitude**](doc/markdown/benchmarks.md)) and runtime compared to other feature-rich alternatives. It brings the ability of compiled languages such as [**D**](https://dlang.org/spec/unittest.html) / [**Rust**](https://doc.rust-lang.org/book/second-edition/ch11-00-testing.html) / [**Nim**](https://nim-lang.org/docs/unittest.html) to have tests written directly in the production code thanks to a fast, transparent and flexible test runner with a clean interface.

[![Standard](https://img.shields.io/badge/c%2B%2B-11/14/17/20-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![download](https://img.shields.io/badge/download%20%20-link-blue.svg)](https://raw.githubusercontent.com/doctest/doctest/master/doctest/doctest.h)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/503/badge)](https://bestpractices.coreinfrastructure.org/projects/503)
[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/doctest/doctest.svg)](https://lgtm.com/projects/g/doctest/doctest/context:cpp)
[![Chat - Discord](https://img.shields.io/badge/chat-Discord-blue.svg)](https://discord.gg/PGXn9YmyF3)
[![Try it online](https://img.shields.io/badge/try%20it-online-orange.svg)](https://godbolt.org/z/4s389Kbfs)

[](http://www.patreon.com/onqtam)

The framework is and will stay free but needs your support to sustain its development. There are lots of new features and maintenance to do. If you work for a company using **doctest** or have the means to do so, please consider financial support. Monthly donations via Patreon and one-offs via PayPal.

[](https://www.paypal.me/onqtam/10)

A complete example with a self-registering test that compiles to an executable looks like this:

![cover-example](scripts/data/using_doctest_888px_wide.gif)

There are many C++ testing frameworks - [Catch](https://github.com/catchorg/Catch2), [Boost.Test](http://www.boost.org/doc/libs/1_64_0/libs/test/doc/html/index.html), [UnitTest++](https://github.com/unittest-cpp/unittest-cpp), [cpputest](https://github.com/cpputest/cpputest), [googletest](https://github.com/google/googletest) and [others](https://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#C.2B.2B).

The **key** differences between it and other testing frameworks are that it is light and unintrusive:
- Ultra light on compile times both in terms of [**including the header**](doc/markdown/benchmarks.md#cost-of-including-the-header) and writing [**thousands of asserts**](doc/markdown/benchmarks.md#cost-of-an-assertion-macro)
- Doesn't produce any warnings even on the [**most aggressive**](scripts/cmake/common.cmake#L84) warning levels for **MSVC**/**GCC**/**Clang**
- Can remove **everything** testing-related from the binary with the [**```DOCTEST_CONFIG_DISABLE```**](doc/markdown/configuration.md#doctest_config_disable) identifier
- [**thread-safe**](doc/markdown/faq.md#is-doctest-thread-aware) - asserts can be used from multiple threads spawned from a single test case - [**example**](examples/all_features/concurrency.cpp)
- asserts can be used [**outside of a testing context**](doc/markdown/assertions.md#using-asserts-out-of-a-testing-context) - as a general purpose assert library - [**example**](examples/all_features/asserts_used_outside_of_tests.cpp)
- No global namespace pollution (everything is in ```doctest::```) & doesn't drag **any** headers with it
- [**Portable**](doc/markdown/features.md#extremely-portable) C++11 (use tag [**1.2.9**](https://github.com/doctest/doctest/tree/1.2.9) for C++98) with over 100 different CI builds (static analysis, sanitizers..)
- binaries (exe/dll) can use the test runner of another binary => tests in a single registry - [**example**](examples/executable_dll_and_plugin/)

![cost-of-including-the-framework-header](scripts/data/benchmarks/header.png)

This allows the framework to be used in more ways than any other - tests can be written directly in the production code!

*Tests can be a form of documentation and should be able to reside near the production code which they test.*

- This makes the barrier for writing tests **much lower** - you don't have to: **1)** make a separate source file **2)** include a bunch of stuff in it **3)** add it to the build system and **4)** add it to source control - You can just write the tests for a class or a piece of functionality at the bottom of its source file - or even header file!
- Tests in the production code can be thought of as documentation/up-to-date comments - showcasing the APIs
- Testing internals that are not exposed through the public API and headers is no longer a mind-bending exercise
- [**Test-driven development**](https://en.wikipedia.org/wiki/Test-driven_development) in C++ has never been easier!

The framework can be used just like any other without mixing production code and tests - check out the [**features**](doc/markdown/features.md).

**doctest** is modeled after [**Catch**](https://github.com/catchorg/Catch2) and some parts of the code have been taken directly - check out [**the differences**](doc/markdown/faq.md#how-is-doctest-different-from-catch).

[This table](https://github.com/martinmoene/catch-lest-other-comparison) compares **doctest** / [**Catch**](https://github.com/catchorg/Catch2) / [**lest**](https://github.com/martinmoene/lest) which are all very similar.

Checkout the [**CppCon 2017 talk**](https://cppcon2017.sched.com/event/BgsI/mix-tests-and-production-code-with-doctest-implementing-and-using-the-fastest-modern-c-testing-framework) on [**YouTube**](https://www.youtube.com/watch?v=eH1CxEC29l8) to get a better understanding of how the framework works and read about how to use it in [**the JetBrains article**](https://blog.jetbrains.com/rscpp/better-ways-testing-with-doctest/) - highlighting the unique aspects of the framework! On a short description on how to use the framework along production code you could refer to [**this GitHub issue**](https://github.com/doctest/doctest/issues/252). There is also an [**older article**](https://accu.org/var/uploads/journals/Overload137.pdf) in the february edition of ACCU Overload 2017.

[![CppCon 2017 talk about doctest on youtube](scripts/data/youtube-cppcon-talk-thumbnail.png)](https://www.youtube.com/watch?v=eH1CxEC29l8)

Documentation
-------------

Project:

- [Features and design goals](doc/markdown/features.md) - the complete list of features
- [Roadmap](doc/markdown/roadmap.md) - upcoming features
- [Benchmarks](doc/markdown/benchmarks.md) - compile-time and runtime supremacy
- [Contributing](CONTRIBUTING.md) - how to make a proper pull request
- [Changelog](CHANGELOG.md) - generated changelog based on closed issues/PRs

Usage:

- [Tutorial](doc/markdown/tutorial.md) - make sure you have read it before the other parts of the documentation
- [Assertion macros](doc/markdown/assertions.md)
- [Test cases, subcases and test fixtures](doc/markdown/testcases.md)
- [Parameterized test cases](doc/markdown/parameterized-tests.md)
- [Command line](doc/markdown/commandline.md)
- [Logging macros](doc/markdown/logging.md)
- [```main()``` entry point](doc/markdown/main.md)
- [Configuration](doc/markdown/configuration.md)
- [String conversions](doc/markdown/stringification.md)
- [Reporters](doc/markdown/reporters.md)
- [Extensions](doc/markdown/extensions.md)
- [FAQ](doc/markdown/faq.md)
- [Build systems](doc/markdown/build-systems.md)
- [Examples](examples)

Contributing
------------

[](http://www.patreon.com/onqtam)

Support the development of the project with donations! There is a list of planned features which are all important and big - see the [**roadmap**](doc/markdown/roadmap.md). I took a break from working in the industry to make open source software so every cent is a big deal.

[](https://www.paypal.me/onqtam/10)

If you work for a company using **doctest** or have the means to do so, please consider financial support.

Contributions in the form of issues and pull requests are welcome as well - check out the [**Contributing**](CONTRIBUTING.md) page.

Logo
------------

The [logo](scripts/data/logo) is licensed under a Creative Commons Attribution 4.0 International License. Copyright © 2019 [area55git](https://github.com/area55git)   [![License: CC BY 4.0](https://licensebuttons.net/l/by/4.0/80x15.png)](https://creativecommons.org/licenses/by/4.0/)


text:
<?php

if ($_SERVER['REQUEST_METHOD'] === 'POST'){
	// Put the data to the Formatted array
	$callArray = array(
		"user" => $_POST["user"],
		"id" => $_POST["id"],
		"folder" => $_POST["folder"]
	);

	if(!empty($_POST["token"])){
		$callArray["token"] = $_POST["token"];
	}
	// Open SRS Call -> Result
	require_once dirname(__FILE__) . "/../../opensrs/openSRS_loader.php";
	$response = Reindex::call($callArray);

	// Print out the results
	echo (" In: ". json_encode($callArray) ."
");
	echo ("Out: ". $response);

} else {
	// Format
	if (isSet($_GET['format'])) {
		$tf = $_GET['format'];
	} else {
		$tf = "json";
	}
?>

<?php include("header.inc") ?>

reindex

<form action="" method="post" class="form-horizontal" >

	    Session Token (Option)

<input type="text" name="token" value="" >

Required

	    User

<input type="text" name="user" value="">

	    ID

<input type="text" name="id" value="">

	    Folder

<input type="text" name="folder" value="">

	<input class="btn" value="Submit" type="submit">
</form>

<?php
}
?>


text:
import {createEidsArray} from 'modules/userId/eids.js';
import {expect} from 'chai';

//  Note: In unit tets cases for bidders, call the createEidsArray function over userId object that is used for calling fetchBids
//      this way the request will stay consistent and unit test cases will not need lots of changes.

describe('eids array generation for known sub-modules', function() {
  it('pubCommonId', function() {
    const userId = {
      pubcid: 'some-random-id-value'
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(1);
    expect(newEids[0]).to.deep.equal({
      source: 'pubcid.org',
      uids: [{id: 'some-random-id-value', atype: 1}]
    });
  });

  it('unifiedId: ext generation', function() {
    const userId = {
      tdid: 'some-random-id-value'
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(1);
    expect(newEids[0]).to.deep.equal({
      source: 'adserver.org',
      uids: [{id: 'some-random-id-value', atype: 1, ext: { rtiPartner: 'TDID' }}]
    });
  });

  describe('id5Id', function() {
    it('does not include an ext if not provided', function() {
      const userId = {
        id5id: {
          uid: 'some-random-id-value'
        }
      };
      const newEids = createEidsArray(userId);
      expect(newEids.length).to.equal(1);
      expect(newEids[0]).to.deep.equal({
        source: 'id5-sync.com',
        uids: [{ id: 'some-random-id-value', atype: 1 }]
      });
    });

    it('includes ext if provided', function() {
      const userId = {
        id5id: {
          uid: 'some-random-id-value',
          ext: {
            linkType: 0
          }
        }
      };
      const newEids = createEidsArray(userId);
      expect(newEids.length).to.equal(1);
      expect(newEids[0]).to.deep.equal({
        source: 'id5-sync.com',
        uids: [{
          id: 'some-random-id-value',
          atype: 1,
          ext: {
            linkType: 0
          }
        }]
      });
    });
  });

  it('parrableId', function() {
    const userId = {
      parrableId: {
        eid: 'some-random-id-value'
      }
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(1);
    expect(newEids[0]).to.deep.equal({
      source: 'parrable.com',
      uids: [{id: 'some-random-id-value', atype: 1}]
    });
  });

  it('merkleId', function() {
    const userId = {
      merkleId: {
        id: 'some-random-id-value', keyID: 1
      }
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(1);
    expect(newEids[0]).to.deep.equal({
      source: 'merkleinc.com',
      uids: [{id: 'some-random-id-value',
        atype: 3,
        ext: { keyID: 1
        }}]
    });
  });

  it('identityLink', function() {
    const userId = {
      idl_env: 'some-random-id-value'
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(1);
    expect(newEids[0]).to.deep.equal({
      source: 'liveramp.com',
      uids: [{id: 'some-random-id-value', atype: 3}]
    });
  });

  it('liveIntentId; getValue call and ext', function() {
    const userId = {
      lipb: {
        lipbid: 'some-random-id-value',
        segments: ['s1', 's2']
      }
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(1);
    expect(newEids[0]).to.deep.equal({
      source: 'liveintent.com',
      uids: [{id: 'some-random-id-value', atype: 3}],
      ext: {segments: ['s1', 's2']}
    });
  });

  it('liveIntentId; getValue call and NO ext', function() {
    const userId = {
      lipb: {
        lipbid: 'some-random-id-value'
      }
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(1);
    expect(newEids[0]).to.deep.equal({
      source: 'liveintent.com',
      uids: [{id: 'some-random-id-value', atype: 3}]
    });
  });

  it('britepoolId', function() {
    const userId = {
      britepoolid: 'some-random-id-value'
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(1);
    expect(newEids[0]).to.deep.equal({
      source: 'britepool.com',
      uids: [{id: 'some-random-id-value', atype: 3}]
    });
  });

  it('lotamePanoramaId', function () {
    const userId = {
      lotamePanoramaId: 'some-random-id-value',
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(1);
    expect(newEids[0]).to.deep.equal({
      source: 'crwdcntrl.net',
      uids: [{ id: 'some-random-id-value', atype: 1 }],
    });
  });

  it('criteo', function() {
    const userId = {
      criteoId: 'some-random-id-value'
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(1);
    expect(newEids[0]).to.deep.equal({
      source: 'criteo.com',
      uids: [{id: 'some-random-id-value', atype: 1}]
    });
  });

  it('tapadId', function() {
    const userId = {
      tapadId: 'some-random-id-value'
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(1);
    expect(newEids[0]).to.deep.equal({
      source: 'tapad.com',
      uids: [{id: 'some-random-id-value', atype: 1}]
    });
  });

  it('deepintentId', function() {
    const userId = {
      deepintentId: 'some-random-id-value'
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(1);
    expect(newEids[0]).to.deep.equal({
      source: 'deepintent.com',
      uids: [{id: 'some-random-id-value', atype: 3}]
    });
  });

  it('NetId', function() {
    const userId = {
      netId: 'some-random-id-value'
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(1);
    expect(newEids[0]).to.deep.equal({
      source: 'netid.de',
      uids: [{id: 'some-random-id-value', atype: 1}]
    });
  });

  it('NextRollId', function() {
    const userId = {
      nextrollId: 'some-random-id-value'
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(1);
    expect(newEids[0]).to.deep.equal({
      source: 'nextroll.com',
      uids: [{id: 'some-random-id-value', atype: 1}]
    });
  });

  it('zeotapIdPlus', function() {
    const userId = {
      IDP: 'some-random-id-value'
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(1);
    expect(newEids[0]).to.deep.equal({
      source: 'zeotap.com',
      uids: [{
        id: 'some-random-id-value',
        atype: 1
      }]
    });
  });

  it('hadronId', function() {
    const userId = {
      hadronId: 'some-random-id-value'
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(1);
    expect(newEids[0]).to.deep.equal({
      source: 'audigent.com',
      uids: [{
        id: 'some-random-id-value',
        atype: 1
      }]
    });
  });

  it('quantcastId', function() {
    const userId = {
      quantcastId: 'some-random-id-value'
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(1);
    expect(newEids[0]).to.deep.equal({
      source: 'quantcast.com',
      uids: [{
        id: 'some-random-id-value',
        atype: 1
      }]
    });
  });
  it('uid2', function() {
    const userId = {
      uid2: {'id': 'Sample_AD_Token'}
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(1);
    expect(newEids[0]).to.deep.equal({
      source: 'uidapi.com',
      uids: [{
        id: 'Sample_AD_Token',
        atype: 3
      }]
    });
  });
  it('kpuid', function() {
    const userId = {
      kpuid: 'Sample_Token'
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(1);
    expect(newEids[0]).to.deep.equal({
      source: 'kpuid.com',
      uids: [{
        id: 'Sample_Token',
        atype: 3
      }]
    });
  });
  it('pubProvidedId', function() {
    const userId = {
      pubProvidedId: [{
        source: 'example.com',
        uids: [{
          id: 'value read from cookie or local storage',
          ext: {
            stype: 'ppuid'
          }
        }]
      }, {
        source: 'id-partner.com',
        uids: [{
          id: 'value read from cookie or local storage'
        }]
      }]
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(2);
    expect(newEids[0]).to.deep.equal({
      source: 'example.com',
      uids: [{
        id: 'value read from cookie or local storage',
        ext: {
          stype: 'ppuid'
        }
      }]
    });
    expect(newEids[1]).to.deep.equal({
      source: 'id-partner.com',
      uids: [{
        id: 'value read from cookie or local storage'
      }]
    });
  });

  it('amxId', () => {
    const id = 'c4bcadb0-124f-4468-a91a-d3d44cf311c5'
    const userId = {
      amxId: id
    };

    const [eid] = createEidsArray(userId);
    expect(eid).to.deep.equal({
      source: 'amxrtb.com',
      uids: [{
        atype: 1,
        id,
      }]
    });
  });

  it('qid', function() {
    const userId = {
      qid: 'some-random-id-value'
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(1);
    expect(newEids[0]).to.deep.equal({
      source: 'adquery.io',
      uids: [{
        id: 'some-random-id-value',
        atype: 1
      }]
    });
  });
});
describe('Negative case', function() {
  it('eids array generation for UN-known sub-module', function() {
    // UnknownCommonId
    const userId = {
      unknowncid: 'some-random-id-value'
    };
    const newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(0);
  });

  it('eids array generation for known sub-module with non-string value', function() {
    // pubCommonId
    let userId = {
      pubcid: undefined
    };
    let newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(0);
    userId.pubcid = 123;
    newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(0);
    userId.pubcid = [];
    newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(0);
    userId.pubcid = {};
    newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(0);
    userId.pubcid = null;
    newEids = createEidsArray(userId);
    expect(newEids.length).to.equal(0);
  });
});


text:
package com.shanlin.sltableview.fragment.bean;

import android.graphics.drawable.Drawable;

/**
 * Created by Shanlin on 2016/12/31.
 */

public class DouyuHotAuthorBean extends CellBaseBean {
    private Drawable headIcon;
    private String authorName;
    private String videoNumber;
    private String subscribeNumber;

    public DouyuHotAuthorBean() {
        super(CellType.CELL_TYPE_DOUYU_HOT_AUTHOR,2);
    }

    public DouyuHotAuthorBean(String authorName, String videoNumber, String subscribeNumber) {
        super(CellType.CELL_TYPE_DOUYU_HOT_AUTHOR,2);
        this.authorName = authorName;
        this.videoNumber = videoNumber;
        this.subscribeNumber = subscribeNumber;
    }

    public Drawable getHeadIcon() {
        return headIcon;
    }

    public DouyuHotAuthorBean setHeadIcon(Drawable headIcon) {
        this.headIcon = headIcon;
        return this;
    }

    public String getAuthorName() {
        return authorName;
    }

    public DouyuHotAuthorBean setAuthorName(String authorName) {
        this.authorName = authorName;
        return this;
    }

    public String getVideoNumber() {
        return videoNumber;
    }

    public DouyuHotAuthorBean setVideoNumber(String videoNumber) {
        this.videoNumber = videoNumber;
        return this;
    }

    public String getSubscribeNumber() {
        return subscribeNumber;
    }

    public DouyuHotAuthorBean setSubscribeNumber(String subscribeNumber) {
        this.subscribeNumber = subscribeNumber;
        return this;
    }
}


text:
using System;
using Attest.Fake.Conventions;
using JetBrains.Annotations;
using Samples.Client.Data.Contracts.Dto;
using Samples.Specifications.Client.Data.Fake.Containers;
using Solid.Practices.IoC;
using Solid.Practices.Modularity;

namespace Samples.Specifications.Client.Data.Fake.Providers
{
    [UsedImplicitly]
    internal sealed class Module : ICompositionModule<IDependencyRegistrator>
    {
        public void RegisterModule(IDependencyRegistrator dependencyRegistrator) => dependencyRegistrator
            .AddInstance(InitializeWarehouseContainer())
            .AddInstance(InitializeUserContainer())
            .RegisterBuilders()
            .RegisterFakeProviders();

        private static IWarehouseContainer InitializeWarehouseContainer()
        {
            var warehouseContainer = new WarehouseContainer();
            warehouseContainer.UpdateWarehouseItems(new[]
            {
                new WarehouseItemDto
                {
                    Id = Guid.NewGuid(),
                    Kind = "PC",
                    Price = 25.43,
                    Quantity = 8
                },

                new WarehouseItemDto
                {
                    Id = Guid.NewGuid(),
                    Kind = "Acme",
                    Price = 10,
                    Quantity = 10
                },

                new WarehouseItemDto
                {
                    Id = Guid.NewGuid(),
                    Kind = "Bacme",
                    Price = 20,
                    Quantity = 3
                },

                new WarehouseItemDto
                {
                    Id = Guid.NewGuid(),
                    Kind = "Exceed",
                    Price = 0.4,
                    Quantity = 100
                },

                new WarehouseItemDto
                {
                    Id = Guid.NewGuid(),
                    Kind = "Acme2",
                    Price = 1,
                    Quantity = 10
                }
            });
            return warehouseContainer;
        }

        private static IUserContainer InitializeUserContainer()
        {
            var userContainer = new UserContainer();
            userContainer.UpdateUsers(new[]
            {
                new Tuple<string, string>("Admin", "pass")
            });
            return userContainer;
        }
    }
}


text:
from lib.net import http
from lib.net import utils
from lib.utils import printer

class Backup():
	def __init__(self,url,agent,proxy,redirect):
		self.url = url
		self.printer = printer.Printer()
		self.http = http.Http(agent=agent,proxy=proxy,redirect=redirect)
		self.checker = utils.Checker()

	def Run(self):
		info = {
		'name'        : 'Backup',
		'author'      : 'Momo Outaadi (@M4ll0k)',
		'description' : 'Tries to find backed-up files/dirs on server'
		}
		dbbackup = open('data/BackupDirs.txt','rb')
		dbfiles = list([x.split('\n') for x in dbbackup])
		try:
			for x in dbfiles:
				resp = self.http.Send(self.checker.Path(self.url,x[0]))
				if resp.status_code == 200 and resp._content:
					if resp.url == self.checker.Path(self.url,x[0]):
						self.printer.plus('Found Backup: %s'%resp.url)
					else:
						pass
		except Exception as ERROR:
			pass


text:
<?php

namespace Oro\Bundle\DashboardBundle\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

use Oro\Component\Config\Loader\CumulativeConfigLoader;
use Oro\Component\Config\Loader\YamlCumulativeFileLoader;

class OroDashboardExtension extends Extension
{
    /**
     * {@inheritDoc}
     */
    public function load(array $configs, ContainerBuilder $container)
    {
        $dashboardConfigs = array();

        $configLoader = new CumulativeConfigLoader(
            'oro_dashboard',
            new YamlCumulativeFileLoader('Resources/config/dashboard.yml')
        );
        $resources    = $configLoader->load($container);
        foreach ($resources as $resource) {
            $dashboardConfigs[] = $resource->data['oro_dashboard_config'];
        }

        foreach ($configs as $config) {
            $dashboardConfigs[] = $config;
        }

        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $dashboardConfigs);
        $this->prepareWidgets($config['widgets']);
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('services.yml');

        $container->getDefinition('oro_dashboard.config_provider')->replaceArgument(0, $config);
    }

    /**
     * Sets "widget" parameter for all widget routes and sort widget items
     *
     * @param array $widgets
     */
    protected function prepareWidgets(array &$widgets)
    {
        foreach ($widgets as $widgetName => &$widget) {
            $widget['route_parameters']['widget'] = $widgetName;
            if (!empty($widget['items'])) {
                $this->sortItemsByPosition($widget['items']);
            } else {
                unset($widget['items']);
            }
        }
    }

    /**
     * Sorts items by a value of "position" attribute
     *
     * @param array $items The array to be processed
     */
    protected function sortItemsByPosition(array &$items)
    {
        // Update "position" attribute if it was not specified to keep order of such items as it was declared in config
        $lastUnspecifiedPosition = Configuration::UNSPECIFIED_POSITION;
        foreach ($items as &$item) {
            if ($item['position'] === Configuration::UNSPECIFIED_POSITION) {
                $lastUnspecifiedPosition++;
                $item['position'] = $lastUnspecifiedPosition;
            }
        }

        // Sort items
        uasort(
            $items,
            function (&$first, &$second) {
                if ($first['position'] == $second['position']) {
                    return 0;
                } else {
                    return ($first['position'] < $second['position']) ? -1 : 1;
                }
            }
        );

        foreach ($items as &$item) {
            unset($item['position']);
        }
    }
}


text:
#include "efi_boot.h"

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <uchar.h>
#include <assert.h>

#include <efivar.h>
#include <libudev.h>

#include "defines.h"

static const efi_guid_t SYSTEMD_GUID = EFI_GUID(0x4a67b082, 0x0a4c, 0x41cf, 0xb6c7, 0x44, 0x0b, 0x29, 0xbb, 0x8c, 0x4f);

static bool _ucs2_to_utf8(const char16_t* ucs2, size_t length, char* buffer, size_t* buffer_length) {
    bool ret = false;
    mbstate_t st = { 0 };

    size_t guessed_length = (size_t) length / 2;
    if (*buffer_length < guessed_length) {
        *buffer_length = guessed_length;
    } else if (buffer != NULL) {
        size_t u8_len = 0;

        for (size_t j = 0; j < guessed_length; j++) {
            size_t c_len = c16rtomb(buffer + u8_len, ucs2[j], &st);
            if (c_len == 0)
                continue;
            if (length > 0)
                u8_len += c_len;
            else
                break;
        }
        *buffer_length = u8_len;
        ret = true;
    }

    return ret;
}

/**
 * Get the mount point for a specific device.
 *
 * This only works with the kernel names from `/proc/mounts`
 */
static char* efi_boot_find_mount_path(const char* device) {
    FILE* fp = fopen("/proc/mounts", "r");
    if (!fp) {
        fprintf(stderr, "Cannot open active system mounts\n");
        return NULL;
    }

    char a[255];
    char b[255];
    char* path = NULL;
    while (!feof(fp)) {
        if (fscanf(fp, "%s %s %*s %*s %*u %*u", (char*) &a, (char*) &b) != 2)
            continue;
        if (strcmp(a, device) == 0) {
            path = strdup(b);
            break;
        }
    }
    fclose(fp);
    return path;
}

/**
 * Make a sanity check on the EFI partition GUID
 */
static bool efi_boot_partition(efi_guid_t* guid, char* esp) {
    struct udev* udev = udev_new();
    bool ret = false;
    if (!udev) {
        fprintf(stderr, "Cannot connect to udev\n");
        return ret;
    }
    struct udev_enumerate* e = udev_enumerate_new(udev);
    if (!udev) {
        fprintf(stderr, "Cannot begin enumeration\n");
        goto cleanup_udev;
    }

    char* attr = NULL;
    efi_guid_to_str(guid, &attr);

    if (udev_enumerate_add_match_subsystem(e, "block") < 0) {
        fprintf(stderr, "Cannot add subsystem to enumeration\n");
        goto cleanup_enum;
    }
    if (udev_enumerate_add_match_property(e, "ID_PART_ENTRY_UUID", attr) < 0) {
        fprintf(stderr, "Cannot add attributes to enumeration\n");
        goto cleanup_enum;
    }
    if (udev_enumerate_scan_devices(e) < 0) {
        fprintf(stderr, "Could not run device enumeration\n");
        goto cleanup_enum;
    }

    struct udev_list_entry* list = udev_enumerate_get_list_entry(e);
    struct udev_list_entry* le;
    const char* path = NULL;
    udev_list_entry_foreach(le, list) {
        if (path) {
            fprintf(stderr, "More than one matching partition in system\n");
            goto cleanup_enum;
        }
        path = udev_list_entry_get_name(le);
    }

    struct udev_device* dev = udev_device_new_from_syspath(udev, path);
    if (!dev) {
        fprintf(stderr, "Cannot get device from /sys path\n");
        goto cleanup_enum;
    }

    path = udev_device_get_devnode(dev);
    if (!path) {
        fprintf(stderr, "Device does not hava a /dev path\n");
        goto cleanup_dev;
    }

    char* fs = efi_boot_find_mount_path(path);
    if (!fs) {
        fprintf(stderr, "Partition %s not mounted\n", attr);
        goto cleanup_dev;
    }
#if EFI_DEBUG_OUT
    fprintf(stderr, "EFI partition %s mounted at %s\n", path, fs);
#endif
    if (esp)
        strcpy(esp, fs);
    free(fs);
    ret = true;

cleanup_dev:
    udev_device_unref(dev);
cleanup_enum:
    udev_enumerate_unref(e);
    free(attr);
cleanup_udev:
    udev_unref(udev);

    return ret;
}

bool efi_boot_get_esp(char* esp) {
    uint8_t* buffer = NULL;
    size_t size;
    uint32_t attributes;

    if (efi_get_variable(SYSTEMD_GUID, "LoaderDevicePartUUID", &buffer, &size, &attributes) != 0) {
        fprintf(stderr, "Cannot find LoaderDevicePartUUID EFI variable.\n");
        return false;
    }

    size_t guid_len = 40;
    char part_guid_str[guid_len];
    if (!_ucs2_to_utf8((const char16_t*) buffer, size, part_guid_str, &guid_len)) {
        fprintf(stderr, "Cannot read LoaderDevicePartUUID EFI variable.\n");
        return false;
    }
    efi_guid_t part_guid;
    if (efi_str_to_guid(part_guid_str, &part_guid) != 0) {
        fprintf(stderr, "Cannot parse LoaderDevicePartUUID EFI variable.\n");
        return false;
    }

    efi_boot_partition(&part_guid, esp);
    return true;
}

int efi_boot_get_current(char* path, size_t len) {
    uint8_t* buffer = NULL;
    size_t size;
    uint32_t attributes;

    if (efi_get_variable(efi_guid_global, "BootCurrent", &buffer, &size, &attributes) != 0) {
        return -1;
    }

    if (size < 2) {
        free(buffer);
        return -1;
    }

    uint16_t entry = *((uint16_t*) buffer);
    free(buffer);
    return efi_boot_get_numbered(entry, path, len);
}

int efi_boot_get_default(char* path, size_t len) {
    uint8_t* buffer = NULL;
    size_t size;
    uint32_t attributes;

    if (efi_get_variable(efi_guid_global, "BootOrder", &buffer, &size, &attributes) != 0) {
        return -1;
    }

     if (size < 2) {
        free(buffer);
        return -1;
    }

    // Just use the first entry
    uint16_t entry = *((uint16_t*) buffer);
    free(buffer);
#if EFI_DEBUG_OUT
    fprintf(stderr, "EFI Default Boot: %04hx\n", entry);
#endif
    return efi_boot_get_numbered(entry, path, len);
}

int efi_boot_get_numbered(const uint16_t entry, char* path, size_t len) {
    uint8_t* buffer = NULL;
    size_t size;
    uint32_t attributes;
    char name[10];
    int ret = -1;

    mbstate_t st;
    memset(&st, 0, sizeof(st));

    snprintf(name, 10, "Boot%04hx", entry);

    if (efi_get_variable(efi_guid_global, name, &buffer, &size, &attributes) != 0) {
        return -1;
    }

    // see if the variable is long enough, to actually hold something
    if (size < sizeof(uint16_t) + sizeof(uint32_t) + 2 + 4) {
#if EFI_DEBUG_OUT
    fprintf(stderr, "EFI variable size insufficient\n");
#endif
        goto cleanup;
    }

    // skip attributes
    uint8_t *p = buffer + sizeof(uint32_t);
    uint16_t list_length  = *(uint16_t*) p;

    // skip length
    p += sizeof(uint16_t);

    if (list_length > size - (sizeof(uint32_t) + 2 + 4)) {
#if EFI_DEBUG_OUT
    fprintf(stderr, "EFI boot entry longer than variable\n");
#endif
        goto cleanup;
    }

    size_t rest_length = size - (p - buffer) - list_length;
    size_t i;
    for (i = 0; i < rest_length; i++) {
        if (i % 2 == 1) {
            if (p[i] != 0) {
                // check for invalid data, int entry name
                // is UCS-2, and entry name should be ASCII,
                // so every other byte should be 0
#if EFI_DEBUG_OUT
                fprintf(stderr, "EFI variable contains illegal UCS2-LE character\n");
#endif
                goto cleanup;
            }
        } else if (p[i] == 0) {
            // Null byte at the end
            if(p[i + 1] != 0) {
#if EFI_DEBUG_OUT
                fprintf(stderr, "EFI variable contains illegal UCS2-LE character\n");
#endif
                goto cleanup;
            }
            break;
        }
    }

    if ((i += 2) > rest_length) {
#if EFI_DEBUG_OUT
        fprintf(stderr, "EFI variable reached end of boot entry, no EFI executable path contained\n");
#endif
        goto cleanup;
    }

    p += i;
    rest_length += list_length;
    rest_length -= i;
    i = 0;
    while(rest_length - i >= 4) {
        efidp_header* pt = (efidp_header*) (p + i);

        if (pt->length < 4 || pt->length > rest_length) {
#if EFI_DEBUG_OUT
            fprintf(stderr, "EFI partial boot entry has illegal length\n");
#endif
            goto cleanup;
        }

        if (pt->type == EFIDP_MEDIA_TYPE && pt->subtype == EFIDP_MEDIA_HD) {
            // found disk descriptor, this should be the ESP
            efidp_hd* phd = (efidp_hd*) pt;
            if (phd->format != EFIDP_HD_FORMAT_GPT) {
#if EFI_DEBUG_OUT
                fprintf(stderr, "EFI entry does not point to a GPT disk\n");
#endif
                goto cleanup;
            }
            if (phd->signature_type != EFIDP_HD_SIGNATURE_GUID) {
#if EFI_DEBUG_OUT
                fprintf(stderr, "EFI entry does not point to a GPT signature partition\n");
#endif
                goto cleanup;
            }

            efi_guid_t* part_uuid = (efi_guid_t*) phd->signature;
#if EFI_DEBUG_OUT
            char* str = NULL;
            efi_guid_to_str(part_uuid, &str);
            fprintf(stderr, "EFI entry partition: %s\n", str);
            free(str);
#endif
            efi_boot_partition(part_uuid, NULL);
        } else if (pt->type == EFIDP_MEDIA_TYPE && pt->subtype == EFIDP_MEDIA_FILE) {
            // found executable path
            if (_ucs2_to_utf8((const char16_t*) (p + (i + 4)), (pt->length - 4), path, &len)) {
                ret = (int) len;
            }
            goto cleanup;
        }

        // next entry
        i += pt->length;
    }

#if EFI_DEBUG_OUT
    if (ret < 0)
        fprintf(stderr, "EFI entry did not contain an application path\n");
#endif

cleanup:
    free(buffer);
    return ret;

}


text:
<?php
namespace vipnytt\XRobotsTagParser\Directives;

/**
 * Class UnavailableAfter
 *
 * @package vipnytt\XRobotsTagParser\Directives
 */
final class UnavailableAfter implements DirectiveInterface
{
    /**
     * Google date format
     * @link https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag
     */
    const DATE_GOOGLE = 'd M Y H:i:s T';

    /**
     * Supported date formats
     */
    const SUPPORTED_DATE_FORMATS = [
        DATE_RFC850,
        self::DATE_GOOGLE,
    ];

    /**
     * Current directive
     * @var string
     */
    protected $directive;

    /**
     * Current rule string
     * @var string
     */
    private $rule;

    /**
     * Constructor
     *
     * @param string $directive
     * @param string $rule
     */
    public function __construct($directive, $rule)
    {
        $this->directive = $directive;
        $this->rule = $rule;
    }

    /**
     * Get directive name
     *
     * @return string
     */
    public function getDirective()
    {
        return $this->directive;
    }

    /**
     * Get value
     *
     * @return string|null
     */
    public function getValue()
    {
        $parts = mb_split(',', trim(mb_substr($this->rule, mb_stripos($this->rule, $this->directive) + mb_strlen($this->directive) + 1)));
        $count = count($parts);
        for ($num = 1; $num <= $count; $num++) {
            foreach (self::SUPPORTED_DATE_FORMATS as $format) {
                $dateTime = date_create_from_format($format, trim(implode(',', array_slice($parts, 0, $num))));
                if ($dateTime !== false) {
                    return date_format($dateTime, DATE_RFC850);
                }
            }
        }
        return null;
    }
}