text:
package com.google.plus.samples.photohunt;

import java.util.Arrays;

import android.app.Activity;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentSender.SendIntentException;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;

import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesClient.ConnectionCallbacks;
import com.google.android.gms.common.GooglePlayServicesClient.OnConnectionFailedListener;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.plus.PlusClient;

/**
 * A fragment that you can add to your layout to automate connecting a {@link PlusClient}.
 * The key integration points are to attach the fragment with {@link #getPlusClientFragment}
 * in your Activity's {@code onCreate} method, then call {@link #signIn} when the user clicks your
 * sign-in button and forward calls to {@code onActivityResult} to {@link #handleOnActivityResult}.
 */
public final class PlusClientFragment extends Fragment
        implements ConnectionCallbacks, OnConnectionFailedListener {

    /**
     * Tag to refer to this fragment.
     */
    private static final String TAG_PLUS_CLIENT = "plusClientFragment";

    /**
     * Tag to refer to an error (resolution) dialog.
     */
    private static final String TAG_ERROR_DIALOG = "plusClientFragmentErrorDialog";

    /**
     * Tag to refer to a progress dialog when sign in is requested.
     */
    private static final String TAG_PROGRESS_DIALOG = "plusClientFragmentProgressDialog";

    /**
     * Array of strings representing scopes to request for {@link #getArguments()}.
     */
    private static final String ARG_SCOPES = "scopes";

    /**
     * Array of strings representing visible activities to request for {@link #getArguments()}.
     */
    private static final String ARG_VISIBLE_ACTIVITIES = "visible_activities";

    /**
     * Integer request code to apply to requests, as set by {@link #signIn(int)}.
     */
    private static final String STATE_REQUEST_CODE = "request_code";

    /**
     * Signed in successfully connection state.
     */
    private static final ConnectionResult CONNECTION_RESULT_SUCCESS =
            new ConnectionResult(ConnectionResult.SUCCESS, null);

    /**
     * An invalid request code to use to indicate that {@link #signIn(int)} hasn't been called.
     */
    private static final int INVALID_REQUEST_CODE = -1;

    // The PlusClient to connect.
    private PlusClient mPlusClient;

    // The last result from onConnectionFailed.
    private ConnectionResult mLastConnectionResult;

    // The request specified in signIn or INVALID_REQUEST_CODE if not signing in.
    private int mRequestCode;

    // A handler to post callbacks (rather than call them in a potentially reentrant way.)
    private Handler mHandler;

    /** Tracks if {@link PlusClient#connect()} has been called. */
    private boolean mIsConnecting;

	/**
     * Local handler to send callbacks on sign in.
     */
    private final class PlusClientFragmentHandler extends Handler {
        public static final int WHAT_SIGNED_IN = 1;

        public PlusClientFragmentHandler() {
            super(Looper.getMainLooper());
        }

        @Override
        public void handleMessage(Message msg) {
            if (msg.what != WHAT_SIGNED_IN) {
                return;
            }

            Activity activity = getActivity();
            if (mPlusClient.isConnected() && activity instanceof OnSignInListener) {
                ((OnSignInListener) activity).onSignedIn(mPlusClient);
            }
        }
    }

    /**
     * Listener interface for sign in events.  Activities hosting a {@link PlusClientFragment}
     * must implement this.
     */
    public static interface OnSignInListener {
        /**
         * Called when the {@link PlusClient} has been connected successfully.
         *
         * @param plusClient The connected {@link PlusClient} to make requests on.
         */
        void onSignedIn(PlusClient plusClient);

        /**
         * Called when the {@link PlusClient} fails to connect.
         */
        void onSignInFailed();
    }

    /**
     * Attach a {@link PlusClient} managing fragment to you activity.
     *
     * @param activity The activity to attach the fragment to.
     * @param scopes The scopes to request permission for.
     * @param visibleActivities An array of visible activities to request.
     * @return The fragment managing a {@link PlusClient}.
     */
    public static PlusClientFragment getPlusClientFragment(
            FragmentActivity activity, String[] scopes, String[] visibleActivities) {
        if (!(activity instanceof OnSignInListener)) {
            throw new IllegalArgumentException(
                    "The activity must implement OnSignedInListener to receive callbacks.");
        }

        // Check if the fragment is already attached.
        FragmentManager fragmentManager = activity.getSupportFragmentManager();
        Fragment fragment = fragmentManager.findFragmentByTag(TAG_PLUS_CLIENT);
        if (fragment instanceof PlusClientFragment) {
            // The fragment is attached.  If it has the right visible activities, return it.
            if (Arrays.equals(visibleActivities,
                    fragment.getArguments().getStringArray(ARG_VISIBLE_ACTIVITIES))) {
                return (PlusClientFragment) fragment;
            }
        }

        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
        // If a fragment was already attached, remove it to clean up.
        if (fragment != null) {
            fragmentTransaction.remove(fragment);
        }

        // Create a new fragment and attach it to the fragment manager.
        Bundle arguments = new Bundle();
        arguments.putStringArray(ARG_VISIBLE_ACTIVITIES, visibleActivities);
        arguments.putStringArray(ARG_SCOPES, scopes);
        PlusClientFragment signInFragment = new PlusClientFragment();
        signInFragment.setArguments(arguments);
        fragmentTransaction.add(signInFragment, TAG_PLUS_CLIENT);
        fragmentTransaction.commit();
        return signInFragment;
    }

    /**
     * Creates a {@link PlusClient} and kicks-off the connection flow.
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // Retain instance to avoid reconnecting on rotate.  This means that onDestroy and onCreate
        // will not be called on configuration changes.
        setRetainInstance(true);
        mHandler = new PlusClientFragmentHandler();

        // Create the PlusClient.
        PlusClient.Builder plusClientBuilder =
                new PlusClient.Builder(getActivity().getApplicationContext(), this, this);
        String[] visibleActivities = getArguments().getStringArray(ARG_VISIBLE_ACTIVITIES);
        String[] scopes = getArguments().getStringArray(ARG_SCOPES);

        plusClientBuilder.setScopes(scopes);

        if (visibleActivities != null && visibleActivities.length > 0) {
            plusClientBuilder.setVisibleActivities(visibleActivities);
        }
        mPlusClient = plusClientBuilder.build();

        if (savedInstanceState == null) {
            mRequestCode = INVALID_REQUEST_CODE;
        } else {
            mRequestCode = savedInstanceState.getInt(STATE_REQUEST_CODE, INVALID_REQUEST_CODE);
        }

        // Attempt to connect.
        mPlusClient.connect();
        mIsConnecting = true;
    }

    /**
     * Disconnects the {@link PlusClient} to avoid leaks.
     */
    @Override
    public void onDestroy() {
        super.onDestroy();
        if (mIsConnecting || mPlusClient.isConnected()) {
            mPlusClient.disconnect();
        }
    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putInt(STATE_REQUEST_CODE, mRequestCode);
    }

    @Override
    public void onResume() {
        super.onResume();
        if (mRequestCode == INVALID_REQUEST_CODE) {
            // No user interaction, hide the progress dialog.
            hideProgressDialog();
            hideErrorDialog();
        } else if (mLastConnectionResult != null && !mLastConnectionResult.isSuccess()) {
            showProgressDialog();
        }
    }

    @Override
    public void onStart() {
        super.onStart();
        if (mRequestCode == INVALID_REQUEST_CODE && !mIsConnecting) {
            mLastConnectionResult = null;
            mPlusClient.connect();
            mIsConnecting = true;
        }
    }

    @Override
    public void onConnected() {
        // Successful connection!
        mLastConnectionResult = CONNECTION_RESULT_SUCCESS;
        mRequestCode = INVALID_REQUEST_CODE;
        mIsConnecting = false;
        hideProgressDialog();

        Activity activity = getActivity();
        if (activity instanceof OnSignInListener) {
            ((OnSignInListener) activity).onSignedIn(mPlusClient);
        }
    }

    @Override
    public void onConnectionFailed(ConnectionResult connectionResult) {
        mLastConnectionResult = connectionResult;
        mIsConnecting = false;

        // On a failed connection try again.
        if (isResumed() && mRequestCode != INVALID_REQUEST_CODE) {
            resolveLastResult();
        } else {
            Activity activity = getActivity();
            ((OnSignInListener) activity).onSignInFailed();
        }
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        // Let new activities know the signed-in state.
        if (mPlusClient.isConnected()) {
            mHandler.sendEmptyMessage(PlusClientFragmentHandler.WHAT_SIGNED_IN);
        }
    }

    @Override
    public void onDisconnected() {
        mIsConnecting = false;
    }

    /**
     * Shows any UI required to resolve the error connecting.
     */
    public void signIn(int requestCode) {
        if (requestCode < 0) {
            throw new IllegalArgumentException("A non-negative request code is required.");
        }

        if (mPlusClient.isConnected()) {
            // Already connected!  Schedule callback.
            mHandler.sendEmptyMessage(PlusClientFragmentHandler.WHAT_SIGNED_IN);
            return;
        }

        if (mRequestCode != INVALID_REQUEST_CODE) {
            // We're already signing in.
            return;
        }

        mRequestCode = requestCode;
        if (mLastConnectionResult == null) {
            // We're starting up, show progress.
            showProgressDialog();
            return;
        }

        resolveLastResult();
    }

    /**
     * Perform resolution given a non-null result.
     */
    private void resolveLastResult() {
        if (GooglePlayServicesUtil.isUserRecoverableError(mLastConnectionResult.getErrorCode())) {
        	// Show a dialog to install or enable Google Play services.
        	showErrorDialog(ErrorDialogFragment.create(mLastConnectionResult.getErrorCode(),
        			mRequestCode));
            return;
        }

        if (mLastConnectionResult.hasResolution()) {
            startResolution();
        }
    }

    public static final class ErrorDialogFragment extends GooglePlayServicesErrorDialogFragment {

        public static ErrorDialogFragment create(int errorCode, int requestCode) {
            ErrorDialogFragment fragment = new ErrorDialogFragment();
            fragment.setArguments(createArguments(errorCode, requestCode));
            return fragment;
        }

        @Override
        public void onCancel(DialogInterface dialog) {
            super.onCancel(dialog);
            FragmentActivity activity = getActivity();
            if (activity == null) {
                return;
            }

            Fragment fragment =
                    activity.getSupportFragmentManager().findFragmentByTag(TAG_PLUS_CLIENT);
            if (fragment instanceof PlusClientFragment) {
                ((PlusClientFragment) fragment).onDialogCanceled(getTag());
            }
        }

        @Override
        public void onDismiss(DialogInterface dialog) {
            super.onDismiss(dialog);
            FragmentActivity activity = getActivity();
            if (activity == null) {
                return;
            }

            Fragment fragment =
                    activity.getSupportFragmentManager().findFragmentByTag(TAG_PLUS_CLIENT);
            if (fragment instanceof PlusClientFragment) {
                ((PlusClientFragment) fragment).onDialogDismissed(getTag());
            }
        }
    }

    private void onDialogCanceled(String tag) {
        mRequestCode = INVALID_REQUEST_CODE;
        hideProgressDialog();
    }

    private void onDialogDismissed(String tag) {
        if (TAG_PROGRESS_DIALOG.equals(tag)) {
            mRequestCode = INVALID_REQUEST_CODE;
            hideProgressDialog();
        }
    }

    private void showProgressDialog() {
        DialogFragment progressDialog =
                (DialogFragment) getFragmentManager().findFragmentByTag(TAG_PROGRESS_DIALOG);
        if (progressDialog == null) {
            progressDialog = ProgressDialogFragment.create();
            progressDialog.show(getFragmentManager(), TAG_PROGRESS_DIALOG);
        }
    }

    public static final class ProgressDialogFragment extends DialogFragment {

        private static final String ARG_MESSAGE = "message";

        public static ProgressDialogFragment create(int message) {
            ProgressDialogFragment progressDialogFragment = new ProgressDialogFragment();
            Bundle args = new Bundle();
            args.putInt(ARG_MESSAGE, message);
            progressDialogFragment.setArguments(args);
            return progressDialogFragment;
        }

        public static ProgressDialogFragment create() {
            return create(R.string.progress_message);
        }

        @Override
        public Dialog onCreateDialog(Bundle savedInstanceState) {
            ProgressDialog progressDialog = new ProgressDialog(getActivity());
            progressDialog.setIndeterminate(true);
            progressDialog.setMessage(getString(getArguments().getInt(ARG_MESSAGE)));
            return progressDialog;
        }

        @Override
        public void onCancel(DialogInterface dialog) {
            super.onCancel(dialog);
            FragmentActivity activity = getActivity();
            if (activity == null) {
                return;
            }

            Fragment fragment =
                    activity.getSupportFragmentManager().findFragmentByTag(TAG_PLUS_CLIENT);
            if (fragment instanceof PlusClientFragment) {
                ((PlusClientFragment) fragment).onDialogCanceled(getTag());
            }
        }

        @Override
        public void onDismiss(DialogInterface dialog) {
            super.onDismiss(dialog);
            FragmentActivity activity = getActivity();
            if (activity == null) {
                return;
            }

           Fragment fragment =
                    activity.getSupportFragmentManager().findFragmentByTag(TAG_PLUS_CLIENT);
            if (fragment instanceof PlusClientFragment) {
                ((PlusClientFragment) fragment).onDialogDismissed(getTag());
            }
        }
    }

    protected void hideProgressDialog() {
        mRequestCode = INVALID_REQUEST_CODE;
        DialogFragment progressDialog =
                (DialogFragment) getFragmentManager().findFragmentByTag(TAG_PROGRESS_DIALOG);
        if (progressDialog != null) {
            progressDialog.dismiss();
        }
    }

    private void showErrorDialog(DialogFragment errorDialog) {
        DialogFragment oldErrorDialog =
                (DialogFragment) getFragmentManager().findFragmentByTag(TAG_ERROR_DIALOG);
        if (oldErrorDialog != null) {
            oldErrorDialog.dismiss();
        }

        hideProgressDialog();
        errorDialog.show(getFragmentManager(), TAG_ERROR_DIALOG);
    }

    private void hideErrorDialog() {
        mRequestCode = INVALID_REQUEST_CODE;
        DialogFragment errorDialog =
                (DialogFragment) getFragmentManager().findFragmentByTag(TAG_ERROR_DIALOG);
        if (errorDialog != null) {
            errorDialog.dismiss();
        }
    }

    private void startResolution() {
        try {
            mLastConnectionResult.startResolutionForResult(getActivity(), mRequestCode);
        } catch (SendIntentException e) {
            // The intent we had is not valid right now, perhaps the remote process died.
            // Try to reconnect to get a new resolution intent.
            mLastConnectionResult = null;
            showProgressDialog();
            mPlusClient.connect();
            mIsConnecting = true;
        }
    }

    public boolean handleOnActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode != mRequestCode) {
            return false;
        }

        switch (resultCode) {
            case Activity.RESULT_OK:
                mLastConnectionResult = null;
                mPlusClient.connect();
                mIsConnecting = true;
                break;
            case Activity.RESULT_CANCELED:
                // User canceled sign in, clear the request code.
                mRequestCode = INVALID_REQUEST_CODE;
                break;
        }
        return true;
    }

    /**
     * Sign out of the app.
     */
    public void signOut() {
        if (mPlusClient.isConnected()) {
            mPlusClient.clearDefaultAccount();
        }

        if (mIsConnecting || mPlusClient.isConnected()) {
            mPlusClient.disconnect();
            // Reconnect to get a new mPlusClient.
            mLastConnectionResult = null;
            // Cancel sign in.
            mRequestCode = INVALID_REQUEST_CODE;

            // Reconnect to fetch the sign-in (account chooser) intent from the plus client.
            mPlusClient.connect();
        }
    }

	public boolean isAuthenticated() {
		return mPlusClient != null && mPlusClient.isConnected();
	}

    public boolean isConnecting() {
        return mIsConnecting;
    }

	public PlusClient getClient() {
		return mPlusClient;
	}
}


