Creates a new GridLines instance.

@param data data block
@param offset offset into data block
@return new GridLines instance
975423
private GridLines getGridLines(byte[] data, int offset)
   {
      Color normalLineColor = ColorType.getInstance(data[offset]).getColor();
      LineStyle normalLineStyle = LineStyle.getInstance(data[offset + 3]);
      int intervalNumber = data[offset + 4];
      LineStyle intervalLineStyle = LineStyle.getInstance(data[offset + 5]);
      Color intervalLineColor = ColorType.getInstance(data[offset + 6]).getColor();
      return new GridLines(normalLineColor, normalLineStyle, intervalNumber, intervalLineStyle, intervalLineColor);
   }
1126110
public static Pipe newPipe(byte[] data, int offset, int length, boolean numeric) throws IOException
    {
        ArrayBufferInput in = new ArrayBufferInput(data, offset, length);
        return newPipe(in, numeric);
    }
507087
public GroupOptions setOffset(@Nullable Integer offset) {

		this.offset = offset == null ? null : Math.max(0, offset);
		return this;
	}
1160294
private static Collection<Polygon> polygonWithLineSplitter(Polygon polygon, LineString lineString) throws SQLException {
        Collection<Polygon> polygons = splitPolygonizer(polygon, lineString);
        if (polygons != null && polygons.size() > 1) {
            List<Polygon> pols = new ArrayList<Polygon>();
            for (Polygon pol : polygons) {
                if (polygon.contains(pol.getInteriorPoint())) {
                    pols.add(pol);
                }
            }
            return pols;
        }
        return null;
    }
55474
function(tag, line_number, offset) {
  while (!canContain(this.tip.t, tag)) {
    this.finalize(this.tip, line_number);
  }

  var column_number = offset + 1; // offset 0 = column 1
  var newBlock = makeBlock(tag, line_number, column_number);
  this.tip.children.push(newBlock);
  newBlock.parent = this.tip;
  this.tip = newBlock;
  return newBlock;
}
538809
public static PlotCanvas plot(String id, double[][][] data) {
        double[] lowerBound = {data[0][0][0], data[0][0][1]};
        double[] upperBound = {data[0][0][0], data[0][0][1]};
        for (int i = 0; i < data.length; i++) {
            for (int j = 0; j < data[i].length; j++) {
                if (data[i][j][0] < lowerBound[0]) {
                    lowerBound[0] = data[i][j][0];
                }
                if (data[i][j][0] > upperBound[0]) {
                    upperBound[0] = data[i][j][0];
                }
                if (data[i][j][1] < lowerBound[1]) {
                    lowerBound[1] = data[i][j][1];
                }
                if (data[i][j][1] > upperBound[1]) {
                    upperBound[1] = data[i][j][1];
                }
            }
        }

        PlotCanvas canvas = new PlotCanvas(lowerBound, upperBound);

        Grid grid = new Grid(data);
        if (id != null) grid.setID(id);
        canvas.add(grid);

        return canvas;
    }
1129792
private WRow createRow(final int hgap, final int[] colWidths) {
		WRow row = new WRow(hgap);

		for (int i = 0; i < colWidths.length; i++) {
			WColumn col = new WColumn(colWidths[i]);
			WPanel box = new WPanel(WPanel.Type.BOX);
			box.add(new WText(colWidths[i] + "%"));
			col.add(box);
			row.add(col);
		}

		return row;
	}
552869
public void newDataReady(DataType data) {
		ArrayList<Runnable> list;
		synchronized (this) {
			if (end) throw new IllegalStateException("method endOfData already called, method newDataReady is not allowed anymore");
			waitingData.addLast(data);
			list = listeners;
			listeners = null;
		}
		if (list != null) {
			for (Runnable listener : list) listener.run();
		}
		// notify after listeners
		synchronized (this) {
			this.notify();
		}
	}
1193463
public static Pipe newPipe(byte[] data, int offset, int length) throws IOException
    {
        return newPipe(new ByteArrayInputStream(data, offset, length));
    }
1287573
@Override
    public DataBuffer createHalf(long offset, byte[] data, boolean copy) {
        return new CudaHalfDataBuffer(ArrayUtil.toFloatArray(data), copy, offset);
    }
235272
@Override
    public void append(long streamSegmentId, long offset, byte[] data) throws StreamSegmentNotExistsException {
        Exceptions.checkNotClosed(this.closed.get(), this);
        log.debug("{}: append (StreamSegmentId = {}, Offset = {}, DataLength = {}).", this.traceObjectId, streamSegmentId, offset, data.length);

        // Append the data to the StreamSegment Index. It performs further validation with respect to offsets, etc.
        StreamSegmentReadIndex index = getOrCreateIndex(streamSegmentId);
        Exceptions.checkArgument(!index.isMerged(), "streamSegmentId", "StreamSegment is merged. Cannot append to it anymore.");
        index.append(offset, data);
    }
301010
protected Iterable<GridCell<P>> getGridCellsOn(Rectangle2afp<?, ?, ?, ?, ?, ?> bounds, boolean createCells) {
		if (bounds.intersects(this.bounds)) {
			final int c1 = getColumnFor(bounds.getMinX());
			final int r1 = getRowFor(bounds.getMinY());
			final int c2 = getColumnFor(bounds.getMaxX());
			final int r2 = getRowFor(bounds.getMaxY());
			return new CellIterable(r1, c1, r2, c2, createCells);
		}
		return Collections.emptyList();
	}
491280
@Override
    public INDArray create(int[] shape, int[] stride, long offset) {
        DataBuffer buffer = Nd4j.createBuffer(ArrayUtil.prodLong(shape));
        return create(buffer, shape, stride, offset);
    }
