text:
package android.bluetooth;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.media.MediaMetadata;
import android.media.session.PlaybackState;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;

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

/**
 * This class provides the public APIs to control the Bluetooth AVRCP Controller. It currently
 * supports player information, playback support and track metadata.
 *
 *
BluetoothAvrcpController is a proxy object for controlling the Bluetooth AVRCP
 * Service via IPC. Use {@link BluetoothAdapter#getProfileProxy} to get
 * the BluetoothAvrcpController proxy object.
 *
 * {@hide}
 */
public final class BluetoothAvrcpController implements BluetoothProfile {
    private static final String TAG = "BluetoothAvrcpController";
    private static final boolean DBG = false;
    private static final boolean VDBG = false;

    /**
     * Intent used to broadcast the change in connection state of the AVRCP Controller
     * profile.
     *
     *
This intent will have 3 extras:
     *

     *
 {@link #EXTRA_STATE} - The current state of the profile.

     *
 {@link #EXTRA_PREVIOUS_STATE}- The previous state of the profile.

     *
 {@link BluetoothDevice#EXTRA_DEVICE} - The remote device.

     *

     *
     *
{@link #EXTRA_STATE} or {@link #EXTRA_PREVIOUS_STATE} can be any of
     * {@link #STATE_DISCONNECTED}, {@link #STATE_CONNECTING},
     * {@link #STATE_CONNECTED}, {@link #STATE_DISCONNECTING}.
     *
     *
Requires {@link android.Manifest.permission#BLUETOOTH} permission to
     * receive.
     */
    public static final String ACTION_CONNECTION_STATE_CHANGED =
        "android.bluetooth.avrcp-controller.profile.action.CONNECTION_STATE_CHANGED";

    /**
     * Intent used to broadcast the change in metadata state of playing track on the AVRCP
     * AG.
     *
     *
This intent will have the two extras:
     *

     *
 {@link #EXTRA_METADATA} - {@link MediaMetadata} containing the current metadata.

     *
 {@link #EXTRA_PLAYBACK} - {@link PlaybackState} containing the current playback
     *    state.

     *

     */
    public static final String ACTION_TRACK_EVENT =
        "android.bluetooth.avrcp-controller.profile.action.TRACK_EVENT";

    /**
     * Intent used to broadcast the change in player application setting state on AVRCP AG.
     *
     *
This intent will have the following extras:
     *

     *
 {@link #EXTRA_PLAYER_SETTING} - {@link BluetoothAvrcpPlayerSettings} containing the
     *    most recent player setting.

     *

     */
    public static final String ACTION_PLAYER_SETTING =
        "android.bluetooth.avrcp-controller.profile.action.PLAYER_SETTING";

    public static final String EXTRA_METADATA =
            "android.bluetooth.avrcp-controller.profile.extra.METADATA";

    public static final String EXTRA_PLAYBACK =
            "android.bluetooth.avrcp-controller.profile.extra.PLAYBACK";

    public static final String EXTRA_PLAYER_SETTING =
            "android.bluetooth.avrcp-controller.profile.extra.PLAYER_SETTING";

    /*
     * KeyCoded for Pass Through Commands
     */
    public static final int PASS_THRU_CMD_ID_PLAY = 0x44;
    public static final int PASS_THRU_CMD_ID_PAUSE = 0x46;
    public static final int PASS_THRU_CMD_ID_VOL_UP = 0x41;
    public static final int PASS_THRU_CMD_ID_VOL_DOWN = 0x42;
    public static final int PASS_THRU_CMD_ID_STOP = 0x45;
    public static final int PASS_THRU_CMD_ID_FF = 0x49;
    public static final int PASS_THRU_CMD_ID_REWIND = 0x48;
    public static final int PASS_THRU_CMD_ID_FORWARD = 0x4B;
    public static final int PASS_THRU_CMD_ID_BACKWARD = 0x4C;
    /* Key State Variables */
    public static final int KEY_STATE_PRESSED = 0;
    public static final int KEY_STATE_RELEASED = 1;
    /* Group Navigation Key Codes */
    public static final int PASS_THRU_CMD_ID_NEXT_GRP = 0x00;
    public static final int PASS_THRU_CMD_ID_PREV_GRP = 0x01;

    private Context mContext;
    private ServiceListener mServiceListener;
    private IBluetoothAvrcpController mService;
    private BluetoothAdapter mAdapter;

    final private IBluetoothStateChangeCallback mBluetoothStateChangeCallback =
        new IBluetoothStateChangeCallback.Stub() {
            public void onBluetoothStateChange(boolean up) {
                if (DBG) Log.d(TAG, "onBluetoothStateChange: up=" + up);
                if (!up) {
                    if (VDBG) Log.d(TAG,"Unbinding service...");
                    synchronized (mConnection) {
                        try {
                            mService = null;
                            mContext.unbindService(mConnection);
                        } catch (Exception re) {
                            Log.e(TAG,"",re);
                        }
                    }
                } else {
                    synchronized (mConnection) {
                        try {
                            if (mService == null) {
                                if (VDBG) Log.d(TAG,"Binding service...");
                                doBind();
                            }
                        } catch (Exception re) {
                            Log.e(TAG,"",re);
                        }
                    }
                }
            }
      };

    /**
     * Create a BluetoothAvrcpController proxy object for interacting with the local
     * Bluetooth AVRCP service.
     *
     */
    /*package*/ BluetoothAvrcpController(Context context, ServiceListener l) {
        mContext = context;
        mServiceListener = l;
        mAdapter = BluetoothAdapter.getDefaultAdapter();
        IBluetoothManager mgr = mAdapter.getBluetoothManager();
        if (mgr != null) {
            try {
                mgr.registerStateChangeCallback(mBluetoothStateChangeCallback);
            } catch (RemoteException e) {
                Log.e(TAG,"",e);
            }
        }

        doBind();
    }

    boolean doBind() {
        Intent intent = new Intent(IBluetoothAvrcpController.class.getName());
        ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0);
        intent.setComponent(comp);
        if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0,
                android.os.Process.myUserHandle())) {
            Log.e(TAG, "Could not bind to Bluetooth AVRCP Controller Service with " + intent);
            return false;
        }
        return true;
    }

    /*package*/ void close() {
        mServiceListener = null;
        IBluetoothManager mgr = mAdapter.getBluetoothManager();
        if (mgr != null) {
            try {
                mgr.unregisterStateChangeCallback(mBluetoothStateChangeCallback);
            } catch (Exception e) {
                Log.e(TAG,"",e);
            }
        }

        synchronized (mConnection) {
            if (mService != null) {
                try {
                    mService = null;
                    mContext.unbindService(mConnection);
                } catch (Exception re) {
                    Log.e(TAG,"",re);
                }
            }
        }
    }

    public void finalize() {
        close();
    }

    /**
     * {@inheritDoc}
     */
    public List<BluetoothDevice> getConnectedDevices() {
        if (VDBG) log("getConnectedDevices()");
        if (mService != null && isEnabled()) {
            try {
                return mService.getConnectedDevices();
            } catch (RemoteException e) {
                Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
                return new ArrayList<BluetoothDevice>();
            }
        }
        if (mService == null) Log.w(TAG, "Proxy not attached to service");
        return new ArrayList<BluetoothDevice>();
    }

    /**
     * {@inheritDoc}
     */
    public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) {
        if (VDBG) log("getDevicesMatchingStates()");
        if (mService != null && isEnabled()) {
            try {
                return mService.getDevicesMatchingConnectionStates(states);
            } catch (RemoteException e) {
                Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
                return new ArrayList<BluetoothDevice>();
            }
        }
        if (mService == null) Log.w(TAG, "Proxy not attached to service");
        return new ArrayList<BluetoothDevice>();
    }

    /**
     * {@inheritDoc}
     */
    public int getConnectionState(BluetoothDevice device) {
        if (VDBG) log("getState(" + device + ")");
        if (mService != null && isEnabled()
            && isValidDevice(device)) {
            try {
                return mService.getConnectionState(device);
            } catch (RemoteException e) {
                Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
                return BluetoothProfile.STATE_DISCONNECTED;
            }
        }
        if (mService == null) Log.w(TAG, "Proxy not attached to service");
        return BluetoothProfile.STATE_DISCONNECTED;
    }

    public void sendPassThroughCmd(BluetoothDevice device, int keyCode, int keyState) {
        if (DBG) Log.d(TAG, "sendPassThroughCmd");
        if (mService != null && isEnabled()) {
            try {
                mService.sendPassThroughCmd(device, keyCode, keyState);
                return;
            } catch (RemoteException e) {
                Log.e(TAG, "Error talking to BT service in sendPassThroughCmd()", e);
                return;
            }
        }
        if (mService == null) Log.w(TAG, "Proxy not attached to service");
    }

    /**
     * Gets the player application settings.
     *
     * @return the {@link BluetoothAvrcpPlayerSettings} or {@link null} if there is an error.
     */
    public BluetoothAvrcpPlayerSettings getPlayerSettings(BluetoothDevice device) {
        if (DBG) Log.d(TAG, "getPlayerSettings");
        BluetoothAvrcpPlayerSettings settings = null;
        if (mService != null && isEnabled()) {
            try {
                settings = mService.getPlayerSettings(device);
            } catch (RemoteException e) {
                Log.e(TAG, "Error talking to BT service in getMetadata() " + e);
                return null;
            }
        }
        return settings;
    }

    /**
     * Gets the metadata for the current track.
     *
     * This should be usually called when application UI needs to be updated, eg. when the track
     * changes or immediately after connecting and getting the current state.
     * @return the {@link MediaMetadata} or {@link null} if there is an error.
     */
    public MediaMetadata getMetadata(BluetoothDevice device) {
        if (DBG) Log.d(TAG, "getMetadata");
        MediaMetadata metadata = null;
        if (mService != null && isEnabled()) {
            try {
                metadata = mService.getMetadata(device);
            } catch (RemoteException e) {
                Log.e(TAG, "Error talking to BT service in getMetadata() " + e);
                return null;
            }
        }
        return metadata;
    }

    /**
     * Gets the playback state for current track.
     *
     * When the application is first connecting it can use current track state to get playback info.
     * For all further updates it should listen to notifications.
     * @return the {@link PlaybackState} or {@link null} if there is an error.
     */
    public PlaybackState getPlaybackState(BluetoothDevice device) {
        if (DBG) Log.d(TAG, "getPlaybackState");
        PlaybackState playbackState = null;
        if (mService != null && isEnabled()) {
            try {
                playbackState = mService.getPlaybackState(device);
            } catch (RemoteException e) {
                Log.e(TAG,
                    "Error talking to BT service in getPlaybackState() " + e);
                return null;
            }
        }
        return playbackState;
    }

    /**
     * Sets the player app setting for current player.
     * returns true in case setting is supported by remote, false otherwise
     */
    public boolean setPlayerApplicationSetting(BluetoothAvrcpPlayerSettings plAppSetting) {
        if (DBG) Log.d(TAG, "setPlayerApplicationSetting");
        if (mService != null && isEnabled()) {
            try {
                return mService.setPlayerApplicationSetting(plAppSetting);
            } catch (RemoteException e) {
                Log.e(TAG, "Error talking to BT service in setPlayerApplicationSetting() " + e);
                return false;
            }
        }
        if (mService == null) Log.w(TAG, "Proxy not attached to service");
        return false;
    }

    /*
     * Send Group Navigation Command to Remote.
     * possible keycode values: next_grp, previous_grp defined above
     */
    public void sendGroupNavigationCmd(BluetoothDevice device, int keyCode, int keyState) {
        Log.d(TAG, "sendGroupNavigationCmd dev = " + device + " key " + keyCode + " State = " + keyState);
        if (mService != null && isEnabled()) {
            try {
                mService.sendGroupNavigationCmd(device, keyCode, keyState);
                return;
            } catch (RemoteException e) {
                Log.e(TAG, "Error talking to BT service in sendGroupNavigationCmd()", e);
                return;
            }
        }
        if (mService == null) Log.w(TAG, "Proxy not attached to service");
    }

    private final ServiceConnection mConnection = new ServiceConnection() {
        public void onServiceConnected(ComponentName className, IBinder service) {
            if (DBG) Log.d(TAG, "Proxy object connected");
            mService = IBluetoothAvrcpController.Stub.asInterface(service);

            if (mServiceListener != null) {
                mServiceListener.onServiceConnected(BluetoothProfile.AVRCP_CONTROLLER,
                        BluetoothAvrcpController.this);
            }
        }
        public void onServiceDisconnected(ComponentName className) {
            if (DBG) Log.d(TAG, "Proxy object disconnected");
            mService = null;
            if (mServiceListener != null) {
                mServiceListener.onServiceDisconnected(BluetoothProfile.AVRCP_CONTROLLER);
            }
        }
    };

    private boolean isEnabled() {
       if (mAdapter.getState() == BluetoothAdapter.STATE_ON) return true;
       return false;
    }

    private boolean isValidDevice(BluetoothDevice device) {
       if (device == null) return false;

       if (BluetoothAdapter.checkBluetoothAddress(device.getAddress())) return true;
       return false;
    }

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


