text:
This section discusses how to deal with some of the challenges in testing and/or automating modern web applications.

## The "js" object

The browser instance exposes a "[`js`](api/geb/Browser.html#getJs\(\))" object that provides support for working with Javascript over and above what WebDriver provides.
It's important to understand how WebDriver does handle Javascript, which is through a driver's implementation of [`JavascriptExecutor`][javascriptexecutor]'s [`executeScript()`](http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/JavascriptExecutor.html#executeScript(java.lang.String, java.lang.Object[]\)) method.

> Before reading further, it's **strongly** recommended to read the description of [`executeScript()`](http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/JavascriptExecutor.html#executeScript(java.lang.String, java.lang.Object[]\)) in order to understand how type conversion works between the two worlds.

You can execute Javascript like you would with straight WebDriver using the driver instance via the browser…

    assert browser.driver.executeScript("return arguments[0];", 1) == 1

This is a bit long winded, and as you would expect Geb uses the dynamism of Groovy to make life easier.

> The [JavascriptExecutor][javascriptexecutor] interface does not define any contract in regards to the driver's responsibility when there is some issue executing Javascript. All drivers however throw _some kind_ of exception when this happens.

### Accessing Variables

Any _global_ javascript variables inside the browser can be read as _properties_ of the `js` object.

Given the following page…

We could access the javascript variable "`aVariable`" with…

    Browser.drive {
        assert js.aVariable == 1
    }

Or if we wanted to map it to page content…

    class ExamplePage extends Page {
        static content = {
            aVar { js.aVariable }
        }
    }

    Browser.drive {
        to ExamplePage
        assert aVar == 1
    }

We can even access _nested_ variables…

    assert js."document.title" == "Book of Geb"

### Calling Methods

Any _global_ javascript functions can be called as methods on the `js` object.

Given the following page…

We can call the `addThem()` function with…

    Browser.drive {
        assert js.addThem(1, 2) == 3
    }

This also works from pages and modules.

To call _nested_ methods, we use the same syntax as properties…

    Browser.drive {
        js."document.write"("dynamic!")
    }

### Executing Arbitrary Code

