text:
package com.android.keyguard;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.FloatProperty;
import android.util.Log;
import android.util.Property;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityManager;
import android.view.animation.Interpolator;
import android.widget.Scroller;

/**
 * This layout handles interaction with the sliding security challenge views
 * that overlay/resize other keyguard contents.
 */
public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout {
    private static final String TAG = "SlidingChallengeLayout";
    private static final boolean DEBUG = false;

    // The drag handle is measured in dp above & below the top edge of the
    // challenge view; these parameters change based on whether the challenge
    // is open or closed.
    private static final int DRAG_HANDLE_CLOSED_ABOVE = 8; // dp
    private static final int DRAG_HANDLE_CLOSED_BELOW = 0; // dp
    private static final int DRAG_HANDLE_OPEN_ABOVE = 8; // dp
    private static final int DRAG_HANDLE_OPEN_BELOW = 0; // dp

    private static final int HANDLE_ANIMATE_DURATION = 250; // ms

    // Drawn to show the drag handle in closed state; crossfades to the challenge view
    // when challenge is fully visible
    private boolean mEdgeCaptured;

    private DisplayMetrics mDisplayMetrics;

    // Initialized during measurement from child layoutparams
    private View mExpandChallengeView;
    private KeyguardSecurityContainer mChallengeView;
    private View mScrimView;
    private View mWidgetsView;

    // Range: 0 (fully hidden) to 1 (fully visible)
    private float mChallengeOffset = 1.f;
    private boolean mChallengeShowing = true;
    private boolean mChallengeShowingTargetState = true;
    private boolean mWasChallengeShowing = true;
    private boolean mIsBouncing = false;

    private final Scroller mScroller;
    private ObjectAnimator mFader;
    private int mScrollState;
    private OnChallengeScrolledListener mScrollListener;
    private OnBouncerStateChangedListener mBouncerListener;
    private boolean mEnableChallengeDragging;

    public static final int SCROLL_STATE_IDLE = 0;
    public static final int SCROLL_STATE_DRAGGING = 1;
    public static final int SCROLL_STATE_SETTLING = 2;
    public static final int SCROLL_STATE_FADING = 3;

    public static final int CHALLENGE_FADE_OUT_DURATION = 100;
    public static final int CHALLENGE_FADE_IN_DURATION = 160;

    private static final int MAX_SETTLE_DURATION = 600; // ms

    // ID of the pointer in charge of a current drag
    private int mActivePointerId = INVALID_POINTER;
    private static final int INVALID_POINTER = -1;

    // True if the user is currently dragging the slider
    private boolean mDragging;
    // True if the user may not drag until a new gesture begins
    private boolean mBlockDrag;

    private VelocityTracker mVelocityTracker;
    private int mMinVelocity;
    private int mMaxVelocity;
    private float mGestureStartX, mGestureStartY; // where did you first touch the screen?
    private int mGestureStartChallengeBottom; // where was the challenge at that time?

    private int mDragHandleClosedBelow; // handle hitrect extension into the challenge view
    private int mDragHandleClosedAbove; // extend the handle's hitrect this far above the line
    private int mDragHandleOpenBelow; // handle hitrect extension into the challenge view
    private int mDragHandleOpenAbove; // extend the handle's hitrect this far above the line

    private int mDragHandleEdgeSlop;
    private int mChallengeBottomBound; // Number of pixels from the top of the challenge view
                                       // that should remain on-screen

    private int mTouchSlop;
    private int mTouchSlopSquare;

    float mHandleAlpha;
    float mFrameAlpha;
    float mFrameAnimationTarget = Float.MIN_VALUE;
    private ObjectAnimator mHandleAnimation;
    private ObjectAnimator mFrameAnimation;

    private boolean mHasGlowpad;
    private final Rect mInsets = new Rect();

    // We have an internal and external version, and we and them together.
    private boolean mChallengeInteractiveExternal = true;
    private boolean mChallengeInteractiveInternal = true;

    static final Property<SlidingChallengeLayout, Float> HANDLE_ALPHA =
            new FloatProperty<SlidingChallengeLayout>("handleAlpha") {
        @Override
        public void setValue(SlidingChallengeLayout view, float value) {
            view.mHandleAlpha = value;
            view.invalidate();
        }

        @Override
        public Float get(SlidingChallengeLayout view) {
            return view.mHandleAlpha;
        }
    };

    // True if at least one layout pass has happened since the view was attached.
    private boolean mHasLayout;

    private static final Interpolator sMotionInterpolator = new Interpolator() {
        public float getInterpolation(float t) {
            t -= 1.0f;
            return t * t * t * t * t + 1.0f;
        }
    };

    private static final Interpolator sHandleFadeInterpolator = new Interpolator() {
        public float getInterpolation(float t) {
            return t * t;
        }
    };

    private final Runnable mEndScrollRunnable = new Runnable () {
        public void run() {
            completeChallengeScroll();
        }
    };

    private final OnClickListener mScrimClickListener = new OnClickListener() {
        @Override
        public void onClick(View v) {
            hideBouncer();
        }
    };

    private final OnClickListener mExpandChallengeClickListener = new OnClickListener() {
        @Override
        public void onClick(View v) {
            if (!isChallengeShowing()) {
                showChallenge(true);
            }
        }
    };

    /**
     * Listener interface that reports changes in scroll state of the challenge area.
     */
    public interface OnChallengeScrolledListener {
        /**
         * The scroll state itself changed.
         *
         *
scrollState will be one of the following:

         *
         *

         *
SCROLL_STATE_IDLE - The challenge area is stationary.

         *
SCROLL_STATE_DRAGGING - The user is actively dragging
         * the challenge area.

         *
SCROLL_STATE_SETTLING - The challenge area is animating
         * into place.

         *

         *
         *
Do not perform expensive operations (e.g. layout)
         * while the scroll state is not SCROLL_STATE_IDLE.

         *
         * @param scrollState The new scroll state of the challenge area.
         */
        public void onScrollStateChanged(int scrollState);

        /**
         * The precise position of the challenge area has changed.
         *
         *
NOTE: It is NOT safe to modify layout or call any View methods that may
         * result in a requestLayout anywhere in your view hierarchy as a result of this call.
         * It may be called during drawing.

         *
         * @param scrollPosition New relative position of the challenge area.
         *                       1.f = fully visible/ready to be interacted with.
         *                       0.f = fully invisible/inaccessible to the user.
         * @param challengeTop Position of the top edge of the challenge view in px in the
         *                     SlidingChallengeLayout's coordinate system.
         */
        public void onScrollPositionChanged(float scrollPosition, int challengeTop);
    }

    public SlidingChallengeLayout(Context context) {
        this(context, null);
    }

    public SlidingChallengeLayout(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public SlidingChallengeLayout(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);

        mScroller = new Scroller(context, sMotionInterpolator);

        final ViewConfiguration vc = ViewConfiguration.get(context);
        mMinVelocity = vc.getScaledMinimumFlingVelocity();
        mMaxVelocity = vc.getScaledMaximumFlingVelocity();

        final Resources res = getResources();
        mDragHandleEdgeSlop = res.getDimensionPixelSize(R.dimen.kg_edge_swipe_region_size);

        mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
        mTouchSlopSquare = mTouchSlop * mTouchSlop;

        mDisplayMetrics = res.getDisplayMetrics();
        final float density = mDisplayMetrics.density;

        // top half of the lock icon, plus another 25% to be sure
        mDragHandleClosedAbove = (int) (DRAG_HANDLE_CLOSED_ABOVE * density + 0.5f);
        mDragHandleClosedBelow = (int) (DRAG_HANDLE_CLOSED_BELOW * density + 0.5f);
        mDragHandleOpenAbove = (int) (DRAG_HANDLE_OPEN_ABOVE * density + 0.5f);
        mDragHandleOpenBelow = (int) (DRAG_HANDLE_OPEN_BELOW * density + 0.5f);

        // how much space to account for in the handle when closed
        mChallengeBottomBound = res.getDimensionPixelSize(R.dimen.kg_widget_pager_bottom_padding);

        setWillNotDraw(false);
        setSystemUiVisibility(SYSTEM_UI_FLAG_LAYOUT_STABLE | SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
    }

    public void setEnableChallengeDragging(boolean enabled) {
        mEnableChallengeDragging = enabled;
    }

    public void setInsets(Rect insets) {
        mInsets.set(insets);
    }

    public void setHandleAlpha(float alpha) {
        if (mExpandChallengeView != null) {
            mExpandChallengeView.setAlpha(alpha);
        }
    }

    public void setChallengeInteractive(boolean interactive) {
        mChallengeInteractiveExternal = interactive;
        if (mExpandChallengeView != null) {
            mExpandChallengeView.setEnabled(interactive);
        }
    }

    void animateHandle(boolean visible) {
        if (mHandleAnimation != null) {
            mHandleAnimation.cancel();
            mHandleAnimation = null;
        }
        final float targetAlpha = visible ? 1.f : 0.f;
        if (targetAlpha == mHandleAlpha) {
            return;
        }
        mHandleAnimation = ObjectAnimator.ofFloat(this, HANDLE_ALPHA, targetAlpha);
        mHandleAnimation.setInterpolator(sHandleFadeInterpolator);
        mHandleAnimation.setDuration(HANDLE_ANIMATE_DURATION);
        mHandleAnimation.start();
    }

    private void sendInitialListenerUpdates() {
        if (mScrollListener != null) {
            int challengeTop = mChallengeView != null ? mChallengeView.getTop() : 0;
            mScrollListener.onScrollPositionChanged(mChallengeOffset, challengeTop);
            mScrollListener.onScrollStateChanged(mScrollState);
        }
    }

    public void setOnChallengeScrolledListener(OnChallengeScrolledListener listener) {
        mScrollListener = listener;
        if (mHasLayout) {
            sendInitialListenerUpdates();
        }
    }

    public void setOnBouncerStateChangedListener(OnBouncerStateChangedListener listener) {
        mBouncerListener = listener;
    }

    @Override
    public void onAttachedToWindow() {
        super.onAttachedToWindow();

        mHasLayout = false;
    }

    @Override
    public void onDetachedFromWindow() {
        super.onDetachedFromWindow();

        removeCallbacks(mEndScrollRunnable);
        mHasLayout = false;
    }

    @Override
    public void requestChildFocus(View child, View focused) {
        if (mIsBouncing && child != mChallengeView) {
            // Clear out of the bouncer if the user tries to move focus outside of
            // the security challenge view.
            hideBouncer();
        }
        super.requestChildFocus(child, focused);
    }

    // We want the duration of the page snap animation to be influenced by the distance that
    // the screen has to travel, however, we don't want this duration to be effected in a
    // purely linear fashion. Instead, we use this method to moderate the effect that the distance
    // of travel has on the overall snap duration.
    float distanceInfluenceForSnapDuration(float f) {
        f -= 0.5f; // center the values about 0.
        f *= 0.3f * Math.PI / 2.0f;
        return (float) Math.sin(f);
    }

    void setScrollState(int state) {
        if (mScrollState != state) {
            mScrollState = state;

            animateHandle(state == SCROLL_STATE_IDLE && !mChallengeShowing);
            if (mScrollListener != null) {
                mScrollListener.onScrollStateChanged(state);
            }
        }
    }

    void completeChallengeScroll() {
        setChallengeShowing(mChallengeShowingTargetState);
        mChallengeOffset = mChallengeShowing ? 1.f : 0.f;
        setScrollState(SCROLL_STATE_IDLE);
        mChallengeInteractiveInternal = true;
        mChallengeView.setLayerType(LAYER_TYPE_NONE, null);
    }

    void setScrimView(View scrim) {
        if (mScrimView != null) {
            mScrimView.setOnClickListener(null);
        }
        mScrimView = scrim;
        if (mScrimView != null) {
            mScrimView.setVisibility(mIsBouncing ? VISIBLE : GONE);
            mScrimView.setFocusable(true);
            mScrimView.setOnClickListener(mScrimClickListener);
        }
    }

    /**
     * Animate the bottom edge of the challenge view to the given position.
     *
     * @param y desired final position for the bottom edge of the challenge view in px
     * @param velocity velocity in
     */
    void animateChallengeTo(int y, int velocity) {
        if (mChallengeView == null) {
            // Nothing to do.
            return;
        }

        cancelTransitionsInProgress();

        mChallengeInteractiveInternal = false;
        enableHardwareLayerForChallengeView();
        final int sy = mChallengeView.getBottom();
        final int dy = y - sy;
        if (dy == 0) {
            completeChallengeScroll();
            return;
        }

        setScrollState(SCROLL_STATE_SETTLING);

        final int childHeight = mChallengeView.getHeight();
        final int halfHeight = childHeight / 2;
        final float distanceRatio = Math.min(1f, 1.0f * Math.abs(dy) / childHeight);
        final float distance = halfHeight + halfHeight *
                distanceInfluenceForSnapDuration(distanceRatio);

        int duration = 0;
        velocity = Math.abs(velocity);
        if (velocity > 0) {
            duration = 4 * Math.round(1000 * Math.abs(distance / velocity));
        } else {
            final float childDelta = (float) Math.abs(dy) / childHeight;
            duration = (int) ((childDelta + 1) * 100);
        }
        duration = Math.min(duration, MAX_SETTLE_DURATION);

        mScroller.startScroll(0, sy, 0, dy, duration);
        postInvalidateOnAnimation();
    }

    private void setChallengeShowing(boolean showChallenge) {
        if (mChallengeShowing == showChallenge) {
            return;
        }
        mChallengeShowing = showChallenge;

        if (mExpandChallengeView == null || mChallengeView == null) {
            // These might not be here yet if we haven't been through layout.
            // If we haven't, the first layout pass will set everything up correctly
            // based on mChallengeShowing as set above.
            return;
        }

        if (mChallengeShowing) {
            mExpandChallengeView.setVisibility(View.INVISIBLE);
            mChallengeView.setVisibility(View.VISIBLE);
            if (AccessibilityManager.getInstance(mContext).isEnabled()) {
                mChallengeView.requestAccessibilityFocus();
                mChallengeView.announceForAccessibility(mContext.getString(
                        R.string.keyguard_accessibility_unlock_area_expanded));
            }
        } else {
            mExpandChallengeView.setVisibility(View.VISIBLE);
            mChallengeView.setVisibility(View.INVISIBLE);
            if (AccessibilityManager.getInstance(mContext).isEnabled()) {
                mExpandChallengeView.requestAccessibilityFocus();
                mChallengeView.announceForAccessibility(mContext.getString(
                        R.string.keyguard_accessibility_unlock_area_collapsed));
            }
        }
    }

    /**
     * @return true if the challenge is at all visible.
     */
    public boolean isChallengeShowing() {
        return mChallengeShowing;
    }

    @Override
    public boolean isChallengeOverlapping() {
        return mChallengeShowing;
    }

    @Override
    public boolean isBouncing() {
        return mIsBouncing;
    }

    @Override
    public int getBouncerAnimationDuration() {
        return HANDLE_ANIMATE_DURATION;
    }

    @Override
    public void showBouncer() {
        if (mIsBouncing) return;
        setSystemUiVisibility(getSystemUiVisibility() | STATUS_BAR_DISABLE_SEARCH);
        mWasChallengeShowing = mChallengeShowing;
        mIsBouncing = true;
        showChallenge(true);
        if (mScrimView != null) {
            Animator anim = ObjectAnimator.ofFloat(mScrimView, "alpha", 1f);
            anim.setDuration(HANDLE_ANIMATE_DURATION);
            anim.addListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationStart(Animator animation) {
                    mScrimView.setVisibility(VISIBLE);
                }
            });
            anim.start();
        }
        if (mChallengeView != null) {
            mChallengeView.showBouncer(HANDLE_ANIMATE_DURATION);
        }

        if (mBouncerListener != null) {
            mBouncerListener.onBouncerStateChanged(true);
        }
    }

    @Override
    public void hideBouncer() {
        if (!mIsBouncing) return;
        setSystemUiVisibility(getSystemUiVisibility() & ~STATUS_BAR_DISABLE_SEARCH);
        if (!mWasChallengeShowing) showChallenge(false);
        mIsBouncing = false;

        if (mScrimView != null) {
            Animator anim = ObjectAnimator.ofFloat(mScrimView, "alpha", 0f);
            anim.setDuration(HANDLE_ANIMATE_DURATION);
            anim.addListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    mScrimView.setVisibility(GONE);
                }
            });
            anim.start();
        }
        if (mChallengeView != null) {
            mChallengeView.hideBouncer(HANDLE_ANIMATE_DURATION);
        }
        if (mBouncerListener != null) {
            mBouncerListener.onBouncerStateChanged(false);
        }
    }

    private int getChallengeMargin(boolean expanded) {
        return expanded && mHasGlowpad ? 0 : mDragHandleEdgeSlop;
    }

    private float getChallengeAlpha() {
        float x = mChallengeOffset - 1;
        return x * x * x + 1.f;
    }

    @Override
    public void requestDisallowInterceptTouchEvent(boolean allowIntercept) {
        // We'll intercept whoever we feel like! ...as long as it isn't a challenge view.
        // If there are one or more pointers in the challenge view before we take over
        // touch events, onInterceptTouchEvent will set mBlockDrag.
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        if (mVelocityTracker == null) {
            mVelocityTracker = VelocityTracker.obtain();
        }
        mVelocityTracker.addMovement(ev);

        final int action = ev.getActionMasked();
        switch (action) {
            case MotionEvent.ACTION_DOWN:
                mGestureStartX = ev.getX();
                mGestureStartY = ev.getY();
                mBlockDrag = false;
                break;

            case MotionEvent.ACTION_CANCEL:
            case MotionEvent.ACTION_UP:
                resetTouch();
                break;

            case MotionEvent.ACTION_MOVE:
                final int count = ev.getPointerCount();
                for (int i = 0; i < count; i++) {
                    final float x = ev.getX(i);
                    final float y = ev.getY(i);
                    if (!mIsBouncing && mActivePointerId == INVALID_POINTER
                                && (crossedDragHandle(x, y, mGestureStartY)
                                        && shouldEnableChallengeDragging()
                                        || (isInChallengeView(x, y) &&
                                        mScrollState == SCROLL_STATE_SETTLING))) {
                        mActivePointerId = ev.getPointerId(i);
                        mGestureStartX = x;
                        mGestureStartY = y;
                        mGestureStartChallengeBottom = getChallengeBottom();
                        mDragging = true;
                        enableHardwareLayerForChallengeView();
                    } else if (mChallengeShowing && isInChallengeView(x, y)
                            && shouldEnableChallengeDragging()) {
                        mBlockDrag = true;
                    }
                }
                break;
        }

        if (mBlockDrag || isChallengeInteractionBlocked()) {
            mActivePointerId = INVALID_POINTER;
            mDragging = false;
        }

        return mDragging;
    }

    private boolean shouldEnableChallengeDragging() {
        return mEnableChallengeDragging || !mChallengeShowing;
    }

    private boolean isChallengeInteractionBlocked() {
        return !mChallengeInteractiveExternal || !mChallengeInteractiveInternal;
    }

    private void resetTouch() {
        mVelocityTracker.recycle();
        mVelocityTracker = null;
        mActivePointerId = INVALID_POINTER;
        mDragging = mBlockDrag = false;
    }

    @Override
    public boolean onTouchEvent(MotionEvent ev) {
        if (mVelocityTracker == null) {
            mVelocityTracker = VelocityTracker.obtain();
        }
        mVelocityTracker.addMovement(ev);

        final int action = ev.getActionMasked();
        switch (action) {
            case MotionEvent.ACTION_DOWN:
                mBlockDrag = false;
                mGestureStartX = ev.getX();
                mGestureStartY = ev.getY();
                break;

            case MotionEvent.ACTION_CANCEL:
                if (mDragging && !isChallengeInteractionBlocked()) {
                    showChallenge(0);
                }
                resetTouch();
                break;

            case MotionEvent.ACTION_POINTER_UP:
                if (mActivePointerId != ev.getPointerId(ev.getActionIndex())) {
                    break;
                }
            case MotionEvent.ACTION_UP:
                if (mDragging && !isChallengeInteractionBlocked()) {
                    mVelocityTracker.computeCurrentVelocity(1000, mMaxVelocity);
                    showChallenge((int) mVelocityTracker.getYVelocity(mActivePointerId));
                }
                resetTouch();
                break;

            case MotionEvent.ACTION_MOVE:
                if (!mDragging && !mBlockDrag && !mIsBouncing) {
                    final int count = ev.getPointerCount();
                    for (int i = 0; i < count; i++) {
                        final float x = ev.getX(i);
                        final float y = ev.getY(i);

                        if ((isInDragHandle(x, y) || crossedDragHandle(x, y, mGestureStartY) ||
                                (isInChallengeView(x, y) && mScrollState == SCROLL_STATE_SETTLING))
                                && mActivePointerId == INVALID_POINTER
                                && !isChallengeInteractionBlocked()) {
                            mGestureStartX = x;
                            mGestureStartY = y;
                            mActivePointerId = ev.getPointerId(i);
                            mGestureStartChallengeBottom = getChallengeBottom();
                            mDragging = true;
                            enableHardwareLayerForChallengeView();
                            break;
                        }
                    }
                }
                // Not an else; this can be set above.
                if (mDragging) {
                    // No-op if already in this state, but set it here in case we arrived
                    // at this point from either intercept or the above.
                    setScrollState(SCROLL_STATE_DRAGGING);

                    final int index = ev.findPointerIndex(mActivePointerId);
                    if (index < 0) {
                        // Oops, bogus state. We lost some touch events somewhere.
                        // Just drop it with no velocity and let things settle.
                        resetTouch();
                        showChallenge(0);
                        return true;
                    }
                    final float y = ev.getY(index);
                    final float pos = Math.min(y - mGestureStartY,
                            getLayoutBottom() - mChallengeBottomBound);

                    moveChallengeTo(mGestureStartChallengeBottom + (int) pos);
                }
                break;
        }
        return true;
    }

    /**
     * The lifecycle of touch events is subtle and it's very easy to do something
     * that will cause bugs that will be nasty to track when overriding this method.
     * Normally one should always override onInterceptTouchEvent instead.
     *
     * To put it another way, don't try this at home.
     */
    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        final int action = ev.getActionMasked();
        boolean handled = false;
        if (action == MotionEvent.ACTION_DOWN) {
            // Defensive programming: if we didn't get the UP or CANCEL, reset anyway.
            mEdgeCaptured = false;
        }
        if (mWidgetsView != null && !mIsBouncing && (mEdgeCaptured || isEdgeSwipeBeginEvent(ev))) {
            // Normally we would need to do a lot of extra stuff here.
            // We can only get away with this because we haven't padded in
            // the widget pager or otherwise transformed it during layout.
            // We also don't support things like splitting MotionEvents.

            // We set handled to captured even if dispatch is returning false here so that
            // we don't send a different view a busted or incomplete event stream.
            handled = mEdgeCaptured |= mWidgetsView.dispatchTouchEvent(ev);
        }

        if (!handled && !mEdgeCaptured) {
            handled = super.dispatchTouchEvent(ev);
        }

        if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) {
            mEdgeCaptured = false;
        }

        return handled;
    }

    private boolean isEdgeSwipeBeginEvent(MotionEvent ev) {
        if (ev.getActionMasked() != MotionEvent.ACTION_DOWN) {
            return false;
        }

        final float x = ev.getX();
        return x < mDragHandleEdgeSlop || x >= getWidth() - mDragHandleEdgeSlop;
    }

    /**
     * We only want to add additional vertical space to the drag handle when the panel is fully
     * closed.
     */
    private int getDragHandleSizeAbove() {
        return isChallengeShowing() ? mDragHandleOpenAbove : mDragHandleClosedAbove;
    }
    private int getDragHandleSizeBelow() {
        return isChallengeShowing() ? mDragHandleOpenBelow : mDragHandleClosedBelow;
    }

    private boolean isInChallengeView(float x, float y) {
        return isPointInView(x, y, mChallengeView);
    }

    private boolean isInDragHandle(float x, float y) {
        return isPointInView(x, y, mExpandChallengeView);
    }

    private boolean isPointInView(float x, float y, View view) {
        if (view == null) {
            return false;
        }
        return x >= view.getLeft() && y >= view.getTop()
                && x < view.getRight() && y < view.getBottom();
    }

    private boolean crossedDragHandle(float x, float y, float initialY) {

        final int challengeTop = mChallengeView.getTop();
        final boolean horizOk = x >= 0 && x < getWidth();

        final boolean vertOk;
        if (mChallengeShowing) {
            vertOk = initialY < (challengeTop - getDragHandleSizeAbove()) &&
                    y > challengeTop + getDragHandleSizeBelow();
        } else {
            vertOk = initialY > challengeTop + getDragHandleSizeBelow() &&
                    y < challengeTop - getDragHandleSizeAbove();
        }
        return horizOk && vertOk;
    }

    private int makeChildMeasureSpec(int maxSize, int childDimen) {
        final int mode;
        final int size;
        switch (childDimen) {
            case LayoutParams.WRAP_CONTENT:
                mode = MeasureSpec.AT_MOST;
                size = maxSize;
                break;
            case LayoutParams.MATCH_PARENT:
                mode = MeasureSpec.EXACTLY;
                size = maxSize;
                break;
            default:
                mode = MeasureSpec.EXACTLY;
                size = Math.min(maxSize, childDimen);
                break;
        }
        return MeasureSpec.makeMeasureSpec(size, mode);
    }

    @Override
    protected void onMeasure(int widthSpec, int heightSpec) {
        if (MeasureSpec.getMode(widthSpec) != MeasureSpec.EXACTLY ||
                MeasureSpec.getMode(heightSpec) != MeasureSpec.EXACTLY) {
            throw new IllegalArgumentException(
                    "SlidingChallengeLayout must be measured with an exact size");
        }
        final int width = MeasureSpec.getSize(widthSpec);
        final int height = MeasureSpec.getSize(heightSpec);
        setMeasuredDimension(width, height);

        final int insetHeight = height - mInsets.top - mInsets.bottom;
        final int insetHeightSpec = MeasureSpec.makeMeasureSpec(insetHeight, MeasureSpec.EXACTLY);

        // Find one and only one challenge view.
        final View oldChallengeView = mChallengeView;
        final View oldExpandChallengeView = mChallengeView;
        mChallengeView = null;
        mExpandChallengeView = null;
        final int count = getChildCount();

        // First iteration through the children finds special children and sets any associated
        // state.
        for (int i = 0; i < count; i++) {
            final View child = getChildAt(i);
            final LayoutParams lp = (LayoutParams) child.getLayoutParams();
            if (lp.childType == LayoutParams.CHILD_TYPE_CHALLENGE) {
                if (mChallengeView != null) {
                    throw new IllegalStateException(
                            "There may only be one child with layout_isChallenge=\"true\"");
                }
                if (!(child instanceof KeyguardSecurityContainer)) {
                            throw new IllegalArgumentException(
                                    "Challenge must be a KeyguardSecurityContainer");
                }
                mChallengeView = (KeyguardSecurityContainer) child;
                if (mChallengeView != oldChallengeView) {
                    mChallengeView.setVisibility(mChallengeShowing ? VISIBLE : INVISIBLE);
                }
                // We're going to play silly games with the frame's background drawable later.
                if (!mHasLayout) {
                    // Set up the margin correctly based on our content for the first run.
                    mHasGlowpad = child.findViewById(R.id.keyguard_selector_view) != null;
                    lp.leftMargin = lp.rightMargin = getChallengeMargin(true);
                }
            } else if (lp.childType == LayoutParams.CHILD_TYPE_EXPAND_CHALLENGE_HANDLE) {
                if (mExpandChallengeView != null) {
                    throw new IllegalStateException(
                            "There may only be one child with layout_childType"
                            + "=\"expandChallengeHandle\"");
                }
                mExpandChallengeView = child;
                if (mExpandChallengeView != oldExpandChallengeView) {
                    mExpandChallengeView.setVisibility(mChallengeShowing ? INVISIBLE : VISIBLE);
                    mExpandChallengeView.setOnClickListener(mExpandChallengeClickListener);
                }
            } else if (lp.childType == LayoutParams.CHILD_TYPE_SCRIM) {
                setScrimView(child);
            } else if (lp.childType == LayoutParams.CHILD_TYPE_WIDGETS) {
                mWidgetsView = child;
            }
        }

        // We want to measure the challenge view first, since the KeyguardWidgetPager
        // needs to do things its measure pass that are dependent on the challenge view
        // having been measured.
        if (mChallengeView != null && mChallengeView.getVisibility() != View.GONE) {
            // This one's a little funny. If the IME is present - reported in the form
            // of insets on the root view - we only give the challenge the space it would
            // have had if the IME wasn't there in order to keep the rest of the layout stable.
            // We base this on the layout_maxHeight on the challenge view. If it comes out
            // negative or zero, either we didn't have a maxHeight or we're totally out of space,
            // so give up and measure as if this rule weren't there.
            int challengeHeightSpec = insetHeightSpec;
            final View root = getRootView();
            if (root != null) {
                final LayoutParams lp = (LayoutParams) mChallengeView.getLayoutParams();
                final int windowHeight = mDisplayMetrics.heightPixels
                        - root.getPaddingTop() - mInsets.top;
                final int diff = windowHeight - insetHeight;
                final int maxChallengeHeight = lp.maxHeight - diff;
                if (maxChallengeHeight > 0) {
                    challengeHeightSpec = makeChildMeasureSpec(maxChallengeHeight, lp.height);
                }
            }
            measureChildWithMargins(mChallengeView, widthSpec, 0, challengeHeightSpec, 0);
        }

        // Measure the rest of the children
        for (int i = 0; i < count; i++) {
            final View child = getChildAt(i);
            if (child.getVisibility() == GONE) {
                continue;
            }
            // Don't measure the challenge view twice!
            if (child == mChallengeView) continue;

            // Measure children. Widget frame measures special, so that we can ignore
            // insets for the IME.
            int parentWidthSpec = widthSpec, parentHeightSpec = insetHeightSpec;
            final LayoutParams lp = (LayoutParams) child.getLayoutParams();
            if (lp.childType == LayoutParams.CHILD_TYPE_WIDGETS) {
                final View root = getRootView();
                if (root != null) {
                    // This calculation is super dodgy and relies on several assumptions.
                    // Specifically that the root of the window will be padded in for insets
                    // and that the window is LAYOUT_IN_SCREEN.
                    final int windowWidth = mDisplayMetrics.widthPixels;
                    final int windowHeight = mDisplayMetrics.heightPixels
                            - root.getPaddingTop() - mInsets.top;
                    parentWidthSpec = MeasureSpec.makeMeasureSpec(
                            windowWidth, MeasureSpec.EXACTLY);
                    parentHeightSpec = MeasureSpec.makeMeasureSpec(
                            windowHeight, MeasureSpec.EXACTLY);
                }
            } else if (lp.childType == LayoutParams.CHILD_TYPE_SCRIM) {
                // Allow scrim views to extend into the insets
                parentWidthSpec = widthSpec;
                parentHeightSpec = heightSpec;
            }
            measureChildWithMargins(child, parentWidthSpec, 0, parentHeightSpec, 0);
        }
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        final int paddingLeft = getPaddingLeft();
        final int paddingTop = getPaddingTop();
        final int paddingRight = getPaddingRight();
        final int paddingBottom = getPaddingBottom();
        final int width = r - l;
        final int height = b - t;

        final int count = getChildCount();
        for (int i = 0; i < count; i++) {
            final View child = getChildAt(i);

            if (child.getVisibility() == GONE) continue;

            final LayoutParams lp = (LayoutParams) child.getLayoutParams();

            if (lp.childType == LayoutParams.CHILD_TYPE_CHALLENGE) {
                // Challenge views pin to the bottom, offset by a portion of their height,
                // and center horizontally.
                final int center = (paddingLeft + width - paddingRight) / 2;
                final int childWidth = child.getMeasuredWidth();
                final int childHeight = child.getMeasuredHeight();
                final int left = center - childWidth / 2;
                final int layoutBottom = height - paddingBottom - lp.bottomMargin - mInsets.bottom;
                // We use the top of the challenge view to position the handle, so
                // we never want less than the handle size showing at the bottom.
                final int bottom = layoutBottom + (int) ((childHeight - mChallengeBottomBound)
                        * (1 - mChallengeOffset));
                child.setAlpha(getChallengeAlpha());
                child.layout(left, bottom - childHeight, left + childWidth, bottom);
            } else if (lp.childType == LayoutParams.CHILD_TYPE_EXPAND_CHALLENGE_HANDLE) {
                final int center = (paddingLeft + width - paddingRight) / 2;
                final int left = center - child.getMeasuredWidth() / 2;
                final int right = left + child.getMeasuredWidth();
                final int bottom = height - paddingBottom - lp.bottomMargin - mInsets.bottom;
                final int top = bottom - child.getMeasuredHeight();
                child.layout(left, top, right, bottom);
            } else if (lp.childType == LayoutParams.CHILD_TYPE_SCRIM) {
                // Scrim views use the entire area, including padding & insets
                child.layout(0, 0, getMeasuredWidth(), getMeasuredHeight());
            } else {
                // Non-challenge views lay out from the upper left, layered.
                child.layout(paddingLeft + lp.leftMargin,
                        paddingTop + lp.topMargin + mInsets.top,
                        paddingLeft + child.getMeasuredWidth(),
                        paddingTop + child.getMeasuredHeight() + mInsets.top);
            }
        }

        if (!mHasLayout) {
            mHasLayout = true;
        }
    }

    @Override
    public void draw(Canvas c) {
        super.draw(c);
        if (DEBUG) {
            final Paint debugPaint = new Paint();
            debugPaint.setColor(0x40FF00CC);
            // show the isInDragHandle() rect
            c.drawRect(mDragHandleEdgeSlop,
                    mChallengeView.getTop() - getDragHandleSizeAbove(),
                    getWidth() - mDragHandleEdgeSlop,
                    mChallengeView.getTop() + getDragHandleSizeBelow(),
                    debugPaint);
        }
    }

    public void computeScroll() {
        super.computeScroll();

        if (!mScroller.isFinished()) {
            if (mChallengeView == null) {
                // Can't scroll if the view is missing.
                Log.e(TAG, "Challenge view missing in computeScroll");
                mScroller.abortAnimation();
                return;
            }

            mScroller.computeScrollOffset();
            moveChallengeTo(mScroller.getCurrY());

            if (mScroller.isFinished()) {
                post(mEndScrollRunnable);
            }
        }
    }

    private void cancelTransitionsInProgress() {
        if (!mScroller.isFinished()) {
            mScroller.abortAnimation();
            completeChallengeScroll();
        }
        if (mFader != null) {
            mFader.cancel();
        }
    }

    public void fadeInChallenge() {
        fadeChallenge(true);
    }

    public void fadeOutChallenge() {
        fadeChallenge(false);
    }

    public void fadeChallenge(final boolean show) {
        if (mChallengeView != null) {

            cancelTransitionsInProgress();
            float alpha = show ? 1f : 0f;
            int duration = show ? CHALLENGE_FADE_IN_DURATION : CHALLENGE_FADE_OUT_DURATION;
            mFader = ObjectAnimator.ofFloat(mChallengeView, "alpha", alpha);
            mFader.addListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationStart(Animator animation) {
                    onFadeStart(show);
                }
                @Override
                public void onAnimationEnd(Animator animation) {
                    onFadeEnd(show);
                }
            });
            mFader.setDuration(duration);
            mFader.start();
        }
    }

    private int getMaxChallengeBottom() {
        if (mChallengeView == null) return 0;
        final int layoutBottom = getLayoutBottom();
        final int challengeHeight = mChallengeView.getMeasuredHeight();

        return (layoutBottom + challengeHeight - mChallengeBottomBound);
    }

    private int getMinChallengeBottom() {
        return getLayoutBottom();
    }

    private void onFadeStart(boolean show) {
        mChallengeInteractiveInternal = false;
        enableHardwareLayerForChallengeView();

        if (show) {
            moveChallengeTo(getMinChallengeBottom());
        }

        setScrollState(SCROLL_STATE_FADING);
    }

    private void enableHardwareLayerForChallengeView() {
        if (mChallengeView.isHardwareAccelerated()) {
            mChallengeView.setLayerType(LAYER_TYPE_HARDWARE, null);
        }
    }

    private void onFadeEnd(boolean show) {
        mChallengeInteractiveInternal = true;
        setChallengeShowing(show);

        if (!show) {
            moveChallengeTo(getMaxChallengeBottom());
        }

        mChallengeView.setLayerType(LAYER_TYPE_NONE, null);
        mFader = null;
        setScrollState(SCROLL_STATE_IDLE);
    }

    public int getMaxChallengeTop() {
        if (mChallengeView == null) return 0;

        final int layoutBottom = getLayoutBottom();
        final int challengeHeight = mChallengeView.getMeasuredHeight();
        return layoutBottom - challengeHeight - mInsets.top;
    }

    /**
     * Move the bottom edge of mChallengeView to a new position and notify the listener
     * if it represents a change in position. Changes made through this method will
     * be stable across layout passes. If this method is called before first layout of
     * this SlidingChallengeLayout it will have no effect.
     *
     * @param bottom New bottom edge in px in this SlidingChallengeLayout's coordinate system.
     * @return true if the challenge view was moved
     */
    private boolean moveChallengeTo(int bottom) {
        if (mChallengeView == null || !mHasLayout) {
            return false;
        }

        final int layoutBottom = getLayoutBottom();
        final int challengeHeight = mChallengeView.getHeight();

        bottom = Math.max(getMinChallengeBottom(),
                Math.min(bottom, getMaxChallengeBottom()));

        float offset = 1.f - (float) (bottom - layoutBottom) /
                (challengeHeight - mChallengeBottomBound);
        mChallengeOffset = offset;
        if (offset > 0 && !mChallengeShowing) {
            setChallengeShowing(true);
        }

        mChallengeView.layout(mChallengeView.getLeft(),
                bottom - mChallengeView.getHeight(), mChallengeView.getRight(), bottom);

        mChallengeView.setAlpha(getChallengeAlpha());
        if (mScrollListener != null) {
            mScrollListener.onScrollPositionChanged(offset, mChallengeView.getTop());
        }
        postInvalidateOnAnimation();
        return true;
    }

    /**
     * The bottom edge of this SlidingChallengeLayout's coordinate system; will coincide with
     * the bottom edge of mChallengeView when the challenge is fully opened.
     */
    private int getLayoutBottom() {
        final int bottomMargin = (mChallengeView == null)
                ? 0
                : ((LayoutParams) mChallengeView.getLayoutParams()).bottomMargin;
        final int layoutBottom = getMeasuredHeight() - getPaddingBottom() - bottomMargin
                - mInsets.bottom;
        return layoutBottom;
    }

    /**
     * The bottom edge of mChallengeView; essentially, where the sliding challenge 'is'.
     */
    private int getChallengeBottom() {
        if (mChallengeView == null) return 0;

        return mChallengeView.getBottom();
    }

    /**
     * Show or hide the challenge view, animating it if necessary.
     * @param show true to show, false to hide
     */
    public void showChallenge(boolean show) {
        showChallenge(show, 0);
        if (!show) {
            // Block any drags in progress so that callers can use this to disable dragging
            // for other touch interactions.
            mBlockDrag = true;
        }
    }

    private void showChallenge(int velocity) {
        boolean show = false;
        if (Math.abs(velocity) > mMinVelocity) {
            show = velocity < 0;
        } else {
            show = mChallengeOffset >= 0.5f;
        }
        showChallenge(show, velocity);
    }

    private void showChallenge(boolean show, int velocity) {
        if (mChallengeView == null) {
            setChallengeShowing(false);
            return;
        }

        if (mHasLayout) {
            mChallengeShowingTargetState = show;
            final int layoutBottom = getLayoutBottom();
            animateChallengeTo(show ? layoutBottom :
                    layoutBottom + mChallengeView.getHeight() - mChallengeBottomBound, velocity);
        }
    }

    @Override
    public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attrs) {
        return new LayoutParams(getContext(), attrs);
    }

    @Override
    protected ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams p) {
        return p instanceof LayoutParams ? new LayoutParams((LayoutParams) p) :
                p instanceof MarginLayoutParams ? new LayoutParams((MarginLayoutParams) p) :
                new LayoutParams(p);
    }

    @Override
    protected ViewGroup.LayoutParams generateDefaultLayoutParams() {
        return new LayoutParams();
    }

    @Override
    protected boolean checkLayoutParams(ViewGroup.LayoutParams p) {
        return p instanceof LayoutParams;
    }

    public static class LayoutParams extends MarginLayoutParams {
        public int childType = CHILD_TYPE_NONE;
        public static final int CHILD_TYPE_NONE = 0;
        public static final int CHILD_TYPE_CHALLENGE = 2;
        public static final int CHILD_TYPE_SCRIM = 4;
        public static final int CHILD_TYPE_WIDGETS = 5;
        public static final int CHILD_TYPE_EXPAND_CHALLENGE_HANDLE = 6;

        public int maxHeight;

        public LayoutParams() {
            this(MATCH_PARENT, WRAP_CONTENT);
        }

        public LayoutParams(int width, int height) {
            super(width, height);
        }

        public LayoutParams(android.view.ViewGroup.LayoutParams source) {
            super(source);
        }

        public LayoutParams(MarginLayoutParams source) {
            super(source);
        }

        public LayoutParams(LayoutParams source) {
            super(source);

            childType = source.childType;
        }

        public LayoutParams(Context c, AttributeSet attrs) {
            super(c, attrs);

            final TypedArray a = c.obtainStyledAttributes(attrs,
                    R.styleable.SlidingChallengeLayout_Layout);
            childType = a.getInt(R.styleable.SlidingChallengeLayout_Layout_layout_childType,
                    CHILD_TYPE_NONE);
            maxHeight = a.getDimensionPixelSize(
                    R.styleable.SlidingChallengeLayout_Layout_layout_maxHeight, 0);
            a.recycle();
        }
    }
}


