_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q167300 | ListBuddiesLayout.toogleListView | validation | private void toogleListView(View v) {
if (mLastViewTouchId != v.getId()) {
if (mLastViewTouchId == mListViewLeft.getId()) {
isLeftListEnabled = true;
isRightListEnabled = false;
} else {
isLeftListEnabled = false;
isRightLis... | java | {
"resource": ""
} |
q167301 | ListBuddiesLayout.onListScroll | validation | @Override
public void onListScroll(View view, float deltaY) {
int speed;
if (view.getId() == mListViewLeft.getId() && !isLeftListEnabled) {
speed = getSpeed(false, deltaY);
mListViewRight.smoothScrollBy(speed, 0);
} else if (view.getId() == mListViewRight.getId() && ... | java | {
"resource": ""
} |
q167302 | SafeUrls.toProto | validation | public static SafeUrlProto toProto(SafeUrl url) {
return SafeUrlProto.newBuilder()
.setPrivateDoNotAccessOrElseSafeUrlWrappedValue(url.getSafeUrlString())
.build();
} | java | {
"resource": ""
} |
q167303 | SafeStyles.toProto | validation | public static SafeStyleProto toProto(SafeStyle style) {
return SafeStyleProto.newBuilder()
.setPrivateDoNotAccessOrElseSafeStyleWrappedValue(style.getSafeStyleString()).build();
} | java | {
"resource": ""
} |
q167304 | SafeScripts.toProto | validation | public static SafeScriptProto toProto(SafeScript script) {
return SafeScriptProto.newBuilder()
.setPrivateDoNotAccessOrElseSafeScriptWrappedValue(script.getSafeScriptString()).build();
} | java | {
"resource": ""
} |
q167305 | SafeStyleSheets.toProto | validation | public static SafeStyleSheetProto toProto(SafeStyleSheet style) {
return SafeStyleSheetProto.newBuilder()
.setPrivateDoNotAccessOrElseSafeStyleSheetWrappedValue(
style.getSafeStyleSheetString())
.build();
} | java | {
"resource": ""
} |
q167306 | TrustedResourceUrls.toProto | validation | public static TrustedResourceUrlProto toProto(TrustedResourceUrl url) {
return TrustedResourceUrlProto.newBuilder()
.setPrivateDoNotAccessOrElseTrustedResourceUrlWrappedValue(
url.getTrustedResourceUrlString())
.build();
} | java | {
"resource": ""
} |
q167307 | SafeHtmls.toProto | validation | public static SafeHtmlProto toProto(SafeHtml safeHtml) {
return SafeHtmlProto.newBuilder().setPrivateDoNotAccessOrElseSafeHtmlWrappedValue(
safeHtml.getSafeHtmlString()).build();
} | java | {
"resource": ""
} |
q167308 | GenericMath.wrapAngleRad | validation | public static double wrapAngleRad(double angle) {
angle %= TrigMath.TWO_PI;
if (angle <= -TrigMath.PI) {
return angle + TrigMath.TWO_PI;
}
if (angle > TrigMath.PI) {
return angle - TrigMath.TWO_PI;
}
return angle;
} | java | {
"resource": ""
} |
q167309 | GenericMath.round | validation | public static double round(double input, int decimals) {
final double p = Math.pow(10, decimals);
return Math.round(input * p) / p;
} | java | {
"resource": ""
} |
q167310 | GenericMath.lerp | validation | public static double lerp(double x, double x1, double x2, double q0, double q1) {
return ((x2 - x) / (x2 - x1)) * q0 + ((x - x1) / (x2 - x1)) * q1;
} | java | {
"resource": ""
} |
q167311 | GenericMath.slerp | validation | public static Quaternionf slerp(Quaternionf a, Quaternionf b, float percent) {
final float inverted;
float cosineTheta = a.dot(b);
if (cosineTheta < 0) {
cosineTheta = -cosineTheta;
inverted = -1;
} else {
inverted = 1;
}
if (1 - cosine... | java | {
"resource": ""
} |
q167312 | GenericMath.biLerp | validation | public static double biLerp(double x, double y, double q00, double q01,
double q10, double q11, double x1, double x2, double y1, double y2) {
double q0 = lerp(x, x1, x2, q00, q10);
double q1 = lerp(x, x1, x2, q01, q11);
return lerp(y, y1, y2, q0, q1);
} | java | {
"resource": ""
} |
q167313 | GenericMath.triLerp | validation | public static double triLerp(double x, double y, double z, double q000, double q001,
double q010, double q011, double q100, double q101, double q110, double q111,
double x1, double x2, double y1, double y2, double z1, double z2) {
double q00 = le... | java | {
"resource": ""
} |
q167314 | GenericMath.blend | validation | public static Color blend(Color a, Color b) {
return lerp(a, b, a.getAlpha() / 255f);
} | java | {
"resource": ""
} |
q167315 | GenericMath.clamp | validation | public static double clamp(double value, double low, double high) {
if (value < low) {
return low;
}
if (value > high) {
return high;
}
return value;
} | java | {
"resource": ""
} |
q167316 | GenericMath.inverseSqrt | validation | public static double inverseSqrt(double a) {
final double halfA = 0.5d * a;
a = Double.longBitsToDouble(0x5FE6EB50C7B537AAl - (Double.doubleToRawLongBits(a) >> 1));
return a * (1.5d - halfA * a * a);
} | java | {
"resource": ""
} |
q167317 | GenericMath.castFloat | validation | public static Float castFloat(Object o) {
if (o == null) {
return null;
}
if (o instanceof Number) {
return ((Number) o).floatValue();
}
try {
return Float.valueOf(o.toString());
} catch (NumberFormatException e) {
return nu... | java | {
"resource": ""
} |
q167318 | GenericMath.castByte | validation | public static Byte castByte(Object o) {
if (o == null) {
return null;
}
if (o instanceof Number) {
return ((Number) o).byteValue();
}
try {
return Byte.valueOf(o.toString());
} catch (NumberFormatException e) {
return null;
... | java | {
"resource": ""
} |
q167319 | GenericMath.castShort | validation | public static Short castShort(Object o) {
if (o == null) {
return null;
}
if (o instanceof Number) {
return ((Number) o).shortValue();
}
try {
return Short.valueOf(o.toString());
} catch (NumberFormatException e) {
return nu... | java | {
"resource": ""
} |
q167320 | GenericMath.castInt | validation | public static Integer castInt(Object o) {
if (o == null) {
return null;
}
if (o instanceof Number) {
return ((Number) o).intValue();
}
try {
return Integer.valueOf(o.toString());
} catch (NumberFormatException e) {
return nu... | java | {
"resource": ""
} |
q167321 | GenericMath.castDouble | validation | public static Double castDouble(Object o) {
if (o == null) {
return null;
}
if (o instanceof Number) {
return ((Number) o).doubleValue();
}
try {
return Double.valueOf(o.toString());
} catch (NumberFormatException e) {
retur... | java | {
"resource": ""
} |
q167322 | GenericMath.castLong | validation | public static Long castLong(Object o) {
if (o == null) {
return null;
}
if (o instanceof Number) {
return ((Number) o).longValue();
}
try {
return Long.valueOf(o.toString());
} catch (NumberFormatException e) {
return null;
... | java | {
"resource": ""
} |
q167323 | GenericMath.castBoolean | validation | public static Boolean castBoolean(Object o) {
if (o == null) {
return null;
}
if (o instanceof Boolean) {
return (Boolean) o;
} else if (o instanceof String) {
try {
return Boolean.parseBoolean((String) o);
} catch (IllegalA... | java | {
"resource": ""
} |
q167324 | GenericMath.mean | validation | public static int mean(int... values) {
int sum = 0;
for (int v : values) {
sum += v;
}
return sum / values.length;
} | java | {
"resource": ""
} |
q167325 | GenericMath.mod | validation | public static double mod(double a, double div) {
final double remainder = a % div;
return remainder < 0 ? remainder + div : remainder;
} | java | {
"resource": ""
} |
q167326 | GenericMath.multiplyToShift | validation | public static int multiplyToShift(int a) {
if (a < 1) {
throw new IllegalArgumentException("Multiplicand must be at least 1");
}
int shift = 31 - Integer.numberOfLeadingZeros(a);
if ((1 << shift) != a) {
throw new IllegalArgumentException("Multiplicand must be a p... | java | {
"resource": ""
} |
q167327 | Quaterniond.mul | validation | @Override
public Quaterniond mul(double a) {
return new Quaterniond(x * a, y * a, z * a, w * a);
} | java | {
"resource": ""
} |
q167328 | Quaterniond.div | validation | @Override
public Quaterniond div(double a) {
return new Quaterniond(x / a, y / a, z / a, w / a);
} | java | {
"resource": ""
} |
q167329 | Quaterniond.rotate | validation | public Vector3d rotate(double x, double y, double z) {
final double length = length();
if (Math.abs(length) < GenericMath.DBL_EPSILON) {
throw new ArithmeticException("Cannot rotate by the zero quaternion");
}
final double nx = this.x / length;
final double ny = this.... | java | {
"resource": ""
} |
q167330 | Quaterniond.lengthSquared | validation | @Override
public double lengthSquared() {
return x * x + y * y + z * z + w * w;
} | java | {
"resource": ""
} |
q167331 | Quaterniond.normalize | validation | @Override
public Quaterniond normalize() {
final double length = length();
if (Math.abs(length) < GenericMath.DBL_EPSILON) {
throw new ArithmeticException("Cannot normalize the zero quaternion");
}
return new Quaterniond(x / length, y / length, z / length, w / length);
... | java | {
"resource": ""
} |
q167332 | Quaterniond.fromImaginary | validation | public static Quaterniond fromImaginary(double x, double y, double z) {
return x == 0 && y == 0 && z == 0 ? ZERO : new Quaterniond(x, y, z, 0);
} | java | {
"resource": ""
} |
q167333 | Quaterniond.from | validation | public static Quaterniond from(double x, double y, double z, double w) {
return x == 0 && y == 0 && z == 0 && w == 0 ? ZERO : new Quaterniond(x, y, z, w);
} | java | {
"resource": ""
} |
q167334 | Quaterniond.fromAxesAnglesDeg | validation | public static Quaterniond fromAxesAnglesDeg(double pitch, double yaw, double roll) {
return Quaterniond.fromAngleDegAxis(yaw, Vector3d.UNIT_Y).
mul(Quaterniond.fromAngleDegAxis(pitch, Vector3d.UNIT_X)).
mul(Quaterniond.fromAngleDegAxis(roll, Vector3d.UNIT_Z));
} | java | {
"resource": ""
} |
q167335 | Quaterniond.fromAxesAnglesRad | validation | public static Quaterniond fromAxesAnglesRad(double pitch, double yaw, double roll) {
return Quaterniond.fromAngleRadAxis(yaw, Vector3d.UNIT_Y).
mul(Quaterniond.fromAngleRadAxis(pitch, Vector3d.UNIT_X)).
mul(Quaterniond.fromAngleRadAxis(roll, Vector3d.UNIT_Z));
} | java | {
"resource": ""
} |
q167336 | Quaterniond.fromAngleRadAxis | validation | public static Quaterniond fromAngleRadAxis(double angle, Vector3d axis) {
return fromAngleRadAxis(angle, axis.getX(), axis.getY(), axis.getZ());
} | java | {
"resource": ""
} |
q167337 | Quaterniond.fromAngleDegAxis | validation | public static Quaterniond fromAngleDegAxis(float angle, float x, float y, float z) {
return fromAngleRadAxis(Math.toRadians(angle), x, y, z);
} | java | {
"resource": ""
} |
q167338 | Vector4i.getMinAxis | validation | @Override
public int getMinAxis() {
int value = x;
int axis = 0;
if (y < value) {
value = y;
axis = 1;
}
if (z < value) {
value = z;
axis = 2;
}
if (w < value) {
axis = 3;
}
return axi... | java | {
"resource": ""
} |
q167339 | Complexf.mul | validation | public Complexf mul(float x, float y) {
return new Complexf(
this.x * x - this.y * y,
this.x * y + this.y * x);
} | java | {
"resource": ""
} |
q167340 | Complexf.div | validation | public Complexf div(float x, float y) {
final float d = x * x + y * y;
return new Complexf(
(this.x * x + this.y * y) / d,
(this.y * x - this.x * y) / d);
} | java | {
"resource": ""
} |
q167341 | Complexf.rotate | validation | public Vector2f rotate(float x, float y) {
final float length = length();
if (Math.abs(length) < GenericMath.FLT_EPSILON) {
throw new ArithmeticException("Cannot rotate by the zero complex");
}
final float nx = this.x / length;
final float ny = this.y / length;
... | java | {
"resource": ""
} |
q167342 | Complexf.normalize | validation | @Override
public Complexf normalize() {
final float length = length();
if (Math.abs(length) < GenericMath.FLT_EPSILON) {
throw new ArithmeticException("Cannot normalize the zero complex");
}
return new Complexf(x / length, y / length);
} | java | {
"resource": ""
} |
q167343 | Complexf.toQuaternion | validation | public Quaternionf toQuaternion(float x, float y, float z) {
return Quaternionf.fromAngleRadAxis(getAngleRad(), x, y, z);
} | java | {
"resource": ""
} |
q167344 | Complexf.from | validation | public static Complexf from(float x, float y) {
return x == 0 && y == 0 ? ZERO : new Complexf(x, y);
} | java | {
"resource": ""
} |
q167345 | Complexf.fromAngleRad | validation | public static Complexf fromAngleRad(float angle) {
return new Complexf(TrigMath.cos(angle), TrigMath.sin(angle));
} | java | {
"resource": ""
} |
q167346 | Vector4l.getMaxAxis | validation | @Override
public int getMaxAxis() {
long value = x;
int axis = 0;
if (y > value) {
value = y;
axis = 1;
}
if (z > value) {
value = z;
axis = 2;
}
if (w > value) {
axis = 3;
}
return ax... | java | {
"resource": ""
} |
q167347 | HashFunctions.hash | validation | public static int hash(double value) {
assert !Double.isNaN(value) : "Values of NaN are not supported.";
long bits = Double.doubleToLongBits(value);
return (int) (bits ^ (bits >>> 32));
//return (int) Double.doubleToLongBits(value*663608941.737);
// This avoids excessive hashCol... | java | {
"resource": ""
} |
q167348 | Quaternionf.add | validation | public Quaternionf add(float x, float y, float z, float w) {
return new Quaternionf(this.x + x, this.y + y, this.z + z, this.w + w);
} | java | {
"resource": ""
} |
q167349 | Quaternionf.mul | validation | @Override
public Quaternionf mul(float a) {
return new Quaternionf(x * a, y * a, z * a, w * a);
} | java | {
"resource": ""
} |
q167350 | Quaternionf.div | validation | @Override
public Quaternionf div(float a) {
return new Quaternionf(x / a, y / a, z / a, w / a);
} | java | {
"resource": ""
} |
q167351 | Quaternionf.getAxis | validation | public Vector3f getAxis() {
final float q = (float) Math.sqrt(1 - w * w);
return new Vector3f(x / q, y / q, z / q);
} | java | {
"resource": ""
} |
q167352 | Quaternionf.getAxesAnglesRad | validation | public Vector3f getAxesAnglesRad() {
final double roll;
final double pitch;
double yaw;
final double test = w * x - y * z;
if (Math.abs(test) < 0.4999) {
roll = TrigMath.atan2(2 * (w * z + x * y), 1 - 2 * (x * x + z * z));
pitch = TrigMath.asin(2 * test);
... | java | {
"resource": ""
} |
q167353 | Quaternionf.fromImaginary | validation | public static Quaternionf fromImaginary(float x, float y, float z) {
return x == 0 && y == 0 && z == 0 ? ZERO : new Quaternionf(x, y, z, 0);
} | java | {
"resource": ""
} |
q167354 | Quaternionf.from | validation | public static Quaternionf from(float x, float y, float z, float w) {
return x == 0 && y == 0 && z == 0 && w == 0 ? ZERO : new Quaternionf(x, y, z, w);
} | java | {
"resource": ""
} |
q167355 | Quaternionf.fromAxesAnglesDeg | validation | public static Quaternionf fromAxesAnglesDeg(float pitch, float yaw, float roll) {
return Quaternionf.fromAngleDegAxis(yaw, Vector3f.UNIT_Y).
mul(Quaternionf.fromAngleDegAxis(pitch, Vector3f.UNIT_X)).
mul(Quaternionf.fromAngleDegAxis(roll, Vector3f.UNIT_Z));
} | java | {
"resource": ""
} |
q167356 | Quaternionf.fromAxesAnglesRad | validation | public static Quaternionf fromAxesAnglesRad(float pitch, float yaw, float roll) {
return Quaternionf.fromAngleRadAxis(yaw, Vector3f.UNIT_Y).
mul(Quaternionf.fromAngleRadAxis(pitch, Vector3f.UNIT_X)).
mul(Quaternionf.fromAngleRadAxis(roll, Vector3f.UNIT_Z));
} | java | {
"resource": ""
} |
q167357 | Quaternionf.fromAngleRadAxis | validation | public static Quaternionf fromAngleRadAxis(float angle, Vector3f axis) {
return fromAngleRadAxis(angle, axis.getX(), axis.getY(), axis.getZ());
} | java | {
"resource": ""
} |
q167358 | Quaternionf.fromAngleRadAxis | validation | public static Quaternionf fromAngleRadAxis(double angle, double x, double y, double z) {
return fromAngleRadAxis((float) angle, (float) x, (float) y, (float) z);
} | java | {
"resource": ""
} |
q167359 | Complexd.mul | validation | public Complexd mul(double x, double y) {
return new Complexd(
this.x * x - this.y * y,
this.x * y + this.y * x);
} | java | {
"resource": ""
} |
q167360 | Complexd.div | validation | public Complexd div(double x, double y) {
final double d = x * x + y * y;
return new Complexd(
(this.x * x + this.y * y) / d,
(this.y * x - this.x * y) / d);
} | java | {
"resource": ""
} |
q167361 | Complexd.rotate | validation | public Vector2d rotate(double x, double y) {
final double length = length();
if (Math.abs(length) < GenericMath.DBL_EPSILON) {
throw new ArithmeticException("Cannot rotate by the zero complex");
}
final double nx = this.x / length;
final double ny = this.y / length;
... | java | {
"resource": ""
} |
q167362 | Complexd.toQuaternion | validation | public Quaterniond toQuaternion(double x, double y, double z) {
return Quaterniond.fromAngleRadAxis(getAngleRad(), x, y, z);
} | java | {
"resource": ""
} |
q167363 | Complexd.from | validation | public static Complexd from(double x, double y) {
return x == 0 && y == 0 ? ZERO : new Complexd(x, y);
} | java | {
"resource": ""
} |
q167364 | Complexd.fromAngleRad | validation | public static Complexd fromAngleRad(double angle) {
return new Complexd(TrigMath.cos(angle), TrigMath.sin(angle));
} | java | {
"resource": ""
} |
q167365 | ScalableLayout.moveChildView | validation | public void moveChildView(View pChildView, float pScale_Left, float pScale_Top) {
ScalableLayout.LayoutParams lSLLP = getChildLayoutParams(pChildView);
lSLLP.mScale_Left = pScale_Left;
lSLLP.mScale_Top = pScale_Top;
postInvalidate();
} | java | {
"resource": ""
} |
q167366 | ScalableLayout.moveChildView | validation | public void moveChildView(View pChildView, float pScale_Left, float pScale_Top, float pScale_Width, float pScale_Height) {
ScalableLayout.LayoutParams lSLLP = getChildLayoutParams(pChildView);
lSLLP.mScale_Left = pScale_Left;
lSLLP.mScale_Top = pScale_Top;
lSLLP.mScale_Width = pScale_Wid... | java | {
"resource": ""
} |
q167367 | Bypass.setBlockSpan | validation | private static void setBlockSpan(SpannableStringBuilder builder, Object what) {
int length = Math.max(0, builder.length() - 1);
builder.setSpan(what, 0, length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
} | java | {
"resource": ""
} |
q167368 | ConstraintFormulaSet.reduce | validation | public BoundSet reduce(TypeSolver typeSolver) {
List<ConstraintFormula> constraints = new LinkedList<>(constraintFormulas);
BoundSet boundSet = BoundSet.empty();
while (constraints.size() > 0) {
ConstraintFormula constraintFormula = constraints.remove(0);
ConstraintFormul... | java | {
"resource": ""
} |
q167369 | ReferenceTypeImpl.transformTypeParameters | validation | @Override
public ResolvedType transformTypeParameters(ResolvedTypeTransformer transformer) {
ResolvedType result = this;
int i = 0;
for (ResolvedType tp : this.typeParametersValues()) {
ResolvedType transformedTp = transformer.transform(tp);
// Identity comparison on ... | java | {
"resource": ""
} |
q167370 | SymbolReference.solved | validation | public static <S extends ResolvedDeclaration, S2 extends S> SymbolReference<S> solved(S2 symbolDeclaration) {
return new SymbolReference<S>(Optional.of(symbolDeclaration));
} | java | {
"resource": ""
} |
q167371 | SymbolReference.unsolved | validation | public static <S extends ResolvedDeclaration, S2 extends S> SymbolReference<S> unsolved(Class<S2> clazz) {
return new SymbolReference<>(Optional.empty());
} | java | {
"resource": ""
} |
q167372 | TypeHelper.isProperType | validation | public static boolean isProperType(ResolvedType type) {
if (type instanceof InferenceVariable) {
return false;
}
if (type instanceof ResolvedReferenceType) {
ResolvedReferenceType referenceType = (ResolvedReferenceType) type;
return referenceType.typeParameter... | java | {
"resource": ""
} |
q167373 | TypeHelper.leastUpperBound | validation | public static ResolvedType leastUpperBound(Set<ResolvedType> types) {
if (types.size() == 0) {
throw new IllegalArgumentException();
}
// The least upper bound, or "lub", of a set of reference types is a shared supertype that is more specific than
// any other shared superty... | java | {
"resource": ""
} |
q167374 | TypeHelper.groundTargetTypeOfLambda | validation | public static Pair<ResolvedType, Boolean> groundTargetTypeOfLambda(LambdaExpr lambdaExpr, ResolvedType T, TypeSolver typeSolver) {
// The ground target type is derived from T as follows:
//
boolean used18_5_3 = false;
boolean wildcardParameterized = T.asReferenceType().typeParametersVal... | java | {
"resource": ""
} |
q167375 | TypeHelper.nonWildcardParameterizationOf | validation | private static ResolvedReferenceType nonWildcardParameterizationOf(ResolvedReferenceType originalType, TypeSolver typeSolver) {
List<ResolvedType> TIs = new LinkedList<>();
List<ResolvedType> AIs = originalType.typeParametersValues();
List<ResolvedTypeParameterDeclaration> TPs = originalType.get... | java | {
"resource": ""
} |
q167376 | TypeHelper.glb | validation | public static ResolvedType glb(Set<ResolvedType> types) {
if (types.size() == 0) {
throw new IllegalArgumentException();
}
if (types.size() == 1) {
return types.iterator().next();
}
return new ResolvedIntersectionType(types);
} | java | {
"resource": ""
} |
q167377 | TypeExtractor.solveDotExpressionType | validation | private ResolvedType solveDotExpressionType(ResolvedReferenceTypeDeclaration parentType, FieldAccessExpr node) {
// Fields and internal type declarations cannot have the same name.
// Thus, these checks will always be mutually exclusive.
if (parentType.hasField(node.getName().getId())) {
... | java | {
"resource": ""
} |
q167378 | JavaParserFacade.solve | validation | public SymbolReference<ResolvedConstructorDeclaration> solve(ObjectCreationExpr objectCreationExpr, boolean solveLambdas) {
List<ResolvedType> argumentTypes = new LinkedList<>();
List<LambdaArgumentTypePlaceholder> placeholders = new LinkedList<>();
solveArguments(objectCreationExpr, objectCrea... | java | {
"resource": ""
} |
q167379 | JavaParserFacade.solve | validation | public SymbolReference<ResolvedMethodDeclaration> solve(MethodCallExpr methodCallExpr, boolean solveLambdas) {
List<ResolvedType> argumentTypes = new LinkedList<>();
List<LambdaArgumentTypePlaceholder> placeholders = new LinkedList<>();
solveArguments(methodCallExpr, methodCallExpr.getArguments... | java | {
"resource": ""
} |
q167380 | JavaParserFacade.find | validation | private Optional<ResolvedType> find(Map<Node, ResolvedType> map, LambdaExpr lambdaExpr) {
for (Node key : map.keySet()) {
if (key instanceof LambdaExpr) {
LambdaExpr keyLambdaExpr = (LambdaExpr) key;
if (keyLambdaExpr.toString().equals(lambdaExpr.toString()) && getPar... | java | {
"resource": ""
} |
q167381 | JavaParserFacade.qName | validation | private String qName(ClassOrInterfaceType classOrInterfaceType) {
String name = classOrInterfaceType.getName().getId();
if (classOrInterfaceType.getScope().isPresent()) {
return qName(classOrInterfaceType.getScope().get()) + "." + name;
} else {
return name;
}
... | java | {
"resource": ""
} |
q167382 | JavaParserFacade.getTypeOfThisIn | validation | public ResolvedType getTypeOfThisIn(Node node) {
// TODO consider static methods
if (node instanceof ClassOrInterfaceDeclaration) {
return new ReferenceTypeImpl(getTypeDeclaration((ClassOrInterfaceDeclaration) node), typeSolver);
} else if (node instanceof EnumDeclaration) {
... | java | {
"resource": ""
} |
q167383 | ControlFlowLogic.exitTheStatement | validation | public boolean exitTheStatement(BreakStmt breakStmt) {
if (!isReachable(breakStmt)) {
return false;
}
Statement breakTarget = breakTarget(breakStmt);
for (TryStmt tryStmt : containedTryStmts(breakTarget)) {
if (contains(tryStmt.getTryBlock(), breakStmt)) {
... | java | {
"resource": ""
} |
q167384 | ControlFlowLogic.canCompleteNormally | validation | public boolean canCompleteNormally(Statement statement) {
if (!isReachable(statement)) {
return false;
}
GenericVisitor<Boolean, Void> visitor = new GenericVisitorAdapter<Boolean, Void>(){
@Override
public Boolean visit(BlockStmt n, Void arg) {
... | java | {
"resource": ""
} |
q167385 | SymbolSolver.solveTypeInType | validation | @Deprecated
public SymbolReference<ResolvedTypeDeclaration> solveTypeInType(ResolvedTypeDeclaration typeDeclaration, String name) {
if (typeDeclaration instanceof JavaParserClassDeclaration) {
return ((JavaParserClassDeclaration) typeDeclaration).solveType(name, typeSolver);
}
if... | java | {
"resource": ""
} |
q167386 | MethodResolutionLogic.solveMethodInType | validation | public static SymbolReference<ResolvedMethodDeclaration> solveMethodInType(ResolvedTypeDeclaration typeDeclaration,
String name, List<ResolvedType> argumentsTypes, boolean staticOnly,
... | java | {
"resource": ""
} |
q167387 | Value.from | validation | public static Value from(ResolvedValueDeclaration decl) {
ResolvedType type = decl.getType();
return new Value(type, decl.getName());
} | java | {
"resource": ""
} |
q167388 | TypeInference.invocationApplicabilityInference | validation | public boolean invocationApplicabilityInference(MethodCallExpr methodCallExpr, ResolvedMethodDeclaration methodDeclaration) {
if (!methodCallExpr.getNameAsString().equals(methodDeclaration.getName())) {
throw new IllegalArgumentException();
}
Optional<InstantiationSet> partial = inst... | java | {
"resource": ""
} |
q167389 | TypeInference.moreSpecificMethodInference | validation | public boolean moreSpecificMethodInference(MethodCallExpr methodCall, ResolvedMethodDeclaration m1, ResolvedMethodDeclaration m2) {
// When testing that one applicable method is more specific than another (§15.12.2.5), where the second method
// is generic, it is necessary to test whether some instantia... | java | {
"resource": ""
} |
q167390 | ExpressionHelper.appearsInAssignmentContext | validation | private static boolean appearsInAssignmentContext(Expression expression) {
if (expression.getParentNode().isPresent()) {
Node parent = expression.getParentNode().get();
if (parent instanceof ExpressionStmt) {
return false;
}
if (parent instanceof M... | java | {
"resource": ""
} |
q167391 | Predictor.predict | validation | public float[] predict(FVec feat, boolean output_margin, int ntree_limit) {
float[] preds = predictRaw(feat, ntree_limit);
if (! output_margin) {
preds = obj.predTransform(preds);
}
return preds;
} | java | {
"resource": ""
} |
q167392 | RegTreeImpl.loadModel | validation | public void loadModel(ModelReader reader) throws IOException {
param = new Param(reader);
nodes = new Node[param.num_nodes];
for (int i = 0; i < param.num_nodes; i++) {
nodes[i] = new Node(reader);
}
stats = new RTreeNodeStat[param.num_nodes];
for (int i = 0... | java | {
"resource": ""
} |
q167393 | RegTreeImpl.getLeafIndex | validation | @Override
public int getLeafIndex(FVec feat, int root_id) {
int pid = root_id;
Node n;
while (!(n = nodes[pid])._isLeaf) {
pid = n.next(feat);
}
return pid;
} | java | {
"resource": ""
} |
q167394 | RegTreeImpl.getLeafValue | validation | @Override
public float getLeafValue(FVec feat, int root_id) {
Node n = nodes[root_id];
while (!n._isLeaf) {
n = nodes[n.next(feat)];
}
return n.leaf_value;
} | java | {
"resource": ""
} |
q167395 | JsonUnflattener.unflatten | validation | public String unflatten() {
StringWriter sw = new StringWriter();
if (root.isArray()) {
try {
unflattenArray(root.asArray()).writeTo(sw, getWriterConfig());
} catch (IOException e) {}
return sw.toString();
}
if (!root.isObject()) {
return root.toString();
}
JsonO... | java | {
"resource": ""
} |
q167396 | JsonFlattener.flatten | validation | public String flatten() {
flattenAsMap();
if (source.isObject() || isObjectifiableArray())
return flattenedMap.toString(printMode);
else
return javaObj2Json(flattenedMap.get(ROOT));
} | java | {
"resource": ""
} |
q167397 | JsonFlattener.flattenAsMap | validation | public Map<String, Object> flattenAsMap() {
if (flattenedMap != null) return flattenedMap;
flattenedMap = newJsonifyLinkedHashMap();
reduce(source);
while (!elementIters.isEmpty()) {
IndexedPeekIterator<?> deepestIter = elementIters.getLast();
if (!deepestIter.hasNext()) {
elementI... | java | {
"resource": ""
} |
q167398 | Lists.concatView | validation | public static <E> List<E> concatView(List<List<? extends E>> lists) {
if(lists.isEmpty()) {
return Collections.emptyList();
} else {
return ConcatView.create(lists);
}
} | java | {
"resource": ""
} |
q167399 | EventStreams.invalidationsOf | validation | public static EventStream<Void> invalidationsOf(Observable observable) {
return new EventStreamBase<Void>() {
@Override
protected Subscription observeInputs() {
InvalidationListener listener = obs -> emit(null);
observable.addListener(listener);
... | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.