text:
package com.hyh.fyp.widget;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.os.Handler;
import android.support.annotation.IntDef;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewTreeObserver;

import com.hyh.common.utils.ViewUtil;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.ref.WeakReference;

/**
 * @author Administrator
 * @description
 * @data 2020/7/21
 */
public class DragViewHelper implements View.OnTouchListener, View.OnAttachStateChangeListener, ViewTreeObserver.OnGlobalLayoutListener {

    public static final int IDLE_MODE_NONE = 0;
    public static final int IDLE_MODE_LEFT_SIDE = 1;
    public static final int IDLE_MODE_RIGHT_SIDE = 2;
    public static final int IDLE_MODE_BOTH_SIDE = 3;

    @IntDef({IDLE_MODE_NONE, IDLE_MODE_LEFT_SIDE, IDLE_MODE_RIGHT_SIDE, IDLE_MODE_BOTH_SIDE})
    @Retention(RetentionPolicy.SOURCE)
    public @interface IdleMode {
    }

    private final WeakReference<View> viewRef;
    private final InitialPosition mInitialPosition;
    private final int mIdleMode;
    private final boolean mHalfHidden;
    private final float mLeftRatio;
    private final int mTouchSlop;
    private final HalfHiddenTask mHalfHiddenTask = new HalfHiddenTask();

    private float mInitialTouchX;
    private float mInitialTouchY;

    private float mLastTranslationX;
    private float mLastTranslationY;

    private boolean mInDragging;

    private float mMinTranslationX;
    private float mMaxTranslationX;
    private float mMinTranslationY;
    private float mMaxTranslationY;

    private boolean mPositionInitialized;

    private boolean mAllowHandleTouch;

    private ObjectAnimator mIdleAnim;

    private DragViewHelper(Builder builder) {
        this.viewRef = new WeakReference<>(builder.view);
        this.mInitialPosition = builder.initialPosition;
        this.mIdleMode = builder.idleMode;
        this.mHalfHidden = builder.halfHidden;
        this.mLeftRatio = builder.leftRatio;
        this.mTouchSlop = ViewConfiguration.get(builder.view.getContext()).getScaledTouchSlop();

        builder.view.setOnTouchListener(this);
        builder.view.addOnAttachStateChangeListener(this);
        if (ViewUtil.isAttachedToWindow(builder.view)) {
            onViewAttachedToWindow(builder.view);
        }
    }

    @Override
    public boolean onTouch(View v, MotionEvent event) {
        int action = event.getActionMasked();
        if (action == MotionEvent.ACTION_DOWN) {
            mHalfHiddenTask.cancel();
            ObjectAnimator idleAnim = mIdleAnim;
            mAllowHandleTouch = idleAnim == null || !idleAnim.isStarted();
        }

        boolean result = false;

        switch (action) {
            case MotionEvent.ACTION_DOWN: {
                mInitialTouchX = event.getRawX();
                mInitialTouchY = event.getRawY();
                float translationX = v.getTranslationX();
                if (translationX < mMinTranslationX) {
                    v.setTranslationX(mMinTranslationX);
                }
                if (translationX > mMaxTranslationX) {
                    v.setTranslationX(mMaxTranslationX);
                }

                mLastTranslationX = v.getTranslationX();
                mLastTranslationY = v.getTranslationY();
                break;
            }
            case MotionEvent.ACTION_MOVE: {
                if (!mAllowHandleTouch) {
                    return false;
                }

                float x = event.getRawX();
                float y = event.getRawY();

                float tx = x - mInitialTouchX;
                float ty = y - mInitialTouchY;

                if (Math.abs(tx) > mTouchSlop || Math.abs(ty) > mTouchSlop) {
                    mInDragging = true;
                }

                if (mInDragging) {
                    float translationX = mLastTranslationX + tx;
                    float translationY = mLastTranslationY + ty;

                    translationX = Math.max(mMinTranslationX, translationX);
                    translationX = Math.min(mMaxTranslationX, translationX);

                    translationY = Math.max(mMinTranslationY, translationY);
                    translationY = Math.min(mMaxTranslationY, translationY);

                    v.setTranslationX(translationX);
                    v.setTranslationY(translationY);
                }
                result = mInDragging;
                break;
            }
            case MotionEvent.ACTION_UP:
            case MotionEvent.ACTION_CANCEL: {
                result = mInDragging;
                mInDragging = false;
                startIdleAnim();
                break;
            }
        }
        return result;
    }

    private void startIdleAnim() {
        View view = viewRef.get();
        if (view == null) return;

        float startTranslation = view.getTranslationX();
        float endTranslation;
        switch (mIdleMode) {
            default:
            case IDLE_MODE_NONE: {
                endTranslation = startTranslation;
                break;
            }
            case IDLE_MODE_LEFT_SIDE: {
                endTranslation = mMinTranslationX;
                break;
            }
            case IDLE_MODE_RIGHT_SIDE: {
                endTranslation = mMaxTranslationX;
                break;
            }
            case IDLE_MODE_BOTH_SIDE: {
                if (startTranslation > (mMaxTranslationX - mMinTranslationX) * 0.5f) {
                    endTranslation = mMaxTranslationX;
                } else {
                    endTranslation = mMinTranslationX;
                }
                break;
            }
        }
        if (startTranslation == endTranslation) {
            mHalfHiddenTask.post();
            return;
        }

        mIdleAnim = ObjectAnimator.ofFloat(view, "translationX", startTranslation, endTranslation)
                .setDuration(300);

        mIdleAnim.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                super.onAnimationEnd(animation);
                mIdleAnim = null;
                mHalfHiddenTask.post();
            }
        });

        mIdleAnim.start();
    }

    @Override
    public void onViewAttachedToWindow(View v) {
        v.getViewTreeObserver().addOnGlobalLayoutListener(this);

        computeBound();

        mHalfHiddenTask.post();
    }

    @Override
    public void onViewDetachedFromWindow(View v) {
        v.getViewTreeObserver().removeOnGlobalLayoutListener(this);
    }

    @Override
    public void onGlobalLayout() {
        computeBound();
    }

    private void computeBound() {
        View view = viewRef.get();
        if (view == null) return;

        View parent = (View) view.getParent();

        mMinTranslationX = -view.getLeft();
        mMaxTranslationX = parent.getWidth() - view.getWidth() - view.getLeft();

        mMinTranslationY = -view.getTop();
        mMaxTranslationY = parent.getHeight() - view.getHeight() - view.getTop();

        setInitialPosition();
    }

    private void setInitialPosition() {
        if (mPositionInitialized) return;
        View view = viewRef.get();
        if (view == null) return;
        if (mInitialPosition != null) {
            View parent = (View) view.getParent();
            if (parent == null) return;
            int width = parent.getWidth();
            int height = parent.getHeight();
            if (width == 0 || height == 0) return;

            mPositionInitialized = true;

            float translationX;
            float translationY;

            int left = view.getLeft();
            int top = view.getTop();

            int gravity = mInitialPosition.gravity;

            final int layoutDirection = view.getLayoutDirection();
            final int absoluteGravity = Gravity.getAbsoluteGravity(gravity, layoutDirection);
            final int horizontalGravity = absoluteGravity & Gravity.HORIZONTAL_GRAVITY_MASK;
            final int verticalGravity = gravity & Gravity.VERTICAL_GRAVITY_MASK;

            switch (horizontalGravity) {
                case Gravity.CENTER_HORIZONTAL: {
                    translationX = -left + (parent.getWidth() - view.getWidth()) * 0.5f;
                    break;
                }
                case Gravity.RIGHT: {
                    translationX = -left + (parent.getWidth() - view.getWidth());
                    break;
                }
                case Gravity.LEFT: {
                    translationX = -left;
                    break;
                }
                default: {
                    translationX = 0;
                    break;
                }
            }
            switch (verticalGravity) {
                case Gravity.TOP: {
                    translationY = -top;
                    break;
                }
                case Gravity.CENTER_VERTICAL: {
                    translationY = -top + (parent.getHeight() - view.getHeight()) * 0.5f;
                    break;
                }
                case Gravity.BOTTOM: {
                    translationY = -top + (parent.getHeight() - view.getHeight());
                    break;
                }
                default: {
                    translationY = 0;
                    break;
                }
            }
            translationX += parent.getWidth() * mInitialPosition.horizontalBias;
            translationY += parent.getHeight() * mInitialPosition.verticalBias;

            view.setTranslationX(translationX);
            view.setTranslationY(translationY);
        }
    }

    private class HalfHiddenTask implements Runnable {

        @Override
        public void run() {
            View view = viewRef.get();
            if (view == null) return;

            float startTranslationX = view.getTranslationX();
            float endTranslationX = startTranslationX;
            if (startTranslationX == mMinTranslationX) {
                endTranslationX = startTranslationX - view.getWidth() * mLeftRatio;
            } else if (startTranslationX == mMaxTranslationX) {
                endTranslationX = startTranslationX + view.getWidth() * (1 - mLeftRatio);
            }
            if (startTranslationX == endTranslationX) {
                return;
            }

            ObjectAnimator animator = ObjectAnimator.ofFloat(view, "translationX", startTranslationX, endTranslationX)
                    .setDuration(300);
            animator.start();
        }

        void post() {
            if (!mHalfHidden) return;
            View view = viewRef.get();
            if (view == null) return;
            Handler handler = view.getHandler();
            if (handler == null) return;
            handler.postDelayed(this, 3000);
        }

        void cancel() {
            View view = viewRef.get();
            if (view == null) return;
            Handler handler = view.getHandler();
            if (handler == null) return;
            handler.removeCallbacks(this);
        }
    }

    public static class InitialPosition {

        public int gravity;

        public float horizontalBias;

        public float verticalBias;

        public InitialPosition(int gravity, float horizontalBias, float verticalBias) {
            this.gravity = gravity;
            this.horizontalBias = horizontalBias;
            this.verticalBias = verticalBias;
        }
    }

    public static class Builder {

        private View view;
        private InitialPosition initialPosition;
        private int idleMode;
        private boolean halfHidden;
        private float leftRatio;

        public Builder(View view) {
            this.view = view;
        }

        public Builder initialPosition(InitialPosition initialPosition) {
            this.initialPosition = initialPosition;
            return this;
        }

        public Builder idleMode(@IdleMode int idleMode) {
            this.idleMode = idleMode;
            return this;
        }

        public Builder halfHidden(boolean halfHidden) {
            this.halfHidden = halfHidden;
            return this;
        }

        public Builder leftRatio(float leftRatio) {
            this.leftRatio = leftRatio;
            return this;
        }

        public DragViewHelper build() {
            return new DragViewHelper(this);
        }
    }
}


