« first day (2732 days earlier)      last day (677 days later) » 

5:50 AM
6
Q: Why is __aexit__ not fully executed when it has await inside?

S.BThis is the simplified version of my code: main is a coroutine which stops after the second iteration. get_numbers is an async generator which yields numbers but within an async context manager. import asyncio class MyContextManager: async def __aenter__(self): print("Enter to the C...

 
 
1 hour later…
7:20 AM
8
Q: Pair of short exact sequences of groups

Daniel SebaldDoes there exist a pair of finite groups $G$ and $H$ satisfying both of the short exact sequences $1 \rightarrow G \rightarrow H \rightarrow A_4 \rightarrow 1$ and $1 \rightarrow G \rightarrow H \rightarrow D_6 \rightarrow 1$? Of course the homomorphisms $G \to H$ in these short exact sequences a...

 
 
3 hours later…
10:22 AM
5
Q: Implement Binary Exponentiation

Aiden ChowBackground In programming, there is a recursive algorithm called binary exponentiation, which allows for large integer powers to be calculated in a faster way. Given a non-zero base \$x\$ and a non-negative exponent \$n\$, the algorithm goes something like this (based on the example code from Wik...

 
 
8 hours later…
6:38 PM
6
Q: "if" statement syntax differences between C and C++

Tom Hicksonif (1) int a = 2; This line of code is valid C++ code (it compiles at the very least) yet invalid C code (doesn't compile). I know there are differences between the languages but this one was unexpected. I always thought the grammar was if (expr) statement but this would make it valid in both. ...

 
 
2 hours later…
8:38 PM
2
Q: Noether–Enriques using Tsen's lemma

KaiConsider the following weak version of the Noether–Enriques theorem (field is $\mathbb{C}$): Let $\varphi:X\rightarrow Z$ be a morphism from a smooth projective surface to a smooth curve with $F_z:=\varphi^{-1}(z)\cong\mathbb{P}^1$ for every point $z$. Then there exists a Zariski open neighborho...

 
 
1 hour later…
9:50 PM
7
Q: Iterating over an enum class: it works, but is it conforming the standard?

Bertwim van BeestIn the c++ code below+output, the following is used to iterate over the values of an enum class, say MyEnumClass: (the enum class has contiguous values) for (const auto& e : MyEnumClass() ) { // ... } In order for the range-based for-loop to work, I had to define the operators ++ and *, as we...

 

« first day (2732 days earlier)      last day (677 days later) »