CORVALLIS, Ore. - A new material created by Oregon State University researchers is a key step toward the next generation of supercomputers.
Those "quantum computers" will be able to solve problems well beyond the reach of existing computers while working much faster and consuming vastly less energy.
Researchers in OSU's College of Science have developed an inorganic compound that adopts a crystal structure capable of sustaining a new state of matter known as quantum spin liquid, an important advance toward quantum computing.
In the new compound, lithium osmium oxide, osmium atoms form a honeycomb-like lattice, enforcing a phenomenon called "magnetic frustration" that could lead to quantum spin liquid as predicted by condensed matter physics theorists.
Corresponding author Mas Subramanian, Milton Harris Professor of Materials Science at OSU, explains that in a permanent magnet like a compass needle, the electrons spin in an aligned manner - that is, they all rotate in the same direction.
"But in a frustrated magnet, the atomic arrangement is such that the electron spins cannot achieve an ordered alignment and instead are in a constantly fluctuating state, analogous to how ions would appear in a liquid," Subramanian said.
Ramirez also noted that this study demonstrates the importance of multidisciplinary collaboration involving materials chemists and condensed matter physicists engaged in synthesis, theory and measurements to tackle emerging science like quantum spin liquid.
The National Science Foundation is funding the research through its DMREF program: Designing Materials to Revolutionize and Engineer our Future. Findings were published today in Scientific Reports.
The concept of quantum computing is based on the ability of subatomic particles to exist in more than one state at any time.
Classical computing relies on bits - pieces of information that exist in one of two states, a 0 or a 1. In quantum computing, information is translated to quantum bits, or qubits, that can store much more information than a 0 or 1 because they can be in any "superposition" of those values.
Think of bits and qubits by visualizing a sphere. A bit can only be at either of the two poles on the sphere, whereas a qubit can be anywhere on the sphere. What that means is much more information storage potential and much less energy consumption.


