« first day (2454 days earlier)      last day (931 days later) » 

12:05 AM
6
Q: True in [True] in [True] Output: False

arsalanI'm trying to figure out in what order this code runs: print( True in [True] in [True] ) False even though: print( ( True in [True] ) in [True] ) True and: print( True in ( [True] in [True] ) ) TypeError If the first code is neither of these two last ones, then what?

 
 
1 hour later…
1:35 AM
7
Q: C++ Templates - The Complete Guide: Understanding footnote comment about decltype and return type

EnlicoThe 2nd edition of C++ Templates - The Complete Guide features the following code at page 435 #include <string> #include <type_traits> template<typename T, typename = void> struct HasBeginT : std::false_type {}; template<typename T> struct HasBeginT<T, std::void_t<decltype(std::declval<T>().beg...

 
 
5 hours later…
6:35 AM
6
Q: How to dynamically pick a member from two similar C++ structures while avoiding code duplication?

iFarbodHaving the following structures: class XY { int test; }; class XYZ { short extra; int test; }; I want to use XY::test and XYZ::test depending on a runtime variable. Like: if (x == 1) { reinterpret_cast<XY*> (object)->test = 1; } else if (x == 2) { reinterpret_cast<XYZ*> (obje...

 
7:11 AM
0
Q: Click sub-subcommand

HaktigI want to create a python CLI script with the Click package. I looked at the documentation, but couldn't find out how to create a command with subcommand and sub-subcommand like this: cmd subcommand sub-subcommand <options> <args> An idea ? Thank you.

 
8:06 AM
3
Q: Scrabble with prime numbers!

Taco タコスHow to Play Overall, gameplay is very similar to typical Scrabble; however, unlike typical Scrabble, you'll be using numbers instead of letters (we'll cover your tile bag later). The objective is to achieve a higher score than your opponent while building prime numbers: A prime number (or a prim...

 
 
4 hours later…
11:53 AM
1
Q: Galois representations attached to a cusp form for different primes

user390304If I have a cusp form $f$, I can consider the associated Galois representation $\rho_l(f)$ for any prime $l$. For two distinct primes $p$ and $q$, what is the relationship between $\rho_p(f)$ and $\rho_q(f)$? Are they basically the same? How can I make the relationship precise?

 
 
1 hour later…
1:05 PM
4
Q: Isomorphic morphisms. A 27-morphism category

Wlod AATwo morphims of category $\ \mathbf C\ $ are isomorphic one to another $\ \Leftarrow:\Rightarrow\ $ they are the opposite edges that are drawn horizontally (aimed East) of a commutative square that has the vertical edges (aimed North) being isomorphisms of $\ \mathbf C$. Problem What is the minim...

 
 
1 hour later…
2:23 PM
6
Q: Delay between different function calls

MateuszI have a question about adding delay after calling various functions. Let's say I've function like: def my_func1(): print("Function 1") def my_func2(): print("Function 2") def my_func3(): print("Function 3") Currently I've added delay between invoking them like below: delay = 1 my_...

 
 
1 hour later…
3:35 PM
0
Q: Name a function after a string

samharI am trying to read different tabs from an excel file. For each tab I a want to perform a linear regression that returns a function (1st order polynom) I want to store the function under the name of tab or the data frame import pandas as pd import numpy as np dfs = pd.read_excel(r'Prod.xlsx', s...

 
 
2 hours later…
5:35 PM
6
Q: Why is IntoIter not owning the values?

DavidI want to iterate over the bytes of an integer: use core::mem::size_of; const SIZE: usize = size_of::<u64>(); fn main() { let x: u64 = 512; let mut buf: [u8; SIZE] = [0; SIZE]; for (i, b) in x.to_be_bytes().into_iter().enumerate() { buf[i] = b; } }...

 

« first day (2454 days earlier)      last day (931 days later) »