text:
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}

module Language.Fold where

class Fold f t r | f t -> r where
    fold :: f -> t -> r

redpajama_set_name: RedPajamaGithub


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

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"
><TITLE
>Qtc.Gui.QTextOption</TITLE
><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css"
>

Qtc.Gui.QTextOption

class QqTextOption x1

class QqTextOption_nf x1

class Qalignment x1

class Qflags x1 xr

class QsetAlignment x1 xr

class QsetFlags x1

setTabArray

setTabStop

class QsetTextDirection x1

class QsetUseDesignMetrics x1

setWrapMode

tabArray

tabStop

class QtextDirection x1 xr

class QuseDesignMetrics x1

wrapMode

qTextOption_delete


text:
/*
Theme Name: Pixova-lite
Description: Adds support for languages written in a Right To Left (RTL) direction.
It's easy, just a matter of overwriting all the horizontal positioning attributes
of your CSS stylesheet in a separate stylesheet file named rtl.css.

See: https://codex.wordpress.org/Right_to_Left_Language_Support
*/

body {
	direction: rtl;
	unicode-bidi: embed;
}


text:
<?php

// Warning! This code was generated by WSDL2PHP tool.
// author: Filippov Andrey <afi.work@gmail.com>
// see https://solo-framework-lib.googlecode.com

namespace Moneta\Types;

/**
 * Ответ на запрос создания документа в профиле.
	 * Response to CreateProfileDocumentRequest.
	 *
 */
class CreateProfileDocumentResponse
{

	/**
	 * Идентификатор документа в системе МОНЕТА.РУ.
	 * Unique identifier of the document in MONETA.RU.
	 *
	 *
	 * @var long
	 */
	 public $id = null;

}


text:
from __future__ import absolute_import
import sys
import warnings

from google.cloud.devtools.resultstore.v2 import types
from google.cloud.devtools.resultstore.v2.gapic import enums
from google.cloud.devtools.resultstore.v2.gapic import result_store_download_client
from google.cloud.devtools.resultstore.v2.gapic import result_store_file_download_client
from google.cloud.devtools.resultstore.v2.gapic import result_store_upload_client

if sys.version_info[:2] == (2, 7):
    message = (
        'A future version of this library will drop support for Python 2.7.'
        'More details about Python 2 support for Google Cloud Client Libraries'
        'can be found at https://cloud.google.com/python/docs/python2-sunset/'
    )
    warnings.warn(message, DeprecationWarning)

class ResultStoreDownloadClient(result_store_download_client.ResultStoreDownloadClient):
    __doc__ = result_store_download_client.ResultStoreDownloadClient.__doc__
    enums = enums

class ResultStoreFileDownloadClient(result_store_file_download_client.ResultStoreFileDownloadClient):
    __doc__ = result_store_file_download_client.ResultStoreFileDownloadClient.__doc__
    enums = enums

class ResultStoreUploadClient(result_store_upload_client.ResultStoreUploadClient):
    __doc__ = result_store_upload_client.ResultStoreUploadClient.__doc__
    enums = enums

__all__ = (
    'enums',
    'types',
    'ResultStoreDownloadClient',
    'ResultStoreFileDownloadClient',
    'ResultStoreUploadClient',
)


text:
package org.apache.nifi.processors.aws.dynamodb;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.apache.nifi.processors.aws.dynamodb.ITAbstractDynamoDBTest.REGION;
import static org.apache.nifi.processors.aws.dynamodb.ITAbstractDynamoDBTest.stringHashStringRangeTableName;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.nifi.util.MockFlowFile;
import org.apache.nifi.util.TestRunner;
import org.apache.nifi.util.TestRunners;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentMatchers;
import org.mockito.Mockito;

import com.amazonaws.AmazonClientException;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.regions.Regions;
import com.amazonaws.services.dynamodbv2.document.BatchGetItemOutcome;
import com.amazonaws.services.dynamodbv2.document.DynamoDB;
import com.amazonaws.services.dynamodbv2.document.TableKeysAndAttributes;
import com.amazonaws.services.dynamodbv2.model.AttributeValue;
import com.amazonaws.services.dynamodbv2.model.BatchGetItemResult;
import com.amazonaws.services.dynamodbv2.model.KeysAndAttributes;

public class GetDynamoDBTest extends AbstractDynamoDBTest {
    protected GetDynamoDB getDynamoDB;
    protected BatchGetItemOutcome outcome;
    protected BatchGetItemResult result = new BatchGetItemResult();
    private HashMap unprocessed;

    @Before
    public void setUp() {
        outcome = new BatchGetItemOutcome(result);
        KeysAndAttributes kaa = new KeysAndAttributes();
        Map<String,AttributeValue> map = new HashMap<>();
        map.put("hashS", new AttributeValue("h1"));
        map.put("rangeS", new AttributeValue("r1"));
        kaa.withKeys(map);
        unprocessed = new HashMap<>();
        unprocessed.put(stringHashStringRangeTableName, kaa);

        result.withUnprocessedKeys(unprocessed);

        Map<String,List<Map<String,AttributeValue>>> responses = new HashMap<>();
        List<Map<String,AttributeValue>> items = new ArrayList<>();
        responses.put("StringHashStringRangeTable", items);
        result.withResponses(responses);

        final DynamoDB mockDynamoDB = new DynamoDB(Regions.AP_NORTHEAST_1) {

            @Override
            public BatchGetItemOutcome batchGetItem(TableKeysAndAttributes... tableKeysAndAttributes) {
                return outcome;
            }

        };

        getDynamoDB = new GetDynamoDB() {
            @Override
            protected DynamoDB getDynamoDB() {
                return mockDynamoDB;
            }
        };

    }