Community Therapy Services (CTS) provides a comprehensive range of multi-disciplinary rehabilitation services.
Patients are provided an individually tailored, short-term, goal-orientated therapy program with an emphasis on patient education, self-management and carer support.
Each Community Therapy Services program is different and is designed to suit the needs of the patient. As such, patients may receive therapy as an individual or as part of a group. The therapists may also see patients in their home, at the hospital or a combination of both. The length of time a patient will be involved with Community Therapy Services will be established with them, taking into account their goals and capabilities.
OT home safety assessments will be conducted as part of an integrated rehabilitation program but not in isolation and not for major home modifications or complex equipment prescription (scooters, wheelchairs, seating and bedding, pressure care). Refer to local Community Health Service for more information.
*Patients living out of catchment area and/or eligible funded therapy may be accepted if they require amputee rehabilitation, hand therapy only, vestibular physiotherapy or neuropsychology only.
We accept referrals from any source for this service, including GPs, family, carers, case managers and self-referral.
The Direct Access Unit also welcomes phone enquiries to discuss potential referrals or an existing referral.
Referrals are triaged depending on priority. Emergency cases can present to the Emergency & Trauma Service at any time.
To refer a patient, complete and fax your referral to Direct Access Unit on (03) 8387 2217.
You can use the following forms or a template from your own system.
Consider making referrals for chronic conditions indefinite.
Once a referral has been received, a Care Coordinator will phone the patient to discuss their needs and organise appropriate services. The Care Coordinator will provide the patient with their phone number. Patients are encouraged to contact the Care Coordinator if they have any concerns.
Contact us if you need an accessible version of a download.
Print this section Did this page help you?
Support the important work of The Royal Melbourne Hospital by making a much-needed donation today.
This hospital does not cater for childbirth or provide children's services.
The RMH acknowledges owners of the land on which the hospital site is located, the Wurundjeri people of the Kulin nation.
What's around the City Campus?
What's around the Royal Park Campus?
What is a Consumer Representative?
Who pays for our services?
2018 Ride to Recovery's incredible result!
Did this page help you ?