text:
local runner = require('user_modules/script_runner')
local commonRC = require('test_scripts/RC/commonRC')

--[[ Test Configuration ]]
runner.testSettings.isSelfIncluded = false

--[[ Local Variables ]]
local Module = "RADIO"

--[[ Local Functions ]]
local function rpcInvalidData()
  local requestParams = commonRC.getSettableModuleControlData(Module)
  requestParams.radioControlData.hdRadioEnable = "ENABLE"

  local cid = commonRC.getMobileSession():SendRPC("SetInteriorVehicleData", {
	moduleData = requestParams
  })

  EXPECT_HMICALL("RC.SetInteriorVehicleData")
  :Times(0)

  commonRC.getMobileSession():ExpectResponse(cid, { success = false, resultCode = "INVALID_DATA" })
end

--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", commonRC.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", commonRC.start)
runner.Step("RAI", commonRC.registerAppWOPTU)
runner.Step("Activate App", commonRC.activateApp)

runner.Title("Test")

runner.Step("SetInteriorVehicleData INVALID_DATA", rpcInvalidData)

runner.Title("Postconditions")
runner.Step("Stop SDL", commonRC.postconditions)

redpajama_set_name: RedPajamaGithub


text:
namespace storage::rpc {

RpcTargetPool::RpcTargetPool(RpcTargetVector&& targets, const vespalib::string& spec, uint32_t slobrok_gen)
    : _targets(std::move(targets)),
      _spec(spec),
      _slobrok_gen(slobrok_gen)
{
}

std::shared_ptr<RpcTarget>
RpcTargetPool::get_target(uint64_t bucket_id) const
{
    return _targets[bucket_id % _targets.size()];
}

}


text:
UTestBTTask_SetFlag::UTestBTTask_SetFlag(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
	NodeName = "Log";
	TaskResult = EBTNodeResult::Succeeded;
	KeyName = TEXT("Bool1");
	bValue = true;
}

EBTNodeResult::Type UTestBTTask_SetFlag::ExecuteTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory)
{
	OwnerComp.GetBlackboardComponent()->SetValue<UBlackboardKeyType_Bool>(KeyName, bValue);
	return TaskResult;
}


text:
layout: page
title: Rose Deleon's 44th Birthday
date: 2016-05-24
author: Joseph Swanson
tags: weekly links, java
status: published
summary: Cras congue aliquam diam in suscipit. Suspendisse potenti.
banner: images/banner/leisure-04.jpg
booking:
  startDate: 04/07/2019
  endDate: 04/11/2019
  ctyhocn: BDGNJHX
  groupCode: RD4B
published: true
---
Pellentesque rhoncus lobortis elit non mollis. Vestibulum at porta eros. Sed commodo faucibus ullamcorper. Vestibulum ultrices nibh in felis tristique, quis cursus magna viverra. Mauris fringilla, libero et sagittis tristique, odio urna sollicitudin metus, eu aliquet erat massa quis erat. Mauris id viverra justo. Mauris diam justo, fermentum id ligula ut, vehicula efficitur est. Donec sagittis quam ut tortor congue porta. Fusce vitae posuere risus. Vestibulum vestibulum elit tellus, a lacinia felis finibus convallis. Vestibulum pulvinar eleifend nunc nec consequat.
Morbi ultrices bibendum diam, ut tempor ante maximus nec. Duis venenatis lorem non tellus lobortis, sed consectetur nibh dapibus. Sed rhoncus massa vel enim bibendum lacinia. Nulla efficitur, libero quis tincidunt iaculis, tortor leo tempus arcu, ac ornare dui mi non velit. Nunc ultrices eu turpis in ullamcorper. Sed sed erat ligula. Sed risus tortor, euismod sed augue sed, ullamcorper commodo nisi. Ut eu fermentum nunc, quis sodales sapien.

* Sed tincidunt purus sit amet elit sodales porta
* Sed congue ipsum vitae varius maximus.

Aenean diam mi, pulvinar vitae tellus eget, congue pretium eros. Nullam vel est at nunc eleifend finibus ac eget arcu. Quisque eget sem mauris. Quisque sagittis faucibus nisl egestas vulputate. Mauris a quam consequat, pulvinar quam eget, ultrices nibh. Donec in sollicitudin nisi, vitae lacinia tellus. Nulla augue dolor, eleifend eu urna eget, faucibus vulputate nisi. Ut eget libero eget felis cursus sollicitudin sit amet at purus. Maecenas dignissim diam mauris. Nullam viverra et risus sed euismod. Ut auctor lacinia velit, eget tempor erat commodo non. Donec non metus vitae odio mollis pulvinar. Quisque efficitur urna risus, aliquet pretium metus commodo id. Cras id odio vulputate velit pellentesque ultricies sit amet ac ligula.


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

<title>The GNU C Library: Constants for Sysconf</title>

<meta name="description" content="The GNU C Library: Constants for Sysconf">
<meta name="keywords" content="The GNU C Library: Constants for Sysconf">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Sysconf.html#Sysconf" rel="up" title="Sysconf">
<link href="Examples-of-Sysconf.html#Examples-of-Sysconf" rel="next" title="Examples of Sysconf">
<link href="Sysconf-Definition.html#Sysconf-Definition" rel="prev" title="Sysconf Definition">

Next: Examples of Sysconf, Previous: Sysconf Definition, Up: Sysconf   [Contents][Index]

32.4.2 Constants for sysconf Parameters

Here are the symbolic constants for use as the <var>parameter</var> argument
to sysconf.  The values are all integer constants (more
specifically, enumeration type values).

_SC_ARG_MAX

Inquire about the parameter corresponding to ARG_MAX.

_SC_CHILD_MAX

Inquire about the parameter corresponding to CHILD_MAX.

_SC_OPEN_MAX

Inquire about the parameter corresponding to OPEN_MAX.

_SC_STREAM_MAX

Inquire about the parameter corresponding to STREAM_MAX.

_SC_TZNAME_MAX

Inquire about the parameter corresponding to TZNAME_MAX.

_SC_NGROUPS_MAX

Inquire about the parameter corresponding to NGROUPS_MAX.

_SC_JOB_CONTROL

Inquire about the parameter corresponding to _POSIX_JOB_CONTROL.

_SC_SAVED_IDS

Inquire about the parameter corresponding to _POSIX_SAVED_IDS.

_SC_VERSION

Inquire about the parameter corresponding to _POSIX_VERSION.

_SC_CLK_TCK

Inquire about the number of clock ticks per second; see CPU Time.
The corresponding parameter CLK_TCK is obsolete.

_SC_CHARCLASS_NAME_MAX

Inquire about the parameter corresponding to maximal length allowed for
a character class name in an extended locale specification.  These
extensions are not yet standardized and so this option is not standardized
as well.

_SC_REALTIME_SIGNALS

Inquire about the parameter corresponding to _POSIX_REALTIME_SIGNALS.