    @Test
    public void testStringHashStringRangeGetUnprocessed() {
        final TestRunner getRunner = TestRunners.newTestRunner(getDynamoDB);

        getRunner.setProperty(AbstractDynamoDBProcessor.ACCESS_KEY,"abcd");
        getRunner.setProperty(AbstractDynamoDBProcessor.SECRET_KEY, "cdef");
        getRunner.setProperty(AbstractDynamoDBProcessor.REGION, REGION);
        getRunner.setProperty(AbstractDynamoDBProcessor.TABLE, stringHashStringRangeTableName);
        getRunner.setProperty(AbstractDynamoDBProcessor.RANGE_KEY_NAME, "rangeS");
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_NAME, "hashS");
        getRunner.setProperty(AbstractDynamoDBProcessor.RANGE_KEY_VALUE, "r1");
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_VALUE, "h1");
        getRunner.setProperty(AbstractDynamoDBProcessor.JSON_DOCUMENT, "j1");
        getRunner.enqueue(new byte[] {});

        getRunner.run(1);

        getRunner.assertAllFlowFilesTransferred(AbstractDynamoDBProcessor.REL_UNPROCESSED, 1);

        List<MockFlowFile> flowFiles = getRunner.getFlowFilesForRelationship(AbstractDynamoDBProcessor.REL_UNPROCESSED);
        for (MockFlowFile flowFile : flowFiles) {
            assertNotNull(flowFile.getAttribute(AbstractDynamoDBProcessor.DYNAMODB_KEY_ERROR_UNPROCESSED));
        }

    }

    @Test
    public void testStringHashStringRangeGetJsonObjectNull() {
        outcome = new BatchGetItemOutcome(result);
        KeysAndAttributes kaa = new KeysAndAttributes();
        Map<String,AttributeValue> map = new HashMap<>();
        map.put("hashS", new AttributeValue("h1"));
        map.put("rangeS", new AttributeValue("r1"));
        kaa.withKeys(map);
        unprocessed = new HashMap<>();
        result.withUnprocessedKeys(unprocessed);

        Map<String,List<Map<String,AttributeValue>>> responses = new HashMap<>();
        List<Map<String,AttributeValue>> items = new ArrayList<>();
        Map<String,AttributeValue> item = new HashMap<String,AttributeValue>();
        item.put("j1",null);
        item.put("hashS", new AttributeValue("h1"));
        item.put("rangeS", new AttributeValue("r1"));
        items.add(item);
        responses.put("StringHashStringRangeTable", items);
        result.withResponses(responses);

        final DynamoDB mockDynamoDB = new DynamoDB(Regions.AP_NORTHEAST_1) {

            @Override
            public BatchGetItemOutcome batchGetItem(TableKeysAndAttributes... tableKeysAndAttributes) {
                return outcome;
            }

        };

        getDynamoDB = new GetDynamoDB() {
            @Override
            protected DynamoDB getDynamoDB() {
                return mockDynamoDB;
            }
        };
        final TestRunner getRunner = TestRunners.newTestRunner(getDynamoDB);

        getRunner.setProperty(AbstractDynamoDBProcessor.ACCESS_KEY,"abcd");
        getRunner.setProperty(AbstractDynamoDBProcessor.SECRET_KEY, "cdef");
        getRunner.setProperty(AbstractDynamoDBProcessor.REGION, REGION);
        getRunner.setProperty(AbstractDynamoDBProcessor.TABLE, stringHashStringRangeTableName);
        getRunner.setProperty(AbstractDynamoDBProcessor.RANGE_KEY_NAME, "rangeS");
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_NAME, "hashS");
        getRunner.setProperty(AbstractDynamoDBProcessor.RANGE_KEY_VALUE, "r1");
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_VALUE, "h1");
        getRunner.setProperty(AbstractDynamoDBProcessor.JSON_DOCUMENT, "j1");
        getRunner.enqueue(new byte[] {});

        getRunner.run(1);

        getRunner.assertAllFlowFilesTransferred(AbstractDynamoDBProcessor.REL_SUCCESS, 1);

        List<MockFlowFile> flowFiles = getRunner.getFlowFilesForRelationship(AbstractDynamoDBProcessor.REL_SUCCESS);
        for (MockFlowFile flowFile : flowFiles) {
            assertNull(flowFile.getContentClaim());
        }

    }

    @Test
    public void testStringHashStringRangeGetJsonObjectValid() throws IOException {
        outcome = new BatchGetItemOutcome(result);
        KeysAndAttributes kaa = new KeysAndAttributes();
        Map<String,AttributeValue> map = new HashMap<>();
        map.put("hashS", new AttributeValue("h1"));
        map.put("rangeS", new AttributeValue("r1"));
        kaa.withKeys(map);
        unprocessed = new HashMap<>();
        result.withUnprocessedKeys(unprocessed);

        Map<String,List<Map<String,AttributeValue>>> responses = new HashMap<>();
        List<Map<String,AttributeValue>> items = new ArrayList<>();
        Map<String,AttributeValue> item = new HashMap<String,AttributeValue>();
        String jsonDocument = "{\"name\": \"john\"}";
        item.put("j1",new AttributeValue(jsonDocument));
        item.put("hashS", new AttributeValue("h1"));
        item.put("rangeS", new AttributeValue("r1"));
        items.add(item);
        responses.put("StringHashStringRangeTable", items);
        result.withResponses(responses);

        final DynamoDB mockDynamoDB = new DynamoDB(Regions.AP_NORTHEAST_1) {

            @Override
            public BatchGetItemOutcome batchGetItem(TableKeysAndAttributes... tableKeysAndAttributes) {
                return outcome;
            }

        };

        getDynamoDB = new GetDynamoDB() {
            @Override
            protected DynamoDB getDynamoDB() {
                return mockDynamoDB;
            }
        };
        final TestRunner getRunner = TestRunners.newTestRunner(getDynamoDB);

        getRunner.setProperty(AbstractDynamoDBProcessor.ACCESS_KEY,"abcd");
        getRunner.setProperty(AbstractDynamoDBProcessor.SECRET_KEY, "cdef");
        getRunner.setProperty(AbstractDynamoDBProcessor.REGION, REGION);
        getRunner.setProperty(AbstractDynamoDBProcessor.TABLE, stringHashStringRangeTableName);
        getRunner.setProperty(AbstractDynamoDBProcessor.RANGE_KEY_NAME, "rangeS");
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_NAME, "hashS");
        getRunner.setProperty(AbstractDynamoDBProcessor.RANGE_KEY_VALUE, "r1");
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_VALUE, "h1");
        getRunner.setProperty(AbstractDynamoDBProcessor.JSON_DOCUMENT, "j1");
        getRunner.enqueue(new byte[] {});

        getRunner.run(1);
        getRunner.assertAllFlowFilesTransferred(AbstractDynamoDBProcessor.REL_SUCCESS, 1);
    }

    @Test
    public void testStringHashStringRangeGetThrowsServiceException() {
        final DynamoDB mockDynamoDB = new DynamoDB(Regions.AP_NORTHEAST_1) {

            @Override
            public BatchGetItemOutcome batchGetItem(TableKeysAndAttributes... tableKeysAndAttributes) {
                throw new AmazonServiceException("serviceException");
            }

        };

        final GetDynamoDB getDynamoDB = new GetDynamoDB() {
            @Override
            protected DynamoDB getDynamoDB() {
                return mockDynamoDB;
            }
        };

        final TestRunner getRunner = TestRunners.newTestRunner(getDynamoDB);

        getRunner.setProperty(AbstractDynamoDBProcessor.ACCESS_KEY,"abcd");
        getRunner.setProperty(AbstractDynamoDBProcessor.SECRET_KEY, "cdef");
        getRunner.setProperty(AbstractDynamoDBProcessor.REGION, REGION);
        getRunner.setProperty(AbstractDynamoDBProcessor.TABLE, stringHashStringRangeTableName);
        getRunner.setProperty(AbstractDynamoDBProcessor.RANGE_KEY_NAME, "rangeS");
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_NAME, "hashS");
        getRunner.setProperty(AbstractDynamoDBProcessor.RANGE_KEY_VALUE, "r1");
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_VALUE, "h1");
        getRunner.setProperty(AbstractDynamoDBProcessor.JSON_DOCUMENT, "j1");
        getRunner.enqueue(new byte[] {});

        getRunner.run(1);

        getRunner.assertAllFlowFilesTransferred(AbstractDynamoDBProcessor.REL_FAILURE, 1);
        List<MockFlowFile> flowFiles = getRunner.getFlowFilesForRelationship(AbstractDynamoDBProcessor.REL_FAILURE);
        for (MockFlowFile flowFile : flowFiles) {
            assertEquals("serviceException (Service: null; Status Code: 0; Error Code: null; Request ID: null)", flowFile.getAttribute(AbstractDynamoDBProcessor.DYNAMODB_ERROR_EXCEPTION_MESSAGE));
        }

    }

    @Test
    public void testStringHashStringRangeGetThrowsRuntimeException() {
        final DynamoDB mockDynamoDB = new DynamoDB(Regions.AP_NORTHEAST_1) {

            @Override
            public BatchGetItemOutcome batchGetItem(TableKeysAndAttributes... tableKeysAndAttributes) {
                throw new RuntimeException("runtimeException");
            }

        };

        final GetDynamoDB getDynamoDB = new GetDynamoDB() {
            @Override
            protected DynamoDB getDynamoDB() {
                return mockDynamoDB;
            }
        };

        final TestRunner getRunner = TestRunners.newTestRunner(getDynamoDB);

        getRunner.setProperty(AbstractDynamoDBProcessor.ACCESS_KEY,"abcd");
        getRunner.setProperty(AbstractDynamoDBProcessor.SECRET_KEY, "cdef");
        getRunner.setProperty(AbstractDynamoDBProcessor.REGION, REGION);
        getRunner.setProperty(AbstractDynamoDBProcessor.TABLE, stringHashStringRangeTableName);
        getRunner.setProperty(AbstractDynamoDBProcessor.RANGE_KEY_NAME, "rangeS");
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_NAME, "hashS");
        getRunner.setProperty(AbstractDynamoDBProcessor.RANGE_KEY_VALUE, "r1");
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_VALUE, "h1");
        getRunner.setProperty(AbstractDynamoDBProcessor.JSON_DOCUMENT, "j1");
        getRunner.enqueue(new byte[] {});

        getRunner.run(1);

        getRunner.assertAllFlowFilesTransferred(AbstractDynamoDBProcessor.REL_FAILURE, 1);
        List<MockFlowFile> flowFiles = getRunner.getFlowFilesForRelationship(AbstractDynamoDBProcessor.REL_FAILURE);
        for (MockFlowFile flowFile : flowFiles) {
            assertEquals("runtimeException", flowFile.getAttribute(AbstractDynamoDBProcessor.DYNAMODB_ERROR_EXCEPTION_MESSAGE));
        }

    }

    @Test
    public void testStringHashStringRangeGetThrowsClientException() {
        final DynamoDB mockDynamoDB = new DynamoDB(Regions.AP_NORTHEAST_1) {

            @Override
            public BatchGetItemOutcome batchGetItem(TableKeysAndAttributes... tableKeysAndAttributes) {
                throw new AmazonClientException("clientException");
            }

        };

        final GetDynamoDB getDynamoDB = new GetDynamoDB() {
            @Override
            protected DynamoDB getDynamoDB() {
                return mockDynamoDB;
            }
        };

        final TestRunner getRunner = TestRunners.newTestRunner(getDynamoDB);

        getRunner.setProperty(AbstractDynamoDBProcessor.ACCESS_KEY,"abcd");
        getRunner.setProperty(AbstractDynamoDBProcessor.SECRET_KEY, "cdef");
        getRunner.setProperty(AbstractDynamoDBProcessor.REGION, REGION);
        getRunner.setProperty(AbstractDynamoDBProcessor.TABLE, stringHashStringRangeTableName);
        getRunner.setProperty(AbstractDynamoDBProcessor.RANGE_KEY_NAME, "rangeS");
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_NAME, "hashS");
        getRunner.setProperty(AbstractDynamoDBProcessor.RANGE_KEY_VALUE, "r1");
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_VALUE, "h1");
        getRunner.setProperty(AbstractDynamoDBProcessor.JSON_DOCUMENT, "j1");
        getRunner.enqueue(new byte[] {});

        getRunner.run(1);

        getRunner.assertAllFlowFilesTransferred(AbstractDynamoDBProcessor.REL_FAILURE, 1);
        List<MockFlowFile> flowFiles = getRunner.getFlowFilesForRelationship(AbstractDynamoDBProcessor.REL_FAILURE);
        for (MockFlowFile flowFile : flowFiles) {
            assertEquals("clientException", flowFile.getAttribute(AbstractDynamoDBProcessor.DYNAMODB_ERROR_EXCEPTION_MESSAGE));
        }

    }

    @Test
    public void testStringHashStringRangeGetNotFound() {
        result.clearResponsesEntries();
        result.clearUnprocessedKeysEntries();

        final BatchGetItemOutcome notFoundOutcome = new BatchGetItemOutcome(result);
        Map<String,List<Map<String,AttributeValue>>> responses = new HashMap<>();
        List<Map<String,AttributeValue>> items = new ArrayList<>();
        responses.put(stringHashStringRangeTableName, items);
        result.withResponses(responses);

        final DynamoDB notFoundMockDynamoDB = new DynamoDB(Regions.AP_NORTHEAST_1) {
            @Override
            public BatchGetItemOutcome batchGetItem(TableKeysAndAttributes... tableKeysAndAttributes) {
                return notFoundOutcome;
            }
        };

        final GetDynamoDB getDynamoDB = new GetDynamoDB() {
            @Override
            protected DynamoDB getDynamoDB() {
                return notFoundMockDynamoDB;
            }
        };
        final TestRunner getRunner = TestRunners.newTestRunner(getDynamoDB);

        getRunner.setProperty(AbstractDynamoDBProcessor.ACCESS_KEY,"abcd");
        getRunner.setProperty(AbstractDynamoDBProcessor.SECRET_KEY, "cdef");
        getRunner.setProperty(AbstractDynamoDBProcessor.REGION, REGION);
        getRunner.setProperty(AbstractDynamoDBProcessor.TABLE, stringHashStringRangeTableName);
        getRunner.setProperty(AbstractDynamoDBProcessor.RANGE_KEY_NAME, "rangeS");
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_NAME, "hashS");
        getRunner.setProperty(AbstractDynamoDBProcessor.RANGE_KEY_VALUE, "r1");
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_VALUE, "h1");
        getRunner.setProperty(AbstractDynamoDBProcessor.JSON_DOCUMENT, "j1");
        getRunner.enqueue(new byte[] {});

        getRunner.run(1);

        getRunner.assertAllFlowFilesTransferred(GetDynamoDB.REL_NOT_FOUND, 1);

        List<MockFlowFile> flowFiles = getRunner.getFlowFilesForRelationship(AbstractDynamoDBProcessor.REL_UNPROCESSED);
        for (MockFlowFile flowFile : flowFiles) {
            assertNotNull(flowFile.getAttribute(AbstractDynamoDBProcessor.DYNAMODB_KEY_ERROR_NOT_FOUND));
        }

    }

    @Test
    public void testStringHashStringRangeGetOnlyHashFailure() {
        // Inject a mock DynamoDB to create the exception condition
        final DynamoDB mockDynamoDb = Mockito.mock(DynamoDB.class);
        // When writing, mock thrown service exception from AWS
        Mockito.when(mockDynamoDb.batchGetItem(ArgumentMatchers.<TableKeysAndAttributes>any())).thenThrow(getSampleAwsServiceException());

        getDynamoDB = new GetDynamoDB() {
            @Override
            protected DynamoDB getDynamoDB() {
                return mockDynamoDb;
            }
        };

        final TestRunner getRunner = TestRunners.newTestRunner(getDynamoDB);

        getRunner.setProperty(AbstractDynamoDBProcessor.ACCESS_KEY,"abcd");
        getRunner.setProperty(AbstractDynamoDBProcessor.SECRET_KEY, "cdef");
        getRunner.setProperty(AbstractDynamoDBProcessor.REGION, REGION);
        getRunner.setProperty(AbstractDynamoDBProcessor.TABLE, stringHashStringRangeTableName);
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_NAME, "hashS");
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_VALUE, "h1");
        getRunner.setProperty(AbstractDynamoDBProcessor.JSON_DOCUMENT, "j1");
        getRunner.enqueue(new byte[] {});

        getRunner.run(1);

        getRunner.assertAllFlowFilesTransferred(AbstractDynamoDBProcessor.REL_FAILURE, 1);

        List<MockFlowFile> flowFiles = getRunner.getFlowFilesForRelationship(AbstractDynamoDBProcessor.REL_FAILURE);
        for (MockFlowFile flowFile : flowFiles) {
            ITAbstractDynamoDBTest.validateServiceExceptionAttribute(flowFile);
        }

    }

    @Test
    public void testStringHashStringRangeGetNoHashValueFailure() {
        final TestRunner getRunner = TestRunners.newTestRunner(GetDynamoDB.class);

        getRunner.setProperty(AbstractDynamoDBProcessor.ACCESS_KEY,"abcd");
        getRunner.setProperty(AbstractDynamoDBProcessor.SECRET_KEY, "cdef");
        getRunner.setProperty(AbstractDynamoDBProcessor.REGION, REGION);
        getRunner.setProperty(AbstractDynamoDBProcessor.TABLE, stringHashStringRangeTableName);
        getRunner.setProperty(AbstractDynamoDBProcessor.RANGE_KEY_NAME, "rangeS");
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_NAME, "hashS");
        getRunner.setProperty(AbstractDynamoDBProcessor.RANGE_KEY_VALUE, "r1");
        getRunner.setProperty(AbstractDynamoDBProcessor.JSON_DOCUMENT, "j1");
        getRunner.enqueue(new byte[] {});

        getRunner.run(1);

        getRunner.assertAllFlowFilesTransferred(AbstractDynamoDBProcessor.REL_FAILURE, 1);

        List<MockFlowFile> flowFiles = getRunner.getFlowFilesForRelationship(AbstractDynamoDBProcessor.REL_FAILURE);
        for (MockFlowFile flowFile : flowFiles) {
            assertNotNull(flowFile.getAttribute(AbstractDynamoDBProcessor.DYNAMODB_HASH_KEY_VALUE_ERROR));
        }

    }

    @Test
    public void testStringHashStringRangeGetOnlyHashWithRangeValueNoRangeNameFailure() {
        final TestRunner getRunner = TestRunners.newTestRunner(GetDynamoDB.class);

        getRunner.setProperty(AbstractDynamoDBProcessor.ACCESS_KEY,"abcd");
        getRunner.setProperty(AbstractDynamoDBProcessor.SECRET_KEY, "cdef");
        getRunner.setProperty(AbstractDynamoDBProcessor.REGION, REGION);
        getRunner.setProperty(AbstractDynamoDBProcessor.TABLE, stringHashStringRangeTableName);
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_NAME, "hashS");
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_VALUE, "h1");
        getRunner.setProperty(AbstractDynamoDBProcessor.RANGE_KEY_VALUE, "r1");
        getRunner.setProperty(AbstractDynamoDBProcessor.JSON_DOCUMENT, "j1");
        getRunner.enqueue(new byte[] {});

        getRunner.run(1);

        getRunner.assertAllFlowFilesTransferred(AbstractDynamoDBProcessor.REL_FAILURE, 1);

        List<MockFlowFile> flowFiles = getRunner.getFlowFilesForRelationship(AbstractDynamoDBProcessor.REL_FAILURE);
        for (MockFlowFile flowFile : flowFiles) {
            assertNotNull(flowFile.getAttribute(AbstractDynamoDBProcessor.DYNAMODB_RANGE_KEY_VALUE_ERROR));
        }

    }

    @Test
    public void testStringHashStringRangeGetOnlyHashWithRangeNameNoRangeValueFailure() {
        final TestRunner getRunner = TestRunners.newTestRunner(GetDynamoDB.class);

        getRunner.setProperty(AbstractDynamoDBProcessor.ACCESS_KEY,"abcd");
        getRunner.setProperty(AbstractDynamoDBProcessor.SECRET_KEY, "cdef");
        getRunner.setProperty(AbstractDynamoDBProcessor.REGION, REGION);
        getRunner.setProperty(AbstractDynamoDBProcessor.TABLE, stringHashStringRangeTableName);
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_NAME, "hashS");
        getRunner.setProperty(AbstractDynamoDBProcessor.RANGE_KEY_NAME, "rangeS");
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_VALUE, "h1");
        getRunner.setProperty(AbstractDynamoDBProcessor.JSON_DOCUMENT, "j1");
        getRunner.enqueue(new byte[] {});

        getRunner.run(1);

        getRunner.assertAllFlowFilesTransferred(AbstractDynamoDBProcessor.REL_FAILURE, 1);

        List<MockFlowFile> flowFiles = getRunner.getFlowFilesForRelationship(AbstractDynamoDBProcessor.REL_FAILURE);
        for (MockFlowFile flowFile : flowFiles) {
            assertNotNull(flowFile.getAttribute(AbstractDynamoDBProcessor.DYNAMODB_RANGE_KEY_VALUE_ERROR));
        }
    }

    // Incorporated test from James W
    @Test
    public void testStringHashStringNoRangeGetUnprocessed() {
        unprocessed.clear();
        KeysAndAttributes kaa = new KeysAndAttributes();
        Map<String,AttributeValue> map = new HashMap<>();
        map.put("hashS", new AttributeValue("h1"));
        kaa.withKeys(map);
        unprocessed.put(stringHashStringRangeTableName, kaa);

        final TestRunner getRunner = TestRunners.newTestRunner(getDynamoDB);

        getRunner.setProperty(AbstractDynamoDBProcessor.ACCESS_KEY,"abcd");
        getRunner.setProperty(AbstractDynamoDBProcessor.SECRET_KEY, "cdef");
        getRunner.setProperty(AbstractDynamoDBProcessor.REGION, REGION);
        getRunner.setProperty(AbstractDynamoDBProcessor.TABLE, stringHashStringRangeTableName);
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_NAME, "hashS");
        getRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_VALUE, "h1");
        getRunner.setProperty(AbstractDynamoDBProcessor.JSON_DOCUMENT, "j1");
        getRunner.enqueue(new byte[] {});

        getRunner.run(1);

        getRunner.assertAllFlowFilesTransferred(AbstractDynamoDBProcessor.REL_UNPROCESSED, 1);

        List<MockFlowFile> flowFiles = getRunner.getFlowFilesForRelationship(AbstractDynamoDBProcessor.REL_UNPROCESSED);
        for (MockFlowFile flowFile : flowFiles) {
            assertNotNull(flowFile.getAttribute(AbstractDynamoDBProcessor.DYNAMODB_KEY_ERROR_UNPROCESSED));
        }
    }
}


