Insert a value into an array.

@param mutate Should the input array be mutated?
@param at Index to insert at.
@param v Value to insert,
@param arr Array.
328728
function arraySpliceIn(mutate, at, v, arr) {
    var len = arr.length;
    if (mutate) {
        var _i = len;
        while (_i >= at) {
            arr[_i--] = arr[_i];
        }arr[at] = v;
        return arr;
    }
    var i = 0,
        g = 0;
    var out = new Array(len + 1);
    while (i < at) {
        out[g++] = arr[i++];
    }out[at] = v;
    while (i < len) {
        out[++g] = arr[i++];
    }return out;
}
1022708
function push(arr) {
    var args = [];
    for (var _i = 1; _i < arguments.length; _i++) {
        args[_i - 1] = arguments[_i];
    }
    arr = arr.concat(flatten.apply(void 0, args));
    return {
        array: arr,
        val: arr.length
    };
}
698692
public <T> MutateInBuilder arrayAddUnique(String path, T value) {
        asyncBuilder.arrayAddUnique(path, value);
        return this;
    }
193871
@Override
  public void mutate(Mutation mutation) throws IOException {
    handleExceptions();
    addCallback(helper.mutate(mutation), mutation);
  }
262418
public static void insertValue(HashMap m, String var, String val) {
        insertValue(m, var, val, null);
    }
2281
public void addRow(int i, double[] arr, int offset)
    {
        int n = cols;
        for (int j=0;j<n;j++)
        {
            add(i, j, arr[j+offset]);
        }
    }