text:
Q: expansion of polynomials of higher degrees How to expand $(x-x_n)(x-x_{n-1})...(x-x_0)$ into $a_nx^n+...+a_0$? Surely, $a_n=1$ is equal to one in my case, but how to find out the rest of coefficients? Do we a numerical algorithm of calculating them?

A: Hint. To find all the coefficients of the expansion, you may consider what we call elementary symmetric polynomials:
$$e_k(x) = \sum_{1 \leq i_1 < i_2 \dots < i_k \leq n} x_{i_1}x_{i_2}\dots x_{i_k}.$$
Have a look here: elementary symmetric polynomials.

redpajama_set_name: RedPajamaStackExchange


text:
RescueLogic makes it easy to monitor building safety and security from a standard personal computer — and it's been tried, tested, and proven to work by customers just like you, all around the world.
Our company's founder, Dan Horon, was a fledgling fire protection engineer when he decided to use AutoCAD to show fire alarms on a floor plan. His idea was a stroke of innovation, imagination, and inspiration.
Horon's invention immediately solved a whole host of problems. Before he introduced his software, it was almost impossible to update and monitor fire-alarm systems as buildings were updated and remodeled. Technicians and building managers were frustrated by alarm systems that combined hardware and devices from multiple manufacturers — most of which didn't communicate with each other, or work well in combination. And when alarms went off during tests, false alarms, or emergencies, security teams were forced to analyze confusing numeric data, assess events on the fly, and create service records and reports by hand.
Horon started selling the software by word of mouth, to customers who were serious about managing their facilities. He developed a simple plug-and-play import function to get data from alarm systems and devices, as well as an intuitive drag-and-drop process for showing them on maps and floor plans. The software even works with building control systems. In fact, it's an ingenious tool for total facility management alerts.
For years, Horon sold the software as Cadgraphics. The newest version of the software, RescueLogic, integrates fully with the industry's most popular fire and security alarms, panels, devices, and networks — and it uses standard computers, laptops, printers, and sends alerts to cell phones.
Today, RescueLogic is the only software-based fire alarm receiver tested and recognized by UL. If you have your own 24/7 monitoring station, now you can use your own network.
Let's make sure your people and property are protected with the latest RescueLogic technology. Call us at (612) 722-3233, email info@rescuelogic.com, or use this form to contact us.

