text:
package com.inqbarna.tablefixheaders;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.database.DataSetObserver;
import android.graphics.Canvas;
import android.os.Build;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.Scroller;

import com.inqbarna.tablefixheaders.adapters.TableAdapter;

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

/**
 * This view shows a table which can scroll in both directions. Also still
 * leaves the headers fixed.
 *
 * @author Brais Gab�n (InQBarna)
 */
public class TableFixHeaders extends ViewGroup {

    public static final String TAG = "TableFixHeaders";

    private int currentX;
    private int currentY;

    private TableAdapter adapter;
    private int scrollX;
    private int scrollY;
    private int firstRow;
    private int firstColumn;
    private int[] widths;
    private int[] heights;

    @SuppressWarnings("unused")
    private View headView;
    private List<View> rowViewList;
    private List<View> columnViewList;
    private List<List<View>> bodyViewTable;

    private int rowCount;
    private int columnCount;

    private int width;
    private int height;

    private Recycler recycler;

    private TableAdapterDataSetObserver tableAdapterDataSetObserver;
    private boolean needRelayout;

    private final ImageView[] shadows;
    private final int shadowSize;

    private final int minimumVelocity;
    private final int maximumVelocity;

    private final Flinger flinger;

    private VelocityTracker velocityTracker;

    private int touchSlop;

    /**
     * Simple constructor to use when creating a view from code.
     *
     * @param context The Context the view is running in, through which it can
     *                access the current theme, resources, etc.
     */
    public TableFixHeaders(Context context) {
        this(context, null);
    }

    /**
     * Constructor that is called when inflating a view from XML. This is called
     * when a view is being constructed from an XML file, supplying attributes
     * that were specified in the XML file. This version uses a default style of
     * 0, so the only attribute values applied are those in the Context's Theme
     * and the given AttributeSet.
     * <p/>
     * The method onFinishInflate() will be called after all children have been
     * added.
     *
     * @param context The Context the view is running in, through which it can
     *                access the current theme, resources, etc.
     * @param attrs   The attributes of the XML tag that is inflating the view.
     */
    public TableFixHeaders(Context context, AttributeSet attrs) {
        super(context, attrs);

        this.headView = null;
        this.rowViewList = new ArrayList<View>();
        this.columnViewList = new ArrayList<View>();
        this.bodyViewTable = new ArrayList<List<View>>();

        this.needRelayout = true;

        this.shadows = new ImageView[4];
        this.shadows[0] = new ImageView(context);
        this.shadows[0].setImageResource(R.drawable.shadow_left);
        this.shadows[1] = new ImageView(context);
        this.shadows[1].setImageResource(R.drawable.shadow_top);
        this.shadows[2] = new ImageView(context);
        this.shadows[2].setImageResource(R.drawable.shadow_right);
        this.shadows[3] = new ImageView(context);
        this.shadows[3].setImageResource(R.drawable.shadow_bottom);

        this.shadowSize = getResources().getDimensionPixelSize(R.dimen.shadow_size);

        this.flinger = new Flinger(context);
        final ViewConfiguration configuration = ViewConfiguration.get(context);
        this.touchSlop = configuration.getScaledTouchSlop();
        this.minimumVelocity = configuration.getScaledMinimumFlingVelocity();
        this.maximumVelocity = configuration.getScaledMaximumFlingVelocity();
    }

    /**
     * Returns the adapter currently associated with this widget.
     *
     * @return The adapter used to provide this view's content.
     */
    public TableAdapter getAdapter() {
        return adapter;
    }

    /**
     * Sets the data behind this TableFixHeaders.
     *
     * @param adapter The TableAdapter which is responsible for maintaining the data
     *                backing this list and for producing a view to represent an
     *                item in that data set.
     */
    public void setAdapter(TableAdapter adapter) {
        if (this.adapter != null) {
            this.adapter.unregisterDataSetObserver(tableAdapterDataSetObserver);
        }

        this.adapter = adapter;
        tableAdapterDataSetObserver = new TableAdapterDataSetObserver();
        this.adapter.registerDataSetObserver(tableAdapterDataSetObserver);

        this.recycler = new Recycler(adapter.getViewTypeCount());

        scrollX = 0;
        scrollY = 0;
        firstColumn = 0;
        firstRow = 0;

        needRelayout = true;
        requestLayout();
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent event) {
        boolean intercept = false;
        switch (event.getAction()) {
            case MotionEvent.ACTION_DOWN: {
                currentX = (int) event.getRawX();
                currentY = (int) event.getRawY();
                break;
            }
            case MotionEvent.ACTION_MOVE: {
                int x2 = Math.abs(currentX - (int) event.getRawX());
                int y2 = Math.abs(currentY - (int) event.getRawY());
                if (x2 > touchSlop || y2 > touchSlop) {
                    intercept = true;
                }
                break;
            }
        }
        return intercept;
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (velocityTracker == null) { // If we do not have velocity tracker
            velocityTracker = VelocityTracker.obtain(); // then get one
        }
        velocityTracker.addMovement(event); // add this movement to it

        switch (event.getAction()) {
            case MotionEvent.ACTION_DOWN: {
                if (!flinger.isFinished()) { // If scrolling, then stop now
                    flinger.forceFinished();
                }
                currentX = (int) event.getRawX();
                currentY = (int) event.getRawY();
                break;
            }
            case MotionEvent.ACTION_MOVE: {
                final int x2 = (int) event.getRawX();
                final int y2 = (int) event.getRawY();
                final int diffX = currentX - x2;
                final int diffY = currentY - y2;
                currentX = x2;
                currentY = y2;

                scrollBy(diffX, diffY);
                break;
            }
            case MotionEvent.ACTION_UP: {
                final VelocityTracker velocityTracker = this.velocityTracker;
                velocityTracker.computeCurrentVelocity(1000, maximumVelocity);
                int velocityX = (int) velocityTracker.getXVelocity();
                int velocityY = (int) velocityTracker.getYVelocity();

                if (Math.abs(velocityX) > minimumVelocity || Math.abs(velocityY) > minimumVelocity) {
                    flinger.start(getActualScrollX(), getActualScrollY(), velocityX, velocityY, getMaxScrollX(), getMaxScrollY());
                } else {
                    if (this.velocityTracker != null) { // If the velocity less than threshold
                        this.velocityTracker.recycle(); // recycle the tracker
                        this.velocityTracker = null;
                    }
                }
                break;
            }
        }
        return true;
    }

    @Override
    public void scrollTo(int x, int y) {
        if (needRelayout) {
            scrollX = x;
            firstColumn = 0;

            scrollY = y;
            firstRow = 0;
        } else {
            scrollBy(x - sumArray(widths, 1, firstColumn) - scrollX, y - sumArray(heights, 1, firstRow) - scrollY);
        }
    }

    @Override
    public void scrollBy(int x, int y) {
        scrollX += x;
        scrollY += y;

        if (needRelayout) {
            return;
        }

        scrollBounds();

		/*
         * TODO Improve the algorithm. Think big diagonal movements. If we are
		 * in the top left corner and scrollBy to the opposite corner. We will
		 * have created the views from the top right corner on the X part and we
		 * will have eliminated to generate the right at the Y.
		 */
        if (scrollX == 0) {
            // no op
        } else if (scrollX > 0) {
            while (widths[firstColumn + 1] < scrollX) {
                if (!rowViewList.isEmpty()) {
                    removeLeft();
                }
                scrollX -= widths[firstColumn + 1];
                firstColumn++;
            }
            //log("getFilledWidth() " + getFilledHeight() + " width" + width);
            while (getFilledWidth() < width) {
                addRight();
            }
        } else {
            while (!rowViewList.isEmpty() && getFilledWidth() - widths[firstColumn + rowViewList.size() - 1] >= width) {
                removeRight();
            }
            if (rowViewList.isEmpty()) {
                while (scrollX < 0) {
                    firstColumn--;
                    scrollX += widths[firstColumn + 1];
                }
                while (getFilledWidth() < width) {
                    addRight();
                }
            } else {
                while (0 > scrollX) {
                    addLeft();
                    firstColumn--;
                    scrollX += widths[firstColumn + 1];
                }
            }
        }

        if (scrollY == 0) {
            // no op
        } else if (scrollY > 0) {
            while (heights[firstRow + 1] < scrollY) {
                if (!columnViewList.isEmpty()) {
                    removeTop();
                }
                scrollY -= heights[firstRow + 1];
                firstRow++;
            }
            while (getFilledHeight() < height) {
                addBottom();
            }
        } else {
            while (!columnViewList.isEmpty() && getFilledHeight() - heights[firstRow + columnViewList.size()] >= height) {
                removeBottom();
            }
            if (columnViewList.isEmpty()) {
                while (scrollY < 0) {
                    firstRow--;
                    scrollY += heights[firstRow + 1];
                }
                while (getFilledHeight() < height) {
                    addBottom();
                }
            } else {
                while (0 > scrollY) {
                    addTop();
                    firstRow--;
                    scrollY += heights[firstRow + 1];
                }
            }
        }

        repositionViews();
        shadowsVisibility();

    }

    public int getActualScrollX() {
        return scrollX + sumArray(widths, 1, firstColumn);
    }

    public int getActualScrollY() {
        return scrollY + sumArray(heights, 1, firstRow);
    }

    private int getMaxScrollX() {
        return Math.max(0, sumArray(widths) - width);
    }

    private int getMaxScrollY() {
        return Math.max(0, sumArray(heights) - height);
    }

    private int getFilledWidth() {
        return widths[0] + sumArray(widths, firstColumn + 1, rowViewList.size()) - scrollX;
    }

    private int getFilledHeight() {
        return heights[0] + sumArray(heights, firstRow + 1, columnViewList.size()) - scrollY;
    }

    private void addLeft() {
        addLeftOrRight(firstColumn - 1, 0);
    }

    private void addTop() {
        addTopAndBottom(firstRow - 1, 0);
    }

    private void addRight() {
        final int size = rowViewList.size();
        int column = firstColumn + size;
        addLeftOrRight(column, size);
    }

    private void addBottom() {
        final int size = columnViewList.size();
        addTopAndBottom(firstRow + size, size);
    }

