text:
import viewCommon = require("./view-common");
import viewDefinition = require("ui/core/view");
import trace = require("trace");
import utils = require("utils/utils");
import dependencyObservable = require("ui/core/dependency-observable");
import proxy = require("ui/core/proxy");
import gestures = require("ui/gestures");
import types = require("utils/types");

global.moduleMerge(viewCommon, exports);

var ANDROID = "_android";
var NATIVE_VIEW = "_nativeView";
var VIEW_GROUP = "_viewGroup";
var OWNER = "_owner";

function onIdPropertyChanged(data: dependencyObservable.PropertyChangeData) {
    var view = <View>data.object;
    view._nativeView.setTag(data.newValue);
}
(<proxy.PropertyMetadata>viewCommon.View.idProperty.metadata).onSetNativeValue = onIdPropertyChanged;

function onTranslateXPropertyChanged(data: dependencyObservable.PropertyChangeData) {
    var view = <View>data.object;
    view._nativeView.setTranslationX(data.newValue * utils.layout.getDisplayDensity());
}
(<proxy.PropertyMetadata>viewCommon.View.translateXProperty.metadata).onSetNativeValue = onTranslateXPropertyChanged;

function onTranslateYPropertyChanged(data: dependencyObservable.PropertyChangeData) {
    var view = <View>data.object;
    view._nativeView.setTranslationY(data.newValue * utils.layout.getDisplayDensity());
}
(<proxy.PropertyMetadata>viewCommon.View.translateYProperty.metadata).onSetNativeValue = onTranslateYPropertyChanged;

function onScaleXPropertyChanged(data: dependencyObservable.PropertyChangeData) {
    var view = <View>data.object;
    view._nativeView.setScaleX(data.newValue);
}
(<proxy.PropertyMetadata>viewCommon.View.scaleXProperty.metadata).onSetNativeValue = onScaleXPropertyChanged;

function onScaleYPropertyChanged(data: dependencyObservable.PropertyChangeData) {
    var view = <View>data.object;
    view._nativeView.setScaleY(data.newValue);
}
(<proxy.PropertyMetadata>viewCommon.View.scaleYProperty.metadata).onSetNativeValue = onScaleYPropertyChanged;

function onRotatePropertyChanged(data: dependencyObservable.PropertyChangeData) {
    var view = <View>data.object;
    view._nativeView.setRotation(data.newValue);
}
(<proxy.PropertyMetadata>viewCommon.View.rotateProperty.metadata).onSetNativeValue = onRotatePropertyChanged;

function onIsEnabledPropertyChanged(data: dependencyObservable.PropertyChangeData) {
    var view = <View>data.object;
    view._nativeView.setEnabled(data.newValue);
}
(<proxy.PropertyMetadata>viewCommon.View.isEnabledProperty.metadata).onSetNativeValue = onIsEnabledPropertyChanged;

function onIsUserInteractionEnabledPropertyChanged(data: dependencyObservable.PropertyChangeData) {
    var view = <View>data.object;
    view._updateOnTouchListener(data.newValue);
}
(<proxy.PropertyMetadata>viewCommon.View.isUserInteractionEnabledProperty.metadata).onSetNativeValue = onIsUserInteractionEnabledPropertyChanged;

export var NativeViewGroup = (<any>android.view.ViewGroup).extend({
    onMeasure: function (widthMeasureSpec, heightMeasureSpec) {
        var owner: viewDefinition.View = this[OWNER];
        owner.onMeasure(widthMeasureSpec, heightMeasureSpec);
        this.setMeasuredDimension(owner.getMeasuredWidth(), owner.getMeasuredHeight());
    },
    onLayout: function (changed: boolean, left: number, top: number, right: number, bottom: number): void {
        var owner: viewDefinition.View = this[OWNER];
        owner.onLayout(left, top, right, bottom);
    }
});

export class View extends viewCommon.View {
    private _disableUserInteractionListener: android.view.View.OnTouchListener = new android.view.View.OnTouchListener({
        onTouch: function (view: android.view.View, event: android.view.MotionEvent) {
            return true;
        }
    });

    public _updateOnTouchListener(isUserInteractionEnabled: boolean) {
        // User interaction is disabled -- we stop it and we do not care whether someone wants to listen for gestures.
        if (!isUserInteractionEnabled) {
            this._nativeView.setOnTouchListener(this._disableUserInteractionListener);
            return;
        }

        // User interaction is enabled and someone wants to listen for gestures.
        if (this._gesturesListener) {
            this._nativeView.setOnTouchListener(this._gesturesListener);
            return;
        }

        // User interaction is enabled and no one wants to listen for gestures.
        this._nativeView.setOnTouchListener(null);
    }

    private _gesturesListener: android.view.View.OnTouchListener;
    set gesturesListener(value: android.view.View.OnTouchListener) {
        this._gesturesListener = value;
        this._updateOnTouchListener(this.isUserInteractionEnabled);
    }

    observe(type: gestures.GestureTypes, callback: (args: gestures.GestureEventData) => void, thisArg?: any): void {
        super.observe(type, callback, thisArg);
        if (this.isLoaded && !this.touchListenerIsSet) {
            this.setOnTouchListener();
        }
    }

    private touchListenerIsSet: boolean;

    public onLoaded() {
        super.onLoaded();
        this.setOnTouchListener();
    }

    public onUnloaded() {
        super.onUnloaded();
        if (this._nativeView && this._nativeView.setOnTouchListener) {
            this._nativeView.setOnTouchListener(null);
            this.touchListenerIsSet = false;
        }
    }

    private hasGestureObservers() {
        return this._gestureObservers && Object.keys(this._gestureObservers).length > 0
    }

    private setOnTouchListener() {
        if (this._nativeView && this._nativeView.setOnTouchListener && this.hasGestureObservers()) {
            this.touchListenerIsSet = true;
            var that = new WeakRef(this);
            if (this._nativeView.setClickable) {
                this._nativeView.setClickable(true);
            }
            this._nativeView.setOnTouchListener(new android.view.View.OnTouchListener({
                onTouch: function (view: android.view.View, motionEvent: android.view.MotionEvent) {
                    var owner = that.get();
                    if (!owner) {
                        return false;
                    }

                    for (let type in owner._gestureObservers) {
                        let list = owner._gestureObservers[type];
                        for (let i = 0; i < list.length; i++) {
                            list[i].androidOnTouchEvent(motionEvent);
                        }
                    }

                    return owner._nativeView.onTouchEvent(motionEvent);
                }
            }));
        }
    }

    public _addViewCore(view: viewCommon.View) {
        if (this._context) {
            view._onAttached(this._context);
        }

        super._addViewCore(view);
    }

    public _removeViewCore(view: viewCommon.View) {
        super._removeViewCore(view);
        // TODO: Detach from the context?
        view._onDetached();
    }

    public _onAttached(context: android.content.Context) {
        if (!context) {
            throw new Error("Expected valid android.content.Context instance.");
        }

        trace.write("calling _onAttached on view " + this._domId, trace.categories.VisualTreeEvents);

        if (this._context === context) {
            return;
        }

        if (this._context) {
            this._onDetached();
        }

        this._context = context;
        this._onContextChanged();

        trace.notifyEvent(this, "_onAttached");

        if (this._childrenCount > 0) {
            // Notify each child for the _onAttached event
            var that = this;
            var eachChild = function (child: View): boolean {
                child._onAttached(context);
                if (!child._isAddedToNativeVisualTree) {
                    // since we have lazy loading of the android widgets, we need to add the native instances at this point.
                    child._isAddedToNativeVisualTree = that._addViewToNativeVisualTree(child);
                }
                return true;
            }
            this._eachChildView(eachChild);
        }
    }

    public _onDetached(force?: boolean) {
        if (this._childrenCount > 0) {
            // Detach children first
            var that = this;
            var eachChild = function (child: View): boolean {
                if (child._isAddedToNativeVisualTree) {
                    that._removeViewFromNativeVisualTree(child);
                }
                child._onDetached(force);
                return true;
            }
            this._eachChildView(eachChild);
        }

        trace.write("calling _onDetached on view " + this._domId, trace.categories.VisualTreeEvents);

        this._clearAndroidReference();

        this._context = undefined;

        trace.notifyEvent(this, "_onDetached");
    }

    // TODO: revise this method
    public _clearAndroidReference() {

        // Widgets like buttons and such have reference to their native view in both properties.
        if (this[NATIVE_VIEW] === this[ANDROID]) {
            this[NATIVE_VIEW] = undefined;
        }

        // Handle layout and content view
        if (this[VIEW_GROUP] === this[ANDROID]) {
            this[VIEW_GROUP] = undefined;
        }

        this[ANDROID] = undefined;
    }

    public _onContextChanged() {
        trace.write("calling _onContextChanged on view " + this._domId, trace.categories.VisualTreeEvents);

        this._createUI();

        utils.copyFrom(this._options, this);
        delete this._options;

        // copy all the locally cached values to the native android widget
        this._syncNativeProperties();
        trace.notifyEvent(this, "_onContextChanged");
    }