_SC_PRIORITY_SCHEDULING

Inquire about the parameter corresponding to _POSIX_PRIORITY_SCHEDULING.

_SC_TIMERS

Inquire about the parameter corresponding to _POSIX_TIMERS.

_SC_ASYNCHRONOUS_IO

Inquire about the parameter corresponding to _POSIX_ASYNCHRONOUS_IO.

_SC_PRIORITIZED_IO

Inquire about the parameter corresponding to _POSIX_PRIORITIZED_IO.

_SC_SYNCHRONIZED_IO

Inquire about the parameter corresponding to _POSIX_SYNCHRONIZED_IO.

_SC_FSYNC

Inquire about the parameter corresponding to _POSIX_FSYNC.

_SC_MAPPED_FILES

Inquire about the parameter corresponding to _POSIX_MAPPED_FILES.

_SC_MEMLOCK

Inquire about the parameter corresponding to _POSIX_MEMLOCK.

_SC_MEMLOCK_RANGE

Inquire about the parameter corresponding to _POSIX_MEMLOCK_RANGE.

_SC_MEMORY_PROTECTION

Inquire about the parameter corresponding to _POSIX_MEMORY_PROTECTION.

_SC_MESSAGE_PASSING

Inquire about the parameter corresponding to _POSIX_MESSAGE_PASSING.

_SC_SEMAPHORES

Inquire about the parameter corresponding to _POSIX_SEMAPHORES.

_SC_SHARED_MEMORY_OBJECTS

Inquire about the parameter corresponding to

_POSIX_SHARED_MEMORY_OBJECTS.

_SC_AIO_LISTIO_MAX

Inquire about the parameter corresponding to _POSIX_AIO_LISTIO_MAX.

_SC_AIO_MAX

Inquire about the parameter corresponding to _POSIX_AIO_MAX.

_SC_AIO_PRIO_DELTA_MAX

Inquire the value by which a process can decrease its asynchronous I/O
priority level from its own scheduling priority.  This corresponds to the
run-time invariant value AIO_PRIO_DELTA_MAX.

_SC_DELAYTIMER_MAX

Inquire about the parameter corresponding to _POSIX_DELAYTIMER_MAX.

_SC_MQ_OPEN_MAX

Inquire about the parameter corresponding to _POSIX_MQ_OPEN_MAX.

_SC_MQ_PRIO_MAX

Inquire about the parameter corresponding to _POSIX_MQ_PRIO_MAX.

_SC_RTSIG_MAX

Inquire about the parameter corresponding to _POSIX_RTSIG_MAX.

_SC_SEM_NSEMS_MAX

Inquire about the parameter corresponding to _POSIX_SEM_NSEMS_MAX.

_SC_SEM_VALUE_MAX

Inquire about the parameter corresponding to _POSIX_SEM_VALUE_MAX.

_SC_SIGQUEUE_MAX

Inquire about the parameter corresponding to _POSIX_SIGQUEUE_MAX.

_SC_TIMER_MAX

Inquire about the parameter corresponding to _POSIX_TIMER_MAX.

_SC_PII

Inquire about the parameter corresponding to _POSIX_PII.

_SC_PII_XTI

Inquire about the parameter corresponding to _POSIX_PII_XTI.

_SC_PII_SOCKET

Inquire about the parameter corresponding to _POSIX_PII_SOCKET.

_SC_PII_INTERNET

Inquire about the parameter corresponding to _POSIX_PII_INTERNET.

_SC_PII_OSI

Inquire about the parameter corresponding to _POSIX_PII_OSI.

_SC_SELECT

Inquire about the parameter corresponding to _POSIX_SELECT.

_SC_UIO_MAXIOV

Inquire about the parameter corresponding to _POSIX_UIO_MAXIOV.

_SC_PII_INTERNET_STREAM

Inquire about the parameter corresponding to _POSIX_PII_INTERNET_STREAM.

_SC_PII_INTERNET_DGRAM

Inquire about the parameter corresponding to _POSIX_PII_INTERNET_DGRAM.

_SC_PII_OSI_COTS

Inquire about the parameter corresponding to _POSIX_PII_OSI_COTS.

_SC_PII_OSI_CLTS

Inquire about the parameter corresponding to _POSIX_PII_OSI_CLTS.

_SC_PII_OSI_M

Inquire about the parameter corresponding to _POSIX_PII_OSI_M.

_SC_T_IOV_MAX

Inquire the value of the value associated with the T_IOV_MAX
variable.

_SC_THREADS

Inquire about the parameter corresponding to _POSIX_THREADS.

_SC_THREAD_SAFE_FUNCTIONS

Inquire about the parameter corresponding to

_POSIX_THREAD_SAFE_FUNCTIONS.

_SC_GETGR_R_SIZE_MAX

Inquire about the parameter corresponding to _POSIX_GETGR_R_SIZE_MAX.

_SC_GETPW_R_SIZE_MAX

Inquire about the parameter corresponding to _POSIX_GETPW_R_SIZE_MAX.

_SC_LOGIN_NAME_MAX

Inquire about the parameter corresponding to _POSIX_LOGIN_NAME_MAX.

_SC_TTY_NAME_MAX

Inquire about the parameter corresponding to _POSIX_TTY_NAME_MAX.

_SC_THREAD_DESTRUCTOR_ITERATIONS

Inquire about the parameter corresponding to
_POSIX_THREAD_DESTRUCTOR_ITERATIONS.

_SC_THREAD_KEYS_MAX

Inquire about the parameter corresponding to _POSIX_THREAD_KEYS_MAX.

_SC_THREAD_STACK_MIN

Inquire about the parameter corresponding to _POSIX_THREAD_STACK_MIN.

_SC_THREAD_THREADS_MAX

Inquire about the parameter corresponding to _POSIX_THREAD_THREADS_MAX.

_SC_THREAD_ATTR_STACKADDR

Inquire about the parameter corresponding to
a
_POSIX_THREAD_ATTR_STACKADDR.

_SC_THREAD_ATTR_STACKSIZE

Inquire about the parameter corresponding to

_POSIX_THREAD_ATTR_STACKSIZE.

_SC_THREAD_PRIORITY_SCHEDULING

Inquire about the parameter corresponding to
_POSIX_THREAD_PRIORITY_SCHEDULING.

_SC_THREAD_PRIO_INHERIT

Inquire about the parameter corresponding to _POSIX_THREAD_PRIO_INHERIT.

_SC_THREAD_PRIO_PROTECT

Inquire about the parameter corresponding to _POSIX_THREAD_PRIO_PROTECT.

_SC_THREAD_PROCESS_SHARED

Inquire about the parameter corresponding to
_POSIX_THREAD_PROCESS_SHARED.

_SC_2_C_DEV

Inquire about whether the system has the POSIX.2 C compiler command,
c89.

_SC_2_FORT_DEV

Inquire about whether the system has the POSIX.2 Fortran compiler
command, fort77.

_SC_2_FORT_RUN

Inquire about whether the system has the POSIX.2 asa command to
interpret Fortran carriage control.

_SC_2_LOCALEDEF

Inquire about whether the system has the POSIX.2 localedef
command.

_SC_2_SW_DEV

Inquire about whether the system has the POSIX.2 commands ar,
make, and strip.

_SC_BC_BASE_MAX

Inquire about the maximum value of obase in the bc
utility.

_SC_BC_DIM_MAX

Inquire about the maximum size of an array in the bc
utility.

_SC_BC_SCALE_MAX

Inquire about the maximum value of scale in the bc
utility.

_SC_BC_STRING_MAX

Inquire about the maximum size of a string constant in the
bc utility.

_SC_COLL_WEIGHTS_MAX

Inquire about the maximum number of weights that can necessarily
be used in defining the collating sequence for a locale.

_SC_EXPR_NEST_MAX

Inquire about the maximum number of expressions nested within
parentheses when using the expr utility.

_SC_LINE_MAX

Inquire about the maximum size of a text line that the POSIX.2 text
utilities can handle.

_SC_EQUIV_CLASS_MAX

Inquire about the maximum number of weights that can be assigned to an
entry of the LC_COLLATE category ‘<samp>order</samp>’ keyword in a locale
definition.  The GNU C Library does not presently support locale
definitions.

_SC_VERSION

Inquire about the version number of POSIX.1 that the library and kernel
support.

_SC_2_VERSION

Inquire about the version number of POSIX.2 that the system utilities
support.

_SC_PAGESIZE

Inquire about the virtual memory page size of the machine.
getpagesize returns the same value (see Query Memory Parameters).

_SC_NPROCESSORS_CONF

Inquire about the number of configured processors.

_SC_NPROCESSORS_ONLN

Inquire about the number of processors online.

_SC_PHYS_PAGES

Inquire about the number of physical pages in the system.

_SC_AVPHYS_PAGES

Inquire about the number of available physical pages in the system.

_SC_ATEXIT_MAX

Inquire about the number of functions which can be registered as termination
functions for atexit; see Cleanups on Exit.

_SC_XOPEN_VERSION

Inquire about the parameter corresponding to _XOPEN_VERSION.

_SC_XOPEN_XCU_VERSION

Inquire about the parameter corresponding to _XOPEN_XCU_VERSION.

_SC_XOPEN_UNIX

Inquire about the parameter corresponding to _XOPEN_UNIX.

_SC_XOPEN_REALTIME

Inquire about the parameter corresponding to _XOPEN_REALTIME.

_SC_XOPEN_REALTIME_THREADS

Inquire about the parameter corresponding to _XOPEN_REALTIME_THREADS.

_SC_XOPEN_LEGACY

Inquire about the parameter corresponding to _XOPEN_LEGACY.

_SC_XOPEN_CRYPT

Inquire about the parameter corresponding to _XOPEN_CRYPT.

_SC_XOPEN_ENH_I18N

Inquire about the parameter corresponding to _XOPEN_ENH_I18N.

_SC_XOPEN_SHM

Inquire about the parameter corresponding to _XOPEN_SHM.

_SC_XOPEN_XPG2

Inquire about the parameter corresponding to _XOPEN_XPG2.

_SC_XOPEN_XPG3

Inquire about the parameter corresponding to _XOPEN_XPG3.

_SC_XOPEN_XPG4

Inquire about the parameter corresponding to _XOPEN_XPG4.

_SC_CHAR_BIT

Inquire about the number of bits in a variable of type char.

_SC_CHAR_MAX

Inquire about the maximum value which can be stored in a variable of type
char.

_SC_CHAR_MIN

Inquire about the minimum value which can be stored in a variable of type
char.

_SC_INT_MAX

Inquire about the maximum value which can be stored in a variable of type
int.

_SC_INT_MIN

Inquire about the minimum value which can be stored in a variable of type
int.

_SC_LONG_BIT

Inquire about the number of bits in a variable of type long int.

_SC_WORD_BIT

Inquire about the number of bits in a variable of a register word.

_SC_MB_LEN_MAX

Inquire the maximum length of a multi-byte representation of a wide
character value.

_SC_NZERO

Inquire about the value used to internally represent the zero priority level for
the process execution.

SC_SSIZE_MAX

Inquire about the maximum value which can be stored in a variable of type
ssize_t.

_SC_SCHAR_MAX

Inquire about the maximum value which can be stored in a variable of type
signed char.

_SC_SCHAR_MIN

Inquire about the minimum value which can be stored in a variable of type
signed char.

_SC_SHRT_MAX

Inquire about the maximum value which can be stored in a variable of type
short int.