    private void addLeftOrRight(int column, int index) {
        View view = makeView(-1, column, widths[column + 1], heights[0]);
        rowViewList.add(index, view);

        int row = firstRow;
        for (List<View> list : bodyViewTable) {
            view = makeView(row, column, widths[column + 1], heights[row + 1]);
            list.add(index, view);
            row++;
        }
    }

    private void addTopAndBottom(int row, int index) {
        View view = makeView(row, -1, widths[0], heights[row + 1]);
        columnViewList.add(index, view);

        List<View> list = new ArrayList<View>();
        final int size = rowViewList.size() + firstColumn;
        for (int column = firstColumn; column < size; column++) {
            view = makeView(row, column, widths[column + 1], heights[row + 1]);
            list.add(view);
        }
        bodyViewTable.add(index, list);
    }

    private void removeLeft() {
        removeLeftOrRight(0);
    }

    private void removeTop() {
        removeTopOrBottom(0);
    }

    private void removeRight() {
        removeLeftOrRight(rowViewList.size() - 1);
    }

    private void removeBottom() {
        removeTopOrBottom(columnViewList.size() - 1);
    }

    private void removeLeftOrRight(int position) {
        removeView(rowViewList.remove(position));
        for (List<View> list : bodyViewTable) {
            removeView(list.remove(position));
        }
    }

    private void removeTopOrBottom(int position) {
        removeView(columnViewList.remove(position));
        List<View> remove = bodyViewTable.remove(position);
        for (View view : remove) {
            removeView(view);
        }
    }

    @Override
    public void removeView(View view) {
        super.removeView(view);

        final int typeView = (Integer) view.getTag(R.id.tag_type_view);
        if (typeView != TableAdapter.IGNORE_ITEM_VIEW_TYPE) {
            recycler.addRecycledView(view, typeView);
        }
    }

    private void repositionViews() {
        int left, top, right, bottom, i;

        left = widths[0] - scrollX;
        i = firstColumn;
        for (View view : rowViewList) {
            right = left + widths[++i];
            view.layout(left, 0, right, heights[0]);
            left = right;
        }

        top = heights[0] - scrollY;
        i = firstRow;
        for (View view : columnViewList) {
            bottom = top + heights[++i];
            view.layout(0, top, widths[0], bottom);
            top = bottom;
        }

        top = heights[0] - scrollY;
        i = firstRow;
        for (List<View> list : bodyViewTable) {
            bottom = top + heights[++i];
            left = widths[0] - scrollX;
            int j = firstColumn;
            for (View view : list) {
                right = left + widths[++j];
                view.layout(left, top, right, bottom);
                left = right;
            }
            top = bottom;
        }
        invalidate();
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        final int widthMode = MeasureSpec.getMode(widthMeasureSpec);
        final int heightMode = MeasureSpec.getMode(heightMeasureSpec);
        final int widthSize = MeasureSpec.getSize(widthMeasureSpec);
        final int heightSize = MeasureSpec.getSize(heightMeasureSpec);

        final int w;
        final int h;

        if (adapter != null) {
            this.rowCount = adapter.getRowCount();
            this.columnCount = adapter.getMaxColumnCount();

            widths = new int[columnCount + 1];
            for (int i = -1; i < columnCount; i++) {
                widths[i + 1] += adapter.getWidth(i);
            }
            heights = new int[rowCount + 1];
            for (int i = -1; i < rowCount; i++) {
                heights[i + 1] += adapter.getHeight(i);
            }

            if (widthMode == MeasureSpec.AT_MOST) {
                w = Math.min(widthSize, sumArray(widths));
            } else if (widthMode == MeasureSpec.UNSPECIFIED) {
                w = sumArray(widths);
            } else {
                w = widthSize;
                int sumArray = sumArray(widths);
                if (sumArray < widthSize) {
                    final float factor = widthSize / (float) sumArray;
                    for (int i = 1; i < widths.length; i++) {
                        widths[i] = Math.round(widths[i] * factor);
                    }
                    widths[0] = widthSize - sumArray(widths, 1, widths.length - 1);
                }
            }

            if (heightMode == MeasureSpec.AT_MOST) {
                h = Math.min(heightSize, sumArray(heights));
            } else if (heightMode == MeasureSpec.UNSPECIFIED) {
                h = sumArray(heights);
            } else {
                h = heightSize;
            }
        } else {
            if (heightMode == MeasureSpec.AT_MOST || widthMode == MeasureSpec.UNSPECIFIED) {
                w = 0;
                h = 0;
            } else {
                w = widthSize;
                h = heightSize;
            }
        }

        if (firstRow >= rowCount || getMaxScrollY() - getActualScrollY() < 0) {
            firstRow = 0;
            scrollY = Integer.MAX_VALUE;
        }
        if (firstColumn >= columnCount || getMaxScrollX() - getActualScrollX() < 0) {
            firstColumn = 0;
            scrollX = Integer.MAX_VALUE;
        }

        setMeasuredDimension(w, h);
    }

    private int sumArray(int array[]) {
        return sumArray(array, 0, array.length);
    }

    private int sumArray(int array[], int firstIndex, int count) {
        int sum = 0;
        count += firstIndex;
        for (int i = firstIndex; i < count; i++) {
            sum += array[i];
        }
        return sum;
    }