1261383
public static void insertFromStringArray(final String[] stringValues,
	    final DeviceData deviceDataArgin, final int dataType) throws DevFailed {
	// by default for xdim = 1, send the first value.
	String firsString = "";
	Double numericalValue = Double.NaN;

	if (stringValues.length > 0) {
	    firsString = stringValues[0];
	}

	try {
	    numericalValue = Double.valueOf(firsString);
	} catch (final Exception e) {
	    numericalValue = Double.NaN;
	}

	switch (dataType) {
	case TangoConst.Tango_DEV_SHORT:
	    if (!numericalValue.isNaN()) {
		deviceDataArgin.insert(numericalValue.shortValue());
	    } else {
		Except.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
			+ " is not a Tango_DEV_SHORT",
			"CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
	    }
	    break;
	case TangoConst.Tango_DEV_USHORT:
	    if (!numericalValue.isNaN()) {
		deviceDataArgin.insert_us(numericalValue.shortValue());
	    } else {
		Except.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
			+ " is not a Tango_DEV_USHORT",
			"CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
	    }
	    break;
	case TangoConst.Tango_DEV_CHAR:
	    deviceDataArgin.insert(numericalValue.byteValue());
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
		    "input type Tango_DEV_CHAR not supported",
		    "CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
	    break;
	case TangoConst.Tango_DEV_UCHAR:
	    if (!numericalValue.isNaN()) {
		deviceDataArgin.insert(numericalValue.shortValue());
	    } else {
		Except.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
			+ " is not a Tango_DEV_UCHAR",
			"CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
	    }
	    break;
	case TangoConst.Tango_DEV_LONG:
	    if (!numericalValue.isNaN()) {
		deviceDataArgin.insert(numericalValue.intValue());
	    } else {
		Except.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
			+ " is not a Tango_DEV_LONG",
			"CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
	    }
	    break;
	case TangoConst.Tango_DEV_ULONG:
	    if (!numericalValue.isNaN()) {
		deviceDataArgin.insert_ul(numericalValue.longValue());
	    } else {
		Except.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
			+ " is not a Tango_DEV_ULONG",
			"CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
	    }
	    break;
	case TangoConst.Tango_DEV_LONG64:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
		    "input type Tango_DEV_LONG64 not supported",
		    "CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
	    break;
	case TangoConst.Tango_DEV_ULONG64:
	    if (!numericalValue.isNaN()) {
		deviceDataArgin.insert_u64(numericalValue.longValue());
	    } else {
		Except.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
			+ " is not a Tango_DEV_ULONG64",
			"CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
	    }
	    break;
	case TangoConst.Tango_DEV_INT:
	    if (!numericalValue.isNaN()) {
		deviceDataArgin.insert(numericalValue.intValue());
	    } else {
		Except.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
			+ " is not a Tango_DEV_INT",
			"CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
	    }
	    break;
	case TangoConst.Tango_DEV_FLOAT:
	    if (!numericalValue.isNaN()) {
		deviceDataArgin.insert(numericalValue.floatValue());
	    } else {
		Except.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
			+ " is not a Tango_DEV_FLOAT",
			"CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
	    }
	    break;
	case TangoConst.Tango_DEV_DOUBLE:
	    if (!numericalValue.isNaN()) {
		deviceDataArgin.insert(numericalValue.doubleValue());
	    } else {
		Except.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
			+ " is not a Tango_DEV_DOUBLE",
			"CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
	    }
	    break;
	case TangoConst.Tango_DEV_STRING:
	    deviceDataArgin.insert(firsString);
	    break;
	case TangoConst.Tango_DEV_BOOLEAN:
	    if (!numericalValue.isNaN()) {
		if (numericalValue.doubleValue() == 1) {
		    deviceDataArgin.insert(true);
		} else {
		    deviceDataArgin.insert(false);
		}
	    } else {
		Except.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
			+ " is not a Tango_DEV_BOOLEAN",
			"CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
	    }
	    break;
	case TangoConst.Tango_DEV_STATE:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR", "Tango_DEV_STATE is not supported",
		    "CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
	    break;

	// Array input type
	case TangoConst.Tango_DEVVAR_SHORTARRAY:
	    final short[] shortValues = new short[stringValues.length];
	    for (int i = 0; i < stringValues.length; i++) {
		try {
		    shortValues[i] = Double.valueOf(stringValues[i]).shortValue();
		} catch (final Exception e) {
		    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
			    "input is not a Tango_DEVVAR_SHORTARRAY",
			    "CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
		}
	    }
	    deviceDataArgin.insert(shortValues);
	    break;

	case TangoConst.Tango_DEVVAR_USHORTARRAY:
	    final short[] ushortValues = new short[stringValues.length];
	    for (int i = 0; i < stringValues.length; i++) {
		try {
		    ushortValues[i] = Double.valueOf(stringValues[i]).shortValue();
		} catch (final Exception e) {
		    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
			    "input is not a Tango_DEVVAR_USHORTARRAY",
			    "CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
		}
	    }
	    deviceDataArgin.insert_us(ushortValues);
	    break;
	case TangoConst.Tango_DEVVAR_CHARARRAY:
	    final byte[] byteValues = new byte[stringValues.length];
	    for (int i = 0; i < stringValues.length; i++) {
		try {
		    byteValues[i] = Double.valueOf(stringValues[i]).byteValue();
		} catch (final Exception e) {
		    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
			    "input is not a Tango_DEVVAR_CHARARRAY",
			    "CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
		}
	    }
	    deviceDataArgin.insert(byteValues);
	    break;
	case TangoConst.Tango_DEVVAR_LONGARRAY:
	    final int[] longValues = new int[stringValues.length];
	    for (int i = 0; i < stringValues.length; i++) {
		try {
		    longValues[i] = Double.valueOf(stringValues[i]).intValue();
		} catch (final Exception e) {
		    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
			    "input is not a Tango_DEVVAR_LONGARRAY",
			    "CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
		}
	    }
	    deviceDataArgin.insert(longValues);
	    break;
	case TangoConst.Tango_DEVVAR_ULONGARRAY:
	    final long[] ulongValues = new long[stringValues.length];
	    for (int i = 0; i < stringValues.length; i++) {
		try {
		    ulongValues[i] = Double.valueOf(stringValues[i]).longValue();
		} catch (final Exception e) {
		    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
			    "input is not a Tango_DEVVAR_LONGARRAY",
			    "CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
		}
	    }
	    deviceDataArgin.insert_ul(ulongValues);
	    break;
	case TangoConst.Tango_DEVVAR_LONG64ARRAY:
	    final int[] long64Values = new int[stringValues.length];
	    for (int i = 0; i < stringValues.length; i++) {
		try {
		    long64Values[i] = Double.valueOf(stringValues[i]).intValue();
		} catch (final Exception e) {
		    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
			    "input is not a Tango_DEVVAR_LONGARRAY",
			    "CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
		}
	    }
	    deviceDataArgin.insert(long64Values);
	    break;
	case TangoConst.Tango_DEVVAR_ULONG64ARRAY:
	    final long[] ulong64Values = new long[stringValues.length];
	    for (int i = 0; i < stringValues.length; i++) {
		try {
		    ulong64Values[i] = Double.valueOf(stringValues[i]).longValue();
		} catch (final Exception e) {
		    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
			    "input is not a Tango_DEVVAR_LONGARRAY",
			    "CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
		}
	    }
	    deviceDataArgin.insert_u64(ulong64Values);
	    break;
	case TangoConst.Tango_DEVVAR_FLOATARRAY:
	    final float[] floatValues = new float[stringValues.length];
	    for (int i = 0; i < stringValues.length; i++) {
		try {
		    floatValues[i] = Double.valueOf(stringValues[i]).floatValue();
		} catch (final Exception e) {
		    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
			    "input is not a Tango_DEVVAR_FLOATARRAY",
			    "CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
		}
	    }
	    deviceDataArgin.insert(floatValues);
	    break;
	case TangoConst.Tango_DEVVAR_DOUBLEARRAY:
	    final double[] doubleValues = new double[stringValues.length];
	    for (int i = 0; i < stringValues.length; i++) {
		try {
		    doubleValues[i] = Double.valueOf(stringValues[i]).doubleValue();
		} catch (final Exception e) {
		    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
			    "input is not a Tango_DEVVAR_DOUBLEARRAY",
			    "CommandHelper.insertFromStringArray(String[] values,deviceDataArgin)");
		}
	    }
	    deviceDataArgin.insert(doubleValues);
	    break;
	case TangoConst.Tango_DEVVAR_STRINGARRAY:
	    deviceDataArgin.insert(stringValues);
	    break;

	default:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR", "input type "
		    + deviceDataArgin.getType() + " not supported",
		    "CommandHelper.insertFromStringArray(String[] value,deviceDataArgin)");
	    break;
	}
    }