_SC_SHRT_MIN

Inquire about the minimum value which can be stored in a variable of type
short int.

_SC_UCHAR_MAX

Inquire about the maximum value which can be stored in a variable of type
unsigned char.

_SC_UINT_MAX

Inquire about the maximum value which can be stored in a variable of type
unsigned int.

_SC_ULONG_MAX

Inquire about the maximum value which can be stored in a variable of type
unsigned long int.

_SC_USHRT_MAX

Inquire about the maximum value which can be stored in a variable of type
unsigned short int.

_SC_NL_ARGMAX

Inquire about the parameter corresponding to NL_ARGMAX.

_SC_NL_LANGMAX

Inquire about the parameter corresponding to NL_LANGMAX.

_SC_NL_MSGMAX

Inquire about the parameter corresponding to NL_MSGMAX.

_SC_NL_NMAX

Inquire about  the parameter corresponding to NL_NMAX.

_SC_NL_SETMAX

Inquire about the parameter corresponding to NL_SETMAX.

_SC_NL_TEXTMAX

Inquire about the parameter corresponding to NL_TEXTMAX.

Next: Examples of Sysconf, Previous: Sysconf Definition, Up: Sysconf   [Contents][Index]


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="albionRed">#F44336</color>
    <color name="midgardBlue">#2196F3</color>
    <color name="hiberniaGreen">#4CAF50</color>
    <color name="delimiter">#000000</color>
    <color name="colorPrimary">#000000</color>
    <color name="colorPrimaryDark">#8b1616</color>
    <color name="colorAccent">#bace1d</color>
    <color name="colorLightGray">#E0E0E0</color>
    <color name="colorDarkerGray">@android:color/darker_gray</color>
    <color name="colorBaseSpec">#000033</color>
</resources>


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Net;
using System.Net.Sockets;
using System.Threading.Tasks;

namespace System.IO.Pipelines.Networking.Sockets
{
    /// <summary>
    /// Allows a managed socket to be used as a server, listening on a designated address and accepting connections from clients
    /// </summary>
    public class SocketListener : IDisposable
    {
        private readonly bool _ownsFactory;
        private Socket _socket;
        private Socket Socket => _socket;
        private PipeFactory _factory;
        private PipeFactory PipeFactory => _factory;
        private Func<SocketConnection, Task> Callback { get; set; }
        static readonly EventHandler<SocketAsyncEventArgs> _asyncCompleted = OnAsyncCompleted;

        /// <summary>
        /// Creates a new SocketListener instance
        /// </summary>
        /// <param name="factory">Optionally allows the underlying <see cref="PipeFactory"/> (and hence memory pool) to be specified; if one is not provided, a <see cref="PipeFactory"/> will be instantiated and owned by the listener</param>
        public SocketListener(PipeFactory factory = null)
        {
            _ownsFactory = factory == null;
            _factory = factory ?? new PipeFactory();
        }

        /// <summary>
        /// Releases all resources owned by the listener
        /// </summary>
        public void Dispose() => Dispose(true);
        /// <summary>
        /// Releases all resources owned by the listener
        /// </summary>
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                GC.SuppressFinalize(this);
                _socket?.Dispose();
                _socket = null;
                if (_ownsFactory) { _factory?.Dispose(); }
                _factory = null;
            }
        }

        /// <summary>
        /// Commences listening for and accepting connection requests from clients
        /// </summary>
        /// <param name="endpoint">The endpoint on which to listen</param>
        public void Start(IPEndPoint endpoint)
        {
            if (_socket == null)
            {
                _socket = new Socket(SocketType.Stream, ProtocolType.Tcp);
                _socket.Bind(endpoint);
                _socket.Listen(10);
                var args = new SocketAsyncEventArgs(); // note: we keep re-using same args over for successive accepts
                                                       // so usefulness of pooling here minimal; this is per listener
                args.Completed += _asyncCompleted;
                args.UserToken = this;
                BeginAccept(args);
            }
        }

        /// <summary>
        /// Stops the server from listening; no further connections will be accepted
        /// </summary>
        public void Stop()
        {
            if (_socket != null)
            {
                try
                {
                    _socket.Shutdown(SocketShutdown.Both);
                }
                catch { /* nom nom */ }
                _socket.Dispose();
                _socket = null;
            }
        }

        public Socket ListeningSocket => _socket;

        private Socket GetReusableSocket() => null; // TODO: socket pooling / re-use

        private void BeginAccept(SocketAsyncEventArgs args)
        {
            // keep trying to take sync; break when it goes async
            args.AcceptSocket = GetReusableSocket();
            while (!Socket.AcceptAsync(args))
            {
                OnAccept(args);
                args.AcceptSocket = GetReusableSocket();
            }
        }
        /// <summary>
        /// Specifies a callback to be invoked whenever a connection is accepted
        /// </summary>
        public void OnConnection(Func<SocketConnection, Task> callback)
        {
            Callback = callback;
        }

        private static void OnAsyncCompleted(object sender, SocketAsyncEventArgs e)
        {
            try
            {
                switch (e.LastOperation)
                {
                    case SocketAsyncOperation.Accept:
                        var obj = (SocketListener)e.UserToken;
                        obj.OnAccept(e);
                        obj.BeginAccept(e);
                        break;
                }
            }
            catch { }
        }

        private void OnAccept(SocketAsyncEventArgs e)
        {
            if (e.SocketError == SocketError.Success)
            {
                var conn = new SocketConnection(e.AcceptSocket, PipeFactory);
                e.AcceptSocket = null;
                ExecuteConnection(conn);
            }

            // note that we don't want to call BeginAccept at the end of OnAccept, as that
            // will cause a stack-dive in the sync (backlog) case
        }

        private async void ExecuteConnection(SocketConnection connection)
        {
            try
            {
                await Callback?.Invoke(connection);
            }
            catch
            {

            }
            finally
            {
                await connection.DisposeAsync();
            }
        }
    }
}


text:
#include "SkGradientShader.h"
#include "SkSurface.h"
#include "gm.h"

static void make_transparency(SkCanvas* canvas, SkScalar width, SkScalar height) {
    SkPoint pts[2];
    pts[0] = SkPoint::Make(0, 0);
    pts[1] = SkPoint::Make(width, 0);
    const SkColor kColors[] = {
            SK_ColorBLACK,
            SK_ColorGRAY,
            SK_ColorWHITE,
            SK_ColorRED,
            SK_ColorYELLOW,
            SK_ColorGREEN,
            SK_ColorCYAN,
            SK_ColorBLUE,
            SK_ColorMAGENTA,
    };
    const SkScalar kRowHeight = height / SK_ARRAY_COUNT(kColors);
    for (size_t i = 0; i < SK_ARRAY_COUNT(kColors); ++i) {
        SkColor shaderColors[2];
        shaderColors[0] = SK_AlphaTRANSPARENT;
        shaderColors[1] = kColors[i];
        SkPaint p;
        p.setShader(SkGradientShader::MakeLinear(pts, shaderColors, nullptr, 2,
                                                 SkShader::kClamp_TileMode));
        canvas->drawRect(SkRect::MakeXYWH(0, i * kRowHeight, width, kRowHeight), p);
    }
}

// http://crrev.com/834303005
static sk_sp<SkShader> create_checkerboard_shader(SkColor c1, SkColor c2, int size) {
    SkBitmap bm;
    bm.allocN32Pixels(2 * size, 2 * size);
    bm.eraseColor(c1);
    bm.eraseArea(SkIRect::MakeLTRB(0, 0, size, size), c2);
    bm.eraseArea(SkIRect::MakeLTRB(size, size, 2 * size, 2 * size), c2);
    return SkShader::MakeBitmapShader(bm, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode);
}

// http://crrev.com/834303005
static void checkerboard(SkCanvas* canvas, SkColor c1, SkColor c2, int size) {
    SkPaint paint;
    paint.setShader(create_checkerboard_shader(c1, c2, size));
    canvas->drawPaint(paint);
}

/**
 *  This GM verifies that a transparent bitmap drawn over a
 *  checkerboard pattern looks correct.
 */
DEF_SIMPLE_GM(transparency_check, canvas, 1792, 1080) {
    checkerboard(canvas, sk_tool_utils::color_to_565(0xFF999999),
            sk_tool_utils::color_to_565(0xFF666666), 8);
    {
        SkAutoCanvasRestore autoCanvasRestore(canvas, true);
        auto surface(SkSurface::MakeRasterN32Premul(256, 9));
        make_transparency(surface->getCanvas(), 256.0f, 9.0f);
        canvas->scale(7.0f, 120.0f);
        surface->draw(canvas, 0, 0, nullptr);
    }
}


text:
module Language.Dash.Context where

import Control.Applicative ((<$>), (<*>))
import Data.List ((\\), elemIndex, union)

import Language.Dash.Types

indexCtx :: Context -> (String, Binding) -> Maybe Int
indexCtx = flip elemIndex

unsafeCtx :: Context -> String -> Either String Int
unsafeCtx ctx str =
  maybe
  (Left $ "Unknown variable: " ++ str)
  Right
  (indexCtx (reverse ctx) (str, NameBind))

-- | Convert a 'Term' to de Bruijn indexing ('Nameless')
removeNames :: Context -> Term -> Either String Nameless
removeNames ctx (Var s) = NVar <$> unsafeCtx ctx s
removeNames ctx (Abs s ty t) = NAbs s ty <$> removeNames ((s, NameBind) : ctx) t
removeNames ctx (App t1 t2) = NApp <$> removeNames ctx t1 <*> removeNames ctx t2
removeNames _ TTrue = return NTrue
removeNames _ TFalse = return NFalse
removeNames ctx (Succ n) = NSucc <$> removeNames ctx n
removeNames _ Zero = return NZero
removeNames _ (TString s) = return (NString s)

nextFresh :: Context -> String -> String
nextFresh ctx s =
  if (s, NameBind) `elem` ctx
  then nextFresh ctx (s ++ "'")
  else s

restoreNames :: Context -> Nameless -> Term
restoreNames ctx (NVar n) = Var (fst $ ctx !! n)
restoreNames ctx (NAbs s ty t) =
  let fresh = nextFresh ctx s
  in Abs fresh ty (restoreNames ((fresh, NameBind):ctx) t)
restoreNames ctx (NApp t1 t2) = App (restoreNames ctx t1) (restoreNames ctx t2)
restoreNames _ NTrue = TTrue
restoreNames _ NFalse = TFalse
restoreNames ctx (NSucc n) = Succ (restoreNames ctx n)
restoreNames _ NZero = Zero
restoreNames _ (NString s) = TString s

-- | List free variables in a named representation.
fv :: Term -> [String]
fv (Var s) = [s]
fv (Abs s _ t) = fv t \\ [s]
fv (App t1 t2) = fv t1 `union` fv t2
fv TTrue = []
fv TFalse = []
fv (Succ _) = []
fv Zero = []
fv (TString _) = []

shift :: Int -> Int -> Nameless -> Nameless
shift d c (NVar k) = if k < c then NVar k else NVar (k + d)
shift d c (NAbs s ty t) = NAbs s ty (shift d (c + 1) t)
shift d c (NApp t1 t2) = NApp (shift d c t1) (shift d c t2)
shift _ _ NTrue = NTrue
shift _ _ NFalse = NFalse
shift _ _ (NSucc n) = NSucc n
shift _ _ NZero = NZero
shift _ _ (NString s) = NString s