The `js` object also has an `exec()` method that can be used to run snippets of Javascript. It is identical to the [JavascriptExecutor.executeScript()](http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/JavascriptExecutor.html#executeScript(java.lang.String, java.lang.Object[]\)) method, except that it takes its arguments in the other order…

    assert js.exec(1, 2, "return arguments[0] + arguments[1];") == 3

You might be wondering why the order has been changed (i.e. the arguments go _before_ the script). It makes writing multiline javascript more convenient…

    js.exec 1, 2, """
        someJsMethod();
        // lots of javascript
        return true;
    """

## Waiting

Geb provides some convenient methods for _waiting_ for a certain condition to be true. This is useful for testing pages using AJAX, timers or effects.

The `waitFor` methods are provided by the [`WaitingSupport`](api/geb/waiting/WaitingSupport.html) mixin which delegates to the [`Wait` class](api/geb/waiting/Wait.html) (see the documentation of the [`waitFor` method](api/geb/waiting/Wait.html#waitFor\(groovy.lang.Closure\)) of this class for the precise semantics of _waiting_). These methods take various parameters that determine how long to wait for the given closure to return a true object according to the [Groovy Truth](http://groovy.codehaus.org/Groovy+Truth "Groovy - Groovy Truth"), and how long to wait in between invoking the closure again.

    waitFor {} // use default configuration
    waitFor(10) {} // wait for up to 10 seconds, using the default retry interval
    waitFor(10, 0.5) {} // wait for up to 10 seconds, waiting half a second in between retries
    waitFor("quick") {} // use the preset "quick" as the wait settings

See the section on [wait configuration](configuration.html#waiting) for how to change the default values and define presets.

> It is also possible to declare that content should be implicitly waited on, see [the `wait` option for content definition](pages.html#wait).

### Examples

Here is an example showing one way of using `waitFor()` to deal with the situation where clicking a button invokes an AJAX request that creates a new `div` on its completion.

    import geb.*

    class DynamicPage extends Page {
        static content = {
            theButton { $("input", value: "Make Request") }
            theResultDiv(required: false) { $("div#result") }
        }

        def makeRequest() {
            theButton.click()
            waitFor { theResultDiv.present }
        }
    }

    Browser.drive {
        to DynamicPage
        makeRequest()
        assert theResultDiv.text() == "The Result"
    }

> Notice that the '`theResultDiv`' is declared `required: false`. This is almost always necessary when dealing with dynamic content as it's likely to not be present on the page when it is first accessed (see: [section on `required`](pages.html#required))

Because the browser delegates method calls to the page object, the above could have been written as…

    Browser.drive {
        $("input", value: "Make Request")
        waitFor { $("div#result").present }
        assert $("div#result").text() == "The Result"
    }

Recall that the `return` keyword is optional in Groovy, so in the example above the `$("div#result").present` statement acts as the return value for the closure and is used as the basis on whether the closure _passed_ or not. This means that you must ensure that the last statement inside the closure returns a value that is `true` according to the [Groovy Truth](http://groovy.codehaus.org/Groovy+Truth) (if you're unfamiliar with the Groovy Truth **do** read that page).

> Not using explicit `return` statements in closure expressions passed to `waitFor()` is actually preferred. See the section on [implicit assertions][implicit-assertions] for more information.

The closures given to the `waitFor` method(s) do not need to be single statement.

    waitFor {
        def a = 1
        def b = 2
        a == b
    }

That will work fine.

If you wish to *test* multiple conditions as separate statement inside a `waitFor` closure, you can just put them in separate lines.

    waitFor {
        1 == 1
        2 == 2
    }

### Custom message

If you wish to add a custom message to `WaitTimeoutException` that is being thrown when `waitFor` call times out you can do so by providing a message parameter to the `waitFor` call:

	waitFor (message: 'My custom message') { $("div#result").present }

## Alert and Confirm Dialogs

WebDriver currently [does not handle](http://code.google.com/p/selenium/wiki/FrequentlyAskedQuestions#Q:_Does_support_Javascript_alerts_and_prompts?) the [`alert()` and `confirm()` dialog windows](http://www.w3schools.com/JS/js_popup.asp). However, we can fake it through some Javascript magic as [discussed on the WebDriver issue for this](http://code.google.com/p/selenium/issues/detail?id=27#c17). Geb implements a workaround based on this solution for you. Note that this feature relies on making changes to the browser's `window` DOM object so may not work on all browsers on all platforms. At the time when WebDriver adds support for this functionality the underlying implementation of the following methods will change to use that which will presumably be more robust. Geb adds this functionality through the [`AlertAndConfirmSupport`](api/geb/js/AlertAndConfirmSupport.html) class that is mixed into
[`Page`][page-api] and
[`Module`][module-api].

The Geb methods **prevent** the browser from actually displaying the dialog, which is a good thing. This prevents the browser blocking while the dialog is displayed and causing your test to hang indefinitely.

> Unexpected `alert()` and `confirm()` calls can have strange results. This is due to the nature of how Geb handles this internally. If you are seeing strange results, you may want to run your tests/scripts against a real browser and watch what happens to make sure there aren't `alert()`s or `confirm()`s being called that you aren't expecting. To do this, you need to disable Geb's handling by changing your code to not use the methods below.

### alert()

There are two methods that deal with `alert()` dialogs:

    String withAlert(Closure actions)
    void withNoAlert(Closure actions)

The first method, `withAlert()`, is used to verify actions that will produce an `alert()` dialog. This method returns the alert message.

Given the following HTML…

    <input type="button" name="showAlert" onclick="alert('Bang!');" />

The `withAlert()` method is used like so…

    assert withAlert { $("input", name: "showAlert").click() } == "Bang!"

If an alert dialog is not raised by the given "actions" closure, an `AssertionError` will be thrown.

The `withAlert()` method also accepts a wait option. It is useful if the code in your "actions" closure is raising a dialog in an asynchronous manner and can be used like that:

	assert withAlert(wait: true) { $("input", name: "showAlert").click() } == "Bang!"

The value for the `wait` option can be one of the following:

* **`true`** - wait for the content using the _default wait_ configuration
* **a string** - wait for the content using the _wait preset_ with this name from the configuration
* **a number** - wait for the content for this many seconds, using the _default retry interval_ from the configuration
* **a 2 element list of numbers** - wait for the content using element 0 as the timeout seconds value, and element 1 as the retry interval seconds value

Any other value will be interpreted as `false`.

The second method, `withNoAlert()`, is used to verify actions that will not produce an `alert()` dialog. If an alert dialog is raised by the given "actions" closure, an `AssertionError` will be thrown.

Given the following HTML…

    <input type="button" name="dontShowAlert" />

The `withNoAlert()` method is used like so…

    withNoAlert { $("input", name: "dontShowAlert").click() }

> It's a good idea to use `withNoAlert()` when doing something that _might_ raise an alert. If you don't, the browser is going to raise a real alert dialog and sit there waiting for someone to click it which means your test is going to hang. Using `withNoAlert()` prevents this.

A side effect of the way that this is implemented is that we aren't able to definitively handle actions that cause the browser's actual page to change (e.g. clicking a link in the closure given to `withAlert()`/`withNoAlert()`). We can detect that the browser page did change, but we can't know if `alert()` did or did not get called before the page change. If a page change was detected the `withAlert()` method will return a literal `true` (whereas it would normally return the alert message), while the `withNoAlert()` will succeed.

### confirm()

There are three methods that deal with `confirm()` dialogs:

    String withConfirm(boolean ok, Closure actions)
    String withConfirm(Closure actions) // defaults 'ok' to true
    void withNoConfirm(Closure actions)

The first method, `withConfirm()` (and its '`ok`' defaulted relative), is used to verify actions that will produce an `confirm()` dialog. This method returns the confirmation message. The `ok` parameter controls whether the `confirm()` call should return `true` or `false` (i.e. the user has clicked the "OK" or "Cancel" buttons).

Given the following HTML…

    <input type="button" name="showConfirm" onclick="confirm('Do you like Geb?');" />

The `withConfirm()` method is used like so…

    assert withConfirm(true) { $("input", name: "showConfirm").click() } == "Do you like Geb?"

If a confirmation dialog is not raised by the given "actions" closure, an `AssertionError` will be thrown.

The `withConfirm()` method also accepts a wait option just like the `withAlert()` method. See the [description of `withAlert()`](javascript.html#alert) to learn about the possible values and usage.

The second method, `withNoConfirm()`, is used to verify actions that will not produce an `confirm()` dialog. If a confirmation dialog is raised by the given "actions" closure, an `AssertionError` will be thrown.

Given the following HTML…

    <input type="button" name="dontShowConfirm" />

The `withNoConfirm()` method is used like so…

    withNoConfirm { $("input", name: "dontShowConfirm").click() }

> It's a good idea to use `withNoConfirm()` when doing something that _might_ raise a a confirmation. If you don't, the browser is going to raise a real confirmation dialog and sit there waiting for someone to click it which means your test is going to hang. Using `withNoConfirm()` prevents this.

A side effect of the way that this is implemented is that we aren't able to definitively handle actions that cause the browser's actual page to change (e.g. clicking a link in the closure given to `withConfirm()`/`withNoConfirm()`). We can detect that the browser page did change, but we can't know if `confirm()` did or did not get called before the page change. If a page change was detected the `withConfirm()` method will return a literal `true` (whereas it would normally return the alert message), while the `withNoConfirm()` will succeed.

### About prompt()

Geb does not provide any support for prompt() due to it's infrequent and generally discouraged use.

## jQuery Integration

Geb has special support for the [jQuery javascript library][jquery]. Navigator objects have a special adapter that makes calling jQuery methods against the underlying DOM elements simple. This is best explained by example.

> The jQuery integration only works when the pages you are working with include jQuery, Geb does not install it in the page for you. The minimum supported version of jQuery is 1.4.

Consider the following page:

Geb!

We want to click the Geb link, but can't because it's hidden (WebDriver does not let you interact with hidden elements). The div containing the link (div "a") is only displayed when the mouse moves over div "a".

The jQuery library provides convenient methods for triggering browser events. We can use this to simulate the mouse being moved over the div "a".

In straight jQuery JavaScript we would do…

    jQuery("div#a").mouseover()

Which we could invoke via Geb easy enough…

    js.exec 'jQuery("div#a").mouseover();'

That will work, but can be inconvenient as it duplicates content definitions in our Geb pages. Geb's jQuery integration allows you to use your defined content in Geb with jQuery. Here is how we could call the `mouseover` jQuery function on an element from Geb…

    $("div#a").jquery.mouseover()

To be clear, that is Groovy (not JavaScript code). It can be used with pages…

    import geb.*

    class ExamplePage extends Page {
        static content = {
            divA { $("#a") }
            divB { $("#b") }
            gebLink { divB.find("a") }
        }
    }

    Browser.drive {
        to ExamplePage
        // div b is not showing
        divA.jquery.mouseover()
        // div b is showing now
        gebLink.click()
    }

The `jquery` property of a navigator is conceptually equivalent to a jQuery object for _all_ of the navigator's matched page elements.

The methods can also take arguments…

    $("#a").jquery.trigger('mouseover')

The same set of restricted types as allowed by WebDriver's [`executeScript()`](http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/JavascriptExecutor.html#executeScript(java.lang.String, java.lang.Object[]\)) method are permitted here.

The return value of methods called on the `jquery` property depends on what the corresponding jQuery method returns. A jQuery object will be converted to a Navigator representing the same set of elements, other values such as strings and numbers are returned as per WebDriver's [`executeScript()`](http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/JavascriptExecutor.html#executeScript(java.lang.String, java.lang.Object[]\)) method.

### Why?

This functionality was developed to make triggering mouse related events easier. Some applications are very sensitive to mouse events and triggering these events in an automated environment is a challenge. jQuery provides a good API for faking these events which makes for a good solution.


text:
import { NgModule } from '@angular/core';
import { ButtonModule } from '../button/button.module';
import { IconModule } from '../icon/icon.module';
import { Searchbar } from './searchbar';
/**
 * @hidden
 */
var SearchbarModule = (function () {
    function SearchbarModule() {
    }
    /**
     * @return {?}
     */
    SearchbarModule.forRoot = function () {
        return {
            ngModule: SearchbarModule, providers: []
        };
    };
    return SearchbarModule;
}());
export { SearchbarModule };
SearchbarModule.decorators = [
    { type: NgModule, args: [{
                imports: [
                    ButtonModule,
                    IconModule
                ],
                declarations: [
                    Searchbar
                ],
                exports: [
                    Searchbar
                ]
            },] },
];
/**
 * @nocollapse
 */
SearchbarModule.ctorParameters = function () { return []; };
function SearchbarModule_tsickle_Closure_declarations() {
    /** @type {?} */
    SearchbarModule.decorators;
    /**
     * @nocollapse
     * @type {?}
     */
    SearchbarModule.ctorParameters;
}
//# sourceMappingURL=searchbar.module.js.map

redpajama_set_name: RedPajamaGithub


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/logging/v2/log_entry.proto

package com.google.logging.v2;

/**
 *
 *
 *

 * Additional information about the source code location that produced the log
 * entry.
 *

 *
 * Protobuf type {@code google.logging.v2.LogEntrySourceLocation}
 */
public final class LogEntrySourceLocation extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.logging.v2.LogEntrySourceLocation)
    LogEntrySourceLocationOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use LogEntrySourceLocation.newBuilder() to construct.
  private LogEntrySourceLocation(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private LogEntrySourceLocation() {
    file_ = "";
    line_ = 0L;
    function_ = "";
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  private LogEntrySourceLocation(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              file_ = s;
              break;
            }
          case 16:
            {
              line_ = input.readInt64();
              break;
            }
          case 26:
            {
              java.lang.String s = input.readStringRequireUtf8();

              function_ = s;
              break;
            }
          default:
            {
              if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.logging.v2.LogEntryProto
        .internal_static_google_logging_v2_LogEntrySourceLocation_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.logging.v2.LogEntryProto
        .internal_static_google_logging_v2_LogEntrySourceLocation_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.logging.v2.LogEntrySourceLocation.class,
            com.google.logging.v2.LogEntrySourceLocation.Builder.class);
  }

  public static final int FILE_FIELD_NUMBER = 1;
  private volatile java.lang.Object file_;
  /**
   *
   *
   *

   * Optional. Source file name. Depending on the runtime environment, this
   * might be a simple name or a fully-qualified name.
   *

   *
   * string file = 1;
   */
  public java.lang.String getFile() {
    java.lang.Object ref = file_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      file_ = s;
      return s;
    }
  }
  /**
   *
   *
   *

   * Optional. Source file name. Depending on the runtime environment, this
   * might be a simple name or a fully-qualified name.
   *

   *
   * string file = 1;
   */
  public com.google.protobuf.ByteString getFileBytes() {
    java.lang.Object ref = file_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      file_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int LINE_FIELD_NUMBER = 2;
  private long line_;
  /**
   *
   *
   *

   * Optional. Line within the source file. 1-based; 0 indicates no line number
   * available.
   *

   *
   * int64 line = 2;
   */
  public long getLine() {
    return line_;
  }

  public static final int FUNCTION_FIELD_NUMBER = 3;
  private volatile java.lang.Object function_;
  /**
   *
   *
   *

   * Optional. Human-readable name of the function or method being invoked, with
   * optional context such as the class or package name. This information may be
   * used in contexts such as the logs viewer, where a file and line number are
   * less meaningful. The format can vary by language. For example:
   * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
   * (Python).
   *

   *
   * string function = 3;
   */
  public java.lang.String getFunction() {
    java.lang.Object ref = function_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      function_ = s;
      return s;
    }
  }
  /**
   *
   *
   *

   * Optional. Human-readable name of the function or method being invoked, with
   * optional context such as the class or package name. This information may be
   * used in contexts such as the logs viewer, where a file and line number are
   * less meaningful. The format can vary by language. For example:
   * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
   * (Python).
   *

   *
   * string function = 3;
   */
  public com.google.protobuf.ByteString getFunctionBytes() {
    java.lang.Object ref = function_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      function_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!getFileBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, file_);
    }
    if (line_ != 0L) {
      output.writeInt64(2, line_);
    }
    if (!getFunctionBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, function_);
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!getFileBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, file_);
    }
    if (line_ != 0L) {
      size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, line_);
    }
    if (!getFunctionBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, function_);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.logging.v2.LogEntrySourceLocation)) {
      return super.equals(obj);
    }
    com.google.logging.v2.LogEntrySourceLocation other =
        (com.google.logging.v2.LogEntrySourceLocation) obj;

    boolean result = true;
    result = result && getFile().equals(other.getFile());
    result = result && (getLine() == other.getLine());
    result = result && getFunction().equals(other.getFunction());
    result = result && unknownFields.equals(other.unknownFields);
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + FILE_FIELD_NUMBER;
    hash = (53 * hash) + getFile().hashCode();
    hash = (37 * hash) + LINE_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getLine());
    hash = (37 * hash) + FUNCTION_FIELD_NUMBER;
    hash = (53 * hash) + getFunction().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.logging.v2.LogEntrySourceLocation parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.logging.v2.LogEntrySourceLocation parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.logging.v2.LogEntrySourceLocation parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.logging.v2.LogEntrySourceLocation parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.logging.v2.LogEntrySourceLocation parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.logging.v2.LogEntrySourceLocation parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.logging.v2.LogEntrySourceLocation parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.logging.v2.LogEntrySourceLocation parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.logging.v2.LogEntrySourceLocation parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.logging.v2.LogEntrySourceLocation parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.logging.v2.LogEntrySourceLocation parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.logging.v2.LogEntrySourceLocation parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(com.google.logging.v2.LogEntrySourceLocation prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   *

   * Additional information about the source code location that produced the log
   * entry.
   *

   *
   * Protobuf type {@code google.logging.v2.LogEntrySourceLocation}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.logging.v2.LogEntrySourceLocation)
      com.google.logging.v2.LogEntrySourceLocationOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.logging.v2.LogEntryProto
          .internal_static_google_logging_v2_LogEntrySourceLocation_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.logging.v2.LogEntryProto
          .internal_static_google_logging_v2_LogEntrySourceLocation_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.logging.v2.LogEntrySourceLocation.class,
              com.google.logging.v2.LogEntrySourceLocation.Builder.class);
    }

    // Construct using com.google.logging.v2.LogEntrySourceLocation.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      file_ = "";

      line_ = 0L;

      function_ = "";

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.logging.v2.LogEntryProto
          .internal_static_google_logging_v2_LogEntrySourceLocation_descriptor;
    }

    @java.lang.Override
    public com.google.logging.v2.LogEntrySourceLocation getDefaultInstanceForType() {
      return com.google.logging.v2.LogEntrySourceLocation.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.logging.v2.LogEntrySourceLocation build() {
      com.google.logging.v2.LogEntrySourceLocation result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.logging.v2.LogEntrySourceLocation buildPartial() {
      com.google.logging.v2.LogEntrySourceLocation result =
          new com.google.logging.v2.LogEntrySourceLocation(this);
      result.file_ = file_;
      result.line_ = line_;
      result.function_ = function_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return (Builder) super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return (Builder) super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return (Builder) super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return (Builder) super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.logging.v2.LogEntrySourceLocation) {
        return mergeFrom((com.google.logging.v2.LogEntrySourceLocation) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.logging.v2.LogEntrySourceLocation other) {
      if (other == com.google.logging.v2.LogEntrySourceLocation.getDefaultInstance()) return this;
      if (!other.getFile().isEmpty()) {
        file_ = other.file_;
        onChanged();
      }
      if (other.getLine() != 0L) {
        setLine(other.getLine());
      }
      if (!other.getFunction().isEmpty()) {
        function_ = other.function_;
        onChanged();
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.logging.v2.LogEntrySourceLocation parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.logging.v2.LogEntrySourceLocation) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object file_ = "";
    /**
     *
     *
     *

     * Optional. Source file name. Depending on the runtime environment, this
     * might be a simple name or a fully-qualified name.
     *

     *
     * string file = 1;
     */
    public java.lang.String getFile() {
      java.lang.Object ref = file_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        file_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     *

     * Optional. Source file name. Depending on the runtime environment, this
     * might be a simple name or a fully-qualified name.
     *

     *
     * string file = 1;
     */
    public com.google.protobuf.ByteString getFileBytes() {
      java.lang.Object ref = file_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        file_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     *

     * Optional. Source file name. Depending on the runtime environment, this
     * might be a simple name or a fully-qualified name.
     *

     *
     * string file = 1;
     */
    public Builder setFile(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      file_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Optional. Source file name. Depending on the runtime environment, this
     * might be a simple name or a fully-qualified name.
     *

     *
     * string file = 1;
     */
    public Builder clearFile() {

      file_ = getDefaultInstance().getFile();
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Optional. Source file name. Depending on the runtime environment, this
     * might be a simple name or a fully-qualified name.
     *

     *
     * string file = 1;
     */
    public Builder setFileBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      file_ = value;
      onChanged();
      return this;
    }

    private long line_;
    /**
     *
     *
     *

     * Optional. Line within the source file. 1-based; 0 indicates no line number
     * available.
     *

     *
     * int64 line = 2;
     */
    public long getLine() {
      return line_;
    }
    /**
     *
     *
     *

     * Optional. Line within the source file. 1-based; 0 indicates no line number
     * available.
     *

     *
     * int64 line = 2;
     */
    public Builder setLine(long value) {

      line_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Optional. Line within the source file. 1-based; 0 indicates no line number
     * available.
     *

     *
     * int64 line = 2;
     */
    public Builder clearLine() {

      line_ = 0L;
      onChanged();
      return this;
    }

    private java.lang.Object function_ = "";
    /**
     *
     *
     *

     * Optional. Human-readable name of the function or method being invoked, with
     * optional context such as the class or package name. This information may be
     * used in contexts such as the logs viewer, where a file and line number are
     * less meaningful. The format can vary by language. For example:
     * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
     * (Python).
     *

     *
     * string function = 3;
     */
    public java.lang.String getFunction() {
      java.lang.Object ref = function_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        function_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     *

     * Optional. Human-readable name of the function or method being invoked, with
     * optional context such as the class or package name. This information may be
     * used in contexts such as the logs viewer, where a file and line number are
     * less meaningful. The format can vary by language. For example:
     * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
     * (Python).
     *

     *
     * string function = 3;
     */
    public com.google.protobuf.ByteString getFunctionBytes() {
      java.lang.Object ref = function_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        function_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     *

     * Optional. Human-readable name of the function or method being invoked, with
     * optional context such as the class or package name. This information may be
     * used in contexts such as the logs viewer, where a file and line number are
     * less meaningful. The format can vary by language. For example:
     * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
     * (Python).
     *

     *
     * string function = 3;
     */
    public Builder setFunction(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      function_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Optional. Human-readable name of the function or method being invoked, with
     * optional context such as the class or package name. This information may be
     * used in contexts such as the logs viewer, where a file and line number are
     * less meaningful. The format can vary by language. For example:
     * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
     * (Python).
     *

     *
     * string function = 3;
     */
    public Builder clearFunction() {

      function_ = getDefaultInstance().getFunction();
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Optional. Human-readable name of the function or method being invoked, with
     * optional context such as the class or package name. This information may be
     * used in contexts such as the logs viewer, where a file and line number are
     * less meaningful. The format can vary by language. For example:
     * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
     * (Python).
     *

     *
     * string function = 3;
     */
    public Builder setFunctionBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      function_ = value;
      onChanged();
      return this;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.logging.v2.LogEntrySourceLocation)
  }

  // @@protoc_insertion_point(class_scope:google.logging.v2.LogEntrySourceLocation)
  private static final com.google.logging.v2.LogEntrySourceLocation DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.logging.v2.LogEntrySourceLocation();
  }

  public static com.google.logging.v2.LogEntrySourceLocation getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<LogEntrySourceLocation> PARSER =
      new com.google.protobuf.AbstractParser<LogEntrySourceLocation>() {
        @java.lang.Override
        public LogEntrySourceLocation parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new LogEntrySourceLocation(input, extensionRegistry);
        }
      };

  public static com.google.protobuf.Parser<LogEntrySourceLocation> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<LogEntrySourceLocation> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.logging.v2.LogEntrySourceLocation getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}


text:
chrome.webRequest.onBeforeRequest.addListener(
function(details){
	return { redirectUrl: details.url.replace("www.bing.com/search", "duckduckgo.com/")};
}, { urls: ["*://www.bing.com/search*"] }, ["blocking"]);

// Listener to check if extension is installed (when browsing installer page)
chrome.runtime.onMessageExternal.addListener(
function (request, sender, sendResponse) {
    if (request) {
        if (request.message) {
            if (request.message == "version") {
                sendResponse({ version: "1.1" });
            }
        }
    }
    return true;
});


text:
package log5go

import (
	"fmt"
	"io"
	"time"
)

// Data represents user-added key/value pairs to a log message. For string output,
// these values are added to the end of the end of the user message with the form
// key=value. For JSON output, data is added as a JSON object, like
// data:{ "key1":10, "key2":"foo" }. Developers should avoid using complex types
// as data values, as it could break log output if the value cannot be properly
// formatted.
type Data map[string]interface{}

// boundLogger binds a logger to user-supplied data. boundLogger implements the Log5Go
// interface so a logging method can be called on it to log the data. The boundLogger
// object can be reused. Calling LogBuilder methods on a boundLogger object result in
// a NOOP to keep developers from doing silly things.
type boundLogger struct {
	l    *logger
	data Data
}

//-- Log5GoData interface ------------

func (l *boundLogger) WithData(d Data) Log5Go {
	for key, value := range d {
		l.data[key] = value
	}
	return l
}

//-- Log5Go interface ------------

func (l *boundLogger) Log(level LogLevel, format string, a ...interface{}) {
	l.l.log(time.Now(), level, 2, fmt.Sprintf(format, a...), l.data)
}

func (l *boundLogger) Trace(format string, a ...interface{}) {
	l.l.log(time.Now(), LogTrace, 2, fmt.Sprintf(format, a...), l.data)
}

func (l *boundLogger) Debug(format string, a ...interface{}) {
	l.l.log(time.Now(), LogDebug, 2, fmt.Sprintf(format, a...), l.data)
}

func (l *boundLogger) Info(format string, a ...interface{}) {
	l.l.log(time.Now(), LogInfo, 2, fmt.Sprintf(format, a...), l.data)
}

func (l *boundLogger) Notice(format string, a ...interface{}) {
	l.l.log(time.Now(), LogNotice, 2, fmt.Sprintf(format, a...), l.data)
}

func (l *boundLogger) Warn(format string, a ...interface{}) {
	l.l.log(time.Now(), LogWarn, 2, fmt.Sprintf(format, a...), l.data)
}

func (l *boundLogger) Error(format string, a ...interface{}) {
	l.l.log(time.Now(), LogError, 2, fmt.Sprintf(format, a...), l.data)
}

func (l *boundLogger) Critical(format string, a ...interface{}) {
	l.l.log(time.Now(), LogCritical, 2, fmt.Sprintf(format, a...), l.data)
}

func (l *boundLogger) Alert(format string, a ...interface{}) {
	l.l.log(time.Now(), LogAlert, 2, fmt.Sprintf(format, a...), l.data)
}

func (l *boundLogger) Fatal(format string, a ...interface{}) {
	l.l.log(time.Now(), LogFatal, 2, fmt.Sprintf(format, a...), l.data)
}

func (l *boundLogger) LogLevel() LogLevel {
	return l.l.LogLevel()
}

func (l *boundLogger) SetLogLevel(level LogLevel) {
	// NOOP
}

//-- LogBuilder interface -----------------

func (l *boundLogger) Clone() Log5Go {
	// NOOP
	return l
}

func (l *boundLogger) WithTimeFmt(format string) Log5Go {
	// NOOP
	return l
}

func (l *boundLogger) ToStdout() Log5Go {
	// NOOP
	return l
}

func (l *boundLogger) ToStderr() Log5Go {
	// NOOP
	return l
}

func (l *boundLogger) ToWriter(out io.Writer) Log5Go {
	// NOOP
	return l
}

func (l *boundLogger) WithPrefix(prefix string) Log5Go {
	// NOOP
	return l
}

func (l *boundLogger) WithLongLines() Log5Go {
	// NOOP
	return l
}

func (l *boundLogger) WithShortLines() Log5Go {
	// NOOP
	return l
}

func (l *boundLogger) ToFile(directory string, filename string) Log5Go {
	// NOOP
	return l
}

func (l *boundLogger) ToAppender(appender Appender) Log5Go {
	// NOOP
	return l
}

func (l *boundLogger) WithRotation(frequency rollFrequency, keepNLogs int) Log5Go {
	// NOOP
	return l
}

func (l *boundLogger) WithStderr() Log5Go {
	// NOOP
	return l
}

func (l *boundLogger) WithFmt(format string) Log5Go {
	// NOOP
	return l
}

func (l *boundLogger) Json() Log5Go {
	// NOOP
	return l
}

func (l *boundLogger) Register(key string) Log5Go {
	// NOOP
	return l
}

func (l *boundLogger) ToLocalSyslog(facility SyslogPriority, tag string) Log5Go {
	// NOOP
	return l
}

func (l *boundLogger) ToRemoteSyslog(facility SyslogPriority, tag string, transport string, addr string) Log5Go {
	// NOOP
	return l
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.Windows;

namespace ESRI.ArcLogistics.App.Controls
{
    /// <summary>
    /// Class that contains all necessary data for gantt item progress to draw itself.
    /// </summary>
    internal class GanttItemProgressDrawingContext
    {
        /// <summary>
        /// Drawing context that must be used to draw the element.
        /// </summary>
        public DrawingContext DrawingContext
        {
            get;
            set;
        }

        /// <summary>
        /// Center point where drawing must be drawn.
        /// </summary>
        public Point DrawingCenterPoint
        {
            get;
            set;
        }
    }
}


text:
function cdn(options) {
	return this;
}
cdn.prototype.constructor = cdn;

cdn.prototype.serviceType = "rax:object-cdn";
cdn.prototype.endpoint = null;

//  _____                 _   _
// |  ___|   _ _ __   ___| |_(_) ___  _ __  ___
// | |_ | | | | '_ \ / __| __| |/ _ \| '_ \/ __|
// |  _|| |_| | | | | (__| |_| | (_) | | | \__ \
// |_|   \__,_|_| |_|\___|\__|_|\___/|_| |_|___/

cdn.prototype.listContainers = function(options, callback) {
	if(!this.core.processArgs({}, arguments)) { return callback({error:"Bad Arguments"}); }

	var qs = {
		'format':'json',
		'enabled_only' : true
	};
	if(options.limit) qs.limit = options.limit;
	if(options.marker) qs.marker = options.marker;
	if(options.end_marker) qs.end_marker = options.end_marker;
	if(options.enabled_only !== undefined) qs.enabled_only = options.enabled_only;

	return this.request({
		qs : {'format':'json'}
	}, callback);
};

cdn.prototype.getContainerMeta = function(options, callback) {
	if(!this.core.processArgs({
		default : "container",
		required : ['container']
	}, arguments)) { return callback({error:"Bad Arguments"}); }

	return this.request({
		method: "HEAD",
		url: options.container
	}, callback);
};

cdn.prototype.editContainerMeta = function(options, callback) {
	if(!this.core.processArgs({
		required : ['meta','container']
	}, arguments)) { return callback({error:"Bad Arguments"}); }

	return this.request({
		method: "POST",
		url: options.container,
		headers: options.meta || {},
		mergeHeaders : true
	},callback);
};

cdn.prototype.enableContainer = function(options, callback) {
		if(!this.core.processArgs({
			required : ['container'],
			default : 'container'
		}, arguments)) { return callback({error:"Bad Arguments"}); }

		return this.request({
			method : "PUT",
			url: options.container,
			headers: {
				'X-CDN-Enabled' : 'True',
				'X-TTL' : options.ttl || '900'
			},
			mergeHeaders : true
		}, callback);
	};

cdn.prototype.disableContainer = function(options, callback) {
		if(!this.core.processArgs({
			required : ['container'],
			default : 'container'
		}, arguments)) { return callback({error:"Bad Arguments"}); }

		return this.request({
			method : "PUT",
			url: options.container,
			headers: {
				'X-CDN-Enabled' : 'False',
				'X-TTL' : options.ttl || '900'
			},
			mergeHeaders : true
		}, callback);
	};

cdn.prototype.purgeObject = function(options, callback) {
	if(!this.core.processArgs({
		required : ['object','container']
	}, arguments)) { return callback({error:"Bad Arguments"}); }

	return this.request({
		method: "DELETE",
		url: options.container+'/'+options.object,
		mergeHeaders : true
	},callback);
};

//////////////////////////////////
// Return the module definition //
//////////////////////////////////
module.exports = cdn;


text:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Warcraft.Map;
using Warcraft.Util;

namespace Warcraft.Managers
{
    class ManagerIsland
    {
        List<ManagerMap> managerMap = new List<ManagerMap>();
        public static List<Room> rooms = new List<Room>();

        public ManagerIsland(ManagerMouse managerMouse)
        {
            GenerateRooms generateRooms = new GenerateRooms();
            rooms = generateRooms.Rooms;

            for (int i = 0; i < rooms.Count; i++)
            {
                managerMap.Add(new ManagerMap(rooms[i]));
            }

            Functions.managerMap = CurrentMap();

            int[] min = new int[2] { 3, rooms[0].rectangle.Width / 3 };
            int[] max = new int[2] { rooms[0].rectangle.Height / 2 + rooms[0].rectangle.Height / 3, rooms[0].rectangle.Height };

            for (int i = 0; i < managerMap.Count; i++)
            {
                Warcraft.MAP_SIZE = rooms[i].rectangle.Width / Warcraft.TILE_SIZE;

                Vector2[] pos = { Vector2.Zero, Vector2.Zero };

                for (int j = 0; j < managerMap[i].FULL_MAP.Count; j++)
                {
                    for (int k = 0; k < managerMap[i].FULL_MAP[j].Count; k++)
                    {
                        if (managerMap[i].FULL_MAP[j][k].tileType != TileType.WATER && !managerMap[i].FULL_MAP[j][k].isWall && !managerMap[i].FULL_MAP[j][k].isWater)
                        {
                            if (pos[0] == Vector2.Zero)
                            {
                                pos[0] = managerMap[i].FULL_MAP[j][k].position;
                            }
                            else
                            {
                                pos[1] = managerMap[i].FULL_MAP[j][k].position;
                            }
                        }
                    }
                }

                for (int j = 0; j < 2; j++)
                {
                    Vector2 place = Functions.CleanHalfPosition(managerMap[i], pos[j]);
                    place = place + new Vector2(rooms[i].rectangle.X, rooms[i].rectangle.Y);

					ManagerBuildings.goldMines.Add(new Buildings.Neutral.GoldMine((int)(place.X / Warcraft.TILE_SIZE), (int)(place.Y / Warcraft.TILE_SIZE), managerMouse, managerMap[i], null));
				}
			}
		}

        public void LoadContent(ContentManager content)
        {
            managerMap.ForEach(mp => mp.LoadContent(content));
        }

        public ManagerMap CurrentMap()
        {
            return managerMap[Warcraft.PLAYER_ISLAND];
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            CurrentMap().Draw(spriteBatch);
        }
    }
}


text:
<!DOCTYPE html>
<title>CSS Backdrop Filters Animation: Contrast</title>
<link rel="author" href="mailto:masonf@chromium.org">
<link rel="help" href="https://drafts.fxtf.org/filter-effects-2/#BackdropFilterProperty">
<link rel="match" href="backdrop-filters-contrast-ref.html">

You should see a gray rectangle with a green box. Neither black nor white.


text:
package org.omnaest.i18nbinder.grouping;

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

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Set;

import junit.framework.Assert;

import org.junit.Before;
import org.junit.Test;

public class FileGrouperTest
{

  @Before
  public void setUp() throws Exception
  {
  }

  @Test
  public void testDetermineFileGroupIdentifierToFileGroupMap()
  {
    //
    List<File> fileList = new ArrayList<File>();
    fileList.add( new File( "C:\\temp\\admin_de_DE.properties" ) );
    fileList.add( new File( "C:\\temp\\admin_en_US.properties" ) );
    fileList.add( new File( "C:\\temp\\article_de_DE.properties" ) );
    fileList.add( new File( "C:\\temp\\article_en_US.properties" ) );
    fileList.add( new File( "C:\\temp\\article_de.properties" ) );
    fileList.add( new File( "C:\\temp\\article_en.properties" ) );

    //
    FileGrouper fileGrouper = new FileGrouper();
    try
    {
      fileGrouper.addAllFiles( fileList );
      fileGrouper.setGroupingPatternReplacementToken( "{locale}" );
      fileGrouper.setGroupingPatternString( "(.*?_(\\w{2,3}_\\w{2,3}|\\w{2,3})|.*())\\.\\w*" );
      fileGrouper.setGroupingPatternGroupingGroupIndexList( Arrays.asList( 2, 3 ) );
    }
    catch ( Exception e )
    {
      e.printStackTrace();
      Assert.fail();
    }

    //
    Map<String, FileGroup> fileGroupIdentifierToFileGroupMap = fileGrouper.determineFileGroupIdentifierToFileGroupMap();

    //
    assertEquals( 2, fileGroupIdentifierToFileGroupMap.size() );
    Set<String> fileGroupIdentifierSet = fileGroupIdentifierToFileGroupMap.keySet();
    assertTrue( fileGroupIdentifierSet.contains( "C:\\temp\\admin_{locale}.properties" ) );
    assertTrue( fileGroupIdentifierSet.contains( "C:\\temp\\article_{locale}.properties" ) );

    //
    {
      //
      FileGroup fileGroup = fileGroupIdentifierToFileGroupMap.get( "C:\\temp\\admin_{locale}.properties" );

      //
      Map<String, File> groupTokenToFileMap = fileGroup.getGroupTokenToFileMap();
      assertEquals( 2, groupTokenToFileMap.size() );
      assertTrue( groupTokenToFileMap.containsKey( "de_DE" ) );
      assertTrue( groupTokenToFileMap.containsKey( "en_US" ) );
    }
    {
      //
      FileGroup fileGroup = fileGroupIdentifierToFileGroupMap.get( "C:\\temp\\article_{locale}.properties" );

      //
      Map<String, File> groupTokenToFileMap = fileGroup.getGroupTokenToFileMap();
      assertEquals( 4, groupTokenToFileMap.size() );
      assertTrue( groupTokenToFileMap.containsKey( "de_DE" ) );
      assertTrue( groupTokenToFileMap.containsKey( "en_US" ) );
      assertTrue( groupTokenToFileMap.containsKey( "de" ) );
      assertTrue( groupTokenToFileMap.containsKey( "en" ) );
    }
  }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <declare-styleable name="PagerSlidingTabStrip">
        <attr name="pstsIndicatorColor" format="color" />
        <attr name="pstsUnderlineColor" format="color" />
        <attr name="pstsDividerColor" format="color" />
        <attr name="pstsDividerWidth" format="dimension" />
        <attr name="pstsIndicatorHeight" format="dimension" />
        <attr name="pstsUnderlineHeight" format="dimension" />
        <attr name="pstsDividerPadding" format="dimension" />
        <attr name="pstsTabPaddingLeftRight" format="dimension" />
        <attr name="pstsScrollOffset" format="dimension" />
        <attr name="pstsTabBackground" format="reference" />
        <attr name="pstsShouldExpand" format="boolean" />
        <attr name="pstsTextAllCaps" format="boolean" />
        <attr name="pstsPaddingMiddle" format="boolean" />
        <attr name="pstsTextStyle">
            <flag name="normal" value="0x0" />
            <flag name="bold" value="0x1" />
            <flag name="italic" value="0x2" />
        </attr>
        <attr name="pstsTextSelectedStyle">
            <flag name="normal" value="0x0" />
            <flag name="bold" value="0x1" />
            <flag name="italic" value="0x2" />
        </attr>
        <attr name="pstsTextAlpha" format="float" />
        <attr name="pstsTextSelectedAlpha" format="float" />
    </declare-styleable>

</resources>


text:
<?xml version="1.0"?>
<properties>
	<Edit>true</Edit>
	<Files>true</Files>
	<LastModified>20090111073938</LastModified>
	<Properties>true</Properties>
	<RecentChanges>true</RecentChanges>
	<Refactor>true</Refactor>
	<Search>true</Search>
	<Versions>true</Versions>
	<WhereUsed>true</WhereUsed>
	<saveId>1231681178844</saveId>
	<ticketId>5795227355115484696</ticketId>
</properties>


text:
<!--
  ~ Copyright 2015-present Open Networking Foundation
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<scenario name="smoke" description="ONOS smoke test">
    <import file="${ONOS_SCENARIOS}/prerequisites.xml"/>
    <import file="${ONOS_SCENARIOS}/net-prerequisites.xml"/>
    <import file="${ONOS_SCENARIOS}/setup.xml"/>
    <import file="${ONOS_SCENARIOS}/dist-test.xml"/>
    <import file="${ONOS_SCENARIOS}/smoke-internal.xml"/>
    <import file="${ONOS_SCENARIOS}/app-reactivate.xml"/>
    <import file="${ONOS_SCENARIOS}/yang-smoke.xml"/>
    <import file="${ONOS_SCENARIOS}/yang-live-compile.xml"/>

    <dependency name="Setup" requires="Prerequisites,Net-Prerequisites"/>
    <dependency name="Net-Smoke" requires="Setup"/>
    <dependency name="Drivers-Test" requires="Setup"/>
    <dependency name="Meta-App" requires="Setup"/>
    <dependency name="Netcfg" requires="Setup"/>
    <dependency name="Distributed-Primitives" requires="Setup"/>
    <dependency name="App-Reactivation" requires="Setup,~Distributed-Primitives"/>
    <dependency name="YANG-Smoke" requires="Setup,~Distributed-Primitives"/>
    <dependency name="YANG-Live-Compile" requires="Setup,~YANG-Smoke"/>

    <import file="${ONOS_SCENARIOS}/wrapup.xml"/>
    <dependency name="Wrapup" requires="~Setup,~Net-Smoke,~App-Reactivation,~Drivers-Test,~Meta-App,~Netcfg,~YANG-Smoke,~YANG-Live-Compile"/>
</scenario>


text:
Parikh sets of strings

Parikh vector of a string:
https://en.wikipedia.org/wiki/Parikh%27s_theorem

Parikh set of length k (denoted by Pi_k) of a string is a set that contains the Parikh vectors for all k-sized
substrings of the string.

>Consider the following example:
given s = aaba, then pi_1 = {(1, 0), (0, 1)}, pi_2 = {(2, 0), (1, 1)}, pi_3 = {(2, 1)}, pi_4 = {(3, 1)}.


text:
yORM
=====

Basics
-------
yORM is an ORM built specifically for Titanium Appcelerator.

Usage
------
The entry point is BaseEntity. Write a javascript class that extends BaseEntity using prototypes.
This class serves as your Entity class (or a table in database).

###Sample Code

**Include the single entity.js file**

```javascript
Ti.include('yORM/entity.js');
```

**Declare a function like this**

```javascript
function UserEntity() {
 	//add some of your own methods specific to User
};
```

**Then extend BaseEntity like this**

```javascript
var dbName = "Your Database Name";

var tableName = "Your Table Name (used in the database)";

var fields = {

	'field1': 'SQLLite_DataType',

	'field2: 'SQLLite_DataType',

	'field3: 'SQLLite_DataType'

};

UserEntity.prototype = new BaseEntity(dbName, tableName, fields);

var user = new UserEntity();
```

**The rest is easy**

```javascript
var user = new UserEntity();

user.field1 = 'field1_value';

user.field2 = 'field2_value';

user.field2 = 'field3_value';

user.save();

Ti.API.info(user.id);
```

**Entity Methods.**

> `save()` - _Insert into the table that this entity represents. Call this method after setting the values of the Entity. If you down't set any value, the default is null. The entity's id field is automatically updated with the id of inserted item._

> `removeAll()` - _Deletes from the table **WITHOUT** a where clause_

> `remove()` - _Deletes from the table where id is the id of this entity_

> `all()` - _Retrieves all records in the table_

> `find(id, clauses)` - _Find a single record by id. Optionally you can specify clauses. clauses can be `where`, `order`, `limit`, etc clauses supported by SQLLite. Method always return a valid Entity. If there are no records found for the id, the Entity fields will be null._

> `findBy(fieldsAndValuesObject)` - _Find a single record. The where clause is generated from the object fieldsAndValuesObject. The return value is the first record found. If there are no records found, a valid entity will still be returned but the fields will be null. fieldsAndValuesObject is a javascript object. For example to find where name is 'Don' and age is 19 we will write_
> `new User().findBy({'name':'Don', 'age':19})`

> `findAllBy(fieldsAndValuesObject)` - _Find all records. The where clause is as in findBy(fieldsAndValuesObject) method. The method returns a list. If there are no records found, an empty list is returned._


text:
package com.amazonaws.services.servicecatalog.model.transform;

import java.math.*;

import javax.annotation.Generated;

import com.amazonaws.services.servicecatalog.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;

import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;

/**
 * Principal JSON Unmarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class PrincipalJsonUnmarshaller implements Unmarshaller<Principal, JsonUnmarshallerContext> {

    public Principal unmarshall(JsonUnmarshallerContext context) throws Exception {
        Principal principal = new Principal();

        int originalDepth = context.getCurrentDepth();
        String currentParentElement = context.getCurrentParentElement();
        int targetDepth = originalDepth + 1;

        JsonToken token = context.getCurrentToken();
        if (token == null)
            token = context.nextToken();
        if (token == VALUE_NULL) {
            return null;
        }

        while (true) {
            if (token == null)
                break;

            if (token == FIELD_NAME || token == START_OBJECT) {
                if (context.testExpression("PrincipalARN", targetDepth)) {
                    context.nextToken();
                    principal.setPrincipalARN(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("PrincipalType", targetDepth)) {
                    context.nextToken();
                    principal.setPrincipalType(context.getUnmarshaller(String.class).unmarshall(context));
                }
            } else if (token == END_ARRAY || token == END_OBJECT) {
                if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
                    if (context.getCurrentDepth() <= originalDepth)
                        break;
                }
            }
            token = context.nextToken();
        }

        return principal;
    }

    private static PrincipalJsonUnmarshaller instance;

    public static PrincipalJsonUnmarshaller getInstance() {
        if (instance == null)
            instance = new PrincipalJsonUnmarshaller();
        return instance;
    }
}


text:
package org.gridkit.lab.gridant.jarsync.jarsync;

/**
 * a rebuilder event. Rebuilder events are emitted by a {@link RebuilderStream}
 * each time a new {@link Delta} is applied. The stream will send this event to
 * each of its {@link RebuilderListener}s.
 *
 * @see RebuilderStream
 * @see RebuilderListener
 */
class RebuilderEvent extends java.util.EventObject {

    private static final long serialVersionUID = 2737952549045585051L;

    /** The destination offset. */
    protected transient long offset;

    /**
     * Create a new rebuilder event.
     *
     * @param data
     *            The source of this event, the data block.
     * @param offset
     *            The destination offset.
     */
    public RebuilderEvent(byte[] data, long offset) {
        this(data, 0, data.length, offset);
    }

    public RebuilderEvent(byte[] data, int off, int len, long offset) {
        super(new byte[len]);
        System.arraycopy(data, off, source, 0, len);
        this.offset = offset;
    }

    /**
     * Get the data. This method is equivalent to
     * {@link java.util.EventObject#getSource()} but the source is already cast
     * for convenience.
     *
     * @return The data array.
     */
    public byte[] getData() {
        return (byte[]) source;
    }

    /**
     * Get the offset at which the data should be written.
     *
     * @return The offset.
     */
    public long getOffset() {
        return offset;
    }
}


text:
package org.eric.commonkit.kit.phone;

import android.content.ContentResolver;
import android.database.Cursor;
import android.net.Uri;
import android.provider.CallLog.Calls;
import android.provider.ContactsContract;

import org.eric.commonkit.CKApplication;

import java.util.ArrayList;
import java.util.List;

/**
 * 获取联系人信息等
 *
 * @author 12
 */
public class ContactKit {

    public static boolean isFindPhoneFromContact(String number) {

        for (String n : getAllContactPhone()) {
            if (n == number) {
                return true;
            }
        }
        return false;

    }

    public static List<String> getAllContactPhone() {

        List<String> numbers = new ArrayList<String>();
        ContentResolver resolver = CKApplication.context.getContentResolver();

        Uri id_uri = Uri.parse("content://com.android.contacts/raw_contacts");
        Uri data_uri = Uri.parse("content://com.android.contacts/data");

        Cursor cursor = resolver.query(id_uri, null, null, null, null);
        while (cursor.moveToNext()) {
            String id = cursor.getString(cursor.getColumnIndex("_id"));
            Cursor datacursor = resolver.query(data_uri, null,
                    "raw_contact_id=?", new String[]{id}, null);
            while (datacursor.moveToNext()) {
                // mimetype
                String type = datacursor.getString(datacursor
                        .getColumnIndex("mimetype"));
                if ("vnd.android.cursor.item/phone_v2".equals(type)) {
                    String number = datacursor.getString(datacursor
                            .getColumnIndex("data1"));
                    numbers.add(number);
                }
            }
            datacursor.close();
        }
        cursor.close();
        return numbers;
    }

    public static Cursor getAllSms() {

        ContentResolver resolver = CKApplication.context.getContentResolver();
        Uri uri = Uri.parse("content://sms/");
        Cursor cursor = resolver.query(uri, null, null, null, "date desc");
        return cursor;

    }

    /**
     * 根据电话号码取得联系人姓名
     */
    public static String getContactName(String number) {
        String[] projection = {ContactsContract.PhoneLookup.DISPLAY_NAME,
                ContactsContract.CommonDataKinds.Phone.NUMBER};

        // 将自己添加到 msPeers 中
        Cursor cursor = CKApplication.context.getContentResolver()
                //
                .query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
                        projection, // Which
                        ContactsContract.CommonDataKinds.Phone.NUMBER + "=?", // WHERE
                        new String[]{number}, //
                        null); // Sort order.

        String name = null;
        while (cursor.moveToNext()) {
            name = cursor.getString(cursor
                    .getColumnIndex(ContactsContract.PhoneLookup.DISPLAY_NAME));
        }

        return name;
    }

    public static long getTelTime() {

        Cursor cursor = CKApplication.context.getContentResolver().query(
                Calls.CONTENT_URI,
                new String[]{Calls.DURATION, Calls.TYPE, Calls.DATE}, null,
                null, Calls.DEFAULT_SORT_ORDER);
        boolean hasRecord = cursor.moveToFirst();
        long incoming = 0L;
        long outgoing = 0L;
        int count = 0;
        while (hasRecord) {
            int type = cursor.getInt(cursor.getColumnIndex(Calls.TYPE));
            long duration = cursor.getLong(cursor
                    .getColumnIndex(Calls.DURATION));
            switch (type) {
                case Calls.INCOMING_TYPE:
                    incoming += duration;
                    break;
                case Calls.OUTGOING_TYPE:
                    outgoing += duration;
                default:
                    break;
            }
            count++;
            hasRecord = cursor.moveToNext();
        }

        cursor.close();
        return incoming + outgoing;
    }

}


text:
angular.module('firebase.appauth', ['firebase'])
  // renamed as per
  // https://stackoverflow.com/questions/39244924/angularfire-and-firebase-upgrade-error-unknown-provider-firebaseauthprovider#39249547
  .factory('Auth', ['$firebaseAuth', function($firebaseAuth) {
    return $firebaseAuth();
  }]);


text:
case node['platform']
when 'windows'
  if node['platform_version'].to_f >= 6.0 || node['platform_version'].to_f <= 6.3
    registry_key 'hash_md5' do
      key 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Hashes\MD5'
      recursive true
      case node['windows_schannel']['hash_md5']
      when 'disable'
        values(name: 'Enabled', type: :dword, data: 0)
        :create
      when 'enable'
        values(name: 'Enabled', type: :dword, data: 4_294_967_295)
        :create
      end
    end
    registry_key 'hash_sha' do
      key 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Hashes\SHA'
      recursive true
      case node['windows_schannel']['hash_sha']
      when 'disable'
        values(name: 'Enabled', type: :dword, data: 0)
        :create
      when 'enable'
        values(name: 'Enabled', type: :dword, data: 4_294_967_295)
        :create
      end
    end
  end
end


text: require_relative 'active_data_tables/active_data_tables'


text:
package com.khaale.bigdatarampup.tagcloud.app;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Collection;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * Performs keywords extraction and saving.
 */
public class Worker {

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

    private final static int KEYWORD_INDEX = 1;
    private final static int URL_INDEX = 5;
    private final static String ERROR_MARK = "!ERROR";

    private final FileSystemFacade fsFacade;
    private final ContentExtractor contentExtractor;
    private final TagExtractor tagExtractor;

    public Worker(
            FileSystemFacade fsFacade,
            ContentExtractor contentExtractor,
            TagExtractor tagExtractor) {

        this.fsFacade = fsFacade;
        this.contentExtractor = contentExtractor;
        this.tagExtractor = tagExtractor;
    }

    public void fillKeywordValues(String inputFilePath) {

        fillKeywordValues(
                inputFilePath,
                inputFilePath + ".out",
                Optional.empty(),
                Optional.empty());
    }

    /**
     * Gets keywords by URL's in input file, saves them to output file.
     * Supports partial input file processing.
     * @param inputFilePath hdfs path to input file
     * @param outputFilePath hdfs path to output file
     * @param skipLines how much lines should be skipped in input file. 1 record (header) if not specified.
     * @param limitLines how much lines should be taken from input file. All records - 1(header) if not specified.
     */
    public void fillKeywordValues(String inputFilePath, String outputFilePath, Optional<Integer> skipLines, Optional<Integer> limitLines) {

        logger.info("Starting..");

        final String inputText = fsFacade.readFile(
                inputFilePath,
                skipLines.orElse(1),
                limitLines.orElse(fsFacade.getLinesCount(inputFilePath) - 1));

        if (inputText == null || inputText.isEmpty()) {
            logger.info("File is empty - exiting.");
            return;
        }

        final String[] allLines = inputText.split("\\r?\\n");
        logger.info("Read {} lines", allLines.length);

        final Collection<String> filledRows =
        Stream.of(allLines)
                .filter(line -> !line.isEmpty())
                .map(this::fillKeywords)
                .collect(Collectors.toList());

        final String result =
                String.join("\n", String.join(System.lineSeparator(), filledRows)) +
                System.lineSeparator();
        fsFacade.writeFile(outputFilePath, result);

        logger.info("Finished.");
    }

    private String fillKeywords(String row) {

        final String[] fields = row.split("\\t");
        final String url = fields[URL_INDEX];

        logger.info("Processing {}", url);

        final Optional<String> text = contentExtractor.getContent(url);

        if (text.isPresent()) {
            final Collection<String> tags = tagExtractor.getTags(text.get());
            fields[KEYWORD_INDEX] = String.join(",", tags);
        }
        else {
            fields[KEYWORD_INDEX] = ERROR_MARK;
        }
        logger.info("Extracted tags: {}", fields[KEYWORD_INDEX]);

        return String.join("\t", (CharSequence[]) fields);
    }

}


text:
require "formula"

class AescryptPacketizer < Formula
  homepage "https://www.aescrypt.com"
  url "https://www.aescrypt.com/download/v3/linux/aescrypt-3.0.9.tgz"
  sha256 "3f3590f9b7e50039611ba9c0cf1cae1b188a44bd39cfc41553db7ec5709c0882"

  bottle do
    cellar :any
    sha1 "9332b85915d37899948db1d69c2703baba61e50e" => :yosemite
    sha1 "a0bff6bff8e0476badc312dabdb6a936f8ed6507" => :mavericks
    sha1 "2b9d8e775d1abf5bdf5ad0ba9a948deb498bdcf2" => :mountain_lion
  end

  head do
    url "https://github.com/paulej/AESCrypt.git"

    depends_on "automake" => :build
    depends_on "autoconf" => :build
    depends_on "libtool" => :build
  end

  depends_on :xcode => :build

  option "with-default-names", "Build with the binaries named as expected upstream"

  def install
    if build.head?
      cd "linux"
      system "autoreconf", "-ivf"
      system "./configure", "prefix=#{prefix}", "--enable-iconv",
              "--disable-gui"
      system "make", "install"
    end

    if build.stable?
      cd "src"
      # https://www.aescrypt.com/mac_aes_crypt.html
      inreplace "Makefile", "#LIBS=-liconv", "LIBS=-liconv"
      system "make", "prefix=#{prefix}"

      bin.install "aescrypt"
      bin.install "aescrypt_keygen"
    end

    # To prevent conflict with our other aescrypt, rename the binaries.
    if build.without? "default-names"
      mv "#{bin}/aescrypt", "#{bin}/paescrypt"
      mv "#{bin}/aescrypt_keygen", "#{bin}/paescrypt_keygen"
    end
  end

  def caveats; <<-EOS.undent
    To avoid conflicting with our other AESCrypt package the binaries
    have been renamed paescrypt and paescrypt_keygen, unless you chose
    to exercise the default-names option.
    EOS
  end

  test do
    path = testpath/"secret.txt"
    original_contents = "What grows when it eats, but dies when it drinks?"
    path.write original_contents

    system bin/"paescrypt", "-e", "-p", "fire", path
    assert File.exist?("#{path}.aes")

    system bin/"paescrypt", "-d", "-p", "fire", "#{path}.aes"
    assert_equal original_contents, path.read
  end
end


text:
class AddAssignedDateToTask < ActiveRecord::Migration
  def change
    add_column :tasks, :assigned_date, :date
  end
end


text:
The following built-in collections are available at the root of the context:

| **Collection** | **Collection item** | **Description**                |
| -------------- | ------------------- | ------------------------------ |
| `tags`         | `tag`               | Used to specify tags associated with the current page. Multiple tags may be associated with each page. Useful for adding semantic **tags** or tag clouds to your content. |
| `categories`   | `category`          | Used to specify categories associated with the current page. Multiple categories may be associated with each page. Similar to tags but more appropriate for categorizing pages by "broader" concepts. |
| `pages`        | `page`              | See **Pages collection differences** below |

### Pages collection differences

"[Pages][]" and "page" differ from other collections and collection items in the following ways:

* _Any files specified in the `src` of a given target_ will be the collection items associated with the "pages" object for that target.
* Although a "page" is a collection item, there is currently no concept of "pages with related pages". In other words _there is no object which contains a collection of pages associated with a given page_. So

### Collection items

You may then add items to collections in the YAML front matter of any files that should include those collections:

```yaml
---
title: My Blog
archives:
  - 2013
  - May
  - 12
---
```

### List of associate pages

Additionally, any collection item from the `collections` object can list the [pages][pages] associated with that collection. For example, each "tag" would list the [pages][pages] associated with that tag.

```javascript
{
  tag: 'news',
  pages: ['one.html', 'two.html', 'three.html']
}
```

## Custom collections

### options.collections

type: `Array`
default: `null`

Custom `collections` may be defined using the `collections` option:

```javascript
assemble: {
  options: {
    collections: ['archives', 'posts']
  }
}
```

And then in the YAML front matter of a page:

```yaml
---
archives:
  - 2013
  - May
  - 12
---
```

There are no restrictions on the number of collections creatd, you may specify as many custom collections as you require.

### Automatic inflection
Currently, for the sake of ease of use, the collection method uses the [inflection](https://github.com/dreamerslab/node.inflection) library to convert a collection's item key into the correct syntax:

* `tags` converts to: `{ tag: 'ficus', pages: [] }`
* `categories` converts to: `{ category: 'trees', pages: [] }`

If words you wish to use are either missing or don't work properly, please let us know by [creating an Issue](https://github.com/assemble/assemble/issues/) on Assemble's GitHub repository.

## Usage examples

Declaring tags and categories for a page within the page's [YAML front matter][yaml-front-matter]

``` yaml
---
tags:
- feature
- priority
categories:
- open
---
```

**List all tags**

``` html
<ul>
  \{{#tags}}
  <li><a href="/tag/\{{tag}}.html">\{{tag}}</a></li>
  \{{/tags}}
</ul>
```

**List all categories**

``` html
<ul>
  \{{#categories}}
  <li><a href="/category/\{{category}}.html">\{{category}}</a></li>
  \{{/categories}}
</ul>
```

**List tags on current page**

``` html
<ul>
  \{{#page.tags}}
  <li>\{{.}}</li>
  \{{/page.tags}}
</ul>
```

**List categories on current page**

``` html
<ul>
  \{{#page.categories}}
  <li>\{{.}}</li>
  \{{/page.categories}}
</ul>
```


text:
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%
% Copyright (C) 2006 Open Microscopy Environment
%       Massachusetts Institue of Technology,
%       National Institutes of Health,
%       University of Dundee
%
%
%
%    This library is free software; you can redistribute it and/or
%    modify it under the terms of the GNU Lesser General Public
%    License as published by the Free Software Foundation; either
%    version 2.1 of the License, or (at your option) any later version.
%
%    This library is distributed in the hope that it will be useful,
%    but WITHOUT ANY WARRANTY; without even the implied warranty of
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
%    Lesser General Public License for more details.
%
%    You should have received a copy of the GNU Lesser General Public
%    License along with this library; if not, write to the Free Software
%    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
%
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% Written by:  Tom Macura <tmacura@nih.gov>
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

% int2uint8_dynamic_range takes in any numeric image (single, double, int16 etc)
% and converts it into a uint8 in the range [0 255]. It scales the input
% images's whole dynamic range (from min to max)
function [Im] = im2uint8_dynamic_range(Im)

% convert im to uint8 by normalizing the dynamic range
min_Im = min(Im(:));
max_Im = max(Im(:));
Im = uint8 ((Im-min_Im) / (max_Im-min_Im) * 255);


text:
require File.dirname(__FILE__) + '/test_helper'

class BufferTest < Test::Unit::TestCase
  def setup
    @buffer = FastSafeBuffer.new
  end

  def test_initialize
    buffer = FastSafeBuffer.new("hi")
    assert_equal "hi", buffer.to_str

    @buffer << "muffin"
    buffer = FastSafeBuffer.new(@buffer)
    assert_equal @buffer.to_str, buffer.to_str
  end

  def test_size
    @buffer.concat "me"
    @buffer.concat "&you"

    assert_equal "me&you".size, @buffer.size
    assert_equal "me&you".size, @buffer.length
  end

  def test_empty
    assert @buffer.empty?
    @buffer.concat "yo"
    assert ! @buffer.empty?
  end

  def test_concat
    @buffer << "hi"
    @buffer << " here"
    @buffer << " & there"

    assert_equal "hi here & there", @buffer.to_str
  end

  def test_concat_buffer
    @buffer << FastSafeBuffer.new("hi")

    assert_equal "hi", @buffer.to_str
  end

  def test_safe_concat
    @buffer.safe_concat "me"
    @buffer.safe_concat " & you"

    assert_equal "me & you", @buffer.to_str
  end

  def test_concat_unsafe
    @buffer.safe_concat "unsafe".capitalize

    assert_equal "Unsafe", @buffer.to_str
  end

  def test_clone
    @buffer.concat "yo"

    buffer2 = @buffer.clone
    @buffer.concat "oops"

    assert buffer2.html_safe?
    assert_equal "yo", buffer2.to_str
  end

  def test_force_encoding
    @buffer.force_encoding("utf-8")

    assert_raise(EncodingError) { @buffer.force_encoding("ascii") }
  end
end


text:
import requests

frames = []
data = b""
found_first = False
response = requests.get("http://navigation.local:8080/stream/video.h264", stream=True)

for chunk in response.iter_content(chunk_size=1024):
    if chunk:
        starting_offset = len(data)

        if starting_offset >= 2:
            if data[-1] == b"\x00":
                print("last byte is zero, backing up one")
                starting_offset -= 1
            if data[-2] == b"\x00":
                print("second to last byte is zero, backing up one more")
                starting_offset -= 1

        data = data + chunk
        offset = data.find(b"\x00\x00\x01", starting_offset)

        if offset != -1:
            print("found frame")
            remaining = data[offset:]

            if not found_first:
                print("dropping partial first frame")
                found_first = True
            else:
                print("adding frame", len(frames) + 1)
                frames.append(data[:offset])

                if len(frames) == 120:
                    break

            data = remaining

with open("navigation.h264", "wb") as out:
    out.write(b"\x00")
    for frame in frames:
        out.write(frame)


text:
package al.tonikolaba.entity.enemies;

import al.tonikolaba.entity.Player;
import al.tonikolaba.handlers.Content;
import al.tonikolaba.main.GamePanel;
import al.tonikolaba.tilemap.TileMap;

import java.awt.*;
import java.awt.image.BufferedImage;

/**
 * @author ArtOfSoul
 */

public class XhelBat extends Flyer {

    private BufferedImage[] sprites;
    private Player player;
    private boolean active;

    public XhelBat(TileMap tm, Player p) {

        super(tm, FlyerType.XHEL_BAT);
        player = p;

        sprites = Content.getXhelbat()[0];

        animation.setFrames(sprites);
        animation.setDelay(4);

        left = true;
        facingRight = false;

    }

    @Override
    public void update() {

        if (!active) {
            if (Math.abs(player.getx() - x) < GamePanel.WIDTH)
                active = true;
            return;
        }

        // check if done flinching
        if (flinching) {
            flinchCount++;
            if (flinchCount == 6)
                flinching = false;
        }

        getNextPosition();
        checkTileMapCollision();
        calculateCorners(x, ydest + 1);
        if (!bottomLeft) {
            left = false;
            right = facingRight = true;
        }
        if (!bottomRight) {
            left = true;
            right = facingRight = false;
        }
        setPosition(xtemp, ytemp);

        if (dx == 0) {
            left = !left;
            right = !right;
            facingRight = !facingRight;
        }

        // update animation
        animation.update();

    }

    @Override
    public void draw(Graphics2D g) {

        if (flinching && (flinchCount == 0 || flinchCount == 2)) {
            return;
        }

        super.draw(g);

    }

}


text:
export default state => state.features.auth.loginInfo ||
  {
    required: true,
    username: 'username',
    password: 'password',
  };


text:
.prettyprint.theme-balupton {
    font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;
    font-size: 14px;
    font-style: normal;
    font-weight: normal;
    line-height: 15px
}

.prettyprint.theme-balupton .com {
    color: #008200
}

.prettyprint.theme-balupton .lit {
    color: #066
}

.prettyprint.theme-balupton.lang-html .lit {
    color: #066
}

.prettyprint.theme-balupton.lang-html .kwd {
    color: #066;
    font-weight: bold
}

.prettyprint.theme-balupton.lang-html .atv+.pln, .prettyprint.theme-balupton.lang-html .pun+.pln {
    color: blue
}

.prettyprint.theme-balupton .atv, .prettyprint.theme-balupton .str {
    color: blue
}

.prettyprint.theme-balupton .atn {
    color: gray
}

.prettyprint.theme-balupton .pln {
    color: black
}

.prettyprint.theme-balupton .pun {
    color: #666
}

.prettyprint.theme-balupton .typ {
    color: #606
}

.prettyprint.theme-balupton .tag, .prettyprint.theme-balupton .kwd {
    color: #069;
    font-weight: bold
}


text:
#include "xlsxcell.h"
#include "xlsxcell_p.h"
#include "xlsxformat.h"
#include "xlsxformat_p.h"
#include "xlsxutility_p.h"
#include "xlsxworksheet.h"
#include "xlsxworkbook.h"
#include <QDateTime>

QT_BEGIN_NAMESPACE_XLSX

CellPrivate::CellPrivate(Cell *p) :
    q_ptr(p)
{

}

CellPrivate::CellPrivate(const CellPrivate * const cp)
    : value(cp->value), formula(cp->formula), cellType(cp->cellType)
    , format(cp->format), richString(cp->richString), parent(cp->parent)
{

}

/*!
  \class Cell
  \inmodule QtXlsx
  \brief The Cell class provides a API that is used to handle the worksheet cell.

*/

/*!
  \enum Cell::CellType
  \value BooleanType      Boolean type
  \value NumberType       Number type, can be blank or used with forumula
  \value ErrorType        Error type
  \value SharedStringType Shared string type
  \value StringType       String type, can be used with forumula
  \value InlineStringType Inline string type
  */

/*!
 * \internal
 * Created by Worksheet only.
 */
Cell::Cell(const QVariant &data, CellType type, const Format &format, Worksheet *parent) :
    d_ptr(new CellPrivate(this))
{
    d_ptr->value = data;
    d_ptr->cellType = type;
    d_ptr->format = format;
    d_ptr->parent = parent;
}

/*!
 * \internal
 */
Cell::Cell(const Cell * const cell):
    d_ptr(new CellPrivate(cell->d_ptr))
{
    d_ptr->q_ptr = this;
}

/*!
 * Destroys the Cell and cleans up.
 */
Cell::~Cell()
{
    delete d_ptr;
}

/*!
 * Return the dataType of this Cell
 */
Cell::CellType Cell::cellType() const
{
    Q_D(const Cell);
    return d->cellType;
}

/*!
 * Return the data content of this Cell
 */
QVariant Cell::value() const
{
    Q_D(const Cell);
    return d->value;
}

/*!
 * Return the style used by this Cell. If no style used, 0 will be returned.
 */
Format Cell::format() const
{
    Q_D(const Cell);
    return d->format;
}

/*!
 * Returns true if the cell has one formula.
 */
bool Cell::hasFormula() const
{
    Q_D(const Cell);
    return d->formula.isValid();
}

/*!
 * Return the formula contents if the dataType is Formula
 */
CellFormula Cell::formula() const
{
    Q_D(const Cell);
    return d->formula;
}

/*!
 * Returns whether the value is probably a dateTime or not
 */
bool Cell::isDateTime() const
{
    Q_D(const Cell);
    if (d->cellType == NumberType && d->value.toDouble() >=0
            && d->format.isValid() && d->format.isDateTimeFormat()) {
        return true;
    }
    return false;
}

/*!
 * Return the data time value.
 */
QDateTime Cell::dateTime() const
{
    Q_D(const Cell);
    if (!isDateTime())
        return QDateTime();
    return datetimeFromNumber(d->value.toDouble(), d->parent->workbook()->isDate1904());
}

/*!
 * Returns whether the cell is probably a rich string or not
 */
bool Cell::isRichString() const
{
    Q_D(const Cell);
    if (d->cellType != SharedStringType && d->cellType != InlineStringType
            && d->cellType != StringType)
        return false;

    return d->richString.isRichString();
}

QT_END_NAMESPACE_XLSX