text:
* Theme: **Entire Game on One Screen**
* Framework: [Phaser.js](http://phaser.io)
* Starting code: Phaser's Full Screen Mobile Template
* Trying for the compo, but may go jam if I run out of time or need to borrow some art

## Initial Ideas

* Turn-based strategy/puzzler, maybe something roguelike
* Runs on iPad or in the web browser (probably too tiny for phone)
* Targeting 4:3 aspect ratio, 1024x768
* Gotta pack a lot into the one screen, so we need the real estate!
* Tile-based, of course, because that's just how I roll
* Me do the artwork? Scary. Gonna start pretty simple.
* Thinking some kind of roguelike with a single screen world.
* Regenerate on each playthrough.
* Go for the best score? Or maybe just try to survive? Hmm.

## Friday @ 11pm

* Got the boilerplate uploaded, running on iPad, etc.
* Popping into Photoshop for some idea mongering.
* Created a grid of 88x88 tiles to test tap target sizes.
* Wired up some basic tap logic so I can get a feel for the iPad.

## Saturday @ 1am

* Calling it a night (because I'm falling asleep while thinking).
* Widescreen gives me 14x8 whole tiles with a bit leftover.
* Gonna chew on that while sleeping.

## Saturday @ 9am

* Playing in photoshop with mockups.

## Saturday @ noon

* Continuing to play with mockups. Nothing sticking so far.
* Starting to explore mockup2, something totally different.
* Tossing the notion of a grid. Going much more loosey goosey.


text:
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE pov SYSTEM "/usr/share/cgc-docs/replay.dtd">
<pov>
	<cbid>CROMU_00001</cbid>
	<replay>
		<read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>username: </data></match></read>
		<write echo="ascii"><data>yyeuktz\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>username: </data></match></read>
		<write echo="ascii"><data>mchjlcz\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>username: </data></match></read>
		<write echo="ascii"><data>dmgdbrr\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>username: </data></match></read>
		<write echo="ascii"><data>hndqvda\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>username: </data></match></read>
		<write echo="ascii"><data>rarwpsg\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>username: </data></match></read>
		<write echo="ascii"><data>hzgkjno\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>username: </data></match></read>
		<write echo="ascii"><data>lhtrwrc\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>2\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>username: </data></match></read>
		<write echo="ascii"><data>rarwpsg\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>Login Success\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>To: </data></match></read>
		<write echo="ascii"><data>yyeuktz\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>Message: </data></match></read>
		<write echo="ascii"><data>ayzncdmwjrq\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>To: </data></match></read>
		<write echo="ascii"><data>rarwpsg\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>Message: </data></match></read>
		<write echo="ascii"><data>mlbrgrqvvippukt\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>Unread messages:\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>***********************************\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>1:  mlbrgrqvvippukt\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>***********************************\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>To: </data></match></read>
		<write echo="ascii"><data>hndqvda\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>Message: </data></match></read>
		<write echo="ascii"><data>pdgvplkzhmjwnuxenuwvubmyoz\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>To: </data></match></read>
		<write echo="ascii"><data>hndqvda\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>Message: </data></match></read>
		<write echo="ascii"><data>qckylbrzipdrnq\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>2\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>ID: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>***********************************\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>1:  mlbrgrqvvippukt\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>***********************************\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>5\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>Logging out...\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>2\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>username: </data></match></read>
		<write echo="ascii"><data>hndqvda\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>Login Success\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>Unread messages:\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>***********************************\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>1:  pdgvplkzhmjwnuxenuwvubmyoz\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>***********************************\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>***********************************\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2:  qckylbrzipdrnq\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>***********************************\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>To: </data></match></read>
		<write echo="ascii"><data>hndqvda\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>Message: </data></match></read>
		<write echo="ascii"><data>ertkvnlqsrnvlutujebzbx\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>Unread messages:\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>***********************************\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3:  ertkvnlqsrnvlutujebzbx\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>***********************************\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>5\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>Logging out...\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>2\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>username: </data></match></read>
		<write echo="ascii"><data>lhtrwrc\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>Login Success\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>To: </data></match></read>
		<write echo="ascii"><data>dmgdbrr\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>Message: </data></match></read>
		<write echo="ascii"><data>qgrwqoxnalnxepxygzqyicypntci\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>To: </data></match></read>
		<write echo="ascii"><data>yyeuktz\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>Message: </data></match></read>
		<write echo="ascii"><data>jmeix\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>To: </data></match></read>
		<write echo="ascii"><data>rarwpsg\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>Message: </data></match></read>
		<write echo="ascii"><data>tpfsacfakiwlljgk\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>To: </data></match></read>
		<write echo="ascii"><data>dmgdbrr\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>Message: </data></match></read>
		<write echo="ascii"><data>xijdyokyxnatnqrdobm\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>To: </data></match></read>
		<write echo="ascii"><data>hzgkjno\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>Message: </data></match></read>
		<write echo="ascii"><data>lnhttqjslrswgttmzmm\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>5\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>Logging out...\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>2\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>username: </data></match></read>
		<write echo="ascii"><data>rarwpsg\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>Login Success\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>Unread messages:\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>***********************************\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2:  tpfsacfakiwlljgk\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>***********************************\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>To: </data></match></read>
		<write echo="ascii"><data>dmgdbrr\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>Message: </data></match></read>
		<write echo="ascii"><data>ervas\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>To: </data></match></read>
		<write echo="ascii"><data>hndqvda\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>Message: </data></match></read>
		<write echo="ascii"><data>jipejxospkjuhojsn\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>6\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>Exiting...\n</data></match></read>
	</replay>
</pov>


text:
package com.planet_ink.coffee_mud.Abilities.Thief;

import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;

import java.util.*;

public class Thief_Racketeer extends ThiefSkill
{
	@Override
	public int classificationCode()
	{
		return Ability.ACODE_THIEF_SKILL|Ability.DOMAIN_CRIMINAL;
	}

	@Override
	public String ID()
	{
		return "Thief_Racketeer";
	}

	@Override
	public String name()
	{
		return "Racketeer";
	}

	@Override
	public String displayText()
	{
		return "";
	}

	@Override
	protected int canAffectCode()
	{
		return CAN_MOBS;
	}

	@Override
	protected int canTargetCode()
	{
		return CAN_MOBS;
	}

	@Override
	public int abstractQuality()
	{
		return Ability.QUALITY_MALICIOUS;
	}

	private static final String[] triggerStrings={"RACKETEER"};

	@Override
	public String[] triggerStrings()
	{
		return triggerStrings;
	}

	@Override
	public long flags()
	{
		return super.flags() | Ability.FLAG_STEALING;
	}

	@Override
	public boolean disregardsArmorCheck(final MOB mob)
	{
		return true;
	}

	public Vector<MOB> mobs=new Vector<MOB>();

	@Override
	public boolean okMessage(final Environmental myHost, final CMMsg msg)
	{
		if(!super.okMessage(myHost,msg))
		{
			return false;
		}
		final MOB source=msg.source();
		if((!msg.source().Name().equals(text()))
		&&((msg.source().getClanRole(text())==null))
		&&(msg.tool() instanceof Ability)
		&&(msg.target()==affected)
		&&((((Ability)msg.tool()).classificationCode()&Ability.ALL_ACODES)==Ability.ACODE_THIEF_SKILL)
		&&(msg.sourceMinor()!=CMMsg.TYP_TEACH))
		{
			if(invoker()==source)
			{
				source.tell(L("@x1 is currently under your protection.",((Physical)msg.target()).name(source)));
			}else
			{
				source.tell(L("@x1 is under @x2's protection.",((Physical)msg.target()).name(source),invoker().name(source)));
				invoker().tell(L("Word on the street is that @x1 is hassling @x2 who is under your protection.",source.name(invoker()),((Physical)msg.target()).name(invoker())));
			}
			return false;
		}
		return true;
	}

	@Override
	public int castingQuality(final MOB mob, final Physical target)
	{
		if(mob!=null)
		{
			if(mob.isInCombat())
				return Ability.QUALITY_INDIFFERENT;
			if(target instanceof PhysicalAgent)
			{
				final PhysicalAgent AE=(PhysicalAgent)target;
				if((CMLib.coffeeShops().getShopKeeper(target)==null)&&(AE.fetchBehavior("MoneyChanger")==null)
				&&(AE.fetchBehavior("ItemMender")==null)&&(AE.fetchBehavior("ItemIdentifier")==null)
				&&(AE.fetchBehavior("ItemRefitter")==null))
					return Ability.QUALITY_INDIFFERENT;
				if(target.fetchEffect(ID())!=null)
					return Ability.QUALITY_INDIFFERENT;
				if((target instanceof MOB)&&(!((MOB)target).mayIFight(mob)))
					return Ability.QUALITY_INDIFFERENT;
			}
		}
		return super.castingQuality(mob,target);
	}

	@Override
	public boolean invoke(final MOB mob, final List<String> commands, final Physical givenTarget, final boolean auto, final int asLevel)
	{
		if((commands.size()<1)&&(givenTarget==null))
		{
			mob.tell(L("Get protection money from whom?"));
			return false;
		}
		MOB target=null;
		if((givenTarget!=null)&&(givenTarget instanceof MOB))
			target=(MOB)givenTarget;
		else
			target=mob.location().fetchInhabitant(CMParms.combine(commands,0));
		if((target==null)||(target.amDead())||(!CMLib.flags().canBeSeenBy(target,mob)))
		{
			mob.tell(L("You don't see '@x1' here.",CMParms.combine(commands,1)));
			return false;
		}
		if(mob.isInCombat())
		{
			mob.tell(L("You are too busy to racketeer right now."));
			return false;
		}
		if((CMLib.coffeeShops().getShopKeeper(target)==null)
		&&(target.fetchBehavior("MoneyChanger")==null)
		&&(target.fetchBehavior("ItemMender")==null)
		&&(target.fetchBehavior("ItemIdentifier")==null)
		&&(target.fetchBehavior("ItemRefitter")==null))
		{
			mob.tell(L("You can't get protection money from @x1.",target.name(mob)));
			return false;
		}
		final Ability A=target.fetchEffect(ID());
		if(A!=null)
		{
			if(A.invoker()==mob)
				mob.tell(L("@x1 has already been extracted from today.",target.name(mob)));
			else
			{
				mob.tell(L("@x1 is already under @x2's protection.",target.name(mob),A.invoker().name(mob)));
				A.invoker().tell(L("Word on the street is that @x1 is trying to push into your business with @x2.",mob.name(A.invoker()),target.name()));
			}
			return false;
		}
		final int levelDiff=target.phyStats().level()-(mob.phyStats().level()+(2*getXLEVELLevel(mob)));
		if(!target.mayIFight(mob))
		{
			mob.tell(L("You cannot racketeer @x1.",target.charStats().himher()));
			return false;
		}
		if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
			return false;
		final double amount=CMLib.dice().roll(proficiency(),target.phyStats().level(),0);
		final boolean success=proficiencyCheck(mob,-(levelDiff),auto);
		final Room R=mob.location();
		if((success)&&(R!=null))
		{
			final CMMsg msg=CMClass.getMsg(mob,target,this,(auto?CMMsg.MASK_ALWAYS:0)|CMMsg.MSG_THIEF_ACT,L("<S-NAME> extract(s) @x1 of protection money from <T-NAME>.",CMLib.beanCounter().nameCurrencyShort(target,amount)));
			if(R.okMessage(mob,msg))
			{
				R.send(mob,msg);
				final TimeClock timeObj = R.getArea().getTimeObj();
				final int hoursInMonth =  timeObj.getHoursInDay() * timeObj.getDaysInMonth();
				final int tickDown = (int)(((CMProps.getMillisPerMudHour()) * hoursInMonth) / (CMProps.getTickMillis()) );
				beneficialAffect( mob, target, asLevel, tickDown);
				final Coins C=CMLib.beanCounter().makeBestCurrency(target,amount);
				if(C!=null)
				{
					R.addItem(C,ItemPossessor.Expire.Player_Drop);
					CMLib.commands().postGet(mob,null,C,true);
				}
			}
		}else
			maliciousFizzle(mob,target,L("<T-NAME> seem(s) unintimidated by <S-NAME>."));
		return success;
	}
}


text:
package mimir.demo

import java.io._
import org.specs2.reporter.LineLogger
import org.specs2.specification.core.{Fragment,Fragments}

import mimir.test._
import mimir.util._
import LoggerUtils.trace
import mimir.ctables._
import mimir.algebra.{NullPrimitive,MissingVariable}

object CureScenario
  extends SQLTestSpecification("CureScenario",  Map("reset" -> "YES"))
{
  // This test case should be checked at least once per major version
  // but is reeeeeally slow and memory intensive.  Skip it in general
  args(skipAll = true)

  val dataFiles = List(
    "test/data/cureSource.csv",
    "test/data/cureLocations.csv",
    "test/data/curePorts.csv"
  )

  val cureQuery = """
    SELECT BILL_OF_LADING_NBR,
           SRC.IMO_CODE           AS "SRC_IMO",
           LOC.LAT                AS "VESSEL_LAT",
           LOC.LON                AS "VESSEL_LON",
           PORTS.LAT              AS "PORT_LAT",
           PORTS.LON              AS "PORT_LON",
           DATE(SRC.DATE)          AS "SRC_DATE",
           DST(LOC.LON, LOC.LAT, PORTS.LON, PORTS.LAT) AS "DISTANCE",  SPEED(DST(LOC.LON, LOC.LAT, PORTS.LON, PORTS.LAT), SRC.DATE, DATE('2016-09-03')) AS "SPEED"
    FROM MV1 AS SRC
      JOIN MV2 AS LOC ON SRC.IMO_CODE = LOC.IMO_CODE
        LEFT OUTER JOIN CUREPORTS AS PORTS ON SRC.PORT_OF_ARRIVAL = PORTS.PORT
        WHERE SPEED(DST(LOC.LON, LOC.LAT, PORTS.LON, PORTS.LAT),SRC.DATE, DATE('2016-09-03')) > 100;
    ;"""

  def time[A](description: String): ( => A) => A =
    Timer.monitor(description)

  sequential

  "The CURE Scenario" should {
    Fragment.foreach(dataFiles){ table => {
      val basename = new File(table).getName().replace(".csv", "").toUpperCase
      s"Load '$table'" >> {
        time(s"Load '$table'") {
          //update(s"LOAD '$table';")
          loadCSV(table)
        }
        // time(s"Materialize '$basename'"){
        //   update(s"ALTER VIEW $basename MATERIALIZE;")
        // }
        db.uncertainty.explainEverything(
          db.table(basename)) must not beEmpty;
        db.tableExists(basename) must beTrue
      }
    }}

    "Select from the source table" >> {
      time("Source Query"){
      query("""
          SELECT * FROM cureSource;
        """){ _.foreach { row => { }}}
      }
      ok
    }

    "Select from the ports table" >> {
      time("Ports Query"){
      query("""
          SELECT * FROM curePorts;
        """){ _.foreach { row => { }}}
      }
      ok
    }

    "Create the source MV Lens" >> {
      time("Source MV Lens"){
        update("""
          CREATE LENS MV1
          AS SELECT * FROM cureSource
          WITH MISSING_VALUE('IMO_CODE');
        """)
      }
      ok
    }

    "Create the locations MV Lens" >> {
      time("Locations MV Lens"){
        update("""
          CREATE LENS MV2
          AS SELECT * FROM cureLocations
          WITH MISSING_VALUE('IMO_CODE');
        """)
      }
      ok
    }

    "Explain the CURE Query" >> {
      db.typechecker.schemaOf(select(cureQuery))
      ok
    }

     "Run the CURE Query" >> {
       LoggerUtils.trace(
					// "mimir.backend.SparkBackend",
          // "mimir.algebra.Typechecker"
				){
          try {
            time("CURE Query"){
              val qr = query(cureQuery){ _.toList.map { row => {1} } }.length
            }
          } catch {
            case mv: MissingVariable =>
              mv.printStackTrace()
              println(mv.context)
              ko
          }
       }
       ok
     }
  }
}


text:
package com.android.settings.slim;

import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.os.Bundle;
import android.preference.EditTextPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.PreferenceFragment;
import android.preference.PreferenceScreen;
import android.preference.SwitchPreference;
import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
import android.text.format.DateFormat;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.EditText;

import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.Utils;
import com.android.settings.widget.SeekBarPreferenceCham;

import net.margaritov.preference.colorpicker.ColorPickerPreference;

import java.util.Date;

public class StatusBarClockStyle extends SettingsPreferenceFragment
        implements OnPreferenceChangeListener {

    private static final String TAG = "StatusBarClockStyle";

    private static final String PREF_ENABLE = "clock_style";
    private static final String PREF_FONT_STYLE = "font_style";
    private static final String PREF_FONT_SIZE  = "font_size_clock";
    private static final String PREF_AM_PM_STYLE = "status_bar_am_pm";
    private static final String PREF_COLOR_PICKER = "clock_color";
    private static final String PREF_CLOCK_DATE_DISPLAY = "clock_date_display";
    private static final String PREF_CLOCK_DATE_STYLE = "clock_date_style";
    private static final String PREF_CLOCK_DATE_POSITION = "clock_date_position";
    private static final String PREF_CLOCK_DATE_FORMAT = "clock_date_format";
    private static final String STATUS_BAR_CLOCK = "status_bar_show_clock";

    public static final int CLOCK_DATE_STYLE_LOWERCASE = 1;
    public static final int CLOCK_DATE_STYLE_UPPERCASE = 2;
    private static final int CUSTOM_CLOCK_DATE_FORMAT_INDEX = 18;

    private static final int MENU_RESET = Menu.FIRST;

    private static final int DLG_RESET = 0;

    private ListPreference mClockStyle;
    private ListPreference mFontStyle;
    private SeekBarPreferenceCham mStatusBarDateSize;
    private ListPreference mClockAmPmStyle;
    private ColorPickerPreference mColorPicker;
    private ListPreference mClockDateDisplay;
    private ListPreference mClockDateStyle;
    private ListPreference mClockDatePosition;
    private ListPreference mClockDateFormat;
    private SwitchPreference mStatusBarClock;

    private boolean mCheckPreferences;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        createCustomView();
    }

    private PreferenceScreen createCustomView() {
        mCheckPreferences = false;
        PreferenceScreen prefSet = getPreferenceScreen();
        if (prefSet != null) {
            prefSet.removeAll();
        }

        addPreferencesFromResource(R.xml.status_bar_clock_style);
        prefSet = getPreferenceScreen();

        PackageManager pm = getPackageManager();
        Resources systemUiResources;
        try {
            systemUiResources = pm.getResourcesForApplication("com.android.systemui");
        } catch (Exception e) {
            Log.e(TAG, "can't access systemui resources",e);
            return null;
        }

        mClockStyle = (ListPreference) findPreference(PREF_ENABLE);
        mClockStyle.setOnPreferenceChangeListener(this);
        mClockStyle.setValue(Integer.toString(Settings.System.getInt(getActivity()
                .getContentResolver(), Settings.System.STATUSBAR_CLOCK_STYLE,
                0)));
        mClockStyle.setSummary(mClockStyle.getEntry());

        mFontStyle = (ListPreference) findPreference(PREF_FONT_STYLE);
        mFontStyle.setOnPreferenceChangeListener(this);
        mFontStyle.setValue(Integer.toString(Settings.System.getInt(getActivity()
               .getContentResolver(), Settings.System.STATUSBAR_CLOCK_FONT_STYLE,
               0)));
        mFontStyle.setSummary(mFontStyle.getEntry());

        mClockAmPmStyle = (ListPreference) prefSet.findPreference(PREF_AM_PM_STYLE);
        mClockAmPmStyle.setOnPreferenceChangeListener(this);
        mClockAmPmStyle.setValue(Integer.toString(Settings.System.getInt(getActivity()
                .getContentResolver(), Settings.System.STATUSBAR_CLOCK_AM_PM_STYLE,
                0)));
        boolean is24hour = DateFormat.is24HourFormat(getActivity());
        if (is24hour) {
            mClockAmPmStyle.setSummary(R.string.status_bar_am_pm_info);
        } else {
            mClockAmPmStyle.setSummary(mClockAmPmStyle.getEntry());
        }
        mClockAmPmStyle.setEnabled(!is24hour);

        mColorPicker = (ColorPickerPreference) findPreference(PREF_COLOR_PICKER);
        mColorPicker.setOnPreferenceChangeListener(this);
        int intColor = Settings.System.getInt(getActivity().getContentResolver(),
                    Settings.System.STATUSBAR_CLOCK_COLOR, -2);
        if (intColor == -2) {
            intColor = systemUiResources.getColor(systemUiResources.getIdentifier(
                    "com.android.systemui:color/status_bar_clock_color", null, null));
            mColorPicker.setSummary(getResources().getString(R.string.default_string));
        } else {
            String hexColor = String.format("#%08x", (0xffffffff & intColor));
            mColorPicker.setSummary(hexColor);
        }
        mColorPicker.setNewPreviewColor(intColor);

        mClockDateDisplay = (ListPreference) findPreference(PREF_CLOCK_DATE_DISPLAY);
        mClockDateDisplay.setOnPreferenceChangeListener(this);
        mClockDateDisplay.setValue(Integer.toString(Settings.System.getInt(getActivity()
                .getContentResolver(), Settings.System.STATUSBAR_CLOCK_DATE_DISPLAY,
                0)));
        mClockDateDisplay.setSummary(mClockDateDisplay.getEntry());

        mClockDateStyle = (ListPreference) findPreference(PREF_CLOCK_DATE_STYLE);
        mClockDateStyle.setOnPreferenceChangeListener(this);
        mClockDateStyle.setValue(Integer.toString(Settings.System.getInt(getActivity()
                .getContentResolver(), Settings.System.STATUSBAR_CLOCK_DATE_STYLE,
                0)));
        mClockDateStyle.setSummary(mClockDateStyle.getEntry());

        mClockDatePosition = (ListPreference) findPreference(PREF_CLOCK_DATE_POSITION);
        mClockDatePosition.setOnPreferenceChangeListener(this);
        mClockDatePosition.setValue(Integer.toString(Settings.System.getInt(getActivity()
                .getContentResolver(), Settings.System.STATUSBAR_CLOCK_DATE_POSITION,
                0)));
        mClockDatePosition.setSummary(mClockDatePosition.getEntry());

        mClockDateFormat = (ListPreference) findPreference(PREF_CLOCK_DATE_FORMAT);
        mClockDateFormat.setOnPreferenceChangeListener(this);
        if (mClockDateFormat.getValue() == null) {
            mClockDateFormat.setValue("EEE");
        }

        parseClockDateFormats();

        mStatusBarClock = (SwitchPreference) prefSet.findPreference(STATUS_BAR_CLOCK);
        mStatusBarClock.setChecked((Settings.System.getInt(
                getActivity().getApplicationContext().getContentResolver(),
                Settings.System.STATUS_BAR_CLOCK, 1) == 1));
        mStatusBarClock.setOnPreferenceChangeListener(this);

        boolean mClockDateToggle = Settings.System.getInt(getActivity().getContentResolver(),
                    Settings.System.STATUSBAR_CLOCK_DATE_DISPLAY, 0) != 0;
        if (!mClockDateToggle) {
            mClockDateStyle.setEnabled(false);
            mClockDatePosition.setEnabled(false);
            mClockDateFormat.setEnabled(false);
        }

        setHasOptionsMenu(true);
        mCheckPreferences = true;

        // Clock font size
        mStatusBarDateSize = (SeekBarPreferenceCham) prefSet.findPreference(PREF_FONT_SIZE);
        mStatusBarDateSize.setValue(Settings.System.getInt(getActivity().getContentResolver(),
                Settings.System.STATUSBAR_CLOCK_FONT_SIZE, 14));
        mStatusBarDateSize.setOnPreferenceChangeListener(this);

        return prefSet;
    }

    public boolean onPreferenceChange(Preference preference, Object newValue) {
        if (!mCheckPreferences) {
            return false;
        }
        AlertDialog dialog;

        if (preference == mClockAmPmStyle) {
            int val = Integer.parseInt((String) newValue);
            int index = mClockAmPmStyle.findIndexOfValue((String) newValue);
            Settings.System.putInt(getActivity().getContentResolver(),
                    Settings.System.STATUSBAR_CLOCK_AM_PM_STYLE, val);
            mClockAmPmStyle.setSummary(mClockAmPmStyle.getEntries()[index]);
            return true;
        } else if (preference == mClockStyle) {
            int val = Integer.parseInt((String) newValue);
            int index = mClockStyle.findIndexOfValue((String) newValue);
            Settings.System.putInt(getActivity().getContentResolver(),
                    Settings.System.STATUSBAR_CLOCK_STYLE, val);
            mClockStyle.setSummary(mClockStyle.getEntries()[index]);
            return true;
        } else if (preference == mFontStyle) {
             int val = Integer.parseInt((String) newValue);
             int index = mFontStyle.findIndexOfValue((String) newValue);
             Settings.System.putInt(getActivity().getContentResolver(),
                     Settings.System.STATUSBAR_CLOCK_FONT_STYLE, val);
             mFontStyle.setSummary(mFontStyle.getEntries()[index]);
             return true;
        } else if (preference == mStatusBarDateSize) {
            int width = ((Integer)newValue).intValue();
            Settings.System.putInt(getActivity().getContentResolver(),
                    Settings.System.STATUSBAR_CLOCK_FONT_SIZE, width);
            return true;
        } else if (preference == mColorPicker) {
            String hex = ColorPickerPreference.convertToARGB(Integer.valueOf(String
                    .valueOf(newValue)));
            preference.setSummary(hex);
            int intHex = ColorPickerPreference.convertToColorInt(hex);
            Settings.System.putInt(getActivity().getContentResolver(),
                    Settings.System.STATUSBAR_CLOCK_COLOR, intHex);
            return true;
        } else if (preference == mClockDateDisplay) {
            int val = Integer.parseInt((String) newValue);
            int index = mClockDateDisplay.findIndexOfValue((String) newValue);
            Settings.System.putInt(getActivity().getContentResolver(),
                    Settings.System.STATUSBAR_CLOCK_DATE_DISPLAY, val);
            mClockDateDisplay.setSummary(mClockDateDisplay.getEntries()[index]);
            if (val == 0) {
                mClockDateStyle.setEnabled(false);
                mClockDatePosition.setEnabled(false);
                mClockDateFormat.setEnabled(false);
            } else {
                mClockDateStyle.setEnabled(true);
                mClockDatePosition.setEnabled(true);
                mClockDateFormat.setEnabled(true);
            }
            return true;
        } else if (preference == mClockDateStyle) {
            int val = Integer.parseInt((String) newValue);
            int index = mClockDateStyle.findIndexOfValue((String) newValue);
            Settings.System.putInt(getActivity().getContentResolver(),
                    Settings.System.STATUSBAR_CLOCK_DATE_STYLE, val);
            mClockDateStyle.setSummary(mClockDateStyle.getEntries()[index]);
            parseClockDateFormats();
            return true;
        } else if (preference == mClockDatePosition) {
            int val = Integer.parseInt((String) newValue);
            int index = mClockDatePosition.findIndexOfValue((String) newValue);
            Settings.System.putInt(getActivity().getContentResolver(),
                    Settings.System.STATUSBAR_CLOCK_DATE_POSITION, val);
            mClockDatePosition.setSummary(mClockDatePosition.getEntries()[index]);
            parseClockDateFormats();
            return true;
        } else if (preference == mStatusBarClock) {
            Settings.System.putInt(getActivity().getApplicationContext().getContentResolver(),
                    Settings.System.STATUS_BAR_CLOCK,
                    (Boolean) newValue ? 1 : 0);
            return true;
        } else if (preference == mClockDateFormat) {
            int index = mClockDateFormat.findIndexOfValue((String) newValue);

            if (index == CUSTOM_CLOCK_DATE_FORMAT_INDEX) {
                AlertDialog.Builder alert = new AlertDialog.Builder(getActivity());
                alert.setTitle(R.string.clock_date_string_edittext_title);
                alert.setMessage(R.string.clock_date_string_edittext_summary);

                final EditText input = new EditText(getActivity());
                String oldText = Settings.System.getString(
                    getActivity().getContentResolver(),
                    Settings.System.STATUSBAR_CLOCK_DATE_FORMAT);
                if (oldText != null) {
                    input.setText(oldText);
                }
                alert.setView(input);

                alert.setPositiveButton(R.string.menu_save, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialogInterface, int whichButton) {
                        String value = input.getText().toString();
                        if (value.equals("")) {
                            return;
                        }
                        Settings.System.putString(getActivity().getContentResolver(),
                            Settings.System.STATUSBAR_CLOCK_DATE_FORMAT, value);

                        return;
                    }
                });

                alert.setNegativeButton(R.string.menu_cancel,
                    new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialogInterface, int which) {
                        return;
                    }
                });
                dialog = alert.create();
                dialog.show();
            } else {
                if ((String) newValue != null) {
                    Settings.System.putString(getActivity().getContentResolver(),
                        Settings.System.STATUSBAR_CLOCK_DATE_FORMAT, (String) newValue);
                }
            }
            return true;
        }
        return false;
    }

    @Override
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
        menu.add(0, MENU_RESET, 0, R.string.reset)
                .setIcon(R.drawable.ic_settings_reset)
                .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case MENU_RESET:
                showDialogInner(DLG_RESET);
                return true;
             default:
                return super.onContextItemSelected(item);
        }
    }

    private void parseClockDateFormats() {
        // Parse and repopulate mClockDateFormats's entries based on current date.
        String[] dateEntries = getResources().getStringArray(R.array.clock_date_format_entries_values);
        CharSequence parsedDateEntries[];
        parsedDateEntries = new String[dateEntries.length];
        Date now = new Date();

        int lastEntry = dateEntries.length - 1;
        int dateFormat = Settings.System.getInt(getActivity()
                .getContentResolver(), Settings.System.STATUSBAR_CLOCK_DATE_STYLE, 0);
        for (int i = 0; i < dateEntries.length; i++) {
            if (i == lastEntry) {
                parsedDateEntries[i] = dateEntries[i];
            } else {
                String newDate;
                CharSequence dateString = DateFormat.format(dateEntries[i], now);
                if (dateFormat == CLOCK_DATE_STYLE_LOWERCASE) {
                    newDate = dateString.toString().toLowerCase();
                } else if (dateFormat == CLOCK_DATE_STYLE_UPPERCASE) {
                    newDate = dateString.toString().toUpperCase();
                } else {
                    newDate = dateString.toString();
                }

                parsedDateEntries[i] = newDate;
            }
        }
        mClockDateFormat.setEntries(parsedDateEntries);
    }

    private void showDialogInner(int id) {
        DialogFragment newFragment = MyAlertDialogFragment.newInstance(id);
        newFragment.setTargetFragment(this, 0);
        newFragment.show(getFragmentManager(), "dialog " + id);
    }

    public static class MyAlertDialogFragment extends DialogFragment {

        public static MyAlertDialogFragment newInstance(int id) {
            MyAlertDialogFragment frag = new MyAlertDialogFragment();
            Bundle args = new Bundle();
            args.putInt("id", id);
            frag.setArguments(args);
            return frag;
        }

        StatusBarClockStyle getOwner() {
            return (StatusBarClockStyle) getTargetFragment();
        }

        @Override
        public Dialog onCreateDialog(Bundle savedInstanceState) {
            int id = getArguments().getInt("id");
            switch (id) {
                case DLG_RESET:
                    return new AlertDialog.Builder(getActivity())
                    .setTitle(R.string.reset)
                    .setMessage(R.string.status_bar_clock_style_reset_message)
                    .setNegativeButton(R.string.cancel, null)
                    .setPositiveButton(R.string.dlg_ok,
                        new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int which) {
                            Settings.System.putInt(getActivity().getContentResolver(),
                                Settings.System.STATUSBAR_CLOCK_COLOR, -2);
                            Settings.System.putInt(getActivity().getContentResolver(),
                                Settings.System.STATUSBAR_CLOCK_FONT_SIZE, 14);
                            getOwner().createCustomView();
                        }
                    })
                    .create();
            }
            throw new IllegalArgumentException("unknown id " + id);
        }

        @Override
        public void onCancel(DialogInterface dialog) {

        }
    }

}