subst :: Int -> Nameless -> Nameless -> Nameless
subst j s (NVar k) = if k == j then s else NVar k
subst j s (NAbs s' ty t1) = NAbs s' ty (subst (j + 1) (shift 1 0 s) t1)
subst j s (NApp t1 t2) = NApp (subst j s t1) (subst j s t2)
subst _ _ NTrue = NTrue
subst _ _ NFalse = NFalse
subst _ _ (NSucc n) = NSucc n
subst _ _ NZero = NZero
subst _ _ (NString s) = NString s

betaReduce :: Nameless -> Nameless -> Nameless
betaReduce t1 t2 = shift (-1) 0 (subst 0 (shift 1 0 t2) t1)

isVal :: Nameless -> Bool
isVal (NApp _ _) = True
isVal NTrue = True
isVal NFalse = True
isVal (NSucc _) = True
isVal NZero = True
isVal (NString _) = True
isVal _ = False

evaluate :: Nameless -> Either String Nameless
evaluate (NApp (NAbs _ _ t1) t2)
  | isVal t2 = Right $ betaReduce t1 t2
evaluate (NApp t1 t2)
  | isVal t1 = do
      t2' <- evaluate t2
      return $ NApp t1 t2'
evaluate (NApp t1 t2) = do
  t1' <- evaluate t1
  return $ NApp t1' t2
evaluate x = Left ("No evaluation rule applies for " ++ show x)

--evaluate :: Nameless -> Nameless
--evaluate t = let t' = evaluate' t
--             in evaluate t'


text:
* Add media volume uniform
* Fix cleaning source from invalid characters

## 2.25.0
* Add nightMode uniform

## 2.24.0
* Add touchStart uniform

## 2.23.5
* Skip too large textures when importing
* Fix showing SQL exceptions when importing a database

## 2.23.4
* Fix support for RTL layouts

## 2.23.3
* Hard-code text orientation of the source editor to left
* Automatically convert ShaderToy sources
* Add a monochome launcher icon for Android 13

## 2.23.2
* Fix opening FAQs in browser
* Remove unnecessary WRITE permissions for Android Q+

## 2.23.1
* Fix handling battery updates on Android O+

## 2.23.0
* Add powerConnected uniform
* Fix registering for battery updates on Android N+

## 2.22.0
* Import/Export SQLite database

## 2.21.0
* Add daytime uniform

## 2.20.0
* Open live wallpaper picker if app is not set as live wallpaper
* Apply Material Design to preferences
* Extra preview is completely full screen now

## 2.19.0
* Add 1/16 and 1/32 quality levels
* Set quality to 1/2 for shaders added by intents
* Update toolbar title when shader is renamed

## 2.18.0
* Turn on autosave by default
* Add support for GLES 310 and 320
* Add GLES 300 sample shader
* Add Cloudy Conway sample shader

## 2.17.0
* Add undo/redo to editor
* Make all default actions Floating Action Buttons
* Move "Save as" menu item directly below "Save"
* Add more intent filters for application/glsl files
* Load shaders as UTF-8 text
* Prefer TYPE_GAME_ROTATION_VECTOR for the rotation uniform
* Fix showing inactive cube map bitmaps in composer

## 2.16.0
* Add uniform for rotation vector sensor
* Alternatively calculate rotation matrix from rotation vector if necessary
* Fix using accelerometer sensor to calculate gravity

## 2.15.0
* Adds frame count uniform

## 2.14.0
* Adds import and export for shaders

## 2.13.0
* Adds a preference to auto save changes

## 2.12.0
* Adds a preference to disable syntax highlighting for large shaders

## 2.11.0
* New app icon
* Added adaptive app icon for Android 8.0
* Added FAQ menu item to answer common questions
* Added swirl gun example
* Shows a message for "Set wallpaper" when not set as live wallpaper

## 2.10.6
* Expose rotation and inclination matrix as uniforms
* Rename rotation uniform to gyroscope

## 2.10.5
* Fallback to old gravity and linear acceleration calculation if necessary
* Add uniform for geomagnetic inclination angle

## 2.10.4
* Fix remapping of orientation uniform
* Use system-calculated gravity and linear acceleration data

## 2.10.3
* Insert preprocessor directives after #version

## 2.10.2
* Remove non-ascii characters from pasted source code

## 2.10.1
* Match version declaration of vertex shader

## 2.10.0
* Try to acquire a GLES 3.0 context if available

## 2.9.1
* Fix broken backbuffer preset selection
* Fix crash when setting backbuffer parameters

## 2.9.0
* Choose any shader as the template for new shaders
* Remap orientation uniform when device is rotated
* Show shader name in settings summary too
* Fixed initializing camera

## 2.8.1
* Fixed clearing empty backbuffer
* Fixed floating action button icon color

## 2.8.0
* Set a texture for the initial backbuffer
* Replace already existing uniform statements when adding them
* Samples can have a lower quality setting

## 2.7.0
* Collection of sample shaders added
* Use front or back camera as texture
* New uniforms to rotate camera frame to match with device orientation
* Give shaders a name
* Use a low-pass filter on the orientation uniform

## 2.6.1
* Use previous defaults for sampler texture params
* Converted shader samples indenting style

## 2.6.0
* Support custom texture parameters for each sampler
* Removed laser lines shader

## 2.5.3
* Enable/disable listening for battery events in wallpaper service

## 2.5.2
* Fixed terminating wallpaper service after use
* Fixed reusing list items

## 2.5.1
* Added a splash screen to give feedback while loading
* Fixed input type of editor to allow GBoard swipe shortcuts
* Fixed loading of external images on Yotaphone 2

## 2.5.0
* Added orientation uniform exposing azimuth, pitch and roll
* Fixed rotation uniform
* Improved description for rotation and magnetic sensors
* Sorted preset uniforms by name for a better overview
* Double tap zooms/restores in texture viewer
* Reformatted to standard Android coding style
* Use left/right padding for editor only

## 2.4.6
* Set current shader as wallpaper shader

## 2.4.5
* New setting to open preview activity in new task

## 2.4.4
* Support Nougat's multi-window mode
* Removed superfluous ScrollView around EditText
* Update highlighting after setting an error line

## 2.4.3
* Made ftime's period definable in shader source

## 2.4.2
* New second and subsecond uniform, changed ftime
* Extra uniform to transfer fractional part of time
* Fixed date uniform, now updates properly every second

## 2.4.1
* Fixed inserting code from texture fragment

## 2.4.0
* Support for samplerCube
* Configurable tab width
* Deep Link for App Indexing
* Run lint and FindBugs when building for release
* Renamed project directory to app

## 2.3.1
* Added date/time and startRandom uniform
* Allow underscores and hyphens in texture names
* Show texture name in texture view
* Add READ_EXTERNAL_STORAGE permission for API < 19

## 2.3.0
* Exposure of light, pressure and proximity sensors
* Expose magnetic field sensor
* Fixed binding of multiple textures
* Create sensor listeners on demand

## 2.2.0
* Add uniforms by picking them form a list
* Moved quality spinner to the right/end
* Fixed monitoring battery level
* Drop glClear() to preserve pixel buffer
* Only show update wallpaper if set as wallpaper

## 2.1.0
* Change render resolution/quality
* Fixed inserting sampler2D statement

## 2.0.3
* Handle out of memory exception

## 2.0.2
* Better names for time constants and labels
* Additional sample shaders
* Put ImageView's behind translucent system bars

## 2.0.1
* Button to rotate source image for texture
* Intent filter for text/plain and image/\*

## 2.0.0
* Material Design refactoring
* Import and use textures from images on the device
* Update wallpaper shader from menu
* Wrap time variable
* Use highp where available
* Run shader in extra activity
* Support multiple touches
* Turn wallpaper black when battery is low
* Converted to gradle

## 1.6.3
* Bind texture again for drawing into framebuffer

## 1.6.2
* Show overflow icon in action bar for Lollipop

## 1.6.1
* Show source if it's hidden and there's an error

## 1.6.0
* Fixed y-flipped rendering when using a frame buffer
* Support for gyroscope and battery

## 1.5.0
* Remove trailing white space on save
* Improved auto indenting

## 1.4.0
* Implemented back buffer
* Preference to change update delay of editor
* Preference to set editor text size

## 1.3.0
* Set rate of sensor events

## 1.2.0
* Improved auto-indenting
* Exposed wallpaper offset

## 1.1.2
* Fixed dead-lock when no program is running

## 1.1.1
* Removed String.isEmpty()

## 1.1.0
* Show FPS in spinner label
* Added FPS gauge
* Added simple auto indenting


text:
<?php

namespace suralc\yii2\PureWidgets;

class Table extends Widget
{
    public $items;
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>integration</artifactId>
        <groupId>org.toxos.process-assertions</groupId>
        <version>0.7.2-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.toxos.process-assertions.integration</groupId>
    <artifactId>common-integration</artifactId>
    <name>${projectNamePrefix} Common Integration</name>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <configuration>
                    <!-- Skip deployment of this module -->
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>


text:
std::unique_ptr<Sender> Sender::create() {
    Sender *ret = new StdSender();
    return std::unique_ptr<Sender>(ret);
}

std::unique_ptr<Sender> Sender::create(std::string host, std::string port) {
    try {
        auto query = boost::asio::ip::tcp::resolver::query(host, port);
        Sender *client = new TcpSender(query);
        return std::unique_ptr<Sender>(client);
    } catch (std::exception &e) {
        BOOST_THROW_EXCEPTION(e);
    }
}


text:
#if !defined(AFX_MARKUPSTL_H__948A2705_9E68_11D2_A0BF_00105A27C570__INCLUDED_)
#define AFX_MARKUPSTL_H__948A2705_9E68_11D2_A0BF_00105A27C570__INCLUDED_

#if (defined(WIN32) || defined(WIN64))
#pragma warning(disable:4996) // suppress VS 2005 deprecated function warnings
#pragma warning(disable:4786) // for string
#endif

#include <string>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>

#ifdef _DEBUG
#define _DS(i) (i?&(m_strDoc.c_str())[m_aPos[i].nStart]:0)
#define MARKUP_SETDEBUGSTATE m_pMainDS=_DS(m_iPos); m_pChildDS=_DS(m_iPosChild)
#else
#define MARKUP_SETDEBUGSTATE
#endif

#if _MSC_VER >= 1200
#define strnicmp  _strnicmp
#else
#define strnicmp strncasecmp
#endif

class CMarkupSTL
{
public:
        CMarkupSTL() { SetDoc( NULL ); InitDocFlags(); };
        CMarkupSTL( const char* szDoc ) { SetDoc( szDoc ); InitDocFlags(); };
        CMarkupSTL( int nFlags ) { SetDoc( NULL ); m_nFlags = nFlags; };
        CMarkupSTL( const CMarkupSTL& markup ) { *this = markup; };
        void operator=( const CMarkupSTL& markup );
        ~CMarkupSTL() {};

        // Navigate
        bool Load( const char* szFileName );
        bool SetDoc( const char* szDoc );
        bool IsWellFormed();
        bool FindElem( const char* szName=NULL );
        bool FindChildElem( const char* szName=NULL );
        bool IntoElem();
        bool OutOfElem();
        void ResetChildPos() { x_SetPos(m_iPosParent,m_iPos,0); };
        void ResetMainPos() { x_SetPos(m_iPosParent,0,0); };
        void ResetPos() { x_SetPos(0,0,0); };
        std::string GetTagName() const;
        std::string GetChildTagName() const { return x_GetTagName(m_iPosChild); };
        std::string GetData() const { return x_GetData(m_iPos); };
        std::string GetChildData() const { return x_GetData(m_iPosChild); };
        std::string GetElemContent() const { return x_GetElemContent(m_iPos); };
        std::string GetAttrib( const char* szAttrib ) const { return x_GetAttrib(m_iPos,szAttrib); };
        std::string GetChildAttrib( const char* szAttrib ) const { return x_GetAttrib(m_iPosChild,szAttrib); };
        std::string GetAttribName( int n ) const;
        int FindNode( int nType=0 );
        int GetNodeType() { return m_nNodeType; };
        bool SavePos( const char* szPosName="" );
        bool RestorePos( const char* szPosName="" );
        const std::string& GetError() const { return m_strError; };
        int GetDocFlags() const { return m_nFlags; };
        void SetDocFlags( int nFlags ) { m_nFlags = nFlags; };
        enum MarkupDocFlags
        {
                MDF_IGNORECASE = 8,
        };
        enum MarkupNodeFlags
        {
                MNF_WITHCDATA      = 0x01,
                MNF_WITHNOLINES    = 0x02,
                MNF_WITHXHTMLSPACE = 0x04,
                MNF_WITHREFS       = 0x08,
                MNF_WITHNOEND      = 0x10,
                MNF_ESCAPEQUOTES  = 0x100,
                MNF_NONENDED   = 0x100000,
                MNF_ILLDATA    = 0x200000,
        };
        enum MarkupNodeType
        {
                MNT_ELEMENT                                     = 1,  // 0x01
                MNT_TEXT                                        = 2,  // 0x02
                MNT_WHITESPACE                          = 4,  // 0x04
                MNT_CDATA_SECTION                       = 8,  // 0x08
                MNT_PROCESSING_INSTRUCTION      = 16, // 0x10
                MNT_COMMENT                                     = 32, // 0x20
                MNT_DOCUMENT_TYPE                       = 64, // 0x40
                MNT_EXCLUDE_WHITESPACE          = 123,// 0x7b
                MNT_LONE_END_TAG                        = 128,// 0x80
                MNT_NODE_ERROR              = 32768 // 0x8000
        };

        // Create
        bool Save( const char* szFileName );
        const std::string& GetDoc() const { return m_strDoc; };
        bool AddElem( const char* szName, const char* szData=NULL, int nFlags=0 ) { return x_AddElem(szName,szData,nFlags); };
        bool InsertElem( const char* szName, const char* szData=NULL, int nFlags=0 ) { return x_AddElem(szName,szData,nFlags|MNF_INSERT); };
        bool AddChildElem( const char* szName, const char* szData=NULL, int nFlags=0 ) { return x_AddElem(szName,szData,nFlags|MNF_CHILD); };
        bool InsertChildElem( const char* szName, const char* szData=NULL, int nFlags=0 ) { return x_AddElem(szName,szData,nFlags|MNF_INSERT|MNF_CHILD); };
        bool AddElem( const char* szName, int nValue, int nFlags=0 ) { return x_AddElem(szName,nValue,nFlags); };
        bool InsertElem( const char* szName, int nValue, int nFlags=0 ) { return x_AddElem(szName,nValue,nFlags|MNF_INSERT); };
        bool AddChildElem( const char* szName, int nValue, int nFlags=0 ) { return x_AddElem(szName,nValue,nFlags|MNF_CHILD); };
        bool InsertChildElem( const char* szName, int nValue, int nFlags=0 ) { return x_AddElem(szName,nValue,nFlags|MNF_INSERT|MNF_CHILD); };
        bool AddAttrib( const char* szAttrib, const char* szValue ) { return x_SetAttrib(m_iPos,szAttrib,szValue); };
        bool AddChildAttrib( const char* szAttrib, const char* szValue ) { return x_SetAttrib(m_iPosChild,szAttrib,szValue); };
        bool AddAttrib( const char* szAttrib, int nValue ) { return x_SetAttrib(m_iPos,szAttrib,nValue); };
        bool AddChildAttrib( const char* szAttrib, int nValue ) { return x_SetAttrib(m_iPosChild,szAttrib,nValue); };
        bool AddSubDoc( const char* szSubDoc ) { return x_AddSubDoc(szSubDoc,0); };
        bool InsertSubDoc( const char* szSubDoc ) { return x_AddSubDoc(szSubDoc,MNF_INSERT); };
        std::string GetSubDoc() const { return x_GetSubDoc(m_iPos); };
        bool AddChildSubDoc( const char* szSubDoc ) { return x_AddSubDoc(szSubDoc,MNF_CHILD); };
        bool InsertChildSubDoc( const char* szSubDoc ) { return x_AddSubDoc(szSubDoc,MNF_CHILD|MNF_INSERT); };
        std::string GetChildSubDoc() const { return x_GetSubDoc(m_iPosChild); };
        bool AddNode( int nType, const char* szText ) { return x_AddNode(nType,szText,0); };
        bool InsertNode( int nType, const char* szText ) { return x_AddNode(nType,szText,MNF_INSERT); };

        // Modify
        bool RemoveElem();
        bool RemoveChildElem();
        bool RemoveNode();
        bool SetAttrib( const char* szAttrib, const char* szValue ) { return x_SetAttrib(m_iPos,szAttrib,szValue); };
        bool SetChildAttrib( const char* szAttrib, const char* szValue ) { return x_SetAttrib(m_iPosChild,szAttrib,szValue); };
        bool SetAttrib( const char* szAttrib, int nValue ) { return x_SetAttrib(m_iPos,szAttrib,nValue); };
        bool SetChildAttrib( const char* szAttrib, int nValue ) { return x_SetAttrib(m_iPosChild,szAttrib,nValue); };
        bool SetData( const char* szData, int nFlags=0 ) { return x_SetData(m_iPos,szData,nFlags); };
        bool SetChildData( const char* szData, int nFlags=0 ) { return x_SetData(m_iPosChild,szData,nFlags); };
        bool SetData( int nValue ) { return x_SetData(m_iPos,nValue); };
        bool SetChildData( int nValue ) { return x_SetData(m_iPosChild,nValue); };
        bool SetElemContent( const char* szContent ) { return x_SetElemContent(szContent); };

        // Utility
        static bool ReadTextFile( const char* szFileName, std::string& strDoc, std::string* pstrError=NULL, int* pnFlags=NULL );
        static bool WriteTextFile( const char* szFileName, std::string& strDoc, std::string* pstrError=NULL, int* pnFlags=NULL );
        static std::string EscapeText( const char* szText, int nFlags = 0 );
        static std::string UnescapeText( const char* szText, int nTextLength = -1 );

protected:

#ifdef _DEBUG
        const char* m_pMainDS;
        const char* m_pChildDS;
#endif

        std::string m_strDoc;
        std::string m_strError;

        int m_iPosParent;
        int m_iPos;
        int m_iPosChild;
        int m_iPosFree;
        int m_iPosDeleted;
        int m_nNodeType;
        int m_nNodeOffset;
        int m_nNodeLength;
        int m_nFlags;

        struct ElemPos
        {
                ElemPos() {};
                ElemPos( const ElemPos& pos ) { *this = pos; };
                enum { EP_STBITS=22, EP_STMASK=0x2fffff, EP_LEVMASK=0xffff };
                int StartTagLen() const { return (nTagLengths & EP_STMASK); };
                void SetStartTagLen( int n ) { nTagLengths = (nTagLengths & ~EP_STMASK) + n; };
                void AdjustStartTagLen( int n ) { nTagLengths += n; };
                int EndTagLen() const { return (nTagLengths >> EP_STBITS); };
                void SetEndTagLen( int n ) { nTagLengths = (nTagLengths & EP_STMASK) + (n << EP_STBITS); };
                bool IsEmptyElement() { return (StartTagLen()==nLength)?true:false; };
                int StartContent() const { return nStart + StartTagLen(); };
                int ContentLen() const { return nLength - StartTagLen() - EndTagLen(); };
                int StartAfter() const { return nStart + nLength; };
                int Level() const { return nFlags & EP_LEVMASK; };
                void SetLevel( int nLev ) { nFlags = (nFlags & ~EP_LEVMASK) | nLev; };
                void ClearVirtualParent() { memset(this,0,sizeof(ElemPos)); };

                // Memory size: 8 32-bit integers == 32 bytes
                int nStart;
                int nLength;
                int nTagLengths; // 22 bits 4MB limit for start tag, 10 bits 1K limit for end tag
                int nFlags; // 16 bits flags, 16 bits level 65536 depth limit
                int iElemParent;
                int iElemChild; // first child
                int iElemNext;
                int iElemPrev; // if this is first child, iElemPrev points to last
        };

        enum MarkupNodeFlagsInternal
        {
                MNF_REPLACE    = 0x001000,
                MNF_INSERT     = 0x002000,
                MNF_CHILD      = 0x004000,
                MNF_QUOTED     = 0x008000,
                MNF_EMPTY      = 0x010000,
                MNF_DELETED    = 0x020000,
                MNF_FIRST      = 0x080000,
                MNF_PUBLIC     = 0x300000,
                MNF_ILLFORMED  = 0x800000,
        };

        struct NodePos
        {
                NodePos() {};
                NodePos( int n ) { nFlags=n; nNodeType=0; nStart=0; nLength=0; };
                int nNodeType;
                int nStart;
                int nLength;
                int nFlags;
                std::string strMeta;
        };

        struct TokenPos
        {
                TokenPos( const char* sz, int n ) { Clear(); szDoc=sz; nTokenFlags=n; };
                TokenPos( const std::string& str, int n ) { Clear(); szDoc=str.c_str(); nTokenFlags=n; };
                void Clear() { nL=0; nR=-1; nNext=0; };
                int Length() const { return nR - nL + 1; };
                bool Match( const std::string& strName ) { return Match(strName.c_str()); };
                bool Match( const char* szName )
                {
                        int nLen = nR - nL + 1;
                        if ( nTokenFlags & MDF_IGNORECASE )
                                return ( (strnicmp( &szDoc[nL], szName, nLen ) == 0)
                                        && ( szName[nLen] == '\0' || strchr(" =/[]",szName[nLen]) ) );
                        else
                                return ( (strncmp( &szDoc[nL], szName, nLen ) == 0)
                                        && ( szName[nLen] == '\0' || strchr(" =/[]",szName[nLen]) ) );
                };
                int nL;
                int nR;
                int nNext;
                const char* szDoc;
                int nTokenFlags;
                int nPreSpaceStart;
                int nPreSpaceLength;
        };

        struct SavedPos
        {
                SavedPos() { nSavedPosFlags=0; iPos=0; };
                std::string strName;
                int iPos;
                int nSavedPosFlags;
        };

        struct SavedPosMap
        {
                SavedPosMap() { pTable = NULL; };
                ~SavedPosMap() { RemoveAll(); };
                void RemoveAll() { if (pTable) Release(); pTable=NULL; };
                enum { SPM_SIZE = 7, SPM_MAIN = 1, SPM_CHILD = 2, SPM_USED = 4, SPM_LAST = 8 };
                void Release() { for (int n=0;n<SPM_SIZE;++n) if (pTable[n]) delete[] pTable[n]; delete[] pTable; };
                void AllocMapTable() { pTable = new SavedPos*[SPM_SIZE]; for (int n=0; n<SPM_SIZE; ++n) pTable[n]=NULL; };
                int Hash( const char* szName ) { int n=0; while (*szName) n += *szName++; return n % SPM_SIZE; };
                SavedPos** pTable;
        };
        SavedPosMap m_mapSavedPos;

        struct PosArray
        {
                PosArray() { Clear(); };
                ~PosArray() { Release(); };
                enum { PA_SEGBITS = 16, PA_SEGMASK = 0xffff };
                void RemoveAll() { Release(); Clear(); };
                void Release() { for (int n=0;n<SegsUsed();++n) delete[] (char*)pSegs[n]; if (pSegs) delete[] (char*)pSegs; };
                void Clear() { nSegs=0; nSize=0; pSegs=NULL; };
                int GetSize() const { return nSize; };
                int SegsUsed() const { return ((nSize-1)>>PA_SEGBITS) + 1; };
                ElemPos& operator[](int n) const { return pSegs[n>>PA_SEGBITS][n&PA_SEGMASK]; };
                ElemPos** pSegs;
                int nSize;
                int nSegs;
        };
        PosArray m_aPos;

        struct NodeStack
        {
                NodeStack() { nTop=-1; nSize=0; pN=NULL; };
                ~NodeStack() { if (pN) delete [] pN; };
                NodePos& Top() { return pN[nTop]; };
                NodePos& At( int n ) { return pN[n]; };
                void Add() { ++nTop; if (nTop==nSize) Alloc(nSize*2+6); };
                void Remove() { --nTop; };
                int TopIndex() { return nTop; };
        protected:
                void Alloc( int nNewSize ) { NodePos* pNNew = new NodePos[nNewSize]; Copy(pNNew); nSize=nNewSize; };
                void Copy( NodePos* pNNew ) { for(int n=0;n<nSize;++n) pNNew[n]=pN[n]; if (pN) delete [] pN; pN=pNNew; };
                NodePos* pN;
                int nSize;
                int nTop;
        };

        void x_SetPos( int iPosParent, int iPos, int iPosChild )
        {
                m_iPosParent = iPosParent;
                m_iPos = iPos;
                m_iPosChild = iPosChild;
                m_nNodeOffset = 0;
                m_nNodeLength = 0;
                m_nNodeType = iPos?MNT_ELEMENT:0;
                MARKUP_SETDEBUGSTATE;
        };
        int x_GetFreePos()
        {
                if ( m_iPosFree == m_aPos.GetSize() )
                        x_AllocPosArray();
                return m_iPosFree++;
        };
        bool x_AllocPosArray( int nNewSize = 0 );

        void InitDocFlags()
        {
                // To always ignore case, define MARKUP_IGNORECASE
        #ifdef MARKUP_IGNORECASE
                m_nFlags = MDF_IGNORECASE;
        #else
                m_nFlags = 0;
        #endif
        };

        bool x_ParseDoc();
        int x_ParseElem( int iPos, TokenPos& token );
        static bool x_FindAny( const char* szDoc, int& nChar );
        static bool x_FindName( TokenPos& token );
        static std::string x_GetToken( const TokenPos& token );
        int x_FindElem( int iPosParent, int iPos, const char* szPath ) const;
        std::string x_GetPath( int iPos ) const;
        std::string x_GetTagName( int iPos ) const;
        std::string x_GetData( int iPos ) const;
        std::string x_GetAttrib( int iPos, const char* szAttrib ) const;
        static std::string x_EncodeCDATASection( const char* szData );
        bool x_AddElem( const char* szName, const char* szValue, int nFlags );
        bool x_AddElem( const char* szName, int nValue, int nFlags );
        std::string x_GetSubDoc( int iPos ) const;
        bool x_AddSubDoc( const char* szSubDoc, int nFlags );
        static bool x_FindAttrib( TokenPos& token, const char* szAttrib, int n=0 );
        bool x_SetAttrib( int iPos, const char* szAttrib, const char* szValue );
        bool x_SetAttrib( int iPos, const char* szAttrib, int nValue );
        bool x_AddNode( int nNodeType, const char* szText, int nFlags );
        void x_RemoveNode( int iPosParent, int& iPos, int& nNodeType, int& nNodeOffset, int& nNodeLength );
        void x_AdjustForNode( int iPosParent, int iPos, int nShift );
        static bool x_CreateNode( std::string& strNode, int nNodeType, const char* szText );
        int x_InsertNew( int iPosParent, int& iPosRel, NodePos& node );
        void x_LinkElem( int iPosParent, int iPosBefore, int iPos );
        int x_UnlinkElem( int iPos );
        int x_ReleaseSubDoc( int iPos );
        int x_ReleasePos( int iPos );
        void x_CheckSavedPos();
        static int x_ParseNode( TokenPos& token, NodePos& node );
        bool x_SetData( int iPos, const char* szData, int nFlags );
        bool x_SetData( int iPos, int nValue );
        int x_RemoveElem( int iPos );
        std::string x_GetElemContent( int iPos ) const;
        bool x_SetElemContent( const char* szContent );
        void x_DocChange( int nLeft, int nReplace, const std::string& strInsert );
        void x_Adjust( int iPos, int nShift, bool bAfterPos = false );
};

#endif // !defined(AFX_MARKUPSTL_H__948A2705_9E68_11D2_A0BF_00105A27C570__INCLUDED_)


text:
from django.conf.urls import patterns, url

from web import views

urlpatterns = patterns('',
    url(r'^items/(?P<item_id>\d+)/$', views.item, name='item'),
    url(r'^items/gen/$', views.item_gen, name='item_gen'),
    url(r'^items/$', views.item_list, name='item_list'),
    url(r'^affixes/g/(?P<affix_group_id>\d+)/$', views.affix_group, name='affix_group'),
    url(r'^affixes/(?P<affix_id>\d+)/$', views.affix, name='affix'),
    url(r'^affixes/$', views.affix_list, name='affix_list'),
    url(r'^characters/create/$', views.character_create, name="character_create"),
    url(r'^accounts/login/$', views.login_view, name='login'),
    url(r'^accounts/logout/$', views.logout_view, name='logout'),
    url(r'^$', views.index, name='index')
)


text:
package de.mccityville.common.bukkit.commands;

import org.bukkit.command.CommandSender;

public class ExampleCommands {

	public static final int METHODS = 2;

	private boolean test1Executed = false;
	private static boolean test2Executed = false;

	@Command(name="test1")
	public void testCommand(CommandSender sender, String[] args) {
		test1Executed = true;
	}

	@Command(name="test2")
	public static void testStaticCommand(CommandSender sender, String[] args) {
		test2Executed = true;
	}

	public boolean isTest1Executed() {
		return test1Executed;
	}

	public static boolean isTest2Executed() {
		return test2Executed;
	}
}


text:
"use strict";

	window.onload = function() {

		var window_width = window.innerWidth; //Sorry, ie8-

		/* Menu toggle */

		var menu_height;

		window_width < 480 ? menu_height = 300 : menu_height = 200;

		/* If changed */

		window.onresize = function() {
			window_width = window.innerWidth;
			window_width < 480 ? menu_height = 300 : menu_height = 200;

			var menu = document.querySelector('.main_menu');
			var menu_status = getCss(menu, 'display');
			if(menu_status === "block" && window_width < 768) {
				menu.style.height = menu_height + 'px';
			}
			else {
				menu.style.height = 0 + 'px';
			}
		};

		var toggle_menu = document.querySelector('.menu-mini');
		toggle_menu.addEventListener("click", function(){
			window_width = window.innerWidth;

			toggleBlock('.menu-mini', menu_height);
		});

		//

	};

	/* Functions */

	function toggleBlock(css, height) {
		var block = document.querySelector('.main_menu');
		var display = getCss(block, 'display');
		if(display === 'block') {
			var cur_hei = height;
			var hei = 0;
			block.style.height = height + 'px';

			var interval = setTimeout(function go() {
				block.style.height = (parseInt(block.style.height) - 5) + 'px';
				if(parseInt(block.style.height) > hei) {
					setTimeout(go, 1);
				}
				else {
					block.style.display = 'none';
				}
			}, 1);

		}
		else if(display === 'none') {
			var cur_hei = 0;
			var hei = height;
			block.style.height = '0px';
			block.style.display = 'block';

			var interval = setTimeout(function go() {
				block.style.height = (parseInt(block.style.height) + 5) + 'px';
				if(parseInt(block.style.height) < hei) {
					setTimeout(go, 1);
				}
			}, 1);
		}
	}

	function getCss(node, prop) {
		return getComputedStyle(node).getPropertyValue(prop);
	}


text:
package com.devilwwj.loginandregister.utils;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * SharedPreference操作类
 * Created by devilwwj on 16/1/23.
 */
public class SpUtils {
    private static final String spFileName = "app";

    public static String getString(Context context, String strKey) {
        SharedPreferences setPreferences = context.getSharedPreferences(
                spFileName, Context.MODE_PRIVATE);
        String result = setPreferences.getString(strKey, "");
        return result;
    }

    public static String getString(Context context, String strKey,
                                   String strDefault) {
        SharedPreferences setPreferences = context.getSharedPreferences(
                spFileName, Context.MODE_PRIVATE);
        String result = setPreferences.getString(strKey, strDefault);
        return result;
    }

    public static void putString(Context context, String strKey, String strData) {
        SharedPreferences activityPreferences = context.getSharedPreferences(
                spFileName, Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = activityPreferences.edit();
        editor.putString(strKey, strData);
        editor.commit();
    }

    public static Boolean getBoolean(Context context, String strKey) {
        SharedPreferences setPreferences = context.getSharedPreferences(
                spFileName, Context.MODE_PRIVATE);
        Boolean result = setPreferences.getBoolean(strKey, false);
        return result;
    }

    public static Boolean getBoolean(Context context, String strKey,
                                     Boolean strDefault) {
        SharedPreferences setPreferences = context.getSharedPreferences(
                spFileName, Context.MODE_PRIVATE);
        Boolean result = setPreferences.getBoolean(strKey, strDefault);
        return result;
    }

    public static void putBoolean(Context context, String strKey,
                                  Boolean strData) {
        SharedPreferences activityPreferences = context.getSharedPreferences(
                spFileName, Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = activityPreferences.edit();
        editor.putBoolean(strKey, strData);
        editor.commit();
    }

    public static int getInt(Context context, String strKey) {
        SharedPreferences setPreferences = context.getSharedPreferences(
                spFileName, Context.MODE_PRIVATE);
        int result = setPreferences.getInt(strKey, -1);
        return result;
    }

    public static int getInt(Context context, String strKey, int strDefault) {
        SharedPreferences setPreferences = context.getSharedPreferences(
                spFileName, Context.MODE_PRIVATE);
        int result = setPreferences.getInt(strKey, strDefault);
        return result;
    }

    public static void putInt(Context context, String strKey, int strData) {
        SharedPreferences activityPreferences = context.getSharedPreferences(
                spFileName, Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = activityPreferences.edit();
        editor.putInt(strKey, strData);
        editor.commit();
    }

    public static long getLong(Context context, String strKey) {
        SharedPreferences setPreferences = context.getSharedPreferences(
                spFileName, Context.MODE_PRIVATE);
        long result = setPreferences.getLong(strKey, -1);
        return result;
    }

    public static long getLong(Context context, String strKey, long strDefault) {
        SharedPreferences setPreferences = context.getSharedPreferences(
                spFileName, Context.MODE_PRIVATE);
        long result = setPreferences.getLong(strKey, strDefault);
        return result;
    }

    public static void putLong(Context context, String strKey, long strData) {
        SharedPreferences activityPreferences = context.getSharedPreferences(
                spFileName, Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = activityPreferences.edit();
        editor.putLong(strKey, strData);
        editor.commit();
    }
}


text:
 package org.apache.hadoop.mapred;

import junit.framework.TestCase;

import java.util.Collection;
import java.util.Set;
import java.util.HashSet;
import java.util.Arrays;
import java.util.Timer;
import java.util.TimerTask;
import java.io.IOException;
import java.io.File;

import org.apache.hadoop.conf.Configuration;

/**
 * Base class for various scheduler tests
 */
public class BaseSchedulerTest extends TestCase {
  final static String[] QUEUES = new String[] {"queue1","queue2"};
  protected FakeDynamicTimer timer = new FakeDynamicTimer();
  protected FakeTaskTrackerManager taskTracker = new FakeTaskTrackerManager();
  protected String budgetFile;
  protected Configuration conf;
   /**
   * Create the test budget file
   * @throws Exception
   */
  @Override
  protected void setUp() throws Exception {
    super.setUp();
     String pathname = System.getProperty("test.build.data",
                                          "build/contrib/dynamic-scheduler/test/data");
     String testDir = new File(pathname).getAbsolutePath();
    budgetFile = new File(testDir, "test-budget").getAbsolutePath();
    new File(testDir).mkdirs();
    new File(budgetFile).createNewFile();
         conf = new Configuration();
    conf.set(PrioritySchedulerOptions.DYNAMIC_SCHEDULER_ALLOC_INTERVAL, "2");
    conf.set(PrioritySchedulerOptions.DYNAMIC_SCHEDULER_BUDGET_FILE, budgetFile);
  }

  /**
    * deletes the test budget file
    * @throws Exception
    */
   @Override
   protected void tearDown() throws Exception {
     new File(budgetFile).delete();
   }

  static class FakeTaskTrackerManager implements TaskTrackerManager {
    FakeQueueManager qm = new FakeQueueManager();
    public FakeTaskTrackerManager() {
    }
    public void addTaskTracker(String ttName) {
    }
    public ClusterStatus getClusterStatus() {
      return null;
    }
    public int getNumberOfUniqueHosts() {
      return 0;
    }
    public int getNextHeartbeatInterval() {
      return 0;
    }
    public Collection<TaskTrackerStatus> taskTrackers() {
      return null;
    }
    public void addJobInProgressListener(JobInProgressListener listener) {
    }
    public void removeJobInProgressListener(JobInProgressListener listener) {
    }
    public void submitJob(JobInProgress job) {
    }
    public TaskTrackerStatus getTaskTracker(String trackerID) {
      return null;
    }
    public void killJob(JobID jobid) throws IOException {
    }
    public JobInProgress getJob(JobID jobid) {
      return null;
    }
    public void initJob(JobInProgress job) {
    }
    public void failJob(JobInProgress job) {
    }
    public void startTask(String taskTrackerName, final Task t) {
    }
    public boolean killTask(TaskAttemptID attemptId, boolean shouldFail) {
      return true;
    }
    void addQueues(String[] arr) {
      Set<String> queues = new HashSet<String>();
      queues.addAll(Arrays.asList(arr));
      qm.setQueues(queues);
    }
    public QueueManager getQueueManager() {
      return qm;
    }
  }

  static class FakeDynamicTimer extends Timer {
    private TimerTask task;
    public void scheduleAtFixedRate(TimerTask task, long delay, long period) {
      this.task = task;
    }
    public void runTask() {
      task.run();
    }
  }

  static class FakeQueueManager extends QueueManager {
    private Set<String> queues = null;
    FakeQueueManager() {
      super(new Configuration());
    }
    void setQueues(Set<String> queues) {
      this.queues = queues;
    }
    public synchronized Set<String> getLeafQueueNames() {
      return queues;
    }
  }

}


text:
all: get-deps compile

get-deps:
	./rebar get-deps

compile:
	./rebar compile


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<title>Spark License</title>

Spark License

    Readme|Changelog|License

Apache License

Version 2.0, January 2004

http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use,
reproduction, and distribution as defined by Sections 1 through 9 of this
document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common control
with that entity. For the purposes of this definition, "control"
means (i) the power, direct or indirect, to cause the direction or management
of such entity, whether by contract or otherwise, or (ii) ownership of fifty
percent (50%) or more of the outstanding shares, or (iii) beneficial ownership
of such entity.

"You" (or "Your") shall mean an individual or Legal
Entity exercising permissions granted by this License.

"Source" form shall mean the preferred form for making
modifications, including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but not limited to
compiled object code, generated documentation, and conversions to other media
types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a copyright
notice that is included in or attached to the work (an example is provided in
the Appendix below).

"Derivative Works" shall mean any work, whether in Source or
Object form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes of this
License, Derivative Works shall not include works that remain separable from,
or merely link (or bind by name) to the interfaces of, the Work and Derivative
Works thereof.

"Contribution" shall mean any work of authorship, including the
original version of the Work and any modifications or additions to that Work or
Derivative Works thereof, that is intentionally submitted to Licensor for
inclusion in the Work by the copyright owner or by an individual or Legal
Entity authorized to submit on behalf of the copyright owner. For the purposes
of this definition, "submitted" means any form of electronic, verbal,
or written communication sent to the Licensor or its representatives, including
but not limited to communication on electronic mailing lists, source code
control systems, and issue tracking systems that are managed by, or on behalf
of, the Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise designated in
writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal
Entity on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License.
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and
such Derivative Works in Source or Object form.

3.
Grant of Patent License. Subject to the terms and
conditions of this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as
stated in this section) patent license to make, have made, use, offer to sell,
sell, import, and otherwise transfer the Work, where such license applies only
to those patent claims licensable by such Contributor that are necessarily
infringed by their Contribution(s) alone or by combination of their
Contribution(s) with the Work to which such Contribution(s) was submitted. If
You institute patent litigation against any entity (including a cross-claim or
counterclaim in a lawsuit) alleging that the Work or a Contribution
incorporated within the Work constitutes direct or contributory patent
infringement, then any patent licenses granted to You under this License for
that Work shall terminate as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute
copies of the Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You meet the
following conditions:

<![if !supportLists]>1.
<![endif]>You
must give any other recipients of the Work or Derivative Works a copy of this
License; and

<![if !supportLists]>2.
<![endif]>You
must cause any modified files to carry prominent notices stating that You
changed the files; and

<![if !supportLists]>3.
<![endif]>You
must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and

<![if !supportLists]>4.      <![endif]>If the Work includes a
"NOTICE" text file as part of its distribution, then any Derivative
Works that You distribute must include a readable copy of the attribution
notices contained within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one of the following
places: within a NOTICE text file distributed as part of the Derivative Works;
within the Source form or documentation, if provided along with the Derivative
Works; or, within a display generated by the Derivative Works, if and wherever
such third-party notices normally appear. The contents of the NOTICE
file are for informational purposes only and do not modify the License. You may
add Your own attribution notices within Derivative Works that You distribute,
alongside or as an addendum to the NOTICE text from the Work, provided that
such additional attribution notices cannot be construed as modifying the
License. You may add Your own copyright statement to Your modifications and may
provide additional or different license terms and conditions for use,
reproduction, or distribution of Your modifications, or for any such Derivative
Works as a whole, provided Your use, reproduction, and distribution of the Work
otherwise complies with the conditions stated in this License.

5. Submission of Contributions.
Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and conditions
of this License, without any additional terms or conditions. Notwithstanding
the above, nothing herein shall supersede or modify the terms of any separate
license agreement you may have executed with Licensor regarding such
Contributions.

6. Trademarks. This License does not
grant permission to use the trade names, trademarks, service marks, or product
names of the Licensor, except as required for reasonable and customary use in
describing the origin of the Work and reproducing the content of the NOTICE
file.

7. Disclaimer of Warranty. Unless
required by applicable law or agreed to in writing, Licensor provides the Work
(and each Contributor provides its Contributions) on an "AS IS"
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.

8. Limitation of Liability. In no
event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License
or out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction,
or any and all other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability.
While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
other liability obligations and/or rights consistent with this License.
However, in accepting such obligations, You may act only on Your own behalf and
on Your sole responsibility, not on behalf of any other Contributor, and only
if You agree to indemnify, defend, and hold each Contributor harmless for any
liability incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

    Copyright © Jive Software, 2006-2011


text:
var chai = require('chai')
var expect = chai.expect
var AST = require('../src/ast.js')
var parse = require('../src/parse.js')

describe('Parse', () => {
   it('parse empty source', () => {
      expect(parse.program('')).to.deep.equal({
         'status' : true,
         'value' : new AST.Block([])
      })
   })

   it('parse identifier', () => {
      expect(parse.program('xyz')).to.deep.equal({
         'status' : true,
         'value' : new AST.Block([new AST.Variable('xyz')])
      })
   })

   it('parse application', () => {
      expect(parse.program('f(x)')).to.deep.equal({
         "status": true,
         "value": new AST.Block([
            new AST.Application(
               new AST.Variable('f'),
               new AST.LiteralTuple([new AST.Variable('x')]
            ))])
      })
   })

   it('parse simple assignment', () => {
      expect(parse.program('let x = 3')).to.deep.equal({
         'status' : true,
         'value' : new AST.Block([new AST.Declaration(new AST.Variable('x'), new AST.LiteralInt(3))])
      })
   })

   it('parse simple assignment, and expression', () => {
      expect(parse.program('let x = 3\nx')).to.deep.equal({
         'status' : true,
         'value' : new AST.Block([
            new AST.Declaration(new AST.Variable('x'), new AST.LiteralInt(3)),
            new AST.Variable('x')
         ])
      })
   })

   it('parse anonymous function definition', () => {
      expect(parse.program('(x) => x')).to.deep.equal({
         'status' : true,
         'value' : new AST.Block([new AST.Fn('', [new AST.Variable('x')], new AST.Return(new AST.Variable('x')))])
      })
   })

   it('parse assignment of function definition', () => {
      expect(parse.program('let id = id(x) => x')).to.deep.equal({
         'status' : true,
         'value' : new AST.Block([
            new AST.Declaration(new AST.Variable('id'), new AST.Fn('id',
               [new AST.Variable('x')], new AST.Return(new AST.Variable('x'))))
         ])
      })
   })

   it('parse assignment of function definition, and application', () => {
      expect(parse.program('let id = id(x) => x\nid(42)')).to.deep.equal({
         'status' : true,
         'value' : new AST.Block([
            new AST.Declaration(new AST.Variable('id'),
               new AST.Fn('id', [new AST.Variable('x')], new AST.Return(new AST.Variable('x')))),
            new AST.Application(new AST.Variable('id'), new AST.LiteralTuple([new AST.LiteralInt(42)]))
         ])
      })
   })

   it('parse function definiton block indent', () => {
      expect(parse.program('let f = (x) =>\n g(x)\n g(x)')).to.deep.equal({
         'status' : true,
         'value' : new AST.Block([
            new AST.Declaration(new AST.Variable('f'), new AST.Fn('', [new AST.Variable('x')], new AST.Block([
               new AST.Application(new AST.Variable('g'), new AST.LiteralTuple([new AST.Variable('x')])),
               new AST.Application(new AST.Variable('g'), new AST.LiteralTuple([new AST.Variable('x')]))
            ])))
         ])
      })
   })
})