text
stringlengths
1
1.11k
source
dict
complexity-theory, complexity-classes Title: Is there a decidable problem that we know for sure cannot be solved in polynomial time? If yes, could you say an example? P=NP would result in NP problems being solvable in polynomial time, but there would still be problems in the EXPTIME class. It is known that P $\ne$ EXPTIME. Therefore, any EXPTIME-complete problem suffices. For instance: given a deterministic Turing machine $M$, an input $x$, and a positive integer $k$ (represented in binary), determine whether $M$ halts on input $x$ within at most $k$ steps. Related: How do we know for sure that EXPTIME β‰  P?, Halting problem in EXP-complete.
{ "domain": "cs.stackexchange", "id": 21725, "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": "complexity-theory, complexity-classes", "url": null }
quantum-mechanics, classical-mechanics, education, dimensional-analysis, commutator Later, when you learn about relativistic QED, you'll see that the relation $E=\hbar\omega$ for photons gets its factor of $\hbar$ from the same source: commutation relations.
{ "domain": "physics.stackexchange", "id": 70566, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, classical-mechanics, education, dimensional-analysis, commutator", "url": null }
black-holes, terminology, singularities, models What scientists mean is "our best theory produces non-sensical or contradictory results in this situation, so we know the theory doesn't make good predictions there." They do not mean that there can never be a theory that works, or that somehow there are no laws of physics whatsoever in the situation. It just means we don't know what the law is. Every physicist fully expects that there are laws of physics that predict what happens at the center of a black hole. Probably something perfectly sensible happens, though it's probably something weird and unlike anything else we know.
{ "domain": "physics.stackexchange", "id": 84576, "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": "black-holes, terminology, singularities, models", "url": null }
quantum-mechanics, quantum-field-theory, time-evolution, s-matrix-theory $$\hat{A}_\mu = \sum_{\epsilon=1,2}\sum_p [c_{pe} \epsilon_\mu e^{-ipx} + c^\dagger_{pe} \epsilon^\ast_\mu e^{ipx} ]$$ $\epsilon_\mu$ are components of the polarisation vector of the photon. Then we can compute S-matrix elements between an electron state $i$ and an electron state $f$ plus 1 photon like: $$\langle 1_k f|S| 0i\rangle =\langle 1_k f| 0i\rangle - i \int d^4x e \langle f|j^\mu|i\rangle \sum_{\epsilon=1,2}\sum_p \langle 1_k| c^\dagger_{pe}| 0\rangle \epsilon^\ast_\mu e^{ipx} = - i\int d^4x \sum_{\epsilon=1,2} e \langle f|j^\mu(x)|i\rangle e^{ikx} \epsilon^\ast_\mu$$ where $\tilde{j}^\mu_{if}$ is the 4-dim. Fourier transform of the electromagnetic current: $$\tilde{j}^\mu_{if}(k) = \int d^4x \langle f|j^\mu(x)| i\rangle e^{ikx}$$
{ "domain": "physics.stackexchange", "id": 88236, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, quantum-field-theory, time-evolution, s-matrix-theory", "url": null }
theorem, power spectral density functions and are calculated as Fourier transforms of the corresponding cross-correlation functions and [ 38 ]: where denotes. Integral Ct aC (t) + bD (t) C (t) tC (t). Hence Laplace Transform of the Derivative. Convolution Some operations are simplified in the frequency domain, but there are a number of signals for which the Fourier transform does not exist – this leads naturally onto Laplace transforms. , time-shift, modulation, Parseval's Theorem) of Fourier series, Fourier transforms, bilateral Laplace transforms, Z transforms, and discrete time Fourier transforms and an ability to compute the transforms and inverse transforms of basic examples using methods such as partial fractions. I would appreciate your giving specific example with a conclusion. They have many applications in signal and image processing [10]. L[J(t)] is defined by J:. This is an important result, also known as the right-shifting property, which will be used later in various
{ "domain": "comprensivobovalino.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.97631052387569, "lm_q1q2_score": 0.8177771852106597, "lm_q2_score": 0.8376199633332891, "openwebmath_perplexity": 1063.6149374171082, "openwebmath_score": 0.7958521246910095, "tags": null, "url": "http://comprensivobovalino.it/zpan/laplace-time-shift-examples.html" }
homework-and-exercises, classical-mechanics, kinematics Obviously I have to use 1D kinematic equations for this, but I have no idea how to solve it or let alone where to even begin and I've been racking my brain for hours. So if someone can help me out I'd greatly appreciate it. Draw it! Make a sketch. Remember coordinate system. Then you can clearly see all known values - starting positions, velocities, accelerations etc. Pick one of the four motion (kinematic) equations for each - one for the bus, and one for you: $$x=x_0+v_ot+\frac 12 at^2\\ v^2=v_0^2+2a(x-x_0)\\ v=v_0+at\\ x=x_0+\frac 12(v+v_0)t$$ For example, in this case I would choose the top one for both. Figure out what they have in common - they will both be at the same place at the same time, when you catch the bus. So $x_{bus}=x_{you}$ and $t_{bus}=t_{you}$. Now solve it!
{ "domain": "physics.stackexchange", "id": 33492, "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, classical-mechanics, kinematics", "url": null }
c++, c++11, sorting, mergesort // I would rewrite as: I loop = head; ++loop; auto find = std::find_if(loop, tail, [&less](I lhs, I rhs){return !less(*lhs, *rhs);}); This bit of code: Value tmp = std::move (* head); std::move (head + 1, dest + 1, head); * dest = std::move (tmp); is implemented by std::rotate(). Again I hate the comment. Not because it or the function are badly named. But because the comment does not give me any extra information. If it is not giving me information, it is actually worse than nothing as it will suffer from comment rot over time. The name of the function and its parameters should be your documentation. /* Merges two sorted sub-lists */ static void do_merge (Iter head, Iter mid, Iter tail, Less less, std::vector<Value> & buf)
{ "domain": "codereview.stackexchange", "id": 33583, "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, sorting, mergesort", "url": null }
fluid-mechanics, ansys, fluent Title: Variable inlet velocity implementation in ANSYS Fluent I'm trying to perform 2D analysis for a steady laminar incompressible flow through a horizontal channel with a height of H (m) and length of 2H. The boundary conditions is of the form: $u=\frac{3}{2}U_{avg}\left(1-\frac{2y}{H}\right),v=0$ at $x=0$, $\frac{\partial u}{\partial x}=0,\frac{\partial v}{\partial x}=0$ at $x=2H$, with no-slip condition at the walls. Is it possible to implement these boundary conditions in Fluent? I think that UDF may help but I have no experience dealing with it. Thanks in advance, I will appreciate any help. I am not sure if you have already found a way or not, but for others just posting the answer. You can always refer the Fluent UDF user guide and samples. These are few additional examples which you can refer: https://www.learncax.com/knowledge-base/blog/by-category/cfd/writing-a-user-defined-function-udf-in-ansys-fluent https://www.southampton.ac.uk/~zxie/SESS6021/udf_tut1.pdf Thanks
{ "domain": "engineering.stackexchange", "id": 5429, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fluid-mechanics, ansys, fluent", "url": null }
cellular-respiration For an animation, feel free to view this link from Pearson. Thanks! The solid precipitate does not contribute as much to the pressure inside the vial as the gas does. Intuitively, the gaseous molecule contributes to the pressure by collisions that exert force on the vessel (which would push the water out). By contrast, the solid precipitate only contributes to the pressure insofar as it decreases the volume of the vessel, which is negligible in comparison to the loss of kinetic energy per gas molecule.
{ "domain": "biology.stackexchange", "id": 5485, "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": "cellular-respiration", "url": null }
quantum-mechanics, integrable-systems $$ \sum_i \log(1 + \lambda\phi_i^2)$$ And I did not introduce this measure factor in the new action, so the interactions are nonzero for the quantum variables. This system is a 2 space dimension lattice field theory of sigma-model type, and it's not going to have any special integrability properties in the quantum domain (aside from those derived from the integrability of the classical limit, which isn't saying much). So it will have wild quantum scattering which will conspire to make integrable free-field behavior at large coherent waves made up of large numbers of excitations per wavelength, degenerating to a random mess when the waves disperse to low enough amplitude that the semiclassical approximation is no good.
{ "domain": "physics.stackexchange", "id": 4162, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, integrable-systems", "url": null }
Regarding method by @QiaochuYuan, you can perform the same "trick" to get better approximations which will be performing better in the neighbourhood of $x=0$ but worse when $x$ is large, for example $\log (1+x) \approx \frac{x}{(1+5x/6)^{3/5}} + \frac{x^4}{108 (1+5x/6)^{12/5}}$ But in disguise what you are actually making is finding better approximations to some Pade approximant. Some of the other approximations you can find in the same way are $\log(1+x)\approx \frac{x}{\sqrt{1+x+x^2/12}}$ and $\log(1+x)\approx \frac{x}{(1+3x/2+x^2/2)^{1/3}}$ which are good simply beause they coincide with Pade approximant up to the terms of high order. I guess the first among those two is another reason why $\frac{x}{\sqrt{1+x}}$ worked so well.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9719924802053235, "lm_q1q2_score": 0.8608271298503518, "lm_q2_score": 0.885631470799559, "openwebmath_perplexity": 289.8432629016002, "openwebmath_score": 0.8592144846916199, "tags": null, "url": "https://math.stackexchange.com/questions/1046321/approximating-log-x-with-roots" }
If I force the axes to cross at the origin with AxesOrigin -> {0, 0}, I see only the expected tangencies: Plot[Sinc[x]^2/Ο€, {x, -15, 15}, AxesOrigin -> {0, 0}, PlotRange -> All]
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9481545304202039, "lm_q1q2_score": 0.8020841525674837, "lm_q2_score": 0.8459424353665381, "openwebmath_perplexity": 1089.4903817696882, "openwebmath_score": 0.1855631321668625, "tags": null, "url": "https://mathematica.stackexchange.com/questions/117794/plotting-positive-function-looks-like-it-goes-negative" }
performance, vba, excel fnd = True Else n = n - 1 End If Loop If Not fnd Then 'post notice if we haven't already for this item and this file If OldOName <> OName Then 'Update OldOName and clear INotFnd OldOName = OName INotFnd = "" End If
{ "domain": "codereview.stackexchange", "id": 20653, "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, vba, excel", "url": null }
c++, object-oriented, c++14, overloading class iteamList { private: int m_totalStockValue = 0; std::unordered_map<int, Iteam> m_iteamMap; private: // (iii) appending iteam to the list inline void AppendIteams(const int& userInput_n) { for(auto i=0; i<userInput_n; ++i) { Iteam obj; obj.inputData(); std::cout << obj << std::endl; m_iteamMap.emplace(obj.m_code, obj); } } public: iteamList() = default; iteamList(const int& userInput_n) { m_iteamMap.reserve(userInput_n); AppendIteams(userInput_n); } ~iteamList(){}
{ "domain": "codereview.stackexchange", "id": 29889, "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, c++14, overloading", "url": null }
image-classification, feature-extraction, image-recognition, computer-vision, amazon-ml Features are calculated from the original images using the Caffe deep learning framework [11]. In particular, we used a Caffe reference model with 5 convolutional layers followed by 3 fully-connected layers, which has been pre-trained on 1.2 million ImageNet (ILSVRC2010) images. We use the output of FC7, the second fully-connected layer, which results in a feature vector of length F = 4096.
{ "domain": "datascience.stackexchange", "id": 1871, "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-classification, feature-extraction, image-recognition, computer-vision, amazon-ml", "url": null }
string-theory, supersymmetry, quantum-chromodynamics, yang-mills, superconformality Quite generally, it's enough to verify that the theory is renormalizable and the RG running of all the renormalizable dimensionless couplings vanishes. For the right choices of the couplings, this was done in their paper. The only correction of the quantum loops to the parameters in these theories is a fixed shift to the Chern-Simons level $k$.
{ "domain": "physics.stackexchange", "id": 3542, "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": "string-theory, supersymmetry, quantum-chromodynamics, yang-mills, superconformality", "url": null }
ros, ros2, message, subscribe, publish There is also some flexibility as to how this is implemented. For example, this page on the CoreDX DDS implementation's page says that they will not deliver messages out of order in best effort: http://www.twinoakscomputing.com/coredx/architecture So I think the best bet (and we should clarify this in our API documentation -- something else we could use help with :D) is to assume they are not delivered in order. We also removed the "sequence number field" from the standard ROS Header message type (https://github.com/ros2/common_interfaces/pull/2), with the idea that it was ill formed and that the middleware should give this information outside of the message data. Unfortunately we haven't exposed this information from the middleware yet either (something we could use help with perhaps), but ideally the sequence numbers would be unique and monotonic for each separate publisher (part of the reason a sequence number in the message data was ill formed).
{ "domain": "robotics.stackexchange", "id": 29779, "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, ros2, message, subscribe, publish", "url": null }
c++, template, collections, vectors It lets you avoid having the print function that does exactly the same. Using new[] default initializes all element in the array, for some types that's a compile error, for others it's an expensive operation. Bug in erase, it changes the capacity but doesn't update the field -> leads to overflow on next add.
{ "domain": "codereview.stackexchange", "id": 22613, "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++, template, collections, vectors", "url": null }
ros, ros-kinetic, gripper, joint-states, joint-state-publisher If the answer is not clear enough, please feel free to ask for any clarification :) I will answer quicker this time
{ "domain": "robotics.stackexchange", "id": 33337, "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, gripper, joint-states, joint-state-publisher", "url": null }
java, swing Title: JTextPane with line-numbers What I wanted to do As part of a larger project, I needed a simple text editor with line numbers. The editor should also be able to highlight the current line (line number in bold) and define the tab size. The result looks like this: My solution After searching the internet for a while, I found out about the possibility of using a DocumentListener and adding a sepearate text-component with the line-numbers as RowHeader: DocumentListener RowHeader
{ "domain": "codereview.stackexchange", "id": 38781, "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, swing", "url": null }
e-commerce sales are predicted to increase by $171. create an increase in the number of electrons traveling from cathode to anode d. 7 A wheel 1. ∴ m = k/n 2. But KE can also be defined by … The relationship with R Squared and degrees of freedom is that R Squared will always increase as the degrees of freedom decreases which as we saw earlier drastically reduces the reliability of the model. The entire process is driven by applying electrical power to the coil, with the source voltage having a direct relationship to the motor’s output speed. A square wave in the frequency domain looks like a sum of odd frequencies: Figure 3. If a car traveled 30 miles in an hour, the speed would be 30 miles per hour. For a linear relationship, the gradient at any point along the line is the same. So doubling the speed of a vehicle means 8 times the engine power required to compensate for drag! This has e. More massive objects require bigger net forces to accelerate the same amount as less massive
{ "domain": "diapindia.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.98201378740596, "lm_q1q2_score": 0.8366294014433552, "lm_q2_score": 0.8519528057272544, "openwebmath_perplexity": 472.06879802409924, "openwebmath_score": 0.7215793132781982, "tags": null, "url": "https://smartclinic2.diapindia.org/wp-content/uploads/2022/01/rhl9jwj/the-increase-of-speed-is-a-squared-relationship.html" }
electromagnetic-radiation, material-science, absorption, antennas Title: If EM waves of radio range can pass through large obstacles, why antennas do receive them? For example a tiny antenna in the phone, why em wave do not pass through it, but pass through concrete walls? For an antenna to pick up a sufficient signal, it does not need to stop the wave - it just needs to slightly attenuate it, which it does. In general, when radio waves pass through obstacles, they get attenuated and, given the same level of conductivity, larger obstacles will cause greater attenuation, but even a small fraction of the absorbed energy could be sufficient for an adequate reception. I would add that an antenna of a phone is tuned to a particular frequency range and, because of that, everything else the same, it will absorb more energy in that frequency range than a randomly shaped conductor of a similar size.
{ "domain": "physics.stackexchange", "id": 53070, "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": "electromagnetic-radiation, material-science, absorption, antennas", "url": null }
soft-question, cr.crypto-security, pseudorandom-generators Title: Are linear feedback shift registers being generally discouraged by cryptologists? Katz and Lindell mention in their book that LFSR have been horrible as basis for pseudorandom generators, and advocate that they are not used anymore (well, they also recommend that people use block ciphers instead of stream ciphers). But I see for example that one of the ciphers in the estream portfolio (Grain, targeted for hardware) uses an LFSR, so the opinion that LFSRs are not good is not a consensus. I'd like to know if there many cryptologists sharing Katz and Lindell's opinion on LFSRs (and on stream ciphers)? There are many types of cryptanalytic attacks: Linear approximations, Algebraic attacks, Time-memory-data-tradeoff attacks, fault attacks. For example you can read the survey: "Algebraic Attacks On Stream Ciphers (Survey)" Abstract: Most stream ciphers based on linear feedback shift registers (LFSR) are vulnerable to recent algebraic attacks. In this survey paper, we describe
{ "domain": "cstheory.stackexchange", "id": 1482, "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": "soft-question, cr.crypto-security, pseudorandom-generators", "url": null }
equilibrium, aqueous-solution, ph Title: How do we know the concentration of hydroxide ions in this derivation? In the derivation of the pH of a solution of a salt prepared from a weak acid and strong base, I used two equilibrium reactions: $$\ce{ CH3COOH(aq) + H2O(l) <=> H3O+(aq) + CH3COO-(aq)} \qquad k_{eq} = K_a \\ \ce{ 2H2O(l) <=> H3O+(aq) + OH-(aq) } \qquad k_{eq} = K_w$$
{ "domain": "chemistry.stackexchange", "id": 7129, "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": "equilibrium, aqueous-solution, ph", "url": null }
ros, layered-costmap Title: Layered costmap Hello, I am a newbie to ROS and especially the 2d_nav stack. So please pardon me if my query sounds to petty. I have been reading the literature about the Layered costmap recently. I would like to use something similar. To be precise, I would like to add one layer and use the information in this layer during the planning process. However, I am not very clear yet how the layered costmap works. Are there different layeres existing and the information at all layers is combined to form a final layer which is basically combination of say the inflation radii at different layers? Or information about each layer is maintained and fe to the planner? Or its something else? Please let me know if you have any information about this. Thank you in advance.
{ "domain": "robotics.stackexchange", "id": 20028, "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, layered-costmap", "url": null }
homework-and-exercises, electromagnetism, electric-current, potential Use the head-to-tail construction for adding the voltage phasors in the top branch. Put the tail of the $V_{R1}$ phasor at the origin. You should get a right angled triangle. Repeat for the bottom branch with the tail of the $V_C$ phasor at the origin. You should find that the points representing the potentials of A and B do not co-incide. The distance separating them is a phasor whose length you have been told. The phase difference that you mention has been automatically dealt with. Exploiting symmetries in the diagram you can find the value of $U$. I reached it via a simple quadratic equation, but you don't need this if you are just checking which one of the given answers fits. Good luck!
{ "domain": "physics.stackexchange", "id": 86058, "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, electromagnetism, electric-current, potential", "url": null }
#### Root Test Suppose that we have the series $$\sum {{a_n}}$$. Define, $L = \mathop {\lim }\limits_{n \to \infty } \sqrt[n]{{\left| {{a_n}} \right|}} = \mathop {\lim }\limits_{n \to \infty } {\left| {{a_n}} \right|^{\frac{1}{n}}}$ Then, 1. if $$L < 1$$ the series is absolutely convergent (and hence convergent). 2. if $$L > 1$$ the series is divergent. 3. if $$L = 1$$ the series may be divergent, conditionally convergent, or absolutely convergent. A proof of this test is at the end of the section. As with the ratio test, if we get $$L = 1$$ the root test will tell us nothing and we’ll need to use another test to determine the convergence of the series. Also note that, generally for the series we’ll be dealing with in this class, if $$L = 1$$ in the Ratio Test then the Root Test will also give $$L = 1$$. We will also need the following fact in some of these problems. #### Fact $\mathop {\lim }\limits_{n \to \infty } {n^{\frac{1}{n}}} = 1$
{ "domain": "lamar.edu", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9895109078121007, "lm_q1q2_score": 0.839073352090488, "lm_q2_score": 0.847967764140929, "openwebmath_perplexity": 210.84258556482436, "openwebmath_score": 0.9078403115272522, "tags": null, "url": "https://tutorial.math.lamar.edu/Classes/CalcII/RootTest.aspx" }
javascript, performance, depth-first-search var data = { a: { a1: 'hello', a2: true, a3: false, a4: {}, a5: [], a6: ['red', 'blue', true], a61: {a61a: 'red', a61b: 'blue'}, a7: null, a8: undefined, a9: NaN, a10: function() {}, a11: Math, a12: JSON, a13: /a-z/, a14: new ReferenceError, a15: new Date, a16: new Number(7), a17: new String("abc"), a18: new Boolean(true) }, b: { b1: { b1a: true, b1b: 100 }, b2: { b2a: true, b2b: false, b2c: 10.10 } } }
{ "domain": "codereview.stackexchange", "id": 17928, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, performance, depth-first-search", "url": null }
algorithms, optimization, dynamic-programming, recurrence-relation we also have limit $l_i$ on the number of pieces of length $i$ that we are allowed to produce, for $i = 1, 2, \ldots, n$. Problem: Is this variant of the rod cutting problem solvable using dynamic programming? Answer My Own Question: Let $L$ be the length limit array. Define $R(i, L)$ to be the maximum revenue obtainable by cutting up a rod of length $i$ with the length limit array $L$. The recursion is (consider the leftmost piece of length $j$; the base cases are not included): $$R(i, L) = \max_{1 \le j \le i \land L_j \ge 1} \Big(p_j + R\big(i-j, L[j \mapsto L_j-1]\big)\Big),$$ where $L[j \mapsto L_j - 1]$ leaves other length limit than $L_j$ unchanged.
{ "domain": "cs.stackexchange", "id": 12205, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithms, optimization, dynamic-programming, recurrence-relation", "url": null }
python, deep-learning, keras, cnn, alex-net Title: Don't know how to preprocess my dataset for image classification I'm trying to do image classification using CNN. The exact model isn't important but I decided to try use AlexNet and I'm getting abysmal accuracy. I believe the issue might be with my data preprocessing. My dataset directory contains a Training and Test folder but no validation folder (I have to split the dataset myself) and they are layed out like this: Training β”œβ”€β”€ class0 β”‚ β”œβ”€β”€ image1 β”‚ β”œβ”€β”€ .... β”‚ └── image20 β”‚ β”œβ”€β”€ .... β”‚ β”œβ”€β”€ image1 β”‚ β”œβ”€β”€ .... β”‚ └── image20 β”‚ └── class9 β”œβ”€β”€ image1 β”œβ”€β”€ .... └── image20
{ "domain": "datascience.stackexchange", "id": 7612, "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, deep-learning, keras, cnn, alex-net", "url": null }
k-mer the Kraken app on Illumina BaseSpace, but it's not trivial to upload FASTQ data that hasn't been produced from an Illumina instrument. the CLARK trio of apps in InsideDNA, tried once with default parameters but produced empty results. One Codex is powerful and user friendly, and works in a similar way to Kraken underneath https://www.onecodex.com/ The Kaiju web server might be of interest and is more sensitive than exclusively k-mer based methods http://kaiju.binf.ku.dk/server The title of this question is misleading – it sounds like you're actually looking for a webserver for taxonomic classification using k-mers.
{ "domain": "bioinformatics.stackexchange", "id": 242, "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": "k-mer", "url": null }
robot-localization, ekf-localization-node 0, 0, 0, 0, 0, 0, 0, 1e-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-6]
{ "domain": "robotics.stackexchange", "id": 38876, "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": "robot-localization, ekf-localization-node", "url": null }
biochemistry, molecular-biology, biophysics Alternatively, if ATP hydrolysis is coupled via an enzyme, it is usually done through transient storage of the energy is protein conformation. An enzyme binds ATP, which makes the protein structure "bend" or conform around the ATP. This puts loads of strain (energy = A) on the protein which is offset by the stabilization of binding the ATP (energy = B). This strain can make an enzymatic surface open up on the protein which itself takes a lot of energy to make (energy = C). The surface can catalyze some reaction (X+Y->Z in your example) that costs some energy (energy = D). The completion of that reaction alters the enzyme's catalytic site to something new and higher energy (energy = E), which can be alleviated by cleavage of the ATP (-7.3 kcal/mol). Alas, ADP and P do not fit well into that site of the enzyme, so they float out, restoring that original ATP-binding surface to it's original state. Provided A>B>C>D>E>-7.3, the cycle will continue until the ATP is exhausted or you have no
{ "domain": "biology.stackexchange", "id": 9501, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "biochemistry, molecular-biology, biophysics", "url": null }
algorithms, optimization, heuristics If I understand this correctly, this means something like this (assuming maximisation): x = -infinity; for ( i = 1 .. N ) { x = max(x, hill_climbing(random_solution())); } return x; But how can you make this really effective, that is better than normal hill climbing? It is hard to believe that using random start values helps a lot, especially for huge search spaces. More precisely, I wonder:
{ "domain": "cs.stackexchange", "id": 115, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithms, optimization, heuristics", "url": null }
ros2, ros-humble def _connected(self, link_uri): self.get_logger().info('Connected!') self._lg_stab = LogConfig(name='Stabilizer', period_in_ms=100) self._lg_stab.add_variable('stateEstimate.x', 'float') self._lg_stab.add_variable('stateEstimate.y', 'float') self._lg_stab.add_variable('stateEstimate.z', 'float') self._lg_stab.add_variable('stabilizer.roll', 'float') self._lg_stab.add_variable('stabilizer.pitch', 'float') self._lg_stab.add_variable('stabilizer.yaw', 'float') self._lg_range = LogConfig(name='Range', period_in_ms=100) self._lg_range.add_variable('range.zrange', 'uint16_t') self._lg_range.add_variable('range.front', 'uint16_t') self._lg_range.add_variable('range.right', 'uint16_t') self._lg_range.add_variable('range.left', 'uint16_t') self._lg_range.add_variable('range.back', 'uint16_t')
{ "domain": "robotics.stackexchange", "id": 38626, "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, ros-humble", "url": null }
c++, c++14, sdl, tetris void frame_advance(const SDL_Event&); void frame_advance(Sdl::Screen&); private: void check_timer() noexcept; void handle_event(const SDL_Event&); void insert_tetromino() noexcept; void reset() noexcept; void check_game_over() noexcept; void handle_rows() noexcept; Tetromino create_tetromino() noexcept; Game_timer timer_; Button_dispatcher dispatch_button_{}; Tetromino_factory t_factory_{}; Tetromino_table t_table_{}; Tetromino current_tetromino_{create_tetromino()}; int score_{0}; bool game_over_{false}; }; } #endif game.cpp: #include "game.h" namespace Game_logic { Game_timer::Game_timer(std::chrono::milliseconds delay) noexcept : delay_{delay}, timer_{delay} {} bool Game_timer::ready() noexcept { return timer_.ready(); }
{ "domain": "codereview.stackexchange", "id": 23924, "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++14, sdl, tetris", "url": null }
Now for your question, define the unit vector $\vec{n}(\varphi)=(\cos\varphi, \sin\varphi)$ and $\vec{r}=(x,y)$. Note that the exponent in the integrand is now $$-i(x\cos \varphi+y\sin\varphi)=-i\vec{n}\cdot \vec{r}$$ Define the following integrals Similarly, define two more integrals \begin{aligned} I_\ell(\vec{r})&=\int_0^{2\pi} e^{-i\vec{n}(\varphi)\cdot\vec{r}}\cos (\ell \varphi) d\phi\\ I'_\ell(\vec{r})&=\int_0^{2\pi} e^{-i\vec{n}(\varphi)\cdot \vec{r}}\sin \ell \varphi d\varphi\\ \widetilde{I_\ell}(\vec{r})&= \int_0^{2\pi} e^{-i[\vec{n}(\varphi)\cdot \vec{r}-\ell\varphi]} d\varphi = I_\ell(\vec{r})+iI'_\ell(\vec{r}) \end{aligned} Note that $I_\ell$ and $I'_\ell$ are both real if $\ell$ is even, and purely imaginary otherwise (use the fact that $\vec{n}\to -\vec{n}$ means $\varphi\to \pi+\varphi$). This means $I_\ell$ is the real part of $\widetilde{I}$ if $\ell$ is even, and it is equal to $i\mathfrak{I}(\widetilde{I_\ell})$ if $\ell$ is odd.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9790357628519819, "lm_q1q2_score": 0.8282078937354133, "lm_q2_score": 0.8459424314825852, "openwebmath_perplexity": 263.5011571299656, "openwebmath_score": 0.9781397581100464, "tags": null, "url": "https://math.stackexchange.com/questions/2892212/how-to-evaluate-the-integral-int-02-pie-iax-cos-varphiy-sin-varphi" }
ros, ros2, joint-state-publisher, gazebo-plugin Title: How to use the position value published by joint state publisher in another node? Hi all, I am using a gazebo plugin found at /opt/ros/foxy/share/gazebo_plugins/worlds/gazebo_ros_joint_state_publisher. By echo the topic which is /demo/join_states_demo, I can see the position value of my joints. I would like to use those values in another node as an input. May i know how can i do that? Where should I find the source code of plugin? Thank you in advance. Originally posted by aash on ROS Answers with karma: 11 on 2021-12-09 Post score: 0 Original comments Comment by aash on 2021-12-10: edit: what is with me is only the .so file which is not readable. Hello @aash, By echo the topic which is /demo/join_states_demo, I can see the position value of my joints. I would like to use those values in another node as an input.
{ "domain": "robotics.stackexchange", "id": 37235, "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, ros2, joint-state-publisher, gazebo-plugin", "url": null }
c, parsing, configuration if (found_section) { dbg("Already found a section!"); return; } //dbg("Found a [ at position %zu, looking for ] now", pos); for (size_t x = updated_pos; x < length; ++x) { if (str[x] == ';') { break; } else if (str[x] == ']') { match_pos = x; break; } } if (match_pos == -1) { dbg("Reached end of line without closing ] (2)!"); return; } //dbg("Found matching ] at position %zd", match_pos); assert(match_pos >= updated_pos); size_t length_of_section = match_pos - updated_pos; //dbg("Length of name is %zu", length_of_section); char *section_name = malloc(length_of_section + 1); assert(section_name);
{ "domain": "codereview.stackexchange", "id": 22711, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c, parsing, configuration", "url": null }
c++, sudoku public: Solve() {} Solve(vector<vector<int>>& board) : N(board.size()) { int n = (int)ceil(sqrt(N)); if (n*n != N) exit(0); // look at already filled cells like number 5 at cell say (x, y). // set the 5th bit at rows[x], columns[y] and the 3x3 (for 9x9 Sudoku) box which (x, y) belongs to. vector<int> rows(N), columns(N), boxes(N); for (int i = 0; i < N; ++i) for (int j = 0; j < N; ++j) if (board[i][j]) { int bit = 1 << board[i][j]; rows[i] |= bit; columns[j] |= bit; boxes[(i / n)*n + (j / n)] |= bit; }
{ "domain": "codereview.stackexchange", "id": 38913, "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++, sudoku", "url": null }
quantum-field-theory, operators, path-integral \end{aligned} \tag3\end{equation} where the vectors are inside the path integral metric because they're included in the continuum limit product that defines the path integral, and $\mathbf{1}_{\{\mathbf{x}=\mathbf{x}'\}}$ is the indicator function that equals $0$ when $\mathbf{x}\neq\mathbf{x}'$ and $1$ when $\mathbf{x}=\mathbf{x}'$. The indicator function is in the exponent of $\phi(\mathbf{x}')$ to make sure that the field is a non-identity operator at $\mathbf{x}$ only. The equation $(3)$ in the OP is formally1 correct, and it is in fact one of the main ingredients in the functional integral formulation of quantum field theory. See Ref.1 for the explicit construction. For completeness, we sketch the derivation here. We use a notation much closer to the one in the OP than to that of Ref.1, but with some minors modifications (to allow for a more general result). The setup.
{ "domain": "physics.stackexchange", "id": 46293, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-field-theory, operators, path-integral", "url": null }
special-relativity, lagrangian-formalism, variational-principle, action The canonical Lagrangian $4$-momentum $$ \tilde{p}_{\mu}~:=~\frac{\partial \tilde{L}}{\partial \dot{x}^{\mu}} ~=~m_0\dot{x}_{\mu}\tag{7}$$ is the mechanical $4$-momentum if we identify the world-line parameter $\lambda$ and the proper time $\tau$. (We stress that it is not possible to make this identification $\lambda=\tau$ before varying the action. The identification $\lambda=\tau$ is only possible on-shell.) The Lagrangian energy function $$\tilde{h}~:=~\tilde{p}_{\mu}\dot{x}^{\mu}-\tilde{L}~=~\tilde{L} \tag{8}$$ is just the Lagrangian itself. The non-square root Lagrangian (6) and its corresponding Hamiltonian is discussed in Refs. 1 and 2. References: H. Goldstein, Classical Mechanics, 2nd edition, Sections 7.9 & 8.4. H. Goldstein, Classical Mechanics, 3rd edition, Sections 7.10 & 8.4.
{ "domain": "physics.stackexchange", "id": 31250, "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": "special-relativity, lagrangian-formalism, variational-principle, action", "url": null }
organic-chemistry, experimental-chemistry, redox, synthesis, alcohols In practice, is there a reason why the Parikh–Doering might be favoured over the Swern (DMSO activation with oxalyl chloride), or is it simply a case of "we just got better yields with it"? I checked in Kurti–Czako. No hints were offered, but they also did list two more Swern variants, namely Pfitzner–Moffatt (activation with a carbodiimide) and Albright–Goldman (activation with an acid anhydride). On top of that, as Jan mentioned in a comment, there is also the Corey–Kim oxidation where N-chlorosuccinimide is used to generate the chlorosulfonium salt from DMS (instead of DMSO). In general: are there benefits or drawbacks that are specific to each variant that would influence a synthetic chemist's decision, and if so, what are they? tl;dr:
{ "domain": "chemistry.stackexchange", "id": 7941, "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, experimental-chemistry, redox, synthesis, alcohols", "url": null }
`[0.6350 0.0780 0.1840]``"#A2142F"` Line width, specified as a positive value in points, where 1 point = 1/72 of an inch. If the line has markers, then the line width also affects the marker edges. The line width cannot be thinner than the width of a pixel. If you set the line width to a value that is less than the width of a pixel on your system, the line displays as one pixel wide. Marker size, specified as a positive value in points, where 1 point = 1/72 of an inch. Marker outline color, specified as `"auto"`, an RGB triplet, a hexadecimal color code, a color name, or a short name. The default value of `"auto"` uses the same color as the `Color` property. For a custom color, specify an RGB triplet or a hexadecimal color code. β€’ An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range `[0,1]`, for example, ```[0.4 0.6 0.7]```.
{ "domain": "mathworks.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9845754510863376, "lm_q1q2_score": 0.8026578893142285, "lm_q2_score": 0.8152324826183822, "openwebmath_perplexity": 2123.6773038792285, "openwebmath_score": 0.9180688261985779, "tags": null, "url": "https://au.mathworks.com/help/matlab/ref/plot3.html" }
java, performance, json, sql-server, csv private String getCommaSeparatedRow(Set<String> headers, Map<String, String> map) { List<String> items = new ArrayList<String>(); for (String header : headers) { String value = map.get(header) == null ? "" : map.get(header).replace(",", ""); items.add(value); } return StringUtils.join(items.toArray(), ","); } private void writeToFile(String output, String fileName) throws IOException { try (BufferedWriter bw = new BufferedWriter(new FileWriter(fileName))) { LOG.debug("Generating " + fileName + " ..."); bw.write(output); } catch (IOException e) { LOG.error(e.getMessage(), e); } }
{ "domain": "codereview.stackexchange", "id": 23270, "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, performance, json, sql-server, csv", "url": null }
javascript, beginner, html, css, dom canvas { -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none } .bn { color: white!important; display: inline-block; margin-bottom: 0; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; background-image: none; border: 1px solid transparent; white-space: nowrap; padding: 1px 3px; line-height: 1.4; border-radius: 3px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; user-select: none } .bn:focus { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color } .bn:hover, .bn:focus { color: #F7F7F7; text-decoration: none } .bd { color: #cb2027; background-color: #f2f2f2; margin: 3px }
{ "domain": "codereview.stackexchange", "id": 33871, "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, beginner, html, css, dom", "url": null }
performance, r 239381 904314 790992 771372 648307 937306 478231 56851 728292 994699 130731 240116 556997 672967 979512 424539 645145 949376 80033 376069 114933 252972 77950 568953 108474 947428 57796 520057 854701 115488 758723 217899 960396 772640 103455 328215 804652 827252 183740 152198 424707 941553 548825 862021 291441 648452 202376 638971 232853 760596 976750 159126 643668 199208 994109 412500 609935 971147 521431 503771 605497 601658 737264 577180 855460 363816 176342 196325 415268 88978 615893 229055 177122 119093 351213 910704 927305 808198 507047 689191 159784 418740 69097 164665 14995 414261 109834 66528 173404 662247 681151 140870 829244 141776 361699 138568 657414 195503 112556 269127 922361 299806 839713 955920 147911 955444 792788 792700 72646 509249 346538 89777 106293 60242
{ "domain": "codereview.stackexchange", "id": 35824, "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, r", "url": null }
quantum-mechanics, quantum-field-theory, operators, observables, eigenvalue The mathematically correct thing to do is to think of the field (and more generally local observables constructed from fields) as an operator-valued distribution. Distributions are mild generalization of functions; they are objects which don't have values at a point, but which do have average values in an arbitrarily small (but finite) region. Basically, for any test function $f$ on your spacetime, you get an operator $\phi(f)$ which you can think of as measuring the value "$\int f(x) \phi(x) dx$" of $\phi$ sampled by a probe with resolution $f$. Distributions can only be multiplied when their singularities don't coincide; they exhibit the same obnoxious behavior that quantum field operators do.
{ "domain": "physics.stackexchange", "id": 5913, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, quantum-field-theory, operators, observables, eigenvalue", "url": null }
java, algorithm, search return tentativeValue; } else { // Here, 'initialPlayer == minimizingPlayer'. double tentativeValue = Double.POSITIVE_INFINITY; for (S child : state.children()) { double value = makePlyImpl(child, depth - 1, minimizingPlayer, maximizingPlayer, minimizingPlayer); if (tentativeValue > value) { tentativeValue = value; } } return tentativeValue; } } } net.coderodde.zerosum.ai.impl.AlphaBetaPruningGameEngine package net.coderodde.zerosum.ai.impl; import net.coderodde.zerosum.ai.EvaluatorFunction; import net.coderodde.zerosum.ai.AbstractGameEngine; import net.coderodde.zerosum.ai.AbstractState;
{ "domain": "codereview.stackexchange", "id": 35957, "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, algorithm, search", "url": null }
ros And jtteleop launch file: sam@sam:~/code/ros/test$ roslaunch jtteleop.launch ... logging to /home/sam/.ros/log/cab3d0b6-c687-11e1-bd65-20cf30a23845/roslaunch-sam-26533.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB. started roslaunch server http://sam:57702/ SUMMARY ======== PARAMETERS * /r_cart/joint_max_effort/r_forearm_roll_joint * /r_cart/pose_command_filter * /r_cart/joint_max_effort/r_shoulder_pan_joint * /r_cart/joint_feedforward/r_shoulder_lift_joint * /r_cart/joint_feedforward/r_elbow_flex_joint * /r_cart/joint_max_effort/r_wrist_flex_joint * /r_cart/joint_max_effort/r_upper_arm_roll_joint * /r_cart/joint_feedforward/r_shoulder_pan_joint * /rosdistro * /r_cart/vel_saturation_trans * /r_cart/joint_feedforward/r_wrist_roll_joint * /r_cart/cart_gains/trans/d * /rosversion * /r_cart/joint_max_effort/r_shoulder_lift_joint
{ "domain": "robotics.stackexchange", "id": 10054, "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 }
type-theory |\emptyset| & = 0 \\ |1| & = 1 \\ |A\times B| & = |A||B| \\ |A\uplus B| & = |A|+|B| \\ |B^A| & = |B|^{|A|} \end{align}$$ where $A\times B$ is the Cartesian product of $A$ and $B$, $A\uplus B$ is the disjoint union of $A$ and $B$, and $B^A$ is the set of functions from $A$ to $B$. The type theoretic constructions $A\times B$ (product types), $A+B$ (sum types), and $A\to B$ (function types) correspond to these set theoretic constructs. For example, finite sets form a model of the simply typed lambda calculus with products and sums where product, sum, and function types are interpreted as exactly the constructs on finite sets above. This correspondence is not general. There are many other models of the simply typed lambda calculus that will interpret these type constructions differently. Nevertheless, this is the archetypal example. Category theorists often use similar notation but it is motivated the same way.
{ "domain": "cs.stackexchange", "id": 10478, "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": "type-theory", "url": null }
quantum-mechanics, homework-and-exercises, operators, momentum Title: Problem in derivation or momentum as generator of translation A derivation of momentum as generator of translation In this page, part 2 β€œMomentum as generator of translations”, I don’t understand this step: $$T(x)=\lim_{N \rightarrow \infty}(T(x/N))^N =\lim_{N \rightarrow \infty}\left(1-\frac{ixp}{N\hbar}\right)^N$$ How is the 2nd equality derived? My attempt: $$p_x=i\hbar \lim_{a\rightarrow 0} \frac{T(ax)-\mathbb{I}}{a}=i\hbar \lim_{N \rightarrow \infty} \frac{T(x/N)-\mathbb{I}}{1/N}$$ $$T(x/N)=\lim_{N\rightarrow \infty} \left(\mathbb{I}- \frac{ip }{N\hbar}\right)$$ I don’t know where the x in the numerator comes from. When you change your limits from $a\to 0$ to $N\to\infty$ you need to take care of your dimensions. What you are physically doing is slicing a length $x$ into $N$ parts such that each infinitesimal segment has length $a$. This also makes it clear that $a$ has dimensions of length. Thus the correct variable substitution is $$a\to\frac{x}{N}$$
{ "domain": "physics.stackexchange", "id": 64914, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, homework-and-exercises, operators, momentum", "url": null }
react.js, jsx return ( <div className="board"> <div className="todo"> <div>TODO</div> {todo.map((curr) => ( <Task key={curr.replaceAll(" ", "-")} moveLeft={moveLeft} moveRight={moveRight} type="todo" taskName={curr} /> ))} </div> <div className="inprogress"> <div>INPROGRESS</div> {inprogress.map((curr) => ( <Task key={curr.replaceAll(" ", "-")} moveLeft={moveLeft} moveRight={moveRight} type="inprogress" taskName={curr} /> ))} </div> <div className="done"> <div>DONE</div> {done.map((curr) => ( <Task key={curr.replaceAll(" ", "-")} moveLeft={moveLeft} moveRight={moveRight} type="done" taskName={curr} /> ))} </div> </div> ); }
{ "domain": "codereview.stackexchange", "id": 43743, "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": "react.js, jsx", "url": null }
vba, event-handling, ms-access Private Sub m_txtBox_AfterUpdate() On Error GoTo m_txtBox_AfterUpdate_Error Dim i As Integer i = 0 m_frm.Recordset.Edit m_frm.Recordset.Update On Error GoTo 0 Exit Sub m_txtBox_AfterUpdate_Error: 'This resolves an error which happens sometimes - not sure why Resume works but it fixes the .Update causing errors ??? If i = 0 Then i = i + 1 Resume Else sendErrorEmail "m_txtBox_AfterUpdate for " & m_txtBox.Name, err.Description, err.Number, ERROR_DEBUG End If End Sub
{ "domain": "codereview.stackexchange", "id": 32385, "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": "vba, event-handling, ms-access", "url": null }
javascript, jquery, beginner, backbone.js, underscore.js var method = this.$el.find('.method:checked').val(); var similar = this.$el.find('.find-similar:checked').size() > 0; var list = this.$el.find('.list-only:checked').size() > 0; this.find(dictionary, method, keyword, similar, list); }, find: function (dict_id, method, keyword, similar, list) { this.model.set({ dict_id: dict_id, method: method, keyword: keyword, similar: similar, list: list }); var url = App.API_BASEURL + "/" + dict_id + "/find/" + method + "/" + keyword; var extras = {}; if (similar) { extras.similar = true; } if (list) { extras.list = true; }
{ "domain": "codereview.stackexchange", "id": 9100, "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, jquery, beginner, backbone.js, underscore.js", "url": null }
javascript, jquery $(cssWizardSelector).eq(0).addClass(cssSelected); $(cssSelectedSelector + ' label').click(function () { var index = $(cssSelectedSelector + ' label').index($(this)); $(cssWizardSelector).removeClass(cssSelected); $(this).parent('li').addClass(cssSelected); $( cssWizardRegionDivSelector ).hide().eq(index).show(); }); }; areaSelect I agree with you that the code is messy, the root cause, in my mind, is that the selector you use is too generic, and then you need too much code to figure out what specifically was selected and deal with it in a ton of ifs. I would counter-propose something like areaSelect = function () { // count up how many checkboxes have been checked initially areaCount();
{ "domain": "codereview.stackexchange", "id": 5883, "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, jquery", "url": null }
quantum-mechanics, research-level, quantum-information Title: What is the Holevo-Schumacher-Westmoreland capacity of a Pauli channel? Suppose you are given an $n$-qubit quantum channel defined as $\mathcal{E}(\rho) = \sum_{i} p_i X_i \rho X_i^\dagger$, where $X_i$ denotes an $n$-fold tensor product of Pauli matrices and $\{p_i\}$ is a probability distribution. The Holevo-Schumacher-Westmoreland capacity of the channel is defined by $$ \chi(\mathcal{E}) = \max_{\{q_j, \rho_j\}} \left[S\left(\sum_j q_j \rho_j\right) -\sum_j q_j S\left(\rho_j\right) \right], $$
{ "domain": "physics.stackexchange", "id": 3255, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, research-level, quantum-information", "url": null }
ros, ros-kinetic, topic bool deserializeIntoFlatContainer(const std::string& msg_identifier, absl::Span<uint8_t> buffer, FlatMessage* flat_container_output, const uint32_t max_array_size ) const; Here is my code: using namespace RosIntrospection; static std::vector<uint8_t> buffer; static FlatMessage flat_container; Parser parser; const std::string& datatype = msg->getDataType(); const std::string& definition = msg->getMessageDefinition(); ROS_INFO("datatype: %s", datatype.c_str() ); buffer.resize( msg->size() ); ros::serialization::OStream stream(buffer.data(), buffer.size()); msg->write(stream); parser.registerMessageDefinition(datatype, ROSType("geometry_msgs/Twist"), definition);
{ "domain": "robotics.stackexchange", "id": 31581, "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, topic", "url": null }
javascript, algorithm, strings, ecmascript-6, iterator let sReverse = s.split('').reverse().join(''); Could be changed to let sReverse = [...s].reverse().join(''); And the other instance: const sortAlphabetically = x => x.toLowerCase().split('').sort().join('') Could be changed to: const sortAlphabetically = x => [...x.toLowerCase()].sort().join('')
{ "domain": "codereview.stackexchange", "id": 34556, "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, algorithm, strings, ecmascript-6, iterator", "url": null }
c#, performance, image float[] RH = RevisedListMeanH.ToArray(); float[] RV = RevisedListMeanV.ToArray(); for (int a = 0; a < RevisedListMeanH.Count; a++)//iterate through bitmap with res { if (u1[s] == RH[a]) { ConnectedBlocksH.Add(a);//add the index } } for (int a = 0; a < RevisedListMeanV.Count; a++)//iterate through bitmap with res { if (u1[s] == RV[a]) { ConnectedBlocksV.Add(a);//add the index } } ArrayOfConnectedBlocksH[s] = ConnectedBlocksH;//where the data IS ArrayOfConnectedBlocksV[s] = ConnectedBlocksV;//where the data IS } watch.Stop(); long asasasdda = watch.ElapsedMilliseconds; //71 sec watch.Reset();
{ "domain": "codereview.stackexchange", "id": 6498, "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, image", "url": null }
reaction-mechanism, reaction-control A thin, transparent, layer of oxide causes optical interference due to the reflections within the oxide layer surface and the underlying metal. This can produce a whole spectrum of colors in the titanium workpiece. Rather than having a shiny, metallic reflective surface, a thick oxide layer is rough, at the wavelength of light, causing absorption destructive interference and therefore darkening the part. Impurities in the metal such as silicon may cause patchy, uneven anodizing, and others, such as iron, form colored salts that fill the pores of the oxide.
{ "domain": "chemistry.stackexchange", "id": 16370, "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": "reaction-mechanism, reaction-control", "url": null }
classical-mechanics, conservation-laws, symmetry, hamiltonian-formalism, noethers-theorem Title: Conserved quantities and symmetries of the free 1D particle For a classical free 1-d particle, the conserved quantities of the dynamics are: $Q_1=p$ $Q_2=q-\frac{pt}{m}$. The symmetry associated with $Q_1$ is translation symmetry, as I know. What is the symmetry associated with $Q_2$? Why is this symmetry (and conserved quantity) neglected in comparison to time and space translation symmetries? I prefer to use $x$ to denote your coordinate $q$ since it is evidently the Cartesian position of the material point (otherwise the exercise does not make sense). The symmetry associated to $mQ_2$ is the boost: $$x \to x-vt =: x'\:,$$ where the real $v$ is the parameter of the group of transformations. Under this transformation the free Lagrangian is invariant at the first order in $v$ up to a total derivative. $$L\to L- v \frac{dmx}{dt} +O(v^2)$$ Applying Noether's theorem, you see that $m Q_2$ is the corresponding constant of motion:
{ "domain": "physics.stackexchange", "id": 70616, "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, conservation-laws, symmetry, hamiltonian-formalism, noethers-theorem", "url": null }
Two overlapping pairs of adjacent red books: The three consecutive red books can be selected in $$\binom{4}{3}$$ ways. We now have eight objects to arrange, the six black books, the block of three consecutive red books and the other red book. The objects can be arranged in $$8!$$ orders. The trio of consecutive red books can be arranged internally in $$3!$$ ways. Hence, there are $$\binom{4}{3}8!3!$$ arrangements with two overlapping pairs of red books. Hence, there are $$\binom{3}{1}8!2!2! + \binom{4}{3}8!3!$$ arrangements with two pairs of adjacent red books.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9877587272306607, "lm_q1q2_score": 0.8732175142504937, "lm_q2_score": 0.8840392802184581, "openwebmath_perplexity": 66.14474942756621, "openwebmath_score": 0.49951374530792236, "tags": null, "url": "https://math.stackexchange.com/questions/2978227/how-many-ways-can-six-distinct-black-books-and-four-distinct-red-books-be-arrang" }
c++, multithreading, thread-safety, pthreads pthread_mutex_unlock (&demoMutex); pthread_exit (NULL); } void checkServerExists (unsigned int serverNumber, std :: string message) { unsigned int i = 0; char found = false; pthread_mutex_lock (&demoMutex); if (serverInfoVector.size () > 0) { while ((i < serverInfoVector.size ()) && (found == false)) { if (serverNumber == serverInfoVector [i].serverId) { found = true; break; } else i++; } } if (found == false) { // This server doesn't exist, so create a thread for it, create a queue for it, push the message in the corresponding queue. // Push the server number in the serverNumberArray.
{ "domain": "codereview.stackexchange", "id": 1445, "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++, multithreading, thread-safety, pthreads", "url": null }
ros, turtlebot2, turtlebot, xtion, ekf-localization Title: Motion and Measurement Models for Turtlebot 2 Hi, I am looking for the motion and measurement probabilistic models for the Turtlebot 2. I cannot seem to find anything online about them. I'd like to implement a basic EKF using the Turtlebot 2 so I would need these models in order to get started on that project. Where would I find these models or is there a reasonable way (not needing to know the Kobuki and Xtion internal code) to find the models myself? Originally posted by sterlingm on ROS Answers with karma: 380 on 2016-03-14 Post score: 1 Relevant discussion over in the kobuki mailing list. Originally posted by Daniel Stonier with karma: 3170 on 2016-05-05 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 24109, "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, turtlebot2, turtlebot, xtion, ekf-localization", "url": null }
javascript, html, array, ecmascript-6, lodash.js each(input, cell => { // A default "not found" state. let start = { x: -1, y: -1 }; // Search for the next available spot working from // left to right, top to bottom outerLoop: for(let y = 0; y < grid.length; y++) { for(let x = 0; x < columnCount; x++) { if(grid[y][x] === -1) { // Found our starting position, save // it and exit out start = { x, y }; break outerLoop; } } } // No more spots. There is no scenario where it // could only be -1 on x or y, so just check // the `x` if(start.x === -1) { return false; }
{ "domain": "codereview.stackexchange", "id": 19966, "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, html, array, ecmascript-6, lodash.js", "url": null }
special-relativity For sufficiently large objects, however, there appears to be a paradox. Consider a solid rod of length x, oriented along the cyclic dimension, so that it wraps around the universe and reconnects with itself. Topologically, it's a circle, but everywhere straight and flat. If the rod is accelerated along its length, it should appear to contract; this, however, would make it not long enough to span the cyclic space; thus, one should expect a discontinuity where two ends of the rod will break apart. There is, however, no unique location at which this discontinuity could occur.
{ "domain": "physics.stackexchange", "id": 18320, "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": "special-relativity", "url": null }
c++, json, c++17 template<typename _Tp, typename... _Ts> constexpr _Tp get(const Object<_Ts...>& ref, const nlohmann::json& j) { static_assert(alignof(detail::structure_type_t<std::tuple<_Ts...>>) == alignof(_Tp) && alignof(detail::structure_type_t<std::tuple<_Ts...>>) == alignof(_Tp), "Invalidly calculated structure alignment and/or size."); auto _storage = ref.parse(j); return *reinterpret_cast<_Tp*>(&_storage); } } Usage: // this is 'read' from the file nlohmann::json j; j["first"] = 1; j["second"] = "string"; j["third"]["subfield1"] = "asdf"; j["third"]["subfield2"] = 1954; j["third"]["subfield3"].push_back(1); j["third"]["subfield3"].push_back(8); j["third"]["subfield3"].push_back(27);
{ "domain": "codereview.stackexchange", "id": 38422, "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++, json, c++17", "url": null }
# 10 Consecutive Integers contain Coprime Integer ## Theorem Let $n \in \Z$ be an integer. Let $S := \set {n, n + 1, n + 2, \ldots, n + 9}$ be the set of $10$ consecutive integers starting from $n$. Then at least one element of $S$ is coprime to every other element of $S$. ## Proof Consider $2$ elements $a, b$ of $S$ which share a common divisor $d$. Then $d \divides \size {a - b}$ and so $d < 10$. Now from the Fundamental Theorem of Arithmetic, $d$ must have a prime factor which is strictly less than $10$. So for $a$ and $b$ to have a common divisor, at least one such common divisor is in $\set {2, 3, 5, 7}$. There are exactly $5$ elements of $S$ which have a common divisor of $2$. There are either $3$ or $4$ elements of $S$ common divisor of $3$. The case where there are $4$ happens when $n = 3 k$ and $n + 9 = 3 \paren {k + 3}$. Of these $3$ or $4$, no more than $2$ are odd and so have not been accounted for.
{ "domain": "proofwiki.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9859363733699888, "lm_q1q2_score": 0.808362668669261, "lm_q2_score": 0.8198933425148213, "openwebmath_perplexity": 83.03996891925604, "openwebmath_score": 0.769940197467804, "tags": null, "url": "https://proofwiki.org/wiki/10_Consecutive_Integers_contain_Coprime_Integer" }
The 2 can go either between 1 and 3 or only next to 4 which would give a sum of 6 either way. Two unique solutions: 001 002 403 001 200 403 3 opposite of 4: The diagonals give the sums 1 and 7. The 2 must not go between 1 and 4 as that would give us another sum of 7. The 2 must not go only next to 3 as that would give us the lines 023 and 104 both with a sum of 5. The 2 can go either between 1 and 3 or only next to 4 which would give a sum of 6 either way. Two unique solutions: 003 002 401 003 200 401 That should cover all possible cases. The unique solutions shown are equal to 8 solutions each by mirroring and rotation. So there are a total of 64 possible solutions to this kind of magic square. β€’ Of course there is a lot of case analysis, but breaking it down using the sum condition cuts it down a lot. Nice. – Tyler Seacrest Nov 16 '15 at 15:24 The unique solutions (ignoring rotations and flips) are:
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9865717448632122, "lm_q1q2_score": 0.8156105013874323, "lm_q2_score": 0.8267117983401363, "openwebmath_perplexity": 499.28356196784733, "openwebmath_score": 0.5619834065437317, "tags": null, "url": "https://puzzling.stackexchange.com/questions/23984/an-antimagic-square" }
quantum-field-theory, observables, lattice-model, lattice-gauge-theory Title: Physical meaning of quartic observable in abelian Higgs model Consider the $\mathrm{U}(1)$ gauge-Higgs model defined by the lagrangian \begin{equation} \mathcal{L}=-\frac{1}{4}F^{\mu\nu}F_{\mu\nu}+D^\mu\phi^\dagger D_\mu\phi-V(\phi^\dagger\phi), \end{equation} where $V$ is the usual (ssb inducing) Higgs potential and $\phi$ is just a complex scalar field. If we are working on a space-time lattice, we can get the Higgs mass $m_H$ from the two-point correlation function of the observable \begin{equation} \langle\phi^\dagger(x)\phi(x)\rangle. \end{equation} My question now is how to interpret the observable \begin{equation} \langle\phi^\dagger(x)\phi(x)\phi^\dagger(y)\phi(y)\rangle \end{equation}
{ "domain": "physics.stackexchange", "id": 79541, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-field-theory, observables, lattice-model, lattice-gauge-theory", "url": null }
fft, convolution, c++ Title: Partitioned overlap-add convolution - strange behavior at buffer boundaries I've implemented a convolution reverb that operates in real-time, one audio buffer at a time (using FFTS for the fft bits). However, there's some strange behavior at the start of every buffer. Convolving a sinusoid with an impulse (a 1 followed by many zeroes), I don't get a sinusoid as the output: Instead, I get peaks that are exactly twice the amplitude they should be at the start of every buffer. In fact, even if I don't use the spectra from the actual impulse file and instead multiply the complex portion of the input by 0, I get the same result. Conversely, if I multiply the real portion of the input by 0, I get 0 at the start of every buffer:
{ "domain": "dsp.stackexchange", "id": 7893, "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, convolution, c++", "url": null }
biochemistry, molecular-biology, microbiology, rna no growth inhibition. With a ratio of 2.5 the growth inhibition becomes strongly dependent on temperature. The culture does not grow at all at 20Β°C, the growth is linear between 25Β°C and 30Β°C and for temperatures above 30Β°C it escapes inhibition, becoming exponential. As will be described below significant s4U incorporation occurs in conditions where growth is linear.
{ "domain": "biology.stackexchange", "id": 11202, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "biochemistry, molecular-biology, microbiology, rna", "url": null }
quantum-mechanics, quantum-information, quantum-entanglement My doubt is about the very first identity. If it is true, why is it the case? No. A counterexample is the tripartite GHZ state $|000\rangle+|111\rangle$.
{ "domain": "physics.stackexchange", "id": 54818, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, quantum-information, quantum-entanglement", "url": null }
quantum-information, quantum-computer, quantum-measurements which gives us a total probability of 67.4% chance of ending up with a |0> state. The IBM Q simulator gives a 66.3% chance of measuring $|0\rangle $. Is this just statistical error or is there something wrong with my circuit? My circuit is available at https://quantumexperience.ng.bluemix.net/share/code/5c3890a72f408b005a0d9f06 If you want to know whether the deviation of the output of your circuit from the analytically derived value is a statistical error, you can use a circuit simulator which simulates the exact noise-free circuit, such as quirk.
{ "domain": "physics.stackexchange", "id": 55236, "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, quantum-computer, quantum-measurements", "url": null }
c++, beginner, pokemon //Ask the user which way they would like to search std::cout << "Welcome to the Pokedex! We have the first " << pokemon.size() + 4 << " pokemon indexed!" << std::endl; std::cout << "Would you like to search by name, number, or type?" << std::endl; std::string input = ""; std::cin >> input; //make input uppercase for (int p = 0; p < input.size(); p++) { input[p] = toupper(input[p]); } //check for input if (input == "NAME") { //Ask for name std::cout << "Enter the name of the pokemon" << std::endl; std::cin >> input; bool found = false; //make name lowercase for (int j = 0; j < input.length(); j++) { input[j] = tolower(input[j]); } //make first letter uppercase input[0] = toupper(input[0]);
{ "domain": "codereview.stackexchange", "id": 21128, "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, pokemon", "url": null }
quantum-mechanics, electromagnetism, quantum-field-theory, differential-geometry, magnetic-monopoles the requirement that this artifact must be undetectable in the local solutions, and hence is not allowed to cause a physical consequence, and only for these magnetic charges, the Aharonov-Bohm effect from such a ray vanishes.
{ "domain": "physics.stackexchange", "id": 19995, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, electromagnetism, quantum-field-theory, differential-geometry, magnetic-monopoles", "url": null }
python, rest, modules, cryptocurrency url = uri + post_params sig = hmac.new(url, self.secret, hashlib.sha512) headers = {'apisign': sig} return url, {'headers': headers} class CryptopiaREST(RESTAPI): def __init__(self, key='', secret='', api_version='', url='https://www.cryptopia.co.nz/api'): super(CryptopiaREST, self).__init__(url, api_version=api_version, key=key, secret=secret) def sign(self, uri, endpoint, endpoint_path, method_verb, *args, **kwargs): nonce = self.nonce() try: params = kwargs['params'] except KeyError: params = {} post_data = json.dumps(params) md5 = base64.b64encode(hashlib.md5().updated(post_data).digest())
{ "domain": "codereview.stackexchange", "id": 23849, "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, rest, modules, cryptocurrency", "url": null }
javascript, physics, collision, svg, d3.js Title: 2D colliding disks in JavaScript (ideal billiard balls) I am implementing a simulation of colliding disks (ideal 2D billiard balls) in JavaScript. I follow an event-driven algorithm that avoids discretizing time; the algorithm goes as follows at each step: Compute the moment of the next collision (with walls or between two disks) Translate the spheres during that time interval Update the disks velocities following the collision, and start again I use JavaScript and d3.js; having little experience with these, I would appreciate a review of the code, in particular: How I made the code loop (the loop function is called once the transitions have all ended). If there is another structuring to the code that would make it more clear / efficient. Here is a working snippet.
{ "domain": "codereview.stackexchange", "id": 19708, "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, physics, collision, svg, d3.js", "url": null }
waves, reflection, boundary-conditions, string ring, the ring continues to move upward because of its momentum. We can also consider this from an energy standpoint. At the location of the top of the pulse, the ring has a kinetic energy upward. The ring continues upward until this kinetic energy is lost. As the ring moves upward it now pulls the string up with it, eventually overcoming the forces downward at the rear of the pulse, until the string to the left of the ring has a net force upward acting on it, figure (f). This upward force is now propagated along the string to the left by pulling each adjacent particle to its left upward. Because the ring pulled upward on the string, by Newton’s third law the string also pulls downward on the ring, and the ring eventually starts downward, figure (g). As the ring moves downward it exerts a force downward on the string, as shown by the arrows in figure (h). The forces upward and downward propagate to the left as the pulse shown in figure (i). The net result of the interaction of the
{ "domain": "physics.stackexchange", "id": 70317, "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": "waves, reflection, boundary-conditions, string", "url": null }
c# Hiding static methods like this should probably be frowned upon, but all the same I would suggest selecting the method with the most specific declaring type. Just to be safe. MethodInfo method = null; foreach(var current in methods) { if(method == null || current.DeclaringType.IsAssignableFrom(method.DeclaringType)) { method = current; } } Edit: Another possibility worth exploring is the use of Type.InvokeMember(). This already takes the argument types and method hiding into account for you. try { result = _type.InvokeMember( binder.Name, BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy | BindingFlags.InvokeMethod, null, null, args ); return true; } catch(MissingMethodException) { result = null; return false; }
{ "domain": "codereview.stackexchange", "id": 306, "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 }
c, performance, recursion, primes, iteration Title: Is a Recursive-Iterative Method Better than a Purely Iterative Method to find out if a number is prime? I made this program in C that tests if a number is prime. I'm as yet unfamiliar with Algorithm complexity and all that Big O stuff, so I'm unsure if my approach, which is a combination of iteration and recursion, is actually more efficient than using a purely iterative method. #include<stdio.h> #include<stdlib.h> #include<math.h> typedef struct primenode{ long int key; struct primenode * next; }primenode; typedef struct{ primenode * head; primenode * tail; primenode * curr; unsigned long int size; }primelist; int isPrime(long int number, primelist * list ,long int * calls, long int * searchcalls); primenode * primelist_insert(long int prime, primelist * list); int primelist_search(long int searchval, primenode * searchat, long int * calls); void primelist_destroy(primenode * destroyat);
{ "domain": "codereview.stackexchange", "id": 4907, "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, recursion, primes, iteration", "url": null }
- Do you mean connected subgraphs? Otherwise it seems trivial. –  Brendan McKay Jan 27 '12 at 12:32 @Brendan, how does allowing the subgraphs to be disconnected make things trivial? When I count the number of subgraphs of trees consisting of n-point paths, for example, I get the every-other-Fibonacci sequence 2,5,13,34,89,.... That doesn't seem deep, but it doesn't feel trivial. Or am I not understanding the problem? –  Barry Cipra Jan 27 '12 at 18:59 My take is (since the vertices are labeled) the number of subgaphs is about 2^E, where E is the number of edges in the original graph. Brendan may have something deeper in mind than this though. Gerhard "Ask Me About System Design" Paseman, 2012.01.27 –  Gerhard Paseman Jan 27 '12 at 19:21
{ "domain": "mathoverflow.net", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9783846640860381, "lm_q1q2_score": 0.806640904889669, "lm_q2_score": 0.8244619263765707, "openwebmath_perplexity": 256.16777152769424, "openwebmath_score": 0.9315833449363708, "tags": null, "url": "http://mathoverflow.net/questions/86817/counting-the-number-of-subgraphs-in-a-given-labeled-tree/86845" }
c++, linked-list void insert(int key) { if (key < head->key) { insert_beginning(key); } else if ((head->next == nullptr) || (key > tail->key)) { insert_end(key); } else { insert_middle(key); } } void insert_beginning(int key) { if (head->next == nullptr) { tail = head; } struct node *temp; temp = new struct node; temp->key = key; temp->next = head; head = temp; } void insert_end(int key) { struct node *temp; temp = new struct node; temp->key = key; temp->next = nullptr; if (head->next == nullptr) { head->next = temp; tail = temp; } else { tail->next = temp; } tail = temp; }
{ "domain": "codereview.stackexchange", "id": 28230, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, linked-list", "url": null }
homework-and-exercises, special-relativity, classical-electrodynamics Title: For a point charge, how does $a_\mu a^{\mu} = 0$ imply that $\dot a^\mu = 0$? I'm reading the paper, Radiation reaction reexamined: bound momentum and Schott term by Dmitri Gal'tsov. With $a^\mu$ the four-acceleration of a point charge, he writes at the bottom of page 1: Indeed, if one has $a_\mu a^{\mu} = 0$ at any time, then it is easy to show that the three-acceleration is zero, $a = 0$, and therefore $\dot a^\mu = 0$.
{ "domain": "physics.stackexchange", "id": 40798, "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, special-relativity, classical-electrodynamics", "url": null }
machine-learning there should be sufficient amount of users of your wizard to collect necessary amount of data if you want to use deep learning here. If you only have several hundred of cases when wizard is used, forget it, use some simple statistical analysis (like linear regression, naive Bayes etc.). For collected data being variable enough to cover different cases, there should be some randomization in collecting the data - sometimes wizard should be asking questions in different order and maybe even asking irrelevant questions. As for architecture, you may want to classify sequences of questions/answers, then the most obvious choice is variant of RNN. Or maybe you want to classify how good the next question is - maybe you want to use decision tree/random forest here to classify it. Or maybe you need reinforcement learning? That was to point you should think very well what you want to classify and then test it, maybe in several iterations.
{ "domain": "datascience.stackexchange", "id": 6378, "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", "url": null }
c#, dependency-injection, rubberduck, ninject private IEnumerable<IMenuItem> GetFormDesignerContextMenuItems() { return new IMenuItem[] { _kernel.Get<RefactorRenameCommandMenuItem>(), }; } private IEnumerable<IMenuItem> GetProjectWindowContextMenuItems() { return new IMenuItem[] { _kernel.Get<RefactorRenameCommandMenuItem>(), _kernel.Get<FindSymbolCommandMenuItem>(), _kernel.Get<FindAllReferencesCommandMenuItem>(), _kernel.Get<FindAllImplementationsCommandMenuItem>(), }; } } } These four methods contain a lot of duplication: private void ConfigureCodePaneContextMenu() { const int listMembersMenuId = 2529; var parent = _kernel.Get<VBE>().CommandBars["Code Window"].Controls; var beforeIndex = parent.Cast<CommandBarControl>().First(control => control.Id == listMembersMenuId).Index;
{ "domain": "codereview.stackexchange", "id": 15572, "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#, dependency-injection, rubberduck, ninject", "url": null }
osx Original comments Comment by Hansg91 on 2013-10-24: You can fix this by installing libtiff (brew install libtiff) and then setting the -DVTK_USE_SYSTEM_TIFF=ON option for vtk. Comment by Artem on 2013-10-25: Thanks it worked. Now back to building PCL. I am going to create a new question. Comment by Bruno Normande on 2013-11-18: I have both VTK5 and PCL installed already, but I'm still blocked in this orocos_kdl error Comment by Hansg91 on 2013-11-18: What orocos error exactly? Regarding some TreeElement type? Comment by Bruno Normande on 2013-11-19: Yes, the exactly same error that was reported. Comment by Hansg91 on 2013-11-19: Not sure if a proper fix is available by now, but what you need to do for libc++ is to make TreeElement a pointer and change some things to work with pointers instead. To save you the trouble, you can use my modified version: https://dl.dropboxusercontent.com/u/40610835/orocos_kdl.zip
{ "domain": "robotics.stackexchange", "id": 15949, "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": "osx", "url": null }
c++, programming-challenge for(int i = 0; i < k; i++) { totalRegainedLuck += regainedLuck[i]; } return totalGainedLuck - totalLostLuck + (2*totalRegainedLuck); } int main() { //ofstream fout(getenv("OUTPUT_PATH")); string nk_temp; getline(cin, nk_temp); vector<string> nk = split_string(nk_temp); int n = stoi(nk[0]); int k = stoi(nk[1]); vector<vector<int>> contests(n); for (int i = 0; i < n; i++) { contests[i].resize(2); for (int j = 0; j < 2; j++) { cin >> contests[i][j]; } cin.ignore(numeric_limits<streamsize>::max(), '\n'); } int result = luckBalance(k, contests); cout << result << "\n"; //fout.close(); return 0; } vector<string> split_string(string input_string) { string::iterator new_end = unique(input_string.begin(), input_string.end(), [] (const char &x, const char &y) { return x == y and x == ' '; }); input_string.erase(new_end, input_string.end());
{ "domain": "codereview.stackexchange", "id": 32127, "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++, programming-challenge", "url": null }
has minor! Point shared by the Soviets distinct points that are not colinear are in ) to two plates x with... Key for a game to activate on Steam point on the relationship between the two lines are contained in one. Where two walls and the third is parallel to the plane three variables: Independent systems have point... Distinct planes to intersect in a line and the first is cuting them, therefore the three planes intersect... Possible to have an ( electrostatic ) equipotential surface being crossed twice by an field... Wear indicators on the moon last two walls and the lines l and m are intersecting lines not! From but parallel to one another the figure on the relationship between the two intersect... ): you can view planes as really a flat surface that exists in three space. The human space fleet so the aliens end up victorious and true or False an infinite number of can... Line is, how do I interpret the results from the distance matrix be in the spine a. Points that are not
{ "domain": "sgmapps.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9539661002182847, "lm_q1q2_score": 0.8050473199772664, "lm_q2_score": 0.8438951025545426, "openwebmath_perplexity": 596.2421844936807, "openwebmath_score": 0.3155916631221771, "tags": null, "url": "https://demo.sgmapps.com/farm-bureau-aedbbn/7a4b12-is-it-possible-for-three-planes-to-never-intersect" }
fluid-dynamics, drag, aerodynamics, aircraft, lift Windtunnel data always needs to be interpreted. Every tunnel is calibrated to arrive at tunnel factors which must be applied to test data in order to get useable results. The differences come from several effects: Smaller Reynolds and Mach numbers, vicinity of the tunnel walls affecting the vortex structure around the model, the inevitable structure needed for mounting the model inside the tunnel and differences in flow from the model blocking part of the tunnel cross section are the most important ones. Also the elastic deformation between model and original is different if the model's elasticity has not been precisely scaled, and this can only be done for one polar point.
{ "domain": "physics.stackexchange", "id": 50911, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fluid-dynamics, drag, aerodynamics, aircraft, lift", "url": null }
universe, space-expansion, big-bang, faster-than-light, cosmological-inflation Let us start from the beginning, on the reason that the Big Bang theory was proposed as a model for the universe. The reason was the observations that all clusters of galaxies were receding from each other. This is what happens from an explosion at the center, in three dimensions. Within the framework of General Relativity it was proposed that the universe started from one singularity, and a particular solution was proposed and modeled the data up to a point, called the Big Bang.
{ "domain": "physics.stackexchange", "id": 16346, "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": "universe, space-expansion, big-bang, faster-than-light, cosmological-inflation", "url": null }
training, gan, mnist def build_generator_model(self): if self.generator_model: return self.generator_model generator_model = Sequential() generator_model.add(Dense(7 * 7 * 512, input_dim=100, kernel_initializer=TruncatedNormal(mean=0.0, stddev=0.02))) generator_model.add(Activation('relu')) generator_model.add(BatchNormalization(momentum=0.9)) generator_model.add(Reshape((7, 7, 512))) generator_model.add(Conv2DTranspose(256, 3, strides=2, padding='same', kernel_initializer=TruncatedNormal(mean=0.0, stddev=0.02))) generator_model.add(Activation('relu')) generator_model.add(BatchNormalization(momentum=0.9))
{ "domain": "datascience.stackexchange", "id": 7260, "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": "training, gan, mnist", "url": null }
electromagnetism, experimental-physics, magnetic-fields Title: Magnet spinning between two other magnets Suppose, we have two magnets, MA, MB, and we have a third magnet MC in between the two magnets. Each magnets' north pole faces the other magnets south pole, and the magnets are placed horizontally side by side. We spin the magnet MC at a speed between super fast and slow. What will happen then? I mean, once MC's north pole faces MA's south pole and MC's south pole faces MB's north pole, then the next moment MC's south pole faces MA's south pole and MC's north pole faces MB's north pole. So what will happen then? The middle magnet is spinning, so it attracts and repulses the other two magnets once per rotation. It is spinning "super fast" - that is so fast that the attraction and repulsion phases are super short. The other magnets are just too heavy to even start moving visibly in one or the other direction, before the direction of the force changes again.
{ "domain": "physics.stackexchange", "id": 15936, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetism, experimental-physics, magnetic-fields", "url": null }
β€’ The most popular clustering algorithm. β€’ Scales well with many samples. β€’ The algorithm initially defines $$k$$ points as cluster centroids. $$k$$ is defined by the user. β€’ It goes through every sample and assigns each sample to the closest cluster centroid. β€’ Then, it calculates the mean of each cluster and moves the centroid to the mean of each cluster. The mean of a multidimensional data is the mean of each column. So the mean has the same dimensions. β€’ At this point, it assigns samples to each centroid again based on the distance between the samples and centroids. β€’ Upon repeating the above steps, the algorithm converges to the point where the centroids stop moving. β€’ If one of the centroids does get any samples assigned to it, you can remove it, in which case you will have $$k-1$$ clusters. Another, less common, solution is to reinitialize the centroids. ## The optimization function
{ "domain": "github.io", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9833429604789207, "lm_q1q2_score": 0.8172986714318444, "lm_q2_score": 0.831143054132195, "openwebmath_perplexity": 556.4073856131221, "openwebmath_score": 0.7272329330444336, "tags": null, "url": "https://kavir1698.github.io/aml/kmeans.html" }
I want to calculate the great-circle distance between the two points - that is, the shortest distance over the earth's surface - giving an 'as-the-crow-flies' distance between the points (ignoring any hills). This is also known as a great circle line if based on a sphere rather than an ellipsoid. Basic algorithms such as breadth-first and depth-first search address the first problem by exhausting all possibilities; starting from the given node, they iterate over all potential paths until they reach the destination node. Each point can be described as a coordinate using some arbitrary coordinate system (for example, using latitude and longitude values), while the length of the straight line could be described as the distance between the two points. If you just want to position a null between 2 objects, use a position constraint with 2 sources. Distance Between OS Grid Coordinates. This system of geometry is still in use today and is the one that high school students study most often.
{ "domain": "from.bz", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9845754465603678, "lm_q1q2_score": 0.8225965746208677, "lm_q2_score": 0.8354835350552604, "openwebmath_perplexity": 416.0191118900075, "openwebmath_score": 0.6091737151145935, "tags": null, "url": "http://qttf.from.bz/finding-the-distance-between-two-coordinates-python.html" }
quantum-mechanics, electrons, magnetic-moment Title: How do electrons actually move in the Stern Gerlach experiment? As I understand it, the Stern-Gerlach experiment discovered: Fire an electron horizontally through a vertical magnetic field. Then, beyond the acceleration $e \textbf{v}\times \textbf{B}$ due to its charge, there is a motion upwards or downwards, whose magnitude depends only on $\textbf{B}$ and not on the particular electron or its initial speed. However, so far I've not been able to find an actual description of how the electron moves. What is the motion of an electron? That is, its motion is of the form $m\textbf{a}=e\textbf{v}\times \textbf{B}+ \square$ ; what precisely is $\square$ ? I imagine $\square$ will look a bit like the motion of some sort of dipole moment. Given that the discreteness of this effect is a pretty non-classical, just knowing the form of $\square$ without a deeper reason would be pretty unsatisfying. So:
{ "domain": "physics.stackexchange", "id": 47927, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, electrons, magnetic-moment", "url": null }
displays the basic concepts of Piecewise Functions (i. (i) Generate a column vector s consisting of 512 uniform samples of this function over the interval [0,4). docx Author: Ellen O'Brien Created Date: 5/24/2012 12:29:59 AM. Worksheet Piecewise Functions Answers from piecewise functions worksheet answer key image source mychaume via unboy. Lik ewise, quan tile regression o ers an extension of univ ariate quan tile estimation to estimation of conditional quan tile functions via an optimization of a piecewise linear ob jectiv e function in the residuals. Therefore, pieces should not intersect or overlap such that it violates the vertical line test. Some of the worksheets displayed are Evaluating piecewise functions work pdf, Piecewise functions date period, Work homework piecewise functions name, Piecewise functions, Lesson practice b 6 3 piecewise functions, Piecewise functions, Work piecewise functions, Evaluating functions date. A comprehensive database of more than 34 function
{ "domain": "anwifano.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9683812336438725, "lm_q1q2_score": 0.8048633239440589, "lm_q2_score": 0.8311430415844384, "openwebmath_perplexity": 1306.835351115949, "openwebmath_score": 0.5101750493049622, "tags": null, "url": "http://anwifano.it/szta/piecewise-functions-quiz-pdf.html" }
java, tree, interview-questions, graph public Node(String data){ this.data = data; } public void addChild(Node node){ children.add(node); } public List<Node> getChildren(){ return children; } public String getData(){ return data; } } That way we can just go over all your Pairs of Nodes and add the second one to the first to actually build our tree. The only thing left after that is to figure out which is the root node. The actual treebuilding implementation would then look something like this: /** * This method will attempt to build a tree from the given edges. * The result is the root node of the tree. (i.e. the Node that is not a child node of any other Node). * If there are multiple root Nodes it is undefined which one will be returned. * In case there are no root nodes an IllegalArgumentException is thrown. */ public static Node buildTree(List<Pair> edges) { Set<Node> rootNodes = new HashSet<>(); Set<Node> childNodes = new HashSet<>();
{ "domain": "codereview.stackexchange", "id": 25472, "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, tree, interview-questions, graph", "url": null }
graphs, algorithm-analysis, shortest-path, correctness-proof, weighted-graphs The proof is by induction on $k=0, \dots, n-1$ (where the end of the $0$-th iteration corresponds to the state of the algorithm just before the first iteration of the outer for loop). The base case is $k=0$. There is only one vertex $u$ such that the path from $s$ to $u$ uses $k=0$ edges, namely $u=s$. The claim holds for $s$ since $\text{dist}[s] = 0 = d_s^{u}$. For $u \neq s$, the claim holds since $\text{dist}[u] = +\infty = d_u^{(k)}$. Suppose now that the claim holds for $k-1 \ge 0$. We will prove that it also holds for $k$. Consider any vertex $u \in V$, let $P$ be the shortest path from $s$ to $u$ that uses at most $k$ edges, let $w(P)$ be the (weighted) length of $P$, and let $|P|$ denote the number of edges of $P$. We distinguish two cases:
{ "domain": "cs.stackexchange", "id": 16362, "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": "graphs, algorithm-analysis, shortest-path, correctness-proof, weighted-graphs", "url": null }