text:
notes: >

    Optionally, the event triggering showing/hiding of the tooltip can be changed to `on click`. This makes the tooltip stay open until user clicks anywhere outside of the element or tooltip.

    The 'On click' tooltip can be useful for more complex tooltips that require custom HTML or clickable elements.

---

Tooltip 'on click'


text:
<component name="libraryTable">
  <library name="ijkplayer-exo-0.7.6">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/ijkplayer-sample/build/intermediates/exploded-aar/tv.danmaku.ijk.media/ijkplayer-exo/0.7.6/jars/classes.jar!/" />
      <root url="file://$PROJECT_DIR$/ijkplayer-sample/build/intermediates/exploded-aar/tv.danmaku.ijk.media/ijkplayer-exo/0.7.6/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>


text:
#ifndef WABT_BINARY_READER_OBJDUMP_H_
#define WABT_BINARY_READER_OBJDUMP_H_

#include <map>
#include <string>

#include "src/common.h"
#include "src/feature.h"
#include "src/stream.h"

namespace wabt {

struct Module;
struct ReadBinaryOptions;

enum class ObjdumpMode {
  Prepass,
  Headers,
  Details,
  Disassemble,
  RawData,
};

struct ObjdumpOptions {
  Stream* log_stream;
  bool headers;
  bool details;
  bool raw;
  bool disassemble;
  bool debug;
  bool relocs;
  bool section_offsets;
  ObjdumpMode mode;
  const char* filename;
  const char* section_name;
};

struct ObjdumpSymbol {
  wabt::SymbolType kind;
  std::string name;
  Index index;
};

struct ObjdumpNames {
  std::string_view Get(Index index) const;
  void Set(Index index, std::string_view name);