redpajama_set_name: RedPajamaCommonCrawl


text:
package org.wso2.carbon.databridge.core.internal.authentication;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.wso2.carbon.analytics.idp.client.core.exception.IdPClientException;
import org.wso2.carbon.analytics.idp.client.core.utils.IdPClientConstants;
import org.wso2.carbon.databridge.core.DataBridgeServiceValueHolder;
import org.wso2.carbon.databridge.core.utils.AgentSession;

import java.util.HashMap;
import java.util.Map;

/**
 * CarbonAuthenticationHandler implementation that authenticate Agents.
 * via Carbon AuthenticationService
 */

public class CarbonAuthenticationHandler implements AuthenticationHandler {
    private static final Logger LOG = LoggerFactory.getLogger(CarbonAuthenticationHandler.class);

    public boolean authenticate(String userName, String password) {
        try {
            Map<String, String> loginProperties = new HashMap<>();
            loginProperties.put(IdPClientConstants.USERNAME, userName);
            loginProperties.put(IdPClientConstants.PASSWORD, password);
            loginProperties.put(IdPClientConstants.GRANT_TYPE, IdPClientConstants.PASSWORD_GRANT_TYPE);
            Map<String, String> login = DataBridgeServiceValueHolder.getIdPClient().login(loginProperties);
            String loginStatus = login.get(IdPClientConstants.LOGIN_STATUS);
            if (loginStatus.equals(IdPClientConstants.LoginStatus.LOGIN_SUCCESS)) {
                return true;
            } else {
                LOG.error("Authentication failed for username '" + userName + "'. Error : '"
                        + login.get(IdPClientConstants.ERROR) + "'. Error Description : '"
                        + login.get(IdPClientConstants.ERROR_DESCRIPTION) + "'");
                return false;
            }
        } catch (IdPClientException e) {
            return false;
        }
    }

    @Override
    public void initContext(AgentSession agentSession) {
        //Not required
    }

    @Override
    public void destroyContext(AgentSession agentSession) {
        //Not required
    }

}

redpajama_set_name: RedPajamaGithub


