text
stringlengths
1
1.11k
source
dict
c++, c++11, queue, lock-free, atomic The node structure is defined as a struct with private fields. This makes it a class. If it has private fields, prefer a class. The node structure is an implementation detail that is not exposed, you do not need to bother with private here. Just remove the friend declaration and remove the private and public declarations. Keep it simple silly ;) Writing lock-free data structures is difficult and error-prone at best with risk for very subtle bugs and race conditions that only occur very rarely. Are you really sure you need a lock-free queue? Do you have profiling data to back this up? You mentioned boost was out of the question, but for your own mental health and hair growth, please do consider using a well tested lock-free queue implemented by experts. The use of template<typename U> is unnecessary. The nested class is automatically a template class with the same parameters as the enclosing class. Simply change node<T> to node and remove template<typename U> from the class declaration.
{ "domain": "codereview.stackexchange", "id": 13554, "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++, c++11, queue, lock-free, atomic", "url": null }
ros, uav, drone Comment by ROSCMBOT on 2016-01-31: @crazymumu Any info about the commercial drones using Pixahawk? Comment by vooon on 2016-02-29: 3DR Solo is based on pixhawk and has onboard computer. But i do not know it is hackable or not. At least they support DroneKit, so you may tie telemetry channel to network (and then run mavros on other machine). Comment by automate on 2016-06-01: @vooon can u please expand on your suggestion of using dronekit with mavros? Dronekit will connect to the solo and control it. What do you mean by tieing telemetry channel to network? Comment by mfkj on 2018-10-18: Can you please define us about the names of drone instead of flight controller/auto pilots?
{ "domain": "robotics.stackexchange", "id": 23495, "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, uav, drone", "url": null }
statistical-mechanics, cosmology, arrow-of-time, multiverse All universes that are in a direct or indirect causal relationship with ours have to have the "same" arrow of time as ours - one that doesn't contradict our arrow of time. It must be possible to define the arrow "uniformly" across the whole spacetime and all of its regions. In particular, one can never mix both arrows of time within the same universe - or the same multiverse. That would be logically equivalent to having closed time-like curves - which are inevitably inconsistencies - because you could get to the future along one arrow and back to the past - which would still be to the future according to another arrow of time. Evolution by the standard laws, starting with any well-defined slice, automatically preserves the uniformity of the arrows of time even when one allows tunneling and eternal inflation. Cheers LM
{ "domain": "physics.stackexchange", "id": 311, "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": "statistical-mechanics, cosmology, arrow-of-time, multiverse", "url": null }
# Zero to the zero power - is $0^0=1$? Could someone provide me with good explanation of why $0^0 = 1$? My train of thought: $x > 0$ $0^x = 0^{x-0} = 0^x/0^0$, so $0^0 = 0^x/0^x = ?$ 1. $0^0 \cdot 0^x = 1 \cdot 0^x$, so $0^0 = 1$ 2. $0^0 = 0^x/0^x = 0/0 = \text{undefined}$ PS. I've read the explanation on mathforum.org, but it isn't clear to me.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9362850093037731, "lm_q1q2_score": 0.8048902843274588, "lm_q2_score": 0.8596637523076225, "openwebmath_perplexity": 248.84215821830452, "openwebmath_score": 0.905488908290863, "tags": null, "url": "http://math.stackexchange.com/questions/11150/zero-to-the-zero-power-is-00-1/11211" }
neural-network, deep-learning, nlp, transformer, attention-mechanism Title: Transformer architecture question I am hand-coding a transformer (https://arxiv.org/pdf/1706.03762.pdf) based primarily on the instructions I found at this blog: http://jalammar.github.io/illustrated-transformer/. The first attention block takes matrix input of the shape [words, input dimension] and multiplies by the attention weight matrices of shape [input dimension, model dimension]. The model dimension is chosen to be less than the input dimension and is the dimension used as output in all subsequent steps.
{ "domain": "datascience.stackexchange", "id": 8980, "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, nlp, transformer, attention-mechanism", "url": null }
c++, c++11, stack class Stack { public: Stack(); Stack(const Stack& other); Stack(Stack&& other) noexcept; ~Stack(); Stack<T>& operator =(const Stack<T>& other); Stack<T>& operator =(Stack<T>&& other) noexcept; void swap(Stack<T>& other) noexcept; friend void swap(Stack<T>& A, Stack<T>& B) { A.swap(B); } void pop(); T& top(); void push(T item); //Pass T by value? What if T is big and expensive? private: struct Node { Node* next; T data; //Should data be stored as a reference instead? (i.e: T& data) }; //Should I be adding constructors/destructors and such in this struct?
{ "domain": "codereview.stackexchange", "id": 21230, "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++, c++11, stack", "url": null }
• This worked, thanks! Is this method documented anywhere? – Joe Bentley Jul 3 at 8:54 • No idea if it is documented. I coded a variant a long time ago to answer a question raised in the Usenet group sci.math.symbolic. Now I cannot locate that thread. It may have had a reference.What would be nice (but I have not worked out) would be a way to avoid having to force there to be no permutations. That would, among other things, allow for handling of matrices that have zeros as eigenvalues. – Daniel Lichtblau Jul 3 at 12:42 FindInstance gives the solution you expect. Module[{X, j, T, n = 2}, X = {{-2, 0}, {0, 2}}; j = DiagonalMatrix[{1, -1}]; T = Array[t, {n, n}]; T /. FindInstance[ Simplify[ X - T.j.T\[ConjugateTranspose] == ConstantArray[0, {n, n}] // ComplexExpand], Flatten[T]]] {{{0, -Sqrt[2]}, {-Sqrt[2], 0}}} Use Reduce for symbolic matrices.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9783846691281407, "lm_q1q2_score": 0.8256540326122749, "lm_q2_score": 0.8438951045175643, "openwebmath_perplexity": 3339.4775410404745, "openwebmath_score": 0.43220052123069763, "tags": null, "url": "https://mathematica.stackexchange.com/questions/224767/find-solution-for-specific-similarity-transformation" }
thermodynamics, energy, combustion Title: What is change in internal energy of a system in which combustion occurs at constant temperature? We got a question in a test, in which we were asked which system has zero change in internal energy and it had an option which was combustion of methane at constant temperature. I imagined this to be a situation in which the combustion is carried out in a system, where the change in internal energy of system due to heat released, is cancelled by the work done by the system. The reason why I thought of this is because of the formula, ∆U=nCv∆T,
{ "domain": "chemistry.stackexchange", "id": 14880, "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, combustion", "url": null }
radioactivity, electronics, image-processing First I've verified that the cover works by looking at the images from the camera with a desktop application. The images were all pitch black. I than have written a python script that takes images, highpass-filters every individual pixel and all three color channel (to cancel "hot pixels" and similar artifacts and concentrate on changes), and calculates the average (for sanity check) and standard distribution of the tremendous amount of 1 byte samples. The images are of a resolution of 1280x720 pixels, therefore each image consits of $1280 * 720 * 3 = 2,764,800$ samples. Taking ten thousand of these gives one $2.76*10^6*10^4 = 2.76*10^{10}$ samples. I consider this quite a lot. I base my trust in this amount on the very much less amount of data taken by the application. It might take a few dozen or maybe a hundred pictures, but nothing more. The app simply doesn't run that long.
{ "domain": "physics.stackexchange", "id": 17048, "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": "radioactivity, electronics, image-processing", "url": null }
python, file-system print "Date:",strftime("%d %b %Y") print "Hi There, Today is ",strftime("%A")," And time is ", strftime("%I:%M:%S:%P"), ", So on this beautiful ",strftime("%A"),"", time_d," I welcome you to this Backup program." def source_destination(self): w_s = True w_ss = True while w_s: source = raw_input('Please Enter The Complete Path of Source Directory: ') if source == '': print "***You have not Specified Anything***" print "***Source Directory is required in Order to make backup***" continue elif os.path.exists(source) == False: print "***Source Path Does not Exists***" print "***Please check source path and Try Again***" continue else: print "***Specified source path is ACCEPTED***" w_s = False backup.source_s = source
{ "domain": "codereview.stackexchange", "id": 844, "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, file-system", "url": null }
performance, c, library, vectors, macros Title: Generic vector implementation in C using macros I while ago I experimented with macros in C and came up with the idea of implementing a generic vector library using macros. This code uses the non standard typeof extension that returns the type of an expression. #ifndef VECTOR_H #define VECTOR_H #include <stdlib.h> #include <string.h> #define VECTOR_OF(T) struct { \ typeof (T) *data; \ unsigned size; \ unsigned capacity; \ } #define VECTOR_INIT_ASSIGN(VEC, VAL) do { \ typeof (VEC) *vec = &(VEC); \ typeof (VAL) val = (VAL); \ vec->data = malloc(sizeof *vec->data); \ vec->size = vec->capacity = 1; \ vec->data[0] = val; \ } while (0) #define VECTOR_INIT_ASSIGN_N(VEC, N, VAL) do { \ typeof (VEC) *vec = &(VEC); \ unsigned n = (N); \ typeof (VAL) val = (VAL); \ vec->data = malloc(n * sizeof *vec->data); \ vec->size = vec->capacity = n; \ while (n-- > 0) \ vec->data[n] = val; \ } while (0)
{ "domain": "codereview.stackexchange", "id": 40921, "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, library, vectors, macros", "url": null }
python, recursion, sorting, python-3.x def is_sorted(s): ''' recursive function when passed a list returns a bool telling whether or not the values in the list are in non-descending order: lowest to highest allowing repetitions. ''' if len(s) <= 1: return True elif s[0] < s[1]: return is_sorted(s[1:]) else: return False def sort(l): ''' recursive function when passed a list; it returns a new list (not mutating the passed one) with every value in the original list, but ordered in non- descending order. ''' if len(l) == 0: return [] else: (before, after) = separate(lambda i: i < l[0], l[1:]) return sort(before) + [l[0]] + sort(after)
{ "domain": "codereview.stackexchange", "id": 12052, "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, sorting, python-3.x", "url": null }
• This is a good intuitive way to think about it. A formal proof is too heavy for a over-a-cup-of-coffee discussion, this is just right. I'll give you the credit since nobody seems to want to take a shot at the physical application – crasic Sep 29 '10 at 8:23 • Could you please elaborate how the fate of the last person is determined the moment either the first or the last seat is selected? and how any other seat will necessarily be taken by the time the last guy gets to 'choose'.? – Mathgeek Jan 20 '17 at 19:50 • @Mathgeek: Suppose the last guy gets seat X, which is neither the first seat, nor the last seat. What seat did person numbered X take? – Aryabhata Jan 23 '17 at 23:26 • @Mathgeek: Yes, it will be 1. – Aryabhata Jan 25 '17 at 22:11
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9744347905312774, "lm_q1q2_score": 0.824315749269558, "lm_q2_score": 0.84594244507642, "openwebmath_perplexity": 500.10150711242886, "openwebmath_score": 0.7296741008758545, "tags": null, "url": "https://math.stackexchange.com/questions/5595/taking-seats-on-a-plane/5596" }
existence of limit cycles can be predicted from closed trajectories in the phase portrait. Introduction to systems of differential equations 2. Nonlinear. The type of phase portrait of a homogeneous linear autonomous system -- a companion system for example -- depends on the matrix coefficients via the eigenvalues or equivalently via the trace and determinant. , the linearized system has coefficient matrix A = − 0 0 α γ γ α a c The eigenvalues are ± aci. Nonlinear phase portrait and linearization. Mathematical background: existence and uniqueness of solutions, continuous dependence on initial conditions and parameters,. In this paper, we study the equilibrium points classi cation of linear and nonlinear fractional order di erential equations de ned by di er-ential operators of Caputo type. In our previous lessons we learned how to solve Systems of Linear Differential Equations, where we had to analyze Eigenvalues and Eigenvectors. A semisum of two expressions of the efficiency found in
{ "domain": "colagrossijeans.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9852713891776498, "lm_q1q2_score": 0.8273658508922132, "lm_q2_score": 0.8397339656668287, "openwebmath_perplexity": 567.4945903919495, "openwebmath_score": 0.6094440817832947, "tags": null, "url": "http://colagrossijeans.it/kzgz/phase-portrait-nonlinear-system.html" }
electrochemistry, electrolysis If the power source can provide high enough current, connect two or several electrodes in parallel, forming one electrode with large surface. If possible, you can create a combed structure of alternating anode and cathode, i.e. all odd electrodes mutually connected and the same for all even ones. That also leads to short distance between electrodes and overall high conductivity. If the power source cannot provide high enough current or if the power source has too high voltage, you can create a series of cells, an anode of one cells connected by wire to cathode of other cell. This ways, at the same current, but with high voltage, you can multiple you gas output. But beware of danger of explosion, as manipulation with electrodes under voltage may produce a spark and mighty explosion of hydrogen and oxygen mix.
{ "domain": "chemistry.stackexchange", "id": 17868, "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, electrolysis", "url": null }
meteorology, simulation Title: Simulating rainy weather I want to test some 3D weather radar software by simulating rainy weather. I want some degree of realism in the sense that it simulates rain systems and their boundaries and also simulates rain rates over their volumes. Weather systems should be dynamic in the sense that they can evolve and change at typical rates. I would be satisfied with a statistical model if that's possible, rather than one driven by solving differential equations, based on my assumption that generating random numbers is easier than solving large systems of equations. The model should be capable of running for long periods of time (a few hours of simulated real time) while generating an assorted set of weather patterns (clear weather and various levels of rain intensity). It should be suitable for real time simulation of the radar software, so weather development over time is an important requirement.
{ "domain": "earthscience.stackexchange", "id": 1030, "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, simulation", "url": null }
The exact question is given here: Probability of meeting I am aware of geometric probability and the methods they have used there. The answer seems to be unanimously $$9/36$$. However, here is where I am confused. Considering A reaches before B, and that he reaches before the first $$50$$ minutes, the probability of meeting should be $$5/6 \cdot 1/6= 5/36$$ (since B would have to reach within $$10$$ minutes of A). By symmetry, this means that if B reaches early and reaches before the first $$50$$ minutes, the meeting probability is again $$5/36$$. It seems that even without considering the probability of what happens if the earlier person reaches in the last $$10$$ minutes, we have a probability of $$10/36$$ already, greater than the total probability calculated in the post in the link. Can anyone please point out my logical flaw?
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.989510906574819, "lm_q1q2_score": 0.8579413271157709, "lm_q2_score": 0.8670357460591569, "openwebmath_perplexity": 154.8414077831596, "openwebmath_score": 0.703490138053894, "tags": null, "url": "https://math.stackexchange.com/questions/3376028/probability-of-meeting-a-confusion" }
forces, gravity, standard-model, interactions, unified-theories One corresponds to the strong force that binds quarks into protons and neutrons. In the technical literature, this one is sometimes denoted $SU(3)$. The other two gauge fields are the ones relevant to your question. In the technical literature, these two gauge fields are described by the cryptic symbols $SU(2)_L$ and $U(1)_Y$, respectively, and I won't try to invent better names for them here. The important point is that the familiar EM force is a special mixture of $SU(2)_L$ and $U(1)_Y$, and the remainder (a different mixture) is what we call the weak force.
{ "domain": "physics.stackexchange", "id": 52918, "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": "forces, gravity, standard-model, interactions, unified-theories", "url": null }
file-formats, k-mer, phylogenetics Title: Is there a standard k-mer count file format? I am doing a research project involving calculating k-mer frequencies and I am wondering if there is any standard file format for storing k-mer counts. Not as far as I am aware. The Ray assembler used to (and possibly still does) store the kmers as FASTA files where the header was the count of the sequence, which I thought was a pretty neat bastardisation of the FASTA file format. It looks like this format is also used by Jellyfish when reporting kmer frequencies by the dump command (but its default output format is a custom binary format):
{ "domain": "bioinformatics.stackexchange", "id": 171, "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": "file-formats, k-mer, phylogenetics", "url": null }
python, game, template, tkinter def Submit(self): self.A1 = self.e1.get() #gets final variables self.A2 = self.e2.get() self.E1 = self.e3.get() self.V5 = self.e4.get() self.N10 = self.e5.get() self.N11 = self.e6.get() self.V6 = self.e7.get() #takes Para and fills in %s with variables chronologicaly messagebox.showinfo("Story", Para % (MN1, O1, N1, N2, N3, S1, MN2, V1, WN1, BP1, V2, N4, N5, RN1, HM1, V3, N6, N7, N8, V4, N9, A1, A2, E1, V5, N10, N11, V6)) self.master.update() Create a main function (like in C and C++ programs): def main(): root = Tk() app = GUI(root) # app.master and root are synonyms now app.master.mainloop() # You also often see root.mainloop(), but in my opinion this is clearer Call the main function in an if-statement (that's necessary if you want to import this file in another Python script without running the main function: if __name__ == '__main__': main()
{ "domain": "codereview.stackexchange", "id": 22848, "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, game, template, tkinter", "url": null }
homework-and-exercises, newtonian-mechanics, friction Edit: By using Wolfram Alpha it modeled something outside of the situation. $$mg\sin \alpha - \mu mg \cos \alpha = ma$$ only applies when $$0 ° \ge \alpha \ge 90 °$$ outside of that it is no longer on a slope. The equation in wolfram alpha was considering friction acting with the motion, which makes no sense in the real situation.
{ "domain": "physics.stackexchange", "id": 38248, "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, friction", "url": null }
co.combinatorics, cr.crypto-security, coding-theory Do there exist $k$ rows of length $n(n-1)$ so that no number appears twice in any column, and for each pair of rows all ordered pairs given by the columns are distinct? Do there exist $k$ rows of length $n^2$ so that for each pair of rows, all ordered pairs given by the columns are distinct?
{ "domain": "cstheory.stackexchange", "id": 833, "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": "co.combinatorics, cr.crypto-security, coding-theory", "url": null }
thermodynamics, thermal-radiation What is a bit tricky here is how the radiation becomes black body radiation: e.g., if gas consists of atoms with discrete energy spectrum, it will mainly absorb and emit on the frequencies characteristic of this spectrum. The thermal distribution of radiation spanning all frequencies is then established via higher-order processes, such as Raman scattering, multi-photon absorption, etc. This might be a rather slow process: as the answers in the duplicate thread suggest it might never happen in practical situations (since the gas will cool down via the radiative losses to the environment), but it might happen at high gas densities, where there direct interaction between gas atoms contributes to spreading radiation over all frequencies. Related: How does radiation become black-body radiation?
{ "domain": "physics.stackexchange", "id": 92775, "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, thermal-radiation", "url": null }
] functions Table 1 Ltd.... Of X must be mapped to by some element of Y, Z be sets of X! Or 11111 Math Elementary Math Algebra Geometry Trigonometry Probability and Statistics Pre-Calculus functions can represented... The basics of functions will be 2 m-2 have 00000 or 11111 than ''! Summation r=1 to n ) = jnj onto ( surjective ) if every element of therefore, each element are. Algebra Geometry Trigonometry Probability and Statistics Pre-Calculus ( a ) f ( X =... = m n. onto a 5-digit binary number of set Y is unused and element 4 is in! Bijective ) of functions can be classified according to you what should be the function is also called a function. A for which f ( m ; n ) = 2, is there! In summer even though it can not have 00000 or 11111 X = 1! Be n×n×n.. m times = nm subsets of W, number of onto functions from one set to:! Effectively a 5-digit binary number one-to-one '' as a synonym for ''. = 2, is PDF with Answers to know their preparation level be... Onto ( bijective ) if every
{ "domain": "vakrenordnorge.no", "id": null, "lm_label": "1. Yes\n2. Yes\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9891815503903563, "lm_q1q2_score": 0.8558637080328639, "lm_q2_score": 0.865224091265267, "openwebmath_perplexity": 628.9770854112651, "openwebmath_score": 0.6120531558990479, "tags": null, "url": "https://www.vakrenordnorge.no/tmdnfv1/total-no-of-onto-functions-from-a-to-b-bd9598" }
homework-and-exercises, quantum-field-theory, hilbert-space The projector into the $n$ particle subspace is straightforward: $$ 1_n=\frac{1}{n!}\int\frac{d^3\textbf{p}_1}{(2\pi)^{3}2E_\textbf{p}^1}\cdots \frac{d^3\textbf{p}_n}{(2\pi)^{3}2E_\textbf{p}^n}|\textbf{p}_1,\cdots,\boldsymbol p_n\rangle\langle\textbf{p}_1,\cdots\boldsymbol p_n| $$ as can be seen by acting on a general $n$ particle state $|\boldsymbol q_1,\cdots,\boldsymbol q_n\rangle$. With this, the identity over the full Hilbert space is $$ 1=|0\rangle\langle 0|+\sum_{n=1}^\infty 1_n $$
{ "domain": "physics.stackexchange", "id": 35548, "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, quantum-field-theory, hilbert-space", "url": null }
deep-learning, convolutional-neural-networks The input (of 7x7, pad of 1) has 3 channels. The convolutional layer has 2 kernels (or filters). Each filter has a depth of 3, equal to the number of channels in the input. Using the notation you used in your question: Filter 1, channel 1 to input channel 1 Filter 1, channel 2 to input channel 2 Filter 1, channel 3 to input channel 3 Sum all three channels of filter 1, then add bias Filter 2, channel 1 to input channel 1 Filter 2, channel 2 to input channel 2 Filter 2, channel 3 to input channel 3 Sum all three channels of filter 2, then add bias These steps are repeated for each frame the filter slides over the input image. To answer question 2, if the output is 128, that simply means there are 128 filters. There could be an infinite number of filters if you so choose. EDIT: Here's the link to the interactive graphic: http://cs231n.github.io/convolutional-networks/
{ "domain": "ai.stackexchange", "id": 1270, "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": "deep-learning, convolutional-neural-networks", "url": null }
formal-languages, reference-request, finite-automata Title: Difference between the languages accepted by two DFAs with different initial state/accepting states? Recently, I asked a question on Math SE. No response yet. This question is related to that question, but more technical details toward computer science. Given two DFAs $A = (Q, \Sigma, \delta, q_1, F_1)$ and $B = (Q, \Sigma, \delta, q_2, F_2)$ where the set of states, the input alphabet and the transition function of $A$ and $B$ are the same, the initial states and the final(accepting) states could be different. Let $L_1$ and $L_2$ be the languages accepted by $A$ and $B$, respectively. There are four cases: $q_1 = q_2$ and $F_1 = F_2$. $q_1 \neq q_2$ and $F_1 = F_2$. $q_1 = q_2$ and $F_1 \neq F_2$. $q_1 \neq q_2$ and $F_1 \neq F_2$. My question is What are the differences between $L_1$ and $L_2$ in cases 2, 3 and 4?
{ "domain": "cs.stackexchange", "id": 1194, "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, reference-request, finite-automata", "url": null }
c#, .net, ip-address var cidr1 = parsedCidrs[0]; var cidr2 = parsedCidrs[1]; var minWideSubnet = IPNetwork.WideSubnet(new[] { cidr1, cidr2 }); while (parsedCidrs.Count > limit) { foreach (var cidrA in parsedCidrs) { foreach (var cidrB in parsedCidrs) { if (cidrA != cidrB) { var wideSubnet = IPNetwork.WideSubnet(new[] {cidrA, cidrB}); if (wideSubnet.Usable < minWideSubnet.Usable) { minWideSubnet = wideSubnet; cidr1 = cidrA; cidr2 = cidrB; } } } } // update array cidrs.Remove(cidr1.ToString()); cidrs.Remove(cidr2.ToString()); var end = minWideSubnet.ToString(); cidrs.Add(end); }
{ "domain": "codereview.stackexchange", "id": 22837, "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#, .net, ip-address", "url": null }
machine-learning, neural-network, encoding Depending on how you are using this portfolio information, another option would be to have an embedding layer, which embeds discrete values into a continuous representation space (whose dimensionality is a hyperparameter of the model). This would be possible if this information is used as input to the model. In those cases, you input an integer number, which is used to index the embedded vector table.
{ "domain": "datascience.stackexchange", "id": 2807, "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, neural-network, encoding", "url": null }
a Fourier series, it is sufficient to calculate the integrals Graph of f(x) (original part in green):. Someexamples The easiest example would be to set f(t) = sin(2…t). 4. 8 1. The inverse Fourier transform is then given by f(n) = NX 1 l=0 ^f( l)’ l(n): If we think of f and ^f as N 1 vectors, we then these definitions become ^f = f; f = ^f: Fourier Series. Dec 15, 2012 · The fourier series will represent the signal as a sum of sines and cosines at the fundamental frequency and its harmonics. By adding infinite sine (and or cosine) waves we can make other functions, even if they are a bit weird. 1 A First Look at the Fourier Transform. notice that the graph of the partial sum of the Fourier series looks very jagged. The Fourier Series will be written into the lightblue area below. You can see the processes involved and some examples on this page: Full Range Fourier Series. The function is displayed in white, with the Fourier series approximation in red. and f(t) = 0 for ˇ 2. Fourier
{ "domain": "estodobueno.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9883127440697255, "lm_q1q2_score": 0.829919781878709, "lm_q2_score": 0.8397339676722393, "openwebmath_perplexity": 555.6384017826568, "openwebmath_score": 0.8730370998382568, "tags": null, "url": "http://estodobueno.com/gheryb/fourier-series-graph.html" }
c# In that case you don't quite understand how streams work. In order to work with a stream (Read or Write) you need finite things. A byte array is a fixed finite thing. A stream in of itself doesn't convey a finite construct, it's kind of an abstract concept. I'm struggling to think of a good analogy here... Suffice it to say, that there doesn't exist a write API/method for a stream that accepts another stream (apart from CopyTo). Thus your only option is to read into a byte array from the source stream and then write that byte array content to the destination stream. End of story.
{ "domain": "codereview.stackexchange", "id": 4362, "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#", "url": null }
ros, turtlebot, ros-indigo, astra Edit: using the tutorials on learn.turtlebot.com , I thought that I was still meant to be using the OpenNI drivers [..] thing is: those tutorials were created by members of the community. Software evolves, and if artefacts like those tutorials don't get updated, you run into situations like this. It's really unfortunate, but it's a common problem with documentation and support material. The learnturtlebot.com sources are hosted at turtlebot/learn.turtlebot.com. Perhaps you could submit a PR that makes this clearer for future readers? You're in a unique position to do so, having just overcome the confusion of trying to understand the current material and mapping your insights to a newer version of the software stack. Originally posted by gvdhoorn with karma: 86574 on 2019-01-23 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 32315, "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, turtlebot, ros-indigo, astra", "url": null }
c++, performance, sorting, mergesort Now you can read numbers using operator>> but still have the speed you have verified with atol(). Never test for eof in a loop while (!sorted_1.eof() ||!sorted_2.eof());} The problem becomes that if there is an error on the stream then you end up going into an infinite loop (if there is an error reading from the stream it goes into a bad state until you reset it. While in a bad state it will refuse to read any more values and thus never reach the end of the file. Rather than testing for eof() you should check to make sure the stream is good() (if it reaches eof() or error() then it will no longer be good() so your loop will still exit correctly). The easy way to test for good() is to simply use the stream in a boolean context (an expression that is expected to be bool) and the compiler will convert the stream to bool which results in a call to good(). while(sorted_1 || sorted_2);
{ "domain": "codereview.stackexchange", "id": 27392, "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, sorting, mergesort", "url": null }
This example shows how to solve a differential equation representing a predator/prey model using both ode23 and ode45. m containing the following code:. Suchen Answers Clear Modeling Lotka-Volterra using ode23. One significant component in these systems is the functional response describing the number of prey consumed per predator per unit time for given quantities of prey N and predators P. Plus, this study also intended to explore the occurrence of diffusion-induced instability (Turing instability) and its effect to the dynamics of prey-predator. The variables x and y measure the sizes of the prey and predator populations, respectively. As an example, the well-know Lotka-Volterra model (aka. Task 3: Read about the Lotka-Volterra Model to describe competition between predators and prey. And the third model is the famous Lotka-Volterra predator-prey equations. The full prey equation is The first term ( rN ) describes exponential population growth in the absence of the predator, and the
{ "domain": "cigibuilding.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9828232884721166, "lm_q1q2_score": 0.8373190581479064, "lm_q2_score": 0.8519528057272543, "openwebmath_perplexity": 1839.2252276001213, "openwebmath_score": 0.5434060096740723, "tags": null, "url": "http://goyy.cigibuilding.it/predator-prey-model-matlab.html" }
javascript, game, html5 // create positions choicesContainer.insertAdjacentHTML('beforeend', [ 'Sixty-Nine', 'Missionary', 'Doggy style', 'Rodeo', 'Reverse Cowgirl', 'Girl on top', 'Zeus', 'Venus', 'Workout' ].map(function(position, i) { return '<button id="position-' + i + '" ' + 'class="choice-buttons">' + position + '</button>'; }).join('') ); var MAX_CHOICES = 2; var choices = choicesContainer.querySelectorAll('button'); choices.ladies = []; choices.gents = []; getByID('playButton').onclick = play; getByID('startOver').onclick = restart; choices.forEach(function(c) { c.onclick = choose; }); // only intro is shown on start hide(choicesContainer); hide(sectionTitle); hide(answer); // ladies choose first container.className = 'female';
{ "domain": "codereview.stackexchange", "id": 22679, "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, game, html5", "url": null }
• @codewarrior hope this helps. $$\frac{\partial}{\partial \theta_j}\log(1+e^{\theta x^i})=\frac{x^i_je^{\theta x^i}}{1+e^{\theta x^i}}$$ $$= \frac{{x^i_j}}{{e^{-\theta x^i}*(1+e^{\theta x^i})}}$$ $$=\frac{{x^i_j}}{{e^{-\theta x^i}+e^{-\theta x^i + \theta x^i}}}$$ $$=\frac{{x^i_j}}{{e^{-\theta x^i}+e^{0}}}$$ $$=\frac{{x^i_j}}{{e^{-\theta x^i}+1}}$$ $$=\frac{{x^i_j}}{{1+e^{-\theta x^i}}}$$ $$=x^i_j*h_\theta(x^i)$$ as $$h_\theta(x^i) = \frac{{1}}{{1+e^{\theta x^i}}}$$ – Rudresha Parameshappa Jan 2 '17 at 13:06 • @Israel, logarithm is usually base e in math. Take a look at When log is written without a base, is the equation normally referring to log base 10 or natural log? – gdrt Mar 11 at 11:46
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9833429614552197, "lm_q1q2_score": 0.8151311364066082, "lm_q2_score": 0.8289388019824946, "openwebmath_perplexity": 1161.8411201605736, "openwebmath_score": 0.9998207688331604, "tags": null, "url": "https://math.stackexchange.com/questions/477207/derivative-of-cost-function-for-logistic-regression" }
python Title: rock paper scissors game simplify in Python I wrote rock paper scissors game using what I have learnt yet.It is while,for statements,list,tuple,dictionary and such simple things only.So I am interested how can I simplify this code using only what I have learnt(simple things) Here is code k = input("Hello guys what are you names: ") j = input("and yours? ") print(f"""ok {k} and {j} let the game begin!" P.s. Type exit to quit game""") list = ["rock","paper","scissors"] while True:
{ "domain": "codereview.stackexchange", "id": 38272, "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", "url": null }
ros-kinetic, ubuntu, ubuntu-xenial exit_code = _rosdep_main(args) File "/usr/lib/python2.7/dist-packages/rosdep2/main.py", line 383, in _rosdep_main return _package_args_handler(command, parser, options, args) File "/usr/lib/python2.7/dist-packages/rosdep2/main.py", line 477, in _package_args_handler return command_handlers[command](lookup, packages, options) File "/usr/lib/python2.7/dist-packages/rosdep2/main.py", line 689, in command_install installer.install(uninstalled, **install_options) File "/usr/lib/python2.7/dist-packages/rosdep2/installers.py", line 520, in install verbose=verbose, quiet=quiet) File "/usr/lib/python2.7/dist-packages/rosdep2/installers.py", line 570, in install_resolved result = subprocess.call(sub_command) File "/usr/lib/python2.7/subprocess.py", line 523, in call return Popen(*popenargs, **kwargs).wait() File "/usr/lib/python2.7/subprocess.py", line 1392, in wait pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0)
{ "domain": "robotics.stackexchange", "id": 30336, "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-kinetic, ubuntu, ubuntu-xenial", "url": null }
process-engineering, product-engineering, grinding My thought is that the coffee grinder is essentially acting like a Van de Graaff generator. Since the coffee maker likely has a plastic frame, rests (most likely) on rubber feet, and the electrical wiring (most likely) is insulated from the grinding mechanism, you have the potential for charge to be stored in the grinder. If I had to guess, there's probably some insulative gap in the grinder drive train between it and the motor that does not allow grounding of the charge. This may be by design to avoid the potential for electric shock. Also, assuming you're using it on a countertop that is not metallic (i.e., nonconductive), even of there was a discharge path from the grinder through the body, it can't ground out anyway since the counter won't conduct the charge. What modifications can the end-user make to either the grinder or the process to prevent static buildup?
{ "domain": "engineering.stackexchange", "id": 4346, "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": "process-engineering, product-engineering, grinding", "url": null }
of a piecewise continuous function tends to form periodic oscillations at locations of discontinuities. G o t a d i f f e r e n t a n s w e r? C h e c k i f i t ′ s c o r r e c t. The complex exponentials can be represented as a linear combination of sinusoidals (Euler's Fo. A—The square wave is of width 1, the period$T_0=2\$ B—The square wave is of width 1. Mathematically, it is de nedas the Fourier transform of the autocorrelation sequence of the time series. We can be confident we have the correct answer. Spectral Analysis Asignalxmay be represented as a function of time as x(t) or as a function of frequency X(f). 1 Notes on Fourier series of periodic functions. I've coded a program, here is the details, Frequen. Hello, No, it does not! The Fourier Series is used to represent a continuous time periodic signal by a summation (discrete sum) of complex exponentials. Can describe object (lightfield) as superposition of “gratings” (spatial frequency components) 4. Fourier Transforms,
{ "domain": "gorizia-legnami.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9904406003707396, "lm_q1q2_score": 0.8050967875657755, "lm_q2_score": 0.8128673110375457, "openwebmath_perplexity": 568.7099265426834, "openwebmath_score": 0.8534658551216125, "tags": null, "url": "http://gorizia-legnami.it/ybve/fourier-transform-of-periodic-square-wave.html" }
homework-and-exercises, general-relativity, lagrangian-formalism, metric-tensor, geodesics I've been working through the topology problems in Wald today, so it's nice to do some calculus again :) You are solving for the worldline of the particle, which is governed by the geodesic equation $$\frac{d^2x^\mu}{d\sigma^2}+\Gamma^\mu_{\;\,\rho\sigma}\frac{dx^\rho}{d\sigma}\frac{dx^\sigma}{d\sigma}=0$$ These are obviously hard differential equations to solve. However, there is a great way to make life easier. (I hope you don't know what I'm talking about, because this will be lengthy.) Suppose we use the Lagrangian in the first equation to calculate the equations of motion. We end up with the geodesic equation with all the Christoffel symbols written out. However, $$L=\frac{d\tau}{d\sigma}$$ tells us something interesting. If we write the Lagrangian in terms of the proper time instead of $\sigma$, we end up with another equation $$L=1$$ We can use this in place of the hardest equation in the geodesic equation. Let me show you what I mean. Write
{ "domain": "physics.stackexchange", "id": 19233, "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, general-relativity, lagrangian-formalism, metric-tensor, geodesics", "url": null }
statistical-mechanics, hamiltonian-formalism, plasma-physics, phase-space, kinetic-theory Liouville's Equation I know that $\langle f \rangle$ satisfies Liouville's equation, or more appropriately, $\partial \langle f \rangle$/$\partial t = 0$. In general, the equation of motion states: $$ \begin{equation} \frac{ \partial f }{ \partial t } = f \left[ \left( \frac{ \partial }{ \partial \textbf{q} } \frac{ d\textbf{q} }{ dt } \right) + \left( \frac{ \partial }{ \partial \textbf{p} } \frac{ d\textbf{p} }{ dt } \right) \right] + \left[ \frac{ d\textbf{q} }{ dt } \cdot \frac{ \partial f }{ \partial \textbf{q} } + \frac{ d\textbf{p} }{ dt } \cdot \frac{ \partial f }{ \partial \textbf{p} } \right] \tag{1} \end{equation} $$ where I have defined the canonical phase space of $(\mathbf{q}, \mathbf{p})$. If I simplify the terms dA/dt to $\dot{A}$ and let $\boldsymbol{\Gamma} = (\mathbf{q}, \mathbf{p})$, then I find: $$ \begin{align}
{ "domain": "physics.stackexchange", "id": 21400, "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": "statistical-mechanics, hamiltonian-formalism, plasma-physics, phase-space, kinetic-theory", "url": null }
image-processing, morphological-operations, gradient However, I would like specific examples, arguments or references that point to desirable properties of symmetrical SEs (or undesirable properties of non-symmetrical ones). For planar elements (implied by the wording "structuring element") the containment of origin is enough to maintain the properties of anti-extensivity for erosion, and extensivity for dilation as can be found in many texts and you also pointed that out. So, yes, this is enough for the non-negativity for the arithmetic difference (this is directly shown by contradiction). The reason this piece of text is present in Pierre's book might be a simple one: a mistake. This statement is supported by other papers (like "Morphological Gradients" by Rivest, Soille, Beucher; or "An Overview of Morphological Filtering" by Serra, Vincent) on the morphological gradient defined by Beucher on his thesis. Now, I expect the most common situation to be the application of a gradient in an isotropic way, implying a symmetrical structuring
{ "domain": "dsp.stackexchange", "id": 1279, "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": "image-processing, morphological-operations, gradient", "url": null }
ros, ardent Originally posted by William with karma: 17335 on 2018-04-12 This answer was ACCEPTED on the original site Post score: 15 Original comments Comment by lexi on 2021-03-04: Is there a way to get the src directory? This method makes it so that you have to rebuild every time you update a config which kind of defeats the purpose of a config sometimes. Comment by kyubot on 2022-07-07: I agree. I need the source directory of the package rather than installed package. Any ideas? Comment by William on 2022-07-27: You should never reference the src directory of another package. It is fragile and will never work on the buildfarm. Instead you should install resources from that package and reference that package's install folder.
{ "domain": "robotics.stackexchange", "id": 30626, "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, ardent", "url": null }
game, react.js, jsx, redux I always recommend that people use Redux Toolkit because it's such a great tool. You're taking steps to make your Redux code clean and maintainable with your reducer.utils.js file and createAction utility. If you follow down that path far enough then you'll eventually recreate Redux Toolkit. But it's already been created and you can just use it!
{ "domain": "codereview.stackexchange", "id": 44300, "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": "game, react.js, jsx, redux", "url": null }
quantum-information, entropy, dark-energy, information, decoherence As a biologist, I have no clue if this is just an exotic hypothesis or it's possibly true. Also, can anyone give an intuitive explanation of how could this be the case? thanks The variety of things that people mean, when they say "information" is fundamental, defies summary. It ranges from near-tautological statements that physical systems are only affected by that which affects them, to half-baked metaphysics in which Information is treated as the substance of reality itself. In this case, the anonymous blogger at "arxiv blog" (no official relation to arxiv, by the way) is excited by a completely obscure paper that would explain the magnitude of dark energy in a small region in space, as a result of something like the degree of quantum correlation between the location of every star in the observable universe, and unspecified physical degrees of freedom within the small region.
{ "domain": "physics.stackexchange", "id": 41786, "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-information, entropy, dark-energy, information, decoherence", "url": null }
galaxies, parallax ( y axis : line of ecliptic )
{ "domain": "physics.stackexchange", "id": 19751, "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": "galaxies, parallax", "url": null }
The random variable $X$ is uniformly distributed on the interval $0\le x\le \ell$, so $\mathrm{P}\left(0\le X\le x\right)=\frac{x}{\ell }\phantom{\rule{0.3em}{0ex}}.$ Now $R=\frac{X}{2\ell -X}$, by definition, so $X=\frac{2\ell R}{1+R}\phantom{\rule{0.3em}{0ex}}.$ The cumulative distribution function for $R$ is given by $\mathrm{P}\left(R\le r\right)=\mathrm{P}\left(\frac{X}{2\ell -X}\le r\right)=\mathrm{P}\left(X\le \frac{2\ell r}{1+r}\right)=\frac{2\ell r}{\left(1+r\right)\ell }=\frac{2r}{1+r}\phantom{\rule{0.3em}{0ex}}.$ Let’s check that this satisfies the conditions for a cumulative distribution function: it should increase from 0 to 1 as $r$ goes from its smallest value, which is 0 to its greatest value, which is 1. And it does, so that’s OK. The probability density function is the derivative of the cumulative distribution function:
{ "domain": "openbookpublishers.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9939964056262038, "lm_q1q2_score": 0.8126660884590955, "lm_q2_score": 0.8175744739711883, "openwebmath_perplexity": 188.6640432535097, "openwebmath_score": 0.8699390292167664, "tags": null, "url": "https://books.openbookpublishers.com/10.11647/obp.0075/Chapters/P74.html" }
optimization, reconstruction, signal-synthesis, convex-optimization, image-restoration $$ g \left( x \right) = \lambda_1{\left\| x \right\|}_{1} + \lambda_2 \operatorname{TV}(x) $$ The question is, how can apply the Proximal function in this case? Can I do it in iterative method where I apply the Proximal of the $ {L}_{1} $ Norm (Soft Threshodling) and then the Proximal of the Total Variation Norm? Indeed the model for the Proximal Gradient Method (Also see Proximal Gradient Methods for Learning) is in the form of: $$ F \left( x \right) = f \left( x \right) + g \left( x \right) $$ Where usually $ f \left( x \right) $ is convex smooth function and $ g \left( x \right) $ is convex non smooth function. Yet the model is quite flexible and you may define $ g \left( x \right) $ any way you want. So it can be that: $$ g \left( x \right) = {g}_{1} \left( x \right) + {g}_{2} \left( x \right) $$ Where in your case $ {g}_{1} \left( x \right) = {\left\| x \right\|}_{1} $ and $ {g}_{2} \left( x \right) = \operatorname{TV} \left( x \right) $.
{ "domain": "dsp.stackexchange", "id": 8080, "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": "optimization, reconstruction, signal-synthesis, convex-optimization, image-restoration", "url": null }
sql, fizzbuzz, sqlite In MySQL, the || ANSI string concatenation operator is disabled by default. You need to SET sql_mode='PIPES_AS_CONCAT' to enable it. SQLite does not support the CONCAT() function. PostgreSQL and MySQL both require all subqueries / derived tables to have aliases. In (select 0 union select 1 as a), you named the column in the last table of the UNION, rather than the first. Apparently, SQLite 2 insists on that. On the other hand, in most other databases, you should specify the column name on the first table of the UNION instead: (SELECT 0 AS a UNION SELECT 1). SQLite 3, MySQL and PostgreSQL, for example, will all insist on having the alias on the first table. The solution: specify the alias on both the first and the last tables of the UNION!
{ "domain": "codereview.stackexchange", "id": 8533, "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, fizzbuzz, sqlite", "url": null }
thermodynamics, energy, temperature, equilibrium Title: Why egg cooks slowly in mountains? A quick Google tells me "Because water boils at a lower temperature at high altitudes". But I am not being able to understand this answer and fill-in the gap. Like, how does an egg cook in the first place? What does it mean when we say that water boils at lower temperature? In fact, I would have thought otherwise that since water is able to boil at low temperature itself (which will be reached sooner), the egg will be able to cook sooner. What is wrong with this reasoning? Since at higher altitudes, the air pressure is lower, the boiling point of water decreases, since it's easier for the energy insde the water to get free. When A liquid starts to boil, you reach a critical point where the liquid loses a lot of heat, much more than when not boiling, thus requiring much more energy for the same increase in temperature, and lowering the equilibrium point where the flame cannot increase further the temperature of the liquid.
{ "domain": "physics.stackexchange", "id": 1806, "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, temperature, equilibrium", "url": null }
deep-learning However, it's entirely unclear to me what these variances are. I thought maybe $Var(y)$ just meant the empirical variance of the vector $y$, i.e. the sum of the squares of the differences of the elements of $y$ from the mean of $y$, and likewise for $Var(x)$ and $Var(W)$, where the latter is just the variance of all of the entries of $W$. But under this interpretation the formula turns out to be false numerically, so I'm at a bit of a loss to understand what this equation is supposed to mean. 1. Meaning of the formula $$Var(z^i)=Var(x)\prod_{i'=0}^{i-1}n_{i'}Var(W^{i'})$$ This formula expresses the variance of the values of the activation for each neuron $k$ of the layer $i \rightarrow z^i_k$. This value, under the assumptions that are going to be mentioned along this post, is the same for all the neurons in the layer $i$. This is why the authors express it as $Var(z^i)$ instead of a particular $Var(z^i_k)$. Just to simplify the notation
{ "domain": "datascience.stackexchange", "id": 8495, "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": "deep-learning", "url": null }
The fact that $Y$ is a subspace is quite clear. To see density, we can use a corollary of Hahn-Banach theorem: we just need to show that each linear continuous functional on $c_0(\Bbb N)$ which vanished on $Y$ vanishes on the whole space. Let $f$ such a functional. We have $f(e_n-e_m)=0$ if $m\neq n$, where $e_n$ is the sequence whose $n$-th term is $1$, the others $0$. So $f(e_k)=:K$. As $\left\lVert\sum_{k=0}^ne_k\right\rVert_{\infty}=1$, we show have $nK\leq \lVert f\rVert$ and $K=0$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9724147169737826, "lm_q1q2_score": 0.8165696724074537, "lm_q2_score": 0.8397339716830606, "openwebmath_perplexity": 314.94270466571004, "openwebmath_score": 0.9820398688316345, "tags": null, "url": "http://math.stackexchange.com/questions/218676/dense-subspace-of-c-0-mathbb-n" }
By definition, $f$ is injective if and only if $$\forall(a,b) \in \mathbb{R}^2: f(a)=f(b) \implies a=b.$$ The negation of this statement is $$\exists (a,b) \in \mathbb{R}^2: f(a)=f(b) \quad \text{and} \quad a \neq b.$$ $f(x)=x^2$ is not injective because there exists the pair $(-1,1)$ such that $(-1)^2 = 1^2$ but $-1 \neq 1.$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9759464485047916, "lm_q1q2_score": 0.8333731113195867, "lm_q2_score": 0.8539127455162773, "openwebmath_perplexity": 329.61722606680036, "openwebmath_score": 0.9387465715408325, "tags": null, "url": "http://math.stackexchange.com/questions/1609276/negation-of-injectivity" }
navigation, mapping, obstacle-avoidance, static-map, map-server Originally posted by Hendrik Wiese on ROS Answers with karma: 1145 on 2014-05-27 Post score: 0 This is actually a needed feature for the navigation stack. The static map was originally only intended for use with the global costmap. Since the local map is usually in the odometry frame, if the robot was improperly localized, it would still be able to perform collision free local navigation. However, as a result, I don't think you can use a static map well in the pre-hydro or post-hydro versions of navigation. I've opened up an issue on github Originally posted by David Lu with karma: 10932 on 2014-05-28 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 18076, "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": "navigation, mapping, obstacle-avoidance, static-map, map-server", "url": null }
ros2 BumperCollisionCondition() = delete; BT::NodeStatus tick() override; static BT::PortsList providedPorts() { return {}; } private: rclcpp::Subscription<gazebo_msgs::msg::ContactsState>::SharedPtr contact_state_; rclcpp::Node::SharedPtr node_; rclcpp::Time lasttime_; }; } // namespace nav2_behavior_tree namespace nav2_behavior_tree {
{ "domain": "robotics.stackexchange", "id": 36093, "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": "ros2", "url": null }
c++, homework, graph, depth-first-search AL.DFT("Canyon Lake"); //depth first traversal std::cin.get(); return 0; } Couple of major issues. You are writing your own hash function. In addition some big problems. You are implementing your own hash based dictionary (badly). You need to use the visitor pattern (rather than have a mark in each node). The hash function: int Graph::getHashVal(std::string name) { int HashVal = 0; for (int i = 0; i < name.size(); i++) { HashVal += name[i]; } HashVal %= graph.size(); return HashVal; } That is a relatively trivial hash function that is known to have a bad distribution. If your keys are the same length you are very likely to get clashes. TAP PAT
{ "domain": "codereview.stackexchange", "id": 7527, "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++, homework, graph, depth-first-search", "url": null }
digital-communications, filtering, nyquist Title: Use of the harris-Moerder Nyquist Pulse Shaping Filter I became aware today through fred harris' excellent presentation at the DSP Online Conference (https://www.dsponlineconference.com/) of the harris-Moerder pulse shaping filter which was published 15 years ago: https://www.wirelessinnovation.org/assets/Proceedings/2005/2005-sdr05-2-2-03-harris.pdf This filter reportedly results in an order of magnitude lower EVM for the same number of taps, and importantly significantly reduced rejection of adjacent channels, but to my understanding isn't commonly used since the Root-Raised Cosine filter is so baked into our standards. Is anyone aware of actual use of this alternate pulse shaping filter and does anyone have further experience with it? Are there any other reasons, now 15 years later, that this hasn't been more widely adopted? Liguid-dsp implements root-Nyquist harris-Moerder (hM-3) filter using Parks-McClellan algorithm as :
{ "domain": "dsp.stackexchange", "id": 9385, "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": "digital-communications, filtering, nyquist", "url": null }
anisotropic-diffusion float dx, dy, dd; dx = 1; dy = 1; dd = pow(2, 0.5); float delta_t = 1/7; float k = 30; float4 nablaN = Convolution(psInput, hN); float4 nablaS = Convolution(psInput, hS); float4 nablaW = Convolution(psInput, hW); float4 nablaE = Convolution(psInput, hE); float4 nablaNE = Convolution(psInput, hNE); float4 nablaSE = Convolution(psInput, hSE); float4 nablaSW = Convolution(psInput, hSW); float4 nablaNW = Convolution(psInput, hNW);
{ "domain": "dsp.stackexchange", "id": 1270, "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": "anisotropic-diffusion", "url": null }
homework-and-exercises, x-ray-crystallography Response to comment: The incoming X-rays are scattered by the atoms in the crystal, so each atom acts as an X-ray source. We get the diffraction pattern by summing up the X-rays emitted (i.e. scattered) by all the atoms in the crystal. If you start with one atom then the scattered X-rays will be just be a spherical wave. Add a second atom and now the pattern will be the same as the Young's slits experiment. As you add more and more atoms the pattern will tend towards the pattern we expect from a large crystal, however to get an infinitely sharp spot would require an infinite number of atoms. When we have a finite number of atoms the spot will have a finite width. It's a bit like a Fourier synthesis (which is where we came in). Each atom adds a term to the Fourier sum, but to get a perfect transform of the lattice requires contributions from an infinite number of atoms. With a finite number of scatterers the diffraction pattern will only be an approximation to the FT of the lattice.
{ "domain": "physics.stackexchange", "id": 9038, "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, x-ray-crystallography", "url": null }
ros, ros-kinetic, service, server Originally posted by Dimitar Rakov with karma: 26 on 2018-11-11 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by gvdhoorn on 2018-11-12: This is indeed the problem. Comment by RobinB on 2018-11-12: Indeed, thank you very much, I will pay attention to this for later Comment by gvdhoorn on 2018-11-12: @RobinB: please accept the answer by @Dimitar Rakov by clicking the checkmark to the left of his answer.
{ "domain": "robotics.stackexchange", "id": 32029, "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, ros-kinetic, service, server", "url": null }
hashing let treesTillCollision = 1./prob printfn "trees till collision: %.3g" treesTillCollision let timeTillCollisionSec (genIntervalSec:float) = genIntervalSec * treesTillCollision let intervalSec = 5. let secsInYear = 365 * 24 * 60 * 60 let yearsToCollision = (timeTillCollisionSec intervalSec) / (float secsInYear) printfn "If we generate a single tree every %.0f seconds, we'll have to wait %.4g years in average to see a collision" intervalSec yearsToCollision Console.ReadLine() |> ignore 0
{ "domain": "cs.stackexchange", "id": 6402, "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": "hashing", "url": null }
c#, object-oriented, constructor public static Inmate CreateDefaultData(EnumType3 pEnumType3Value, EnumType4 pEnumType4Value) { // some code } In the getter in InmateInfoForm, when m_inmte is equal to null, is it generally better form to leave the code as-is, to go ahead and create a default constructor and use it like this: if (m_inmte == null) { m_inmte = new Inmate(); } else { m_inmte.CriminalHistoryNumber = (int)NumericUpDownCriminalHistoryNumber.Value; m_inmte.IntegrationID = (int)NumericUpDownDownIntegrationID.Value;
{ "domain": "codereview.stackexchange", "id": 19633, "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#, object-oriented, constructor", "url": null }
physical-chemistry, gas-laws, pressure Title: Textbook problem with molar mass of carbon dioxide $\ce{K2CO3}$ and $\ce{HCl}$ react to produce $\ce{CO2}$. In an empty flask ( m = $\pu{85.431 g}$ ) we put in the produced gas and the mass of the flask is now $\pu{85.510 g}$. After that we fill the flask with water. Volume of the flask filled with water is $\pu{122 ml}$. Pressure is $\pu{101325 Pa}$, temperature of air is $\pu{300 K}$. Density of water is $\pu{0.99893 g cm-3}$, and the molar mass of air is $\pu{28.8 g mol-1}$. Find the molar mass of carbon dioxide.
{ "domain": "chemistry.stackexchange", "id": 14469, "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": "physical-chemistry, gas-laws, pressure", "url": null }
organic-chemistry, inorganic-chemistry, experimental-chemistry, biochemistry thus, I doubt they'd give precipitates with sought reagents. However, some reagents give false-positive tests for non-nitrogenous extracts indicating the presence of alkaloids. The best example is Dragendorff's spray reagent (Ref.2).
{ "domain": "chemistry.stackexchange", "id": 12324, "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, inorganic-chemistry, experimental-chemistry, biochemistry", "url": null }
python, power-spectral-density, autocorrelation \begin{equation} \hat{\phi}_{k} = \sum_{k=-N+1}^{N-1}w(k)\hat{r}(k)e^{-j\omega k} \end{equation} By squaring and scaling the values of the correlogram you are messing up the relative powers. Additionally, if you want a comparable output to the periodogram from your Blackman-Tukey estimate, you need to use a biased estimate of the autocorrelation sequence. There's a bigger discussion to be had if you are interested, but the basic idea can be seen in the discussion preceding equations 2.2.3 and 2.2.4 in the Stoica and Moses book. Essentially, spectral estimators are more concerned with the structure of the data as opposed to the scaling. The unbiased estimate of the autocorrelation sequence has higher statistical variance in the higher lag estimates, and therefore will have poorer structure, causing issues with spectral estimators based on an unbiased ACS estimate.
{ "domain": "dsp.stackexchange", "id": 12563, "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, power-spectral-density, autocorrelation", "url": null }
intermolecular-forces, periodic-trends, melting-point, electronegativity Title: How would you explain the general trend in melting point between Group 1 and Group 2 chlorides? This question is based off of the attached chart. I notice how there's a general increase in melting point down group 2 chlorides and a general decrease (except for Lithium) down the group 1 chlorides. So, is the melting points of group 2 chlorides greater generally, or vice versa? Also, how would you explain these trends using electronegativity and intermolecular forces? First off, we need to give magnesium chloride its due. Wikipedia reports a melting point of 714°C for the anhydrous salt (the lower figures are for hydrates losing water molecules); apparently the 415°C figure was wrongly recopied. Putting the magnedium chloride point at the correct position makes the trends much more consistent with a sharp change in both groups from Period 1 to Period 2.
{ "domain": "chemistry.stackexchange", "id": 17894, "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": "intermolecular-forces, periodic-trends, melting-point, electronegativity", "url": null }
rust, http PR cleanup // println!("User innput: {check_interval} {url}"); Debugs are fine during development when you're trying to get things working. Once you've decided "it is Done" and you're requesting review for a merge-to-main, then it's time to prune out such commented code. (Also, nit, typo for "input".) narrow type fn check_url(client: &reqwest::blocking::Client, url: &str) { Hmmm, .get() seems perfectly willing to accept an Url instead of a string. The docs and tutorials tend to express it in terms of a string for convenience of exposition, but here you happen to have an Url in hand already. Using the more restrictive type here would have documentation value. Plus, it avoids the need to repeatedly re-parse. other success codes reqwest::StatusCode::OK => println!("... OK(200)"),
{ "domain": "codereview.stackexchange", "id": 44928, "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": "rust, http", "url": null }
classical-mechanics, energy-conservation, harmonic-oscillator, oscillators, dissipation $$ x^2 = \frac{1}{2}\Re (X^2e^{i2\omega t})+\frac{1}{2}|X|^2 $$ you get: $$ E = \frac{-\omega_d^2+\omega_0^2}{4}\Re(X^2e^{i2\omega_d t})+\frac{\omega_d^2+\omega_0^2}{4}|X|^2 $$ The second term is the constant value that you get from averaging. However, the first term shows that in general, $E$ fluctuates at frequency $2\omega_d$, ie twice as fast as a period. Note that at resonance, $E$ is constant even within the period. However, the same caveat applies. There will still be dissipation and injection, so you only have global balance at each time. This is why you avoid saying that energy is conserved.
{ "domain": "physics.stackexchange", "id": 94074, "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": "classical-mechanics, energy-conservation, harmonic-oscillator, oscillators, dissipation", "url": null }
ros, gazebo, c++, service /home/phadjic/ros_workspace/pool_party/src/client.cpp: In function ‘int main(int, char*)’: /home/phadjic/ros_workspace/pool_party/src/client.cpp:36:39: error: no match for ‘operator=’ in ‘setmodelstate.gazebo_msgs::SetModelState::request.gazebo_msgs::SetModelStateRequest_std::allocator<void >::model_state = modelstate’ /opt/ros/electric/stacks/simulator_gazebo/gazebo_msgs/msg_gen/cpp/include/gazebo_msgs/ModelState.h:23:20: note: candidate is: gazebo_msgs::ModelState_std::allocator<void >& gazebo_msgs::ModelState_std::allocator<void >::operator=(const gazebo_msgs::ModelState_std::allocator<void >&) /home/phadjic/ros_workspace/pool_party/src/client.cpp:39:22: error: ‘SetModelState’ was not declared in this scope /home/phadjic/ros_workspace/pool_party/src/client.cpp:42:8: error: no matching function for call to ‘print(int, log4cxx::Logger&, ros::console::Level&, const char [54], int, const char [22], double&)’
{ "domain": "robotics.stackexchange", "id": 8149, "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, gazebo, c++, service", "url": null }
# Differential Equation $u'(t) = \sqrt{|u(t)|}$ I got the equation (exercise of an old exam) $$u'(t) = \sqrt{|u(t)|} \quad ; \qquad u(t_0) = u_0$$ with $u(t) \in \mathbb R$. Then I have to say on which intervals $\mathcal I$ solutions exist and if they are unique. What I got so far: Because $f(t,v) = \sqrt{|v|}$ is not differentiable in $0$ I concluded that if $u_0 \neq 0$ there are locally unique solutions because then $f(t,v)$ is continuously differentiable around $(t_0,u_0)$. If $u_o > 0$ then we get the solution $$\left ( \frac {t+C}{2} \right )^2$$ with $C \in \mathbb R$. If $t_0 = 0$ then we get $C = \pm 2 \sqrt{u_0}$ which leads to the conclusion that there are two solutions which fulfill the conditions and pass trough $u_0$ in $t_0$. So the solution is not unique in $(0,u_0)$ ?! I am confused :D -
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9820137858267907, "lm_q1q2_score": 0.8028694131097206, "lm_q2_score": 0.8175744828610095, "openwebmath_perplexity": 128.5042462350898, "openwebmath_score": 0.9694229364395142, "tags": null, "url": "http://math.stackexchange.com/questions/281401/differential-equation-ut-sqrtut" }
general-relativity, lagrangian-formalism, differential-geometry, metric-tensor, action &+ \int \Big(R_{ab} - \frac{1}{2} R g_{ab} \Big) \delta g^{ab} \sqrt{-g} \ \text{d}^4 x \end{align}\tag{E.1.21}$$ Where $C^c_{ \ ab}$ is the difference between the Levi-Civita connection $\tilde{\nabla}_a$ and our arbitrary connection $\nabla_a$. He then argues that in order for $\delta S / \delta C^c_{\ ab}$ to vanish, the terms inside the parentheses need to vanish when symmetrized over $a$ and $b$ which implies that $C^c_{\ ab} = 0$, i.e. that $\nabla_a = \tilde{\nabla}_a$; while the vanishing of $\delta S / \delta g^{ab}$ leads to Einstein's field equations.
{ "domain": "physics.stackexchange", "id": 83550, "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, lagrangian-formalism, differential-geometry, metric-tensor, action", "url": null }
organic-chemistry, molecular-structure, stability, resonance ($\ce{COOH}$ twists out of the plane) The A-Values are $\ce{COOH} = 1.2, \ce{NO2} = 1.0$, so it makes sense for $\ce{COOH}$ to stay in the plane of the ring. ($\ce{NMe2}$ twists out of the plane) A-Values $\ce{NMe2} = 2.1, \ce{NO2} = 1.0$ so it makes sense for $\ce{NMe2}$ to stay in the plane. ($\ce{COMe}$ slightly twists out of the plane) A-Values $\ce{NH2} = 1.6, \ce{COMe} = 1.17$ so it makes sense for $\ce{NH2}$ to stay in the plane.
{ "domain": "chemistry.stackexchange", "id": 15071, "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-structure, stability, resonance", "url": null }
reinforcement-learning, action-spaces, dimensionality-reduction Is it generally advisable to reduce the dimensionality of the action space (Option 2), or to use multidimensional action variables directly (Option 1)? I know that the is most probably not an answer that is valid for all problems. But, as I am relatively new to reinforcement learning, I would like to know whether in the theory of reinforcement learning there is a general recommendation to do something like this or not or whether this question can't be answered in general as it is something that totally depends on the application and should be tested for each application individually? Reminder: I have already received a good answer. Still, I would like to remind you on this question to maybe hear also the opinion and experience of others regarding this topic. Since the question may not be answered unambiguously in general, I will use the given example as a guide. As you correctly write, a large dimensionality leads to a very large solution space because of the curse of dimensions.
{ "domain": "ai.stackexchange", "id": 3096, "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, action-spaces, dimensionality-reduction", "url": null }
general-relativity, differential-geometry, curvature, anti-de-sitter-spacetime Proof: For the proof we will use the structure equations in $D = 3$, generalise the curvature 2-form in $D$ dimensions and then use it to derive the Riemann tensor up to the Ricci scalar.
{ "domain": "physics.stackexchange", "id": 81761, "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, differential-geometry, curvature, anti-de-sitter-spacetime", "url": null }
energy, coupled-oscillators Thus, as you correctly conclude, only the dynamics of spheres 2 and 3 need be considered.
{ "domain": "physics.stackexchange", "id": 11133, "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": "energy, coupled-oscillators", "url": null }
biophysics, biology Title: What determines the mathematical relations between energy use, axon thickness, and firing rate of action potentials in a neuron? I have a naive model of action potential energy use and I’m unsure where the model is wrong. Clearly the model is wrong because its conclusion is wrong: When an action potential moves along an axon, it moves along the entire surface area (circumference) of the axon. Hence, in order to maintain the desired amount of voltage along the axon, to a first approximation, it requires an amount of energy proportional to the circumference of the axon, i.e. proportional to its diameter squared $d^2$. Since this applies for each spike, the energy per second $E$ is proportional to the spike rate $R$ and energy per spike which is proportional to $d^2$, so that $E\propto R\cdot d^2$.
{ "domain": "physics.stackexchange", "id": 68480, "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": "biophysics, biology", "url": null }
We want to minimize $$F=-2uv-\frac{18}{v}\sqrt{2-u^2}+v^2+\frac{81}{v^2}+2$$ Then, we have $$\frac{\partial F}{\partial u}=\frac{18u-2v^2\sqrt{2-u^2}}{v\sqrt{2-u^2}}$$ So, if we see $v\gt 0$ as a constant, then we know that $F$ is decreasing for $0\lt u\lt\sqrt{\frac{2v^4}{81+v^4}}$ and is increasing for $\sqrt{\frac{2v^4}{81+v^4}}\lt u\lt \sqrt{2}$. So, $F$ is minimized when $u=\sqrt{\frac{2v^4}{81+v^4}}$. Thus, we can have $$F(u,v)\ge F\left(\sqrt{\frac{2v^4}{81+v^4}},v\right)=\frac{81+v^4}{v^2}-2\sqrt 2\sqrt{\frac{81+v^4}{v^2}}+2$$ By the way, letting $\frac{81+v^4}{v^2}=k$ gives $$(v^2)^2-kv^2+81=0.$$ Considering the discriminant gives that $(-k)^2-4\cdot 81\ge 0\Rightarrow k\ge 18$. Since $x-2\sqrt 2\sqrt x$ is increasing for $x\gt 2$, we can see that $F$ is minimized when $\frac{81+v^4}{v^2}=18$, i.e. $v=3$. Thus, the minimum of the expression is $\color{red}{8}$ for $(u,v)=(1,3)$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9752018426872776, "lm_q1q2_score": 0.8083826512894648, "lm_q2_score": 0.8289388062084421, "openwebmath_perplexity": 115.0331551427382, "openwebmath_score": 0.9517121315002441, "tags": null, "url": "https://math.stackexchange.com/questions/1530179/find-the-minimum-of-u-v2-sqrt2-u2-frac9v2-for-0u-sqrt2-a" }
python, python-3.x Title: Find the cheapest shipping option based on item weight I've been taking the Computer Science course on Codecademy. The course includes this project where we have to create a python script to find the cheapest shipping method based on the weight of an item and I'm just wondering if this is the best way to code the solution? def ground_shipping_cost(weight): flat_cost = 20 premium_cost = 125 if weight <= 2: flat_cost += weight * 1.50 elif weight > 2 and weight <= 6: flat_cost += weight * 3.00 elif weight > 6 and weight <= 10: flat_cost += weight * 4.00 elif weight > 10: flat_cost += weight * 4.75 return flat_cost, premium_cost def drone_shipping_cost(weight): cost = 0 if weight <= 2: cost = weight * 4.50 elif weight > 2 and weight <= 6: cost = weight * 9.00 elif weight > 6 and weight <= 10: cost = weight * 12.00 elif weight > 10: cost = weight * 14.25 return cost
{ "domain": "codereview.stackexchange", "id": 34370, "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, python-3.x", "url": null }
the other completely . Two objects are congruent if they have the same shape, dimensions and orientation. iii) False Area of a rectangle = length × breadth Two rectangles can have the same area. For example: Two squares are congruent if their sides are equal, perimeters, or areas are equal. = True (iii) If two figures have equal areas, they are congruent. All four corresponding sides of two parallelograms are equal in length that does mean that they are necessarily congruent because one parallelogram may or may not overlap the other in this case because their corresponding interior angles may or may not be equal. Copyright © 2021 Multiply Media, LLC. To find whether one line segment is congruent to the other or not, we use the same method of superposition as discussed above. However, the lengths of their sides can vary and hence they are not congruent. All Rights Reserved. A square of $1 \times 1$ must have an area of $1$. (iii) False For example, if a triangle and a square have equal
{ "domain": "mbjclothing.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9621075690244281, "lm_q1q2_score": 0.8306756080607899, "lm_q2_score": 0.8633916152464017, "openwebmath_perplexity": 421.66547954517074, "openwebmath_score": 0.6394241452217102, "tags": null, "url": "https://mbjclothing.com/3fs4hz/if-two-squares-have-equal-areas-then-they-are-congruent-4801b5" }
thermodynamics, entropy Edit: To clarify, the $\Delta C_{p,m}$ referred to $C_{p,m}(g)-C_{p,m}(l)$ sorry about that. (Edit to address an ambiguity pointed out by Chet: Since I know what relation you're trying to achieve, I know that you mean that $T_1$ is the boiling temperature at the given conditions, i.e., that vaporization is reversible at $T_1$ but not at $T_2\neq T_1$. The problem statement should make this clear, as other answers are possible if one assumes that the surroundings are adjusted such that vaporization is also reversible at $T_2$, for example.) So we know $\Delta S_{\mathrm{vap},T_1}$, referring to the entropy change for reversible vaporization at temperature $T_1$ (system and surroundings); in other words, the boiling temperature is $T_1$. If I'm instead at temperature $T_2$, vaporization is no longer reversible under the original conditions; this is going to screw up my $\Delta S$ model because entropy will be generated as well as transferred.
{ "domain": "physics.stackexchange", "id": 85930, "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, entropy", "url": null }
ros I think that it still has dependency problems.. Thank you. Updated! Yes, there was no error when I type the command: rosdep install --from-paths src --ignore-src --rosdistro indigo --os=fedora:21 The failed package is 'class_loader': -- Configuring incomplete, errors occurred! <== Failed to process package 'class_loader': Command '['/u/leejang/ros_catkin_ws/install_isolated/env.sh', 'cmake', '/u/leejang/ros_catkin_ws/src/class_loader', '-DCATKIN_DEVEL_PREFIX=/u/leejang/ros_catkin_ws/devel_isolated/class_loader', '-DCMAKE_INSTALL_PREFIX=/u/leejang/ros_catkin_ws/install_isolated', '-DCMAKE_BUILD_TYPE=Release', '-G', 'Unix Makefiles']' returned non-zero exit status 1 Thank you very much for your help! Edit: Now, I'm facing the following error message:
{ "domain": "robotics.stackexchange", "id": 22556, "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", "url": null }
optics, solid-state-physics, refraction, conductors This means that if you take a "clean" cosine in the material it seems effective that it is moving slower than the same cosine in the blank, but the light coming out of the atom is not exactly the same light coming in. So far it's fine and intuitive, but who said that the light emitted by the dipole must be lagging in phase? If for some reason the light that is re-radiated is "ahead" in phase actually, it would seem as if the cosine peaks are effectively moving faster in the material - but again, that's fine! What is really important is that if I send a pulse, its leading edge will never move faster than the speed of light, because it necessarily carries information. I know this is a confusing explanation, but even undergraduates in second year get involved with it and it takes time for them to understand the concept so don't be ashamed to ask any more questions if the explanation is unsatisfactory! :)
{ "domain": "physics.stackexchange", "id": 66964, "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, solid-state-physics, refraction, conductors", "url": null }
ros, opencv, sensor-msgs, gscam, camera //cv::cvtColor(img_rgb, img_hsv, CV_BGR2HSV); cv::inRange(img_rgb, min_vals, max_vals, img_binary); dilate( img_binary, img_binary, getStructuringElement(MORPH_ELLIPSE, Size(10, 10)) ); /*======================= TOA DO ================================*/ colorMoment = moments(img_binary); double moment10 = cvGetSpatialMoment(&colorMoment, 1, 0); double moment01 = cvGetSpatialMoment(&colorMoment, 0, 1); double area = cvGetCentralMoment(&colorMoment, 0, 0); float posX = (moment10/area); float posY = (moment01/area); /*================= HIEN THI =================================*/ printf("1. x-Axis %f y-Axis %f Area %f\n", moment10, moment01, area); printf("2. x %f y %f \n\n", posX , posY);
{ "domain": "robotics.stackexchange", "id": 19443, "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, opencv, sensor-msgs, gscam, camera", "url": null }
and that they correspond to critical points of the underlying field Show[{ContourPlot[fu[x, y], {x, 1, 256}, {y, 1, 256}, Contours -> 35, ColorFunction -> "ThermometerColors"], Graphics[{AbsolutePointSize[6], Purple, Point /@ max}], Graphics[{AbsolutePointSize[6], Gold, Point /@ min}], Questions i) would you know of a more efficient way of finding the saddle points in 2D? ii) could this algorithm be generalized to 3D without significant loss of efficiency? (involves possibly writing a 3D version of FindAllCrossings2D) iii) how robust can it be in terms of the smoothness of the field? Here I am after an algorithm which would be efficient (I would like to identify thousands of critical points).
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9715639653084244, "lm_q1q2_score": 0.8010175047219583, "lm_q2_score": 0.824461932846258, "openwebmath_perplexity": 3306.0204840269985, "openwebmath_score": 0.2803191840648651, "tags": null, "url": "http://mathematica.stackexchange.com/questions/9928/identifying-critical-points-of-2-3d-image-cubes?answertab=votes" }
java, sql, authentication, jdbc private boolean validatePass(String pass) { return pass.length() >= 10 & pass.matches(".*\\d+.*"); } @Override public void delete() { } @Override public int login(String userName, char[] pass) { try { conn = DriverManager.getConnection(DB_URL); PreparedStatement prepStmt = conn .prepareStatement("SELECT name,password FROM SiteUser WHERE name=? AND password=?"); prepStmt.setString(1, userName); prepStmt.setString(2, new String(pass)); ResultSet rs = prepStmt.executeQuery(); if (rs.next()) { return 1; } } catch (SQLException e) { e.printStackTrace(); } return 0; } } Checking return values A mistake I see in multiple places is not checking the return values of operations. Take for example the part of getting the user ID:
{ "domain": "codereview.stackexchange", "id": 31367, "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, sql, authentication, jdbc", "url": null }
Posted in combinatorics, posts without words | Tagged , , , | 6 Comments Post without words #33 Posted in combinatorics, posts without words | Tagged , , | 4 Comments Happy tau day! Happy Tau Day! The Tau Manifesto by Michael Hartl is now available in print, if you’re in the market for a particularly nerdy coffee table book and conversation starter: I also wrote about Tau Day ten years ago; see that post for more links! Using $\tau$ we can make the most beautiful equation in the world even more beautiful: $e^{i \tau} = 1 + 0i$ Please enjoy eating two pi(e)s today. I’ll be back soon with some solutions to the parallelogram area challenge! Posted in famous numbers, links | Tagged , , | 1 Comment Challenge: area of a parallelogram And now for something completely different!1 Suppose we have a parallelogram with one corner at the origin, and two adjacent corners at coordinates $(a,b)$ and $(c,d)$. What is the area of the parallelogram? 1. …or is it?
{ "domain": "mathlesstraveled.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9910145725743421, "lm_q1q2_score": 0.8537969150909941, "lm_q2_score": 0.8615382040983515, "openwebmath_perplexity": 219.63282870187984, "openwebmath_score": 0.8304086923599243, "tags": null, "url": "https://mathlesstraveled.com/?cpage=1" }
fft, power-spectral-density, magnitude \begin{equation} P(f) = \displaystyle \sum_{m = -\infty}^{\infty} r_{xx}[m]\exp\left(-j2\pi fm\right) \tag{3} \end{equation} For reasons you can find in this answer, you see that the squared magnitude of the signal's $\textrm{DFT}$ is taken as the estimate of the PSD in most practical situations. One form, among other variations/methods, is: \begin{equation} P(f_k) = \frac{1}{N} \displaystyle \left| \sum_{n = 0}^{N - 1} x[n]\exp\left(-j2\pi f_kn\right) \right|^2 \tag{4} \end{equation}
{ "domain": "dsp.stackexchange", "id": 2942, "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, power-spectral-density, magnitude", "url": null }
Similar questions to practice: if-n-is-the-greatest-positive-integer-for-which-2n-is-a-fact-144694.html what-is-the-largest-power-of-3-contained-in-103525.html if-n-is-the-product-of-all-positive-integers-less-than-103218.html if-n-is-the-product-of-integers-from-1-to-20-inclusive-106289.html if-n-is-the-product-of-all-multiples-of-3-between-1-and-101187.html if-p-is-the-product-of-integers-from-1-to-30-inclusive-137721.html what-is-the-greatest-value-of-m-such-that-4-m-is-a-factor-of-105746.html if-6-y-is-a-factor-of-10-2-what-is-the-greatest-possible-129353.html if-m-is-the-product-of-all-integers-from-1-to-40-inclusive-108971.html if-p-is-a-natural-number-and-p-ends-with-y-trailing-zeros-108251.html if-73-has-16-zeroes-at-the-end-how-many-zeroes-will-147353.html find-the-number-of-trailing-zeros-in-the-expansion-of-108249.html how-many-zeros-are-the-end-of-142479.html how-many-zeros-does-100-end-with-100599.html find-the-number-of-trailing-zeros-in-the-product-of-108248.html
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9697854199186668, "lm_q1q2_score": 0.8373045950326766, "lm_q2_score": 0.8633916099737806, "openwebmath_perplexity": 1101.4882821330661, "openwebmath_score": 0.8408488035202026, "tags": null, "url": "https://gmatclub.com/forum/if-n-is-the-product-of-all-multiples-of-3-between-1-and-100-what-is-101187.html" }
rust let years = Utc::now().year() - date.year(); let months = Utc::now().month() - date.month(); let days = Utc::now().day() - date.day(); println!("Timespan:\n{} year(s), {} month(s), {} day(s)", years, months, days); println!("{} weeks", total_days.num_weeks()); println!("{:.2} years", total_days.num_days() as f32 / 365_f32); } A sample output (you should get): What's your date (DD/MM/YYYY): 01/01/1970 Input interpretation: days since Thursday, January 01, 1970 Result: 18567 days have rusted away ¯\_(ツ)_/¯ Timespan: 50 years, 10 month(s), 0 days 2652 weeks 50.87 years I can't see any issues in terms of making your code idiomatic; it looks very Rust-like! I did however notice a problem with your code's logic. Integer overflow I tried inputting 31/12/2019 and obtained a panic when I ran it today (07/11/2020). This was because Utc::now().month() is a u32 equal to 11, and the code attempts to subtract 12: let months = Utc::now().month() - date.month();
{ "domain": "codereview.stackexchange", "id": 39824, "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": "rust", "url": null }
c++, beginner, object-oriented, eigen // Payoff of put option static Eigen::VectorXd PutPayoff(const Eigen::VectorXd& S, double K); // Find function for finding the paths that are in the money (call option) static Eigen::VectorXd Findcallpath(const Eigen::VectorXd& S, double K); // Find function for finding the paths that are in the money (put option) static Eigen::VectorXd Findputpath(const Eigen::VectorXd& S, double K); // Find price of call given path static Eigen::VectorXd Findcallprices(const Eigen::VectorXd& path, const Eigen::VectorXd& S); // Find price of put given path static Eigen::VectorXd Findputprices(const Eigen::VectorXd& path, const Eigen::VectorXd& S); // Find return of call (stock price - strike price) static Eigen::VectorXd Findcallreturn(const Eigen::VectorXd& S, double K); // Find return of put (strike price - stock price) static Eigen::VectorXd Findputreturn(const Eigen::VectorXd& S, double K);
{ "domain": "codereview.stackexchange", "id": 27836, "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++, beginner, object-oriented, eigen", "url": null }
quasiparticles, fermi-liquids, tomonaga-luttinger-liquid It is understood that Fermi liquid description is approximate, so I expect some kind of approximatate procedure along the lines of the Schrieffer-Wolff transformation or the the genuine guesses used for spin Hamiltonians (Holstein-Primakoff, Jordan-Wigner, etc.) A close relative of the Fermi liquid is Luttinger liquid, which is exactly mapped onto a collection of non-interacting bosons. In this respect, I would like to stress that I am looking for a canonical transformation, similar to canonical bosonization, as described in the reviews of Haldane, Voit or Giamarchi's book (as opposed to more recent popular bosonization via path integrals). It seems that it can be performed in terms of RPA (random phase approximation). In this set up, one should consider Bose-operators for particle-hole pairs, $$ c_{p,k}=a^{\dagger}_pa_{p+k},\quad c_{p,k}^{\dagger}=a_{p+k}^{\dagger}a_p,$$
{ "domain": "physics.stackexchange", "id": 84611, "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": "quasiparticles, fermi-liquids, tomonaga-luttinger-liquid", "url": null }
machine-learning, neural-network, tensorflow, image-classification, image-recognition To answer your question, yes. The reason is that it leads to high Bayes error. It simply means that you as an expert can not say what they are. Consequently, it is not possible for the network to learn them. You can easily see the images and figure out that there is not anything to be learned. For instance, in that case, what is the difference between the sky and sea? Can a $64\times64$ image represent them? Can you as an expert find it out without any previous knowledge?
{ "domain": "datascience.stackexchange", "id": 4103, "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, neural-network, tensorflow, image-classification, image-recognition", "url": null }
• There are fashions here too. For example, it was long customary to insist that probability density functions and probability mass functions were quite different kinds of beasts referring to continuous and discrete variables respectively. A common and in my experience more recent tendency, particularly with mathematically more mature groups, is to insist that the idea of density function is general; it is just a case of density with respect to what kind of measure, and measure could be e.g. counting measure. So density functions, wide sense, include mass functions. – Nick Cox Oct 26 '16 at 13:21 (1) You are right regarding (1). (2)&(3)&(4) PDF is for probability density function. We usually use probability distribution function to mean CDF. Probability function is used to refer to either probability mass function(the probability function of discrete random variable) or probability density function(the probability function of continuous random variable).
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9796676496254957, "lm_q1q2_score": 0.8494068899954929, "lm_q2_score": 0.8670357649558006, "openwebmath_perplexity": 551.7198944838262, "openwebmath_score": 0.9183500409126282, "tags": null, "url": "https://stats.stackexchange.com/questions/242465/distribution-function-terminology-pdf-cdf-pmf-etc" }
acceleration, astrophysics, plasma-physics, shock-waves $$ \begin{align} V_{ph, \parallel} & = \frac{ \omega }{ k_{\parallel} } = \frac{ \omega }{ k \ \cos{\theta_{kB}} } \tag{0a} \\ V_{ph, \perp} & = \frac{ \omega }{ k_{\perp} } = \frac{ \omega }{ k \ \sin{\theta_{kB}} } \tag{0b} \end{align} $$
{ "domain": "physics.stackexchange", "id": 76512, "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": "acceleration, astrophysics, plasma-physics, shock-waves", "url": null }
VIII. 8.1. Large powers: saddle-point bounds: We consider throughout this section two fixed functions, $$A(z)$$ and $$B(z)$$ satisfying the following conditions. • L1: The functions $$A(z)=\sum_{j\geq 0}a_jz^j$$ and $$B(z)=\sum_{j\geq 0}a_jz^j$$ are analytic at $$0$$ and have non-negative coefficients; furthermore it is assumed (without loss of generality) that $$B(0) \ne 0$$. • L2: The function $$B(z)$$ is aperiodic in the sense that $$\gcd\{j|b_j>0\}=1$$. (Thus $$B(z)$$ is not a function of the form $$\beta(z^p)$$ for some integer $$p\geq 2$$ and some $$\beta$$ analytic at $$0$$.) • L3: Let $$R\leq \infty$$ be the radius of convergence of $$B(z)$$; the radius of convergence of $$A(z)$$ is at least as large as $$R$$. We observe conditions L1 to L3 are fulfilled for $$A(z)=1$$ and $$B(z)=\left(1+z+z^2+\cdots+z^9\right)^2$$ with radius of convergence $$R=\infty$$. In the following we need the quantity $$T$$ called spread which is defined as
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9790357573468175, "lm_q1q2_score": 0.8004346508393979, "lm_q2_score": 0.8175744806385542, "openwebmath_perplexity": 400.0119019042564, "openwebmath_score": 0.9821085929870605, "tags": null, "url": "https://math.stackexchange.com/questions/3063646/what-is-the-probability-that-the-sum-of-digits-of-a-random-k-digit-number-is" }
c++, performance, c++17 constexpr const_reverse_iterator crbegin() const noexcept; constexpr const_reverse_iterator crend() const noexcept; private: const_pointer mPtr; size_type mSize; }; template <typename T> Span<T>::Span(const_pointer ptr, size_type size) : mPtr{ptr}, mSize{size} { } template <typename T> constexpr typename Span<T>::const_pointer Span<T>::data() const noexcept { return mPtr; } template <typename T> constexpr typename Span<T>::size_type Span<T>::size() const noexcept { return mSize; } template <typename T> constexpr typename Span<T>::const_reference Span<T>::operator[](Span::size_type idx) const { assert(idx < mSize); return *(data() + idx); } template <typename T> constexpr typename Span<T>::const_iterator Span<T>::cbegin() const noexcept { return data(); } template <typename T> constexpr typename Span<T>::const_iterator Span<T>::cend() const noexcept { return data() + size(); }
{ "domain": "codereview.stackexchange", "id": 40734, "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", "url": null }
evolution Heiling (1999) performed an interesting study on a nocturnal orb-web spider. The spider lives near the water so it will sometimes build its orb webs on the bridges crossing the water. She found that more spiders build their webs near the lights on one particular bridge compared to unlit parts of the bridge that were otherwise built the same. She found that there was more insect activity around the lighted area (no surprise there) and that the spiders that built near the lights caught more of those insects compared to the spiders that built away from the lights. Perhaps the most interesting result is when she studied the behavior of these spiders in the lab. Spiders that were born and raised in the lab preferentially went to the artificial light source. These had never before been exposed to the artificial lights. She argued that the light-seeking ability of the orb-web spiders she studied is genetic.
{ "domain": "biology.stackexchange", "id": 2774, "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": "evolution", "url": null }
seurat, single-cell, clustering # using dplyr across to calculate the mean mitochondrial percentage and # the median tsne values per cluster label.df <- label.df %>% dplyr::group_by(seurat_clusters) %>% dplyr::summarise(dplyr::across(percent.mito, ~ mean(.), .names = "mean_{.col}"), dplyr::across(contains("tSNE"), ~ median(.))) # running FeaturePlot and adding the label layer FeaturePlot(seurat_object, reduction = "tsne", features = "percent.mito") + geom_text(data = label.df, aes(x = tSNE_1, y = tSNE_2, label = mean_percent.mito)) The labels are positioned at the median position of the cells of a cluster. Typing LabelClusters (without brackets) in the R console will show you the labeling function used by Seurat that contains some additional ways of positioning the labels. If you want to avoid overlapping labels you can use geom_text_repel from the ggrepel package.
{ "domain": "bioinformatics.stackexchange", "id": 1606, "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": "seurat, single-cell, clustering", "url": null }
kalman-filter, books Title: Source to learn Kalman Fusion, explanatory code snippets Currently I am reading a book of Mr. Thrun: Probabilistic Robotics. I find it really helpfull to understand concept of filters, however I would like to see some code in eg. Matlab. Is the book "Kalman Filter for Beginners: with MATLAB Examples" worth buying, or would you suggest some other source to learn the code snippets from? I have read the book, and found it unnecessarily obtuse. Unfortunately, the code snippets will not be very helpful, since they will probably look exactly like the equations, while using a matrix library like Eigen, OpenCV, boost, or just Matlab. To get a good understanding of a Kalman Filter, you should start with a review of multi-variate Gaussian random variables, then brush up on Taylor Series expansions, then realize we are just inventing a covariance matrix for the joint distribution of measurements and state. For example, here's some code I wrote for a robotic rover which uses an EKF.
{ "domain": "robotics.stackexchange", "id": 1747, "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": "kalman-filter, books", "url": null }