« first day (2518 days earlier)      last day (870 days later) » 

5:33 AM
7
Q: Why is this Java generic method call ambiguous when only one method is valid when separate?

Timothy ColeI am trying to understand why the compiler is unable to resolve the bar method call. I would expect bar(Xyz::new) to always select bar(Supplier) as bar(T extends Xyz) can never match due to the upper bound on Xyz. public <T extends Xyz> void foo(T s) {} public <T extends Xyz> void bar(T s) {} pub...

 
 
4 hours later…
9:34 AM
6
Q: Are there infinitely many unique prime numbers?

Chaotic GoodWolfram.mathworld.com defines a unique prime in the following way: "Following Yates (1980), a prime $p$ such that $\frac{1}{p}$ is a repeating decimal with decimal period shared with no other prime is called a unique prime. For example, $3$, $11$, $37$, and $101$ are unique primes." OEIS has uniq...

 
9:46 AM
6
Q: Primes made from alternating factorials

MarioPrixWhile messing around with factorials, I noticed this: $$3! - 2! + 1! = 6 - 2 + 1 = 5$$ $$4! - 3! + 2! - 1!= 24 - 6 + 2 - 1=19$$ $$5! - 4! + 3! - 2! + 1! = 5! - 19 = 101$$ $$6! - 5! + 4! - 3! + 2! - 1! = 6! - 101 = 619$$ $$7! - 6! + 5! - 4! + 3! - 2! + 1! = 7! - 619 = 4421$$ Notice that all of the...

 
10:21 AM
6
Q: Keep only the second observation per group in R

Miguel MoreiraI have a data frame ordered by id variables ("city"), and I want to keep the second observation of those cities that have more than one observation. For example, here's an example data set: city <- c(1,1,2,3,3,4,5,6,7,7,8) value <- c(3,5,7,8,2,5,4,2,3,2,3) mydata <- data.frame(city, value) Then ...

 
11:03 AM
6
Q: What are some ways to avoid String.substring from returning substring with invalid unicode character?

Cheok Yan ChengRecently, only I notice that, it is possible for substring to return string with invalid unicode character. For instance public class Main { public static void main(String[] args) { String text = "🥦_Salade verte"; /* We should avoid using endIndex = 1, as it will cause an i...

 
11:27 AM
0
Q: Retrieve identifiers in Clang Cindex (Python)

RazviI'm building a python script that analyzes a given C source code and performs vulnerability assessment (at least that's my intention). I would like to perform the checks base on Clang's AST. In order to do so, I'm using Cindex's python implementation. I would like to know if variables referenced ...

 
 
9 hours later…
8:33 PM
7
Q: Expected number of compositions needed to get constant function

Sam HopkinsThis is somewhat inspired by Factoring a function from a finite set to itself. Fix natural number $n$ and let $[n] := \{1,2,\ldots,n\}$. Set $g_0 \colon [n]\to [n]$ to be the identity, and for $i \geq 1$ define $g_i := f_i \circ g_{i-1}$ where the $f_i\colon [n] \to [n]$ are chosen (independently...

 
 
1 hour later…
9:51 PM
3
Q: The source of the Integral

Zurab SilagadzeWolfram alpha calculates the integral $$\int\limits_0^\infty \frac{x^2\ln{x}}{e^x-1}dx=2\zeta^\prime(3)+3\zeta(3)-2\gamma\zeta(3).$$ However, I need to cite the source of this identity (the table of integrals, or the article where this integral was calculated). Could you indicate any?

 

« first day (2518 days earlier)      last day (870 days later) »