text:
Q: Long horizontal line between words I want to make a table with several columns, two of them are long horizontal lines, as appears in the image. Could anyone help me?

A: You can use a TikZ matrix of nodes. Please note that it is a bit inconvenient to answer questions which only have a screen shot. I am not good at typing, so I just copied one row, you will need to change the texts yourself.
\documentclass{article}
\usepackage{booktabs}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{table}[htb]
\caption{A table.}
\centering\vspace*{0.2em}
\begin{tabular}{c}
\toprule
\begin{tikzpicture}[font=\sffamily]
\matrix[matrix of math nodes,nodes={anchor=center},
 column sep={width("hexagonal")+2em},
 execute at end matrix={
 \foreach \YY in {2,...,\the\pgfmatrixcurrentrow}
 {\foreach \XX in {2,...,\the\pgfmatrixcurrentcolumn}
 {\draw (\tikzmatrixname-\YY-\the\numexpr\XX-1) --
 (\tikzmatrixname-\YY-\XX);} }}] (mat){
 \mathsf{D}_{3d} & \mathsf{O}_{h} & \mathsf{D}_{4h} \\[2.5em]
 \mathsf{A}_{1g} & \mathsf{A}_{1g} & \mathsf{A}_{1g}\\
 \mathsf{A}_{1g} & \mathsf{A}_{2g} & \mathsf{B}_{1g}+E_{1g}\\
 \mathsf{A}_{1g}+E_{1g} & \mathsf{A}_{2g} & \mathsf{A}_{1g}+E_{1g}\\
 \mathsf{A}_{2g}+E_{1g} & \mathsf{A}_{2g} & \mathsf{B}_{1g}\\
 \mathsf{A}_{1g} & \mathsf{A}_{2g} & \mathsf{B}_{1g}\\[1.5em]
 \mathsf{A}_{1g} & \mathsf{A}_{1g} & \mathsf{A}_{1g}\\
 \mathsf{A}_{1g} & \mathsf{A}_{2g} & \mathsf{B}_{1g}+E_{1g}\\
 \mathsf{A}_{1g}+E_{1g} & \mathsf{A}_{2g} & \mathsf{A}_{1g}+E_{1g}\\
 \mathsf{A}_{2g}+E_{1g} & \mathsf{A}_{2g} & \mathsf{B}_{1g}\\
 \mathsf{A}_{1g} & \mathsf{A}_{2g} & \mathsf{B}_{1g}\\
 };
 \draw[latex-latex] (mat-1-1) -- node[above]{trigonal}
  node[below,align=center]{distortion\\[1ex] (along $\mathsf{C}_3$)} (mat-1-2);
 \draw[latex-latex] (mat-1-2) -- node[above]{tetragonal}
  node[below,align=center]{distortion\\[1ex] (along $\mathsf{C}_4$)} (mat-1-3);
\end{tikzpicture}\\
\bottomrule
\end{tabular}
\end{table}
\end{document}

EDIT: Made the sizes of the entries different to show that the lines really go to these entries and do not stop at a common horizontal point.

A: An option, if lines are okay to stay within their column:

\documentclass{article}

\usepackage{booktabs,mathtools,xhfill}