text:
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<canvas id="myCanvas" style="position:absolute;left:0px;top:96px;">Your browser does not support the HTML5 canvas tag.</canvas>

<form action="importTest.html" method="get">
<select name="model" id="modelSelector">
	<option value="adcade.obj">Adcade</option>
	<option value="car.obj">Car</option>
	<option value="ico.obj">Icosahedron</option>
	<option value="arwing.obj">Starfox</option>
	<option value="dog.obj">Dog</option>
	<option value="texTest.obj">Texture Test</option>
	<option value="monkey.obj">Monkey (many triangles)</option>
	<option value="intersection.obj">Intersection artifact example</option>
	<option value="goal.obj">Goooooalllllll</option>
</select>
<input type="submit" value="Load">

Effects: (apply by clicking "Load")

<input id="shimmerBox" type="checkbox" name="shimmer" value="on">Palette Shift

<input id="warpBox" type="checkbox" name="warping" value="on">Wave Distortion
</form>

</meta>

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2013, The Sporting Exchange Limited
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean id="insecureClientNioConfig" class="com.betfair.cougar.netutil.nio.TlsNioConfig">
        <property name="workerTimeout" value="$COUGAR_CLIENT{cougar.client.socket.worker.timeout}"/>
        <property name="maxWriteQueueSize" value="$COUGAR_CLIENT{cougar.client.socket.maxWriteQueueSize}"/>
        <property name="recvBufferSize" value="$COUGAR_CLIENT{cougar.client.socket.receiveBufferSize}"/>
        <property name="sendBufferSize" value="$COUGAR_CLIENT{cougar.client.socket.sendBufferSize}"/>
        <property name="useDirectBuffersInMina" value="$COUGAR_CLIENT{cougar.client.socket.useDirectBuffers}"/>
        <property name="nioLogger" ref="clientNioLogger"/>
        <property name="supportsTls" value="false"/>
        <property name="requiresTls" value="false"/>
        <property name="rpcTimeoutMillis" value="$COUGAR_CLIENT{cougar.client.socket.rpc.timeout}"/>
        <property name="mbeanServer">
            <bean class="org.springframework.jmx.support.MBeanServerFactoryBean">
                <property name="locateExistingServerIfPossible" value="true"/>
            </bean>
        </property>
    </bean>

    <bean id="secureNioConfig" class="com.betfair.cougar.netutil.nio.TlsNioConfig">
        <property name="workerTimeout" value="$COUGAR_CLIENT{cougar.client.socket.worker.timeout}"/>
        <property name="maxWriteQueueSize" value="$COUGAR_CLIENT{cougar.client.socket.maxWriteQueueSize}"/>
        <property name="recvBufferSize" value="$COUGAR_CLIENT{cougar.client.socket.receiveBufferSize}"/>
        <property name="sendBufferSize" value="$COUGAR_CLIENT{cougar.client.socket.sendBufferSize}"/>
        <property name="useDirectBuffersInMina" value="$COUGAR_CLIENT{cougar.client.socket.useDirectBuffers}"/>
        <property name="nioLogger" ref="clientNioLogger"/>
        <property name="supportsTls" value="true"/>
        <property name="requiresTls" value="true"/>
        <property name="truststore" value="classpath:cougar_server_ca.jks"/>
        <property name="truststoreType" value="JKS"/>
        <property name="truststorePassword" value="password"/>
        <property name="rpcTimeoutMillis" value="$COUGAR_CLIENT{cougar.client.socket.rpc.timeout}"/>
        <property name="mbeanServer">
            <bean class="org.springframework.jmx.support.MBeanServerFactoryBean">
                <property name="locateExistingServerIfPossible" value="true"/>
            </bean>
        </property>
    </bean>

    <bean id="secureNioConfigWithClientAuth" class="com.betfair.cougar.netutil.nio.TlsNioConfig">
        <property name="workerTimeout" value="$COUGAR_CLIENT{cougar.client.socket.worker.timeout}"/>
        <property name="maxWriteQueueSize" value="$COUGAR_CLIENT{cougar.client.socket.maxWriteQueueSize}"/>
        <property name="recvBufferSize" value="$COUGAR_CLIENT{cougar.client.socket.receiveBufferSize}"/>
        <property name="sendBufferSize" value="$COUGAR_CLIENT{cougar.client.socket.sendBufferSize}"/>
        <property name="useDirectBuffersInMina" value="$COUGAR_CLIENT{cougar.client.socket.useDirectBuffers}"/>
        <property name="nioLogger" ref="clientNioLogger"/>
        <property name="supportsTls" value="true"/>
        <property name="requiresTls" value="true"/>
        <property name="keystore" value="classpath:cougar_client_cert.jks"/>
        <property name="keystoreType" value="JKS"/>
        <property name="keystorePassword" value="password"/>
        <property name="truststore" value="classpath:cougar_server_ca.jks"/>
        <property name="truststoreType" value="JKS"/>
        <property name="truststorePassword" value="password"/>
        <property name="wantClientAuth" value="true"/>
        <property name="needClientAuth" value="true"/>
        <property name="rpcTimeoutMillis" value="$COUGAR_CLIENT{cougar.client.socket.rpc.timeout}"/>
        <property name="mbeanServer">
            <bean class="org.springframework.jmx.support.MBeanServerFactoryBean">
                <property name="locateExistingServerIfPossible" value="true"/>
            </bean>
        </property>
    </bean>

    <bean id="socketTransport" parent="cougar.client.AbstractSocketTransport">
        <constructor-arg index="1" ref="insecureClientNioConfig"/>
        <constructor-arg index="5" value="127.0.0.1:9003"/>
        <property name="identityResolver" ref="clientIdentityResolver"/>
    </bean>

    <bean id="secureSocketTransport" parent="cougar.client.AbstractSocketTransport">
        <constructor-arg index="1" ref="secureNioConfig"/>
        <constructor-arg index="5" value="127.0.0.1:9003"/>
        <property name="identityResolver" ref="clientIdentityResolver"/>
    </bean>

    <bean id="secureSocketTransportWithClientAuth" parent="cougar.client.AbstractSocketTransport">
        <constructor-arg index="1" ref="secureNioConfigWithClientAuth"/>
        <constructor-arg index="5" value="127.0.0.1:9003"/>
        <property name="identityResolver" ref="clientIdentityResolver"/>
    </bean>

</beans>


text:
CREATE TABLE public."OfferCategory"
(
    id serial,
    name character varying(100) COLLATE pg_catalog."default" NOT NULL,
    description character varying(255) COLLATE pg_catalog."default",
    parent_offercategory_id bigint NOT NULL,
    CONSTRAINT "OfferCategory_pkey" PRIMARY KEY (id),
    CONSTRAINT offercategory_name_parentoffercategory_id_key UNIQUE (name, parent_offercategory_id),
    CONSTRAINT offercategory_offercategory_fkey FOREIGN KEY (parent_offercategory_id)
        REFERENCES public."OfferCategory" (id) MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION
)
WITH (
    OIDS = FALSE
)
TABLESPACE pg_default;

ALTER TABLE public."OfferCategory"
    OWNER to postgres;
COMMENT ON TABLE public."OfferCategory"
    IS 'Categories of service offerings';


text:
package io.github.factoryfx.docu.configurationdata;

import io.github.factoryfx.factory.storage.DataUpdate;
import io.github.factoryfx.jetty.builder.JettyFactoryTreeBuilder;
import io.github.factoryfx.jetty.builder.JettyServerRootFactory;
import io.github.factoryfx.microservice.rest.client.MicroserviceRestClient;
import io.github.factoryfx.microservice.rest.client.MicroserviceRestClientBuilder;
import io.github.factoryfx.server.Microservice;
import org.eclipse.jetty.server.Server;

import java.nio.file.Paths;

public class Main {

    public static void main(String[] args) {
        JettyFactoryTreeBuilder builder = new JettyFactoryTreeBuilder((jetty, ctx)->jetty
                    .withHost("localhost").withPort(8005)
                    .withResource(ctx.get(SpecificMicroserviceResource.class))
                    .withResource(ctx.get(DatabaseResourceFactory.class))
                );

        builder.addSingleton(SpecificMicroserviceResource.class);

        builder.addSingleton(DatabaseResourceFactory.class, ctx->{
            DatabaseResourceFactory databaseResource = new DatabaseResourceFactory();
            databaseResource.url.set("jdbc:postgresql://host/database");
            databaseResource.user.set("user");
            databaseResource.password.set("123");
            return databaseResource;
        });

        Microservice<Server, JettyServerRootFactory> microservice = builder.microservice().withFilesystemStorage(Paths.get("./docu/src/main/java/io/github/factoryfx/docu/configurationdata/")).build();
        microservice.start();

        {
            DataUpdate<JettyServerRootFactory> update = microservice.prepareNewFactory();
            update.root.getResource(DatabaseResourceFactory.class).url.set("jdbc:postgresql://host/databasenew");
            microservice.updateCurrentFactory(update);
        }

        {
            MicroserviceRestClient<JettyServerRootFactory> microserviceRestClient = MicroserviceRestClientBuilder.build("localhost", 8005, "", "", JettyServerRootFactory.class);
            DataUpdate<JettyServerRootFactory> update = microserviceRestClient.prepareNewFactory();
            update.root.getResource(DatabaseResourceFactory.class).url.set("jdbc:postgresql://host/databasenew");
            microservice.updateCurrentFactory(update);
        }

    }

}


text:
external help file: Microsoft.Azure.Commands.OperationalInsights.dll-Help.xml
ms.assetid: EF3FE3F1-1C8F-41EB-990E-F2B30BD9D082
online version:
schema: 2.0.0
---

# Disable-AzureRmOperationalInsightsLinuxCustomLogCollection

## SYNOPSIS
Stops collection of custom logs from Linux computers.

## SYNTAX

### ByWorkspaceName (Default)
```
Disable-AzureRmOperationalInsightsLinuxCustomLogCollection [-ResourceGroupName] <String>
 [-WorkspaceName] <String> [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-WhatIf]
 [-Confirm] [<CommonParameters>]
```

