_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q14900 | PhysicsUtil.acceleration | train | @Pure
@Inline(value = "PhysicsUtil.getPhysicsEngine().acceleration(($1), ($2), ($3))",
imported = {PhysicsUtil.class})
public static double acceleration(
double previousSpeed,
double currentSpeed,
double dt) {
return engine.acceleration(previousSpeed, currentSpeed, dt);
} | java | {
"resource": ""
} |
q14901 | ScreenSizeExtensions.computeDialogPositions | train | public static List<Point> computeDialogPositions(final int dialogWidth, final int dialogHeight)
{
List<Point> dialogPosition = null;
final int windowBesides = ScreenSizeExtensions.getScreenWidth() / dialogWidth;
final int windowBelow = ScreenSizeExtensions.getScreenHeight() / dialogHeight;
final int listSize =... | java | {
"resource": ""
} |
q14902 | ScreenSizeExtensions.getScreenDevices | train | public static GraphicsDevice[] getScreenDevices()
{
final GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
final GraphicsDevice[] gs = ge.getScreenDevices();
return gs;
} | java | {
"resource": ""
} |
q14903 | ScreenSizeExtensions.getScreenDimension | train | public static Dimension getScreenDimension(Component component)
{
int screenID = getScreenID(component);
Dimension dimension = new Dimension(0, 0);
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsConfiguration defaultConfiguration = ge.getScreenDevices()[screenID]
.getDe... | java | {
"resource": ""
} |
q14904 | ScreenSizeExtensions.getScreenID | train | public static int getScreenID(Component component)
{
int screenID;
final AtomicInteger counter = new AtomicInteger(-1);
Stream.of(getScreenDevices()).forEach(graphicsDevice -> {
GraphicsConfiguration gc = graphicsDevice.getDefaultConfiguration();
Rectangle rectangle = gc.getBounds();
if (rectangle.cont... | java | {
"resource": ""
} |
q14905 | Grid.getCellBounds | train | @Pure
public Rectangle2d getCellBounds(int row, int column) {
final double cellWidth = getCellWidth();
final double cellHeight = getCellHeight();
final double x = this.bounds.getMinX() + cellWidth * column;
final double y = this.bounds.getMinY() + cellHeight * row;
return new Rectangle2d(x, y, cellWidth, cel... | java | {
"resource": ""
} |
q14906 | Grid.createCellAt | train | public GridCell<P> createCellAt(int row, int column) {
GridCell<P> cell = this.cells[row][column];
if (cell == null) {
cell = new GridCell<>(row, column, getCellBounds(row, column));
this.cells[row][column] = cell;
++this.cellCount;
}
return cell;
} | java | {
"resource": ""
} |
q14907 | Grid.removeCellAt | train | public GridCell<P> removeCellAt(int row, int column) {
final GridCell<P> cell = this.cells[row][column];
if (cell != null) {
this.cells[row][column] = null;
--this.cellCount;
for (final P element : cell) {
removeElement(element);
}
}
return cell;
} | java | {
"resource": ""
} |
q14908 | Grid.addElement | train | public boolean addElement(P element) {
boolean changed = false;
if (element != null) {
final GridCellElement<P> gridElement = new GridCellElement<>(element);
for (final GridCell<P> cell : getGridCellsOn(element.getGeoLocation().toBounds2D(), true)) {
if (cell.addElement(gridElement)) {
changed = true... | java | {
"resource": ""
} |
q14909 | Grid.removeElement | train | public boolean removeElement(P element) {
boolean changed = false;
if (element != null) {
GridCellElement<P> gridElement;
for (final GridCell<P> cell : getGridCellsOn(element.getGeoLocation().toBounds2D())) {
gridElement = cell.removeElement(element);
if (gridElement != null) {
if (cell.isEmpty()... | java | {
"resource": ""
} |
q14910 | Grid.getColumnFor | train | @Pure
public int getColumnFor(double x) {
final double xx = x - this.bounds.getMinX();
if (xx >= 0.) {
final int idx = (int) (xx / getCellWidth());
assert idx >= 0;
if (idx < getColumnCount()) {
return idx;
}
return getColumnCount() - 1;
}
return 0;
} | java | {
"resource": ""
} |
q14911 | Grid.getRowFor | train | @Pure
public int getRowFor(double y) {
final double yy = y - this.bounds.getMinY();
if (yy >= 0.) {
final int idx = (int) (yy / getCellHeight());
assert idx >= 0;
if (idx < getRowCount()) {
return idx;
}
return getRowCount() - 1;
}
return 0;
} | java | {
"resource": ""
} |
q14912 | Grid.getGridCellsAround | train | @Pure
public AroundCellIterable<P> getGridCellsAround(Point2D<?, ?> position, double maximalDistance) {
final int column = getColumnFor(position.getX());
final int row = getRowFor(position.getY());
return new AroundIterable(row, column, position, maximalDistance);
} | java | {
"resource": ""
} |
q14913 | Grid.iterator | train | @Pure
public Iterator<P> iterator(Rectangle2afp<?, ?, ?, ?, ?, ?> bounds) {
if (this.bounds.intersects(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... | java | {
"resource": ""
} |
q14914 | Grid.getElementAt | train | @Pure
public P getElementAt(int index) {
if (index >= 0) {
int idx = 0;
int eIdx;
for (final GridCell<P> cell : getGridCells()) {
eIdx = idx + cell.getReferenceElementCount();
if (index < eIdx) {
try {
return cell.getElementAt(index - idx);
} catch (IndexOutOfBoundsException exceptio... | java | {
"resource": ""
} |
q14915 | NioTCPSession.blockingWrite | train | protected final Object blockingWrite(SelectableChannel channel,
WriteMessage message, IoBuffer writeBuffer) throws IOException,
ClosedChannelException {
SelectionKey tmpKey = null;
Selector writeSelector = null;
int attempts = 0;
int bytesProduced = 0;
try {
while (writeBuffer.hasRemaining())... | java | {
"resource": ""
} |
q14916 | DssatXFileOutput.setSecDataArr | train | private int setSecDataArr(HashMap m, ArrayList arr, boolean isEvent) {
int idx = setSecDataArr(m, arr);
if (idx != 0 && isEvent && getValueOr(m, "date", "").equals("")) {
return -1;
} else {
return idx;
}
} | java | {
"resource": ""
} |
q14917 | DssatXFileOutput.isPlotInfoExist | train | private boolean isPlotInfoExist(Map expData) {
String[] plotIds = {"plta", "pltr#", "pltln", "pldr", "pltsp", "pllay", "pltha", "plth#", "plthl", "plthm"};
for (String plotId : plotIds) {
if (!getValueOr(expData, plotId, "").equals("")) {
return true;
}
}... | java | {
"resource": ""
} |
q14918 | DssatXFileOutput.isSoilAnalysisExist | train | private boolean isSoilAnalysisExist(ArrayList<HashMap> icSubArr) {
for (HashMap icSubData : icSubArr) {
if (!getValueOr(icSubData, "slsc", "").equals("")) {
return true;
}
}
return false;
} | java | {
"resource": ""
} |
q14919 | DssatXFileOutput.getDataList | train | private ArrayList<HashMap> getDataList(Map expData, String blockName, String dataListName) {
HashMap dataBlock = getObjectOr(expData, blockName, new HashMap());
return getObjectOr(dataBlock, dataListName, new ArrayList<HashMap>());
} | java | {
"resource": ""
} |
q14920 | ProvenancedConfusionMatrix.entries | train | public Set<CellFiller> entries() {
return FluentIterable.from(table.cellSet())
.transformAndConcat(CollectionUtils.<List<CellFiller>>TableCellValue())
.toSet();
} | java | {
"resource": ""
} |
q14921 | ProvenancedConfusionMatrix.breakdown | train | public <SignatureType> BrokenDownProvenancedConfusionMatrix<SignatureType, CellFiller>
breakdown(Function<? super CellFiller, SignatureType> signatureFunction,
Ordering<SignatureType> keyOrdering) {
final Map<SignatureType, Builder<CellFiller>> ret = Maps.newHashMap();
// a more efficient implementatio... | java | {
"resource": ""
} |
q14922 | FileType.getContentType | train | public static String getContentType(String filename) {
final ContentFileTypeMap map = ensureContentTypeManager();
return map.getContentType(filename);
} | java | {
"resource": ""
} |
q14923 | FileType.getFormatVersion | train | public static String getFormatVersion(File filename) {
final ContentFileTypeMap map = ensureContentTypeManager();
return map.getFormatVersion(filename);
} | java | {
"resource": ""
} |
q14924 | FileType.isImage | train | public static boolean isImage(String mime) {
try {
final MimeType type = new MimeType(mime);
return IMAGE.equalsIgnoreCase(type.getPrimaryType());
} catch (MimeTypeParseException e) {
//
}
return false;
} | java | {
"resource": ""
} |
q14925 | FileType.isContentType | train | public static boolean isContentType(URL filename, String desiredMimeType) {
final ContentFileTypeMap map = ensureContentTypeManager();
return map.isContentType(filename, desiredMimeType);
} | java | {
"resource": ""
} |
q14926 | BotmReflectionUtil.getPublicMethod | train | public static Method getPublicMethod(Class<?> clazz, String methodName, Class<?>[] argTypes) {
assertObjectNotNull("clazz", clazz);
assertStringNotNullAndNotTrimmedEmpty("methodName", methodName);
return findMethod(clazz, methodName, argTypes, VisibilityType.PUBLIC, false);
} | java | {
"resource": ""
} |
q14927 | BotmReflectionUtil.invoke | train | public static Object invoke(Method method, Object target, Object[] args) {
assertObjectNotNull("method", method);
try {
return method.invoke(target, args);
} catch (InvocationTargetException e) {
Throwable t = e.getCause();
if (t instanceof RuntimeException) {... | java | {
"resource": ""
} |
q14928 | BotmReflectionUtil.assertStringNotNullAndNotTrimmedEmpty | train | public static void assertStringNotNullAndNotTrimmedEmpty(String variableName, String value) {
assertObjectNotNull("variableName", variableName);
assertObjectNotNull("value", value);
if (value.trim().length() == 0) {
String msg = "The value should not be empty: variableName=" + variab... | java | {
"resource": ""
} |
q14929 | XMLUtils.nextSibling | train | public static Optional<Element> nextSibling(final Element element, final String name) {
for (Node childNode = element.getNextSibling(); childNode != null;
childNode = childNode.getNextSibling()) {
if (childNode instanceof Element && ((Element) childNode).getTagName()
.equalsIgnoreCase(name)... | java | {
"resource": ""
} |
q14930 | XMLUtils.prettyPrintElementLocally | train | public static String prettyPrintElementLocally(Element e) {
final ImmutableMap.Builder<String, String> ret = ImmutableMap.builder();
final NamedNodeMap attributes = e.getAttributes();
for (int i = 0; i < attributes.getLength(); ++i) {
final Node attr = attributes.item(i);
ret.put(attr.getNodeNam... | java | {
"resource": ""
} |
q14931 | Point1d.convert | train | public static Point1d convert(Tuple1d<?> tuple) {
if (tuple instanceof Point1d) {
return (Point1d) tuple;
}
return new Point1d(tuple.getSegment(), tuple.getX(), tuple.getY());
} | java | {
"resource": ""
} |
q14932 | GISCoordinates.EL2_WSG84 | train | @Pure
public static GeodesicPosition EL2_WSG84(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2E_N,
LAMBERT_2E_C,
LAMBERT_2E_XS,
LAMBERT_2E_YS);
return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY());
} | java | {
"resource": ""
} |
q14933 | GISCoordinates.EL2_L2 | train | @Pure
public static Point2d EL2_L2(double x, double y) {
return new Point2d(x, y + (LAMBERT_2E_YS - LAMBERT_2_YS));
} | java | {
"resource": ""
} |
q14934 | GISCoordinates.EL2_L3 | train | @Pure
public static Point2d EL2_L3(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2E_N,
LAMBERT_2E_C,
LAMBERT_2E_XS,
LAMBERT_2E_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_... | java | {
"resource": ""
} |
q14935 | GISCoordinates.L1_WSG84 | train | @Pure
public static GeodesicPosition L1_WSG84(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,
LAMBERT_1_YS);
return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY());
} | java | {
"resource": ""
} |
q14936 | GISCoordinates.L1_EL2 | train | @Pure
public static Point2d L1_EL2(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,
LAMBERT_1_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_2E_N,
LAMBERT_2E_C,
LAMBERT_2E... | java | {
"resource": ""
} |
q14937 | GISCoordinates.L1_L3 | train | @Pure
public static Point2d L1_L3(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,
LAMBERT_1_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_3_XS,... | java | {
"resource": ""
} |
q14938 | GISCoordinates.L1_L4 | train | @Pure
public static Point2d L1_L4(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,
LAMBERT_1_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_4_XS,... | java | {
"resource": ""
} |
q14939 | GISCoordinates.L2_WSG84 | train | @Pure
public static GeodesicPosition L2_WSG84(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2_N,
LAMBERT_2_C,
LAMBERT_2_XS,
LAMBERT_2_YS);
return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY());
} | java | {
"resource": ""
} |
q14940 | GISCoordinates.L2_EL2 | train | @Pure
public static Point2d L2_EL2(double x, double y) {
return new Point2d(x, y - (LAMBERT_2E_YS - LAMBERT_2_YS));
} | java | {
"resource": ""
} |
q14941 | GISCoordinates.L2_L1 | train | @Pure
public static Point2d L2_L1(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2_N,
LAMBERT_2_C,
LAMBERT_2_XS,
LAMBERT_2_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,... | java | {
"resource": ""
} |
q14942 | GISCoordinates.L2_L3 | train | @Pure
public static Point2d L2_L3(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2_N,
LAMBERT_2_C,
LAMBERT_2_XS,
LAMBERT_2_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_3_XS,... | java | {
"resource": ""
} |
q14943 | GISCoordinates.L2_L4 | train | @Pure
public static Point2d L2_L4(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2_N,
LAMBERT_2_C,
LAMBERT_2_XS,
LAMBERT_2_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_4_XS,... | java | {
"resource": ""
} |
q14944 | GISCoordinates.L2_L93 | train | @Pure
public static Point2d L2_L93(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2_N,
LAMBERT_2_C,
LAMBERT_2_XS,
LAMBERT_2_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93... | java | {
"resource": ""
} |
q14945 | GISCoordinates.L3_WSG84 | train | @Pure
public static GeodesicPosition L3_WSG84(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_3_XS,
LAMBERT_3_YS);
return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY());
} | java | {
"resource": ""
} |
q14946 | GISCoordinates.L3_L4 | train | @Pure
public static Point2d L3_L4(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_3_XS,
LAMBERT_3_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_4_XS,... | java | {
"resource": ""
} |
q14947 | GISCoordinates.L3_L93 | train | @Pure
public static Point2d L3_L93(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_3_XS,
LAMBERT_3_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93... | java | {
"resource": ""
} |
q14948 | GISCoordinates.L4_WSG84 | train | @Pure
public static GeodesicPosition L4_WSG84(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_4_XS,
LAMBERT_4_YS);
return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY());
} | java | {
"resource": ""
} |
q14949 | GISCoordinates.L4_EL2 | train | @Pure
public static Point2d L4_EL2(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_4_XS,
LAMBERT_4_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_2E_N,
LAMBERT_2E_C,
LAMBERT_2E... | java | {
"resource": ""
} |
q14950 | GISCoordinates.L93_WSG84 | train | @Pure
public static GeodesicPosition L93_WSG84(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93_XS,
LAMBERT_93_YS);
return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY());
} | java | {
"resource": ""
} |
q14951 | GISCoordinates.L93_EL2 | train | @Pure
public static Point2d L93_EL2(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93_XS,
LAMBERT_93_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_2E_N,
LAMBERT_2E_C,
LAMBE... | java | {
"resource": ""
} |
q14952 | GISCoordinates.L93_L1 | train | @Pure
public static Point2d L93_L1(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93_XS,
LAMBERT_93_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_... | java | {
"resource": ""
} |
q14953 | GISCoordinates.L93_L4 | train | @Pure
public static Point2d L93_L4(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93_XS,
LAMBERT_93_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_... | java | {
"resource": ""
} |
q14954 | GISCoordinates.NTFLambert_NTFLambdaPhi | train | @SuppressWarnings({"checkstyle:parametername", "checkstyle:localfinalvariablename"})
private static Point2d NTFLambert_NTFLambdaPhi(double x, double y, double n, double c, double Xs, double Ys) {
// Several constants from the IGN specifications
//Longitude in radians of Paris (2°20'14.025" E) from Greenwich
fina... | java | {
"resource": ""
} |
q14955 | GISCoordinates.NTFLambdaPhi_WSG84 | train | @SuppressWarnings({"checkstyle:magicnumber", "checkstyle:localfinalvariablename", "checkstyle:localvariablename"})
private static GeodesicPosition NTFLambdaPhi_WSG84(double lambda_ntf, double phi_ntf) {
// Geographical coordinate NTF (lamda_ntf,phi_ntf)
// -> Cartesian coordinate NTF (x_ntf,y_ntf,z_ntf)
// ALG00... | java | {
"resource": ""
} |
q14956 | GISCoordinates.WSG84_EL2 | train | @Pure
public static Point2d WSG84_EL2(double lambda, double phi) {
final Point2d ntfLambdaPhi = WSG84_NTFLamdaPhi(lambda, phi);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_2E_N,
LAMBERT_2E_C,
LAMBERT_2E_XS,
LAMBERT_2E_YS);
} | java | {
"resource": ""
} |
q14957 | GISCoordinates.WSG84_L1 | train | @Pure
public static Point2d WSG84_L1(double lambda, double phi) {
final Point2d ntfLambdaPhi = WSG84_NTFLamdaPhi(lambda, phi);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,
LAMBERT_1_YS);
} | java | {
"resource": ""
} |
q14958 | GISCoordinates.WSG84_L2 | train | @Pure
public static Point2d WSG84_L2(double lambda, double phi) {
final Point2d ntfLambdaPhi = WSG84_NTFLamdaPhi(lambda, phi);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_2_N,
LAMBERT_2_C,
LAMBERT_2_XS,
LAMBERT_2_YS);
} | java | {
"resource": ""
} |
q14959 | GISCoordinates.WSG84_L3 | train | @Pure
public static Point2d WSG84_L3(double lambda, double phi) {
final Point2d ntfLambdaPhi = WSG84_NTFLamdaPhi(lambda, phi);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_3_XS,
LAMBERT_3_YS);
} | java | {
"resource": ""
} |
q14960 | GISCoordinates.WSG84_L4 | train | public static Point2d WSG84_L4(double lambda, double phi) {
final Point2d ntfLambdaPhi = WSG84_NTFLamdaPhi(lambda, phi);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_4_XS,
LAMBERT_4_YS);
} | java | {
"resource": ""
} |
q14961 | GISCoordinates.WSG84_L93 | train | @Pure
public static Point2d WSG84_L93(double lambda, double phi) {
final Point2d ntfLambdaPhi = WSG84_NTFLamdaPhi(lambda, phi);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93_XS,
LAMBERT_93_YS);
} | java | {
"resource": ""
} |
q14962 | GISCoordinates.NTFLambdaPhi_NTFLambert | train | @SuppressWarnings({"checkstyle:parametername", "checkstyle:magicnumber",
"checkstyle:localfinalvariablename", "checkstyle:localvariablename"})
private static Point2d NTFLambdaPhi_NTFLambert(double lambda, double phi, double n, double c, double Xs, double Ys) {
//----------------------------------------------------... | java | {
"resource": ""
} |
q14963 | GISCoordinates.WSG84_NTFLamdaPhi | train | @SuppressWarnings({"checkstyle:parametername", "checkstyle:magicnumber",
"checkstyle:localfinalvariablename", "checkstyle:localvariablename"})
private static Point2d WSG84_NTFLamdaPhi(double lambda, double phi) {
//---------------------------------------------------------
// 0) degree -> radian
final double la... | java | {
"resource": ""
} |
q14964 | Tuple1dfx.segmentProperty | train | @Pure
public ObjectProperty<WeakReference<Segment1D<?, ?>>> segmentProperty() {
if (this.segment == null) {
this.segment = new SimpleObjectProperty<>(this, MathFXAttributeNames.SEGMENT);
}
return this.segment;
} | java | {
"resource": ""
} |
q14965 | Tuple1dfx.set | train | void set(ObjectProperty<WeakReference<Segment1D<?, ?>>> segment, DoubleProperty x, DoubleProperty y) {
this.segment = segment;
this.x = x;
this.y = y;
} | java | {
"resource": ""
} |
q14966 | AbstractSegment3F.intersectsSegmentCapsule | train | @Pure
public static boolean intersectsSegmentCapsule(
double sx1, double sy1, double sz1, double sx2, double sy2, double sz2,
double mx1, double my1, double mz1, double mx2, double my2, double mz2, double radius) {
double d = distanceSquaredSegmentSegment(
sx1, sy1, sz1, sx2, sy2, sz2,
mx1, my1, mz1, m... | java | {
"resource": ""
} |
q14967 | AbstractSegment3F.intersectsLineLine | train | @Pure
public static boolean intersectsLineLine(
double x1, double y1, double z1,
double x2, double y2, double z2,
double x3, double y3, double z3,
double x4, double y4, double z4) {
double s = computeLineLineIntersectionFactor(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4);
return !Double.isNaN(s);
} | java | {
"resource": ""
} |
q14968 | AbstractSegment3F.distanceSquaredSegmentPoint | train | @Pure
public static double distanceSquaredSegmentPoint(
double sx1, double sy1, double sz1, double sx2, double sy2, double sz2,
double px, double py, double pz) {
double ratio = getPointProjectionFactorOnSegmentLine(px, py, pz, sx1, sy1, sz1, sx2, sy2, sz2);
if (ratio <= 0.)
return FunctionalPoint3D.dist... | java | {
"resource": ""
} |
q14969 | AbstractSegment3F.distanceSegmentPoint | train | @Pure
public static double distanceSegmentPoint(
double sx1, double sy1, double sz1, double sx2, double sy2, double sz2,
double px, double py, double pz) {
double ratio = getPointProjectionFactorOnSegmentLine(px, py, pz, sx1, sy1, sz1, sx2, sy2, sz2);
if (ratio <= 0.)
return FunctionalPoint3D.distancePoi... | java | {
"resource": ""
} |
q14970 | AbstractSegment3F.getPointProjectionFactorOnSegmentLine | train | @Pure
public static double getPointProjectionFactorOnSegmentLine(
double px, double py, double pz,
double s1x, double s1y, double s1z,
double s2x, double s2y, double s2z) {
double dx = s2x - s1x;
double dy = s2y - s1y;
double dz = s2z - s1z;
if (dx == 0. && dy == 0. && dz == 0.)
return 0.;
retu... | java | {
"resource": ""
} |
q14971 | AbstractSegment3F.distanceSegmentSegment | train | @Pure
public static double distanceSegmentSegment(
double ax1, double ay1, double az1, double ax2, double ay2, double az2,
double bx1, double by1, double bz1, double bx2, double by2, double bz2) {
return Math.sqrt(distanceSquaredSegmentSegment(
ax1, ay1, az1, ax2, ay2, az2,
bx1, by1, bz1, bx2, by2, bz2... | java | {
"resource": ""
} |
q14972 | AbstractSegment3F.distanceSquaredSegmentSegment | train | @Pure
public static double distanceSquaredSegmentSegment(
double ax1, double ay1, double az1, double ax2, double ay2, double az2,
double bx1, double by1, double bz1, double bx2, double by2, double bz2) {
Vector3f u = new Vector3f(ax2 - ax1, ay2 - ay1, az2 - az1);
Vector3f v = new Vector3f(bx2 - bx1, by2 - by... | java | {
"resource": ""
} |
q14973 | AbstractSegment3F.distanceSegment | train | @Pure
public double distanceSegment(Point3D point) {
return distanceSegmentPoint(
getX1(), getY1(), getZ1(),
getX2(), getY2(), getZ2(),
point.getX(), point.getY(), point.getZ());
} | java | {
"resource": ""
} |
q14974 | AbstractSegment3F.distanceLine | train | @Pure
public double distanceLine(Point3D point) {
return distanceLinePoint(
getX1(), getY1(), getZ1(),
getX2(), getY2(), getZ2(),
point.getX(), point.getY(), point.getZ());
} | java | {
"resource": ""
} |
q14975 | AbstractSegment3F.distanceSquaredSegment | train | @Pure
public double distanceSquaredSegment(Point3D point) {
return distanceSquaredSegmentPoint(
getX1(), getY1(), getZ1(),
getX2(), getY2(), getZ2(),
point.getX(), point.getY(), point.getZ());
} | java | {
"resource": ""
} |
q14976 | AbstractSegment3F.distanceSquaredLine | train | @Pure
public double distanceSquaredLine(Point3D point) {
return distanceSquaredLinePoint(
getX1(), getY1(), getZ1(),
getX2(), getY2(), getZ2(),
point.getX(), point.getY(), point.getZ());
} | java | {
"resource": ""
} |
q14977 | BusNetworkLayer.onBusLineAdded | train | protected boolean onBusLineAdded(BusLine line, int index) {
if (this.autoUpdate.get()) {
try {
addMapLayer(index, new BusLineLayer(line, isLayerAutoUpdated()));
return true;
} catch (Throwable exception) {
//
}
}
return false;
} | java | {
"resource": ""
} |
q14978 | BusNetworkLayer.onBusLineRemoved | train | protected boolean onBusLineRemoved(BusLine line, int index) {
if (this.autoUpdate.get()) {
try {
removeMapLayerAt(index);
return true;
} catch (Throwable exception) {
//
}
}
return false;
} | java | {
"resource": ""
} |
q14979 | KeyValueSources.fromFileMap | train | @Nonnull
public static ImmutableKeyValueSource<Symbol, ByteSource> fromFileMap(
final Map<Symbol, File> fileMap) {
return new FileMapKeyToByteSource(fileMap);
} | java | {
"resource": ""
} |
q14980 | KeyValueSources.fromPalDB | train | @Nonnull
public static ImmutableKeyValueSource<Symbol, ByteSource> fromPalDB(final File dbFile)
throws IOException {
return PalDBKeyValueSource.fromFile(dbFile);
} | java | {
"resource": ""
} |
q14981 | JTreePanel.newTree | train | protected JTree newTree()
{
JTree tree = new JTree();
tree.setModel(newTreeModel(getModel()));
tree.setEditable(true);
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
tree.addMouseListener(new MouseAdapter()
{
@Override
public void mousePressed(MouseEvent e)
... | java | {
"resource": ""
} |
q14982 | Path3f.add | train | public void add(Iterator<AbstractPathElement3F> iterator) {
AbstractPathElement3F element;
while (iterator.hasNext()) {
element = iterator.next();
switch(element.type) {
case MOVE_TO:
moveTo(element.getToX(), element.getToY(), element.getToZ());
break;
case LINE_TO:
lineTo(element.getToX(), ... | java | {
"resource": ""
} |
q14983 | Path3f.length | train | public double length() {
if (this.isEmpty()) return 0;
double length = 0;
PathIterator3f pi = getPathIterator(MathConstants.SPLINE_APPROXIMATION_RATIO);
AbstractPathElement3F pathElement = pi.next();
if (pathElement.type != PathElementType.MOVE_TO) {
throw new IllegalArgumentException("missi... | java | {
"resource": ""
} |
q14984 | EREtoEDT.lightEREOffsetToEDTOffset | train | private ImmutableMap<Integer, Integer> lightEREOffsetToEDTOffset(String document) {
final ImmutableMap.Builder<Integer, Integer> offsetMap = ImmutableMap.builder();
int EDT = 0;
// lightERE treats these as one, not two (as an XML parser would)
document = document.replaceAll("\\r\\n", "\n");
for (int... | java | {
"resource": ""
} |
q14985 | IntegerArrayFilter.validate | train | protected boolean validate(String text)
{
try
{
String[] strings = text.split(",");
for (int i = 0; i < strings.length; i++)
{
Integer.parseInt(strings[i].trim());
}
return true;
}
catch (NumberFormatException e)
{
return false;
}
} | java | {
"resource": ""
} |
q14986 | EquivalenceBasedProvenancedAlignment.getAlignedTo | train | private Collection<EqClassT> getAlignedTo(final Object item) {
if (rightEquivalenceClassesToProvenances.containsKey(item)
&& leftEquivalenceClassesToProvenances.containsKey(item)) {
return ImmutableList.of((EqClassT) item);
} else {
return ImmutableList.of();
}
} | java | {
"resource": ""
} |
q14987 | ListenerCollection.add | train | public synchronized <T extends EventListener> void add(Class<T> type, T listener) {
assert listener != null;
if (this.listeners == NULL) {
// if this is the first listener added,
// initialize the lists
this.listeners = new Object[] {type, listener};
} else {
// Otherwise copy the array and add the ne... | java | {
"resource": ""
} |
q14988 | ListenerCollection.remove | train | public synchronized <T extends EventListener> void remove(Class<T> type, T listener) {
assert listener != null;
// Is l on the list?
int index = -1;
for (int i = this.listeners.length - 2; i >= 0; i -= 2) {
if ((this.listeners[i] == type) && (this.listeners[i + 1].equals(listener))) {
index = i;
brea... | java | {
"resource": ""
} |
q14989 | ListenerCollection.writeObject | train | private void writeObject(ObjectOutputStream stream) throws IOException {
final Object[] lList = this.listeners;
stream.defaultWriteObject();
// Save the non-null event listeners:
for (int i = 0; i < lList.length; i += 2) {
final Class<?> t = (Class<?>) lList[i];
final EventListener l = (EventListener) lL... | java | {
"resource": ""
} |
q14990 | MathFunctionRange.createDiscreteSet | train | @Pure
public static MathFunctionRange[] createDiscreteSet(double... values) {
final MathFunctionRange[] bounds = new MathFunctionRange[values.length];
for (int i = 0; i < values.length; ++i) {
bounds[i] = new MathFunctionRange(values[i]);
}
return bounds;
} | java | {
"resource": ""
} |
q14991 | MathFunctionRange.createSet | train | @Pure
public static MathFunctionRange[] createSet(double... values) {
final MathFunctionRange[] bounds = new MathFunctionRange[values.length / 2];
for (int i = 0, j = 0; i < values.length; i += 2, ++j) {
bounds[j] = new MathFunctionRange(values[i], values[i + 1]);
}
return bounds;
} | java | {
"resource": ""
} |
q14992 | HttpCore.interceptToProgressResponse | train | public Interceptor interceptToProgressResponse() {
return new Interceptor() {
@Override
public Response intercept(Chain chain) throws IOException {
Response response = chain.proceed(chain.request());
ResponseBody body = new ForwardResponseBody(response.body... | java | {
"resource": ""
} |
q14993 | RoadPolyline.setStartPoint | train | void setStartPoint(StandardRoadConnection desiredConnection) {
final StandardRoadConnection oldPoint = getBeginPoint(StandardRoadConnection.class);
if (oldPoint != null) {
oldPoint.removeConnectedSegment(this, true);
}
this.firstConnection = desiredConnection;
if (desiredConnection != null) {
final Poin... | java | {
"resource": ""
} |
q14994 | RoadPolyline.setEndPoint | train | void setEndPoint(StandardRoadConnection desiredConnection) {
final StandardRoadConnection oldPoint = getEndPoint(StandardRoadConnection.class);
if (oldPoint != null) {
oldPoint.removeConnectedSegment(this, false);
}
this.lastConnection = desiredConnection;
if (desiredConnection != null) {
final Point2d ... | java | {
"resource": ""
} |
q14995 | PartitionData.filterMapToKeysPreservingOrder | train | private static <K, V> ImmutableMap<K, V> filterMapToKeysPreservingOrder(
final ImmutableMap<? extends K, ? extends V> map, Iterable<? extends K> keys) {
final ImmutableMap.Builder<K, V> ret = ImmutableMap.builder();
for (final K key : keys) {
final V value = map.get(key);
checkArgument(value !... | java | {
"resource": ""
} |
q14996 | AwtExtensions.getRootJDialog | train | public static Component getRootJDialog(Component component)
{
while (null != component.getParent())
{
component = component.getParent();
if (component instanceof JDialog)
{
break;
}
}
return component;
} | java | {
"resource": ""
} |
q14997 | AwtExtensions.getRootJFrame | train | public static Component getRootJFrame(Component component)
{
while (null != component.getParent())
{
component = component.getParent();
if (component instanceof JFrame)
{
break;
}
}
return component;
} | java | {
"resource": ""
} |
q14998 | AwtExtensions.getRootParent | train | public static Component getRootParent(Component component)
{
while (null != component.getParent())
{
component = component.getParent();
}
return component;
} | java | {
"resource": ""
} |
q14999 | AwtExtensions.setIconImage | train | public static void setIconImage(final String resourceName, final Window window)
throws IOException
{
final InputStream isLogo = ClassExtensions.getResourceAsStream(resourceName);
final BufferedImage biLogo = ImageIO.read(isLogo);
window.setIconImage(biLogo);
} | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.