  std::map<Index, std::string> names;
};

struct ObjdumpLocalNames {
  std::string_view Get(Index function_index, Index local_index) const;
  void Set(Index function_index, Index local_index, std::string_view name);

  std::map<std::pair<Index, Index>, std::string> names;
};

// read_binary_objdump uses this state to store information from previous runs
// and use it to display more useful information.
struct ObjdumpState {
  std::vector<Reloc> code_relocations;
  std::vector<Reloc> data_relocations;
  ObjdumpNames type_names;
  ObjdumpNames function_names;
  ObjdumpNames global_names;
  ObjdumpNames section_names;
  ObjdumpNames tag_names;
  ObjdumpNames segment_names;
  ObjdumpNames table_names;
  ObjdumpLocalNames local_names;
  std::vector<ObjdumpSymbol> symtab;
  std::map<Index, Index> function_param_counts;
};

Result ReadBinaryObjdump(const uint8_t* data,
                         size_t size,
                         ObjdumpOptions* options,
                         ObjdumpState* state);

}  // namespace wabt

#endif /* WABT_BINARY_READER_OBJDUMP_H_ */


text:
script "install_plugin_es_head" do
  interpreter "bash"
  user "root"
  cwd "#{node.elasticsearch[:dir]}/elasticsearch-#{node.elasticsearch[:version]}/bin/"
  code <<-EOH
    plugin install mobz/elasticsearch-head
    plugin install elasticsearch/elasticsearch-cloud-aws/2.4.1
    EOH
  not_if { File.exist?("#{node.elasticsearch[:dir]}/elasticsearch-#{node.elasticsearch[:version]}/plugins/head") }
