« first day (2569 days earlier)      last day (819 days later) » 

4:43 AM
3
Q: (Quasi)-Galois radii of an integer

Sylvain JulienSay $r$ is a Galois radius of an integer $n$ if $\omega(n-r)=\omega(n+r)=1$, where $\omega$ counts the prime factors regardless of multiplicity, and say $s$ is a $k$-quasi-Galois radius of $n$ if $\omega(\vert n-s\vert)\leq k$ and $\omega(n+s)\leq k$. Is the product of $k$ pairwise distinct Galoi...

 
5:28 AM
7
Q: How do I calculate square root in Python?

wjandreaI need to calculate the square root of a number, for example √9 = 3 or √2 = 1.4142. How can I do it in Python? The inputs will probably be all positive integers, and relatively small (say less than a billion), but just in case they're not, is there anything that might break? Note: This is an att...

 
 
1 hour later…
6:46 AM
6
Q: Use of colon ':' in type hints

MagmurrrWhen type annotating a variable of type dict, typically you'd annotate it like this: numeralToInteger: dict[str, int] = {...} However I rewrote this using a colon instead of a comma: numeralToInteger: dict[str : int] = {...} And this also works, no SyntaxError or NameError is raised. Upon inspe...

 
7:31 AM
0
Q: Move to Right and left

FmbalbuenaTask Your task is to take an array of numbers as input, and produce a new one where each number has been shifted both right and left, leaving 0s if no number fills a spot. This process can be represented graphically like this: [x] / | \ [x, 0, x] This is done with every number in the list, ...

 
 
9 hours later…
4:52 PM
0
Q: __init__() got an unexpected keyword argument

Samuel GuerreroJust starting to learn python and I've encountered a problem that I haven't being able to get around. Here the two files I'm working with. testing.py: import csv import sys from util import Node # Maps names to a set of corresponding person_ids names = {} ...

 
 
1 hour later…
6:16 PM
0
Q: quicktype.io only generates int64_t for integer, are there alternatives or extensions?

Amelse EtomerI would like to use quicktype.io to generate C++ code for reading my configuration files. This works great however all json schema integer types are converted to int64_t. Is there a similar project that takes into account minimum and maximum? E.g. if I have "example": {"type": "integer", "minimum"...

 
6:46 PM
1
Q: Does normalcy in one base imply normalcy in any other base?

Dominic van der ZypenLet $b\geq 2$ be an integer. A real $r \in [0,1]$ is said to be normal with respect to $b$ if every finite string made from the elements $\{0,\ldots,b-1\}$ appears in the $b$-ary expansion of $r$. Are there integers $b, b'\geq 2$ as well as a real number $r\in[0,1]$ such that $r$ is normal with r...

 
 
2 hours later…
8:52 PM
1
Q: Assign name in column based on values from another column in R

KateI am looking for some help to what seems like a very simple question. Any advice is greatly appreciated! I have created a data frame and I am looking to assign names under one column (Region) based on the values in the other column (Unit). rdf<-as.data.frame(matrix(NA, nrow= 59, ncol=2)) colname...

 
 
2 hours later…
10:45 PM
11
Q: Difference betwen const std::array<T,N> and std::array<const T, N>

woockashekIs there any practical difference between std::array<const T, N> and const std::array<T, N> ? It looks that non-const array holding const elements is still not able to be swapped, assignment operator is not working either. When should I prefer one over another? #include <array> std::array<cons...

 

« first day (2569 days earlier)      last day (819 days later) »