1099370
@Override
    public DataBuffer createHalf(long offset, double[] data, boolean copy) {
        return new CudaHalfDataBuffer(data, copy, offset);
    }
250913
public static String dump(final int displayOffset, final byte[] data, final int offset, final int len)
   {
      StringBuilder sb = new StringBuilder();
      Formatter formatter = new Formatter(sb);
      StringBuilder ascii = new StringBuilder();

      int dataNdx = offset;
      final int maxDataNdx = offset + len;
      final int lines = (len + 16) / 16;
      for (int i = 0; i < lines; i++) {
         ascii.append(" |");
         formatter.format("%08x  ", displayOffset + (i * 16));

         for (int j = 0; j < 16; j++) {
            if (dataNdx < maxDataNdx) {
               byte b = data[dataNdx++];
               formatter.format("%02x ", b);
               ascii.append((b > MIN_VISIBLE && b < MAX_VISIBLE) ? (char) b : ' ');
            }
            else {
               sb.append("   ");
            }

            if (j == 7) {
               sb.append(' ');
            }
         }

         ascii.append('|');
         sb.append(ascii).append('\n');
         ascii.setLength(0);
      }

      formatter.close();
      return sb.toString();
   }
810944
public SimpleArrayGrid view(int offset, int width)
    {
        return new SimpleArrayGrid(array, width, height, this.offset + offset, length, boxed);
    }
150210
function(offset) {
			var providerInfoArray = this._providers;
			var textView = this.textView;
			var sel = textView.getSelection();
			var model = textView.getModel(), mapOffset = offset;
			if (model.getBaseModel) {
				mapOffset = model.mapOffset(mapOffset);
				sel.start = model.mapOffset(sel.start);
				sel.end = model.mapOffset(sel.end);
				model = model.getBaseModel();
			}
			var line = model.getLine(model.getLineAtOffset(mapOffset));
			var index = 0;
			while (index < line.length && /\s/.test(line.charAt(index))) {
				index++;
			}
			var indentation = line.substring(0, index);
			var options = textView.getOptions("tabSize", "expandTab"); //$NON-NLS-1$ //$NON-NLS-0$
			var tab = options.expandTab ? new Array(options.tabSize + 1).join(" ") : "\t"; //$NON-NLS-1$ //$NON-NLS-0$
			var lineDelimiter = model.getLineDelimiter();
			var _self = this;
			var promises = providerInfoArray.map(function(providerInfo) {
				var provider = providerInfo.provider;
				var computePrefixFunc = provider.computePrefix;
				var ecProvider;
				var editorContext;
				var proposals;
				var func;
				var promise;
				var params;
				if(typeof providerInfo.autoApply === 'boolean') {
					_self._autoApply = providerInfo.autoApply;
				}
				if (computePrefixFunc) {
					ecProvider = _self.editorContextProvider;
					editorContext = ecProvider.getEditorContext();
					var result = computePrefixFunc.apply(provider, [editorContext, mapOffset]);
					return result.then(function(prefix) {
						params = {
							line: line,
							offset: mapOffset,
							prefix: prefix,
							selection: sel,
							delimiter: lineDelimiter,
							tab: tab,
							indentation: indentation
						};
						try {
							if ((func = provider.computeContentAssist)) {
								params = objects.mixin(params, ecProvider.getOptions());
								promise = func.apply(provider, [editorContext, params]);
							} else if ((func = provider.getProposals || provider.computeProposals)) {
								// old API
								promise = func.apply(provider, [model.getText(), mapOffset, params]);
							}
							proposals = _self.progress ? _self.progress.progress(promise, "Generating content assist proposal") : promise; //$NON-NLS-0$
						} catch (e) {
							return new Deferred().reject(e);
						}
						return Deferred.when(proposals);
					},
					function(err) {
						return new Deferred().reject(err);
					});
				}
				// no computePrefix function is defined for the provider. Use the default prefix
				params = {
					line: line,
					offset: mapOffset,
					prefix: model.getText(_self.getPrefixStart(model, mapOffset), mapOffset),
					selection: sel,
					delimiter: lineDelimiter,
					tab: tab,
					indentation: indentation
				};
				try {
					if (providerInfo.lspServer) {
						// completion comes from the lsp service
						ecProvider = _self.editorContextProvider;
						editorContext = ecProvider.getEditorContext();
						params = objects.mixin(params, ecProvider.getOptions());
						promise = Utils.computeContentAssist(provider, editorContext, params);
					} else if ((func = provider.computeContentAssist)) {
						ecProvider = _self.editorContextProvider;
						editorContext = ecProvider.getEditorContext();
						params = objects.mixin(params, ecProvider.getOptions());
						promise = func.apply(provider, [editorContext, params]);
					} else if ((func = provider.getProposals || provider.computeProposals)) {
						// old API
						promise = func.apply(provider, [model.getText(), mapOffset, params]);
					}
					proposals = _self.progress ? _self.progress.progress(promise, "Generating content assist proposal") : promise; //$NON-NLS-0$
				} catch (e) {
					return new Deferred().reject(e);
				}
				return Deferred.when(proposals);
			});
			
			// TODO should we allow error to propagate instead of handling here?
			var allPromises = Deferred.all(promises, this.handleError);
			
			if (this.pageMessage){
				allPromises = Deferred.when(allPromises, function(proposals){
					_self.pageMessage.close();
					var foundProposal = false;
					if (proposals && proposals.length > 0){
						for (var i=0; i<proposals.length; i++) {
							if (Array.isArray(proposals[i]) && proposals[i].length > 0){
								foundProposal = true;
								break;
							}
						}
					}
					if (!foundProposal){
						_self.pageMessage.setErrorMessage(messages["noProposals"]);
					}
					return proposals;
				});
				this.pageMessage.showWhile(allPromises, messages["computingProposals"]);
			}
			return allPromises;
		}