end

#notifies :restart, 'service[elasticsearch]' unless node.elasticsearch[:skip_restart]


text:
% Normalisation of EBNF expressions
normalise(Ast1,Ast2) :-
  innermost(normstep,Ast1,Ast2).

% epsilon as left and right unit of concat
normstep(concat(X,epsilon),X).
normstep(concat(epsilon,X),X).

% Right-associative conjunctions
normstep(concat(concat(X,Y),Z),concat(X,concat(Y,Z))).

% Right-associative disjunctions
normstep(or(or(X,Y),Z),or(X,or(Y,Z))).

% Right-associative disjunctions
normstep(p(p(X,Y),Z),p(X,p(Y,Z))).

% Prefer optional arrow over iterated optional
normstep(plus(or(epsilon,X)),or(epsilon,plus(X))).

% Elimination of line-breaks for empty lines
normstep(concat(X,nl),X).
normstep(concat(nl,concat(nl,X)),concat(nl,X)).

% Turn a single expression into a list of expressions
toList(concat(X,Ast),[X|Asts]) :- toList(Ast,Asts).
toList(X,[X]) :- \+ X = concat(_,_).

% Turn a list from expressions into a single expression
fromList([X],X).
fromList([X,Y|Z],concat(X,V)) :- fromList([Y|Z],V).