    @SuppressLint("DrawAllocation")
    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        if (needRelayout || changed) {
            needRelayout = false;
            resetTable();

            if (adapter != null) {
                width = r - l;
                height = b - t;

                int left, top, right, bottom;

                right = Math.min(width, sumArray(widths));
                bottom = Math.min(height, sumArray(heights));
                addShadow(shadows[0], widths[0], 0, widths[0] + shadowSize, bottom);
                addShadow(shadows[1], 0, heights[0], right, heights[0] + shadowSize);
                addShadow(shadows[2], right - shadowSize, 0, right, bottom);
                addShadow(shadows[3], 0, bottom - shadowSize, right, bottom);

                headView = makeAndSetup(-1, -1, 0, 0, widths[0], heights[0]);

                scrollBounds();
                adjustFirstCellsAndScroll();

                left = widths[0] - scrollX;
                for (int i = firstColumn; i < columnCount && left < width; i++) {
                    right = left + widths[i + 1];
                    final View view = makeAndSetup(-1, i, left, 0, right, heights[0]);
                    rowViewList.add(view);
                    left = right;
                }

                top = heights[0] - scrollY;
                for (int i = firstRow; i < rowCount && top < height; i++) {
                    bottom = top + heights[i + 1];
                    final View view = makeAndSetup(i, -1, 0, top, widths[0], bottom);
                    columnViewList.add(view);
                    top = bottom;
                }

                top = heights[0] - scrollY;
                for (int i = firstRow; i < rowCount && top < height; i++) {
                    bottom = top + heights[i + 1];
                    left = widths[0] - scrollX;
                    List<View> list = new ArrayList<View>();
                    for (int j = firstColumn; j < columnCount && left < width; j++) {
                        right = left + widths[j + 1];
                        final View view = makeAndSetup(i, j, left, top, right, bottom);
                        list.add(view);
                        left = right;
                    }
                    bodyViewTable.add(list);
                    top = bottom;
                }

                shadowsVisibility();
            }
        }
    }

    private void scrollBounds() {
        scrollX = scrollBounds(scrollX, firstColumn, widths, width);
        scrollY = scrollBounds(scrollY, firstRow, heights, height);
    }

    private int scrollBounds(int desiredScroll, int firstCell, int sizes[], int viewSize) {
        if (desiredScroll == 0) {
            // no op
        } else if (desiredScroll < 0) {
            log("scrollBounds BEFORE " + desiredScroll);
            desiredScroll = Math.max(desiredScroll, -sumArray(sizes, 1, firstCell));
            log("scrollBounds AFTER " + desiredScroll);
        } else {
            desiredScroll = Math.min(desiredScroll, Math.max(0, sumArray(sizes, firstCell + 1, sizes.length - 1 - firstCell) + sizes[0] - viewSize));
        }
        return desiredScroll;
    }

    private void adjustFirstCellsAndScroll() {
        int values[];

        values = adjustFirstCellsAndScroll(scrollX, firstColumn, widths);
        scrollX = values[0];
        firstColumn = values[1];

        values = adjustFirstCellsAndScroll(scrollY, firstRow, heights);
        scrollY = values[0];
        firstRow = values[1];
    }

    private int[] adjustFirstCellsAndScroll(int scroll, int firstCell, int sizes[]) {
        if (scroll == 0) {
            // no op
        } else if (scroll > 0) {
            while (sizes[firstCell + 1] < scroll) {
                firstCell++;
                scroll -= sizes[firstCell];
            }
        } else {
            while (scroll < 0) {
                scroll += sizes[firstCell];
                firstCell--;
            }
        }
        return new int[]{scroll, firstCell};
    }

    private void shadowsVisibility() {
        final int actualScrollX = getActualScrollX();
        final int actualScrollY = getActualScrollY();
        final int[] remainPixels = {
                actualScrollX,
                actualScrollY,
                getMaxScrollX() - actualScrollX,
                getMaxScrollY() - actualScrollY,
        };

        for (int i = 0; i < shadows.length; i++) {
            setAlpha(shadows[i], Math.min(remainPixels[i] / (float) shadowSize, 1));
        }
    }

    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
    @SuppressWarnings("deprecation")
    private void setAlpha(ImageView imageView, float alpha) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            imageView.setAlpha(alpha);
        } else {
            imageView.setAlpha(Math.round(alpha * 255));
        }
    }

    private void addShadow(ImageView imageView, int l, int t, int r, int b) {
        imageView.layout(l, t, r, b);
        addView(imageView);
    }

    private void resetTable() {
        headView = null;
        rowViewList.clear();
        columnViewList.clear();
        bodyViewTable.clear();

        removeAllViews();
    }

    private View makeAndSetup(int row, int column, int left, int top, int right, int bottom) {
        final View view = makeView(row, column, right - left, bottom - top);
        view.layout(left, top, right, bottom);
        return view;
    }

    @Override
    protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
        final boolean ret;

        final Integer row = (Integer) child.getTag(R.id.tag_row);
        final Integer column = (Integer) child.getTag(R.id.tag_column);
        // row == null => Shadow view
        if (row == null || (row == -1 && column == -1)) {
            ret = super.drawChild(canvas, child, drawingTime);
        } else {
            canvas.save();
            if (row == -1) {
                canvas.clipRect(widths[0], 0, canvas.getWidth(), canvas.getHeight());
            } else if (column == -1) {
                canvas.clipRect(0, heights[0], canvas.getWidth(), canvas.getHeight());
            } else {
                canvas.clipRect(widths[0], heights[0], canvas.getWidth(), canvas.getHeight());
            }

            ret = super.drawChild(canvas, child, drawingTime);
            canvas.restore();
        }
        return ret;
    }

    private View makeView(int row, int column, int w, int h) {
        final int itemViewType = adapter.getItemViewType(row, column);
        final View recycledView;
        if (itemViewType == TableAdapter.IGNORE_ITEM_VIEW_TYPE) {
            recycledView = null;
        } else {
            recycledView = recycler.getRecycledView(itemViewType);
        }
        final View view = adapter.getView(row, column, recycledView, this);
        view.setTag(R.id.tag_type_view, itemViewType);
        view.setTag(R.id.tag_row, row);
        view.setTag(R.id.tag_column, column);
        view.measure(MeasureSpec.makeMeasureSpec(w, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(h, MeasureSpec.EXACTLY));
        addTableView(view, row, column);
        return view;
    }

    private void addTableView(View view, int row, int column) {
        if (row == -1 && column == -1) {
            addView(view, getChildCount() - 4);
        } else if (row == -1 || column == -1) {
            addView(view, getChildCount() - 5);
        } else {
            addView(view, 0);
        }
    }

    private class TableAdapterDataSetObserver extends DataSetObserver {

        @Override
        public void onChanged() {
            needRelayout = true;
            requestLayout();
        }

        @Override
        public void onInvalidated() {
            // Do nothing
        }
    }

    // http://stackoverflow.com/a/6219382/842697
    private class Flinger implements Runnable {
        private final Scroller scroller;

        private int lastX = 0;
        private int lastY = 0;

        Flinger(Context context) {
            scroller = new Scroller(context);
        }

        void start(int initX, int initY, int initialVelocityX, int initialVelocityY, int maxX, int maxY) {
            scroller.fling(initX, initY, initialVelocityX, initialVelocityY, 0, maxX, 0, maxY);

            lastX = initX;
            lastY = initY;
            post(this);
        }

        public void run() {
            if (scroller.isFinished()) {
                return;
            }

            boolean more = scroller.computeScrollOffset();
            int x = scroller.getCurrX();
            int y = scroller.getCurrY();
            int diffX = lastX - x;
            int diffY = lastY - y;
            if (diffX != 0 || diffY != 0) {
                scrollBy(diffX, diffY);
                lastX = x;
                lastY = y;
            }

            if (more) {
                post(this);
            }
        }

        boolean isFinished() {
            return scroller.isFinished();
        }

        void forceFinished() {
            if (!scroller.isFinished()) {
                scroller.forceFinished(true);
            }
        }
    }

    private void log(String message) {
        Log.d(TAG, message);
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>0.9.9 API documenation: matrix.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

0.9.9 API documenation

Main Page

Modules

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

File List

G:

Source

G-Truc

glm

glm

matrix.hpp

Go to the documentation of this file.

    1

    4 #pragma once

    5

    6 #include "detail/func_matrix.hpp"

func_matrix.hpp

GLM Core

<address class="footer">
Generated by

 1.8.10
</address>

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>Merry Ninja Xmas</title>
		<link>http://bvs.wikidot.com/forum/t-115447/merry-ninja-xmas</link>
		<description>Posts in the discussion thread "Merry Ninja Xmas" - This is just a topic for everybody to wish a merry christmas and for those who like to share how they spent their christmas or what they got for christmas.</description>
				<copyright></copyright>
		<lastBuildDate>Sun, 10 Jul 2022 03:19:20 +0000</lastBuildDate>

					<item>
				<guid>http://bvs.wikidot.com/forum/t-115447#post-4857730</guid>
				<title>Re: Merry Ninja Xmas</title>
				<link>http://bvs.wikidot.com/forum/t-115447/merry-ninja-xmas#post-4857730</link>
				<description></description>
				<pubDate>Wed, 30 Dec 2020 21:37:44 +0000</pubDate>
				<wikidot:authorName>CollinSullivan</wikidot:authorName>				<wikidot:authorUserId>7182173</wikidot:authorUserId>				<content:encoded>
					<![CDATA[

Happy new year tho.

				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://bvs.wikidot.com/forum/t-115447#post-4545572</guid>
				<title>Re: Merry Ninja Xmas</title>
				<link>http://bvs.wikidot.com/forum/t-115447/merry-ninja-xmas#post-4545572</link>
				<description></description>
				<pubDate>Fri, 13 Mar 2020 09:14:47 +0000</pubDate>
				<wikidot:authorName>Anders88</wikidot:authorName>				<wikidot:authorUserId>6219583</wikidot:authorUserId>				<content:encoded>
					<![CDATA[

Merry christmas to you too! Been a lovely year with much fun sitting at home playing slots and looking for new exciting online casinos.

				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://bvs.wikidot.com/forum/t-115447#post-4540581</guid>
				<title>Re: Merry Ninja Xmas</title>
				<link>http://bvs.wikidot.com/forum/t-115447/merry-ninja-xmas#post-4540581</link>
				<description></description>
				<pubDate>Tue, 10 Mar 2020 14:32:44 +0000</pubDate>
				<wikidot:authorName>Nielsan</wikidot:authorName>				<wikidot:authorUserId>6206913</wikidot:authorUserId>				<content:encoded>
					<![CDATA[

Merry Christmas of 2019! I played some neat christmas slots just now, so I am feeling the holiday spirit!

				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://bvs.wikidot.com/forum/t-115447#post-345752</guid>
				<title>Re: Merry Ninja Xmas</title>
				<link>http://bvs.wikidot.com/forum/t-115447/merry-ninja-xmas#post-345752</link>
				<description></description>
				<pubDate>Wed, 31 Dec 2008 23:53:40 +0000</pubDate>
				<wikidot:authorName>Moare</wikidot:authorName>				<wikidot:authorUserId>79546</wikidot:authorUserId>				<content:encoded>
					<![CDATA[

…and Happy New Year!

				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://bvs.wikidot.com/forum/t-115447#post-342420</guid>
				<title>Merry Ninja Xmas</title>
				<link>http://bvs.wikidot.com/forum/t-115447/merry-ninja-xmas#post-342420</link>
				<description></description>
				<pubDate>Thu, 25 Dec 2008 07:43:57 +0000</pubDate>
				<wikidot:authorName>Yoshirou</wikidot:authorName>				<wikidot:authorUserId>138620</wikidot:authorUserId>				<content:encoded>
					<![CDATA[

Merry Christmas and post away!

				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>


text:
package com.intellij.java.codeInsight.daemon.quickFix;

import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
import com.intellij.codeInspection.ExcessiveLambdaUsageInspection;
import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.testFramework.IdeaTestUtil;
import org.jetbrains.annotations.NotNull;

public class ExcessiveLambdaUsageInspectionTest extends LightQuickFixParameterizedTestCase {
  @NotNull
  @Override
  protected LocalInspectionTool[] configureLocalInspectionTools() {
    return new LocalInspectionTool[]{
      new ExcessiveLambdaUsageInspection()
    };
  }

  @Override
  protected Sdk getProjectJDK() {
    return IdeaTestUtil.getMockJdk9();
  }

  public void test() { doAllTests(); }

  @Override
  protected String getBasePath() {
    return "/codeInsight/daemonCodeAnalyzer/quickFix/excessiveLambdaUsage";
  }
}


text:
<?php
defined('C5_EXECUTE') or die('Access Denied.');

/* @var Concrete\Controller\Panel\Detail\Page\Composer $controller */
/* @var Concrete\Core\View\DialogView $view */
/* @var Concrete\Core\User\User $u */

/* @var Concrete\Core\Application\Service\UserInterface\Help $ui */
/* @var Concrete\Core\Application\Service\Composer $composer */
/* @var Concrete\Core\Validation\CSRF\Token $token */
/* @var Concrete\Core\Page\Type\Type $pagetype */
/* @var string $saveURL */
/* @var string $viewURL */
/* @var Concrete\Core\Page\Page $c */
/* @var int $cID */
/* @var int|null $idleTimeout */

?>

    <?= t('Composer - %s', $pagetype->getPageTypeDisplayName()); ?>
    <form method="post" data-panel-detail-form="compose">
        <?= $ui->display('panel', '/page/composer'); ?>

        <?php $composer->display($pagetype, $c); ?>
    </form>

        <?php $composer->displayButtons($pagetype, $c); ?>


text:
require 'erb'

module Sprockets
  class ERBTemplate
    def self.call(input)
      new.call(input)
    end

    def initialize(&block)
      @block = block
    end

    def call(input)
      engine = ::ERB.new(input[:data], nil, '<>')
      context = input[:environment].context_class.new(input)
      klass = (class << context; self; end)
      klass.class_eval(&@block) if @block
      engine.def_method(klass, :_evaluate_template, input[:filename])
      data = context._evaluate_template
      context.metadata.merge(data: data)
    end
  end
end


text:
CKEDITOR.plugins.setLang( 'blockquote', 'gl', {
	toolbar: 'Cita'
});


text:
@implementation RNFParametersParser

- (NSMutableString *) parseString:(NSMutableString *)source withArguments:(NSArray *)arguments
{
    NSRegularExpression *curlyBraces = [NSRegularExpression regularExpressionWithPattern:@"\\{\\{([^}])\\}\\}"
                                                                                options:0
                                                                                error:nil];

    NSArray *matches = [curlyBraces matchesInString:source
                                            options:0
                                              range:NSMakeRange(0, [source length])];

    NSMutableString *result = source;

    for (NSTextCheckingResult *match in [[matches reverseObjectEnumerator] allObjects])
    {
        NSRange completePlaceholderRange = [match rangeAtIndex:0];
        NSRange placeholderValueRange = [match rangeAtIndex:1];

        NSInteger argIndex = [[result substringWithRange:placeholderValueRange] integerValue];

        if(argIndex >= [arguments count])
            @throw [RNFParametersParserError exceptionWithName:NSStringFromClass([RNFParametersParserError class])
                                                        reason:[NSString stringWithFormat:@"Placeholder %@ references an object out of the arguments array bounds",NSStringFromRange(completePlaceholderRange)]
                                                      userInfo:nil];

        NSObject<RNFSerializable> *argObject = arguments[argIndex];

        NSString *serializedObject = [argObject serialize];

        serializedObject = [serializedObject URLEncodedString];

        if(![argObject isSerializable])
            @throw [RNFParametersParserError exceptionWithName:NSStringFromClass([RNFParametersParserError class])
                                                        reason:[NSString stringWithFormat:@"Object %@ is not serializable",argObject]
                                                      userInfo:nil];

        [result replaceCharactersInRange:completePlaceholderRange
                              withString:serializedObject];
    }

    return result;
}

- (NSMutableString *) parseString:(NSMutableString *)source withUserDefinedParametersProvider:(id)provider
{
    NSRegularExpression *curlyBraces = [NSRegularExpression regularExpressionWithPattern:@"\\{([^}]+)\\}"
                                                                                options:0
                                                                                error:nil];

    NSArray *matches = [curlyBraces matchesInString:source
                                            options:0
                                              range:NSMakeRange(0, [source length])];

    NSMutableString *result = source;

    for (NSTextCheckingResult *match in [[matches reverseObjectEnumerator] allObjects])
    {
        NSRange completePlaceholderRange = [match rangeAtIndex:0];
        NSRange placeholderValueRange = [match rangeAtIndex:1];

        NSString *serializedObject;
        NSString *key = [source substringWithRange:placeholderValueRange];
        NSObject<RNFSerializable> *providedValue = [provider valueForUserDefinedParameter:key];

        if ([providedValue isSerializable])
        {
            serializedObject = [providedValue serialize];

            [result replaceCharactersInRange:completePlaceholderRange
                                  withString:serializedObject];
        } else {
            @throw [RNFParametersParserError exceptionWithName:NSStringFromClass([RNFParametersParserError class])
                                                        reason:[NSString stringWithFormat:@"Provider %@ did not provide a valid value for key %@, returned %@",provider, key, providedValue]
                                                      userInfo:nil];
        }
    }

    return result;
}

- (NSString *) parseString:(NSString *)source withArguments:(NSArray *)arguments userDefinedParametersProvider:(id)provider
{
    NSMutableString *result = [[NSMutableString alloc] initWithString:source];

    result = [self parseString:result withArguments:arguments];

    result = [self parseString:result withUserDefinedParametersProvider:provider];

    return [result copy];
}

- (NSDictionary *) parseDictionary:(NSDictionary *)source withArguments:(NSArray *)arguments userDefinedParametersProvider:(id<RNFUserDefinedConfigurationParameters>)provider
{
    NSMutableDictionary *result = [source mutableCopy];

    for (NSString *key in result.allKeys)
    {
        NSMutableString *parsedValue = [result[key] mutableCopy];
        parsedValue = [self parseString:parsedValue withArguments:arguments];
        parsedValue = [self parseString:parsedValue withUserDefinedParametersProvider:provider];
        [result setObject:parsedValue forKey:key];
    }

    return result;
}

@end


text:
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdlib.h>
#include "mailutils/libcfg.h"
#include <mailutils/sieve.h>

static struct mu_gocs_sieve sieve_settings;

static int
cb_clear_library_path (mu_debug_t debug, void *data, mu_config_value_t *val)
{
  int flag;

  if (mu_cfg_assert_value_type (val, MU_CFG_STRING, debug))
    return 1;
  if (mu_cfg_parse_boolean (val->v.string, &flag))
    {
      mu_cfg_format_error (debug, MU_DEBUG_ERROR, _("not a boolean"));
      return 1;
    }
  if (flag)
    sieve_settings.clearflags |= MU_SIEVE_CLEAR_LIBRARY_PATH;
  return 0;
}

static int
cb_clear_include_path (mu_debug_t debug, void *data, mu_config_value_t *val)
{
  int flag;

  if (mu_cfg_assert_value_type (val, MU_CFG_STRING, debug))
    return 1;
  if (mu_cfg_parse_boolean (val->v.string, &flag))
    {
      mu_cfg_format_error (debug, MU_DEBUG_ERROR, _("not a boolean"));
      return 1;
    }
  if (flag)
    sieve_settings.clearflags |= MU_SIEVE_CLEAR_INCLUDE_PATH;
  return 0;
}

static int
_add_path (mu_debug_t debug, const char *arg, void *data)
{
  char *p, *tmp;
  mu_list_t *plist = data;

  if (!*plist)
    {
      int rc = mu_list_create (plist);
      if (rc)
	{
	  mu_cfg_format_error (debug, MU_DEBUG_ERROR,
			       _("cannot create list: %s"), mu_strerror (rc));
	  exit (1);
	}
      mu_list_set_destroy_item (*plist, mu_list_free_item);
    }
  /* FIXME: Use mu_argcv */
  tmp = strdup (arg);
  for (p = strtok (tmp, ":"); p; p = strtok (NULL, ":"))
    mu_list_append (*plist, strdup (p));
  free (tmp);
  return 0;
}

static int
cb_include_path (mu_debug_t debug, void *data, mu_config_value_t *val)
{
  return mu_cfg_string_value_cb (debug, val, _add_path,
				 &sieve_settings.include_path);
}

static int
cb_library_path (mu_debug_t debug, void *data, mu_config_value_t *val)
{
  return mu_cfg_string_value_cb (debug, val, _add_path,
				 &sieve_settings.library_path);
}

static struct mu_cfg_param mu_sieve_param[] = {
  { "clear-library-path", mu_cfg_callback, NULL, 0, cb_clear_library_path,
     N_("Clear library search path.") },
  { "clear-include-path", mu_cfg_callback, NULL, 0, cb_clear_include_path,
     N_("Clear include search path.") },
  { "library-path", mu_cfg_callback, NULL, 0, cb_library_path,
    N_("Add directories to the library search path.  Argument is a "
       "colon-separated list of directories."),
    N_("list") },
  { "include-path", mu_cfg_callback, NULL, 0, cb_include_path,
    N_("Add directories to the include search path.  Argument is a "
       "colon-separated list of directories."),
    N_("list") },
  { NULL }
};

DCL_CFG_CAPA (sieve);


text:
namespace hms.entappsettings.model
{

    // AppSetting
    [System.CodeDom.Compiler.GeneratedCode("EF.Reverse.POCO.Generator", "2.28.0.0")]
    public partial class AppSetting
    {
        public int AppSettingId { get; set; } // AppSettingId (Primary key)
        public string SettingKey { get; set; } // SettingKey (length: 50)
        public int TenantId { get; set; } // TenantId
        public int SettingGroupId { get; set; } // SettingGroupId
        public int SettingSectionId { get; set; } // SettingSectionId
        public Enums.SettingType TypeId { get; set; } // TypeId
        public string SettingValue { get; set; } // SettingValue
        public bool IsLocked { get; set; } // IsLocked
        public bool IsInternalOnly { get; set; } // IsInternalOnly
        public string Description { get; set; } // Description (length: 1000)
        public System.DateTime ModifiedDate { get; set; } // ModifiedDate
        public string ModifiedBy { get; set; } // ModifiedBy (length: 50)

        // Foreign keys
        public virtual AppSettingGroup AppSettingGroup { get; set; } // FK_AppSetting_AppSettingGroup
        public virtual AppSettingSection AppSettingSection { get; set; } // FK_AppSetting_AppSettingSection
        public virtual AppSettingType AppSettingType { get; set; } // FK_AppSetting_AppSettingType
        public virtual Tenant Tenant { get; set; } // FK_AppSetting_Tenant

        public AppSetting()
        {
            TenantId = 0;
            SettingGroupId = 0;
            SettingSectionId = 0;
            SettingValue = "";
            IsLocked = false;
            IsInternalOnly = false;
            ModifiedDate = System.DateTime.UtcNow;
            ModifiedBy = "suser_sname()";
            InitializePartial();
        }

        partial void InitializePartial();
    }

}
// </auto-generated>


text:
using System;

namespace BTCPayServer.Components.StoreRecentTransactions;

public class StoreRecentTransactionViewModel
{
    public string Id { get; set; }
    public string Balance { get; set; }
    public bool Positive { get; set; }
    public bool IsConfirmed { get; set; }
    public string Link { get; set; }
    public DateTimeOffset Timestamp { get; set; }
}


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />

<link rel="shortcut icon" type="image/x-icon" href="../../../favicon.ico" />
<title>MoreAsserts - Android SDK | Android Developers</title>

<link rel="stylesheet"
href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic,bold" title="roboto">
<link href="../../../assets/css/default.css" rel="stylesheet" type="text/css">

<link href="../../../assets/css/fullscreen.css" rel="stylesheet" class="fullscreen"
type="text/css">

          	Quicknav
			      Quicknav

                  Design

Develop

Distribute

Links

Google Play Developer Console

Android Developers Blog

About Android

Android Sites

Android.com

Android Developers

Android Open Source Project

      <form onsubmit="return submit_search()">
        <input id="search_autocomplete" type="text" value="" autocomplete="off" name="q"
onfocus="search_focus_changed(this, true)" onblur="search_focus_changed(this, false)"
onkeydown="return search_changed(event, true, '../../../')"
onkeyup="return search_changed(event, false, '../../../')" />
      </form>

        close

Get Started

Style

Patterns

Building Blocks

Downloads

Videos

Training

API Guides

Reference

Tools

Get the SDK

Google Services

Google Play

Publishing

Promoting

App Quality

Spotlight

Open Distribution

Results

Loading...

Training

API Guides

Reference

Tools

Google Services

to top

          API level:

            <select id="apiLevelSelector">

            </select>

Android APIs

  android

  android.accessibilityservice

  android.accounts

  android.animation

  android.app

  android.app.admin

  android.app.backup

  android.appwidget

  android.bluetooth

  android.content

  android.content.pm

  android.content.res

  android.database

  android.database.sqlite

  android.drm

  android.gesture

  android.graphics

  android.graphics.drawable

  android.graphics.drawable.shapes

  android.graphics.pdf

  android.hardware

  android.hardware.display

  android.hardware.input

  android.hardware.location

  android.hardware.usb

  android.inputmethodservice

  android.location

  android.media

  android.media.audiofx

  android.media.effect

  android.mtp

  android.net

  android.net.http

  android.net.nsd

  android.net.rtp

  android.net.sip

  android.net.wifi

  android.net.wifi.p2p

  android.net.wifi.p2p.nsd

  android.nfc

  android.nfc.cardemulation

  android.nfc.tech

  android.opengl

  android.os

  android.os.storage

  android.preference

  android.print

  android.print.pdf

  android.printservice

  android.provider

  android.renderscript

  android.sax

  android.security

  android.service.dreams

  android.service.notification

  android.service.textservice

  android.service.wallpaper

  android.speech

  android.speech.tts

  android.support.v13.app

  android.support.v4.accessibilityservice

  android.support.v4.app

  android.support.v4.content

  android.support.v4.content.pm

  android.support.v4.database

  android.support.v4.graphics.drawable

  android.support.v4.hardware.display

  android.support.v4.media

  android.support.v4.net

  android.support.v4.os

  android.support.v4.print

  android.support.v4.text

  android.support.v4.util

  android.support.v4.view

  android.support.v4.view.accessibility

  android.support.v4.widget

  android.support.v7.app

  android.support.v7.appcompat

  android.support.v7.gridlayout

  android.support.v7.media

  android.support.v7.mediarouter

  android.support.v7.view

  android.support.v7.widget

  android.support.v8.renderscript

  android.telephony

  android.telephony.cdma

  android.telephony.gsm

  android.test

  android.test.mock

  android.test.suitebuilder

  android.text

  android.text.format

  android.text.method

  android.text.style

  android.text.util

  android.transition

  android.util

  android.view

  android.view.accessibility

  android.view.animation

  android.view.inputmethod

  android.view.textservice

  android.webkit

  android.widget

  dalvik.bytecode

  dalvik.system

  java.awt.font

  java.beans

  java.io

  java.lang

  java.lang.annotation

  java.lang.ref

  java.lang.reflect

  java.math

  java.net

  java.nio

  java.nio.channels

  java.nio.channels.spi

  java.nio.charset

  java.nio.charset.spi

  java.security

  java.security.acl

  java.security.cert

  java.security.interfaces

  java.security.spec

  java.sql

  java.text

  java.util

  java.util.concurrent

  java.util.concurrent.atomic

  java.util.concurrent.locks

  java.util.jar

  java.util.logging

  java.util.prefs

  java.util.regex

  java.util.zip

  javax.crypto

  javax.crypto.interfaces

  javax.crypto.spec

  javax.microedition.khronos.egl

  javax.microedition.khronos.opengles

  javax.net

  javax.net.ssl

  javax.security.auth

  javax.security.auth.callback

  javax.security.auth.login

  javax.security.auth.x500

  javax.security.cert

  javax.sql

  javax.xml

  javax.xml.datatype

  javax.xml.namespace

  javax.xml.parsers

  javax.xml.transform

  javax.xml.transform.dom

  javax.xml.transform.sax

  javax.xml.transform.stream

  javax.xml.validation

  javax.xml.xpath

  junit.framework

  junit.runner

  org.apache.http

  org.apache.http.auth

  org.apache.http.auth.params

  org.apache.http.client

  org.apache.http.client.entity

  org.apache.http.client.methods

  org.apache.http.client.params

  org.apache.http.client.protocol

  org.apache.http.client.utils

  org.apache.http.conn

  org.apache.http.conn.params

  org.apache.http.conn.routing

  org.apache.http.conn.scheme

  org.apache.http.conn.ssl

  org.apache.http.conn.util

  org.apache.http.cookie

  org.apache.http.cookie.params

  org.apache.http.entity

  org.apache.http.impl

  org.apache.http.impl.auth

  org.apache.http.impl.client

  org.apache.http.impl.conn

  org.apache.http.impl.conn.tsccm

  org.apache.http.impl.cookie

  org.apache.http.impl.entity

  org.apache.http.impl.io

  org.apache.http.io

  org.apache.http.message

  org.apache.http.params

  org.apache.http.protocol

  org.apache.http.util

  org.json

  org.w3c.dom

  org.w3c.dom.ls

  org.xml.sax

  org.xml.sax.ext

  org.xml.sax.helpers

  org.xmlpull.v1

  org.xmlpull.v1.sax2

Interfaces

PerformanceTestCase

PerformanceTestCase.Intermediates

TestSuiteProvider

Classes

ActivityInstrumentationTestCase

ActivityInstrumentationTestCase2

ActivityTestCase

ActivityUnitTestCase

AndroidTestCase

AndroidTestRunner

ApplicationTestCase

InstrumentationTestCase

InstrumentationTestRunner

InstrumentationTestSuite

IsolatedContext

LoaderTestCase

MoreAsserts

ProviderTestCase

ProviderTestCase2

RenamingDelegatingContext

ServiceTestCase

SingleLaunchActivityTestCase

SyncBaseInstrumentation

TouchUtils

ViewAsserts

Errors

AssertionFailedError

ComparisonFailure

      fullscreen
      Use Tree NavigationUse Panel Navigation

Summary:

  Methods

  | Inherited Methods

| [Expand All]

  Added in API level 1

    public

    final

    class

MoreAsserts

    extends Object

        java.lang.Object

               ↳

        android.test.MoreAsserts

Class Overview

Contains additional assertion methods not found in JUnit.

Summary

Public Methods

        <nobr>

            static

            void</nobr>

        <nobr>
        <a href="../../../reference/android/test/MoreAsserts.html#assertAssignableFrom(java.lang.Class<?>, java.lang.Class<?>)">assertAssignableFrom(Class<?> expected, Class<?> actual)</nobr>

Asserts that class expected is assignable from the class
 actual.

        <nobr>

            static

            void</nobr>

        <nobr>
        <a href="../../../reference/android/test/MoreAsserts.html#assertAssignableFrom(java.lang.Class<?>, java.lang.Object)">assertAssignableFrom(Class<?> expected, Object actual)</nobr>

Asserts that the class  expected is assignable from the object
 actual.

        <nobr>

            static

            MatchResult</nobr>

        <nobr>
        assertContainsRegex(String expectedRegex, String actual)</nobr>

Variant of assertContainsRegex(String, String, String) using a
 generic message.

        <nobr>

            static

            MatchResult</nobr>

        <nobr>
        assertContainsRegex(String message, String expectedRegex, String actual)</nobr>

Asserts that expectedRegex matches any substring of actual
 and fails with message if it does not.

        <nobr>

            static

            void</nobr>

        <nobr>
        <a href="../../../reference/android/test/MoreAsserts.html#assertContentsInAnyOrder(java.lang.Iterable<?>, java.lang.Object...)">assertContentsInAnyOrder(Iterable<?> actual, Object... expected)</nobr>

Variant of assertContentsInAnyOrder(String, Iterable<?>, Object...)
 using a generic message.

        <nobr>

            static

            void</nobr>

        <nobr>
        <a href="../../../reference/android/test/MoreAsserts.html#assertContentsInAnyOrder(java.lang.String, java.lang.Iterable<?>, java.lang.Object...)">assertContentsInAnyOrder(String message, Iterable<?> actual, Object... expected)</nobr>

Asserts that actual contains precisely the elements
 expected, but in any order.

        <nobr>

            static

            void</nobr>

        <nobr>
        <a href="../../../reference/android/test/MoreAsserts.html#assertContentsInOrder(java.lang.Iterable<?>, java.lang.Object...)">assertContentsInOrder(Iterable<?> actual, Object... expected)</nobr>

Variant of assertContentsInOrder(String, Iterable<?>, Object...)
 using a generic message.

        <nobr>

            static

            void</nobr>

        <nobr>
        <a href="../../../reference/android/test/MoreAsserts.html#assertContentsInOrder(java.lang.String, java.lang.Iterable<?>, java.lang.Object...)">assertContentsInOrder(String message, Iterable<?> actual, Object... expected)</nobr>

Asserts that actual contains precisely the elements
 expected, and in the same order.

        <nobr>

            static

            void</nobr>

        <nobr>
        <a href="../../../reference/android/test/MoreAsserts.html#assertEmpty(java.lang.Iterable<?>)">assertEmpty(Iterable<?> iterable)</nobr>

Variant of <a href="../../../reference/android/test/MoreAsserts.html#assertEmpty(java.lang.String, java.lang.Iterable<?>)">assertEmpty(String, Iterable) using a
 generic message.

        <nobr>

            static

            void</nobr>

        <nobr>
        <a href="../../../reference/android/test/MoreAsserts.html#assertEmpty(java.lang.String, java.util.Map<?, ?>)">assertEmpty(String message, Map<?, ?> map)</nobr>

Asserts that map is empty.

        <nobr>

            static

            void</nobr>

        <nobr>
        <a href="../../../reference/android/test/MoreAsserts.html#assertEmpty(java.lang.String, java.lang.Iterable<?>)">assertEmpty(String message, Iterable<?> iterable)</nobr>

Asserts that iterable is empty.

        <nobr>

            static

            void</nobr>

        <nobr>
        <a href="../../../reference/android/test/MoreAsserts.html#assertEmpty(java.util.Map<?, ?>)">assertEmpty(Map<?, ?> map)</nobr>

Variant of <a href="../../../reference/android/test/MoreAsserts.html#assertEmpty(java.lang.String, java.util.Map<?, ?>)">assertEmpty(String, Map) using a generic
 message.

        <nobr>

            static

            void</nobr>

        <nobr>
        assertEquals(int[] expected, int[] actual)</nobr>

Asserts that array actual is the same size and every element equals
 those in array expected.

        <nobr>

            static

            void</nobr>

        <nobr>
        <a href="../../../reference/android/test/MoreAsserts.html#assertEquals(java.util.Set<? extends java.lang.Object>, java.util.Set<? extends java.lang.Object>)">assertEquals(Set<? extends Object> expected, Set<? extends Object> actual)</nobr>

Asserts that two sets contain the same elements.

        <nobr>

            static

            void</nobr>

        <nobr>
        assertEquals(byte[] expected, byte[] actual)</nobr>

Asserts that array actual is the same size and every element equals
 those in array expected.

        <nobr>

            static

            void</nobr>

        <nobr>
        <a href="../../../reference/android/test/MoreAsserts.html#assertEquals(java.lang.String, java.util.Set<? extends java.lang.Object>, java.util.Set<? extends java.lang.Object>)">assertEquals(String message, Set<? extends Object> expected, Set<? extends Object> actual)</nobr>

Asserts that two sets contain the same elements.

        <nobr>

            static

            void</nobr>

        <nobr>
        assertEquals(String message, Object[] expected, Object[] actual)</nobr>

Asserts that array actual is the same size and every element
 is the same as those in array expected.

        <nobr>

            static

            void</nobr>

        <nobr>
        assertEquals(Object[] expected, Object[] actual)</nobr>

Asserts that array actual is the same size and every element
 is the same as those in array expected.

        <nobr>

            static

            void</nobr>

        <nobr>
        assertEquals(double[] expected, double[] actual)</nobr>

Asserts that array actual is the same size and every element equals
 those in array expected.

        <nobr>

            static

            void</nobr>

        <nobr>
        assertEquals(String message, int[] expected, int[] actual)</nobr>

Asserts that array actual is the same size and every element equals
 those in array expected.

        <nobr>

            static

            void</nobr>

        <nobr>
        assertEquals(String message, double[] expected, double[] actual)</nobr>

Asserts that array actual is the same size and every element equals
 those in array expected.

        <nobr>

            static

            void</nobr>

        <nobr>
        assertEquals(String message, byte[] expected, byte[] actual)</nobr>

Asserts that array actual is the same size and every element equals
 those in array expected.

        <nobr>

            static

            MatchResult</nobr>

        <nobr>
        assertMatchesRegex(String message, String expectedRegex, String actual)</nobr>

Asserts that expectedRegex exactly matches actual and
 fails with message if it does not.

        <nobr>

            static

            MatchResult</nobr>

        <nobr>
        assertMatchesRegex(String expectedRegex, String actual)</nobr>

Variant of assertMatchesRegex(String, String, String) using a
 generic message.

        <nobr>

            static

            void</nobr>

        <nobr>
        assertNotContainsRegex(String message, String expectedRegex, String actual)</nobr>

Asserts that expectedRegex does not match any substring of
 actual, and fails with message if it does.

        <nobr>

            static

            void</nobr>

        <nobr>
        assertNotContainsRegex(String expectedRegex, String actual)</nobr>

Variant of assertNotContainsRegex(String, String, String) using a
 generic message.

        <nobr>

            static

            void</nobr>

        <nobr>
        <a href="../../../reference/android/test/MoreAsserts.html#assertNotEmpty(java.lang.Iterable<?>)">assertNotEmpty(Iterable<?> iterable)</nobr>

Variant of assertNotEmpty(String, Iterable<?>)
 using a generic message.

        <nobr>

            static

            void</nobr>

        <nobr>
        <a href="../../../reference/android/test/MoreAsserts.html#assertNotEmpty(java.util.Map<?, ?>)">assertNotEmpty(Map<?, ?> map)</nobr>

Variant of <a href="../../../reference/android/test/MoreAsserts.html#assertNotEmpty(java.lang.String, java.util.Map<?, ?>)">assertNotEmpty(String, Map) using a generic
 message.

        <nobr>

            static

            void</nobr>

        <nobr>
        <a href="../../../reference/android/test/MoreAsserts.html#assertNotEmpty(java.lang.String, java.util.Map<?, ?>)">assertNotEmpty(String message, Map<?, ?> map)</nobr>

Asserts that map is not empty.

        <nobr>

            static

            void</nobr>

        <nobr>
        <a href="../../../reference/android/test/MoreAsserts.html#assertNotEmpty(java.lang.String, java.lang.Iterable<?>)">assertNotEmpty(String message, Iterable<?> iterable)</nobr>

Asserts that iterable is not empty.

        <nobr>

            static

            void</nobr>

        <nobr>
        assertNotEqual(Object unexpected, Object actual)</nobr>

Variant of assertNotEqual(String, Object, Object) using a
 generic message.

        <nobr>

            static

            void</nobr>

        <nobr>
        assertNotEqual(String message, Object unexpected, Object actual)</nobr>

Asserts that actual is not equal unexpected, according
 to both == and equals(Object).

        <nobr>

            static

            void</nobr>

        <nobr>
        assertNotMatchesRegex(String expectedRegex, String actual)</nobr>

Variant of assertNotMatchesRegex(String, String, String) using a
 generic message.

        <nobr>

            static

            void</nobr>

        <nobr>
        assertNotMatchesRegex(String message, String expectedRegex, String actual)</nobr>

Asserts that expectedRegex does not exactly match actual,
 and fails with message if it does.

        <nobr>

            static

            void</nobr>

        <nobr>
        checkEqualsAndHashCodeMethods(String message, Object lhs, Object rhs, boolean expectedResult)</nobr>

Utility for testing equals() and hashCode() results at once.

        <nobr>

            static

            void</nobr>

        <nobr>
        checkEqualsAndHashCodeMethods(Object lhs, Object rhs, boolean expectedResult)</nobr>

Variant of
 checkEqualsAndHashCodeMethods(String,Object,Object,boolean...)}
 using a generic message.

  [Expand]

Inherited Methods

From class

  java.lang.Object

        <nobr>

            Object</nobr>

        <nobr>
        clone()</nobr>

Creates and returns a copy of this Object.

        <nobr>

            boolean</nobr>

        <nobr>
        equals(Object o)</nobr>

Compares this instance with the specified object and indicates if they
 are equal.

        <nobr>

            void</nobr>

        <nobr>
        finalize()</nobr>

Invoked when the garbage collector has detected that this instance is no longer reachable.

        <nobr>

            final

            Class<?></nobr>

        <nobr>
        getClass()</nobr>

Returns the unique instance of Class that represents this
 object's class.

        <nobr>

            int</nobr>

        <nobr>
        hashCode()</nobr>

Returns an integer hash code for this object.

        <nobr>

            final

            void</nobr>

        <nobr>
        notify()</nobr>

Causes a thread which is waiting on this object's monitor (by means of
 calling one of the wait() methods) to be woken up.

        <nobr>

            final

            void</nobr>

        <nobr>
        notifyAll()</nobr>

Causes all threads which are waiting on this object's monitor (by means
 of calling one of the wait() methods) to be woken up.

        <nobr>

            String</nobr>

        <nobr>
        toString()</nobr>

Returns a string containing a concise, human-readable description of this
 object.

        <nobr>

            final

            void</nobr>

        <nobr>
        wait()</nobr>

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

        <nobr>

            final

            void</nobr>

        <nobr>
        wait(long millis, int nanos)</nobr>

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
 specified timeout expires.

        <nobr>

            final

            void</nobr>

        <nobr>
        wait(long millis)</nobr>

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
 specified timeout expires.

Public Methods

<A NAME="assertAssignableFrom(java.lang.Class<?>, java.lang.Class<?>)">

        public
        static

        void

      assertAssignableFrom
      (Class<?> expected, Class<?> actual)

  Added in API level 1

Asserts that class expected is assignable from the class
 actual. This verifies expected is a parent class or a
 interface that actual implements.

<A NAME="assertAssignableFrom(java.lang.Class<?>, java.lang.Object)">

        public
        static

        void

      assertAssignableFrom
      (Class<?> expected, Object actual)

  Added in API level 1

Asserts that the class  expected is assignable from the object
 actual. This verifies expected is a parent class or a
 interface that actual implements.

        public
        static

        MatchResult

      assertContainsRegex
      (String expectedRegex, String actual)

  Added in API level 1

Variant of assertContainsRegex(String, String, String) using a
 generic message.

        public
        static

        MatchResult

      assertContainsRegex
      (String message, String expectedRegex, String actual)

  Added in API level 1

Asserts that expectedRegex matches any substring of actual
 and fails with message if it does not.  The Matcher is returned in
 case the test needs access to any captured groups.  Note that you can also
 use this for a literal string, by wrapping your expected string in
 quote(String).

<A NAME="assertContentsInAnyOrder(java.lang.Iterable<?>, java.lang.Object...)">

        public
        static

        void

      assertContentsInAnyOrder
      (Iterable<?> actual, Object... expected)

  Added in API level 1

Variant of assertContentsInAnyOrder(String, Iterable<?>, Object...)
 using a generic message.

<A NAME="assertContentsInAnyOrder(java.lang.String, java.lang.Iterable<?>, java.lang.Object...)">

        public
        static

        void

      assertContentsInAnyOrder
      (String message, Iterable<?> actual, Object... expected)

  Added in API level 1

Asserts that actual contains precisely the elements
 expected, but in any order.

<A NAME="assertContentsInOrder(java.lang.Iterable<?>, java.lang.Object...)">

        public
        static

        void

      assertContentsInOrder
      (Iterable<?> actual, Object... expected)

  Added in API level 1

Variant of assertContentsInOrder(String, Iterable<?>, Object...)
 using a generic message.

<A NAME="assertContentsInOrder(java.lang.String, java.lang.Iterable<?>, java.lang.Object...)">

        public
        static

        void

      assertContentsInOrder
      (String message, Iterable<?> actual, Object... expected)

  Added in API level 1

Asserts that actual contains precisely the elements
 expected, and in the same order.

<A NAME="assertEmpty(java.lang.Iterable<?>)">

        public
        static

        void

      assertEmpty
      (Iterable<?> iterable)

  Added in API level 1

Variant of <a href="../../../reference/android/test/MoreAsserts.html#assertEmpty(java.lang.String, java.lang.Iterable<?>)">assertEmpty(String, Iterable) using a
 generic message.

<A NAME="assertEmpty(java.lang.String, java.util.Map<?, ?>)">

        public
        static

        void

      assertEmpty
      (String message, Map<?, ?> map)

  Added in API level 1

Asserts that map is empty.

<A NAME="assertEmpty(java.lang.String, java.lang.Iterable<?>)">

        public
        static

        void

      assertEmpty
      (String message, Iterable<?> iterable)

  Added in API level 1

Asserts that iterable is empty.

<A NAME="assertEmpty(java.util.Map<?, ?>)">

        public
        static

        void

      assertEmpty
      (Map<?, ?> map)

  Added in API level 1

Variant of <a href="../../../reference/android/test/MoreAsserts.html#assertEmpty(java.lang.String, java.util.Map<?, ?>)">assertEmpty(String, Map) using a generic
 message.

        public
        static

        void

      assertEquals
      (int[] expected, int[] actual)

  Added in API level 1

Asserts that array actual is the same size and every element equals
 those in array expected. On failure, message indicates first
 specific element mismatch.

<A NAME="assertEquals(java.util.Set<? extends java.lang.Object>, java.util.Set<? extends java.lang.Object>)">

        public
        static

        void

      assertEquals
      (Set<? extends Object> expected, Set<? extends Object> actual)

  Added in API level 1

Asserts that two sets contain the same elements.

        public
        static

        void

      assertEquals
      (byte[] expected, byte[] actual)

  Added in API level 1

Asserts that array actual is the same size and every element equals
 those in array expected. On failure, message indicates specific
 element mismatch.

<A NAME="assertEquals(java.lang.String, java.util.Set<? extends java.lang.Object>, java.util.Set<? extends java.lang.Object>)">

        public
        static

        void

      assertEquals
      (String message, Set<? extends Object> expected, Set<? extends Object> actual)

  Added in API level 1

Asserts that two sets contain the same elements.

        public
        static

        void

      assertEquals
      (String message, Object[] expected, Object[] actual)

  Added in API level 1

Asserts that array actual is the same size and every element
 is the same as those in array expected. Note that this uses
 equals() instead of == to compare the objects.
 null will be considered equal to null (unlike SQL).
 On failure, message indicates first specific element mismatch.

        public
        static

        void

      assertEquals
      (Object[] expected, Object[] actual)

  Added in API level 1

Asserts that array actual is the same size and every element
 is the same as those in array expected. Note that this uses
 == instead of equals() to compare the objects.
 On failure, message indicates first specific element mismatch.

        public
        static

        void

      assertEquals
      (double[] expected, double[] actual)

  Added in API level 1

Asserts that array actual is the same size and every element equals
 those in array expected. On failure, message indicates first
 specific element mismatch.

        public
        static

        void

      assertEquals
      (String message, int[] expected, int[] actual)

  Added in API level 1

Asserts that array actual is the same size and every element equals
 those in array expected. On failure, message indicates first
 specific element mismatch.

        public
        static

        void

      assertEquals
      (String message, double[] expected, double[] actual)

  Added in API level 1

Asserts that array actual is the same size and every element equals
 those in array expected. On failure, message indicates first
 specific element mismatch.

        public
        static

        void

      assertEquals
      (String message, byte[] expected, byte[] actual)

  Added in API level 1

Asserts that array actual is the same size and every element equals
 those in array expected. On failure, message indicates specific
 element mismatch.

        public
        static

        MatchResult

      assertMatchesRegex
      (String message, String expectedRegex, String actual)

  Added in API level 1

Asserts that expectedRegex exactly matches actual and
 fails with message if it does not.  The MatchResult is returned
 in case the test needs access to any captured groups.  Note that you can
 also use this for a literal string, by wrapping your expected string in
 quote(String).

        public
        static

        MatchResult

      assertMatchesRegex
      (String expectedRegex, String actual)

  Added in API level 1

Variant of assertMatchesRegex(String, String, String) using a
 generic message.

        public
        static

        void

      assertNotContainsRegex
      (String message, String expectedRegex, String actual)

  Added in API level 1

Asserts that expectedRegex does not match any substring of
 actual, and fails with message if it does.  Note that you
 can also use this for a literal string, by wrapping your expected string
 in quote(String).

        public
        static

        void

      assertNotContainsRegex
      (String expectedRegex, String actual)

  Added in API level 1

Variant of assertNotContainsRegex(String, String, String) using a
 generic message.

<A NAME="assertNotEmpty(java.lang.Iterable<?>)">

        public
        static

        void

      assertNotEmpty
      (Iterable<?> iterable)

  Added in API level 1

Variant of assertNotEmpty(String, Iterable<?>)
 using a generic message.

<A NAME="assertNotEmpty(java.util.Map<?, ?>)">

        public
        static

        void

      assertNotEmpty
      (Map<?, ?> map)

  Added in API level 1

Variant of <a href="../../../reference/android/test/MoreAsserts.html#assertNotEmpty(java.lang.String, java.util.Map<?, ?>)">assertNotEmpty(String, Map) using a generic
 message.

<A NAME="assertNotEmpty(java.lang.String, java.util.Map<?, ?>)">

        public
        static

        void

      assertNotEmpty
      (String message, Map<?, ?> map)

  Added in API level 1

Asserts that map is not empty.

<A NAME="assertNotEmpty(java.lang.String, java.lang.Iterable<?>)">

        public
        static

        void

      assertNotEmpty
      (String message, Iterable<?> iterable)

  Added in API level 1

Asserts that iterable is not empty.

        public
        static

        void

      assertNotEqual
      (Object unexpected, Object actual)

  Added in API level 1

Variant of assertNotEqual(String, Object, Object) using a
 generic message.

        public
        static

        void

      assertNotEqual
      (String message, Object unexpected, Object actual)

  Added in API level 1

Asserts that actual is not equal unexpected, according
 to both == and equals(Object).

        public
        static

        void

      assertNotMatchesRegex
      (String expectedRegex, String actual)

  Added in API level 1

Variant of assertNotMatchesRegex(String, String, String) using a
 generic message.

        public
        static

        void

      assertNotMatchesRegex
      (String message, String expectedRegex, String actual)

  Added in API level 1

Asserts that expectedRegex does not exactly match actual,
 and fails with message if it does. Note that you can also use
 this for a literal string, by wrapping your expected string in
 quote(String).

        public
        static

        void

      checkEqualsAndHashCodeMethods
      (String message, Object lhs, Object rhs, boolean expectedResult)

  Added in API level 1

Utility for testing equals() and hashCode() results at once.
 Tests that lhs.equals(rhs) matches expectedResult, as well as
 rhs.equals(lhs).  Also tests that hashCode() return values are
 equal if expectedResult is true.  (hashCode() is not tested if
 expectedResult is false, as unequal objects can have equal hashCodes.)

Parameters

          lhs
          An Object for which equals() and hashCode() are to be tested.

          rhs
          As lhs.

          expectedResult
          True if the objects should compare equal,
   false if not.

        public
        static

        void

      checkEqualsAndHashCodeMethods
      (Object lhs, Object rhs, boolean expectedResult)

  Added in API level 1

Variant of
 checkEqualsAndHashCodeMethods(String,Object,Object,boolean...)}
 using a generic message.

  Except as noted, this content is licensed under Apache 2.0.
  For details and restrictions, see the
  Content License.

    Android 4.4 r1 —

    About Android  |
    Legal  |
    Support


text:
<?php
namespace Wandu\Migrator;

use Wandu\Config\Contracts\Config;
use Wandu\DI\ContainerInterface;
use Wandu\DI\ServiceProviderInterface;

class MigratorServiceProvider implements ServiceProviderInterface
{
    /**
     * {@inheritdoc}
     */
    public function register(ContainerInterface $app)
    {
        $app->bind(Configuration::class, function (Config $config) {
            return new Configuration([
                'connection' => $config->get('database.migrator.connection'),
                'table' => $config->get('database.migrator.table'),
                'path' => $config->get('database.migrator.path'),
            ]);
        });
    }

    /**
     * {@inheritdoc}
     */
    public function boot(ContainerInterface $app)
    {
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace TimecardBot.Commands
{
    public class AliasAttribute : Attribute
    {
        public string Label { get; }

        public AliasAttribute(string label)
        {
            Label = label;

        }
    }
}


text:
package io.crate.execution.dml.upsert;

import static java.util.Collections.emptyMap;
import static java.util.Collections.singletonMap;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

import java.io.IOException;
import java.util.Collections;
import java.util.Map;

import org.elasticsearch.common.Strings;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.junit.Test;

import io.crate.analyze.AnalyzedUpdateStatement;
import io.crate.expression.reference.Doc;
import io.crate.expression.symbol.Assignments;
import io.crate.metadata.CoordinatorTxnCtx;
import io.crate.metadata.PartitionName;
import io.crate.metadata.RelationName;
import io.crate.metadata.SearchPath;
import io.crate.metadata.TransactionContext;
import io.crate.metadata.doc.DocTableInfo;
import io.crate.metadata.settings.SessionSettings;
import io.crate.test.integration.CrateDummyClusterServiceUnitTest;
import io.crate.testing.SQLExecutor;

public class UpdateSourceGenTest extends CrateDummyClusterServiceUnitTest {

    private static SessionSettings DUMMY_SESSION_INFO = new SessionSettings(
        "dummyUser",
        SearchPath.createSearchPathFrom("dummySchema"));

    private TransactionContext txnCtx = CoordinatorTxnCtx.systemTransactionContext();

    @Test
    public void testSetXBasedOnXAndPartitionedColumn() throws Exception {
        SQLExecutor e = SQLExecutor.builder(clusterService)
            .addPartitionedTable("create table t (x int, p int) partitioned by (p)",
                new PartitionName(new RelationName("doc", "t"), Collections.singletonList("1")).asIndexName())
            .build();

        AnalyzedUpdateStatement update = e.analyze("update t set x = x + p");
        Assignments assignments = Assignments.convert(update.assignmentByTargetCol(), e.nodeCtx);
        DocTableInfo table = (DocTableInfo) update.table().tableInfo();
        UpdateSourceGen updateSourceGen = new UpdateSourceGen(
            txnCtx,
            e.nodeCtx,
            table,
            assignments.targetNames()
        );

        Map<String, Object> source = singletonMap("x", 1);
        Map<String, Object> updatedSource = updateSourceGen.generateSource(
            new Doc(
                1,
                table.concreteIndices()[0],
                "1",
                1,
                1,
                1,
                source,
                () -> {
                    try {
                        return Strings.toString(XContentFactory.jsonBuilder().map(source));
                    } catch (IOException e1) {
                        throw new RuntimeException(e1);
                    }
                }
            ),
            assignments.sources(),
            new Object[0]
        );
        assertThat(updatedSource, is(Map.of("x", 2)));
    }

    @Test
    public void testSourceGenerationWithAssignmentUsingDocumentPrimaryKey() throws Exception {
        SQLExecutor e = SQLExecutor.builder(clusterService)
            .addTable("create table t (y int)")
            .build();
        AnalyzedUpdateStatement update = e.analyze("update t set y = _id::integer * 2");
        Assignments assignments = Assignments.convert(update.assignmentByTargetCol(), e.nodeCtx);
        DocTableInfo table = (DocTableInfo) update.table().tableInfo();
        UpdateSourceGen updateSourceGen = new UpdateSourceGen(
            txnCtx,
            e.nodeCtx,
            table,
            assignments.targetNames()
        );

        BytesReference source = BytesReference.bytes(XContentFactory.jsonBuilder()
            .startObject()
            .field("y", 100)
            .endObject());
        Map<String, Object> updatedSource = updateSourceGen.generateSource(
            new Doc(
                1,
                table.concreteIndices()[0],
                "4",
                1,
                1,
                1,
                emptyMap(),
                source::utf8ToString
            ),
            assignments.sources(),
            new Object[0]
        );
        assertThat(updatedSource, is(Map.of("y", 8)));
    }

    @Test
    public void testNestedGeneratedColumnIsGenerated() throws Exception {
        SQLExecutor e = SQLExecutor.builder(clusterService)
            .addTable("create table t (x int, obj object as (y as x + 1))")
            .build();
        AnalyzedUpdateStatement update = e.analyze("update t set x = 4");
        Assignments assignments = Assignments.convert(update.assignmentByTargetCol(), e.nodeCtx);
        DocTableInfo table = (DocTableInfo) update.table().tableInfo();
        UpdateSourceGen updateSourceGen = new UpdateSourceGen(
            txnCtx,
            e.nodeCtx,
            table,
            assignments.targetNames()
        );
        Map<String, Object> updatedSource = updateSourceGen.generateSource(
            new Doc(
                1,
                table.concreteIndices()[0],
                "1",
                1,
                1,
                1,
                emptyMap(),
                () -> "{}"
            ),
            assignments.sources(),
            new Object[0]
        );
        assertThat(updatedSource, is(Map.of("obj", Map.of("y", 5), "x", 4)));
    }

    @Test
    public void testGeneratedColumnUsingFunctionDependingOnActiveTransaction() throws Exception {
        SQLExecutor e = SQLExecutor.builder(clusterService)
            .addTable("create table t (x int, gen as current_schema)")
            .build();
        AnalyzedUpdateStatement update = e.analyze("update t set x = 1");
        Assignments assignments = Assignments.convert(update.assignmentByTargetCol(), e.nodeCtx);
        DocTableInfo table = (DocTableInfo) update.table().tableInfo();
        UpdateSourceGen sourceGen = new UpdateSourceGen(
            TransactionContext.of(DUMMY_SESSION_INFO),
            e.nodeCtx,
            table,
            assignments.targetNames()
        );

        Map<String, Object> source = sourceGen.generateSource(
            new Doc(1, table.concreteIndices()[0], "1", 1, 1, 1, emptyMap(), () -> "{}"),
            assignments.sources(),
            new Object[0]
        );

        assertThat(source, is(Map.of("gen","dummySchema","x", 1)));
    }

    @Test
    public void testNestedGeneratedColumnRaiseErrorIfGivenByUserDoesNotMatch() throws Exception {
        SQLExecutor e = SQLExecutor.builder(clusterService)
            .addTable("create table t (x int, obj object as (y as 'foo'))")
            .build();
        AnalyzedUpdateStatement update = e.analyze("update t set x = 4, obj = {y='bar'}");
        Assignments assignments = Assignments.convert(update.assignmentByTargetCol(), e.nodeCtx);
        DocTableInfo table = (DocTableInfo) update.table().tableInfo();
        UpdateSourceGen updateSourceGen = new UpdateSourceGen(
            txnCtx,
            e.nodeCtx,
            table,
            assignments.targetNames()
        );

        expectedException.expect(IllegalArgumentException.class);
        expectedException.expectMessage("Given value bar for generated column obj['y'] does not match calculation 'foo' = foo");
        updateSourceGen.generateSource(
            new Doc(
                1,
                table.concreteIndices()[0],
                "1",
                1,
                1,
                1,
                emptyMap(),
                () -> "{}"
            ),
            assignments.sources(),
            new Object[0]
        );
    }

    @Test
    public void testNestedGeneratedColumnIsGeneratedValidateValueIfGivenByUser() throws Exception {
        SQLExecutor e = SQLExecutor.builder(clusterService)
            .addTable("create table t (x int, obj object as (y as 'foo'))")
            .build();
        AnalyzedUpdateStatement update = e.analyze("update t set x = 4, obj = {y='foo'}");
        Assignments assignments = Assignments.convert(update.assignmentByTargetCol(), e.nodeCtx);
        DocTableInfo table = (DocTableInfo) update.table().tableInfo();
        UpdateSourceGen updateSourceGen = new UpdateSourceGen(
            txnCtx,
            e.nodeCtx,
            table,
            assignments.targetNames()
        );
        Map<String, Object> updatedSource = updateSourceGen.generateSource(
            new Doc(
                1,
                table.concreteIndices()[0],
                "1",
                1,
                1,
                1,
                emptyMap(),
                () -> "{}"
            ),
            assignments.sources(),
            new Object[0]
        );
        assertThat(updatedSource, is(Map.of("obj", Map.of("y", "foo"), "x", 4)));
    }

    @Test
    public void test_update_child_of_object_column_that_is_null_implicitly_creates_the_object() throws Exception {
        SQLExecutor e = SQLExecutor.builder(clusterService)
            .addTable("create table t (obj object as (x int))")
            .build();
        AnalyzedUpdateStatement update = e.analyze("update t set obj['x'] = 10");
        Assignments assignments = Assignments.convert(update.assignmentByTargetCol(), e.nodeCtx);
        DocTableInfo table = (DocTableInfo) update.table().tableInfo();
        UpdateSourceGen updateSourceGen = new UpdateSourceGen(
            txnCtx,
            e.nodeCtx,
            table,
            assignments.targetNames()
        );
        Map<String, Object> updatedSource = updateSourceGen.generateSource(
            new Doc(
                1,
                table.concreteIndices()[0],
                "1",
                1,
                1,
                1,
                Collections.singletonMap("obj", null),
                () -> "{\"obj\": null}"
            ),
            assignments.sources(),
            new Object[0]
        );
        assertThat(updatedSource, is(Map.of("obj", Map.of("x", 10))));
    }
}


text:
namespace blink {

class CORE_EXPORT CSSRotation final : public CSSTransformComponent {
  WTF_MAKE_NONCOPYABLE(CSSRotation);
  DEFINE_WRAPPERTYPEINFO();

 public:
  static CSSRotation* create(const CSSAngleValue* angleValue) {
    return new CSSRotation(angleValue);
  }

  static CSSRotation* create(double x,
                             double y,
                             double z,
                             const CSSAngleValue* angleValue) {
    return new CSSRotation(x, y, z, angleValue);
  }

  static CSSRotation* fromCSSValue(const CSSFunctionValue&);

  // Bindings requires returning non-const pointers. This is safe because
  // CSSAngleValues are immutable.
  CSSAngleValue* angle() const {
    return const_cast<CSSAngleValue*>(m_angle.get());
  }
  double x() const { return m_x; }
  double y() const { return m_y; }
  double z() const { return m_z; }

  TransformComponentType type() const override {
    return m_is2D ? RotationType : Rotation3DType;
  }

  CSSMatrixTransformComponent* asMatrix() const override {
    return m_is2D ? CSSMatrixTransformComponent::rotate(m_angle->degrees())
                  : CSSMatrixTransformComponent::rotate3d(m_angle->degrees(),
                                                          m_x, m_y, m_z);
  }

  CSSFunctionValue* toCSSValue() const override;

  DEFINE_INLINE_VIRTUAL_TRACE() {
    visitor->trace(m_angle);
    CSSTransformComponent::trace(visitor);
  }

 private:
  CSSRotation(const CSSAngleValue* angle)
      : m_angle(angle), m_x(0), m_y(0), m_z(1), m_is2D(true) {}

  CSSRotation(double x, double y, double z, const CSSAngleValue* angle)
      : m_angle(angle), m_x(x), m_y(y), m_z(z), m_is2D(false) {}

  Member<const CSSAngleValue> m_angle;
  double m_x;
  double m_y;
  double m_z;
  bool m_is2D;
};

}  // namespace blink

#endif


text:
namespace _04.PascalTriangle
{
    using System;
    using System.Collections.Generic;
    using System.Linq;

    public class PascalTriangle
    {
        public static void Main()
        {
            var height = int.Parse(Console.ReadLine());

            var pascal = new long[height][];

            for (int row = 0; row < height; row++)
            {
                pascal[row] = new long[row + 1];
                pascal[row][0] = 1;
                pascal[row][pascal[row].Length - 1] = 1;

                for (int col = 1; col < pascal[row].Length - 1; col++)
                {
                    pascal[row][col] = pascal[row - 1][col - 1] + pascal[row - 1][col];
                }
            }

            foreach (var row in pascal)
            {
                Console.WriteLine(string.Join(" ", row));
            }
        }
    }
}