674207
public <T> MutateInBuilder arrayInsert(String path, T value) {
        asyncBuilder.arrayInsert(path, value);
        return this;
    }
594701
protected void insertVarOrder(int x) {
    if (!this.orderHeap.inHeap(x) && this.vars.get(x).decision())
      this.orderHeap.insert(x);
  }
314248
protected final void putValue(final Entry e, final V _value) {
    if (!isUpdateTimeNeeded()) {
      insertOrUpdateAndCalculateExpiry(e, _value, 0, 0, 0 , INSERT_STAT_PUT);
    } else {
      long t = clock.millis();
      insertOrUpdateAndCalculateExpiry(e, _value, t, t, t, INSERT_STAT_PUT);
    }
  }
1220736
public static void fill( DMatrix4 a , double v  ) {
        a.a1 = v;
        a.a2 = v;
        a.a3 = v;
        a.a4 = v;
    }
258428
public void insert(final DevEncoded argIn) {
		attributeValue_5.data_format = AttrDataFormat.FMT_UNKNOWN;
		attributeValue_5.err_list = new DevError[0]; // ?? Only for DevEncoded, else
		// (NullPointerException)
		attributeValue_5.w_dim.dim_x = 1;
		attributeValue_5.w_dim.dim_y = 0;
		attributeValue_5.value.encoded_att_value(new DevEncoded[] { argIn });
    }
1151614
public void insert(final String[] argin) {
	values = new String[argin.length];
	System.arraycopy(argin, 0, values, 0, argin.length);
	is_empty_val = false;
    }
120495
public void insert(final DevState[] argIn) {
		attributeValue_5.data_format = AttrDataFormat.FMT_UNKNOWN;
		attributeValue_5.w_dim.dim_x = argIn.length;
		attributeValue_5.w_dim.dim_y = 0;
		if (use_union) {
	    	attributeValue_5.value.state_att_value(argIn);
		} else {
	    	deviceAttribute_3.insert(argIn);
		}
    }
1021010
@Override
  public <N,V> Mutator<K> addInsertion(K key, String cf, HColumn<N,V> c) {
    getPendingMutations().addInsertion(key, Arrays.asList(cf),
        ((HColumnImpl<N, V>) c).toThrift());
    return this;
  }
661148
public void insert_ul(final int[] argin) {
	attrval.r_dim.dim_x = argin.length;
	attrval.r_dim.dim_y = 0;
	DevVarULongArrayHelper.insert(attrval.value, argin);
    }
112255
public static void putVarInt(int v, ByteBuffer sink) {
    while (true) {
      int bits = v & 0x7f;
      v >>>= 7;
      if (v == 0) {
        sink.put((byte) bits);
        return;
      }
      sink.put((byte) (bits | 0x80));
    }
  }