### ByWorkspaceObject
```
Disable-AzureRmOperationalInsightsLinuxCustomLogCollection [-Workspace] <PSWorkspace>
 [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-WhatIf] [-Confirm]
 [<CommonParameters>]
```

## DESCRIPTION
The **Disable-AzureRmOperationalInsightsLinuxCustomLogCollection** cmdlet stops collection of custom logs from connected Linux computers in a workspace.

## EXAMPLES

### 1:
```

```

## PARAMETERS

### -ResourceGroupName
Specifies the name of a resource group that contains Linux computers.

```yaml
Type: String
Parameter Sets: ByWorkspaceName
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -WorkspaceName
Specifies the name of a workspace in which this cmdlet operates.

```yaml
Type: String
Parameter Sets: ByWorkspaceName
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -InformationAction
Specifies how this cmdlet responds to an information event.

The acceptable values for this parameter are:

- Continue
- Ignore
- Inquire
- SilentlyContinue
- Stop
- Suspend

```yaml
Type: ActionPreference
Parameter Sets: (All)
Aliases: infa

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -InformationVariable
Specifies an information variable.

```yaml
Type: String
Parameter Sets: (All)
Aliases: iv

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### -Confirm
Prompts you for confirmation before running the cmdlet.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### -Workspace
Specifies a workspace in which this cmdlet operates.

