text stringlengths 1 1.11k | source dict |
|---|---|
moreover
from A3 have $$\forall a\in A.\ \langle a,b\rangle \in r$$
moreover
have $$\text{antisym}(Le)$$ and $$\text{antisym}(r)$$ using linord, NatOrder_ZF_1_L2, IsLinOrder_def
moreover
from A2, $$|A| \in nat$$ have $$\langle |A|,|A|\rangle \in Le$$ and $$\langle b,b\rangle \in r$$ using linord, NatOrder_ZF_1_L2, IsLinOrder_def, total_is_refl, refl_def
hence $$\langle |A|,|A|\rangle \in Le \longleftrightarrow \langle b,b\rangle \in r$$
ultimately have $$f \in ord\_iso(|A| \cup \{|A|\} , Le, A \cup \{b\} ,r)$$ by (rule ord_iso_extend )
with A1, A2 show $$f \in ord\_iso(|A \cup \{b\}| , Le, A \cup \{b\} ,r)$$ using card_fin_add_one
qed
ultimately have $$f = \sigma (A \cup \{b\})$$ using ord_iso_enum
moreover
have $$\sigma (A)\hookleftarrow b = f$$proof
have $$\sigma (A)\hookleftarrow b = \sigma (A) \cup \{\langle domain(\sigma (A)),b\rangle \}$$ using Append_def
moreover
from A1 have $$domain(\sigma (A)) = |A|$$ using enum_props, func1_1_L1 | {
"domain": "isarmathlib.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9863631675246405,
"lm_q1q2_score": 0.8017823756922308,
"lm_q2_score": 0.8128673110375457,
"openwebmath_perplexity": 2792.8752967890246,
"openwebmath_score": 0.9858716726303101,
"tags": null,
"url": "https://isarmathlib.org/Enumeration_ZF.html"
} |
regular-languages, automata, regular-expressions
Approach #1: Since the language is regular, we can find a DFA that recognizes it -- let's choose the minimal DFA. Since the language is finite, this DFA will not have any loops in it. Now if you apply the standard algorithm for converting a DFA to a regular expression, the result is a star-free regular expression. In fact, you get out only a single regular expression.
Approach #2: If the language is finite, then you can enumerate all of the words in the language, say $L=\{w_1,w_2,\dots,w_n\}$. Therefore $w_1 + w_2 + \dots + w_n$ is a regular expression for $L$.
Credit: The answer for the case where the language is finite is due to @J.E. Pin. | {
"domain": "cs.stackexchange",
"id": 5241,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "regular-languages, automata, regular-expressions",
"url": null
} |
java, programming-challenge, time-limit-exceeded
The count=A; is also wrong. You'd want to increment count here as well, not set it to 1.
You also don't correctly handle values for A like 6. It's not odd, but it's not a power of two either. You should reduce it to 1, but you won't so long as it is less than B. Instead you'll endlessly double it until the program crashes. | {
"domain": "codereview.stackexchange",
"id": 15160,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, programming-challenge, time-limit-exceeded",
"url": null
} |
neural-network, deep-learning, image-classification, convolution
This means ResNet does, except for the beginning and end of the network, not use pooling layers to reduce spatial dimensions but conv. layers.
Also, table 1 shows what is happening:
The part you have highlighted in your screenshot is the transition from conv3_x to the conv4_x layer of the 34-layer network. As you can see in the table the output size is reduced from 28x28 to 14x14 (that is what /2 does) while the filters are doubled from 128 to 256. | {
"domain": "datascience.stackexchange",
"id": 7206,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neural-network, deep-learning, image-classification, convolution",
"url": null
} |
the factor 2 follows from the fact that every edge bounds (at most) 2 faces R1
hence $$3f \leqslant 2e$$ AG
from the Euler relation, $$3f = 6 + 3e – 3v$$ M1
substitute in the inequality, $$6 + 3e – 3v \leqslant 2e$$ A1
hence $$e \leqslant 3v – 6$$ AG
[4 marks]
(c) let G have e edges M1
since G and $${G’}$$ have a total of $$\left( {\begin{array}{*{20}{c}} {12} \\ 2 \end{array}} \right) = 66$$ edges A1
it follows that $${G’}$$ has 66 – e edges A1
for planarity we require
$$e \leqslant 3 \times 12 – 6 = 30$$ M1A1
and $$66 – e \leqslant 30 \Rightarrow e \geqslant 36$$ A1
these two inequalities cannot both be met indicating that both graphs cannot be planar R1
[7 marks]
Total [18 marks]
## Examiners report
Parts (a) and (b) were found difficult by many candidates with explanations often inadequate. In (c), candidates who realised that the union of a graph with its complement results in a complete graph were often successful. | {
"domain": "iitianacademy.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9875683495127004,
"lm_q1q2_score": 0.8097007172168866,
"lm_q2_score": 0.8198933447152497,
"openwebmath_perplexity": 1356.8558396655224,
"openwebmath_score": 0.7188671231269836,
"tags": null,
"url": "https://www.iitianacademy.com/ib-dp-maths-topic-10-7-simple-graphs-connected-graphs-complete-graphs-hl-paper-3/"
} |
homework-and-exercises, newtonian-mechanics, forces, momentum
Title: Changing Momentum
Okay, so I am having a hard time wrapping my head around this. Before looking at the answer, I worked the example and got the answer only because I used dimensional analysis to get me to the right units for force. However, to be honest, I don't think I even understand the concept here. I know mass is changing and velocity is constant, but what is throwing me off is where it says "The water strikes the window at $32\, m/s$ so each kilogram of water loses $32\, kgm/s$ of momentum. Water strikes the window at the rate of $45\,kg/s$, so the rate at which it loses momentum to the window is $1400\, kgm/s^2$" How is it losing $32\, kgm/s$ of momentum and then at the same time also losing it at a rate of $1400\,kg m/s^2$?
Why does it even mention "The water strikes the window at $32\,m/s$ so each kilogram of water loses $32\,kgm/s$ of momentum" what is the purpose of that sentence. That is really confusing me. | {
"domain": "physics.stackexchange",
"id": 10101,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-mechanics, forces, momentum",
"url": null
} |
condensed-matter, solid-state-physics, tight-binding
This allows use to write down a good approximation for the matrix elements of the Hamiltonian in this particular basis. It does not, however, tell us what the electrons are actually doing. To do that for a system at finite temperature we need the density matrix, which, in thermal equilibrium, has the same eigenstates as the Hamiltonian. As you know, for any lattice system, these are the Bloch states and so these are the states which will determine the expectation values of any observables. Consequently, it is the non-localised Bloch states which are important to the physics of the system and not the Wannier states, which are simply an intermediate convenience. | {
"domain": "physics.stackexchange",
"id": 36136,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "condensed-matter, solid-state-physics, tight-binding",
"url": null
} |
algorithms, optimization, dynamic-programming
N ≤ 20 and Sin = 1
Subtask 2: For further 40% of the score,
E[i] = k for all i
i.e. E[i] is some constant k, for all i
Subtask 3: For further 50% of the score,
No further constraints.
============================================================================
I managed to solve the first subtask by employing a brute force solution (O(2^n)). But for the second and third subtasks I don't think that a brute force solution will be optimal.
Also, for the second subtask I have a vague idea. Taking X to be the number of trainings, then N-X is the number of battles. By maximizing experience gained from N-X battles, we might get the answer, but I'm not sure if it's the right way.
I do not have any idea of how to solve the 3rd Subtask without using a brute force algorithm. Help would be appreciated.
Edit: Link to the above question in the IARCS website : https://www.iarcs.org.in/inoi/2017/ It's a 2d dynamic programming question. | {
"domain": "cs.stackexchange",
"id": 10483,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, optimization, dynamic-programming",
"url": null
} |
javascript, unit-testing, node.js
I wouldn't say it's bad practise, having to provide anchors for test purposes isn't uncommon. Side affects would really boil down to how & where it's being used, in this case it looks very much like Express middleware and nowhere in the docs does it mention any rules about not returning values. Furthermore, if you dig into the source you'll find that middleware return values are ignored.
I think in your case returning a Promise from the middleware is the ideal solution. | {
"domain": "codereview.stackexchange",
"id": 27111,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, unit-testing, node.js",
"url": null
} |
quantum-gate, quantum-state, bloch-sphere, pauli-gates
As for overall phase on quantum gate, $U$ v.s $e^{i\theta}U$ , these two are indistinguishable as long as you don't do any control operation. That is, controlled-$U$ is not the same as controlled-$e^{i\theta }U$ . This is because the phase of the target qubit can be kicked back to the controlled-qubit and it is essentially how quantum phase estimation algorithm works. | {
"domain": "quantumcomputing.stackexchange",
"id": 1989,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-gate, quantum-state, bloch-sphere, pauli-gates",
"url": null
} |
their properties to model and solve real-life problems. What are the Applications of Trigonometry in Real Life? Ans. How do you sketch translations of sine and cosine functions? How do you use sine and cosine functions to model real-life data? Section 6. The simplest one is y = sin(x). Let's Get REAL! - (access here: bit. Fourier originally defined the Fourier series for real-valued functions of real arguments, and using the sine and cosine functions as the basis set for the decomposition. Graphing Sine and Cosine Functions Graph the function. Use sigma notation. circular functions. Sound waves travel in a repeating wave pattern, which can be represented graphically by sine and cosine functions. Sine and cosine — a. As you can see, the derivatives of the functions \text {arctanh}\,x and \text {arccoth}\,x are the same, but they are determined for different values of x. Thomas Paine's statement. Both of these functions are defined for all real numbers, since we can evaluate the sine and | {
"domain": "marcodoriaxgenova.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9902915223724212,
"lm_q1q2_score": 0.820891080723575,
"lm_q2_score": 0.8289388146603365,
"openwebmath_perplexity": 518.6406767028611,
"openwebmath_score": 0.7474116683006287,
"tags": null,
"url": "http://marcodoriaxgenova.it/qski/real-life-applications-of-sine-and-cosine-functions.html"
} |
php, cryptography
/**
* Get a string which uniquely represents the algorithms and keys used to encrypt the data.
* @return string
*/
function getTID ()
{
return substr(md5(md5($this->symmetricKey) . 'AES_SHA1' . md5($this->HMACKey)), 0, 8);
}
} Overall your design looks good for me. Nothing really bad here. Some suggestions on your architecture though:
Your cookie implementation is dependent on the CryptoSystem and the CookieStorage. But then a Cookie doesn't actually care about how it is stored or if its content is encrypted. This makes your cookie class very long though with three different responsibilities: representation of the cookie itself, storing & encryption. Furthermore, storing and encryption just delegate.
I'd consider a cookie as a simple value object which can be created everywhere (without a factory). The storage on the other hand is responsible for how the information is stored. One possibility of this how seems to be encrypted for me. | {
"domain": "codereview.stackexchange",
"id": 6329,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, cryptography",
"url": null
} |
computability, turing-machines, undecidability, semi-decidability
... we assume that in an ID the tape must be blank except for some finite number of squares ...
In this paper we show the solvability of the UH for one-state TM's ...
-----
So, to enumerate the $M_i \in L$ start a dovetailed simulation of $M_1,M_2,M_3,....$. | {
"domain": "cs.stackexchange",
"id": 6675,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "computability, turing-machines, undecidability, semi-decidability",
"url": null
} |
c, linked-list, memory-management
list->length++;
return 0;
}
/**
* slRemove: Remove data from SLList.
*
* @param list SLList to remove from.
* @param index Index of element to remove
* (Range between 0 and list->length-1);
*
* @return 0 on success.
* -1 on failure (invalid input).
*/
int SLList_remove(SLList *list, size_t index) {
if (list == NULL) return -1;
if (list->length <= index) return -1;
SLNode *node;
if (index == 0) {
node = list->head;
list->head = node->next;
} else {
size_t i;
SLNode *prev = list->head;
for (i = 1; i < index; i++) {prev = prev->next; };
node = prev->next;
prev->next = node->next;
}
SLNode_free(node);
list->length--;
return 0;
}
void SLList_clear(SLList *list) {
if (list == NULL) return;
SLNode *node, *tmp;
node = list->head;
while (node != NULL) {
tmp = node->next;
SLNode_free(node);
node = tmp;
}
list->head = NULL;
list->length = 0;
} | {
"domain": "codereview.stackexchange",
"id": 18088,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c, linked-list, memory-management",
"url": null
} |
molecular-biology, pcr, cloning
Is this a normal/common issue or does this result indicate that something wrong is happening in our experiments?
And more importantly, any idea of how to prevent such problems?
I have in mind:
Reducing the number of cycles (how low can one go?) and/or increasing the concentration of template (related).
Changing polymerase (but for which one and shouldn't Phusion High-Fidelity be one of the best suited?).
Changing other parameters or conditions (but which ones?) | {
"domain": "biology.stackexchange",
"id": 12095,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "molecular-biology, pcr, cloning",
"url": null
} |
haskell, io, quiz, state
putStrLn (vocab (test^.currentWord) (test^.target))
command db test
else do test' <- execStateT (hinted.=True) test
putStr "Hint: "
putStrLn (hint (test'^.currentWord) (test'^.source))
guess db test' | {
"domain": "codereview.stackexchange",
"id": 4488,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "haskell, io, quiz, state",
"url": null
} |
# CARA Coefficient Calculation
Consider the following scenario:
A consumer with CARA (constant absolute risk aversion) claims that she is indifferent between "getting $2400 for sure" and "getting $5000 or $0, each with 50% possibility".
I know that a consumer has CARA if and only if the vNM utility function is an affine transformation of $-e^{-\lambda x}$, where $x$ is the prize of the gamble. I was wondering how I could solve for the coefficient $\lambda$, given the above scenario.
To do so I wrote down the following equation:
$e^{-2400\lambda}=\frac{1}{2}e^{-5000\lambda}+\frac{1}{2}e^{-0\lambda}$
It is clear that $\lambda=0$ should be a solution to it. However, I found that this could not be the case, as $\lambda=0$ means risk neutral, which is controversial with the consumer's claim.
What should be the correct way of solving it? I think I must have made some stupid mistakes here but I couldn't figure it out. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9669140244715406,
"lm_q1q2_score": 0.8036438753825282,
"lm_q2_score": 0.831143054132195,
"openwebmath_perplexity": 337.3886901483576,
"openwebmath_score": 0.8789486289024353,
"tags": null,
"url": "https://economics.stackexchange.com/questions/17146/cara-coefficient-calculation/20191"
} |
electrostatics, quantum-electrodynamics, virtual-particles, magnetostatics, carrier-particles
But you could calculate the probabilities of various outcomes for a charged particle in an external electric or magnetic field, produced e.g. by many spinning electrons, using Feynman diagrams - where the virtual photons are the internal lines. The Feynman diagrams would be able to calculate the force acting on the probe particle. Some terms in the force wouldn't depend on the velocity - the electric forces - while others would depend on the velocity - the magnetic ones. These different terms would always come from the "same type" of virtual photons but all these photons depend on the sources of the field, so you would of course get different results for electric and magnetic fields. | {
"domain": "physics.stackexchange",
"id": 317,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrostatics, quantum-electrodynamics, virtual-particles, magnetostatics, carrier-particles",
"url": null
} |
beginner, algorithm, c, validation, finance
Last of all I want to say: good job. The way to learn how to program is not a short one. I did it without help, and needed more then ten years to get it right (not perfect, but it was ok). But I didn't had internet back then.
I think it is a good idea to ask other people to review your code. You can learn many thinks and you can protect yourself of bad habits.
To learn even more you could read code written by other developers, but you have to search for nice clean code. Not every open source project is suitable to learn good coding ;-) | {
"domain": "codereview.stackexchange",
"id": 15230,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, algorithm, c, validation, finance",
"url": null
} |
javascript, performance, animation
consider using JSDoc to add comments above your functions.
Your comments sometimes start with a space, e.g. // Here and sometime dont //Here be consistent.
With this.validateAnimStates(this.ABS, this.AES) === false you can use !this.validateAnimStates(this.ABS, this.AES) | {
"domain": "codereview.stackexchange",
"id": 29662,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, performance, animation",
"url": null
} |
ros, image, windows
Title: from linux to windows usb camera connection
Hi everybody
I have ROS fuerte running on a robot (on which I have a ptz ethernet camera and a usb logitech camera). The robot is running on linux ubuntu oneiric (11.10). What I was wondering and I need your expert help on is this:
I can connect over wifi from a windows 7 machine to my robot. I can see from a web broswer the image coming from the PTZ ethernet camera. How can I connect and see the image coming from the usb logitech camera? On linux, when I run the command rosrun image_view image_view image:=/logitech_usb_cam/image_raw I can see the image. But how do I do that from a windows machine? Any ideas?
Thank you
Originally posted by agrirobot-George on ROS Answers with karma: 1 on 2013-02-10
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 12828,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, image, windows",
"url": null
} |
reinforcement-learning
Consider the control problem where the current state is specified by the current room Bunny is in, and the actions Bunny can take are to move through a door to another room. Assume that there are 2 doors in the starting room, each leading to its own room, and that one of these other rooms (specifically the one on the left) has a single door that leads to the exit, while the other one (specifically the one on the right) has a tiger in it.
Moreover, assume that Bunny has full knowledge of these details but that
there is a 10% chance that when trying to move through one of the doors,
he gets confused and goes through the other door instead. Lastly, assume
that the episode does not end when Bunny enters the room with the tiger.
Questions | {
"domain": "datascience.stackexchange",
"id": 2969,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reinforcement-learning",
"url": null
} |
crystal-structure, software, cheminformatics
H -0.1470 0.3330 -0.3060
H -0.2320 0.4140 -0.103
H -0.1280 0.3810 0.186
H 0.7330 0.0190 0.3810
H 0.8130 0.1470 0.3710
H 0.6990 0.1060 0.2370
H 0.7250 -0.0340 0.836
H 0.6470 -0.0070 0.961
H 0.6230 -0.1410 0.861 | {
"domain": "chemistry.stackexchange",
"id": 2066,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "crystal-structure, software, cheminformatics",
"url": null
} |
java, programming-challenge, sqlite, maven
Writer writer = Files.newBufferedWriter(Paths.get(badDataFilename));
CSVWriter csvWriter = new CSVWriter(writer,
CSVWriter.DEFAULT_SEPARATOR,
CSVWriter.NO_QUOTE_CHARACTER,
CSVWriter.DEFAULT_ESCAPE_CHARACTER,
CSVWriter.DEFAULT_LINE_END);
String[] headerRecord = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J"};
csvWriter.writeNext(headerRecord);
PreparedStatement pstatement = connection.prepareStatement("INSERT INTO X(A,B,C,D,E,F,G,H,I,J) "
+ "VALUES(?,?,?,?,?,?,?,?,?,?);");
String[] nextRecord;
while ((nextRecord = csvReader.readNext()) != null)
{
recordsReceived++; | {
"domain": "codereview.stackexchange",
"id": 35368,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, programming-challenge, sqlite, maven",
"url": null
} |
Last edited: Mar 26, 2014
5. Mar 26, 2014
### D H
Staff Emeritus
This kind of thing happens all the time, where two ways of approaching an integral give apparently contradictory results. For example, consider $\int 2\sin(x)\cos(x)\,dx$. One approach is via the u substitution $u=\sin x$, which immediately leads to $\int 2\sin(x)\cos(x)\,dx = \sin^2 x +C_1$. Another approach is to realize that the integrand is $\sin(2x)$, which leads to $\int 2\sin(x)\cos(x)\,dx = -\frac 1 2 \cos(2x)+C_2$. These two solutions differ by a constant.
6. Mar 26, 2014
### MexterO
Still so weird, then what about the definite case...
Okay, yes I see that those are legitimate ways of solving that integral, but what irks and has always irk me since calculus 1 is the fact that there is no way that those two solutions are the same. | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9683812309063186,
"lm_q1q2_score": 0.8211560579062032,
"lm_q2_score": 0.8479677545357568,
"openwebmath_perplexity": 473.4538255836332,
"openwebmath_score": 0.855186402797699,
"tags": null,
"url": "https://www.physicsforums.com/threads/u-substitution-is-this-allowed.745313/"
} |
thermodynamics, energy, energy-conservation, work
$\Delta K = W_c + (W_{frict} + W_{nco}) $
Again, along the lines of what I have already said, this equation should probably read:
$$W = W_c + (W_{frict} + W_{nco}) $$
According to the [Wikipedia article on friction][1]:
$E_{th} = W_{frict} $
IMO the Wikipedia article is poorly written in this regard. They are saying that friction work equals heat. That is not correct. Heat is energy transfer due solely to temperature difference. Friction is energy transfer by means of work. Although the term "friction heating" is commonly used (and because of that I'm often compelled to use it myself), friction is not a "heating process". The work involved in the relative motion between the surfaces results in an increase in the internal energy of the surfaces as reflected by an increase in their temperatures. Then heat transfers from the higher temperature surfaces to the interior of the materials and the environment. | {
"domain": "physics.stackexchange",
"id": 66726,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, energy, energy-conservation, work",
"url": null
} |
machine-learning, deep-learning, time-series, lstm, pytorch
However, for predicting future values in the long term, forecasting, if you will, you need to make either multiple one-step predictions or multi-step predictions that span over the time period you wish to forecast.
Making multiple one-step predictions based on the values predicted the model yields plausible results in the short term. As the forecasting period increases, the predictions become less accurate and therefore less fit for the purpose of forecasting.
To make multiple one-step predictions and update the input after each prediction, we have to work our way through the dataset one by one, as if we are going through a for-loop over the test set. Not surprisingly, this makes us lose all the computational advantages that matrix operations and mini-batch training provide us. | {
"domain": "datascience.stackexchange",
"id": 9063,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning, deep-learning, time-series, lstm, pytorch",
"url": null
} |
electromagnetism, magnetic-fields, energy-conservation, perpetual-motion
$$\mathbf m=m
\begin{pmatrix}-\sin(\theta)\\0\\\cos(\theta)\end{pmatrix}
\text{ at }
\mathbf r=R
\begin{pmatrix}\cos(\theta)\\0\\\sin(\theta)\end{pmatrix}.$$
With this, the potential energy of each spoke magnet is
$$U=-\mathbf m\cdot\mathbf B=3\frac R a mB_0\sin(\theta)\cos(\theta)=\frac32\frac Ra mB_0\sin(2\theta).$$
To see how this behaves, here is a colour plot of the energy, with negative energy in red and positive energy in blue. | {
"domain": "physics.stackexchange",
"id": 61300,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, magnetic-fields, energy-conservation, perpetual-motion",
"url": null
} |
biochemistry, molecular-biology, cell-biology, pigmentation, melanin
Disclaimer: this is just an example, of course I do NOT intend to feed my dog anything at all, it's just a hypothesis. What I want to know is that raising cysteine/glutathione levels can really contribute to pheomelanin production? I know that theoretically, in lab tests a higher cysteine concentration means a higher pheomelanin production, but I am interested in actual living things. If this is possible, it can be a huge breakthrough. If you have the opinion that cysteine alone won't make the difference, than what will? According to the graph attached, that's the only thing making the difference. Surprisingly, it is indeed possible! But, the fact is that the actual process is a bit more complex and might actually require more compounds along with cysteine to give such effects in living beings. First of all, see this image1: | {
"domain": "biology.stackexchange",
"id": 6693,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "biochemistry, molecular-biology, cell-biology, pigmentation, melanin",
"url": null
} |
general-relativity, black-holes, event-horizon, singularities, cosmic-censorship
I do not understand the final sentence.
Firstly, for $|Q|>M$, I find that $r_{\pm}$ is imaginary.
Secondly, even if $r_{+} < 0$, this does not make sense: $r$ is a radial coordinate. How can it be less than $0$? It can't. You are right, it is simply imaginary, i.e. It does not exist. And neither does $r_-$. It means there is no horizon, but you still have the singularity. So, if it existed as a physical case, it would be a naked singularity. | {
"domain": "physics.stackexchange",
"id": 40906,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, black-holes, event-horizon, singularities, cosmic-censorship",
"url": null
} |
formal-languages, regular-languages, closure-properties
I believed that the answer for (1) should be (2), because when I get a word in $w \in L$ and $w=xy$ I can build an automaton that can guess where $x$ turning to $y$, but then it needs to verify that $y$ belongs to $L_2$ and if it won't be regular, how would it do that?
The answer for that is (1).
What should I do in order to analyze those operators correctly and to determine if the regular languages are closed under them or not? To answer these question, we need allow any $L_2$. So let's think that $L_2$ is a very complex language (say, some undecidable language.)
Lets start from the easy question: $A_l(L)$ (question part 2). Take $L_2$ to be undecidable, and $L=\{\varepsilon\}$. What happens?
(moral: Always check the "extremes": empty $L$, $L=\{\varepsilon\}$ and $L=\Sigma^*$...) | {
"domain": "cs.stackexchange",
"id": 177,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "formal-languages, regular-languages, closure-properties",
"url": null
} |
slam, navigation, p3dx, slam-gmapping, gmapping
Originally posted by sar1994 on ROS Answers with karma: 46 on 2015-12-23
Post score: 0
There is a synchronisation problem between the robot and the workstation computers. I used chrony for synchronising both and it worked !!
Originally posted by sar1994 with karma: 46 on 2016-06-25
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 23286,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "slam, navigation, p3dx, slam-gmapping, gmapping",
"url": null
} |
particle-physics, antimatter, neutrinos, elementary-particles
For each neutrino, there also exists a corresponding antiparticle, called an antineutrino, which also has no electric charge and half-integer spin. They are distinguished from the neutrinos by having opposite signs of lepton number and chirality. As of 2016, no evidence has been found for any other difference
The chirality difference, the way the spin of a fermion is oriented with respect to its motion, gives different interaction crossections; for example neutrino nucleon scattering versus antineutrino nucleon scattering. | {
"domain": "physics.stackexchange",
"id": 40990,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "particle-physics, antimatter, neutrinos, elementary-particles",
"url": null
} |
python, recursion, file-system
Note the use of copy2, which is identical to copy but attempts to preserve metadata.
This can be convenient for e.g. music files.
The parent attribute is the logical parent path to the found file, so essentially all path elements except for the found file itself.
Like in your solution, those path elements (directories) have to be created first.
In mkdir, exist_ok=False is the default and would prohibit us from most desired operations, like copying files in subdirectories.
The above gives the following result, which is hopefully what you are aiming for:
~$ tree
.
├── dest
│ ├── file1.py
│ ├── test1
│ │ ├── file2.py
│ │ └── file3.py
│ └── test2
│ ├── file4.py
│ └── test3
│ └── file5.py
└── source
├── file1.py
├── test1
│ ├── file2.py
│ └── file3.py
└── test2
├── file4.py
└── test3
└── file5.py | {
"domain": "codereview.stackexchange",
"id": 38300,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, recursion, file-system",
"url": null
} |
meteorology, atmosphere, models, atmosphere-modelling, wrf
Title: Technique to delete spin-up frames from WRF I'm a user of WRF V3.5 aiming at meteorological simulation.
Sometimes, I'll run the model for a long period.
My attempt
I split the long period(e.g 1 year) into serval short ones.
For example:
## WPS namelist.wps
start_date = '2014-01-01_06:00:00'
end_date = '2014-01-31_23:00:00'
## WRF run period setting in .csh file.
set year = "2014"
foreach strtime (010106010512 010500011012 011000011512 011500012012 012000012512 012500013012 013000020100)
set smon = `echo ${strtime}|cut -c1-2`
set sday = `echo ${strtime}|cut -c3-4`
set shr = `echo ${strtime}|cut -c5-6`
set emon = `echo ${strtime}|cut -c7-8`
set eday = `echo ${strtime}|cut -c9-10`
set ehr = `echo ${strtime}|cut -c11-12` | {
"domain": "earthscience.stackexchange",
"id": 748,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "meteorology, atmosphere, models, atmosphere-modelling, wrf",
"url": null
} |
ros, python
Title: ROS Theoretical Question - How does work properly a node I'm new at ROS and I'm trying to figure out how does the node works with a pyton/C++ code. I have two codes for the same situation:
Use a Xbox Controller to move the turtle in turtlesim
FIRST - Using class python and a while as a main:
#!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
from sensor_msgs.msg import Joy
# DEFINING CLASS
class pubSub:
def __init__(self):
# DEFINE VARIABLE TO KEEP LAST VALUE
rospy.init_node('c2t')
self.twt = Twist()
self.hold = Twist()
def callback_function(self,joyData):
self.twt.linear.x = 4*joyData.axes[1]
self.twt.angular.z = 4*joyData.axes[0]
self.hold = self.twt
def assuming_cont(self):
pub = rospy.Publisher('turtle1/cmd_vel', Twist, queue_size=10)
rospy.Subscriber("joy", Joy, self.callback_function, queue_size=10)
pub.publish(self.twt) | {
"domain": "robotics.stackexchange",
"id": 1882,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, python",
"url": null
} |
interval from 1 to 2, we know it is between the left and right estimates, so it must be about 0. The files can also be found at the bottom of the page. Follow 175 views (last 30 days) Actually, I have a research about the rectangular method, that's why. Calculate the deflection of pros calculator for ers area moment static deflection and natural frequency static deflection and natural frequency beam stress deflection mechanicalc Beam Deflection Calculator For Solid Rectangular …. To see this, let’s divide the region above into two rectangles, one from x = 1 to x = 2 and the other from x = 2 to x = 3, where the top of each rectangle comes just under the curve. So, let’s divide up the interval into 4 subintervals and use the function value at the right endpoint of each interval to define the height of the rectangle. inscribed rectangles. The sum result is the area under the curve since the interval between elements is 1, each element value represents the area of a small rectangle (heigth | {
"domain": "centropartenopeo.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9808759632491111,
"lm_q1q2_score": 0.8195057111990796,
"lm_q2_score": 0.8354835289107307,
"openwebmath_perplexity": 316.55087815325567,
"openwebmath_score": 0.8472341895103455,
"tags": null,
"url": "http://bbdr.centropartenopeo.it/area-under-curve-calculator-with-rectangles.html"
} |
homework-and-exercises, waves
Start off with the standing wave equation, $$y(x,t)=2A\sin(kx)\cos(\omega t)$$
To get the $y$-velocity of a particle on the wave, take the partial derivative wrt time.
$$\dfrac {\partial y} {\partial t}=\dfrac{\partial}{\partial t}\left(2A\sin(kx)\cos(\omega t) \right)$$
The $2A \sin(kx)$ term does not depend on $t$, and you get,
$$\dfrac {\partial y} {\partial t}=2A\sin(kx)\dfrac{\partial}{\partial t}\left(\cos(\omega t) \right)$$
Which finally becomes $$\dfrac {\partial y} {\partial t}=-2A\omega\sin(kx)\cos(\omega t) \\ \implies v_y=-2A\omega\sin(kx)\cos(\omega t)$$
Then, knowing that the wave number $k=\dfrac{2\pi}{\lambda}$ and that $\lambda=2L$, as you correctly stated, you obtain $k=\dfrac{\pi}{L}$. This gives
$$v_y=-2A\omega\sin\left(\dfrac{\pi}{L}x\right)\cos(\omega t)$$
As you can see, for $x=L/2$, the y-velocity won't always be zero. Similarly, the end points will always have a velocity of zero.
Your mistake was computational. | {
"domain": "physics.stackexchange",
"id": 76031,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, waves",
"url": null
} |
computability, proof-techniques, decision-problem, uncountability
A program is "just" an integer in $\mathbb{N}$ cause it is a finite string of bits. The point that I fail to understand is how it is possible that a decision problem is comparable to a real number instead of an integer ... I mean, if we use the argument of "put a dot in front of the number" could not the same reasoning also be applied to the number of possible algorithms that can ever be produced? If I understand you correctly, your question is —
why a solution can be encoded by a natural number and a problem with a real number.
(I assume that you understand the next phase of the proof which is based on the difference between sets of cardinality $\mathfrak c$ and $\aleph_0$.)
The reason lies in set theory, more specifically in the cardinality of different sets.
Count the number of programs — it is the size of the different strings of a specific language or set of characters (ASCII for example). This size is equivalent to the size of the set $\mathbb{N}$ (natural numbers). | {
"domain": "cs.stackexchange",
"id": 14263,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "computability, proof-techniques, decision-problem, uncountability",
"url": null
} |
quantum-field-theory, particle-physics, field-theory, path-integral, classical-field-theory
We see that $W[J]$ is large only if $J_1(x)$ and $J_2(x)$ overlap significantly in their Fourier transform and if the region of overlap in momentum space $k^2-m^2$ almost vanishes. There is a "resonance type" spike at $k^2=m^2$. | {
"domain": "physics.stackexchange",
"id": 38919,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, particle-physics, field-theory, path-integral, classical-field-theory",
"url": null
} |
Corollary 6
If $X$ is a shrinking space, then $X$ is countably paracompact.
____________________________________________________________________
Reference
1. Ball, B. J., Countable Paracompactness in Linearly Ordered Spaces, Proc. Amer. Math. Soc., 5, 190-192, 1954. (link)
2. Rudin, M. E., A Normal Space $X$ for which $X \times I$ is not Normal, Fund. Math., 73, 179-486, 1971. (link)
3. Rudin, M. E., Dowker Spaces, Handbook of Set-Theoretic Topology (K. Kunen and J. E. Vaughan, eds), Elsevier Science Publishers B. V., Amsterdam, (1984) 761-780.
4. Wikipedia Entry on Dowker Spaces (link)
____________________________________________________________________
$\copyright \ 2016 \text{ by Dan Ma}$
# Product Space – Exercise Set 1
This post presents several exercises concerning product spaces. All the concepts involved in the exercises have been discussed in the blog.
____________________________________________________________________
Exercise 1 | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9914225128122336,
"lm_q1q2_score": 0.8082398475701057,
"lm_q2_score": 0.8152324938410784,
"openwebmath_perplexity": 1637.948484019525,
"openwebmath_score": 1.0000100135803223,
"tags": null,
"url": "https://dantopology.wordpress.com/tag/normal-space/"
} |
c++, iterator, c++17
back_insert_iterator& operator=(typename Container::value_type&& value) {
std::apply([&](auto&... container) { ((container.push_back(std::move(value))), ...); }, containers);
return *this;
}
back_insert_iterator& operator*() {
return *this;
}
back_insert_iterator& operator++() {
return *this;
}
back_insert_iterator& operator++(int) {
return *this;
}
private:
std::tuple<Container&, Containers&...> containers;
};
template <class Container, class... Containers>
auto back_inserter(Container& container, Containers&... containers) {
return back_insert_iterator<Container, Containers...>(container, containers...);
}
}
And you can use it like this:
#include <iostream>
#include <vector>
auto main() -> int {
const auto numbers = std::vector<int>{ 1, 2, 3, 4, 5 };
std::vector<int> copy1, copy2;
std::copy(numbers.begin(), numbers.end(), stx::back_inserter(copy1, copy2)); | {
"domain": "codereview.stackexchange",
"id": 32377,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, iterator, c++17",
"url": null
} |
javascript, html5, google-maps, salesforce-apex
When passing arrays between server side and client side, use serialization and parsing instead of mixing markup into your scripts with an <apex:repeat> tag.
Using the above, your code might look more like:
(function (w, $) {
"use strict";
$(function () {
var map, marker, marker2, propLat, propLong,
myOptions = {...},
geocoder = new google.maps.Geocoder(),
address = '{!JSENCODE(Property__c.Property_Address__c) & JSENCODE(...) & etc.}';
// and other properties
geocoder.geocode(..., function () {
// this function can be declared separately
// instead of anonymously
});
});
}(window, jQuery.noConflict())); | {
"domain": "codereview.stackexchange",
"id": 22373,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, html5, google-maps, salesforce-apex",
"url": null
} |
performance, c, security, email, curl
MIME-Version: 1.0
Received: by 10.37.194.194 with HTTP; Tue, 11 Aug 2015 18:42:25 -0700 (PDT)
Date: Tue, 11 Aug 2015 20:42:25 -0500
Delivered-To: person@gmail.com
Message-ID: <CJYf78Vnxbma4wdV1mZuBXHPeEptOzyjH1vLMzLwnhoXsPw@mail.gmail.com>
Subject: Gmail Test
From: syb0rg <person@gmail.com>
To: 5555555555@tmomail.net
Content-Type: multipart/alternative; boundary=001a11c04f6ca3e68e051d1354cc
--001a11c04f6ca3e68e051d1354cc
Content-Type: text/plain; charset=UTF-8
Body content
--001a11c04f6ca3e68e051d1354cc
Content-Type: text/html; charset=UTF-8
<div dir="ltr">Body content</div>
--001a11c04f6ca3e68e051d1354cc--
The actual dissection of each line of this email is done in my final code with comments
Final Code
Please note that this code leaks memory and doesn't contain a unique ID generation method.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <curl/curl.h> | {
"domain": "codereview.stackexchange",
"id": 15466,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, c, security, email, curl",
"url": null
} |
homework-and-exercises, newtonian-mechanics, projectile, drag
EDIT:
Ok, so, now let's do some analysis of the behavior:
$$\dot y = v_{y} = \frac{cv_{y0} + g}{c}e^{-ct} - \frac{g}{c}$$
$$\dot x = v_{x} = v_{x0}e^{-ct}$$
So, that constant $c$ defines a unit with which the x velocity decays to zero, and with which the $y$ velocity decays from an initial velocity of $v_{y0}$ to a late-time velocity $-\frac{g}{c}$, which is the terminal velocity of the motion. So, for a high value of $c$, the motion both decays more quickly, and reaches a lower terminal velocity. Now, going back to a vectorized version of Newton's Second law that I used to derive the initial equations, we have:
$$m{\vec a} = \sum{\vec F} = -m {\vec g} - mc {\vec v}$$ | {
"domain": "physics.stackexchange",
"id": 87631,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-mechanics, projectile, drag",
"url": null
} |
c++, memory-management
if (hi == hbound) {
hi = nullptr;
}
for (;;) {
if (lo) {
if (lo->hasBlock(p, chunkLength)) {
return lo;
}
if (lo == lbound) {
lo = nullptr;
if (!hi) {
break;
}
} else {
--lo;
}
}
if (hi) {
if (hi->hasBlock(p, chunkLength)) {
return hi;
}
if (++hi == hbound) {
hi = nullptr;
if (!lo) {
break;
}
}
}
}
return nullptr;
} | {
"domain": "codereview.stackexchange",
"id": 42330,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, memory-management",
"url": null
} |
turing-machines, computability, decision-problem
Title: Show a TM-recognizable language of TMs can be expressed by TM-description language of equivalent TMs I am studying "An Introduction to the Theory of Computation" by Sipser -- there is a problem *3.17 (p.161) which I can not solve.
Any hints (not answers) from which side to attack it?
Let $B=\{M_1, M_2, ...\}$ be a Turing-recognizable language consisting of TM descriptions. Show that there is a decidable language C consisting of TM descriptions s.t. every machine in B has an equivalent machine in C and vice versa. Technical hint: assume that every string is a legal encoding of a TM. Can you solve this now?
Intuitive hint: the language $C$ can contain many other encodings as well as those that are equivalent to the machines in $B$. Perhaps so many that $C$ becomes decidable. | {
"domain": "cs.stackexchange",
"id": 16764,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "turing-machines, computability, decision-problem",
"url": null
} |
python, performance, hash-map
Title: Optimize performance of flatten function in python I have to flatten a large number (>300k) dicts to write them to a csv file.
Example:
dict = {
a: b,
c: [
{
d:e
},
{
f:g
}
]
}
becomes:
a, c.0.d, c.1.f
b, e, g | {
"domain": "codereview.stackexchange",
"id": 18868,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, hash-map",
"url": null
} |
electrochemistry
Title: Why does electron flow from anode?
The above is a picture of Galvanic cell. Zinc anode is placed in Zinc sulfate solution so we have ions as Zn2+ and SO42-. On the cathode side we have the same situation we have Cu2+ and SO42-. My question is why the zinc rod is getting converted into zinc ions and copper ions are getting converted into atoms and get deposited on copper rod. Why is electron flowing from anode to cathode? The semi-reaction of reduction for Zn is :
$Zn^{2+} +2e^- \rightarrow Zn \quad E^\circ =-0.763$
The semi-reaction of reduction for Cu is :
$Cu^{2+} +2e^- \rightarrow Cu \quad E^\circ= 0.337$
The standard redox potential for Cu is more positive thus it is reduced and Zn is oxidized.
Electrons flow from a negative to a positive potential. They flow towards the cathode because their potential V, at the anode is more negative, thus they have an higher potential energy: $U_e = V*e$
note that $e$ the charge of the electron is negative as well as V. | {
"domain": "chemistry.stackexchange",
"id": 11442,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrochemistry",
"url": null
} |
organic-chemistry, molecular-orbital-theory
When we are talking about "possible" physical properties of not-yet-synthesized compounds, the answer is resoundingly "yes". Graphene, for instance, has more theoretically predicted qualities than have been measured. Super conductance, tensile strengths, diffusion rates... there is just so much exiting being suggested all a result of computer modeling on the quantum level from MO theory and the likes. | {
"domain": "chemistry.stackexchange",
"id": 7642,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, molecular-orbital-theory",
"url": null
} |
, Substituting these values in , we get Also 7. Alternatively, this formula can also be written as s (1) ( 1)( 2)23 2! 3! (1)( 2. there are many techniques to find the interpolation, Newton’s Forward Interpolation is one of, very widely used formulas. We can calculate the interpolated values directly with the. Linear interpolation is a process employed in mathematics, and numerous applications thereof including computer graphics. Newton's Divided Difference Polynomial (General Order): Example Part 1; 13. The divided difference polynomial is just Newton’s interpolating polynomial applied to this type of problem. When the arguments are equally spaced i. A better form of the interpolation polynomial for practical (or computational) purposes is the barycentric form of the Lagrange interpolation (see below) or Newton polynomials. Marco Roello. Python in the browser. formula calculate the polynomial interpolating the following data: f(1;1); (4;2); (9;3)g Show that it is the same polynomial | {
"domain": "tergolandia.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9863631639168357,
"lm_q1q2_score": 0.8017823705237986,
"lm_q2_score": 0.8128673087708699,
"openwebmath_perplexity": 852.6907276840162,
"openwebmath_score": 0.7347735166549683,
"tags": null,
"url": "http://cphq.tergolandia.it/newton-interpolation-example.html"
} |
For instance, if untruncated logic is the default convention, we may use the adverb merely to denote propositional truncation. Thus the phrase
“there merely exists an $x:A$ such that $P(x)$ | {
"domain": "planetmath.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9780517450056273,
"lm_q1q2_score": 0.8407956260295587,
"lm_q2_score": 0.8596637451167997,
"openwebmath_perplexity": 430.16087788279094,
"openwebmath_score": 0.9029503464698792,
"tags": null,
"url": "http://planetmath.org/310whenarepropositionstruncated"
} |
quantum-mechanics, heisenberg-uncertainty-principle, wave-particle-duality
What if, instead of analyzing the situation at hand through the distance traveled, it was analyzed by analyzing the passage of time. Specifically, if time is quantized, would it resolve the dichotomy paradox in a physical sense? I realize that whether or not time is quantized is up for debate (there is even this question here at stack exchange that explores the idea), so I am not going to ask if time is quantized. Based off of my understanding, however, there is nothing known as of now that says time cannot be quantized (please correct me if I am wrong). Therefore, if time were quantized then could we not say that for a given constant velocity there is a minimum distance that can be traveled? A distance that corresponds to $\Delta t_{min} * v$? Would this not imply that as our moving box reached a certain distance, $d$ away from point B, and if $d < \Delta t_{min} * v$, the box would physically not be able to travel such a small distance, and in the next moment that the box moved, it | {
"domain": "physics.stackexchange",
"id": 11664,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, heisenberg-uncertainty-principle, wave-particle-duality",
"url": null
} |
(2) Both $$\sqrt{x}$$ and $$\sqrt{y}$$ are prime numbers. The same here: $$\sqrt{x}=2$$ and $$\sqrt{y}=3$$. Sufficient.
I didnt get how 3 factors imply its x and y are prime nos. ?
Math Expert
Joined: 02 Sep 2009
Posts: 29802
Followers: 4904
Kudos [?]: 53647 [0], given: 8167
Re: New Set: Number Properties!!! [#permalink] 04 Apr 2013, 03:01
Expert's post
sunshinewhole wrote:
Bunuel wrote:
3. If 0 < x < y and x and y are consecutive perfect squares, what is the remainder when y is divided by x?
Notice that since x and y are consecutive perfect squares, then $$\sqrt{x}$$ and $$\sqrt{y}$$ are consecutive integers. | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9385759565090548,
"lm_q1q2_score": 0.815459932111983,
"lm_q2_score": 0.8688267864276107,
"openwebmath_perplexity": 1195.4935970415402,
"openwebmath_score": 0.7336602807044983,
"tags": null,
"url": "http://gmatclub.com/forum/new-set-number-properties-149775-60.html"
} |
Likewise, $1$ is the parent of $3$ and $4$.
For example, the second tier's length is $2$.
i.e. $[1,2]$
Let's say $i$ is the index of the node in question, and $j$ is the index of the tier.
e.g. In the diagram above, if the node in question $(i)$ is $3$, $j$ is $0$, because $3$ is the first element in the 3rd tier.
i = the index of the heap, indicating the node in question
j = the index of the tier where the node in question exists
T = tier
The maximum number of nodes in a certain tier can be expressed by...
$2^T - 1$ E.g. when you have 3 tiers, you can put 7 nodes, as $2 \cdot 2 \cdot 2 - 1 = 7$
This means that the index of the node in question looks like...
$i = 2^T-1 - 1 + j$ //This will shortly become "$i + 1 = 2^T-1 + j$"
The first child (left child) of $i$ can be derived by...
$i' = 2^T -1 + 2j$
If you don't see why I multiplied $j$ by 2, I would suggest you draw a map on a paper and see the indexes of $i - 1$'s left and right child. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9783846640860382,
"lm_q1q2_score": 0.8276571054622156,
"lm_q2_score": 0.8459424353665382,
"openwebmath_perplexity": 423.32611352125036,
"openwebmath_score": 0.9204259514808655,
"tags": null,
"url": "https://cs.stackexchange.com/questions/87154/why-does-the-formula-2n-1-find-the-child-node-in-a-binary-heap/87163"
} |
the identity function, i.e., the function $x \mapsto x$ any differentiable function $\! g'$ $f \circ g = g$, so $(f \circ g)' = g'$. $(f \circ g)' = (f' \circ g) \cdot g'$. Since $f$ is the function $x \mapsto x$, its derivative is the function $x \mapsto 1$. Plugging this in, we get that $f' \circ g$ is also the constant function $x \mapsto 1$, so $(f \circ g)' = 1g' = g'$.
any differentiable function the identity function $\! f'$ $f \circ g = f$, so $(f \circ g)' = f'$. $(f \circ g)' = (f' \circ g) \cdot g'$. Since $g$ is the identity function, $g'$ is the function $x \mapsto 1$. Also, $f' \circ g = f'$. Thus, $(f \circ g)' = f' \cdot 1 = f'$. | {
"domain": "subwiki.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9879462176445589,
"lm_q1q2_score": 0.8122786373832213,
"lm_q2_score": 0.8221891261650247,
"openwebmath_perplexity": 2122.458222484768,
"openwebmath_score": 0.999799907207489,
"tags": null,
"url": "https://calculus.subwiki.org/w/index.php?title=Chain_rule_for_differentiation&diff=595&oldid=594"
} |
packages fail to evaluate the integral SymPy is much slower to say so (timeout for SymPy compared to 1 or 2 seconds for Sage to return an unevaluated integral). Evaluate expressions with arbitrary precision. For example a is supposed to be a positive (and hence real) number. SymPy implements a combination of the Risch algorithm [6], table lookups, a reimplementation of Manuel Bronstein's "Poor Man's Integrator" [5], and an algorithm for computing integrals based on Meijer G-functions [34, 35]. You can type any expression in the input box to evaluate it. To this end, I've been working on an LLVM JIT converter for Sympy expressions (using the llvmlite wrapper). By default, 15 digits of precision are used, To later evaluate this integral, call doit. Contribute to sympy/sympy development by creating an account on GitHub. When I tried the area, mean, variance, and MGF, all the integrals hanged, and I had to abort the operation. Cooper Washington State University Symbolic Calculus. ) The “as | {
"domain": "yiey.pw",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9748211590308922,
"lm_q1q2_score": 0.8058961451185194,
"lm_q2_score": 0.8267117898012105,
"openwebmath_perplexity": 1338.5135338409063,
"openwebmath_score": 0.7079145312309265,
"tags": null,
"url": "http://sgix.yiey.pw/sympy-evaluate-integral.html"
} |
fluid-mechanics
Title: Body submerged in two liquids A metallic cube of side 10cm, density 6.8gm/cc is floating in liquid mercury (density 13.6gm/cc), with 5cm height of cube exposed above mercury level. Water is filled over this to submerge the cube fully. What is the new height of the cube exposed above the mercury level? Question was really simple, We need to equate the total buoyancy force with the weight of the body. I was stuck with before and after situation so was not able to solve it. Answer is the block will rise by 0.4cm.
Total Buoyancy force for a body immersed in two fluid
= Density of water*g(S1*V1+S2*V2)
V1 & V2 being volume of block in respective fluid. S1 and S2 specific gravity
In this question 1-Mercury, 2-water
When water is filled over mercury, let us assume that the block will rise by a x units.
Buoyancy force= 1000*g(S1*(5-x)+S2(5+x))= Weight of block. | {
"domain": "engineering.stackexchange",
"id": 1191,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fluid-mechanics",
"url": null
} |
cross-sectional area to. About the line 's let R be the inner radius a: outer radius b: b≧a volume... Whether the volume and surface area = 4π 2 Rr 2 where, R is the radius of trickiest... Question is does this integral, or band width of a torus … solution for 3.16 volume of a torus,... | {
"domain": "barnabasinstitute.org",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9719924793940119,
"lm_q1q2_score": 0.8013707982732136,
"lm_q2_score": 0.8244619328462579,
"openwebmath_perplexity": 861.7796938378502,
"openwebmath_score": 0.77825528383255,
"tags": null,
"url": "http://barnabasinstitute.org/qtno0/7e9ae4-volume-of-a-torus"
} |
quantum-mechanics, operators, commutator
(Last part of theorem 9.41 in my book Spectral Theory and Quantum Mechanics 2nd ed. 2017 Springer)
THEOREM Let $H$ be a complex Hilbert space, $A :D(A) \to H$ a generally unbounded selfadjoint operator, and $B:H\to H$ a bounded operator. The following facts are equivalent. | {
"domain": "physics.stackexchange",
"id": 97438,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, operators, commutator",
"url": null
} |
quantum-mechanics, operators, hilbert-space, hamiltonian, observables
The Hamiltonian:
We can write the probability amplitude as:
$$C_j(t+\Delta t) =\sum_{j} \mathrm{U}_{jk} C_k(t)\;.$$
As $\Delta t\to 0\,,$ $$\mathrm{ U}_{jk}\to \delta_{jk} \;.$$
So, we can write $$\mathrm{U}_{jk}(t+\Delta t,t)= \delta_{jk}+ \left(\frac{-i}{\hbar}\right)\mathrm{H}_{jk}\,\Delta t $$ where $\mathrm{H}_{jk}$ is defined as
$$\mathrm{ H}_{jk}= \lim_{\Delta t\to 0}\,\frac{\mathrm{U}(t+\Delta t)_{jk}- \mathrm{U}(t)_{jk}}{\Delta t}\;.$$
Using this, we re-write our amplitude as:
$$C_j(t+\Delta t)= \sum_{k}\left[\delta_{jk}- \left(\frac{i}{\hbar}\right)\,\mathrm{H}_{jk}(t)~\mathrm dt\right]\, C_k(t)$$
The elements $\mathrm{H}_{jk}$ constitute the Hamiltonian matrix.
$\mathrm H$s determine the time-variation of the state of the system; they include the "physics of situation" which cause the coefficients to change over time.
The physical situation can correspond to electric field, varying magnetic field- anything. $\rm H$s ascertain what will happen over time.
tl;dr: | {
"domain": "physics.stackexchange",
"id": 29720,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, operators, hilbert-space, hamiltonian, observables",
"url": null
} |
electromagnetism, waves, electromagnetic-radiation, classical-electrodynamics, maxwell-equations
When deriving the model of a plane wave, we assume $E_z = C = 0$, i.e. there is no electric field component in the direction of propagation.
(a) Why do we select the initial condition $C = 0$?
(b) Are there any special cases in which $C \neq 0?$
(c) Would assuming $C \neq 0$ lead to mathematical contradictions? What about physical contradictions? Plugging a plane wave solution $\vec{E}=\vec{E_0}e^{i\vec{k}\cdot\vec{x}-i\omega t}$ into $\nabla\cdot\vec{E}=0$ yields
$$ 0=\vec{E_0}\cdot\vec{k}\;e^{i\vec{k}\cdot\vec{x}-i\omega t} $$ and thus
the field is necessarily orthogonal to the direction of propagation.
You may also start from an unknown field $\vec{E}$ and Fourier transform
$$\nabla\cdot\vec{E} = 0 \rightarrow \vec{k}\cdot\vec{E}_k =0 $$
And since each $\vec{k}$ constitutes a plane wave, the result holds without having assumed a plane wave solution to begin with. | {
"domain": "physics.stackexchange",
"id": 60204,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, waves, electromagnetic-radiation, classical-electrodynamics, maxwell-equations",
"url": null
} |
## Ideals (Prime, Maximal, Proper, Principal, etc)
### Fall 2021 #5
Let $$R$$ be an algebra over $$\mathbb{C}$$ which is finite-dimensional as a $${\mathbb{C}}{\hbox{-}}$$vector space. Recall that an ideal $$I$$ of $$R$$ can be considered as a $${\mathbb{C}}{\hbox{-}}$$subvector space of $$R$$. We define the codimension of $$I$$ in $$R$$ to be \begin{align*} \operatorname{codim}_R I \coloneqq \dim_{{\mathbb{C}}} R - \dim_{{\mathbb{C}}} I ,\end{align*} the difference between the dimension of $$R$$ as a $$\mathbb{C}{\hbox{-}}$$vector space, $$\dim_{{\mathbb{C}}} R$$, and the dimension of $$I$$ as a $${\mathbb{C}}{\hbox{-}}$$vector space, $$\dim_{\mathbb{C}}I$$.
• Show that any maximal ideal $$m \subset R$$ has codimension 1 .
• Suppose that $$\operatorname{dim}_{C} R=2$$. Show that there exists a surjective homomorphism of $${\mathbb{C}}{\hbox{-}}$$algebras from the polynomial ring $${\mathbb{C}}[t]$$ to $$R$$. | {
"domain": "dzackgarza.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9908743636887527,
"lm_q1q2_score": 0.8030827774478073,
"lm_q2_score": 0.8104789132480439,
"openwebmath_perplexity": 362.4303021135475,
"openwebmath_score": 0.9997151494026184,
"tags": null,
"url": "https://quals.dzackgarza.com/10_Algebra/TexDocs/QualAlgebra_stripped.html"
} |
proteins, uniprot, gene-ontology
>$ head goa_uniprot_all.gaf -n 20
!gaf-version: 2.2
!
!The set of protein accessions included in this file is based on UniProt reference proteomes, which provide one protein per gene.
!They include the protein sequences annotated in Swiss-Prot or the longest TrEMBL transcript if there is no Swiss-Prot record.
!
!date-generated: 2021-02-12 21:14
!generated-by: UniProt
!go-version: http://purl.obolibrary.org/obo/go/releases/2021-02-08/extensions/go-plus.owl
!
UniProtKB A0A009GUA7 J508_4179 GO:0003677 GO_REF:0000002 IEA InterPro:IPR006119|InterPro:IPR036162 F Resolvase/invertase-type recombinase catalytic domain-containing protein J508_4179 protein taxon:1310609 20201128 InterPro
UniProtKB A0A009GUA7 J508_4179 GO:0006310 GO_REF:0000002 IEA InterPro:IPR006119|InterPro:IPR036162 P Resolvase/invertase-type recombinase catalytic domain-containing protein J508_4179 protein taxon:1310609 20201128 InterPro | {
"domain": "bioinformatics.stackexchange",
"id": 1869,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "proteins, uniprot, gene-ontology",
"url": null
} |
quantum-mechanics, quantum-spin, probability
It is common practise to normalise wave-functions, such that the probability
$$P_{total} = \left| \mid r\rangle\right|^2 = 1$$
This is a physical requirement. If we stuck with having $\frac{1}{2}$ rather than $\frac{1}{\sqrt{2}}$ then the probability for each would be $\frac{1}{4}$, and the total probability would be $\frac{1}{2}$, which is less than 1, this is simply unphysical. For example, if we are looking at the probability of finding a particle somewhere, and we look in all space, we would still only have a 50% of finding the particle. The normalisation is put in by hand to guarantee that this total probability on all space would sum up to 1 (i.e. 100%). | {
"domain": "physics.stackexchange",
"id": 29010,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-spin, probability",
"url": null
} |
Now let $$x = y = 0$$ and $$z > 0.$$ There are $$6$$ ways for that to happen. Multiply by $$2$$ to account for $$z < 0,$$ then by $$3$$ to account for the other choices of which variables are zeros.
Finally add $$1$$ for the case $$x = y = z = 0,$$ which was not covered by any of the other cases.
The total will be $$377$$ if you do all these calculations correctly. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9603611563610179,
"lm_q1q2_score": 0.8200646424264666,
"lm_q2_score": 0.8539127566694178,
"openwebmath_perplexity": 289.1258247692788,
"openwebmath_score": 0.7990229725837708,
"tags": null,
"url": "https://math.stackexchange.com/questions/3157381/determine-the-number-of-ordered-triple-x-y-z-of-integer-numbers-negatives"
} |
You may or may not know the Pythagorean Theorem, which says, for any right triangle, this equation is true:
\begin{align*}(leg)^2 + (leg)^2 = (hypotenuse)^2\end{align*}
What this means is that if you are given two sides of a right triangle, you can always find the third. Therefore, if you have two sides of a right triangle are congruent to two sides of another right triangle; you can conclude that third sides are also congruent.
The Hypotenuse-Leg (HL) Congruence Theorem is a shortcut of this process.
HL Congruence Theorem: If the hypotenuse and leg in one right triangle are congruent to the hypotenuse and leg in another right triangle, then the two triangles are congruent.
\begin{align*}\triangle ABC\end{align*} and \begin{align*}\triangle XYZ\end{align*} are both right triangles and \begin{align*}\overline{AB} \cong \overline{XY}\end{align*} and \begin{align*}\overline{BC} \cong \overline{YZ}\end{align*} then \begin{align*}\triangle ABC \cong \triangle XYZ\end{align*}. | {
"domain": "ck12.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9790357549000773,
"lm_q1q2_score": 0.8004346510148687,
"lm_q2_score": 0.8175744828610094,
"openwebmath_perplexity": 6355.686699751187,
"openwebmath_score": 0.840915322303772,
"tags": null,
"url": "http://www.ck12.org/book/CK-12-Geometry-Basic/r1/section/4.4/"
} |
quantum-mechanics, quantum-information
$$ \sum_{ij} \lambda_{ij} |i_{A}\rangle |j_{B}\rangle = \sum_k \nu_k |\tilde{k}_A\rangle |\tilde{k}_B\rangle $$
with some orthonormal bases $|i_A\rangle,|\tilde{i}_A\rangle, |i_B\rangle, |\tilde{i}_B\rangle$. If you compare the two sides and consider the fact that orthonormal bases are related by a unitary matrix, this will lead you to the singular value decomposition. This means that the Schmidt decomposition is a (rather trivial) corollary to the singular value decomposition.
Now, there is a mathematical result that tells you that this is not possible in higher dimensions (you can remedy this to some degree, as noted in the comments). Sadly, I don't know a nice and intuitive argument of why this is not the case (you could work with Lagrangian multiplies and see that it is not possible, though). | {
"domain": "physics.stackexchange",
"id": 22254,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-information",
"url": null
} |
# 2d Vector Calculator | {
"domain": "quadri-canvas.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9820137868795701,
"lm_q1q2_score": 0.80740105517724,
"lm_q2_score": 0.822189123986562,
"openwebmath_perplexity": 751.5377189819011,
"openwebmath_score": 0.6384262442588806,
"tags": null,
"url": "http://quadri-canvas.it/muhh/2d-vector-calculator.html"
} |
sql, php5, sqlite
try {
$page = Page::fetch($id, $db);
$title = $page->getTitle();
$body = $page->getBody();
$time = $page->getTime();
date_default_timezone_set($page->getTimezone());
} catch (Exception $e) {
// This exception should be thrown by Page::fetch if no pages exist or an invalid
// id is given
// ...
exit;
}
?>
If this is preferred I will leave the class definition to you. | {
"domain": "codereview.stackexchange",
"id": 1374,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "sql, php5, sqlite",
"url": null
} |
optics
Title: Why light reflects off a surface? And what causes the phenomena of the total internal reflection? I have just watched two videos on the YouTube channel "Fermilab" about why light slows down in transparent mediums and why light refracts when moving between transparent mediums.
These two videos made me curious about light reflection off surfaces. I would like to know the exact mechanism.
What happens down at the atomic level when a ray of light is incident on a surface?
What causes light to reflect at the same angle as the incident light?
And in certain cases, why total internal reflection happens? This is a QM answer. You are asking about reflection, so I am going to talk about the visible wavelength photons.
When a photon interacts with an atom, three things can happen: | {
"domain": "physics.stackexchange",
"id": 59425,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics",
"url": null
} |
solid-state-physics, semiconductor-physics
But the energy of the electrons in the previous band has a maximum, so that their energy is generically
$$ E = -Bk^2$$
Since the zero of energy is defined by the location of the band, and as you vary k, the energy goes down. These electrons have a negative nonrelativistic effective mass, and their motion is crazy--- if you apply a force to these electrons, they move in the opposite direction! But this is silly--- these electron states are fully occupied, so the electrons don't move at all in response to an external force, because all the states are filled, they have nowhere to move to. | {
"domain": "physics.stackexchange",
"id": 42626,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "solid-state-physics, semiconductor-physics",
"url": null
} |
fft, python, radar
Here is some Python code that should do the trick:
n_fft = 256 #size of fft
AoA = np.fft.fft(rv_tg_va, n_fft, axis=0)/rv_tg_va.shape[1] #rv_tg_va is the range-doppler complex array for the target candidates of size numberOfCandidates * n_fft
AoA = np.fft.fftshift(AoA)
# AoA_magnitude = 10.*np.log10(np.abs(AoA))
wavelength = 0.0039189 # 76.5 GHz
d = wavelength/2. # distance btw receivers
f = np.arcsin(np.linspace(-0.5*wavelength/d , 0.5*wavelength/d , AoA.shape[0]))
maxFFT_idx = np.argmax(AoA, axis=0) #where the angles are supposed to be
plt.plot(np.rad2deg(f), AoA)
plt.grid()
plt.show() | {
"domain": "dsp.stackexchange",
"id": 11808,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fft, python, radar",
"url": null
} |
electromagnetism, special-relativity, waves, differential-equations
Title: Why are these solutions to wave equations not considered?
Do plane waves form a complete set (later edit: I meant basis)of solutions to the 3D wave equation ?
In this reference, page 164, there is huge array of solutions. Can one write one set of solutions as a linear combination of the other ?
Solutions to the 3D Laplace equation such as
$1/r$
and
$x/(x^2+y^2+z^2)^{3/2}$
are also solutions of wave equation (edit after Andrews answer: after removing some points from full 3D space).
Lorentz boosted versions of these are also solutions of wave equations. Why are these not considered while writing down the general solutions to wave equations. Or is it that these can be expanded in plane waves ?
Lastly perhaps most importantly, if there are general solutions not expressible as linear combinations of plane waves, how do I see that the general solution will not carry signals faster than light ?
Do plane waves form a complete set of solutions to the 3D wave equation ? | {
"domain": "physics.stackexchange",
"id": 83744,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, special-relativity, waves, differential-equations",
"url": null
} |
corrosion
Title: Combining Lead pipe with Zinc or Copper pipes in a domestic water installation Grateful if someone assists in explaining this example that appears on a high school text book. The problem can be summarized as follows:
"Old water networks supply water to a residential area via Pb lead pipes. A user wants to fit his own installation with pipe made out of either Zn or Cu. The intent is to reduce the lead presence in the water. Condition: the lead pipe of the municipality will remain unchanged up to the water gauge/meter at the house input.
Account for the presence of O2 in the water and give an explanation on your choice Zinc or Copper."
The solution suggested in the book shows Cu pipes, and excludes the use of Zn.
I would chose Zn. Reason would be that O2 would preferentially oxidize Zn instead of Pb. Thus preventing the formation of Pb oxide/hydroxides and consequent leaching in the water. | {
"domain": "chemistry.stackexchange",
"id": 14734,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "corrosion",
"url": null
} |
linux, assembly, x86
to:
cmp dword [esp], 1
je read
open:
Also note that in conjunction with the cmp instruction, it's better to use je and jne.
In conjunction with the test instruction, it's preferable to use jz and jnz.
je and jz have an identical encoding but choosing the right instruction mnemonic better expresses what the intention of the code is.
;if(esi<argc)
cmp dword esi, [esp]
jl open
The argc is by its very nature an unsigned number. After all it's just a count. You should use the conditional jumps that are provided to deal with the unsigned conditions. So better use jb open (JumpIfBelow).
Also there's no point in writing the dword size-tag. The mention of the dword register ESI already dictates the size.
mov edx, eax
mov eax, 4
mov ebx, 1
mov ecx, buf
int 0x80 | {
"domain": "codereview.stackexchange",
"id": 36394,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "linux, assembly, x86",
"url": null
} |
python, datetime
market_closed = is_friday or is_late_thursday or is_early_saturday
or, may be even easier and more understandable would be to define an open market time range and reverse the logic. And, it might be a good idea to extract this check into a separate reusable function (I'm sure you have this kind of check in other parts of your project).
now, we may use an early "return" if market is closed and omit the "else" part decreasing the nestedness:
if market_closed:
return 0
offset = (24 * day) + 2 if day < 6 else -22
hour += offset
# set result according granularity
if freq == Frequency.HOURLY:
return hour
elif freq == Frequency.MINUTELY:
return (hour * 60) + minute
according to PEP8, you should have spaces around operators
the offset calculation logic probably needs more explanation - consider adding an extra comment explaining the idea behind calculating it | {
"domain": "codereview.stackexchange",
"id": 24773,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, datetime",
"url": null
} |
c++, datetime
/** @brief
* @name get_input: Takes no arguments and returns an integer.
* @name goodbye: Takes no arguments and returns void.
* @name menu: Takes no arguments and returns void.
* @name run: Takes no arguments and returns void.
*/
int get_input();
void goodbye();
void menu();
void run();
/** @brief
* @name valid_month: Takes a string and returns a boolean indicating the validity of the month.
* @name valid_day: Takes a string and returns a boolean indicating the validity of the day.
* @name valid_year: Takes a string reference and returns a boolean indicating the validity of */
bool valid_month(std::string);
bool valid_day(std::string);
bool valid_year(std::string &year); | {
"domain": "codereview.stackexchange",
"id": 44698,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, datetime",
"url": null
} |
general-relativity, forces, metric-tensor, geodesics
Lets consider some kind of spherical-symmetric metrics (now we are not interested in the distribution of matter that caused it):
$$ds^2 = dt^2 - \frac{dr^2}{1-\frac{2M}{r}} - r^2(d\theta^2 + \sin^2\theta d\phi^2).$$
Nonzero components of $\Gamma^i_{jk}$:
\begin{align}
\Gamma^r_{rr} &= -\frac{M}{r^2}\frac{1}{1-\frac{2M}{r}},\\
\Gamma^r_{\theta\theta} &= 2M - r\\
\Gamma^r_{\phi\phi} &= (2M - r)\sin^2\theta\\
\Gamma^{\theta}_{r\theta} &= \Gamma^{\phi}_{r\phi} = \frac1r\\
\Gamma^{\theta}_{\phi\phi} &= -\sin\theta\cos\theta \\
\Gamma^{\phi}_{\theta\phi} &= \cot\theta,
\end{align}
$\Gamma\text{'s} = \lambda\text{'s}$.
The Riemann Tensor nonzero components:
\begin{align}
R_{r\theta r\theta} & = \frac{M}{r}\frac{1}{1-\frac{2M}{r}} \\
R_{r\phi r\phi} & = \frac{M}{r}\frac{\sin^2\theta}{1-\frac{2M}{r}} \\
R_{\theta\phi\theta\phi} &= - 2Mr\sin^2\theta
\end{align}
This metrics is only spattialy curved.
Scalar curvature $R = 0$. | {
"domain": "physics.stackexchange",
"id": 47966,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, forces, metric-tensor, geodesics",
"url": null
} |
2. THe balls are not numbered before the draw but are drawn one at a time. Hence we get a sequence of six 1s and 0s where 1 denotes a black and 0 denotes a white. A 'way' of drawing 6 balls including exactly 3 blacks is a permutation of the sequence 1,1,1,0,0,0. THis one is easy to answer. It's just an unordered drawing of three numbers from 1-6 without replacement.
5. Jul 13, 2015
### rajeshmarndi
The book solution is, as follows.
The possibilities are
(i) 3 black and 3 whites (ii) 4 black and 2 whites
case(i) C(4,3) * C(5,3) = 40 different ways
case(ii) C(4,4) * C(5,2) = 10 different ways.
Hence the total number of ways = 40 + 10 = 50
i.e here the ball are numbered B1, B2 etc i.e B1 B2 B3 W1 W2 W3, B2 B3 B4 W3 W4 W5 etc which doesn't make sense. If we ask how many different ways we can draw balls, it means what are the possible number of pattern of the color, one can get.
So I solve it as follows. | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9643214511730025,
"lm_q1q2_score": 0.809773482172678,
"lm_q2_score": 0.8397339716830606,
"openwebmath_perplexity": 413.306004858109,
"openwebmath_score": 0.7769777178764343,
"tags": null,
"url": "https://www.physicsforums.com/threads/combination-or-probability-question.823012/"
} |
text/html 8/18/2008 11:29:32 AM Mattias Sjögren 0. A double implication (also known as a biconditional statement) is a type of compound statement that is formed by joining two simple statements with the biconditional operator. When proving the statement p iff q, it is equivalent to proving both of the statements "if p, then q" and "if q, then p." (In fact, this is exactly what we did in Example 1.) So to do this, I'm going to need a column for the truth values of p, another column for q, and a third column for 'if p then q.' Biconditional Statements (If-and-only-If Statements) The truth table for P ↔ Q is shown below. Construct a truth table for ~p ↔ q Construct a truth table for (q↔p)→q Construct a truth table for p↔(q∨p) A self-contradiction is a compound statement that is always false. Mathematics normally uses a two-valued logic: every statement is either true or false. Sign up to get occasional emails (once every couple or three weeks) letting you know what's new! When we combine | {
"domain": "wildjusticemusic.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.952574129515172,
"lm_q1q2_score": 0.8564797613501972,
"lm_q2_score": 0.899121375242593,
"openwebmath_perplexity": 734.4940030100662,
"openwebmath_score": 0.5925559997558594,
"tags": null,
"url": "http://wildjusticemusic.com/american-satan-mkkicgb/biconditional-statement-truth-table-ad83f6"
} |
ibm-q-experience, qiskit
Title: How to delete pending jobs on IBM Quantum Computer to retrieve units? I am trying to run some code using qiskit, but I get the error message, that I have run out of necessary Experiment Units. I tried to remove pending jobs using the API with the following code
for job in api.get_jobs():
if job["status"] == "RUNNING":
api.cancel_job(id_job=job["id"], hub=None, group=None, project=None,
access_token=None, user_id=None) | {
"domain": "quantumcomputing.stackexchange",
"id": 163,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ibm-q-experience, qiskit",
"url": null
} |
c, parsing
This is an upgraded version that uses more descriptive variable names and structures instead of parallel arrays. This version can also handle functions of varying arity. I was even planning on doing short string optimization here but had to skip that because reasons.
#include <math.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
typedef struct Symbol {
unsigned arity, len;
const char *name;
union {
double
func0,
(*func1)(double),
(*func2)(double, double),
(*func3)(double, double, double);
};
} Symbol;
static int compar(const void *const restrict strp, const void *const restrict p) {
const unsigned len = ((const Symbol *)p)->len;
const char
*const str = *(const char *const *)strp,
*const name = ((const Symbol *)p)->name;
const int cmp = memcmp(str, name, len);
return cmp
? cmp
: isalnum((unsigned char)str[len]) || str[len] == '_' | {
"domain": "codereview.stackexchange",
"id": 45092,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c, parsing",
"url": null
} |
c, windows, sdl, virtual-machine
// Get the value from memory at the HL pointer in case an operation needs it.
hlMemVal = ReadMemory(emu.cpu.regs.HL);
// Don't actually execute an opcode if the system is halted or stopped.
if ((emu.state.halted == 0) && (emu.state.stopped == 0))
{
opcode = ReadMemory(emu.cpu.regs.PC);
if (emu.state.haltInstructionRepeat == 1) // If the halt bug occured, don't increment PC for one instruction.
emu.state.haltInstructionRepeat = 0;
else
emu.cpu.regs.PC++; | {
"domain": "codereview.stackexchange",
"id": 32065,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c, windows, sdl, virtual-machine",
"url": null
} |
boost
from /home/shah/code/ros_workspace/point_cloud_drone/src/pointcloud_builder_node.cpp:20:
/opt/ros/electric/stacks/ros_comm/utilities/message_filters/include/message_filters/sync_policies/exact_time.h: In member function ‘void message_filters::sync_policies::ExactTime<M0, M1, M2, M3, M4, M5, M6, M7, M8>::add(const typename boost::mpl::at_c<typename message_filters::PolicyBase<M0, M1, M2, M3, M4, M5, M6, M7, M8>::Events, i>::type&) [with int i = 1, M0 = geometry_msgs::PoseStamped_<std::allocator<void> >, M1 = geometry_msgs::Pose2D_<std::allocator<void> >, M2 = message_filters::NullType, M3 = message_filters::NullType, M4 = message_filters::NullType, M5 = message_filters::NullType, M6 = message_filters::NullType, M7 = message_filters::NullType, M8 = message_filters::NullType]’: | {
"domain": "robotics.stackexchange",
"id": 7718,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "boost",
"url": null
} |
# $\int_0^\infty \frac{\log(x)}{x^2+\alpha^2}$ using residues
I'm trying to find $\int_0^\infty \frac{\log(x)}{x^2+\alpha^2}dx$ where $\alpha>0$ is real. My approach was to take an integral along the real line from $1/R$ to $R$, around the circle counterclockwise to $-R$, along the real line to $-1/R$, and then around the circle clockwise to $1/R$. I have encountered 2 problems with this:
1. This path encloses one pole, at $z=\alpha i$. I found the residue at $z=\alpha i$ to be $\frac{\ln(\alpha)+i\pi/2}{2\alpha i}$. However, this gives me that $\int_0^\infty \frac{\log(x)}{x^2+\alpha^2}dx=\frac{\pi(\ln(\alpha)+i\pi/2)}{2\alpha}$. Since I have a real function integrated over the real line, there cannot be an imaginary part. Where did I go wrong? (Also, doing a few examples, the correct answer seems to be $\frac{\pi\ln(\alpha)}{2\alpha}$, the same as I have but without the imaginary part.) | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9833429609670702,
"lm_q1q2_score": 0.8236676988952621,
"lm_q2_score": 0.8376199673867852,
"openwebmath_perplexity": 188.96801340016916,
"openwebmath_score": 0.9639318585395813,
"tags": null,
"url": "https://math.stackexchange.com/questions/1375028/int-0-infty-frac-logxx2-alpha2-using-residues"
} |
python, performance, image, object-detection
def remove_pairs(
zeros: tuple[list[int], ...],
ones: tuple[dict[int, int], ...],
more: tuple[dict, ...],
) -> None:
"""Remove pairs if it's not a 1-1 match"""
for direction in (1, -1):
this_zero, other_zero = zeros[::direction]
this_one, other_one = ones[::direction]
this_more, other_more = more[::direction]
to_remove = []
for one_key, one_val in this_one.items():
if one_val not in other_one:
if one_val in other_more:
this_more[one_key] = one_val
else:
other_zero.append(one_val)
this_zero.append(one_key)
to_remove.append(one_key)
for t in sorted(to_remove, reverse=True):
del this_one[t]
def make_new_pair(
ones: tuple[dict[int, int], ...],
items: np.ndarray,
masks: np.ndarray,
) -> np.ndarray:
"""Second pair of image, with all 1-1 match""" | {
"domain": "codereview.stackexchange",
"id": 43494,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, image, object-detection",
"url": null
} |
php, security, authentication
however, my personal preference is just
isset($_POST)
I find that's it's easier to understand and is more intuitive.
This first two conditions encompass basically the entire function. Why not just reduce them to be negative and return false?
Such as
if (!isset($_POST['action']) or $_POST['action'] != 'login') {
return FALSE;
}
It's reduces unnecessary nesting. Apply the same for if ($_SERVER["REQUEST_METHOD"] == "POST").
if (!isset($_POST['user']) or $_POST['user'] == '' or !isset($_POST['password']) or $_POST['password'] == '')
could be simplified to
if (!isset($_POST['user'], $_POST['password']) or empty($_POST['user']) or empty($_POST['password']))
It's just easier to read.
In your minimum time check between form submissions, you've added an else, but because the initial condition would return false, an else is completely unnecessary. It also nests your code one more layer, which isn't too great if it can be avoided.
$user = test_input($_POST['user']); | {
"domain": "codereview.stackexchange",
"id": 8090,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, security, authentication",
"url": null
} |
algorithms, graphs, optimization, approximation, nearest-neighbour
The 1st nearest neighbor $n\in V$ to the set $S$ has the minimum sum of the distance to all the nodes in $S$.
Finding $n \in V$ to minimize $\Sigma_{s \in S}$ $d(s, n)$
I think solving a unique facility location problem with $S$ as the client nodes can be an answer for the problem when k=1. However, it may not provide a correct answer when k>1 since to the best of my knowledge, if the facilities are more than one, the clients are assumed to be served by their closest facility, so the distance of other facilities are not important if there exists a close facility to a subset of $S$ not all of them. However, I need a ranking of facilities while they consider the sum of the distance to all nodes in $S$ for all $k$ facilities. | {
"domain": "cs.stackexchange",
"id": 9930,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, graphs, optimization, approximation, nearest-neighbour",
"url": null
} |
modulo 2. Second is to show that it matches the number of transpositions. To see that it is well-defined modulo 2, note that we just have to show that the intersection between two given curves is well-defined modulo 2. Indeed if the permutation swaps the endpoints of the arcs, then they should intersect an odd number of times and if the permutation does not reverse the order of the endpoints, then the arcs intersect an even number of times. (This is because an arc locally disconnects the plane, so in order to get from one side to the other I have to cross the arc, and if I do it twice, I'm back on the side I started with.) So we have a well-defined intersection number modulo 2. Now write $\sigma$ as a product of transpositions $\tau_j$, and correspondingly stack the pictures for each $\tau_j$ to get a picture for $\sigma$. Then we just need to verify that the number of crossings in some standard picture of $\tau_j$ is odd, which is easy. All the arcs are straight except two, which form | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9886682468025243,
"lm_q1q2_score": 0.805994478203204,
"lm_q2_score": 0.8152324915965392,
"openwebmath_perplexity": 150.5266769886599,
"openwebmath_score": 0.9431997537612915,
"tags": null,
"url": "http://math.stackexchange.com/questions/46403/alternative-proof-that-the-parity-of-permutation-is-well-defined"
} |
python, tensorflow
Title: Tensorflow 2.0 - Layer with fixed input I'm trying to use Tensorflow to optimize a few variables to be used in a KNN algorithm, however, I'm running into an issue where I'm unable to have a layer work properly if it is not connected to an Input layer.
What I'm trying to do below is pass in [[1]] as a static tensor, and then using the Lambda layer to coerce the weights into a usable shape. Once trained, I would just retrieve the weight value from the first Dense layer.
ones = tf.ones(shape=(1,1)) # trying to use this to take the place of dynamic inputs
theta_layer = layers.Dense(1, activation="linear", use_bias=False, trainable=True)(ones)
theta_layer = layers.Lambda(lambda x: tf.ones(shape=(self.batch_size,1)) * x)(theta_layer)
print(theta_layer)
# tf.Tensor(
# [[-1.151663]
# [-1.151663]
# [-1.151663]], shape=(3, 1), dtype=float32)
concat_layer = layers.Concatenate()([theta_layer, features_input]) | {
"domain": "datascience.stackexchange",
"id": 7395,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, tensorflow",
"url": null
} |
test the integral $$\int_{0}^{\infty} \frac {x}{3x^4 + 5x^2 +1}dx$$ for convergence.
My thought
Can I compare it with 1/(3x^4)?
Any hints for the solution are appreciated!
• Is $3x^4+5x^2+1>x^4$? – John Wayland Bales Dec 7 '18 at 6:16
• you can try $$\frac{x}{3x^4+5x^2+1}\leq \frac{1}{x^3},\,\,\,x\geq 0$$ – Lau Dec 7 '18 at 6:19
• @Lau but I have to prove this fact first ....... is it proved here on math stack ? – hopefully Dec 7 '18 at 6:40
• This can be easily seen:$\forall x\geq0, \frac x{3x^4+5x^2+1}\leq\frac x{3x^4}\leq\frac x{x^4} \because$ the terms we ignore in the denominator are all positive. By ignoring them, we make the denominator smaller and thus the value of the ratio larger. – Shubham Johri Dec 7 '18 at 6:44
• I am not speaking about this @Lau I am speaking about proving the convergence of an integral that is different from the required one (the initial point differes) – hopefully Dec 7 '18 at 6:55 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9873750529474511,
"lm_q1q2_score": 0.804940213473605,
"lm_q2_score": 0.8152324803738429,
"openwebmath_perplexity": 874.0972564239765,
"openwebmath_score": 0.9554483294487,
"tags": null,
"url": "https://math.stackexchange.com/questions/3029548/test-the-integral-int-0-infty-frac-x3x4-5x2-1dx-for-convergenc"
} |
c++, performance, c++17, queue
std::is_trivially_destructible<T>::value){
theArray[originalHead] = other.theArray[originalHead];
} else {
new(&theArray[originalHead].value)T(other.theArray[originalHead].value);
}
}
originalHead = 0;
}
for(; originalHead < other.tail; ++originalHead){
if constexpr(std::is_trivially_copy_assignable<T>::value &&
std::is_trivially_destructible<T>::value){
theArray[originalHead] = other.theArray[originalHead];
} else {
new(&theArray[originalHead].value)T(other.theArray[originalHead].value);
}
}
tail = other.tail;
theSize = other.theSize;
return *this;
} | {
"domain": "codereview.stackexchange",
"id": 38715,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, performance, c++17, queue",
"url": null
} |
with the following vertices. The line between the focii is known as the major axis (in an ellipse and a hyperbola). A conic (or conic section) is a smooth curve formed when a plane intersects a pair of right circular cones placed point-to-point. Users have boosted their Conic sections knowledge & grades. Identify important characteristics of graph, such as center, vertices, and foci. Then graph each equation. It provides easy ways to calculate a conic section's axis, vertices, tangents and the pole and polar relationship between points and lines of the plane determined by the conic. Graphing Calculator. The Four Conic Sections Whether the result is a circle, ellipse, parabola, or hyperbola depends only upon the angle at which the plane slices through. Second: view the videos. The most comprehensive Conic sections APP for calculators. Conic Sections: Ellipses In this lesson you will learn how to write equations of ellipses and graphs of ellipses will be compared with their equations. | {
"domain": "cfalivorno.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.986777180580855,
"lm_q1q2_score": 0.8044528262201186,
"lm_q2_score": 0.8152324983301568,
"openwebmath_perplexity": 643.8893938340042,
"openwebmath_score": 0.4354986250400543,
"tags": null,
"url": "http://ngyp.cfalivorno.it/conic-sections-calculator.html"
} |
c#, xml
Entry Point:
private void SaveAuthor()
{
var xmlFileHandler = new XmlFileHandler();
//xmlFileHandler.CreateXmlFile();
xmlFileHandler.AddAuthor(new Author(1, "William", "Shakespeare", "englischer Dramatiker, Lyriker und Schauspieler",
new DateTime(1564, 04, 26), new DateTime(1616, 05, 3)));
xmlFileHandler.AddAuthor(new Author(2, "Friedrich", "Nietzsche", "deutscher Philologe und Philosoph",
new DateTime(1844, 10, 15), new DateTime(1900, 08, 25)));
}
XmlFileHandler class
public class XmlFileHandler
{
private const string FileName = "quotes.xml";
private const string AuthorsNodeName = "Authors";
public bool AddAuthor(Author author)
{
var xmlQuotes = XDocument.Load(FileName);
var authorExists = CheckIfAuthorAlreadyExists(author.AuthorId, xmlQuotes);
if (!authorExists)
{
this.AddAuthorToXmlDocument(author, xmlQuotes); | {
"domain": "codereview.stackexchange",
"id": 7082,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, xml",
"url": null
} |
Merge together and display the true and approximated outputs in the same graph using the function Merge Signal (Functions → Express → Signal Manipulation → Merge Signals). Configure the properties of the waveform graph as shown in Figure 3.
Figure 4 illustrates the completed block diagram of the numerical convolution.
Figure 5 shows the corresponding front panel, which can be used to change parameters. Adjust the input exponent powers and approximation pulse-width Delta to see the effect on the MSE.
### Convolution Example 2
Next, consider the convolution of the two signals x(t)=exp(2t)u(t)x(t)=exp(2t)u(t) size 12{x $$t$$ ="exp" $$- 2t$$ u $$t$$ } {}and h(t)=rect(t22)h(t)=rect(t22) size 12{h $$t$$ = ital "rect" $${ {t - 2} over {2} }$$ } {} for , where u(t)u(t) size 12{u $$t$$ } {}denotes a step function at time 0 and rect a rectangular function defined as | {
"domain": "cnx.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9777138151101525,
"lm_q1q2_score": 0.8423378078680412,
"lm_q2_score": 0.8615382076534743,
"openwebmath_perplexity": 3395.228428659996,
"openwebmath_score": 0.6266806721687317,
"tags": null,
"url": "http://cnx.org/content/m19840/1.3/"
} |
graph-theory, expanders
Title: Existence of long induced paths in expander graphs Let's say that a graph family $\mathcal{F}$ has long induced paths if there is a constant $\epsilon > 0$ such that every graph $G$ in $\mathcal{F}$ contains an induced path on $|V(G)|^{\epsilon}$ vertices. I am interested in properties of graph families that ensure the existence of long induced paths. In particular, I am currently wondering whether constant-degree expanders have long induced paths. Here is what I know.
Random graphs with constant average degree (in the Erdős–Rényi model) have long (even linear-size) induced paths with high probability; see for example Suen's article.
Unique-neighbor expander graphs (as defined by Alon and Copalbo) have large induced trees. In fact, any maximal induced tree is large in such graphs. | {
"domain": "cstheory.stackexchange",
"id": 2795,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "graph-theory, expanders",
"url": null
} |
\begin{align} x+y & =a \\ xy & =b \end{align}
Solve for $$y$$, so we can graph them:
\begin{align} &y=-x+a\\ &y=b\frac{1}{x} \end{align}
The first equation is a line with gradient $$-1$$ (so it slopes diagonally right-down), with y-intercept at $$a$$, which could be positive or negative or zero.
The second equation is two curves, symmetrical over the diagonal line $$y=x$$, and also over the diagonal line $$y=-x$$. Perhaps it's easier to see in the original form $$xy=b$$: whatever values of $$x,y$$ make this equation true, swapping them is also makes it true.
If $$b$$ is positive, there's two curves, one in quadrant I (both $$x,y$$ are positive), and the other in quadrant III (both $$x,y$$ are negative). If $$b$$ is negative, the curves are in quadrants II and IV (only one of $$x,y$$ is negative). In all, $$y$$ is not defined at $$x=0$$.
Finally, the line and curves constrain $$x,y$$ to their intersection. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9817357221825194,
"lm_q1q2_score": 0.8003428500700055,
"lm_q2_score": 0.8152324826183821,
"openwebmath_perplexity": 152.86757160851369,
"openwebmath_score": 0.8997465372085571,
"tags": null,
"url": "https://math.stackexchange.com/questions/3197444/are-two-numbers-a-and-b-uniquely-determined-by-their-addition-ab-and-pr/3197883"
} |
thermodynamics
$$p(\omega) = \frac{1}{\mathcal{Z}}\,\sqrt{\omega}\,\exp\left(-\frac{\hbar\,\omega}{k\,T}\right)\tag{2}$$
where:
$$\mathcal{Z} = \int_0^\infty \,\sqrt{u}\,\exp\left(-\frac{\hbar\,u}{k\,T}\right)\,\mathrm{d}u\tag{3}$$ | {
"domain": "physics.stackexchange",
"id": 31949,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics",
"url": null
} |
jupiter, magnetic-field, saturn
Title: Jupiter's magnetosphere interacts with the one from Saturn? Jupiter's magnetosphere extends "seven million kilometers in the Sun's direction and almost to the orbit of Saturn in the opposite direction" and Saturn's magnetosphere extends towards the Sun on average 22 Rs (Rs=60,330 km is the equatorial radius of Saturn).
My question is: do these magnetospheres actually touch each other when the planets are on the same line? A planet's magnetic field extends furthest in the direction away from the sun. This longest part of the magnetic field is called the magnetotail.
Jupiter's magnetic field is huge. It's tail extends up to 7,000 Jupiter radii, or about 490 million km per Wikipedia. | {
"domain": "astronomy.stackexchange",
"id": 2252,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "jupiter, magnetic-field, saturn",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.