\newcommand{\ch}[2]{\ensuremath{\mathrm{#1}_{\mathrm{#2}}}}
\newcommand{\fromto}[3]{#1 & \xrfill[.5ex]{.4pt} & #2 & \xrfill[.5ex]{.4pt} & #3}

\begin{document}

\begin{table}
  \centering
  \caption{A table}
  \begin{tabular}{ c @{\,} c @{\,} c @{\,} c @{\,} c }
    \toprule
    \ch{D}{3d} &
      $\xleftrightarrow[\substack{\text{distortion} \\ \text{(along \ch{C}{3})}}]{\text{trigonal}}$ &
      \ch{O}{h} &
      $\xleftrightarrow[\substack{\text{distortion} \\ \text{(along \ch{C}{4})}}]{\text{tetragonal}}$ &
      \ch{D}{4h} \\
    \addlinespace
    \fromto{\ch{A}{1g}}{\ch{A}{1g}}{\ch{A}{1g}} \\
    \fromto{\ch{A}{2g}}{\ch{A}{2g}}{\ch{B}{1g}} \\
    \fromto{\ch{E}{g}} {\ch{E}{g}} {$\ch{A}{1g} + \ch{B}{1g}$} \\
    \fromto{$\ch{A}{2g} + \ch{E}{g}$}{\ch{T}{1g}}{$\ch{A}{2g} + \ch{E}{g}$} \\
    \fromto{$\ch{A}{1g} + \ch{E}{g}$}{\ch{T}{2g}}{$\ch{B}{2g} + \ch{E}{g}$} \\
    \addlinespace
    \fromto{\ch{A}{1u}}{\ch{A}{1u}}{\ch{A}{1u}} \\
    \fromto{\ch{A}{2u}}{\ch{A}{2u}}{\ch{B}{1u}} \\
    \fromto{\ch{E}{u}} {\ch{E}{u}} {$\ch{A}{1u} + \ch{B}{1u}$} \\
    \fromto{$\ch{A}{2u} + \ch{E}{u}$}{\ch{T}{1u}}{$\ch{A}{2u} + \ch{E}{u}$} \\
    \fromto{$\ch{A}{1u} + \ch{E}{u}$}{\ch{T}{2u}}{$\ch{B}{2u} + \ch{E}{u}$} \\
    \bottomrule
  \end{tabular}
\end{table}

\end{document}


text:
Q: Taking Multiple User Inputs and Displaying as a String Below I'm pretty new to this, but I'll try my best to explain what I need help with.
I am trying to take user input in a text box form and when they press 'submit' add it to a paragraph below.
As an example, if we have a text box form with a submit button and I type 'yes' and you type 'no', a paragraph below would then display 'yes no'. If John came two days later and typed 'maybe' into the text box then hit submit, the paragraph below would display 'yes no maybe'.
I know a lot of HTML and CSS and am still learning PHP and Javascript (and struggling to learn how to store data), so simplest terms possible here, please. I've been trying to learn to do this on stack overflow, but I feel pretty over my head with this one.


TRIUMPH'S INDIA chief is eyeing a 10 per cent rise in sales for the next financial year.
Managing director Vimal Sumbly says he expects the firm to top 1300 sales by the end of this month from its 15 outlets across the country while a 16th will open later this week.
In the last four years, the overall motorcycle sales grew by two per cent while Triumph posted 63 per cent growth with a majority of sales coming from its more classic models.
"For the next financial '18-'19, we are looking at 10 per cent growth" he said.


The "Lillian's Fashions & Bridals" vendor provides a diversified product line of wedding dresses from celebrity decorators. In our boutique you will see dresses for any fancy: a variety of styles, rich colors, shapes, etc. Every fiancee tries to find a bridal dress in which she will look graceful, exquisite and stylish. All collections emphasize the purity, graceful, innovation and youthfulness of any bride. Our consultants will help You make the accurate selection. We wholeheartedly desire any girl to be the most magnificent Bride! We are waiting for You!
Wedding Dresses, Bridesmaid Dresses, Puffy Gowns, Flower Girl Dresses, Shower Dresses, Dresses, Bridal Dresses, Wedding Veils, Bridal Shoes, Accessories, Bridal Stylists, Alterations, Online Ordering, Private Appointments Available, Plus Size Available, Fashion Services, Group Discounts, Custom Designs, Rentals, Dry Cleaning, etc.


text:
Rahul visits Jaya at hospital, says she is improving
By Chennaivision in Chennai News October 7, 2016
Apollo Hospitals in Chennai had a surprise visitor today, as Congress vice-president Rahul Gandhi came there to visit chief minister J Jayalalithaa.
Talking to reporters after interacting with the doctors team, he said the chief minister is improving and will be alright soon. "I came here to convey the good wishes of Congress president," he said.
During his visit, Rahul Gandhi, accompanied by TNCC President Su Thirunavukkarasar, enquired with the doctors on the nature of treatment being given to Jayalalithaa.
As the visit of Rahul Gandhi was known only at the last minute, police have made elaborate security arrangements both at the airport and at the hospital.
Jayalalithaa, who was admitted to Apollo Hospitals in Chennai a fortnight ago, continues to remain on respiratory support but is "improving and making gradual progress," said a press release issued by the hospital on Thursday evening.
In the most elaborate health bulletin yet on the status of Jayalalithaa, the press release said the "present treatment regimen includes continued respiratory support, nebulisation, drugs to decongest the lungs, antibiotics, nutrition, general nursing care and supportive therapy."
Jayalalithaa needs "a longer stay in hospital" and is "making gradual progress," said doctors who are attending to the 68-year-old politician. The update confirmed that Jayalalithaa remains on respiratory support and is being treated, including by a UK specialist, for lung problems.
Tags: Chennai, featured, Rahul Gandhi
Sivakarthikeyan makes his first Fan Visit to the UAE to promote 'REMO' movie
Don't use Chinese products: Vivekh


text:
Craig Swendson is brewing in the Kootenays
Craig Swendson: Brewing in the Kootenays
Craig Swendson is the proud owner and operator of Torchlight Brewing Co., one of Nelson's most flourishing businesses
by Danielle Cameron — March 23, 2017
Craig Swendson, owner/operator of Torchlight Brewing Co. in Nelson, B.C. — Photo courtesy Craig Swendson
Craig Swendson took a passion for great beer and turned it into an enterprise. He now owns Torchlight Brewing Co. in Nelson, alongside his business partner, Josh Secord.
Swendson sat down with Kootenay Business and shared some of his insights:
How did you come to choose this line of work?
It really came out of a passion for great beer. I was visiting my now-business partner, Josh Secord, in Halifax while I was on a cross-Canada motorcycle trip. (That's) when we came up with the idea for Torchlight Brewing.
What is it about your work that has you excited to get out of bed in the morning?
Making beer can actually be a great creative outlet. It's both art and science and that fits my personality well. It's a fun business to be involved in. Good beer tends to make everyone have a better day.
Where do you like to spend your downtime in the Kootenays?
Downtime? What's that? I haven't had much downtime lately with working on expanding into our new facility, but during the summer at least, I like to spend as much time out on Kootenay Lake as I can.
What has motivated you throughout your entrepreneurial journey?
Starting and running a business is full of challenges, especially if it's growing like Torchlight. That means that there is always something new to work towards achieving. The drive to create has been a primary motivator for me. That applies to creating new and interesting beers, as well as to our new brewery and lounge space that we are opening this spring.
Torchlight Brewing Co.
http://www.torchlightbrewing.com/
Did we miss anyone? Meanwhile, if you think we missed someone who should have been nominated, we'd be happy to consider them for inclusion on next year's list. Click here to nominate your pick for the 2018 40 under 40 list.
2016 40 Under 40 List See who made the 40 Under 40 list in 2016.
Danielle Cameron is a writer and web editor for several publications and has been practising as a Certified Herbal Practitioner since 2005. View all of Danielle Cameron's articles
West Kootenay, Nelson, 40 Under 40 Determination meets inspiration in the West Kootenay
Meet Sydney Black, executive director of the Nelson & District Arts Council and founder of Black Productions.
May 2019 by Danielle Cameron
West Kootenay, Grand Forks, 40 Under 40 Caring for kids in Grand Forks
When Jillian Shannon opened her child-care centre in Grand Forks, she had no idea how warmly she would be welcomed.
40 Under 40 2019 40 under 40 rising stars of business
Our fourth annual 40 under 40 list is a salute to some of the leading entrepreneurs in the Kootenays.
View all 40 Under 40 articles


How Do I Automatically Reply To Someone on Twitter?
1. Click on Services and then select the Apps option from the list to the left.
2. Click the Add option where the Auto Reply service is listed.
3. Add a relevant description for the Service.
4. Select the Twitter account you want the automation to apply to.
5. Select whether you want to reply based on matches found in Tweets or Profiles. Please Note: the system can currently only return a limited number of results based on Profiles so if you select this option, you should edit this service once replies are no longer being sent so that it matches results in Tweets instead.
6. Add the keywords or interests that you want the system to search for.
7. Add how often you want the system to send out replies.
8. Include the messages you want to send out. These will be selected at random and each message should be included on a separate line (you can drag the lower corner of the text box to make it larger) and each should be under 140 characters. You can also include merge tags as highlighted below the text box so that replies are personalized.
9. Select how many Tweets you want to send out each time (based on the frequency you selected in point 7) and whether you only want to reply to Tweets that match a particular sentiment. Please note: as the system determines the sentiment of a Tweet, it may not always be entirely accurate as it cannot pick up on things such as sarcasm or slang.
10. Select which language the keywords you want to reply to should be in.
11. If you only want to reply to Twitter users within a specific area or location, you can add the Country, City or town or provide a specific Longitude or Latitude. You can also select the distance around that area you want to include.
12. You can also select to automatically follow Twitter users you reply to.
13. If you select to follow those you reply to, you can then also select whether you want to receive email notifications when you follow Twitter accounts. Put the email address/es you want to receive these email notifications into the text box provided.
14. Lastly, you can Activate or Pause an automation to meet your needs. When you're ready, click the Save Settings button.


text:
Q: Calculate power of a matrix using jordan form I need to calculate:
$$
\begin{bmatrix}
1&1\\
-1&3
\end{bmatrix}^{50}
$$
The solution i have uses jordan form and get to:

There are some points that i dont understand:
$1.$ In the right upper corner of the matrix, last line of the solution, he changed the $1$ to $50 \cdot 2^{49}$ why? how?
$2.$ What is the $P_A$? He didnt realy get to a final solution... where is the asnwer? how do i get to $P_A$?

A: You should already have learned what $P_A$ is before coming to this example of the use of the JCF: it's a matrix of generalized eigenvectors of $A$. I'm not going to go into that any more than this because there are plenty of resources that describe this in excruciating detail. I suggest looking earlier in the course material when the Jordan decomposition itself is explained.
As to how powers of the JCF are computed, the easiest way I know is to write $$J=\begin{bmatrix}\lambda&1\\0&\lambda\end{bmatrix} = \begin{bmatrix}\lambda&0\\0&\lambda\end{bmatrix}+\begin{bmatrix}0&1\\0&0\end{bmatrix} = \lambda I+N.$$ Now, observe that $N^2=0$. Multiples of the identity matrix commute with everything, we can expand using the binomial theorem: $$(\lambda I+N)^n = (\lambda I)^n+n(\lambda I^{n-1})N+\cdots = \lambda^n I+n\lambda^{n-1}N = \begin{bmatrix}\lambda^n&n\lambda^{n-1}\\0&\lambda^n\end{bmatrix}$$ since all of the terms that involve $N^2$ or a higher power of $N$ vanish. You can use a similar decomposition for powers of larger Jordan blocks: the expansion will terminate after a number of terms equal to the size of the block.
I suspect that you're expected to perform a full Jordan decomposition in your solutions to exercises like this one, but the above derivation suggests a way to compute this knowing only the (repeated) eigenvalue. We have $$A^n = P_AJ^nP_A^{-1} = P_A(\lambda^nI+n\lambda^{n-1}N)P_A^{-1} = \lambda^nI + n\lambda^{n-1}(P_ANP_A^{-1}),$$ but $P_ANP_A^{-1} = A-\lambda I$, so $$A^n = \lambda^nI+n\lambda^{n-1}(A-\lambda I).$$ For the matrix in your question, this yields $$2^{50}I+50\cdot2^{49}\begin{bmatrix}-1&1\\-1&1\end{bmatrix}.$$

A: There are two ways to construct a change of basis matrix $P$ for Jordan form. The way I like is to take the matrix $A-2I,$ which squares to the $0$ matrix, and pick a column vector it does NOT annihilate. I like to put in a single 1 if I can, so let the column vector $v$ be $v=(0,1)^T.$ Then the left column is $u = (A-2I)v,$ so that
$$
P =
\left(
\begin{array}{rr}
 1 & 0 \\
1 & 1
\end{array}
\right)
$$
of determinant $1,$ which helps. keep the inverse with small denominator, namely $1.$
$$
P^{-1} =
\left(
\begin{array}{rr}
 1 & 0 \\
-1 & 1
\end{array}
\right)
$$
$$
\left(
\begin{array}{rr}
 1 & 0 \\
-1 & 1
\end{array}
\right)
\left(
\begin{array}{rr}
 1 & 1 \\
-1 & 3
\end{array}
\right)
\left(
\begin{array}{rr}
 1 & 0 \\
1 & 1
\end{array}
\right) =  J =
\left(
\begin{array}{rr}
 2 & 1 \\
0 & 2
\end{array}
\right)
$$
===============
parisize = 4000000, primelimit = 500000
? a = [ 1,1; -1,3]
%1 =
[ 1 1]

[-1 3]

? charpoly(a)
%2 = x^2 - 4*x + 4
? factor(charpoly(a))
%3 =
[x - 2 2]

? minpoly(a)
%4 = x^2 - 4*x + 4
? b = a - 2 * matid(2)
%5 =
[-1 1]

[-1 1]

? b^2
%6 =
[0 0]

[0 0]

? p = [ 1,0; 1,1]
%7 =
[1 0]

[1 1]

? matdet(p)
%8 = 1
? pinv = matadjoint(p)
%9 =
[ 1 0]

[-1 1]

? pinv * p
%10 =
[1 0]

[0 1]

? pinv *a * p
%11 =
[2 1]

[0 2]

?

=============

A: Ok, so as it may be that someone else will be stack as i did, i will write here what i found in the end.
The answer to the first question:
It seems that there is a formula for power of Jordan blocks of the form:
$$
\begin{bmatrix}
\lambda_0 & 1 \\
0 & \lambda_0
\end{bmatrix}^m = \begin{bmatrix}
\lambda_0^m & m \lambda_0^{m-1} \\
0 & \lambda_0^m
\end{bmatrix}
$$

The answer to the second question: didnt found yet, ill update that post if i will find (and remember)


text:
Books by Refugees in America, Writers Plan to Lobby at AWP, and More
Every day Poets & Writers Magazine scans the headlines—from publishing reports to academic announcements to literary dispatches—for all the news that creative writers need to know. Here are today's stories:
Next weekend, more than twelve thousand writers are expected to attend the Association of Writers and Writing Programs' annual conference in Washington, D.C. In addition to attending panels, readings, and a book fair, a number of writers groups are planning to lobby on Capitol Hill and protest the president's new agenda. (Flavorwire)
Poet Kaveh Akbar responded to the president's recent anti-immigration travel ban by sharing poems on social media written by poets from Iran, Libya, Yemen, Sudan, Somalia, Iraq, and Syria—the seven countries affected by the executive order. (PBS NewsHour)
Meanwhile, the New York Times recommends twenty-five books by refugees in America, including Reinaldo Arenas's Before Night Falls, Thomas Mann's Doctor Faustus, and Karl Polanyi's The Great Transformation.
"The word diversity has as of late become so overused as to be meaningless…. The word diversity is, in its most imprecise uses, a placeholder for issues of inclusion, recruitment, retention and representation." Roxane Gay's keynote at the American Booksellers Association's Winter Institute called on booksellers to take direct action regarding the industry's diversity problem. (Publishers Weekly)
Twenty years since the publication of her Booker Prize–winning debut novel The God of Small Things, writer and activist Arundhati Roy is returning to fiction with a novel she has been working on for nearly a decade. Knopf will release The Ministry of Utmost Happiness in June. (New York Times)
The U.K.–based Women's Prize for Fiction is seeking a new sponsor for 2018 following the end of its four-year sponsorship by Baileys liquor. For the past twenty-two years, the prize, which was previously sponsored by Orange, has awarded £30,000 to an exceptional English-language novel by a woman each year.
Poet Ruby Brunton considers debut books published in 2016—Joni Murphy's novel, Double Teenage, Natasha Stagg's novel, Surveys, and Tommy Pico's poetry book, IRL—that address what it means to come of age in "modern dystopia." (New Inquiry)
Acclaimed author Amy Tan is among the investors for Radish, a new mobile serialized fiction app, which has now raised $3 million in seed funding. Tan says that the app's format makes sense for readers and writers alike: "Readers read for free and pay a small amount only if they want to read the next installment…. The writers get paid immediately—and they still retain copyright and can later publish in another format." (TechCrunch)


Those of you that are interested D/L it now! and I'll see you server side!!
bit of info though, it's very slow and in very early release so quite a few bugs.
i love the way you have to aim though, i will be interested more in this once they've ironed out all the bugs and sped up gameplay a bit.
i also like the way you can climb over stuff definate potential.
I like this mod i am a DoD:S player but i find RnL really good fun.
Any one in the community still on this i still play every day?
Yeah it's definitely one of the best mods for HL:2.


We raised the roof in this home to create an elevated ceiling in the living room. While we were at it, we replaced surfaces throughout the interior to modernize the look. We also completely changed the back yard: resurfacing the pool, terracing the back yard, and adding a shady pergola.


Xi'an is another well known city in central China. One of China's oldest cities, it's home to the famous Terracotta Soldiers among other attractions, making it a logical stop for me on my trek back towards the eastern coast of China.
A 345CNY overnight train put me in Xi'an at a convenient time mid-morning, which is when my phone promptly died, leaving me wandering the streets of the 'Muslim Quarter' trying to find my hostel. Once I did, though, I was reassured by the fact that I would not have to share my bed with another dude. Good news.
The heart of Xi'an is surrounded by a huge wall, which has been reconstructed several times since its construction in the 1400's. Within the wall is the aforementioned Muslim Quarter, a thriving hub of predominately Muslim-owned stores and temples.
There were several street stalls selling hand-rolled cigarettes, which were bloody good. Tasted like the vanilla cigars we used to buy when we were 18.
I caught a good day in Xi'an, so decided to take a bus to one of the entrances of the wall where I hired a bike for a few bucks and cycled around the whole thing. I hardly saw anyone else as it's not a tourist season. It was a pretty cool experience, headphones in, just coasting around the perimeter of the wall and checking out the city from above.
I felt like I was in the Netherlands, cruising around on a single speed bike eating street food.
One night, I went out with a couple of guys from the hostel. We ended up at a high end club (something I didn't expect Xi'an to have) where we soon realised the price of alcohol did not fit within our backpacker budgets. Not to worry; we soon were invited to a table which was being held by a Chinese bloke and a couple of his friends. This dude ordered 300 bottle of Hoegarden, at a cost of around $5.5k. There was one rule: When a beer was opened, you had to top the whole thing in one go. It didn't end well.
I mean, I like drinking beer.. but the volumetric thing becomes a problem after a while.
No trip to Xi'an would be complete without visiting the world-famous Terracotta army. The army depicts the forces of the first emperor of China, and was buried with him in approximately 210 BCE with the intention of protecting him in his afterlife. The warriors were discovered in 1974 by local farmers, who were digging for a well.
Excavation work is still being carried out to unearth the find, and you can see people working away in the pits, which have been covered with new buildings and turned into one hell of a tourist attraction.
Xi'an is a classic example of old meets new. Everywhere you go, there are ancient influences and old buildings and towers that remain from many years ago. The place has a cool vibe to it. It's much more relaxed than the bigger cities like Guangzhou or Shanghai, and is littered with tasty street food everywhere you look. Worth a visit for sure!
Stay in Alley Youth Hostel if you need accommodation. Solid hostel with a sweet social area, right in the middle of the Muslim Quarter.
Buses are the main mode of transport here. There's a subway line but it's pretty basic.
As a general 'tip' for China, get used to people spitting everywhere and anywhere. It becomes part of life after a while.
If you're taking a train that isn't a sleeper, keep an eye on where you are with your GPS because in central China there often isn't any English at the stations to let you know where you need to get off. With a sleeper train you're sweet, the conductor will come and wake you up to let you know you're arriving at your station.


For two UW–Madison students, Italy is more than just a place with great gelato (although they say that certainly is a large part of it.) Instead, they view the country as a place brimming with possibilities for discovery and exploration.
Embarking on an archaeological expedition, Jack White and Megan Bernards — two seniors in the College of Letters and Science — traveled to the ancient city of Agrigento on the south coast of Sicily this past summer.
White and Bernards both won Wisconsin Hilldale Undergraduate/Faculty research fellowships for their projects in Sicily.
According to White, accurately dating the tholos and other artifacts served as "pieces that fit into the whole puzzle, which is the sanctuary itself." Bernards, in particular, found a significant and rare piece of the puzzle — a bronze coin that supports new conclusions about the date of the tholos. Though the coin was small, it had big implications for dating the city.
White described the feeling of discovery simply: "Imagine you lost something you haven't seen in a while and you finally find it," he said. "It's like that feeling." He also contributed to mapping and spatial analysis of the sanctuary by becoming a licensed drone pilot.
Although the expedition was only two weeks long, White and Bernards say they left Italy feeling like they made lifelong connections with others and ultimately contributed to a piece of history.
White also says their trip was about more than gaining technical archaeological skills — it was a cultural experience that helped him to break out of his comfort zone.
The expedition to Agrigento was conducted by the Institut Ausonius and the University of Bordeaux-Montaigne, under the auspices of the l'École française de Rome and the Parco Archeologico della Valle dei Templi di Agrigento.


We've been telling you that Tap is coming…and now it's finally here! We would like to give a huge welcome to Miss. Kathy! Kathy Morrison will be joining the Strutt Faculty full time this year. Miss. Kathy has been teaching all levels and ages of tap for over 20 years including 17 years at Nebraska Dance in Omaha. She graduated college with a major in elementary education. She choreographs and teaches across the country educating and encouraging kids to keep the love of the Tap art form alive. She currently expands her own Tap education by attending Tap festivals, classes in New York City, and dance conventions. Kathy has enjoyed developing a stronger Tap program within the walls of The Southern Strutt and instilling a new love of the art form for Strutt Company Dancers. Miss. Kathy will be teaching all levels of Tap including our Company Tap classes, Adult Tap, and our Brand New Super Star Tap!


Airline Luxair hopes to expand its Irish clientèle after producing an advert for Irish channel Setanta Sports.
The 30-second clip features the familiar voice of ARA City Radio presenter Sam Steen as stunning clips are shown of Luxembourg's varied landscape, from castles to vineyards and more.
The clip was produced by BCE in cooperation with Luxembourg's national tourism office. It aims to promote the Grand Duchy as an attractive tourism destination for leisure and business travel.
In 2014, Luxair relaunched their network linking Luxembourg to Dublin, three years after it halted flights to the Irish capital.


text:
'Savage Amusement': Ferocious Scorpions Strike Again
Their tenth album took just a few weeks to go platinum in the US.
Scorpions 'Savage Amusement' artwork - Courtesy: UMG
When German rock heroes Scorpions conquered America it was, to borrow one of their album titles, love at first sting. Throughout the 1980s, especially, the Hanover outfit were racking up gold and platinum albums in America for fun. Their releases not only sold in huge numbers but had real staying power. No fewer than five of their titles had runs of more than 40 weeks on the Billboard 200.
Rhythm of success
On May 7, 1988, the band entered that chart with their tenth studio album and first in four years, Savage Amusement. It contained the No.6 hit on the Hot Mainstream Rock Tracks chart, "Rhythm Of Love." The album itself took just a few weeks to go platinum in the US, and reached No.5, their highest-ever peak, in another epic sequence of 43 weeks on the countdown.
Savage Amusement also went platinum in Canada and was gold in their native Germany as well as in France, Finland and Switzerland. In the UK, where Scorpions sold steadily, it was their fourth consecutive Top 20 album, reaching No.18.
Listen To The New Version Of Ghost's 'Spillways' Ft. Def Leppard's Joe Elliott
Metallica's '72 Seasons Global Premiere' Coming To Movie Theaters
'Dystopia': How Megadeth Readied Themselves For The Apocalypse
Click to load video
The album had a somewhat more polished and less raucous flavor about it compared to previous Scorpions releases. It also marked the end of an era, as it was the last to be overseen by producer Dieter Dierks, with whom they then ended their 20-year relationship. It was recorded at his Dierks Studios I, II, III, Cologne, Germany and at Scorpio Sound Studios in Hannover.
Rock monsters
Some fans expressed disappointment with the new release, which came as Def Leppard were upping the rock ante with their globe-straddling sound. But there were still some moments of spirited rocking on the record, notably on "We Let It Rock…You Let It Roll" and "Love on the Run." Scorpions celebrated the release of Savage Amusement by taking part in the Monsters of Rock live package and then playing 50 headlining North American shows of their own.
Listen to the Work From Home Rock playlist, featuring Scorpions alongside everyone from Steppenwolf to Soundgarden.
Related Topics:Dieter DierksMetalMonsters of RockOn This DayScorpions
I've been loionkg for a post like this for an age


Bello Jewels is supported by excellent craftsmanship and creative team of designers. Bello Jewels is one of the leading dealer and manufacturers of precious and semi precious gemstones and necklaces, gold as well as diamond gemstone jewellery and 925 sterling silver gemstone jewellery. Their beautiful jewellery collection is inspired by a heritage of rich Indian tradition and craftsmanship, and is in tune with the international trends. They focus on intricate details to modern designs for all age groups and bears the stamp of distinction.


text:
Какмож — село в Вавожском районе Удмуртии. Административный центр Какможского сельского поселения.

География
Село расположено на западе республики на расстоянии примерно в 9 километрах по прямой к северо-западу от районного центра Вавожа.
Часовой пояс

Население

 Национальный состав
Согласно результатам переписи 2002 года, в национальной структуре населения русские составляли 66 %, а удмурты 33 % из 1519 чел..

Примечания

Населённые пункты Вавожского района

redpajama_set_name: RedPajamaWikipedia


This course will introduce students to mathematical descriptions of signals & systems, and mathematical tools for analyzing and designing systems that can operate on signals to achieve a desired effect. The focus of the class will be on the class of systems called linear time invariant systems. Significant emphasis will be place both on time domain analysis of systems through the operation of convolution and on frequency domain analysis of systems using the Fourier and Laplace transforms. Both continuous-time and discrete-time signals will be considered. Several examples from engineering practice will be used throughout the course.


Loadrunner Visual Studio Addin Free Downloads - 2000 Shareware periodically updates software information and pricing of Loadrunner Visual Studio Addin from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using Loadrunner Visual Studio Addin crack, password, registration codes, key generators, serial numbers is illegal.