    get _nativeView(): android.view.View {
        return this.android;
    }

    get isLayoutValid(): boolean {
        if (this._nativeView) {
            return !this._nativeView.isLayoutRequested();
        }

        return false;
    }

    public layoutNativeView(left: number, top: number, right: number, bottom: number): void {
        if (this._nativeView) {
            this._nativeView.layout(left, top, right, bottom);
        }
    }

    public requestLayout(): void {
        super.requestLayout();
        if (this._nativeView) {
            return this._nativeView.requestLayout();
        }
    }

    public measure(widthMeasureSpec: number, heightMeasureSpec: number): void {
        super.measure(widthMeasureSpec, heightMeasureSpec);
        this.onMeasure(widthMeasureSpec, heightMeasureSpec);
    }

    public layout(left: number, top: number, right: number, bottom: number): void {
        super.layout(left, top, right, bottom);
        this.onLayout(left, top, right, bottom);
    }

    public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void {
        var view = this._nativeView;
        if (view) {
            view.measure(widthMeasureSpec, heightMeasureSpec);
            this.setMeasuredDimension(view.getMeasuredWidth(), view.getMeasuredHeight());
        }
    }

    public onLayout(left: number, top: number, right: number, bottom: number): void {
        var view = this._nativeView;
        if (view) {
            this.layoutNativeView(left, top, right, bottom);
        }
    }

    _getCurrentLayoutBounds(): { left: number; top: number; right: number; bottom: number } {
        if (this._nativeView) {
            return {
                left: this._nativeView.getLeft(),
                top: this._nativeView.getTop(),
                right: this._nativeView.getRight(),
                bottom: this._nativeView.getBottom()
            };
        }

        return super._getCurrentLayoutBounds();
    }

    public getMeasuredWidth(): number {
        if (this._nativeView) {
            return this._nativeView.getMeasuredWidth();
        }

        return super.getMeasuredWidth();
    }

    public getMeasuredHeight(): number {
        if (this._nativeView) {
            return this._nativeView.getMeasuredHeight();
        }

        return super.getMeasuredHeight();
    }

    public focus(): boolean {
        if (this._nativeView) {
            return this._nativeView.requestFocus();
        }

        return false;
    }

    public static resolveSizeAndState(size: number, specSize: number, specMode: number, childMeasuredState: number): number {
        var result = size;
        switch (specMode) {
            case utils.layout.UNSPECIFIED:
                result = size;
                break;

            case utils.layout.AT_MOST:
                if (specSize < size) {
                    result = specSize | utils.layout.MEASURED_STATE_TOO_SMALL;
                }
                break;

            case utils.layout.EXACTLY:
                result = specSize;
                break;
        }

        return result | (childMeasuredState & utils.layout.MEASURED_STATE_MASK);
    }
}

export class CustomLayoutView extends View implements viewDefinition.CustomLayoutView {
    private _viewGroup: android.view.ViewGroup;

    get android(): android.view.ViewGroup {
        return this._viewGroup;
    }

    get _nativeView(): android.view.ViewGroup {
        return this._viewGroup;
    }

    public _createUI() {
        this._viewGroup = new org.nativescript.widgets.ContentLayout(this._context);
    }

    public _addViewToNativeVisualTree(child: View, atIndex?: number): boolean {
        super._addViewToNativeVisualTree(child);

        if (this._nativeView && child._nativeView) {
            if (types.isNullOrUndefined(atIndex) || atIndex >= this._nativeView.getChildCount()) {
                this._nativeView.addView(child._nativeView);
            }
            else {
                this._nativeView.addView(child._nativeView, atIndex);
            }
            return true;
        }

        return false;
    }

    public _removeViewFromNativeVisualTree(child: View): void {
        super._removeViewFromNativeVisualTree(child);

        if (this._nativeView && child._nativeView) {
            this._nativeView.removeView(child._nativeView);
            trace.notifyEvent(child, "childInLayoutRemovedFromNativeVisualTree");
        }
    }
}


text:
package press.turngeek.mymemo.controller;

import java.io.IOException;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import press.turngeek.mymemo.model.Memo;
import press.turngeek.mymemo.view.MemoViewRenderer;

@WebServlet({"/MemoServlet", "/memos"})
public class MemoServlet extends HttpServlet {

    private static final long serialVersionUID = -7843898075264520941L;
    private ServletConfig     config;

    @Override
    public void init(ServletConfig config) throws ServletException {
        this.config = config;
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // no action
        sendResponse(request, response);
    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        // get post parameter
        final String button = request.getParameter("button");
        switch (button) {
            case "reset":
                actionReset(request);
                sendResponse(request, response);
                break;
            case "save":
                String memoDescr = request.getParameter("memo");
                actionAddMemo(request, memoDescr);
                sendResponse(request, response);
                break;
            default:
                // no action
                sendResponse(request, response);
        }
    }

    private synchronized void actionReset(HttpServletRequest request) {
        List<Memo> memos = getMemos(request);
        memos.clear();
    }

    private synchronized void actionAddMemo(HttpServletRequest request, String memoDescr) {

        if (memoDescr != null && !memoDescr.isEmpty()) {
            List<Memo> memos = getMemos(request);
            // create memo
            Memo memo = new Memo();
            memo.setDescription(memoDescr);
            memo.setCreated(new Date());
            // add todo list
            memos.add(memo);
        } else {
            //set error message in request
            request.setAttribute("err", "Please, enter a memo!");
        }
    }

    private void sendResponse(HttpServletRequest request, HttpServletResponse response) throws IOException {
        response.setContentType("text/html");
        response.setCharacterEncoding("utf-8");
        String err = (String)request.getAttribute("err");
        List<Memo> memos = getMemos(request);
        response.getOutputStream().print(MemoViewRenderer.renderResponse(memos, err));
    }

    private List<Memo> getMemos(HttpServletRequest request) {
        HttpSession session = request.getSession();
        List<Memo> memos = (List<Memo>)session.getAttribute("memos");
        if (memos == null) {
            memos = new LinkedList<Memo>();
            session.setAttribute("memos", memos);
        }
        return memos;
    }
}

redpajama_set_name: RedPajamaGithub


text:
from .production import *

DATABASES = {
    "default": dj_database_url.config(),
}

ALLOWED_HOSTS = [
    'diventi.herokuapp.com',
    'localhost',
]