% Turn list of expressions into a single expression with line breaks
list2nl([Ast],Ast).
list2nl([Ast1|Asts],concat(Ast1,concat(nl,Ast2))) :- list2nl(Asts,Ast2).

% Turn a single expression with line breaks into a list of expressions
nl2list(concat(nl,Ast),[epsilon|Asts]) :- nl2list(Ast,Asts).
nl2list(concat(X,Ast1),[concat(X,Ast2)|Asts]) :- nl2list(Ast1,[Ast2|Asts]).
nl2list(X,[X]) :- \+ X = concat(_,_), \+ X = p(_,_).

%
% Turn a list of expressions into a permutation phrase
% Check that at least one line break occured
%
nl2p(X,Z) :-
  nl2p(fail,G,epsilon,X,Y), G, normalise(Y,Z).

nl2p(_,true,X,concat(nl,Y),p(X,Z)) :-
  nl2p(_,_,epsilon,Y,Z).

nl2p(G1,G2,X,concat(Y,Z),V) :-
  \+ Y = nl, nl2p(G1,G2,concat(X,Y),Z,V).

nl2p(G,G,X,Y,concat(X,Y)) :-
  \+ Y = concat(_,_).

% Turn a permutation phrase into a list of expressions
p2list(p(X,Y),[X|Asts]) :- p2list(Y,Asts).
p2list(Ast,[Ast]) :- \+ Ast = p(_,_).


text:
export class Semester {
  id:    number;
  level: number;
  periodStart:  string;
  periodEnd:  string;
}


text:
'use strict';

angular.module('cards').directive('cardPager',
	function($timeout) {
        return {
            restrict: 'AE',
            transclude: true,
            link: function(scope, elem, attrs) {

            },
            templateUrl: '/modules/cards/views/templates/pager.html'
        };
	}
);