Generate an array of integers.

@param start First integer
@param end Last integer (exclusive!)
@return Array of integers of length end-start
178997
public static int[] sequence(int start, int end) {
    if(start >= end) {
      return EMPTY_INTS;
    }
    int[] ret = new int[end - start];
    for(int j = 0; start < end; start++, j++) {
      ret[j] = start;
    }
    return ret;
  }
208495
public static function createYears($start, $end)
    {
        $result = array();

        for ($i = $start; $i < $end + 1; $i++) {
            $result[$i] = $i;
        }

        return $result;
    }
258125
public static long factorial(long start, long end) {
		if (start < end) {
			return 0L;
		}
		if (start == end) {
			return 1L;
		}
		return start * factorial(start - 1, end);
	}
80784
function _arraySlice(start, end, arr) {
    var len = arr.length;
    var range = [];
    start = idx(len, start);
    end = idx(len, end, len);
    while (start < end) {
        range.push(arr[start++]);
    }
    return range;
    function idx(len, pos, end) {
        if (end === void 0) { end = undefined; }
        if (pos == null) {
            pos = end || 0;
        }
        else if (pos < 0) {
            pos = Math.max(len + pos, 0);
        }
        else {
            pos = Math.min(pos, len);
        }
        return pos;
    }
}
226232
public static <T> List<T> sub(List<T> list, int start, int end) {
		return sub(list, start, end, 1);
	}
1241305
function arraySlice (array, startIndex, endIndex) {
  var result = []
  if (array) {
    for (startIndex = startIndex || 0, endIndex = endIndex || array.length; startIndex < endIndex; startIndex++) {
      result.push(array[startIndex])
    }
  }
  return result
}
702759
public function readLinesBetween(int $start, int $end) : array
    {
        $content = file($this->_path);
        $lines   = [];

        for($i = $start; $i < $end; $i++) {
            if(isset($content[$i])) {
                $lines[] = $content[$i];
            }
        }

        return $lines;
    }
176817
public static RubyRange<String> range(String start, String end) {
    return new RubyRange<>(StringSuccessor.getInstance(), start, end,
        Interval.CLOSED);
  }
771883
public char[] toCharArray(int start, int end) {
        int length = end - start;
        if (length == 0) {
            return EmptyArrays.EMPTY_CHARS;
        }

        if (isOutOfBounds(start, length, length())) {
            throw new IndexOutOfBoundsException("expected: " + "0 <= start(" + start + ") <= srcIdx + length("
                            + length + ") <= srcLen(" + length() + ')');
        }

        final char[] buffer = new char[length];
        for (int i = 0, j = start + arrayOffset(); i < length; i++, j++) {
            buffer[i] = b2c(value[j]);
        }
        return buffer;
    }
781735
public static Integer[] createAndInitializeArray(int size, Integer start) {
		Integer[] result = new Integer[size];
		for (int i = 0; i < result.length; i++) {
			result[i] = start++;
		}
		return result;
	}
471531
public static RubyRange<Double> range(double start, double end) {
    String startStr = String.valueOf(start);
    String endStr = String.valueOf(end);
    int startPrecision = startStr.length() - startStr.lastIndexOf('.') - 1;
    int endPrecision = endStr.length() - endStr.lastIndexOf('.') - 1;
    return new RubyRange<>(
        new DoubleSuccessor(Math.max(startPrecision, endPrecision)), start, end,
        Interval.CLOSED);
  }
977071
public static INDArrayIndex[] createFromStartAndEnd(INDArray start, INDArray end) {
        if (start.length() != end.length())
            throw new IllegalArgumentException("Start length must be equal to end length");
        else {
            if (start.length() > Integer.MAX_VALUE)
                throw new ND4JIllegalStateException("Can't proceed with INDArray with length > Integer.MAX_VALUE");

            INDArrayIndex[] indexes = new INDArrayIndex[(int) start.length()];
            for (int i = 0; i < indexes.length; i++) {
                indexes[i] = NDArrayIndex.interval(start.getInt(i), end.getInt(i));
            }
            return indexes;
        }
    }
154834
function(start, end){
        //subQueue to Array
        if(start >= 0 && start < end && end <= this._length) {
            var result = [],
                current = this._head,
                i = 0;
            while(i++ < start) {
                current = current.next;
            }

            while(start++ < end) {
                var value = current.data.value;
                if(value != null) {
                    result.push(current.data.value);
                }
                current = current.next;
            }

            return result;
        }

        var result = [],
            current = this._head;
        
        while(current){
            result.push(current.data);
            current = current.next;
        }
        
        return result;
    }
625153
public static ValueArray createArray(int begin, int end, int step) {
        if (end < begin) {
            throw new IllegalArgumentException("End must be greater or equal to begin");
        }
        int nbClasses = (int) ((end - begin) / step);
        ValueInt[] getArray = new ValueInt[nbClasses];
        for (int i = 0; i < nbClasses; i++) {
            getArray[i] = ValueInt.get(i * step + begin);

        }        
        return ValueArray.get(getArray);
    }
1058079
public static Integer[] generateBySet(int begin, int end, int size) {
		if (begin > end) {
			int temp = begin;
			begin = end;
			end = temp;
		}
		// 加入逻辑判断，确保begin<end并且size不能大于该表示范围
		if ((end - begin) < size) {
			throw new UtilException("Size is larger than range between begin and end!");
		}

		Random ran = new Random();
		Set<Integer> set = new HashSet<Integer>();
		while (set.size() < size) {
			set.add(begin + ran.nextInt(end - begin));
		}

		Integer[] ranArr = set.toArray(new Integer[size]);
		return ranArr;
	}
940430
public int[] toIntegerArray() {
    int[] copy = new int[size];
    for (int i = 0; i < size; i++) {
      copy[i] = elements[i];
    }
    return copy;
  }
1351585
function slice(start, end) {
    var index = -1,
        object = Object(this),
        length = object.length >>> 0,
        result = [];

    start = toInteger(start);
    start = start < 0 ? max(length + start, 0) : min(start, length);
    start--;
    end = end == null ? length : toInteger(end);
    end = end < 0 ? max(length + end, 0) : min(end, length);

    while ((++index, ++start) < end) {
      if (start in object) {
        result[index] = object[start];
      }
    }
    return result;
  }