text:
![Build Status](https://github.com/jwalton/node-promise-breaker/workflows/GitHub%20CI/badge.svg)
[![Coverage Status](https://coveralls.io/repos/jwalton/node-promise-breaker/badge.svg)](https://coveralls.io/r/jwalton/node-promise-breaker)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

## What is it?

`promise-breaker` makes it easy to write functions that will accept an optional callback, or return
a Promise if a callback is not provided.  You can use callbacks or Promises in your implementation,
and callers can call with either a callback or expect a Promise.  It's a library that makes it easy
to write libraries for others.

## Installation

    npm install --save promise-breaker

## Requirements

This library assumes that `Promise` is a defined global variable.  If this is not the case
on your platform, you can use a polyfill:

    npm install --save es6-promise

Then somewhere in your node.js application:

    if(!global.Promise) {
        global.Promise = require('es6-promise').Promise;
    }

Or in your client-side app:

    if(!window.Promise) {
        window.Promise = require('es6-promise').Promise;
    }

If you don't want to set the global, you can pass an optional Promise implementation to
`promise-breaker`:

    var MyPromise = require('es6-promise').Promise;
    promiseBreaker = require('promise-breaker').withPromise(MyPromise);

## Summary

With the growing popularity of Promises these days, if you're a library author, it's nice to
be able to provide your clients with a library that will take an optional callback, and if the
callback isn't provided, return a Promise.  If you've ever tried to do this, you know that there's
a lot of finicky boilerplate involved in every function you write.  Providing callback support is
also pretty important if you prefer to write your library using Promises internally.

'promise-breaker' makes this really easy.  If you prefer writing in callback style:

```js
export function myFunc(done=null) {
    return pb.addPromise(done, done => // Add this wrapper around your async function
        doThing((err, thing) => {
            if(err) {return done(err);}
            doOtherThing(thing, (err, otherThing) => {
                if(err) {return done(err);}
                done(null, otherThing);
            });
        });
    );
}
```

or if you prefer Promise style:

```js
export function myFunc(done=null) {
    return pb.addCallback(done, // Add this wrapper around your returned Promise.
        doThing()
        .then(result => doOtherThing(result))
    );
}
```

If you're using arrow functions or using commonjs exports, it's even easier to use
promise-breaker to create functions that generate a Promise or accept a callback:

```js
// Both of these will take an optional `done`, and if not provided return a Promise.
exports.myPromiseFunc = pb.break({args: 0}, () => {
    return Promise.resolve("Hello World");
});

exports.myCbFunc = pb.make({args: 1}, done => {
    done(null, "Hello World");
});
```

The names `make()` and `break()` here come from the idea that you are making a callback into a promise, or breaking
a promise down into a callback.  Note that `make()` and `break()` rely on the `.length` of the function you pass
in.  In ES6, default parameters do not count towards the length of the function, so you need to explicitly tell
promise-breaker how many parameters are expected in the `args` parameter.  If you're not using default arguments, you
can omit the options parameter altogether, but this is a bad habit, as promise-breaker unfortunately has no way to
detect if you get it wrong.

The other thing you often want to do when writing a library is call into a function without knowing whether
it returns a promise or expects a callback.  Again, promise-breaker makes this easy:

```js
export function doStuff(fn) {
    // This works just like `fn.call` except it will add a `done` if `fn.length` is bigger than the parameter count.
    // So here, this will either call `fn("hello world")` and get back a Promise or `fn("hello world", done)` and
    // convert the callback into a Promise for you.
    pb.call(fn, null, "hello world")
    .catch(err => console.log(err));
}
```

Or, in callback style:

```js
export function doStuff(fn) {
    pb.callWithCb(fn, null, "hello world", err => {
        if(err) return console.log(err);
    });
}
```

## API

### pb.make([options,] fn)

* `options.args` - In ES6, default parameters do not count towards a functions `.length`.  If your `fn`
  uses default parameters, you must specify the total parameter count in `args`.  E.g.:
  `const myFn = pb.make({args: 2}, (x, y=null) => ...);`  If you do not specify `args`, then promise-breaker
  will use `fn.length` instead.

`make()` takes a function which accepts a `callback(err, result)` as its last parameter, and
returns a new function which accepts an optional callback as its last parameter.  If a callback is
provided, this new function will behave exactly like the original function.  If the callback
is not provided, then the new function will return a Promise.

Since Promises only allow a single value to be returned, if `fn` passes more than two arguments to `callback(...)`,
then (as of v3.0.0) any arguments after the error will be transformed into an array and returned via the Promise as a
single combined argument.  This does not affect the case where the transformed function is called with a callback.

For example:

    var myFunc = pb.make(function(callback) {
        // We're returning multiple values via callback
        callback(null, "a", "b");
    })

    // Callback style
    myFunc(function(err, a, b) {...});

    // Promise style
    myFunc()
    .then(function(results) {
        // Promises only let us return a single value, so we return an array.
        var a = results[0];
        var b = results[1];
        ...
    })
    .catch(function(err) {...});

### pb.break([options,] fn)

* `options.args` - In ES6, default parameters do not count towards a functions `.length`.  If your `fn`
  uses default parameters, you must specify the total parameter count in `args`.  E.g.:
  `const myFn = pb.break({args: 3}, (x, y=null, done=null) => ...);`  If you do not specify `args`,
  then promise-breaker will use `fn.length` instead.

`break(fn)` is the opposite of `make(fn)`.  `fn` here is a function which returns a Promise.
`break(fn)` will generate a new function with an extra parameter, an optional
`callback(err, result)`.  If no callback is provided, the generated function will behave exactly
like the original function.  If a callback is provided, then the generated function will return
`null`, and will pass any results that would have been returned via the Promise via the callback
instead.

### addPromise(done, fn)

Used to add Promise support to a callback-based function.

Calls `fn(cb)`.  If `done` is provided, it is passed directly as `cb` and `addPromise` returns undefined.  If `done`
is not provided, `addPromise` will generate an appropriate callback and return a Promise.  If `fn` is called with
more than two arguments (with multiple results, in other words) then the Promise will resolve to an array of results.

Use it like this:

```js
export function addAsync(x, y, done=null) {
    return pb.addPromise(done, done => done(null, x + y));
}
```

### addCallback(done, promise)

Used to add callback support to a promise-based function.

If `done` is not provided, returns the `promise` passed in.  If `done` is
provided, this will wait for `promise` to resolve or reject and then call
`done(err, result)` appropriately.  Note that `promise` can also be a
function that takes no arguments and returns a Promise.

Use it like this:

```js
export function addAsync(x, y, done=null) {
    return pb.addCallback(done, Promise.resolve(x + y));
}
```

### pb.apply(fn, thisArg, args[, cb])

Much like [`Function.prototype.apply()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call),
this calls a function, but this lets you call into a function when you don't know whether the
function is expecting a callback or is going to return a Promise.  `fn` is the function you wish
to call.  Under the hood, if `fn.length` is equal to `args.length`, this will call `fn`
with the parameters provided, and then return the Promise (or wrap a returned value in a Promise).
If `fn.length` is `args.length + 1`, then a callback will be added.

If `cb` is provided, `apply` will call into `cb` with a result, otherwise `apply` will itself
return a Promise.

### pb.call(fn, thisArg[, arg1[, arg2[, ...]]))

This is the [`Function.prototype.call()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call)
equivalent of `apply()`.  Note that this always returns a Promise.  If you need a callback, use `callWithCb()`
instead.

Note that this is handy shortcut for promisifying a callback-based API:

```js
pb.call(done => fs.readFile(filename, {encoding: 'utf8'}, done))
.then(fileContents => ...);
```

### pb.callWithCb(fn, argumentCount, thisArg[, arg1[, arg2[, ...[, cb]]]])

Similar to `pb.call()`, but instead of returning a Promise this will call the provided callback.

### pb.withPromise(promiseImpl)

Returns a new `{make, break, addPromise, addCallback, apply, call, callWithCb}` object which uses the specified
promiseImpl constructor to create new Promises.


text:
import Just from '../../src/core/just';
import Nothing from '../../src/core/nothing';

export default function half(n) {
  if (n % 2 === 0) {
    return Just(n / 2);
  }

  return Nothing();
}


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

import org.w3c.dom.Node;
import javax.annotation.Generated;

import com.amazonaws.AmazonServiceException;

import com.amazonaws.transform.StandardErrorUnmarshaller;

import com.amazonaws.services.sqs.model.OverLimitException;

@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class OverLimitExceptionUnmarshaller extends StandardErrorUnmarshaller {

    public OverLimitExceptionUnmarshaller() {
        super(OverLimitException.class);
    }

    @Override
    public AmazonServiceException unmarshall(Node node) throws Exception {
        // Bail out if this isn't the right error code that this
        // marshaller understands
        String errorCode = parseErrorCode(node);
        if (errorCode == null || !errorCode.equals("OverLimit"))
            return null;

        OverLimitException e = (OverLimitException) super.unmarshall(node);

        return e;
    }
}


text:
<!doctype html>

<title>
	{% block title %}
	{% endblock %}
</title>

{% load compress %}
{% compress css %}
	<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/bootstrap.css">
	<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/base.css">
	<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/quiz.css">
{% endcompress %}

{% block css %}
{% endblock %}

		    ConceptGrapher

		      	{% block current-path %}
		      	{% endblock %}

		{% block content %}
		{% endblock %}

		{% load compress %}
		{% compress js %}

			{% include 'quiz-js.html' %}

		{% endcompress %}

		{% block js %}
		{% endblock %}

		{% block templates %}
		{% endblock %}

		{% block config_js %}
		{% endblock %}

	{% csrf_token %}

	{% if not DEBUG %}

	{% endif %}


text:
package org.apache.sling.distribution.util.impl;

import static org.apache.commons.io.IOUtils.copy;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.List;
import java.util.Random;

import org.apache.sling.distribution.util.impl.FileBackedMemoryOutputStream.MemoryUnit;
import org.junit.Test;

/**
 * Tests for {@link org.apache.sling.distribution.util.impl.FileBackedMemoryOutputStream}
 */
public class FileBackedMemoryOutputStreamTest {

    @Test
    public void justKeepDataInMemory() throws IOException {
        FileBackedMemoryOutputStream output = new FileBackedMemoryOutputStream(10,
                                                                               MemoryUnit.BYTES,
                                                                               false,
                                                                               new File("/tmp"),
                                                                               "FileBackedMemoryOutputStreamTest.justKeepDataInMemory",
                                                                               ".tmp");
        byte[] data = newDataArray(2);

        output.write(data);
        output.close();

        assertEquals(2, output.size());
        assertNull(output.getFile());

        verifyWrittenData(data, output);
    }

    @Test
    public void backedToFile() throws IOException {
        FileBackedMemoryOutputStream output = new FileBackedMemoryOutputStream(10,
                                                                               MemoryUnit.BYTES,
                                                                               false,
                                                                               new File("/tmp"),
                                                                               "FileBackedMemoryOutputStreamTest.backedToFile",
                                                                               ".tmp");
        byte[] data = newDataArray(100);

        output.write(data);
        output.close();

        assertEquals(100, output.size());
        assertNotNull(output.getFile());
        assertTrue(output.getFile().exists());
        assertEquals(90, output.getFile().length());

        verifyWrittenData(data, output);

        output.clean();
        assertFalse(output.getFile().exists());
    }

    @Test
    public void multiBackedToFileTest() throws IOException {

        List<byte[]> datum = Arrays.asList(newDataArray(0), newDataArray(1), newDataArray(9),
                newDataArray(10), newDataArray(11), newDataArray(100), newDataArray(1000));

        for (byte[] data : datum) {
            FileBackedMemoryOutputStream output = new FileBackedMemoryOutputStream(10,
                    MemoryUnit.BYTES,false, new File("/tmp"),
                    "FileBackedMemoryOutputStreamTest.multiTest-" + data.length, ".tmp");
            output.write(data);
            output.close();
            assertEquals(data.length, output.size());
            verifyWrittenData(data, output);
        }
    }

    private byte[] newDataArray(int size) {
        byte[] data = new byte[size];
        byte b = (byte) (new Random().nextInt() & 0xff);
        Arrays.fill(data, b);
        return data;
    }

    private void verifyWrittenData(byte[] expecteds, FileBackedMemoryOutputStream writtenData) throws IOException {
        InputStream input = writtenData.openWrittenDataInputStream();
        ByteArrayOutputStream output = new ByteArrayOutputStream();
        copy(input, output);
        byte[] actuals = output.toByteArray();
        assertArrayEquals(expecteds, actuals);
    }

}


text:
import sys, os
sys.path.append(os.path.dirname(os.path.realpath(__file__))+'/lib')

from cloudagents import CloudAgent
from time import sleep

ca = CloudAgent()

ca.required_config = {
	"name": "Count Up",
	"version": "0.1.0",
	"author": "Jeff Kramer",
	"url": "http://www.hpcloud.com/",
	"help": """This script counts up from 0 by the count number given, storing the end number in a datastore.  If the datastore contains a number, it starts there instead of 0.""",
	"config":
		[{
			"name": "count",
			"regexp": "^\d+$",
			"title": "Count",
			"description": "Number to count up.",
			"type": "string",
			"required": True
		}
		]
	}

def agent():

	count = int(ca.conf['count'])
	if ca.datastore:
		start = int(ca.datastore)
	else:
		start = 0

	for i, num in enumerate(range(start+1,start+count+1,1)):
		sleep(1)
		percent = int((float(i+1)/float(count))*100.0)
		ca.log(str(num),"Counted up to "+str(num)+".",percent)

	ca.store(str(num))

ca.run(agent)


text:
static std::mutex m;

typedef std::chrono::system_clock Clock;
typedef Clock::time_point time_point;
typedef Clock::duration duration;
typedef std::chrono::milliseconds ms;
typedef std::chrono::nanoseconds ns;

static int f()
{
    time_point t0 = Clock::now();
    time_point t1;
    {
    std::lock_guard<std::mutex> lg(m);
    t1 = Clock::now();
    }
    ns d = t1 - t0 - ms(250);
    TC_ASSERT_EXPR(d < ms(200));  // within 200ms
    return 0;
}

int tc_libcxx_thread_thread_lock_guard_mutex(void)
{
    m.lock();
    std::thread t(f);
    std::this_thread::sleep_for(ms(250));
    m.unlock();
    t.join();

#ifdef __cpp_deduction_guides
    std::lock_guard lg(m);
    static_assert((std::is_same<decltype(lg), std::lock_guard<decltype(m)>>::value), "" );
#endif
    TC_SUCCESS_RESULT();
    return 0;
}


text:
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This file is autogenerated by:
//     mojo/public/tools/bindings/mojom_bindings_generator.py
// For:
//     media/mojo/interfaces/audio_decoder.mojom
//

package org.chromium.media.mojom;

import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.mojo.bindings.DeserializationException;

class AudioDecoder_Internal {

    public static final org.chromium.mojo.bindings.Interface.Manager<AudioDecoder, AudioDecoder.Proxy> MANAGER =
            new org.chromium.mojo.bindings.Interface.Manager<AudioDecoder, AudioDecoder.Proxy>() {

        public String getName() {
            return "media::mojom::AudioDecoder";
        }

        public int getVersion() {
          return 0;
        }

        public Proxy buildProxy(org.chromium.mojo.system.Core core,
                                org.chromium.mojo.bindings.MessageReceiverWithResponder messageReceiver) {
            return new Proxy(core, messageReceiver);
        }

        public Stub buildStub(org.chromium.mojo.system.Core core, AudioDecoder impl) {
            return new Stub(core, impl);
        }

        public AudioDecoder[] buildArray(int size) {
          return new AudioDecoder[size];
        }
    };

    private static final int CONSTRUCT_ORDINAL = 0;

    private static final int INITIALIZE_ORDINAL = 1;

    private static final int SET_DATA_SOURCE_ORDINAL = 2;

    private static final int DECODE_ORDINAL = 3;

    private static final int RESET_ORDINAL = 4;

    static final class Proxy extends org.chromium.mojo.bindings.Interface.AbstractProxy implements AudioDecoder.Proxy {

        Proxy(org.chromium.mojo.system.Core core,
              org.chromium.mojo.bindings.MessageReceiverWithResponder messageReceiver) {
            super(core, messageReceiver);
        }

        @Override
        public void construct(
org.chromium.mojo.bindings.AssociatedInterfaceNotSupported client) {

            AudioDecoderConstructParams _message = new AudioDecoderConstructParams();

            _message.client = client;

            getProxyHandler().getMessageReceiver().accept(
                    _message.serializeWithHeader(
                            getProxyHandler().getCore(),
                            new org.chromium.mojo.bindings.MessageHeader(CONSTRUCT_ORDINAL)));

        }

        @Override
        public void initialize(
AudioDecoderConfig config, int cdmId,
InitializeResponse callback) {

            AudioDecoderInitializeParams _message = new AudioDecoderInitializeParams();

            _message.config = config;

            _message.cdmId = cdmId;

            getProxyHandler().getMessageReceiver().acceptWithResponder(
                    _message.serializeWithHeader(
                            getProxyHandler().getCore(),
                            new org.chromium.mojo.bindings.MessageHeader(
                                    INITIALIZE_ORDINAL,
                                    org.chromium.mojo.bindings.MessageHeader.MESSAGE_EXPECTS_RESPONSE_FLAG,
                                    0)),
                    new AudioDecoderInitializeResponseParamsForwardToCallback(callback));

        }

        @Override
        public void setDataSource(
org.chromium.mojo.system.DataPipe.ConsumerHandle receivePipe) {

            AudioDecoderSetDataSourceParams _message = new AudioDecoderSetDataSourceParams();

            _message.receivePipe = receivePipe;

            getProxyHandler().getMessageReceiver().accept(
                    _message.serializeWithHeader(
                            getProxyHandler().getCore(),
                            new org.chromium.mojo.bindings.MessageHeader(SET_DATA_SOURCE_ORDINAL)));

        }

        @Override
        public void decode(
DecoderBuffer buffer,
DecodeResponse callback) {

            AudioDecoderDecodeParams _message = new AudioDecoderDecodeParams();

            _message.buffer = buffer;

            getProxyHandler().getMessageReceiver().acceptWithResponder(
                    _message.serializeWithHeader(
                            getProxyHandler().getCore(),
                            new org.chromium.mojo.bindings.MessageHeader(
                                    DECODE_ORDINAL,
                                    org.chromium.mojo.bindings.MessageHeader.MESSAGE_EXPECTS_RESPONSE_FLAG,
                                    0)),
                    new AudioDecoderDecodeResponseParamsForwardToCallback(callback));

        }

        @Override
        public void reset(

ResetResponse callback) {

            AudioDecoderResetParams _message = new AudioDecoderResetParams();

            getProxyHandler().getMessageReceiver().acceptWithResponder(
                    _message.serializeWithHeader(
                            getProxyHandler().getCore(),
                            new org.chromium.mojo.bindings.MessageHeader(
                                    RESET_ORDINAL,
                                    org.chromium.mojo.bindings.MessageHeader.MESSAGE_EXPECTS_RESPONSE_FLAG,
                                    0)),
                    new AudioDecoderResetResponseParamsForwardToCallback(callback));

        }

    }

    static final class Stub extends org.chromium.mojo.bindings.Interface.Stub<AudioDecoder> {

        Stub(org.chromium.mojo.system.Core core, AudioDecoder impl) {
            super(core, impl);
        }

        @Override
        public boolean accept(org.chromium.mojo.bindings.Message message) {
            try {
                org.chromium.mojo.bindings.ServiceMessage messageWithHeader =
                        message.asServiceMessage();
                org.chromium.mojo.bindings.MessageHeader header = messageWithHeader.getHeader();
                if (!header.validateHeader(org.chromium.mojo.bindings.MessageHeader.NO_FLAG)) {
                    return false;
                }
                switch(header.getType()) {

                    case org.chromium.mojo.bindings.interfacecontrol.InterfaceControlMessagesConstants.RUN_OR_CLOSE_PIPE_MESSAGE_ID:
                        return org.chromium.mojo.bindings.InterfaceControlMessagesHelper.handleRunOrClosePipe(
                                AudioDecoder_Internal.MANAGER, messageWithHeader);

                    case CONSTRUCT_ORDINAL: {

                        AudioDecoderConstructParams data =
                                AudioDecoderConstructParams.deserialize(messageWithHeader.getPayload());

                        getImpl().construct(data.client);
                        return true;
                    }

                    case SET_DATA_SOURCE_ORDINAL: {

                        AudioDecoderSetDataSourceParams data =
                                AudioDecoderSetDataSourceParams.deserialize(messageWithHeader.getPayload());

                        getImpl().setDataSource(data.receivePipe);
                        return true;
                    }

                    default:
                        return false;
                }
            } catch (org.chromium.mojo.bindings.DeserializationException e) {
                System.err.println(e.toString());
                return false;
            }
        }

        @Override
        public boolean acceptWithResponder(org.chromium.mojo.bindings.Message message, org.chromium.mojo.bindings.MessageReceiver receiver) {
            try {
                org.chromium.mojo.bindings.ServiceMessage messageWithHeader =
                        message.asServiceMessage();
                org.chromium.mojo.bindings.MessageHeader header = messageWithHeader.getHeader();
                if (!header.validateHeader(org.chromium.mojo.bindings.MessageHeader.MESSAGE_EXPECTS_RESPONSE_FLAG)) {
                    return false;
                }
                switch(header.getType()) {

                    case org.chromium.mojo.bindings.interfacecontrol.InterfaceControlMessagesConstants.RUN_MESSAGE_ID:
                        return org.chromium.mojo.bindings.InterfaceControlMessagesHelper.handleRun(
                                getCore(), AudioDecoder_Internal.MANAGER, messageWithHeader, receiver);

                    case INITIALIZE_ORDINAL: {

                        AudioDecoderInitializeParams data =
                                AudioDecoderInitializeParams.deserialize(messageWithHeader.getPayload());

                        getImpl().initialize(data.config, data.cdmId, new AudioDecoderInitializeResponseParamsProxyToResponder(getCore(), receiver, header.getRequestId()));
                        return true;
                    }

                    case DECODE_ORDINAL: {

                        AudioDecoderDecodeParams data =
                                AudioDecoderDecodeParams.deserialize(messageWithHeader.getPayload());

                        getImpl().decode(data.buffer, new AudioDecoderDecodeResponseParamsProxyToResponder(getCore(), receiver, header.getRequestId()));
                        return true;
                    }

                    case RESET_ORDINAL: {

                        AudioDecoderResetParams.deserialize(messageWithHeader.getPayload());

                        getImpl().reset(new AudioDecoderResetResponseParamsProxyToResponder(getCore(), receiver, header.getRequestId()));
                        return true;
                    }

                    default:
                        return false;
                }
            } catch (org.chromium.mojo.bindings.DeserializationException e) {
                System.err.println(e.toString());
                return false;
            }
        }
    }

    static final class AudioDecoderConstructParams extends org.chromium.mojo.bindings.Struct {

        private static final int STRUCT_SIZE = 16;
        private static final org.chromium.mojo.bindings.DataHeader[] VERSION_ARRAY = new org.chromium.mojo.bindings.DataHeader[] {new org.chromium.mojo.bindings.DataHeader(16, 0)};
        private static final org.chromium.mojo.bindings.DataHeader DEFAULT_STRUCT_INFO = VERSION_ARRAY[0];
        public org.chromium.mojo.bindings.AssociatedInterfaceNotSupported client;

        private AudioDecoderConstructParams(int version) {
            super(STRUCT_SIZE, version);
        }

        public AudioDecoderConstructParams() {
            this(0);
        }

        public static AudioDecoderConstructParams deserialize(org.chromium.mojo.bindings.Message message) {
            return decode(new org.chromium.mojo.bindings.Decoder(message));
        }

        /**
         * Similar to the method above, but deserializes from a |ByteBuffer| instance.
         *
         * @throws org.chromium.mojo.bindings.DeserializationException on deserialization failure.
         */
        public static AudioDecoderConstructParams deserialize(java.nio.ByteBuffer data) {
            if (data == null)
                return null;

            return deserialize(new org.chromium.mojo.bindings.Message(
                    data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));
        }

        @SuppressWarnings("unchecked")
        public static AudioDecoderConstructParams decode(org.chromium.mojo.bindings.Decoder decoder0) {
            if (decoder0 == null) {
                return null;
            }
            decoder0.increaseStackDepth();
            AudioDecoderConstructParams result;
            try {
                org.chromium.mojo.bindings.DataHeader mainDataHeader = decoder0.readAndValidateDataHeader(VERSION_ARRAY);
                result = new AudioDecoderConstructParams(mainDataHeader.elementsOrVersion);
                if (mainDataHeader.elementsOrVersion >= 0) {

                    result.client = decoder0.readAssociatedServiceInterfaceNotSupported(8, false);
                }
            } finally {
                decoder0.decreaseStackDepth();
            }
            return result;
        }

        @SuppressWarnings("unchecked")
        @Override
        protected final void encode(org.chromium.mojo.bindings.Encoder encoder) {
            org.chromium.mojo.bindings.Encoder encoder0 = encoder.getEncoderAtDataOffset(DEFAULT_STRUCT_INFO);

            encoder0.encode(client, 8, false);
        }

        /**
         * @see Object#equals(Object)
         */
        @Override
        public boolean equals(Object object) {
            if (object == this)
                return true;
            if (object == null)
                return false;
            if (getClass() != object.getClass())
                return false;
            AudioDecoderConstructParams other = (AudioDecoderConstructParams) object;
            if (!org.chromium.mojo.bindings.BindingsHelper.equals(this.client, other.client))
                return false;
            return true;
        }

        /**
         * @see Object#hashCode()
         */
        @Override
        public int hashCode() {
            final int prime = 31;
            int result = prime + getClass().hashCode();
            result = prime * result + org.chromium.mojo.bindings.BindingsHelper.hashCode(client);
            return result;
        }
    }

    static final class AudioDecoderInitializeParams extends org.chromium.mojo.bindings.Struct {

        private static final int STRUCT_SIZE = 24;
        private static final org.chromium.mojo.bindings.DataHeader[] VERSION_ARRAY = new org.chromium.mojo.bindings.DataHeader[] {new org.chromium.mojo.bindings.DataHeader(24, 0)};
        private static final org.chromium.mojo.bindings.DataHeader DEFAULT_STRUCT_INFO = VERSION_ARRAY[0];
        public AudioDecoderConfig config;
        public int cdmId;

        private AudioDecoderInitializeParams(int version) {
            super(STRUCT_SIZE, version);
        }

        public AudioDecoderInitializeParams() {
            this(0);
        }

        public static AudioDecoderInitializeParams deserialize(org.chromium.mojo.bindings.Message message) {
            return decode(new org.chromium.mojo.bindings.Decoder(message));
        }

        /**
         * Similar to the method above, but deserializes from a |ByteBuffer| instance.
         *
         * @throws org.chromium.mojo.bindings.DeserializationException on deserialization failure.
         */
        public static AudioDecoderInitializeParams deserialize(java.nio.ByteBuffer data) {
            if (data == null)
                return null;

            return deserialize(new org.chromium.mojo.bindings.Message(
                    data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));
        }

        @SuppressWarnings("unchecked")
        public static AudioDecoderInitializeParams decode(org.chromium.mojo.bindings.Decoder decoder0) {
            if (decoder0 == null) {
                return null;
            }
            decoder0.increaseStackDepth();
            AudioDecoderInitializeParams result;
            try {
                org.chromium.mojo.bindings.DataHeader mainDataHeader = decoder0.readAndValidateDataHeader(VERSION_ARRAY);
                result = new AudioDecoderInitializeParams(mainDataHeader.elementsOrVersion);
                if (mainDataHeader.elementsOrVersion >= 0) {

                    org.chromium.mojo.bindings.Decoder decoder1 = decoder0.readPointer(8, false);
                    result.config = AudioDecoderConfig.decode(decoder1);
                }
                if (mainDataHeader.elementsOrVersion >= 0) {

                    result.cdmId = decoder0.readInt(16);
                }
            } finally {
                decoder0.decreaseStackDepth();
            }
            return result;
        }

        @SuppressWarnings("unchecked")
        @Override
        protected final void encode(org.chromium.mojo.bindings.Encoder encoder) {
            org.chromium.mojo.bindings.Encoder encoder0 = encoder.getEncoderAtDataOffset(DEFAULT_STRUCT_INFO);

            encoder0.encode(config, 8, false);

            encoder0.encode(cdmId, 16);
        }

        /**
         * @see Object#equals(Object)
         */
        @Override
        public boolean equals(Object object) {
            if (object == this)
                return true;
            if (object == null)
                return false;
            if (getClass() != object.getClass())
                return false;
            AudioDecoderInitializeParams other = (AudioDecoderInitializeParams) object;
            if (!org.chromium.mojo.bindings.BindingsHelper.equals(this.config, other.config))
                return false;
            if (this.cdmId!= other.cdmId)
                return false;
            return true;
        }

        /**
         * @see Object#hashCode()
         */
        @Override
        public int hashCode() {
            final int prime = 31;
            int result = prime + getClass().hashCode();
            result = prime * result + org.chromium.mojo.bindings.BindingsHelper.hashCode(config);
            result = prime * result + org.chromium.mojo.bindings.BindingsHelper.hashCode(cdmId);
            return result;
        }
    }

    static final class AudioDecoderInitializeResponseParams extends org.chromium.mojo.bindings.Struct {

        private static final int STRUCT_SIZE = 16;
        private static final org.chromium.mojo.bindings.DataHeader[] VERSION_ARRAY = new org.chromium.mojo.bindings.DataHeader[] {new org.chromium.mojo.bindings.DataHeader(16, 0)};
        private static final org.chromium.mojo.bindings.DataHeader DEFAULT_STRUCT_INFO = VERSION_ARRAY[0];
        public boolean success;
        public boolean needsBitstreamConversion;

        private AudioDecoderInitializeResponseParams(int version) {
            super(STRUCT_SIZE, version);
        }

        public AudioDecoderInitializeResponseParams() {
            this(0);
        }

        public static AudioDecoderInitializeResponseParams deserialize(org.chromium.mojo.bindings.Message message) {
            return decode(new org.chromium.mojo.bindings.Decoder(message));
        }

        /**
         * Similar to the method above, but deserializes from a |ByteBuffer| instance.
         *
         * @throws org.chromium.mojo.bindings.DeserializationException on deserialization failure.
         */
        public static AudioDecoderInitializeResponseParams deserialize(java.nio.ByteBuffer data) {
            if (data == null)
                return null;

            return deserialize(new org.chromium.mojo.bindings.Message(
                    data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));
        }

        @SuppressWarnings("unchecked")
        public static AudioDecoderInitializeResponseParams decode(org.chromium.mojo.bindings.Decoder decoder0) {
            if (decoder0 == null) {
                return null;
            }
            decoder0.increaseStackDepth();
            AudioDecoderInitializeResponseParams result;
            try {
                org.chromium.mojo.bindings.DataHeader mainDataHeader = decoder0.readAndValidateDataHeader(VERSION_ARRAY);
                result = new AudioDecoderInitializeResponseParams(mainDataHeader.elementsOrVersion);
                if (mainDataHeader.elementsOrVersion >= 0) {

                    result.success = decoder0.readBoolean(8, 0);
                }
                if (mainDataHeader.elementsOrVersion >= 0) {

                    result.needsBitstreamConversion = decoder0.readBoolean(8, 1);
                }
            } finally {
                decoder0.decreaseStackDepth();
            }
            return result;
        }

        @SuppressWarnings("unchecked")
        @Override
        protected final void encode(org.chromium.mojo.bindings.Encoder encoder) {
            org.chromium.mojo.bindings.Encoder encoder0 = encoder.getEncoderAtDataOffset(DEFAULT_STRUCT_INFO);

            encoder0.encode(success, 8, 0);

            encoder0.encode(needsBitstreamConversion, 8, 1);
        }

        /**
         * @see Object#equals(Object)
         */
        @Override
        public boolean equals(Object object) {
            if (object == this)
                return true;
            if (object == null)
                return false;
            if (getClass() != object.getClass())
                return false;
            AudioDecoderInitializeResponseParams other = (AudioDecoderInitializeResponseParams) object;
            if (this.success!= other.success)
                return false;
            if (this.needsBitstreamConversion!= other.needsBitstreamConversion)
                return false;
            return true;
        }

        /**
         * @see Object#hashCode()
         */
        @Override
        public int hashCode() {
            final int prime = 31;
            int result = prime + getClass().hashCode();
            result = prime * result + org.chromium.mojo.bindings.BindingsHelper.hashCode(success);
            result = prime * result + org.chromium.mojo.bindings.BindingsHelper.hashCode(needsBitstreamConversion);
            return result;
        }
    }

    static class AudioDecoderInitializeResponseParamsForwardToCallback extends org.chromium.mojo.bindings.SideEffectFreeCloseable
            implements org.chromium.mojo.bindings.MessageReceiver {
        private final AudioDecoder.InitializeResponse mCallback;

        AudioDecoderInitializeResponseParamsForwardToCallback(AudioDecoder.InitializeResponse callback) {
            this.mCallback = callback;
        }

        @Override
        public boolean accept(org.chromium.mojo.bindings.Message message) {
            try {
                org.chromium.mojo.bindings.ServiceMessage messageWithHeader =
                        message.asServiceMessage();
                org.chromium.mojo.bindings.MessageHeader header = messageWithHeader.getHeader();
                if (!header.validateHeader(INITIALIZE_ORDINAL,
                                           org.chromium.mojo.bindings.MessageHeader.MESSAGE_IS_RESPONSE_FLAG)) {
                    return false;
                }

                AudioDecoderInitializeResponseParams response = AudioDecoderInitializeResponseParams.deserialize(messageWithHeader.getPayload());

                mCallback.call(response.success, response.needsBitstreamConversion);
                return true;
            } catch (org.chromium.mojo.bindings.DeserializationException e) {
                return false;
            }
        }
    }

    static class AudioDecoderInitializeResponseParamsProxyToResponder implements AudioDecoder.InitializeResponse {

        private final org.chromium.mojo.system.Core mCore;
        private final org.chromium.mojo.bindings.MessageReceiver mMessageReceiver;
        private final long mRequestId;

        AudioDecoderInitializeResponseParamsProxyToResponder(
                org.chromium.mojo.system.Core core,
                org.chromium.mojo.bindings.MessageReceiver messageReceiver,
                long requestId) {
            mCore = core;
            mMessageReceiver = messageReceiver;
            mRequestId = requestId;
        }

        @Override
        public void call(Boolean success, Boolean needsBitstreamConversion) {
            AudioDecoderInitializeResponseParams _response = new AudioDecoderInitializeResponseParams();

            _response.success = success;

            _response.needsBitstreamConversion = needsBitstreamConversion;

            org.chromium.mojo.bindings.ServiceMessage _message =
                    _response.serializeWithHeader(
                            mCore,
                            new org.chromium.mojo.bindings.MessageHeader(
                                    INITIALIZE_ORDINAL,
                                    org.chromium.mojo.bindings.MessageHeader.MESSAGE_IS_RESPONSE_FLAG,
                                    mRequestId));
            mMessageReceiver.accept(_message);
        }
    }

    static final class AudioDecoderSetDataSourceParams extends org.chromium.mojo.bindings.Struct {

        private static final int STRUCT_SIZE = 16;
        private static final org.chromium.mojo.bindings.DataHeader[] VERSION_ARRAY = new org.chromium.mojo.bindings.DataHeader[] {new org.chromium.mojo.bindings.DataHeader(16, 0)};
        private static final org.chromium.mojo.bindings.DataHeader DEFAULT_STRUCT_INFO = VERSION_ARRAY[0];
        public org.chromium.mojo.system.DataPipe.ConsumerHandle receivePipe;

        private AudioDecoderSetDataSourceParams(int version) {
            super(STRUCT_SIZE, version);
            receivePipe = org.chromium.mojo.system.InvalidHandle.INSTANCE;
        }

        public AudioDecoderSetDataSourceParams() {
            this(0);
        }

        public static AudioDecoderSetDataSourceParams deserialize(org.chromium.mojo.bindings.Message message) {
            return decode(new org.chromium.mojo.bindings.Decoder(message));
        }

        /**
         * Similar to the method above, but deserializes from a |ByteBuffer| instance.
         *
         * @throws org.chromium.mojo.bindings.DeserializationException on deserialization failure.
         */
        public static AudioDecoderSetDataSourceParams deserialize(java.nio.ByteBuffer data) {
            if (data == null)
                return null;

            return deserialize(new org.chromium.mojo.bindings.Message(
                    data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));
        }

        @SuppressWarnings("unchecked")
        public static AudioDecoderSetDataSourceParams decode(org.chromium.mojo.bindings.Decoder decoder0) {
            if (decoder0 == null) {
                return null;
            }
            decoder0.increaseStackDepth();
            AudioDecoderSetDataSourceParams result;
            try {
                org.chromium.mojo.bindings.DataHeader mainDataHeader = decoder0.readAndValidateDataHeader(VERSION_ARRAY);
                result = new AudioDecoderSetDataSourceParams(mainDataHeader.elementsOrVersion);
                if (mainDataHeader.elementsOrVersion >= 0) {

                    result.receivePipe = decoder0.readConsumerHandle(8, false);
                }
            } finally {
                decoder0.decreaseStackDepth();
            }
            return result;
        }

        @SuppressWarnings("unchecked")
        @Override
        protected final void encode(org.chromium.mojo.bindings.Encoder encoder) {
            org.chromium.mojo.bindings.Encoder encoder0 = encoder.getEncoderAtDataOffset(DEFAULT_STRUCT_INFO);

            encoder0.encode(receivePipe, 8, false);
        }

        /**
         * @see Object#equals(Object)
         */
        @Override
        public boolean equals(Object object) {
            if (object == this)
                return true;
            if (object == null)
                return false;
            if (getClass() != object.getClass())
                return false;
            AudioDecoderSetDataSourceParams other = (AudioDecoderSetDataSourceParams) object;
            if (!org.chromium.mojo.bindings.BindingsHelper.equals(this.receivePipe, other.receivePipe))
                return false;
            return true;
        }

        /**
         * @see Object#hashCode()
         */
        @Override
        public int hashCode() {
            final int prime = 31;
            int result = prime + getClass().hashCode();
            result = prime * result + org.chromium.mojo.bindings.BindingsHelper.hashCode(receivePipe);
            return result;
        }
    }

    static final class AudioDecoderDecodeParams extends org.chromium.mojo.bindings.Struct {

        private static final int STRUCT_SIZE = 16;
        private static final org.chromium.mojo.bindings.DataHeader[] VERSION_ARRAY = new org.chromium.mojo.bindings.DataHeader[] {new org.chromium.mojo.bindings.DataHeader(16, 0)};
        private static final org.chromium.mojo.bindings.DataHeader DEFAULT_STRUCT_INFO = VERSION_ARRAY[0];
        public DecoderBuffer buffer;

        private AudioDecoderDecodeParams(int version) {
            super(STRUCT_SIZE, version);
        }

        public AudioDecoderDecodeParams() {
            this(0);
        }

        public static AudioDecoderDecodeParams deserialize(org.chromium.mojo.bindings.Message message) {
            return decode(new org.chromium.mojo.bindings.Decoder(message));
        }

        /**
         * Similar to the method above, but deserializes from a |ByteBuffer| instance.
         *
         * @throws org.chromium.mojo.bindings.DeserializationException on deserialization failure.
         */
        public static AudioDecoderDecodeParams deserialize(java.nio.ByteBuffer data) {
            if (data == null)
                return null;

            return deserialize(new org.chromium.mojo.bindings.Message(
                    data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));
        }

        @SuppressWarnings("unchecked")
        public static AudioDecoderDecodeParams decode(org.chromium.mojo.bindings.Decoder decoder0) {
            if (decoder0 == null) {
                return null;
            }
            decoder0.increaseStackDepth();
            AudioDecoderDecodeParams result;
            try {
                org.chromium.mojo.bindings.DataHeader mainDataHeader = decoder0.readAndValidateDataHeader(VERSION_ARRAY);
                result = new AudioDecoderDecodeParams(mainDataHeader.elementsOrVersion);
                if (mainDataHeader.elementsOrVersion >= 0) {

                    org.chromium.mojo.bindings.Decoder decoder1 = decoder0.readPointer(8, false);
                    result.buffer = DecoderBuffer.decode(decoder1);
                }
            } finally {
                decoder0.decreaseStackDepth();
            }
            return result;
        }

        @SuppressWarnings("unchecked")
        @Override
        protected final void encode(org.chromium.mojo.bindings.Encoder encoder) {
            org.chromium.mojo.bindings.Encoder encoder0 = encoder.getEncoderAtDataOffset(DEFAULT_STRUCT_INFO);

            encoder0.encode(buffer, 8, false);
        }

        /**
         * @see Object#equals(Object)
         */
        @Override
        public boolean equals(Object object) {
            if (object == this)
                return true;
            if (object == null)
                return false;
            if (getClass() != object.getClass())
                return false;
            AudioDecoderDecodeParams other = (AudioDecoderDecodeParams) object;
            if (!org.chromium.mojo.bindings.BindingsHelper.equals(this.buffer, other.buffer))
                return false;
            return true;
        }

        /**
         * @see Object#hashCode()
         */
        @Override
        public int hashCode() {
            final int prime = 31;
            int result = prime + getClass().hashCode();
            result = prime * result + org.chromium.mojo.bindings.BindingsHelper.hashCode(buffer);
            return result;
        }
    }

    static final class AudioDecoderDecodeResponseParams extends org.chromium.mojo.bindings.Struct {

        private static final int STRUCT_SIZE = 16;
        private static final org.chromium.mojo.bindings.DataHeader[] VERSION_ARRAY = new org.chromium.mojo.bindings.DataHeader[] {new org.chromium.mojo.bindings.DataHeader(16, 0)};
        private static final org.chromium.mojo.bindings.DataHeader DEFAULT_STRUCT_INFO = VERSION_ARRAY[0];
        public int status;

        private AudioDecoderDecodeResponseParams(int version) {
            super(STRUCT_SIZE, version);
        }

        public AudioDecoderDecodeResponseParams() {
            this(0);
        }

        public static AudioDecoderDecodeResponseParams deserialize(org.chromium.mojo.bindings.Message message) {
            return decode(new org.chromium.mojo.bindings.Decoder(message));
        }

        /**
         * Similar to the method above, but deserializes from a |ByteBuffer| instance.
         *
         * @throws org.chromium.mojo.bindings.DeserializationException on deserialization failure.
         */
        public static AudioDecoderDecodeResponseParams deserialize(java.nio.ByteBuffer data) {
            if (data == null)
                return null;

            return deserialize(new org.chromium.mojo.bindings.Message(
                    data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));
        }

        @SuppressWarnings("unchecked")
        public static AudioDecoderDecodeResponseParams decode(org.chromium.mojo.bindings.Decoder decoder0) {
            if (decoder0 == null) {
                return null;
            }
            decoder0.increaseStackDepth();
            AudioDecoderDecodeResponseParams result;
            try {
                org.chromium.mojo.bindings.DataHeader mainDataHeader = decoder0.readAndValidateDataHeader(VERSION_ARRAY);
                result = new AudioDecoderDecodeResponseParams(mainDataHeader.elementsOrVersion);
                if (mainDataHeader.elementsOrVersion >= 0) {

                    result.status = decoder0.readInt(8);
                        DecodeStatus.validate(result.status);
                }
            } finally {
                decoder0.decreaseStackDepth();
            }
            return result;
        }

        @SuppressWarnings("unchecked")
        @Override
        protected final void encode(org.chromium.mojo.bindings.Encoder encoder) {
            org.chromium.mojo.bindings.Encoder encoder0 = encoder.getEncoderAtDataOffset(DEFAULT_STRUCT_INFO);

            encoder0.encode(status, 8);
        }

        /**
         * @see Object#equals(Object)
         */
        @Override
        public boolean equals(Object object) {
            if (object == this)
                return true;
            if (object == null)
                return false;
            if (getClass() != object.getClass())
                return false;
            AudioDecoderDecodeResponseParams other = (AudioDecoderDecodeResponseParams) object;
            if (this.status!= other.status)
                return false;
            return true;
        }

        /**
         * @see Object#hashCode()
         */
        @Override
        public int hashCode() {
            final int prime = 31;
            int result = prime + getClass().hashCode();
            result = prime * result + org.chromium.mojo.bindings.BindingsHelper.hashCode(status);
            return result;
        }
    }

    static class AudioDecoderDecodeResponseParamsForwardToCallback extends org.chromium.mojo.bindings.SideEffectFreeCloseable
            implements org.chromium.mojo.bindings.MessageReceiver {
        private final AudioDecoder.DecodeResponse mCallback;

        AudioDecoderDecodeResponseParamsForwardToCallback(AudioDecoder.DecodeResponse callback) {
            this.mCallback = callback;
        }

        @Override
        public boolean accept(org.chromium.mojo.bindings.Message message) {
            try {
                org.chromium.mojo.bindings.ServiceMessage messageWithHeader =
                        message.asServiceMessage();
                org.chromium.mojo.bindings.MessageHeader header = messageWithHeader.getHeader();
                if (!header.validateHeader(DECODE_ORDINAL,
                                           org.chromium.mojo.bindings.MessageHeader.MESSAGE_IS_RESPONSE_FLAG)) {
                    return false;
                }

                AudioDecoderDecodeResponseParams response = AudioDecoderDecodeResponseParams.deserialize(messageWithHeader.getPayload());

                mCallback.call(response.status);
                return true;
            } catch (org.chromium.mojo.bindings.DeserializationException e) {
                return false;
            }
        }
    }

    static class AudioDecoderDecodeResponseParamsProxyToResponder implements AudioDecoder.DecodeResponse {

        private final org.chromium.mojo.system.Core mCore;
        private final org.chromium.mojo.bindings.MessageReceiver mMessageReceiver;
        private final long mRequestId;

        AudioDecoderDecodeResponseParamsProxyToResponder(
                org.chromium.mojo.system.Core core,
                org.chromium.mojo.bindings.MessageReceiver messageReceiver,
                long requestId) {
            mCore = core;
            mMessageReceiver = messageReceiver;
            mRequestId = requestId;
        }

        @Override
        public void call(Integer status) {
            AudioDecoderDecodeResponseParams _response = new AudioDecoderDecodeResponseParams();

            _response.status = status;

            org.chromium.mojo.bindings.ServiceMessage _message =
                    _response.serializeWithHeader(
                            mCore,
                            new org.chromium.mojo.bindings.MessageHeader(
                                    DECODE_ORDINAL,
                                    org.chromium.mojo.bindings.MessageHeader.MESSAGE_IS_RESPONSE_FLAG,
                                    mRequestId));
            mMessageReceiver.accept(_message);
        }
    }

    static final class AudioDecoderResetParams extends org.chromium.mojo.bindings.Struct {

        private static final int STRUCT_SIZE = 8;
        private static final org.chromium.mojo.bindings.DataHeader[] VERSION_ARRAY = new org.chromium.mojo.bindings.DataHeader[] {new org.chromium.mojo.bindings.DataHeader(8, 0)};
        private static final org.chromium.mojo.bindings.DataHeader DEFAULT_STRUCT_INFO = VERSION_ARRAY[0];

        private AudioDecoderResetParams(int version) {
            super(STRUCT_SIZE, version);
        }

        public AudioDecoderResetParams() {
            this(0);
        }

        public static AudioDecoderResetParams deserialize(org.chromium.mojo.bindings.Message message) {
            return decode(new org.chromium.mojo.bindings.Decoder(message));
        }

        /**
         * Similar to the method above, but deserializes from a |ByteBuffer| instance.
         *
         * @throws org.chromium.mojo.bindings.DeserializationException on deserialization failure.
         */
        public static AudioDecoderResetParams deserialize(java.nio.ByteBuffer data) {
            if (data == null)
                return null;

            return deserialize(new org.chromium.mojo.bindings.Message(
                    data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));
        }

        @SuppressWarnings("unchecked")
        public static AudioDecoderResetParams decode(org.chromium.mojo.bindings.Decoder decoder0) {
            if (decoder0 == null) {
                return null;
            }
            decoder0.increaseStackDepth();
            AudioDecoderResetParams result;
            try {
                org.chromium.mojo.bindings.DataHeader mainDataHeader = decoder0.readAndValidateDataHeader(VERSION_ARRAY);
                result = new AudioDecoderResetParams(mainDataHeader.elementsOrVersion);
            } finally {
                decoder0.decreaseStackDepth();
            }
            return result;
        }

        @SuppressWarnings("unchecked")
        @Override
        protected final void encode(org.chromium.mojo.bindings.Encoder encoder) {
            encoder.getEncoderAtDataOffset(DEFAULT_STRUCT_INFO);
        }

        /**
         * @see Object#equals(Object)
         */
        @Override
        public boolean equals(Object object) {
            if (object == this)
                return true;
            if (object == null)
                return false;
            if (getClass() != object.getClass())
                return false;
            return true;
        }

        /**
         * @see Object#hashCode()
         */
        @Override
        public int hashCode() {
            final int prime = 31;
            int result = prime + getClass().hashCode();
            return result;
        }
    }

    static final class AudioDecoderResetResponseParams extends org.chromium.mojo.bindings.Struct {

        private static final int STRUCT_SIZE = 8;
        private static final org.chromium.mojo.bindings.DataHeader[] VERSION_ARRAY = new org.chromium.mojo.bindings.DataHeader[] {new org.chromium.mojo.bindings.DataHeader(8, 0)};
        private static final org.chromium.mojo.bindings.DataHeader DEFAULT_STRUCT_INFO = VERSION_ARRAY[0];

        private AudioDecoderResetResponseParams(int version) {
            super(STRUCT_SIZE, version);
        }

        public AudioDecoderResetResponseParams() {
            this(0);
        }

        public static AudioDecoderResetResponseParams deserialize(org.chromium.mojo.bindings.Message message) {
            return decode(new org.chromium.mojo.bindings.Decoder(message));
        }

        /**
         * Similar to the method above, but deserializes from a |ByteBuffer| instance.
         *
         * @throws org.chromium.mojo.bindings.DeserializationException on deserialization failure.
         */
        public static AudioDecoderResetResponseParams deserialize(java.nio.ByteBuffer data) {
            if (data == null)
                return null;

            return deserialize(new org.chromium.mojo.bindings.Message(
                    data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));
        }

        @SuppressWarnings("unchecked")
        public static AudioDecoderResetResponseParams decode(org.chromium.mojo.bindings.Decoder decoder0) {
            if (decoder0 == null) {
                return null;
            }
            decoder0.increaseStackDepth();
            AudioDecoderResetResponseParams result;
            try {
                org.chromium.mojo.bindings.DataHeader mainDataHeader = decoder0.readAndValidateDataHeader(VERSION_ARRAY);
                result = new AudioDecoderResetResponseParams(mainDataHeader.elementsOrVersion);
            } finally {
                decoder0.decreaseStackDepth();
            }
            return result;
        }

        @SuppressWarnings("unchecked")
        @Override
        protected final void encode(org.chromium.mojo.bindings.Encoder encoder) {
            encoder.getEncoderAtDataOffset(DEFAULT_STRUCT_INFO);
        }

        /**
         * @see Object#equals(Object)
         */
        @Override
        public boolean equals(Object object) {
            if (object == this)
                return true;
            if (object == null)
                return false;
            if (getClass() != object.getClass())
                return false;
            return true;
        }

        /**
         * @see Object#hashCode()
         */
        @Override
        public int hashCode() {
            final int prime = 31;
            int result = prime + getClass().hashCode();
            return result;
        }
    }

    static class AudioDecoderResetResponseParamsForwardToCallback extends org.chromium.mojo.bindings.SideEffectFreeCloseable
            implements org.chromium.mojo.bindings.MessageReceiver {
        private final AudioDecoder.ResetResponse mCallback;

        AudioDecoderResetResponseParamsForwardToCallback(AudioDecoder.ResetResponse callback) {
            this.mCallback = callback;
        }

        @Override
        public boolean accept(org.chromium.mojo.bindings.Message message) {
            try {
                org.chromium.mojo.bindings.ServiceMessage messageWithHeader =
                        message.asServiceMessage();
                org.chromium.mojo.bindings.MessageHeader header = messageWithHeader.getHeader();
                if (!header.validateHeader(RESET_ORDINAL,
                                           org.chromium.mojo.bindings.MessageHeader.MESSAGE_IS_RESPONSE_FLAG)) {
                    return false;
                }

                mCallback.call();
                return true;
            } catch (org.chromium.mojo.bindings.DeserializationException e) {
                return false;
            }
        }
    }

    static class AudioDecoderResetResponseParamsProxyToResponder implements AudioDecoder.ResetResponse {

        private final org.chromium.mojo.system.Core mCore;
        private final org.chromium.mojo.bindings.MessageReceiver mMessageReceiver;
        private final long mRequestId;

        AudioDecoderResetResponseParamsProxyToResponder(
                org.chromium.mojo.system.Core core,
                org.chromium.mojo.bindings.MessageReceiver messageReceiver,
                long requestId) {
            mCore = core;
            mMessageReceiver = messageReceiver;
            mRequestId = requestId;
        }

        @Override
        public void call() {
            AudioDecoderResetResponseParams _response = new AudioDecoderResetResponseParams();

            org.chromium.mojo.bindings.ServiceMessage _message =
                    _response.serializeWithHeader(
                            mCore,
                            new org.chromium.mojo.bindings.MessageHeader(
                                    RESET_ORDINAL,
                                    org.chromium.mojo.bindings.MessageHeader.MESSAGE_IS_RESPONSE_FLAG,
                                    mRequestId));
            mMessageReceiver.accept(_message);
        }
    }

}


text: piston = Runtime.start('piston','Piston')


text:
'use strict';

chrome.runtime.onInstalled.addListener(
    function createContextItem() {
        chrome.contextMenus.create({
            contexts: ['all'],
            id: 'background_img',
            title: 'Open background image in new tab'
        });
    }
);

chrome.contextMenus.onClicked.addListener(function onContextMenu(info, tab) {
    chrome.tabs.sendMessage(tab.id, '', function onMessageResponse(response) {
        if (!response) {
            return console.error('Failed to find any background image');
        }

        chrome.tabs.create({
            index: tab.index + 1,
            url: response
        });
    });
});


text:
verify.codeFix({
    description: "Change 'function(number?): number' to '(arg0: number) => number'.",
    errorCode: 8020,
    index: 0,
    newRangeContent: "(arg0: number) => number",
});


text:
<?php
$comicname = "Trying Human";
$comiclink = "http://www.tryinghuman.com";
$fileprefix = "thuman";
$filetype = "jpg";
$perpage = "50";
$padamount = "4";
$archivename = "";
?>
<?php include "../include/paged.php"; ?>