```yaml
Type: PSWorkspace
Parameter Sets: ByWorkspaceObject
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

## NOTES
* Keywords: azure, azurerm, arm, resource, management, manager, operational, insights

## RELATED LINKS

[Enable-AzureRmOperationalInsightsLinuxCustomLogCollection](./Enable-AzureRmOperationalInsightsLinuxCustomLogCollection.md)


text:
#include <grpc/support/alloc.h>

#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <stdlib.h>
#include <string.h>
#include "src/core/lib/profiling/timers.h"

static void* zalloc_with_calloc(size_t sz) { return calloc(sz, 1); }

static void* zalloc_with_gpr_malloc(size_t sz) {
  void* p = gpr_malloc(sz);
  memset(p, 0, sz);
  return p;
}

static gpr_allocation_functions g_alloc_functions = {malloc, zalloc_with_calloc,
                                                     realloc, free};

gpr_allocation_functions gpr_get_allocation_functions() {
  return g_alloc_functions;
}

void gpr_set_allocation_functions(gpr_allocation_functions functions) {
  GPR_ASSERT(functions.malloc_fn != nullptr);
  GPR_ASSERT(functions.realloc_fn != nullptr);
  GPR_ASSERT(functions.free_fn != nullptr);
  if (functions.zalloc_fn == nullptr) {
    functions.zalloc_fn = zalloc_with_gpr_malloc;
  }
  g_alloc_functions = functions;
}

void* gpr_malloc(size_t size) {
  void* p;
  if (size == 0) return nullptr;
  GPR_TIMER_BEGIN("gpr_malloc", 0);
  p = g_alloc_functions.malloc_fn(size);
  if (!p) {
    abort();
  }
  GPR_TIMER_END("gpr_malloc", 0);
  return p;
}

void* gpr_zalloc(size_t size) {
  void* p;
  if (size == 0) return nullptr;
  GPR_TIMER_BEGIN("gpr_zalloc", 0);
  p = g_alloc_functions.zalloc_fn(size);
  if (!p) {
    abort();
  }
  GPR_TIMER_END("gpr_zalloc", 0);
  return p;
}

void gpr_free(void* p) {
  GPR_TIMER_BEGIN("gpr_free", 0);
  g_alloc_functions.free_fn(p);
  GPR_TIMER_END("gpr_free", 0);
}

void* gpr_realloc(void* p, size_t size) {
  if ((size == 0) && (p == nullptr)) return nullptr;
  GPR_TIMER_BEGIN("gpr_realloc", 0);
  p = g_alloc_functions.realloc_fn(p, size);
  if (!p) {
    abort();
  }
  GPR_TIMER_END("gpr_realloc", 0);
  return p;
}

void* gpr_malloc_aligned(size_t size, size_t alignment_log) {
  size_t alignment = ((size_t)1) << alignment_log;
  size_t extra = alignment - 1 + sizeof(void*);
  void* p = gpr_malloc(size + extra);
  void** ret = (void**)(((uintptr_t)p + extra) & ~(alignment - 1));
  ret[-1] = p;
  return (void*)ret;
}

void gpr_free_aligned(void* ptr) { gpr_free(((void**)ptr)[-1]); }


text:
package main

import (
	"fmt"
	"math/rand"
	"net/http"
	"time"

	tally "github.com/uber-go/tally/v4"
	promreporter "github.com/uber-go/tally/v4/prometheus"
)

func main() {
	r := promreporter.NewReporter(promreporter.Options{})

	// Note: `promreporter.DefaultSeparator` is "_".
	// Prometheus doesnt like metrics with "." or "-" in them.
	scope, closer := tally.NewRootScope(tally.ScopeOptions{
		Prefix:         "my_service",
		Tags:           map[string]string{},
		CachedReporter: r,
		Separator:      promreporter.DefaultSeparator,
	}, 1*time.Second)
	defer closer.Close()

	counter := scope.Tagged(map[string]string{
		"foo": "bar",
	}).Counter("test_counter")

	gauge := scope.Tagged(map[string]string{
		"foo": "baz",
	}).Gauge("test_gauge")

	timer := scope.Tagged(map[string]string{
		"foo": "qux",
	}).Timer("test_timer_summary")

	histogram := scope.Tagged(map[string]string{
		"foo": "quk",
	}).Histogram("test_histogram", tally.DefaultBuckets)

	go func() {
		for {
			counter.Inc(1)
			time.Sleep(time.Second)
		}
	}()

	go func() {
		for {
			gauge.Update(rand.Float64() * 1000)
			time.Sleep(time.Second)
		}
	}()

	go func() {
		for {
			tsw := timer.Start()
			hsw := histogram.Start()
			time.Sleep(time.Duration(rand.Float64() * float64(time.Second)))
			tsw.Stop()
			hsw.Stop()
		}
	}()

	http.Handle("/metrics", r.HTTPHandler())
	fmt.Printf("Serving :8080/metrics\n")
	fmt.Printf("%v\n", http.ListenAndServe(":8080", nil))
	select {}
}


text:
"""
Settings and utilities for the entire Django project.
"""


text:
package com.intellij.java.codeInsight.completion;

import com.intellij.JavaTestUtil;
import com.intellij.codeInsight.completion.CompletionType;
import com.intellij.codeInsight.completion.LightFixtureCompletionTestCase;
import com.intellij.codeInsight.lookup.Lookup;
import com.intellij.testFramework.LightProjectDescriptor;
import org.jetbrains.annotations.NotNull;

public class SmartType18CompletionTest extends LightFixtureCompletionTestCase {
  @Override
  protected String getBasePath() {
    return JavaTestUtil.getRelativeJavaTestDataPath() + "/codeInsight/completion/smartType/";
  }

  @Override
  protected void complete() {
    myItems = myFixture.complete(CompletionType.SMART);
  }

  @NotNull
  @Override
  protected LightProjectDescriptor getProjectDescriptor() {
    return JAVA_8;
  }

  public void testExpectedReturnType() {
    doTest();
  }

  public void testExpectedReturnTypeWithSubstitution() {
    doTest();
  }

  public void testExpectedReturnType1() {
    doTest();
  }

  public void testSemicolonInExpressionBodyInLocalVariable() {
    doTest();
  }

  public void testSemicolonInCodeBlocBodyInLocalVariable() {
    doTest();
  }

  public void testSemicolonInExpressionBodyInExpressionList() {
    doTest();
  }

  public void testIgnoreDefaultMethods() {
    doTest();
  }

  public void testInLambdaPosition() {
    doTest();
  }

  public void testInLambdaPositionSingleParam() {
    doTest();
  }

  public void testInLambdaPositionNameSubstitution() {
    doTest();
  }
  public void testInLambdaPositionSameNames() {
    doTest();
  }

  public void testConstructorRef() {
    doTest(false);
  }

  public void testInnerArrayConstructorRef() { doTest(true); }

  public void testNoConstraintsWildcard() {
    doTest();
  }

  public void testDiamondCollapsedInsideAnonymous() {
    doTest();
  }

  public void testDiamondCollapsedInFieldInitializerInsideAnonymous() {
    doTest();
  }

  public void testInheritorConstructorRef() {
    myFixture.addClass("package intf; public interface Intf<T> {}");
    myFixture.addClass("package foo; public class ImplBar implements intf.Intf<String> {}");
    myFixture.addClass("package foo; public class ImplFoo<T> implements intf.Intf<T> {}");
    myFixture.addClass("package foo; public class ImplIncompatible implements intf.Intf<Integer> {}");
    myFixture.addClass("package foo; public abstract class ImplAbstract implements intf.Intf<String> { public ImplAbstract() {} }");
    myFixture.addClass("package foo; class ImplInaccessible implements intf.Intf<String> {}");

    configureByTestName();
    myFixture.assertPreferredCompletionItems(0, "ImplBar::new", "ImplFoo::new", "() -> ");
    myFixture.type('\n');
    checkResultByFile("/" + getTestName(false) + "-out.java");
  }

  public void testFilteredMethodReference() {
    doTest(false);
  }

  public void testFilteredStaticMethods() {
    doTest(false);
  }

  public void testFilterWrongParamsMethods() {
    doTest(false);
  }

  public void testNoQualifier() {
    doTest();
  }

  public void testFilterAmbiguity() {
    configureByFile("/" + getTestName(false) + ".java");
    assertNotNull(myItems);
    assertTrue(myItems.length == 0);
  }

  public void testNotAvailableInLambdaPositionAfterQualifier() {
    configureByFile("/" + getTestName(false) + ".java");
    assertNotNull(myItems);
    assertTrue(myItems.length == 0);
  }

  public void testInferFromRawType() {
    configureByFile("/" + getTestName(false) + ".java");
    assertNotNull(myItems);
    assertTrue(myItems.length == 0);
  }

  public void testDiamondsInsideMethodCall() {
    doTest(false);
  }

  public void testSimpleMethodReference() {
    doTest(true);
  }

  public void testStaticMethodReference() { doTest(); }
  public void testStaticMethodReferenceInContextWithTypeArgs() {
    doTest();
  }

  public void testOuterMethodReference() { doTest(true); }
  public void testNoAnonymousOuterMethodReference() { doAntiTest(); }

  public void testMethodReferenceOnAncestor() { doTest(true); }

  public void testNoLambdaSuggestionForGenericsFunctionalInterfaceMethod() {
    configureByFile("/" + getTestName(false) + ".java");
    assertEmpty(myItems);
  }

public void testConvertToObjectStream() {
    configureByTestName();
    myFixture.complete(CompletionType.SMART, 2);
  myFixture.type('\n');
    checkResultByFile("/" + getTestName(false) + "-out.java");
  }

  public void testConvertToDoubleStream() {
    configureByTestName();
    myFixture.complete(CompletionType.SMART, 2);
    myFixture.type('\n');
    checkResultByFile("/" + getTestName(false) + "-out.java");
  }

  public void testInferFromReturnTypeWhenCompleteInsideArgList() {
    configureByTestName();
    myFixture.complete(CompletionType.SMART, 1);
    myFixture.type('\n');
    checkResultByFile("/" + getTestName(false) + "-out.java");
  }

  public void testInferThrowableBoundInCompletion() {
    configureByTestName();
    myFixture.complete(CompletionType.SMART, 1);
    checkResultByFile("/" + getTestName(false) + "-out.java");
  }

  public void testInsideNewExpressionWithDiamondAndOverloadConstructors() {
    configureByTestName();
    myFixture.complete(CompletionType.SMART, 1);
    myFixture.type('\n');
    checkResultByFile("/" + getTestName(false) + "-out.java");
  }

  public void testCollectorsToList() {
    doTest(false);
  }

  public void testCollectionsEmptyMap() { doTest(true); }

  private void doTest() {
    doTest(true);
  }

  private void doTest(boolean insertSelectedItem) {
    configureByFile("/" + getTestName(false) + ".java");
    if (insertSelectedItem) {
      assertNotNull(myItems);
      assertTrue(myItems.length > 0);
      final Lookup lookup = getLookup();
      if (lookup != null) {
        selectItem(lookup.getCurrentItem(), Lookup.NORMAL_SELECT_CHAR);
      }
    }
    checkResultByFile("/" + getTestName(false) + "-out.java");
  }

  public void testOnlyCompatibleTypes() {
    configureByTestName();
    assertOrderedEquals(myFixture.getLookupElementStrings(), "get2");
  }

  public void testInferredObjects() {
    configureByTestName();
    assertOrderedEquals(myFixture.getLookupElementStrings(), "M", "HM");
  }

  public void testSuggestMapInheritors() { doTest(); }

  public void testUnboundTypeArgs() { doTest(); }

  public void testCallBeforeLambda() { doTest(false); }

  public void testMapGetOrDefault() {
    configureByTestName();
    myFixture.assertPreferredCompletionItems(0, "TimeUnit.DAYS");
  }

  public void testFreeGenericsAfterClassLiteral() {
    configureByTestName();
    myFixture.assertPreferredCompletionItems(0, "String.class", "tryCast");
  }

  public void testNewHashMapTypeArguments() { doTest(false); }
  public void testNewMapTypeArguments() { doTest(false); }

}


text:
module ConceptQL
  module Vocabularies
    module Behaviors
      module Sourcish
        def unionable?(other)
          other.is_a?(self.class)
        end

        def union(other)
          dup_values(values + other.values)
        end
      end
    end
  end
end


text:
{@link javax.xml.xpath} wrapper package for JAXEN.

Infos on how to configure the {@link XPathFactory}
are here

An option is to use a system property, something like:

-Djavax.xml.xpath.XPathFactory:http://www.jaxen.org=org.eleusoft.jaxen.jaxp.JaxenXPathFactory


text:
package org.apache.spark.sql.catalyst.expressions.aggregate

import org.apache.spark.sql.catalyst.dsl.expressions._
import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.types._

case class Count(children: Seq[Expression]) extends DeclarativeAggregate {

  override def nullable: Boolean = false

  // Return data type.
  override def dataType: DataType = LongType

  // Expected input data type.
  override def inputTypes: Seq[AbstractDataType] = Seq.fill(children.size)(AnyDataType)

  private lazy val count = AttributeReference("count", LongType)()

  override lazy val aggBufferAttributes = count :: Nil

  override lazy val initialValues = Seq(
    /* count = */ Literal(0L)
  )

  override lazy val updateExpressions = Seq(
    /* count = */ If(children.map(IsNull).reduce(Or), count, count + 1L)
  )

  override lazy val mergeExpressions = Seq(
    /* count = */ count.left + count.right
  )

  override lazy val evaluateExpression = Cast(count, LongType)

  override def defaultResult: Option[Literal] = Option(Literal(0L))
}

object Count {
  def apply(child: Expression): Count = Count(child :: Nil)
}


text:
package com.intel.analytics.bigdl.tensor

import com.intel.analytics.bigdl.mkl.MKL
import com.intel.analytics.bigdl.tensor.TensorNumericMath._
import com.intel.analytics.bigdl.tensor.{DenseTensorApply => Apply}

import scala.reflect.ClassTag

object DenseTensorMath {
  val taskSize: Int = System.getProperty("cpu.task.size", "250000").toInt

  def mul[@specialized(Float, Double) T](self: DenseTensor[T], x: Tensor[T], value: T)
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    if (x != null) {
      require(self.nElement() == x.nElement())
      self.copy(x)
    }

    if (self.isContiguous()) {
      ev.scal(self.nElement, value, self.storage().array(), self.storageOffset() - 1, 1)
    } else {
      val func = new TensorFunc2[T] {
        override def apply(data: Array[T], index: Int): Unit = {
          data(index) = ev.times(data(index), value)
        }
      }
      Apply.apply1[T](self, func)
    }
    self
  }

  def cmul[@specialized T](self: DenseTensor[T], x: DenseTensor[T], y: DenseTensor[T])
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    if (x.nElement() != y.nElement() && DenseTensor.canFastBroadcast(x, y)) {
      require(self.nElement() == x.nElement(), "the self tensor nElement is not same as x" +
        s"self(${self.nElement()}) x(${x.nElement()})")
      // recursive cmul
      var i = 0
      while(i < x.size(1)) {
        cmul(self.select(1, i + 1).asInstanceOf[DenseTensor[T]],
          x.select(1, i + 1).asInstanceOf[DenseTensor[T]], y)
        i += 1
      }
    } else if (x.nElement() != y.nElement() && DenseTensor.canFastBroadcast(y, x)) {
      require(self.nElement() == y.nElement(), "the self tensor nElement is not same as y" +
        s"self(${self.nElement()}) y(${y.nElement()})")
      // recursive cmul
      var i = 0
      while(i < y.size(1)) {
        cmul(self.select(1, i + 1).asInstanceOf[DenseTensor[T]], x,
          y.select(1, i + 1).asInstanceOf[DenseTensor[T]])
        i += 1
      }
    } else if (x.nElement() != y.nElement()) {
      self.resizeAs(x).copy(x)
      self.cmul(self.expandTensor(y))
    } else {
      require(self.nElement() == y.nElement(), s"element number doesn't match " +
        s"self(${self.nElement()}) y(${y.nElement()}) x(${x.nElement()})")
      if (self.isContiguous() && x.isContiguous() && y.isContiguous() && MKL.isMKLLoaded) {

        ev.vMul(self.nElement(), x.storage().array(), x.storageOffset() - 1,
          y.storage().array(), y.storageOffset() - 1, self.storage().array(), self.storageOffset()
            - 1)
      } else {
        val func6 = new TensorFunc6[T] {
          override def apply(data1: Array[T], offset1: Int, data2: Array[T], offset2: Int,
            data3: Array[T], offset3: Int): Unit = {
            data1(offset1) = ev.times(data2(offset2), data3(offset3))
          }
        }
        val func4 = new TensorFunc4[T] {
          override def apply(data1: Array[T], offset1: Int, data2: Array[T], offset2: Int): Unit = {
            data1(offset1) = ev.times(data1(offset1), data2(offset2))
          }
        }
        // For special case, we can use apply2 to instead of apply3
        if (self == y) {
          Apply.apply2(self, x, func4)
        } else if (self == x) {
          Apply.apply2(self, y, func4)
        } else {
          Apply.apply3[T](self, x, y, func6)
        }
      }
    }
    self
  }

  def cdiv[@specialized(Float, Double) T](self: DenseTensor[T], x: Tensor[T], y: Tensor[T])
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    require(self.nElement() == y.nElement() && self.nElement() == x.nElement(),
      "element number doesn't match")
    if (self.isContiguous() && y.isContiguous() && x.isContiguous() && MKL.isMKLLoaded) {

      ev.vDiv(self.nElement(), x.storage().array(), x.storageOffset() - 1,
        y.storage().array(), y.storageOffset() - 1, self.storage().array(), self.storageOffset()
          - 1)
    } else {
      val func = new TensorFunc6[T] {
        override def apply(data1: Array[T], offset1: Int, data2: Array[T], offset2: Int,
                          data3: Array[T], offset3: Int): Unit = {
          data1(offset1) = ev.divide(data2(offset2), data3(offset3))
        }
      }
      Apply.apply3[T](self, x, y, func)
    }
    self
  }

  def cadd[@specialized(Float, Double) T](
    self: DenseTensor[T], x: Tensor[T], value: T, y: Tensor[T])
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    require(x != null && y.nElement() == x.nElement())

    if (!self.eq(x) && !self.eq(y)) {
      self.resizeAs(x).copy(x)
    }

    if (self.eq(x) && self.isContiguous() && y.isContiguous()) {
      ev.axpy(y.nElement(), value, y.storage().array(), y.storageOffset() - 1, 1,
        self.storage().array(), self.storageOffset() - 1, 1)
    } else {
      val func = new TensorFunc6[T] {
        override def apply(data1: Array[T], offset1: Int, data2: Array[T], offset2: Int,
                          data3: Array[T], offset3: Int): Unit = {
          data1(offset1) = ev.plus(data2(offset2), ev.times(value, data3(offset3)))
        }
      }
      Apply.apply3[T](self, x, y, func)
    }
    self
  }

  def csub[@specialized(Float, Double) T]
  (self: DenseTensor[T], x: Tensor[T], value: T, y: Tensor[T])
  (implicit ev: TensorNumeric[T]): Tensor[T] = {
    require(x != null && x.nElement() == y.nElement())
    if(!self.eq(x)) {
      self.resizeAs(x).copy(x)
    }

    if(self.eq(x) && self.isContiguous() && y.isContiguous()) {
      ev.axpy(y.nElement(), value, y.storage().array(),
        y.storageOffset() - 1, 1, self.storage().array(), self.storageOffset() - 1, 1)
    } else {
      val func2 = new TensorFunc4[T] {
        override def apply(data1: Array[T], offset1: Int, data2: Array[T], offset2: Int): Unit =
        { data1(offset1) = ev.minus(data1(offset1), ev.times(value, data2(offset2)))  }}
      Apply.apply2[T](self, y, func2)
    }
    self
  }

  def add[@specialized(Float, Double) T: ClassTag](s: T, t: DenseTensor[T])
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    val result = new DenseTensor[T]()
    result.resizeAs(t)
    result.copy(t)
    val func = new TensorFunc2[T] {
      override def apply(data: Array[T], index: Int): Unit = {
        data(index) = ev.plus(data(index), s)
      }
    }
    Apply.apply1[T](result, func)

    result
  }

  def add[@specialized(Float, Double) T: ClassTag](self: DenseTensor[T], t: Tensor[T])
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    val result = new DenseTensor[T]()
    result.resizeAs(self)
    result.copy(self)
    val n = result.nElement()
    if (result.isContiguous() && t.isContiguous() && n == t.nElement()) {
      ev.axpy(n, ev.fromType[Int](1), t.storage().array(), t.storageOffset() - 1, 1,
        result.storage().array,
        result.storageOffset() - 1, 1)
      result
    } else {
      val func2 = new TensorFunc4[T] {
        override def apply(data1: Array[T], offset1: Int, data2: Array[T], offset2: Int): Unit = {
          data1(offset1) = ev.plus(data1(offset1), data2(offset2))
        }
      }
      Apply.apply2[T](self, t, func2)
      result
    }
  }

  def sub[@specialized(Float, Double) T: ClassTag](s: T, t: DenseTensor[T])
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    val result = new DenseTensor[T]()
    result.resizeAs(t)
    result.copy(t)
    val func = new TensorFunc2[T] {
      override def apply(data: Array[T], index: Int): Unit = {
        data(index) = ev.minus(data(index), s)
      }
    }
    Apply.apply1[T](result, func)
    result
  }

  def sub[@specialized(Float, Double) T: ClassTag](self: DenseTensor[T], t: Tensor[T])
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    val result = new DenseTensor[T]()
    result.resizeAs(self)
    result.copy(self)
    val func2 = new TensorFunc4[T] {
      override def apply(data1: Array[T], offset1: Int, data2: Array[T], offset2: Int): Unit = {
        data1(offset1) = ev.minus(data1(offset1), data2(offset2))
      }
    }
    Apply.apply2[T](result, t, func2)
    result
  }

  def neg[@specialized(Float, Double) T: ClassTag](self: DenseTensor[T])
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    val result = new DenseTensor[T]()
    result.resizeAs(self)
    result.copy(self)

    val func = new TensorFunc2[T] {
      override def apply(data: Array[T], index: Int): Unit = {
        data(index) = ev.negative(data(index))
      }
    }
    Apply.apply1[T](result, func)
    result
  }

  def divide[@specialized(Float, Double) T: ClassTag](s: T, t: DenseTensor[T])
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    val result = new DenseTensor[T]()
    result.resizeAs(t)
    result.copy(t)
    val func = new TensorFunc2[T] {
      override def apply(data: Array[T], index: Int): Unit = {
        data(index) = ev.divide(data(index), s)
      }
    }
    Apply.apply1[T](result, func)
    result
  }

  def divide[@specialized(Float, Double) T: ClassTag](self: DenseTensor[T], t: Tensor[T])
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    val result = new DenseTensor[T]()
    result.resizeAs(self)
    result.copy(self)
    val func2 = new TensorFunc4[T] {
      override def apply(data1: Array[T], offset1: Int, data2: Array[T], offset2: Int): Unit = {
        data1(offset1) = ev.divide(data1(offset1), data2(offset2))
      }
    }
    Apply.apply2[T](result, t, func2)
    result
  }

  def mul[@specialized(Float, Double) T: ClassTag](s: T, t: DenseTensor[T])
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    val result = new DenseTensor[T]()
    result.resizeAs(t)
    result.copy(t)
    val func = new TensorFunc2[T] {
      override def apply(data: Array[T], index: Int): Unit = {
        data(index) = ev.times(data(index), s)
      }
    }
    Apply.apply1[T](result, func)
    result
  }

  def mul[@specialized(Float, Double) T: ClassTag](self: Tensor[T], t: Tensor[T])
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    if (self.nDimension() == 1 && t.nDimension() == 1) {
      require(self.size(1) == t.size(1), "vector size not match")

      val result = ev.dot(self.nElement(), self.storage().array(), self.storageOffset() - 1,
        self.stride(1), t.storage().array(), t.storageOffset() - 1, t.stride(1))
      new DenseTensor(new ArrayStorage(Array(result)))
    } else if (self.nDimension() == 2 && t.nDimension() == 1) {
      val result = new DenseTensor[T](self.size(1))
      DenseTensorBLAS.gemv[T](ev.fromType[Int](1), self, t, ev.fromType[Int](0), result)
      result
    } else if (self.nDimension() == 2 && t.nDimension() == 2) {
      val result = new DenseTensor[T](t.size(2), self.size(1)).t()
      addmm[T](result, ev.fromType[Int](0), result, ev.fromType[Int](1), self, t)
      result
    } else {
      throw new UnsupportedOperationException(s"multiplication between ${self.nDimension()}D and " +
        s"${t.nDimension()}D not yet supported")
    }
  }

  def pow[@specialized(Float, Double) T: ClassTag](self: DenseTensor[T], x: Tensor[T], n: T)
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    require(self.nElement() == x.nElement())
    if (MKL.isMKLLoaded && self.isContiguous() && x.isContiguous()) {
      ev.vPowx(self.nElement(), x.storage().array(), x.storageOffset() - 1, n,
        self.storage().array(), self.storageOffset() - 1)
    } else {
      val func = new TensorFunc4[T] {
        override def apply(data1: Array[T], offset1: Int, data2: Array[T], offset2: Int): Unit = {
          data1(offset1) = ev.pow(data2(offset2), n)
        }
      }
      DenseTensorApply.apply2[T](self, x, func)
    }
    self
  }

  def exp[@specialized(Float, Double) T: ClassTag](self: DenseTensor[T], x: Tensor[T])
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    if (self.nElement() != x.nElement()) {
      self.resizeAs(x)
    }

    if (MKL.isMKLLoaded && self.isContiguous() && x.isContiguous()) {
      ev.vExp(self.nElement(), x.storage().array(), x.storageOffset() - 1,
        self.storage().array(), self.storageOffset() - 1)
    } else {
      val func = new TensorFunc4[T] {
        override def apply(data1: Array[T], offset1: Int, data2: Array[T], offset2: Int): Unit = {
          data1(offset1) = ev.exp(data2(offset2))
        }
      }
      DenseTensorApply.apply2[T](self, x, func)
    }
    self
  }

  def log[@specialized(Float, Double) T: ClassTag](self: DenseTensor[T], x: Tensor[T])
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    require(self.nElement() == x.nElement())
    if (MKL.isMKLLoaded && self.isContiguous() && x.isContiguous()) {
      ev.vLn(self.nElement(), x.storage().array(), x.storageOffset() - 1,
        self.storage().array(), self.storageOffset() - 1)
    } else {
      val func = new TensorFunc4[T] {
        override def apply(data1: Array[T], offset1: Int, data2: Array[T], offset2: Int): Unit = {
          data1(offset1) = ev.log(data2(offset2))
        }
      }
      DenseTensorApply.apply2[T](self, x, func)
    }
    self
  }

  def sqrt[@specialized(Float, Double) T: ClassTag](self: DenseTensor[T], x: Tensor[T])
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    require(self.nElement() == x.nElement())
    if (MKL.isMKLLoaded && self.isContiguous() && x.isContiguous()) {
      ev.vSqrt(self.nElement(), x.storage().array(), x.storageOffset() - 1,
        self.storage().array(), self.storageOffset() - 1)
    } else {
      val func = new TensorFunc4[T] {
        override def apply(data1: Array[T], offset1: Int, data2: Array[T], offset2: Int): Unit = {
          data1(offset1) = ev.sqrt(data2(offset2))
        }
      }
      DenseTensorApply.apply2[T](self, x, func)
    }
    self
  }

  def tanh[@specialized(Float, Double) T: ClassTag](self: DenseTensor[T], x: Tensor[T])
                                                   (implicit ev: TensorNumeric[T]): Tensor[T] = {
    require(self.nElement() == x.nElement())
    if (MKL.isMKLLoaded && self.isContiguous() && x.isContiguous()) {
      ev.vTanh(self.nElement(), x.storage().array(), x.storageOffset() - 1,
        self.storage().array(), self.storageOffset() - 1)
    } else {
      val func = new TensorFunc4[T] {
        override def apply(data1: Array[T], offset1: Int, data2: Array[T], offset2: Int): Unit = {
          data1(offset1) = ev.tanh(data2(offset2))
        }
      }
      DenseTensorApply.apply2[T](self, x, func)
    }
    self
  }

  def log1p[@specialized(Float, Double) T: ClassTag](self: DenseTensor[T], x: Tensor[T])
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    require(self.nElement() == x.nElement())
    if (MKL.isMKLLoaded && self.isContiguous() && x.isContiguous()) {
      ev.vLog1p(self.nElement(), x.storage().array(), x.storageOffset() - 1,
        self.storage().array(), self.storageOffset() - 1)

    } else {
      val func = new TensorFunc4[T] {
        override def apply(data1: Array[T], offset1: Int, data2: Array[T], offset2: Int): Unit = {
          data1(offset1) = ev.log1p(data2(offset2))
        }
      }
      DenseTensorApply.apply2[T](self, x, func)

    }
    self
  }

  def prodAll[@specialized(Float, Double) T](self: DenseTensor[T])(
    implicit ev: TensorNumeric[T]): T = {
    var product = ev.fromType[Int](1)
    val func = new TensorFunc2[T] {
      override def apply(data: Array[T], index: Int): Unit = {
        product = ev.times(data(index), product)
      }
    }
    Apply.apply1[T](self, func)
    product
  }

  def sumAll[@specialized(Float, Double) T](self: DenseTensor[T])(
    implicit ev: TensorNumeric[T]): T = {
    var sum = ev.fromType[Int](0)
    val func = new TensorFunc2[T] {
      override def apply(data: Array[T], index: Int): Unit = {
        sum = ev.plus(data(index), sum)
      }
    }
    Apply.apply1[T](self, func)
    sum
  }

  def prod[@specialized(Float, Double) T: ClassTag](self: DenseTensor[T], x: Tensor[T], _dim: Int)
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    require(_dim >= 0 && _dim < x.nDimension, s"dimension ${_dim + 1} out of range")
    val result = if (self == null) new DenseTensor[T]() else self
    val sizes = x.size()
    sizes(_dim) = 1
    result.resize(sizes)
    DenseTensorDimApply.dimApply2[T](result, x, _dim,
      (rData, rOffset, rStride, rSize, tData, tOffset, tStride, tSize) => {
        rData(rOffset) = ev.prod(tSize, tData, tOffset, tStride)
      })

    result
  }

  def sum[@specialized T: ClassTag](self: DenseTensor[T], x: Tensor[T], _dim: Int)
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    require(_dim >= 0 && _dim < x.nDimension, s"dimension ${_dim + 1} out of range")
    val result = if (self == null) new DenseTensor[T]() else self
    val sizes = x.size()
    sizes(_dim) = 1
    result.resize(sizes)
    DenseTensorDimApply.dimApply2[T](result, x, _dim,
      (rData, rOffset, rStride, rSize, tData, tOffset, tStride, tSize) => {
        rData(rOffset) = ev.sum(tSize, tData, tOffset, tStride)
      })

    result
  }

  def maxAll[@specialized(Float, Double) T](self: DenseTensor[T])(
    implicit ev: TensorNumeric[T]): T = {
    var max = ev.fromType[Int](0)
    var first = true
    val func = new TensorFunc2[T] {
      override def apply(data: Array[T], index: Int): Unit = {
        if (first) {
          first = false
          max = data(index)
        } else if (ev.isGreater(data(index), max)) {
          max = data(index)
        }
      }
    }
    Apply.apply1[T](self, func)
    max
  }

  def minAll[@specialized(Float, Double) T](self: DenseTensor[T])(
    implicit ev: TensorNumeric[T]): T = {
    var min = ev.fromType[Int](Int.MaxValue)
    var first = true
    val func = new TensorFunc2[T] {
      override def apply(data: Array[T], index: Int): Unit = {
        if (first) {
          first = false
          min = data(index)
        } else if (ev.isGreater(min, data(index))) {
          min = data(index)
        }
      }
    }
    Apply.apply1[T](self, func)
    min
  }

  def addmm[@specialized(Float, Double) T: ClassTag](r: Tensor[T], beta: T, t: Tensor[T],
    alpha: T, m1: Tensor[T], m2: Tensor[T])
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    require(m1.dim() == 2 && m2.dim() == 2,
      s"matrices expected, got ${m1.dim()}, ${m2.dim()} tensors")
    require(m1.size(2) == m2.size(1),
      s"size mismatch, m1:${m1.size().mkString("x")} m2:${m2.size().mkString("x")}")
    require(t.dim() == 2,
      s"matrix expected, got ${t.dim()} tensor for t")
    require(t.size(1) == m1.size(1) && t.size(2) == m2.size(2),
      s"size mismatch. t:${t.size().mkString("x")}, " +
        s"m1:${m1.size().mkString("x")} + m2:${m2.size().mkString("x")}")

    if (r != t) {
      r.resizeAs(t)
      r.copy(t)
    }

    var _r: Tensor[T] = null
    var _m1: Tensor[T] = m1
    var _m2: Tensor[T] = m2
    var transpose_r = ' '
    if (r.stride(1) == 1 && r.stride(2) != 0) {
      transpose_r = 'n'
      _r = r
    } else if (r.stride(2) == 1 && r.stride(1) != 0) {
      val swap = _m2
      _m2 = _m1
      _m1 = swap
      transpose_r = 't'
      _r = r
    } else {
      transpose_r = 'n'
      _r = new DenseTensor[T](r.size(2), r.size(1))
      _r.copy(r)
      _r = _r.transpose(1, 2)
    }

    val index1 = if (transpose_r == 'n') 1 else 2
    val index2 = if (transpose_r == 'n') 2 else 1
    var transpose_m1 = ' '
    var __m1: Tensor[T] = null
    if (_m1.stride(index1) == 1 && _m1.stride(index2) != 0) {
      transpose_m1 = 'n'
      __m1 = _m1
    } else if (_m1.stride(index2) == 1 && _m1.stride(index1) != 0) {
      transpose_m1 = 't'
      __m1 = _m1
    } else {
      transpose_m1 = if (transpose_r == 'n') 't' else 'n'
      __m1 = _m1.contiguous()
    }

    var transpose_m2 = ' '
    var __m2: Tensor[T] = null
    if (_m2.stride(index1) == 1 && _m2.stride(index2) != 0) {
      transpose_m2 = 'n'
      __m2 = _m2
    } else if (_m2.stride(index2) == 1 && _m2.stride(index1) != 0) {
      transpose_m2 = 't'
      __m2 = _m2
    } else {
      transpose_m2 = if (transpose_r == 'n') 't' else 'n'
      __m2 = _m2.contiguous()
    }

    DenseTensorBLAS.gemm[T](transpose_m1, transpose_m2, _r.size(index1), _r.size(index2),
      __m1.size(index2), alpha, __m1.storage().array(), __m1.storageOffset() - 1,
      if (transpose_m1 == 'n') __m1.stride(index2) else __m1.stride(index1),
      __m2.storage().array(), __m2.storageOffset() - 1,
      if (transpose_m2 == 'n') __m2.stride(index2) else __m2.stride(index1),
      beta,
      _r.storage().array(), _r.storageOffset() - 1,
      _r.stride(index2)
    )
    if (_r != r) {
      r.copy(_r)
    }
    r
  }

  def addr[@specialized(Float, Double) T](r: Tensor[T], beta: T, t: Tensor[T],
    alpha: T, vec1: Tensor[T], vec2: Tensor[T])(implicit ev: TensorNumeric[T]): Tensor[T] = {
    require(vec1.dim() == 1 && vec2.dim() == 1)
    require(t.dim() == 2)
    require(t.size(1) == vec1.size(1) && t.size(2) == vec2.size(1))

    if (!r.eq(t)) {
      r.resizeAs(t).copy(t)
    }

    if (beta != 1) {
      r.mul(beta)
    }

    if (r.stride(1) == 1) {
      val lda = if (t.stride(2) == 1) {
        r.size(1)
      } else {
        r.stride(2)
      }
      ev.ger(vec1.size(1), vec2.size(1), alpha, vec1.storage().array(), vec1.storageOffset() - 1,
        vec1.stride(1), vec2.storage().array(), vec2.storageOffset() - 1, vec2.stride(1),
        r.storage().array(), r.storageOffset() - 1, lda)
    } else if (r.stride(2) == 1) {
      ev.ger(vec2.size(1), vec1.size(1), alpha, vec2.storage().array(), vec2.storageOffset() - 1,
        vec2.stride(1), vec1.storage().array(), vec1.storageOffset() - 1, vec1.stride(1),
        r.storage().array(), r.storageOffset() - 1, r.stride(1))
    } else {
      val cr = r.contiguous()
      ev.ger(vec2.size(1), vec1.size(1), alpha, vec2.storage().array(), vec2.storageOffset() - 1,
        vec2.stride(1), vec1.storage().array(), vec1.storageOffset() - 1, vec1.stride(1),
        cr.storage().array(), cr.storageOffset() - 1, cr.stride(1))
      r.copy(cr)
    }

    r
  }

  def baddbmm[@specialized(Float, Double) T: ClassTag]
  (result: Tensor[T], beta: T, M: Tensor[T], alpha: T, batch1: Tensor[T], batch2: Tensor[T])
    (implicit ev: TensorNumeric[T]): Tensor[T] = {
    require(batch1.dim() == 3, s"expected 3D tensor, got ${batch1.dim()}D")
    require(batch2.dim() == 3, s"expected 3D tensor, got ${batch2.dim()}D")
    require(batch1.size(1) == batch2.size(1), "equal number of batches expected, got " +
      s"${batch1.size(1)}, ${batch2.size(1)}")
    require(batch1.size(3) == batch2.size(2), s"wrong matrix size, batch1: " +
      s"${batch1.size(2)}${batch1.size(3)}, batch2: " +
      s"${batch2.size(2)}${batch2.size(3)}")

    val bs = batch1.size(1)
    val dim1 = batch1.size(2)
    val dim2 = batch2.size(3)
    require(M.size(1) == bs, "output tensor of incorrect size")
    require(M.size(2) == dim1, "output tensor of incorrect size")
    require(M.size(3) == dim2, "output tensor of incorrect size")

    if (M != result) {
      result
        .resizeAs(M)
        .copy(M)
    }

    var batch = 1
    while (batch <= batch1.size(1)) {
      val m1 = batch1.select(1, batch)
      val m2 = batch2.select(1, batch)
      val resultMatrix = result.select(1, batch)

      addmm(resultMatrix, beta, resultMatrix, alpha, m1, m2)
      batch += 1
    }

    result
  }

  def addmv[@specialized(Float, Double) T](r: Tensor[T], beta: T, t: Tensor[T], alpha: T,
    mat: Tensor[T], vec: Tensor[T])(implicit ev: TensorNumeric[T]): Tensor[T] = {
    require(mat.nDimension() == 2 && vec.nDimension() == 1)
    require(mat.size(2) == vec.size(1))
    require(t.nDimension() == 1)
    require(t.size(1) == mat.size(1), s"${t.size(1)} == ${mat.size(1)}")

    if (!r.eq(t)) {
      r.resizeAs(t).copy(t)
    }

    if (mat.stride(1) == 1) {
      val lda = if (mat.size(2) == 1) {
        mat.size(1)
      } else {
        mat.stride(2)
      }
      ev.gemv('N', mat.size(1), mat.size(2), alpha, mat.storage().array(), mat.storageOffset() - 1,
        lda, vec.storage().array(), vec.storageOffset() - 1, vec.stride(1), beta,
        r.storage().array(),
        r.storageOffset() - 1, r.stride(1))
    } else if (mat.stride(2) == 1) {
      ev.gemv('T', mat.size(2), mat.size(1), alpha, mat.storage().array(), mat.storageOffset() - 1,
        mat.stride(1), vec.storage().array(), vec.storageOffset() - 1, vec.stride(1), beta,
        r.storage().array(), r.storageOffset() - 1, r.stride(1))
    } else {
      val cmat = mat.contiguous()
      ev.gemv('T', cmat.size(2), cmat.size(1), alpha, cmat.storage().array(),
        cmat.storageOffset() - 1, cmat.stride(1), vec.storage().array(), vec.storageOffset() - 1,
        vec.stride(1), beta, r.storage().array(), r.storageOffset() - 1, r.stride(1))
    }

    r
  }

  def meanAll[@specialized(Float, Double) T](self: DenseTensor[T])(
    implicit ev: TensorNumeric[T]): T = {
    var sum = ev.fromType[Int](0)
    val func = new TensorFunc2[T] {
      override def apply(data: Array[T], index: Int): Unit = {
        sum = ev.plus(data(index), sum)
      }
    }
    Apply.apply1[T](self, func)
    ev.divide(sum, ev.fromType[Int](self.nElement()))
  }

  def mean[@specialized(Float, Double) T: ClassTag](self: DenseTensor[T], _dim: Int)(
    implicit ev: TensorNumeric[T]): Tensor[T] = {
    require(_dim >= 0 && _dim < self.nDimension, s"dimension ${_dim + 1} out of range")
    val result = new DenseTensor[T]()
    val sizes = self.size()
    sizes(_dim) = 1
    DenseTensor.resize(result, sizes)
    DenseTensorDimApply.dimApply2[T](result, self, _dim,
      (rData, rOffset, rStride, rSize, tData, tOffset, tStride, tSize) => {
        var sum = ev.fromType[Int](0)
        var i = 0
        while (i < tSize) {
          sum = ev.plus(sum, tData(tOffset + i * tStride))
          i += 1
        }
        rData(rOffset) = ev.divide(sum, ev.fromType[Int](self.size(_dim + 1)))
      })
    result
  }

  /**
   * returns the p-norms of the Tensor x computed over the dimension dim.
 *
   * @param self
   * @param value value-norms
   * @param _dim the dimension dim
   * @return
   */
  def norm[@specialized(Float, Double) T: ClassTag](self: DenseTensor[T], result: Tensor[T],
   value: Int, _dim: Int)(implicit ev: TensorNumeric[T]): Tensor[T] = {
    require(_dim >= 0 && _dim < self.nDimension, "invalid dimension")
    val sizes = self.size()
    sizes(_dim) = 1
    result.resize(sizes)

    if (value == 0) {
      DenseTensorDimApply.dimApply2[T](self, result, _dim,
        (rData, rOffset, rStride, rSize, tData, tOffset, tStride, tSize) => {
          var sum = ev.fromType[Int](0)
          var i = 0
          while (i < rSize) {
            sum = ev.plus(sum, rData(rOffset + i * rStride))
            i += 1
          }
          tData(tOffset) = sum
        })
    } else {
      DenseTensorDimApply.dimApply2[T](self, result, _dim,
        (rData, rOffset, rStride, rSize, tData, tOffset, tStride, tSize) => {
          var sum = ev.fromType[Int](0)
          var i = 0
          while (i < rSize) {
            sum = ev.plus(sum, ev.pow(ev.abs(rData(rOffset + i * rStride)), ev.fromType(value)))
            i += 1
          }
          tData(tOffset) = ev.pow(sum, ev.fromType(1.0 / value))
        })
    }
    result
  }

  def nearlyEqual[@specialized(Float, Double) T](a: T, b: T, epsilon: Double)(
    implicit ev: TensorNumeric[T]): Boolean = {
    ev.nearlyEqual(a, b, epsilon)
  }

  def cmax[@specialized(Float, Double) T](self: DenseTensor[T], x: Tensor[T], y: Tensor[T])
                                         (implicit ev: TensorNumeric[T]): Tensor[T] = {
    require(self.nElement() == y.nElement() && self.nElement() == x.nElement(),
      "element number doesn't match")
    // todo: the performance of contiguous tensor should be optimized
    val func = new TensorFunc6[T] {
      override def apply(data1: Array[T], offset1: Int, data2: Array[T], offset2: Int,
                         data3: Array[T], offset3: Int): Unit = {
        data1(offset1) = ev.max(data2(offset2), data3(offset3))
      }
    }
    Apply.apply3[T](self, x, y, func)
    self
  }
  def cmin[@specialized(Float, Double) T](self: DenseTensor[T], x: Tensor[T], y: Tensor[T])
                                         (implicit ev: TensorNumeric[T]): Tensor[T] = {
    require(self.nElement() == y.nElement() && self.nElement() == x.nElement(),
      "element number doesn't match")
    // todo: the performance of contiguous tensor should be optimized
    val func = new TensorFunc6[T] {
      override def apply(data1: Array[T], offset1: Int, data2: Array[T], offset2: Int,
                         data3: Array[T], offset3: Int): Unit = {
        data1(offset1) = ev.min(data2(offset2), data3(offset3))
      }
    }
    Apply.apply3[T](self, x, y, func)
    self
  }

  val doubleEpsilon = System.getProperty("DoubleTensorEpsilon", "0.0000001").toDouble
  val floatEpsilon = System.getProperty("FloatTensorEpsilon", "0.00001").toDouble
}


text:
FOUNDATION_EXTERN NSString * const FLKNoConstraint;

@interface UIView (FLKAutoLayout)

- (NSArray*)flk_alignAttribute:(NSLayoutAttribute)attribute toView:(UIView*)view predicate:(NSString*)predicate;
- (NSArray*)flk_alignAttribute:(NSLayoutAttribute)attribute toAttribute:(NSLayoutAttribute)toAttribute ofView:(UIView *)view predicate:(NSString*)predicate;

- (NSArray*)flk_alignToView:(UIView*)view;
- (NSArray*)flk_alignTop:(NSString *)top leading:(NSString *)leading bottom:(NSString *)bottom trailing:(NSString *)trailing toView:(UIView*)view;
- (NSArray*)flk_alignTop:(NSString *)top leading:(NSString *)leading toView:(UIView*)view;
- (NSArray*)flk_alignBottom:(NSString *)bottom trailing:(NSString *)trailing toView:(UIView*)view;
- (NSArray*)flk_alignTop:(NSString *)top bottom:(NSString *)bottom toView:(UIView*)view;
- (NSArray*)flk_alignLeading:(NSString *)leading trailing:(NSString *)trailing toView:(UIView*)view;

- (NSArray*)flk_alignLeadingEdgeWithView:(UIView *)view predicate:(NSString*)predicate;
- (NSArray*)flk_alignTrailingEdgeWithView:(UIView *)view predicate:(NSString*)predicate;
- (NSArray*)flk_alignTopEdgeWithView:(UIView *)view predicate:(NSString*)predicate;
- (NSArray*)flk_alignBottomEdgeWithView:(UIView *)view predicate:(NSString*)predicate;

- (NSArray*)flk_alignBaselineWithView:(UIView *)view predicate:(NSString*)predicate;
- (NSArray*)flk_alignCenterXWithView:(UIView *)view predicate:(NSString*)predicate;
- (NSArray*)flk_alignCenterYWithView:(UIView *)view predicate:(NSString*)predicate;
- (NSArray*)flk_alignCenterWithView:(UIView*)view;

- (NSArray*)flk_constrainWidth:(NSString *)widthPredicate height:(NSString*)heightPredicate;
- (NSArray*)flk_constrainWidth:(NSString*)widthPredicate;
- (NSArray*)flk_constrainHeight:(NSString*)heightPredicate;

- (NSArray*)flk_constrainWidthToView:(UIView *)view predicate:(NSString*)predicate;
- (NSArray*)flk_constrainHeightToView:(UIView *)view predicate:(NSString*)predicate;

- (NSArray*)flk_constrainAspectRatio:(NSString*)predicate;

- (NSArray*)flk_constrainLeadingSpaceToView:(UIView *)view predicate:(NSString*)predicate;
- (NSArray *)flk_constrainTrailingSpaceToView:(UIView *)view predicate:(NSString *)predicate;
- (NSArray*)flk_constrainTopSpaceToView:(UIView *)view predicate:(NSString*)predicate;
- (NSArray*)flk_constrainBottomSpaceToView:(UIView *)view predicate:(NSString*)predicate;

+ (NSArray*)flk_alignAttribute:(NSLayoutAttribute)attribute ofViews:(NSArray *)ofViews toViews:(NSArray *)toViews predicate:(NSString*)predicate;
+ (NSArray*)flk_alignAttribute:(NSLayoutAttribute)attribute ofViews:(NSArray *)views toAttribute:(NSLayoutAttribute)toAttribute ofViews:(NSArray *)toViews predicate:(NSString*)predicate;

+ (NSArray*)flk_equalWidthForViews:(NSArray*)views;
+ (NSArray*)flk_equalHeightForViews:(NSArray*)views;

+ (NSArray*)flk_alignLeadingEdgesOfViews:(NSArray*)views;
+ (NSArray*)flk_alignTrailingEdgesOfViews:(NSArray*)views;
+ (NSArray*)flk_alignTopEdgesOfViews:(NSArray*)views;
+ (NSArray*)flk_alignBottomEdgesOfViews:(NSArray*)views;
+ (NSArray*)flk_alignLeadingAndTrailingEdgesOfViews:(NSArray*)views;
+ (NSArray*)flk_alignTopAndBottomEdgesOfViews:(NSArray*)views;

+ (NSArray*)flk_spaceOutViewsHorizontally:(NSArray *)views predicate:(NSString*)predicate;
+ (NSArray*)flk_spaceOutViewsVertically:(NSArray *)views predicate:(NSString*)predicate;

+ (NSArray*)flk_distributeCenterXOfViews:(NSArray *)views inView:(UIView*)view;
+ (NSArray*)flk_distributeCenterYOfViews:(NSArray *)views inView:(UIView*)inView;

+ (void)flk_spaceOutViewsHorizontally:(NSArray *)array inView:(UIView *)view;

+ (void)flk_spaceOutViewsVertically:(NSArray *)array inView:(UIView *)view;
@end


text:
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/typingDrawable" android:oneshot="false">
    <item android:drawable="@drawable/typing1" android:duration="300" />
    <item android:drawable="@drawable/typing2" android:duration="300" />
    <item android:drawable="@drawable/typing3" android:duration="300" />
    <item android:drawable="@drawable/typing4" android:duration="300" />
</animation-list>


text:
<?php

  /* A logged teacher removes a student from a class. */

  include_once('../config/init.php');
  include_once('../database/classes.php');

  if(isset($_SESSION['username'])
  	&& $_SESSION['usertype'] == "teacher"
  	&& isset($_GET['classid'])
  	&& isset($_GET['userid'])){

	$row = removeUserFromClass($_GET['userid'],$_GET['classid']);
	if($row==0)
		echo false;
	else{
		echo true;
	}

  }
  else
	echo false;

?>


text:
package com.parse;

import java.util.Arrays;
import java.util.Map;

import bolts.Continuation;
import bolts.Task;

/** package */ class CachedCurrentUserController implements ParseCurrentUserController {

  /**
   * Lock used to synchronize current user modifications and access.
   *
   * Note about lock ordering:
   *
   * You must NOT acquire the ParseUser instance mutex (the "mutex" field in ParseObject) while
   * holding this static initialization lock. Doing so will cause a deadlock. Here's an example:
   * https://phabricator.fb.com/P17182641
   */
  private final Object mutex = new Object();
  private final TaskQueue taskQueue = new TaskQueue();

  private final ParseObjectStore<ParseUser> store;

  /* package */ ParseUser currentUser;
  // Whether currentUser is known to match the serialized version on disk. This is useful for saving
  // a filesystem check if you try to load currentUser frequently while there is none on disk.
  /* package */ boolean currentUserMatchesDisk = false;

  public CachedCurrentUserController(ParseObjectStore<ParseUser> store) {
    this.store = store;
  }

  @Override
  public Task<Void> setAsync(final ParseUser user) {
    return taskQueue.enqueue(new Continuation<Void, Task<Void>>() {
      @Override
      public Task<Void> then(Task<Void> toAwait) throws Exception {
        return toAwait.continueWithTask(new Continuation<Void, Task<Void>>() {
          @Override
          public Task<Void> then(Task<Void> ignored) throws Exception {
            ParseUser oldCurrentUser;
            synchronized (mutex) {
              oldCurrentUser = currentUser;
            }

            if (oldCurrentUser != null && oldCurrentUser != user) {
              // We don't need to revoke the token since we're not explicitly calling logOut
              // We don't need to remove persisted files since we're overwriting them
              oldCurrentUser.logOutInternal();
            }

            synchronized (user.mutex) {
              user.setIsCurrentUser(true);
              user.synchronizeAllAuthData();
            }

            return store.setAsync(user).continueWith(new Continuation<Void, Void>() {
              @Override
              public Void then(Task<Void> task) throws Exception {
                synchronized (mutex) {
                  currentUserMatchesDisk = !task.isFaulted();
                  currentUser = user;
                }
                return null;
              }
            });
          }
        });
      }
    });
  }

  @Override
  public Task<Void> setIfNeededAsync(ParseUser user) {
    synchronized (mutex) {
      if (!user.isCurrentUser() || currentUserMatchesDisk) {
        return Task.forResult(null);
      }
    }

    return setAsync(user);
  }

  @Override
  public Task<ParseUser> getAsync() {
    return getAsync(ParseUser.isAutomaticUserEnabled());
  }

  @Override
  public Task<Boolean> existsAsync() {
    synchronized (mutex) {
      if (currentUser != null) {
        return Task.forResult(true);
      }
    }

    return taskQueue.enqueue(new Continuation<Void, Task<Boolean>>() {
      @Override
      public Task<Boolean> then(Task<Void> toAwait) throws Exception {
        return toAwait.continueWithTask(new Continuation<Void, Task<Boolean>>() {
          @Override
          public Task<Boolean> then(Task<Void> task) throws Exception {
            return store.existsAsync();
          }
        });
      }
    });
  }

  @Override
  public boolean isCurrent(ParseUser user) {
    synchronized (mutex) {
      return currentUser == user;
    }
  }

  @Override
  public void clearFromMemory() {
    synchronized (mutex) {
      currentUser = null;
      currentUserMatchesDisk = false;
    }
  }

  @Override
  public void clearFromDisk() {
    synchronized (mutex) {
      currentUser = null;
      currentUserMatchesDisk = false;
    }
    try {
      ParseTaskUtils.wait(store.deleteAsync());
    } catch (ParseException e) {
      // ignored
    }
  }

  @Override
  public Task<String> getCurrentSessionTokenAsync() {
    return getAsync(false).onSuccess(new Continuation<ParseUser, String>() {
      @Override
      public String then(Task<ParseUser> task) throws Exception {
        ParseUser user = task.getResult();
        return user != null ? user.getSessionToken() : null;
      }
    });
  }

  @Override
  public Task<Void> logoutAsync() {
    return taskQueue.enqueue(new Continuation<Void, Task<Void>>() {
      @Override
      public Task<Void> then(Task<Void> toAwait) throws Exception {
        // We can parallelize disk and network work, but only after we restore the current user from
        // disk.
        final Task<ParseUser> userTask = getAsync(false);
        return Task.whenAll(Arrays.asList(userTask, toAwait)).continueWithTask(new Continuation<Void, Task<Void>>() {
          @Override
          public Task<Void> then(Task<Void> task) throws Exception {
            Task<Void> logOutTask = userTask.onSuccessTask(new Continuation<ParseUser, Task<Void>>() {
              @Override
              public Task<Void> then(Task<ParseUser> task) throws Exception {
                ParseUser user = task.getResult();
                if (user == null) {
                  return task.cast();
                }
                return user.logOutAsync();
              }
            });

            Task<Void> diskTask = store.deleteAsync().continueWith(new Continuation<Void, Void>() {
              @Override
              public Void then(Task<Void> task) throws Exception {
                boolean deleted = !task.isFaulted();
                synchronized (mutex) {
                  currentUserMatchesDisk = deleted;
                  currentUser = null;
                }
                return null;
              }
            });
            return Task.whenAll(Arrays.asList(logOutTask, diskTask));
          }
        });
      }
    });
  }

  @Override
  public Task<ParseUser> getAsync(final boolean shouldAutoCreateUser) {
    synchronized (mutex) {
      if (currentUser != null) {
        return Task.forResult(currentUser);
      }
    }

    return taskQueue.enqueue(new Continuation<Void, Task<ParseUser>>() {
      @Override
      public Task<ParseUser> then(Task<Void> toAwait) throws Exception {
        return toAwait.continueWithTask(new Continuation<Void, Task<ParseUser>>() {
          @Override
          public Task<ParseUser> then(Task<Void> ignored) throws Exception {
            ParseUser current;
            boolean matchesDisk;
            synchronized (mutex) {
              current = currentUser;
              matchesDisk = currentUserMatchesDisk;
            }

            if (current != null) {
              return Task.forResult(current);
            }

            if (matchesDisk) {
              if (shouldAutoCreateUser) {
                return Task.forResult(lazyLogIn());
              }
              return null;
            }

            return store.getAsync().continueWith(new Continuation<ParseUser, ParseUser>() {
              @Override
              public ParseUser then(Task<ParseUser> task) throws Exception {
                ParseUser current = task.getResult();
                boolean matchesDisk = !task.isFaulted();

                synchronized (mutex) {
                  currentUser = current;
                  currentUserMatchesDisk = matchesDisk;
                }

                if (current != null) {
                  synchronized (current.mutex) {
                    current.setIsCurrentUser(true);
                  }
                  return current;
                }

                if (shouldAutoCreateUser) {
                  return lazyLogIn();
                }
                return null;
              }
            });
          }
        });
      }
    });
  }

  private ParseUser lazyLogIn() {
    AnonymousAuthenticationProvider provider = ParseAnonymousUtils.getProvider();
    String authType = provider.getAuthType();
    Map<String, String> authData = provider.getAuthData();
    return lazyLogIn(authType, authData);
  }

  /* package for tests */ ParseUser lazyLogIn(String authType, Map<String, String> authData) {
    // Note: if authType != ParseAnonymousUtils.AUTH_TYPE the user is not "lazy".
    ParseUser user = ParseObject.create(ParseUser.class);
    synchronized (user.mutex) {
      user.setIsCurrentUser(true);
      user.putAuthData(authType, authData);
    }

    synchronized (mutex) {
      currentUserMatchesDisk = false;
      currentUser = user;
    }

    return user;
  }
}


text:
require "local_inbox/engine"

module LocalInbox
end


text:
title: Accessing columns (of a multicolumn combobox) on the client-side when the combobox is databound in an external callback page
description: Accessing columns (of a multicolumn combobox) on the client-side when the RadCombobox is databound in an external callback page. Check it now!
type: how-to
page_title: Accessing columns (of a multicolumn combobox) on the client-side when the combobox is databound in an external callback page
slug: combobox-accessing-columns-of-a-multicolumn-combobox-on-the-client-side-when-the-combobox-is-databound-in-an-external-callback-page
res_type: kb
---

## HOW-TO
Access columns (of a multicolumn combobox) on the client-side when the combobox is databound in an external callback page

## SOLUTION
For RadComboBox AJAX (Prometheus) an external streamer page is no longer needed.

````ASP.NET
<telerik:RadComboBox runat="server"
    ID="RadComboBox1"
    Width="455px"
    HighlightTemplatedItems="true"
    EnableLoadOnDemand="true"
    OnClientSelectedIndexChanged="onClientSelectedIndexChanged"
    OnItemDataBound="RadComboBox1_ItemDataBound"
    OnItemsRequested="RadComboBox1_ItemsRequested">
      <ItemTemplate>
                     <table style="width:415px">
                        <tr>
                           <td style="width:125px;">
                              <%# DataBinder.Eval(Container.DataItem, "ID") %>
                           </td>
                           <td style="width:125px;">
                              <%# DataBinder.Eval(Container.DataItem, "ProductName") %>
                           </td>
                           <td style="width:125px;">
                              <%# DataBinder.Eval(Container.DataItem, "Price") %>
                           </td>
                        </tr>
                     </table>
      </ItemTemplate>
      <HeaderTemplate>
                     <table style="width:415px">
                        <tr>
                           <td style="width:125px;">
                              ID
                           </td>
                           <td style="width:125px;">
                              Product Name
                           </td>
                           <td style="width:125px;">
                              Price
                           </td>
                        </tr>
                     </table>
      </HeaderTemplate>
</telerik:RadComboBox>
<script type="text/javascript">
function onClientSelectedIndexChanged(sender, eventArgs)
{
    var message = "ID: " + eventArgs.get_item().get_attributes().getAttribute("ProductID");
    message += "\nProduct Name: " + eventArgs.get_item().get_attributes().getAttribute("Name");
    message += "\nPrice: " + eventArgs.get_item().get_attributes().getAttribute("Price");
    alert(message);
}
</script>
````

````C#
protected void RadComboBox1_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
{
    SqlConnection connection =
                new SqlConnection(ConfigurationManager.ConnectionStrings["TelerikConnectionString"].ConnectionString);

    SqlCommand selectCommand =
        new SqlCommand(@"   SELECT ID, ProductName, Price FROM Products
                            WHERE LOWER(ProductName) LIKE '" + e.Text + "%'", connection);

    SqlDataAdapter adapter = new SqlDataAdapter(selectCommand);
    DataTable products = new DataTable();
    adapter.Fill(products);

    RadComboBox1.DataTextField = "ProductName";
    RadComboBox1.DataValueField = "ID";
    RadComboBox1.DataSource = products;
    RadComboBox1.DataBind();
}

protected void RadComboBox1_ItemDataBound(object sender, RadComboBoxItemEventArgs e)
{
    DataRowView row = e.Item.DataItem as DataRowView;
    e.Item.Attributes["Name"] = row["ProductName"].ToString();
    e.Item.Attributes["ProductID"] = row["ID"].ToString();
    e.Item.Attributes["Price"] = row["Price"].ToString();
}
````


text:
import io
from functools import partial

from fsspec.core import open_files
from tlz import concat

from ..bytes import read_bytes
from ..delayed import delayed
from ..utils import parse_bytes, system_encoding
from .core import from_delayed

delayed = delayed(pure=True)

def read_text(
    urlpath,
    blocksize=None,
    compression="infer",
    encoding=system_encoding,
    errors="strict",
    linedelimiter=None,
    collection=True,
    storage_options=None,
    files_per_partition=None,
    include_path=False,
):
    """Read lines from text files

    Parameters
    ----------
    urlpath : string or list
        Absolute or relative filepath(s). Prefix with a protocol like ``s3://``
        to read from alternative filesystems. To read from multiple files you
        can pass a globstring or a list of paths, with the caveat that they
        must all have the same protocol.
    blocksize: None, int, or str
        Size (in bytes) to cut up larger files.  Streams by default.
        Can be ``None`` for streaming, an integer number of bytes, or a string
        like "128MiB"
    compression: string
        Compression format like 'gzip' or 'xz'.  Defaults to 'infer'
    encoding: string
    errors: string
    linedelimiter: string or None
    collection: bool, optional
        Return dask.bag if True, or list of delayed values if false
    storage_options: dict
        Extra options that make sense to a particular storage connection, e.g.
        host, port, username, password, etc.
    files_per_partition: None or int
        If set, group input files into partitions of the requested size,
        instead of one partition per file. Mutually exclusive with blocksize.
    include_path: bool
        Whether or not to include the path in the bag.
        If true, elements are tuples of (line, path).
        Default is False.

    Examples
    --------
    >>> b = read_text('myfiles.1.txt')  # doctest: +SKIP
    >>> b = read_text('myfiles.*.txt')  # doctest: +SKIP
    >>> b = read_text('myfiles.*.txt.gz')  # doctest: +SKIP
    >>> b = read_text('s3://bucket/myfiles.*.txt')  # doctest: +SKIP
    >>> b = read_text('s3://key:secret@bucket/myfiles.*.txt')  # doctest: +SKIP
    >>> b = read_text('hdfs://namenode.example.com/myfiles.*.txt')  # doctest: +SKIP

    Parallelize a large file by providing the number of uncompressed bytes to
    load into each partition.

    >>> b = read_text('largefile.txt', blocksize='10MB')  # doctest: +SKIP

    Get file paths of the bag by setting include_path=True

    >>> b = read_text('myfiles.*.txt', include_path=True) # doctest: +SKIP
    >>> b.take(1) # doctest: +SKIP
    (('first line of the first file', '/home/dask/myfiles.0.txt'),)

    Returns
    -------
    dask.bag.Bag or list
        dask.bag.Bag if collection is True or list of Delayed lists otherwise.

    See Also
    --------
    from_sequence: Build bag from Python sequence
    """
    if blocksize is not None and files_per_partition is not None:
        raise ValueError("Only one of blocksize or files_per_partition can be set")
    if isinstance(blocksize, str):
        blocksize = parse_bytes(blocksize)

    if blocksize is None:
        if linedelimiter in [None, "", "\n", "\r", "\r\n"]:
            newline = linedelimiter
            linedelimiter = None
        else:
            newline = ""
        files = open_files(
            urlpath,
            mode="rt",
            encoding=encoding,
            errors=errors,
            compression=compression,
            newline=newline,
            **(storage_options or {}),
        )
        if files_per_partition is None:
            blocks = [
                delayed(list)(
                    delayed(
                        partial(file_to_blocks, include_path, delimiter=linedelimiter)
                    )(fil)
                )
                for fil in files
            ]
        else:
            blocks = []
            for start in range(0, len(files), files_per_partition):
                block_files = files[start : (start + files_per_partition)]
                block_lines = delayed(concat)(
                    delayed(map)(
                        partial(file_to_blocks, include_path, delimiter=linedelimiter),
                        block_files,
                    )
                )
                blocks.append(block_lines)
    else:
        # special case for linedelimiter=None: we will need to split on an actual bytestring
        # and the line reader will then use "universal" mode. Just as well that \r\n and \n
        # will both work (thankfully \r for MacOS is no longer a thing)
        o = read_bytes(
            urlpath,
            delimiter=linedelimiter.encode() if linedelimiter is not None else b"\n",
            blocksize=blocksize,
            sample=False,
            compression=compression,
            include_path=include_path,
            **(storage_options or {}),
        )
        raw_blocks = o[1]
        blocks = [
            delayed(decode)(b, encoding, errors, linedelimiter)
            for b in concat(raw_blocks)
        ]
        if include_path:
            paths = list(
                concat([[path] * len(raw_blocks[i]) for i, path in enumerate(o[2])])
            )
            blocks = [
                delayed(attach_path)(entry, path) for entry, path in zip(blocks, paths)
            ]

    if not blocks:
        raise ValueError("No files found", urlpath)

    if collection:
        blocks = from_delayed(blocks)

    return blocks

def file_to_blocks(include_path, lazy_file, delimiter=None):
    # blocksize is None branch
    with lazy_file as f:
        if delimiter is not None:
            text = f.read()
            if not text:
                return []
            parts = text.split(delimiter)
            yield from (
                (line, lazy_file.path) if include_path else line
                for line in [line + delimiter for line in parts[:-1]] + parts[-1:]
            )
        else:
            for line in f:
                yield (line, lazy_file.path) if include_path else line

def attach_path(block, path):
    for p in block:
        yield (p, path)

def decode(block, encoding, errors, line_delimiter):
    # blocksize is not None branch
    text = block.decode(encoding, errors)
    if line_delimiter in [None, "", "\n", "\r", "\r\n"]:
        lines = io.StringIO(text, newline=line_delimiter)
        return list(lines)
    else:
        if not text:
            return []
        parts = text.split(line_delimiter)
        out = [t + line_delimiter for t in parts[:-1]] + (
            parts[-1:] if not text.endswith(line_delimiter) else []
        )
        return out


text:
class CreateMonths < ActiveRecord::Migration
  def change
    create_table :months do |t|

      t.timestamps null: false
    end
  end
end