text
stringlengths
1
1.11k
source
dict
c#, performance, recursion, vb.net ... and your comment to Comintern said, VB.NET with Strict Off (the case in this code), does allow you to write a function without return statement (although shows a warning). Beware that this comment on StackOverflow says, I agree, but with one small caveat: if you have Option Strict off, you're essentially doing extra conversions everywhere, which often makes code significantly slower. You can't make this same mistake with C#, which can lead to performance improvements if you rewrite VB.NET code in C#. With Option Strict On, type conversions (which affect performance) are more apparent. Microsoft's description of the Option Strict Statement warns that implicit type conversions affect performance. It doesn't explicitly mention conversion from double to int (it talks more about conversion from Object), but using Strict Off allowed you to ignore conversions from double to int, which nevertheless affect performance.
{ "domain": "codereview.stackexchange", "id": 6234, "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, vb.net", "url": null }
of two events occurring together. 2) Make an extra. the likelihood of a particular uncertain event occurring, measured on a scale from 0. Dependent Events. and using the table from the reading, The probability of both A and B happening is 0, since there. Conditioning restricts the sample space to those outcomes which are in the set being conditioned on (in this case B). The probability of getting any number face on the die in no way influences the probability of getting a head or a tail on the coin. Conditional probability is defined as the likelihood of an event or outcome occurring, based on the occurrence of a previous event or outcome. For example, suppose there are 5 marbles in a bowl. 2 7 Practice B 1. Vocabulary certain impossible probability event sample space outcome trial experiment An is an activity in which results are observed. 6 Binomial Distributions 12. Probability that E3 happens if E1 happened is P1. None of the above. 0 Comments 21 Likes Statistics Notes.
{ "domain": "pixelzoom.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.987375049232425, "lm_q1q2_score": 0.818473505022215, "lm_q2_score": 0.8289388167733099, "openwebmath_perplexity": 448.21235000471705, "openwebmath_score": 0.7119199633598328, "tags": null, "url": "http://jukz.pixelzoom.it/dependent-probability.html" }
c++, object-oriented Completed code #include <iostream> #include <string> #include <utility> #include <vector> class SolarSystem { std::string m_name; unsigned int m_id; public: SolarSystem(unsigned int id, std::string name) : m_name{std::move(name)}, m_id{id} { std::clog << "Generated SolarSystem\n"; }; std::string name() const { return m_name; } unsigned id() const { return m_id; } void set_name(std::string name) { m_name = std::move(name); } }; class Galaxy { std::string m_Name; std::vector<SolarSystem> m_Systems; public: Galaxy(std::string name) : m_Name{std::move(name)}, m_Systems{{0, "DEFAULT"}} { } void create(std::string name) { m_Systems.emplace_back(m_Systems.size(), name); } auto& operator[](unsigned int id) { return m_Systems[id]; }
{ "domain": "codereview.stackexchange", "id": 44177, "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", "url": null }
This is mostly a recap of the observations made in the comments, plus some more analysis, because I think it's a nice problem to analyse. First, both the functional form of the system and the reflection symmetry (see also the phase plane) suggest it's a good idea to introduce $x = \alpha+\beta$, $y = \alpha-\beta$, to obtain \begin{align} \dot{x} &= \frac{1}{2}(y^2 - 3 x^2), \tag{1a}\\ \dot{y} &= 3 x y.\tag{1b} \end{align} We can simplify system (1) somewhat by rescaling $y \to \sqrt{3} y$ and $t \to \frac{1}{3} t$, yielding \begin{align} \dot{x} &= \frac{1}{2}(y^2 - x^2), \tag{2a}\\ \dot{y} &= x y.\tag{2b} \end{align} The phase plane of system (2) looks like this:
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9877587250685455, "lm_q1q2_score": 0.8029167788003431, "lm_q2_score": 0.8128673110375458, "openwebmath_perplexity": 292.82801767071066, "openwebmath_score": 0.99964439868927, "tags": null, "url": "https://math.stackexchange.com/questions/2336200/stability-of-a-fixed-point-in-a-nonlinear-system-with-no-linear-part/2339631#2339631" }
general-relativity, special-relativity, gravity, metric-tensor, curvature Title: Significance of Kretschmann scalar to flat spaces? If you are given a spacetime embedded with a particular metric tensor that satisfies the vacuum field equations of general relativity, how do you confirm that you aren’t simply dealing with a Minkowski spacetime that has been changed via some exotic coordinate transformation? Or, more specifically if I have an exact solution to the vacuum field equations that has a Kretschmann scalar value of $0$. Is this just the Minkowski spacetime in a different coordinate system? A zero Kretschmann scalar does not mean the Riemann tensor is zero. For example in the Kerr metric the sign of $K$ can change as we move towards the black hole, and that means it necessarily passes through zero. For details of this see this paper on the Arxiv. There is some related discussion in Interpreting the Kretschmann scalar.
{ "domain": "physics.stackexchange", "id": 46831, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "general-relativity, special-relativity, gravity, metric-tensor, curvature", "url": null }
symbolically and show key features of the graph, by hand in simple cases and using technology for more complicated cases… d) Graph trigonometric functions, showing period, midline, and amplitude. Mixed Review: Equations & Graphing of Trig Functions. To account for a phase shift of , subtract from the x-values of each of the key points for the graph of y = 2 sin 5x. Solution: Cosine Function. In fact Sine and Cosine are like good friends: they. 1) Answers to Graphing Sine and Cosine 1) p 2 p3p 2 2p-6-4-2 2 4 6. y = 4 tan 6. When you write a sine or cosine function for a sinusoid, you need to find the values of a, b>0, h, and kfor y= a sin b(x º h) + k or y = a cos b(x º h) + k. Graphs Of Sine - Displaying top 8 worksheets found for this concept. 5: Graphs of Sine and Cosine Functions) 4. Student needs to show proof. The amplitude is a=2 and the period is. 5 6 sin sin. Graphs Of Sine. In fact Sine and Cosine are like good friends: they. 2 Graphing Sinusoidal Functions using 5 Points
{ "domain": "adunataalpini-pordenone2014.it", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9814534333179648, "lm_q1q2_score": 0.8824457534056622, "lm_q2_score": 0.8991213678089741, "openwebmath_perplexity": 977.6851453625898, "openwebmath_score": 0.6496663093566895, "tags": null, "url": "http://adunataalpini-pordenone2014.it/nrwx/graphs-of-sine-and-cosine-functions-answer-key.html" }
c#, performance queue.Add(A); parent.Add(A, null); while (queue.Count != 0) { Cell c = queue[0]; queue.RemoveAt(0); visited.Add(c); if (c == B) break; foreach (Cell near in c.Links) { if (near != null) { if (!visited.Contains(near)) { parent.Add(near, c); visited.Add(near); queue.Add(near); } } } } List<Cell> path = new List<Cell>(); if (parent.ContainsKey(B)) { Cell backTrack = B; do { path.Add(backTrack); backTrack = parent[backTrack]; } while (backTrack != null); path.Reverse(); } return path; } I suggest you add a simple heuristic (Manhattan will do) and transform it into a A* algorithm this will reduce the number of nodes you need to explore. queue.RemoveAt(0);
{ "domain": "codereview.stackexchange", "id": 19116, "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", "url": null }
kinetics, theoretical-chemistry [1] Ball, P. 1994 Designing the molecular world: Chemistry at the frontier. Princeton, NJ: Princeton University Press. After some more research, the Oregonator appears to be “the simplest realistic model of the chemical dynamics of the oscillatory Belousov-Zhabotinsky (BZ) reaction” or any other oscillatory reaction I could look up. It is described in Field and Noyes (1974) [1], and take its name from the University of Oregon where these researchers worked. It is described by the following set of reactions: where each entity correspond to a chemical species in the real system: X = HBrO2, Y = Br–, Z = Ce(IV), A = BrO3–, B = CH2(COOH)2, and P = HOBr or BrCH(COOH)2. [1] R. J. Field, R. M. Noyes, “Oscillations in Chemical Systems IV. Limit cycle behavior in a model of a real chemical reaction”, J. Chem. Phys. 60 (1974) 1877-84.
{ "domain": "chemistry.stackexchange", "id": 1282, "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": "kinetics, theoretical-chemistry", "url": null }
^ ( 5 = 0101) (13 = 1101) = ( 8 = 1000) ^ ( 5 = 0101) Example #2 Bitwise XOR operations on strings <?php echo 12 ^ 9; // Outputs '5' echo "12" ^ "9"; // Outputs the Backspace character (ascii 8) // ('1' (ascii 49)) ^ ('9' (ascii 57)) = #8 echo "hallo" ^ "hello"; // Outputs the ascii values #0 #4 #0 #0 #0 // 'a' ^ 'e' = #4 echo 2 ^ "3"; // Outputs 1 // 2 ^ ((int)"3") == 1 echo "2" ^ 3; // Outputs 1 // ((int)"2") ^ 3 == 1 ?> Example #3 Bit shifting on integers <?php /* * Here are the examples. */ echo "\n--- BIT SHIFT RIGHT ON POSITIVE INTEGERS ---\n";$val = 4;
{ "domain": "semantic-portal.net", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9715639694252315, "lm_q1q2_score": 0.8053670769704867, "lm_q2_score": 0.8289388062084421, "openwebmath_perplexity": 8815.07020422197, "openwebmath_score": 0.23992781341075897, "tags": null, "url": "http://semantic-portal.net/php-language-reference-operators-bitwise" }
xacro, ros-indigo <xacro:Sensor_setup with_Sensor="$(arg with_Sensor)" Sensor_setting="$(arg Sensor_setting)" /> Originally posted by Franzisdrak on Gazebo Answers with karma: 43 on 2016-11-23 Post score: 0 Multiple complex sensors load in Gazebo (take Atlas, Valkyrie, and PR2 as examples). This is likely a problem with your configuration. I don't think you should have two robot_description elements. Given that ROS is failing, you might want to ask answers.ros.org. Originally posted by nkoenig with karma: 7676 on 2016-11-23 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 4017, "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": "xacro, ros-indigo", "url": null }
verilog, fpga, hdl, system-verilog logic clk = '0; logic s_rst_n = '0; logic en = '0; logic prbs = '0; logic prbs_n = '0; integer tick = 0; prbs # ( .PN (PN) ) prbs_dut ( .i_clk (clk ), .i_s_rst_n (s_rst_n), .i_en (en ), .o_prbs (prbs ), .o_prbs_n (prbs_n ) ); initial begin forever begin #( CLOCK_PERIOD / 2 ) clk = !clk; end end initial begin s_rst_n <= '0; @(posedge clk); s_rst_n <= '1; en <= '1; @(posedge clk); for(int i = 0; i < TEST_ITERATION; i++) begin if ((i % PERIOD) == (PERIOD - 1)) begin en <= ~en; tick = 0; end else begin tick++; end @(posedge clk); end $finish; end endmodule
{ "domain": "codereview.stackexchange", "id": 42449, "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": "verilog, fpga, hdl, system-verilog", "url": null }
slam, navigation, odometry, rtabmap-odometry, rtabmap cheers Originally posted by matlabbe with karma: 6409 on 2016-08-22 This answer was ACCEPTED on the original site Post score: 4 Original comments Comment by quentin on 2016-08-23: Thanks a lot for these answers! I edited my initial post with two additional questions @matlabbe might be able to answer! Comment by h66 on 2018-04-05: Hi @matlabbe, is there any paper now (2 years after the original post), explaining how the rgbd_odometry works?. Looking at the source code of 'OdometryROS.cpp' It seems that the map is generated and then the transformations between frames are estimated and converted to odometry?. Thanks! Comment by matlabbe on 2018-04-06: OdometryROS is a wrapper of Odometry from rtabmap library. The two standard ones are F2M (frame-to-map) and F2F (frame-to-frame). For F2M, the map is a temporary feature map used only for odometry, it is independent from the map of rtabmap.
{ "domain": "robotics.stackexchange", "id": 25514, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "slam, navigation, odometry, rtabmap-odometry, rtabmap", "url": null }
machine-learning, visualization, roc What important information can I gain from this? So these two straight lines show how far the classifier can go: without making any false positive error (bottom left vertical line) without making any false negative error (top right horizontal line) It can be useful in applications where one wants to have perfect precision at the cost of recall, or the converse. However in general (optimizing F1-score for instance) the optimal threshold is somewhere in the middle of the curve. Of course the longer the line, the better the classifier in general. Geometrically, it's clear that when these two lines are long then the area under the curve (AUC) is large. Note that in theory it's possible for a classifier to have a few errors close to the extremes (i.e. short lines) while still performing well in the middle range, but in practice it's quite rare.
{ "domain": "datascience.stackexchange", "id": 11458, "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, visualization, roc", "url": null }
machine-learning, python, time-series, dataset adding an additional categorical attribute informing past repair types already made to the car when a new one is made, andanother attribute informing the mileage passed since the last repair (checking whether it is highly correlated or not with other variables etc), so you could have something like: id car mileage past_repair_types mileage_since_last_repair sex age repair_type 1 Honda 12000 nothing 0 1 50 engine 1 Honda 12000 nothing 0 1 50 suspension 1 Honda 15000 engine&suspension 3000 1 50 brakes For classification tasks with mixed data types, decision-tree based algorithms should work fine, you can try XGBoost, and you can have a look at this worked out example.
{ "domain": "datascience.stackexchange", "id": 9923, "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, python, time-series, dataset", "url": null }
np-complete, np-hard, np Title: Karp hardness of a diameter-decreasing planted clique A diameter-decreasing planted clique in an undirected graph $G(V,E)$ is a set of vertices $\mathcal{C}\subseteq V$ such that if we add all the missing edges between any pair of vertices in $\mathcal{C}$ to turn it into a clique, then the diameter of the obtained graph $G'$ is at most $2$. Diameter-decreasing Planted Clique Problem: Input: An undirected graph $G(V,E)$ and a natural number $k$ Output: YES if there exists a diameter-decreasing planted clique of size $k$ in $G$, otherwise NO What is the complexity of this problem? This problem is $NP$-complete. Reduce from Exact Cover by $3$-Sets (X3C). Given an X3C instance, its ground set is $\mathcal{U}=\{e_1,e_2,\cdots,e_n\}$. Its collecion of $3$-subsets is $\mathcal{C}=\{s_1,s_2,\cdots,s_m\}$.
{ "domain": "cs.stackexchange", "id": 12347, "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": "np-complete, np-hard, np", "url": null }
homework-and-exercises, newtonian-mechanics, energy-conservation, spring Title: What happened to the work done by friction here? Problem/Solution http://img832.imageshack.us/img832/1313/88791065.jpg! Question What happened to the work done by friction BEFORE it touched the spring? Why was that neglected? Also they say there is no physical meaning behind the negative root, so what is the "unphysical" meaning behind the negative root? How are we supposed to know that the speed is constant before and just as it makes contact with the spring? @atomSmasher ! I am referring to the green region. Shouldn't it be $E_i = \frac{1}{2}mv_A ^2 - f_k(x_b + x_{green distance})$ $E_f = \frac{1}{2}kx_B ^2$ I realize we would have two unknowns then. The problem ignores the friction before it hits the spring because it is not relevant to the question. The question asks for the maximum compression of the spring. The force of friction prior to the spring is irrelevant because you are given the velocity at the point of impact.
{ "domain": "physics.stackexchange", "id": 2110, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, newtonian-mechanics, energy-conservation, spring", "url": null }
c++, beginner, memory-management all the members — which is completely wrong, as now the two dynamic arrays will point to the same memory. Not only are the elements shared between the copies, causing modifications to one array to affect the other, but the two copies will attempt to free the same memory upon destruction, leading to a double-free error, which is way more serious than a memory leak. Initialization semantics It is generally expected that the constructor of the element type is called \$n\$ times if \$n\$ elements are pushed into the dynamic array. In your code, however, this is not the case, whre the amount of constructors called is determined by the capacity of the dynamic array. Elements are first default initialized, and then copy-assigned to. The correct way to solve this problem requires allocating an uninitialized buffer, and using placement new (or equivalent features) to construct the elements, which is another can of worms. Exception safety
{ "domain": "codereview.stackexchange", "id": 40575, "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, memory-management", "url": null }
c++, c++11, multithreading, template, queue template<bool trigger = THREADSAFE> enable_if_t<not trigger, bool> is_empty() const { return is_empty_(); } //mutlithreaded public definitions //push --pop oldest element if queue is full template<bool trigger = THREADSAFE> enable_if_t<trigger, bool> push(const T &data) { std::unique_lock<std::mutex> this_lock(this->mutex_); bool result = push_(data); //this_lock.unlock(); cv_.notify_one(); return result; } template<bool trigger = THREADSAFE> enable_if_t<trigger, bool> push(T &&data) { std::unique_lock<std::mutex> this_lock(this->mutex_); bool result = push_(std::move(data)); //this_lock.unlock(); cv_.notify_one(); return result; }
{ "domain": "codereview.stackexchange", "id": 25526, "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, multithreading, template, queue", "url": null }
navigation, move-base rostopic list when everything is running: derek@derek-G74Sx:~$ rostopic list /amcl/parameter_descriptions /amcl/parameter_updates /amcl_pose /cmd_vel /initialpose /map /map_metadata /move_base/current_goal /move_base/goal /move_base_simple/goal /odom /particlecloud /rosout /rosout_agg /scan /tf /tf_static move_base and amcl errors: [ WARN] [1502606686.483551591]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: . canTransform returned after 0.102372 timeout was 0.1. [ WARN] [1502606687.766040187]: No laser scan received (and thus no pose updates have been published) for 1502606687.765959 seconds. Verify that data is being published on the /scan topic. [ WARN] [1502606687.766627339]: MessageFilter [target=odom ]: Dropped 100.00% of messages so far. Please turn the [ros.amcl.message_notifier] rosconsole logger to DEBUG for more information.
{ "domain": "robotics.stackexchange", "id": 28589, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "navigation, move-base", "url": null }
ros, catkin-make, vision-opencv, cv-bridge Originally posted by doudoushuixiu on ROS Answers with karma: 31 on 2013-11-11 Post score: 2 I came across this error as well when trying to compile the vision_opencv package. The fix is on line 325 where it defines the 'dims' variable as a lont int. long int dims[] = {mat.rows, mat.cols, mat.channels()}; Change that to an int so it reads int dims[] = {mat.rows, mat.cols, mat.channels()}; and it should compile without issue. Originally posted by ccostes with karma: 26 on 2013-11-17 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by Vincent Rabaud on 2013-11-22: Please report that kind of bug upstream if that happens. That is now fixed in vision_opencv 1.10.13. (Numpy 1.x has a different API between Ubuntu releases apparently)
{ "domain": "robotics.stackexchange", "id": 16128, "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, catkin-make, vision-opencv, cv-bridge", "url": null }
thermodynamics, thermal-conduction ~~~~~~\Rightarrow~~~~~~~\frac{P_1}{T_1}=\frac{P_2}{T_2}. $$ Using the condition on the equality of temperatures, we get the equality of pressures. If the piston is an adiabatic wall, the situation requires a more careful analysis. According to Callen (Thermodynamics and an Introduction to Thermostatistics), in the presence of an adiabatic piston, the problem of finding the equilibrium state is indeterminate. In the absence of viscous damping, the piston would oscillate forever. In contrast, with the addition of viscous damping, eventually, the piston will come to rest. In such a case, the pressure on both sides must be equal. The final temperatures of the two subvolumes would be undetermined. However, more recent work has shown that this last conclusion is too pessimistic. In any case, there is agreement about the conclusion of a final pressure.
{ "domain": "physics.stackexchange", "id": 97259, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "thermodynamics, thermal-conduction", "url": null }
evolution, cell-biology One possible explanation for this (theory by Margulis & Schwartz as explained by my tutor) is: From the last universal common ancestor, first prokaryotes and archaea diverged. After this branching, the differences in genetic machinery evolved. Archaea then branched, producing a protoeukaryote line which went on to endosymbiosis with some protobacteria. That would explain the similarities I outlined above: similar cell structure between archaea and prokaryotes but similar genetic machinery between archaea and eukaryotes. It gets a bit more complicated though, because archaea and bacteria can exchange genetic material, and eukaryotes incorporated a lot of their endosymbionts' DNA in their own genome, so you end up with all of them having a huge mix of genes from the others.
{ "domain": "biology.stackexchange", "id": 420, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "evolution, cell-biology", "url": null }
thermodynamics, equilibrium, stoichiometry, reactivity, free-energy Many times I see variations of this formula, instead of ∆G(r) they simply use ∆G, there is a difference between two. Is this formula valid if ∆G is used instead of ∆G(r) in left hand side of equation? Textbooks and other sources are often fuzzy concerning the distinction of $\Delta G$ vs $\Delta_r G$. You are right in saying that the formula does not make sense if you are calculating the difference between two states with different concentration. The other thing that is fuzzy are the units, energy vs. energy per amount (e.g. kJ vs kJ/mol).
{ "domain": "chemistry.stackexchange", "id": 11698, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "thermodynamics, equilibrium, stoichiometry, reactivity, free-energy", "url": null }
condensed-matter Title: What is a quantum simulator? What is the idea behind of quantum simulator aimed to study properties of matter, such as using quantum dots to study the exotic quantum states? Although we typically think of the laws of quantum mechanics as governing phenomena only at the smallest length scales, there are situations in which we can measure quantum effects at reasonable experimental sizes. Superconductivity is a great example of this insofar as a macroscopic piece of superconducting material can have a quantum coherence length of the same scale as itself. Crystalline nanoparticles, such as those of CdSe which are grown with little difficulty in chemistry laboratories across the world, are another great example since their macroscopic properties (e.g., color) are intimately tied up with quantum effects due to their small size. These are not simulators, per se, but systems in which quantum effects manifest themselves at a human scale.
{ "domain": "physics.stackexchange", "id": 1600, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "condensed-matter", "url": null }
ros, ros2, rosservices Originally posted by alsora with karma: 1322 on 2019-08-05 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by mikepark93 on 2019-08-05: When I try building, I get an error saying the following: error: ‘rclcpp::Client<ServiceT>::SharedPtr’ is not a type rclcpp::Client<ServiceT>::SharedPtr client Comment by alsora on 2019-08-05: How have you defined servicet in your code? Comment by mikepark93 on 2019-08-05: This was how I defined it before: rclcpp::Client<orion_sensor::srv::SetFocus>::SharedPtr client Comment by alsora on 2019-08-05: So you should use using ServiceT = orion_sensor::srv::SetFocus;. Or you remove this line and you just keep using orion_sensor::srv::SetFocus as before, changing only the send_request function and adding the template parameter when calling it i.e. send_request<orion_sensor::srv::SetFocus>(...)
{ "domain": "robotics.stackexchange", "id": 33579, "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, rosservices", "url": null }
python, numpy, vectorization, pytorch USE_CUDA = torch.cuda.is_available() def gen_mask(mask_pred, threshold): mask_pred = mask_pred.clone() mask_pred[:, :, :][mask_pred[:, :, :] < threshold] = 0 mask_pred[:, :, :][mask_pred[:, :, :] >= threshold] = 1 return mask_pred def jaccard(prediction, ground_truth): union = prediction + ground_truth union[union == 2] = 1 intersection = prediction * ground_truth union = union.sum(axis=(1, 2)) intersection = intersection.sum(axis=(1, 2)) ji_nonezero_union = intersection[union != 0] / union[union != 0] ji = ji = torch.zeros(intersection.shape) if USE_CUDA: ji = ji.cuda() ji[union != 0] = ji_nonezero_union return ji groundtruth_masks = np.load('./masks.npy') pred_mask = np.load('./pred_mask.npy') n_patch = groundtruth_masks.shape[0] groundtruth_masks = torch.from_numpy(groundtruth_masks) groundtruth_masks = groundtruth_masks.type(torch.float) pred_mask = torch.from_numpy(pred_mask)
{ "domain": "codereview.stackexchange", "id": 36013, "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, numpy, vectorization, pytorch", "url": null }
98 /XHeight 394 /CharSet (/a/two/h/s/R/g/three/i/t/S/four/j/I/U/u/d/five/V/six/m/L/l/seven/n/M/X/p\ eriod/x/H/eight/N/o/Y/c/C/O/p/T/e/D/P/one/A/space/E/r/f) /FontFile3 92 0 R >> endobj 65 0 obj 742 endobj 66 0 obj << /Filter /FlateDecode /Length 65 0 R >> stream Length '' so that it is not a negative number, such as the length a! Need for this book ( complex length-vectors, and complex inner product symmetric bilinear form points in same! The matrix vector products are dual with the more familiar case of vectors! Suitable as an inner product is equal to zero, then this reduces to dot of! Wi+Hv, wi and hu, v ) equals dot ( v, u ) Euclidean geometry, the product. Test set should include some column vectors as: Generalizations complex vectors elements are complex, conjugate. I.E., its complex conjugate, but using Abs, not conjugate vectors ( zero inner product ) each... Its complex conjugate this operation as: Generalizations complex vectors, such dot... Points in the vector is a slightly
{ "domain": "ac.th", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9674102524151827, "lm_q1q2_score": 0.8488800296174422, "lm_q2_score": 0.8774767762675405, "openwebmath_perplexity": 668.7707819299859, "openwebmath_score": 0.8892807364463806, "tags": null, "url": "https://maet.eat.kmutnb.ac.th/v0uuvx85/inner-product-of-complex-vectors-8f9b90" }
computation-models Does anyone know about the future of this model? Does it evolve or just stuck and no progress in done in this direction?
{ "domain": "cs.stackexchange", "id": 12525, "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": "computation-models", "url": null }
c++, performance, api, symbolic-math return start_Node->derive(); } double SField::derivative(const std::vector<double>& position, const Var& var_ptr) const { unsigned N = var_ptrs.size(); assert(N == position.size()); for (unsigned i = 0; i != N; ++i) { var_ptrs[i]->vn->value = position[i]; var_ptrs[i]->vn->value_dot = 0.0; } var_ptr.vn->value_dot = 1.0; return start_Node->derive(); } double SField::derivative(const double& position, const double& direction) const { return this->derivative(std::vector<double>{position},std::vector<double>{direction}); } double SField::valueAtLastPosition() const { return start_Node->value; }
{ "domain": "codereview.stackexchange", "id": 45345, "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, api, symbolic-math", "url": null }
16 Feb 2016, 01:08 Length of the rope is the radius of the circle. Decrease in the area grazed by the cow = $$\pi$$ ($$22^2$$ - $$14^2$$) = (22-14)(22+14)$$\pi$$ = 8(36)$$\pi$$ =288$$\pi$$ Manager Joined: 24 Sep 2015 Posts: 57 Location: Spain Concentration: Strategy, Entrepreneurship GPA: 3.9 WE: Management Consulting (Consulting) The length of a rope, by which a cow is tied, is decreased from 22m  [#permalink] ### Show Tags 18 Aug 2019, 05:53 One of the errors that GMAT exam makers want you to make here is confusing radius and diameter Don't divide the 22m and 14m by two and use that resulting number as the radius because the whole length of the rope is already the radius! 1º Area (22m): 22^2 * pi = 484 * pi 2º Area (14m): 14^2 * pi = 196 * pi Differences: 484 * pi - 196 * pi = 288 * pi
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.951142215838086, "lm_q1q2_score": 0.808443469220808, "lm_q2_score": 0.8499711775577736, "openwebmath_perplexity": 7020.044581082631, "openwebmath_score": 0.8409363031387329, "tags": null, "url": "https://gmatclub.com/forum/the-length-of-a-rope-by-which-a-cow-is-tied-is-decreased-from-22m-203974.html?kudos=1" }
rosbag, catkin CMake Error at kitti_to_rosbag/kitti_to_rosbag/CMakeLists.txt:4 (find_package): By not providing "Findcatkin_simple.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "catkin_simple", but CMake did not find one. Could not find a package configuration file provided by "catkin_simple" with any of the following names: catkin_simpleConfig.cmake and catkin_simple-config.cmake I followed the following commands: cd ~/cw/src git clone https://github.com/ethz-asl/kitti_to_rosbag cd .. catkin_make In an attempt to rectify this error, I also cloned all dependent packages(catkin_simple, cv_bridge, eigen_checks ...) provided in the package.xml for kitti_to_rosbag into my catkin/src folder. However, it gives this error No rule to make target '/home/user/catkin_ws/devel/lib/libgflags.so', needed by '/home/user/catkin_ws/devel/lib/libeigen_checks.so
{ "domain": "robotics.stackexchange", "id": 28218, "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": "rosbag, catkin", "url": null }
php, api, rest Also for diagnostic and support issues, use various response codes for different issues and document them for the user. You could use a text header and a message identifying the specifics problem with an error message. header('Content-Type: text/plain; charset=utf-8'); echo $error;
{ "domain": "codereview.stackexchange", "id": 12827, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php, api, rest", "url": null }
homework-and-exercises, electricity, electrical-resistance Title: Getting resistance and current from resistivity For a cylindrical resistor of length $l$, radius $a$, resistivity $\rho=\frac{\rho_0z}{r}$, and voltage $V$, I am to find the current.
{ "domain": "physics.stackexchange", "id": 40825, "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, electricity, electrical-resistance", "url": null }
energy, electric-fields $$ U=\int_0^Q\phi\,dq=\int_0^Q\frac{q}{C}\,dq=\frac{1}{2C}Q^2. $$ For a parallel-plate capacitor, $Q=\sigma A$ and $C=\frac{Q}{\phi}=\sigma A\,E\,d=\sigma A\frac{\epsilon_0}{\sigma d}=\frac{A \epsilon_0}{d}$. Substituting into the above, we get: $$ U=\frac{1}{2C}Q^2=\frac{1}{2\epsilon_0}\sigma^2 A \, d $$ I'm not sure why the two results contradict each other. Other websites such as this one as well as a post on stack-exchange here seem to indicate that in similar scenarios the energy is dissipated in the form of electromagnetic radiation. However, in the above example, all of the charges can be moved slowly, meaning that the current can be made infinitesimally small. Wouldn't this negate the explanation using radiation? If not, where is the radiation being produced, and can the energy supplied to it be quantified?
{ "domain": "physics.stackexchange", "id": 16645, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "energy, electric-fields", "url": null }
magnetic-fields, resonance Concrete uses about 10% water when it is poured, so contains a reasonable amount hydrogen. The steel reenforcing bar in the concrete will effect the local field. This would be a good thing because if the steel moved or broke because of the quake, then that would affect the signal and indicate there was a change I don't think a detailed image would be necessary, just creating a signature of the building (each floor) which could be compared before and after the quake. Thought? Practical issues? MRI isn't that useful for the reasons described above. But it is relatively easy to x-ray large buildings, even very large very solid buildings. The structure of the Pyramid determined by cosmic-ray absorption.
{ "domain": "physics.stackexchange", "id": 35538, "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": "magnetic-fields, resonance", "url": null }
newtonian-mechanics, work, friction Now consider the total work done by static friction between the blocks. The equal and opposite static friction force the upper block applies to the lower block, per Newton's 3rd law, does negative work on the lower block since the force is in the opposite direction to the displacement of the lower block. Since the displacement of both blocks is the same, the net work done by static friction between the blocks is zero. Hope this helps.
{ "domain": "physics.stackexchange", "id": 98442, "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": "newtonian-mechanics, work, friction", "url": null }
Personally, I think it helps to write "x= ", "y= ", "z= " in the limits of integration themselves. The volume is given by: $$\int_{y= 0}^{y=1}\int_{x=0}^{x=1-y}\int_{z=0}^{z=1-x-y}dzdxdy$$. It would be good practice for you to find the integrals in the other 5 orders, and do the integrations to see that they do indeed give the same answer! Last edited: Jan 14, 2006 7. Jan 14, 2006 ### twoflower Thank you HallsoftIvy very much for comprehensible explanation! I already managed it as soon as I draw it :) First it seemed ugly to me to draw it but it turned out to be pretty straightforward. And then the expressing 'x' for fixed 'y' was easy.
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9825575137315161, "lm_q1q2_score": 0.8465108392967042, "lm_q2_score": 0.8615382076534742, "openwebmath_perplexity": 584.9156120464927, "openwebmath_score": 0.8721181750297546, "tags": null, "url": "https://www.physicsforums.com/threads/yet-another-volume.106729/" }
quantum-field-theory \end{eqnarray}\tag{3-112}$$ (Note the subtle but important differences in the underbraces; some are $0$ while others are $|0\rangle$.) The part I am struggling with is understanding how the underbrace "can normalize = 1" at the end of $\text{(3-112)}$ can be true given $\text{(3-110)}$. It seems to me that the $A$ terms appearing at the end of $\text{(3-112)}$ are the same ones defined in the construction operator $C$ and normalized so that their absolute values squared sum to $1$. How can their just-plain sum also be of magnitude $1$? I know that one would *like * the underbraced term to sum to zero, but I don't see how that can be.
{ "domain": "physics.stackexchange", "id": 11060, "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", "url": null }
algorithms Consider following chars to understand the transformation; | : boundary indicator. To separate consecutive dynamic data fields. ^ : next field(set of fields) is/are repeated array item $ : empty value # : missing, null, undefined field @ : empty object or array ! : missing, null, undefined object or array Y : True N : False Example: Transform {projectDetails: [ {detail : {}, id : "gwl" }], name: "amit"} > @gwl|amit {projectDetails: [ {detail : {} }], name: "amit"} > @$amit
{ "domain": "cs.stackexchange", "id": 10843, "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", "url": null }
python, numpy, computational-geometry, clustering Title: Calculating the distance between one point, and many others In my program, I have entities that I call "blobs", because they have a blobby shape. Blobs are polygons. If I have two blobs, then their information array would look like: >>> blobs np.array([ [ [x1, y1], [x2, y2], [x3, y3] ], [ [x1, y1], [x2, y2], [x3, y3] ] ]) Each entry along axis 0 represents one blob. Each entry along axis 2 represents the x,y coordinates of the vertex of a blob. In the above case, there are 2 blobs, each with three vertices. There could be other information in each We can assume that all blobs will always have the same number of vertices. I sometimes need to find which blobs are within a certain distance from another blob. Here are the two functions I use: def returnBlobIndicesOfRelevantBlobs(minimumDistanceFromFocusVertex, blobs, focusVertexBlobIndex, focusVertexIndex): focusVertexCoords = blobs[focusVertexBlobIndex, focusVertexIndex, :2]
{ "domain": "codereview.stackexchange", "id": 8056, "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, numpy, computational-geometry, clustering", "url": null }
java, android XmlDom r = xml.tag("reportrose"); roseUrl = r.tag("img").attr("src").trim(); aq.download(roseUrl, file, new AjaxCallback<File>() { public void callback(String url, File file, AjaxStatus status) { String s = status.getMessage(); int i = status.getCode(); String e = s + " | Status Code: " + i; if (file != null) { getInfo(); } else { Log.e("ACR SAC Widget Error", e); } } }); } else { Log.e("DS", "NO! Don't do anything... Wait until next check..."); } Well, if it works, it works. There is not much to say about this small part of the code without any context. You should know this by yourself, because you should have some tests.
{ "domain": "codereview.stackexchange", "id": 3345, "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, android", "url": null }
physical-chemistry, equilibrium, solubility First with your expressions: $\ce{K_{sp} = [Mg^2+][NH_4^+][PO_4^3-]}$ $\ce{K_{sp} = (S)(0.1)(S-x})$ Here we want to find S-x which is $\ce{[PO_4^3-]_{eq}}$. To do this, I did the following: $\ce{\frac{[PO_4^3-][H+]}{[HPO_4^2-]}=K_{a3} = 10^{-12.4}}$ Assuming $\ce{[H^+] = 10^{-10}}$: $\ce{\frac{[PO_4^3-] 10^{-10}}{[HPO_4^2-] 10^{-12.4}}=K_{a3} = 1}$ $\ce{\frac{[PO_4^3-] 10^{2.4}}{[HPO_4^2-]} = 1}$ Now we could continue on and find $\ce{[H_2PO_4]}$. But it turns out the value is quite small and can be essentially ignored. Here is what we'll get if we solve for it: $\ce{\frac{[HPO_4^2-][H^+]}{[H_2PO_4^-]} = K_{a2} = 10^{-7.2}}$ $\ce{\frac{[HPO_4^2-] 10^{-2.8}}{[H_2PO_4^-]} = 1}$ Replacing $\ce{[HPO_4^2-]}$ with $\ce{[PO_4^3-]}$ in our earlier expression, we get $\ce{\frac{[PO_4^3-] 10^{-0.4}}{[H_2PO_4^-]} = 1}$
{ "domain": "chemistry.stackexchange", "id": 15783, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "physical-chemistry, equilibrium, solubility", "url": null }
particle-physics, atoms, vibrations, molecules Title: Why do particles vibrate? It seems like all molecules vibrate and they vibrate more when heat is added. Why do they vibrate in the first place? And why does adding heat to a system make its molecules vibrate more? What are the forces involved in making particles vibrate? All molecules do not necessarily vibrate. It depends on the energy that is absorbed by the molecule. In the case of absorbing electromagnetic energy, each portion of the electromagnetic spectrum has quantum energies appropriate for the excitation mode of the molecules. If there are no available quantized energy levels which match the quantum energy of the incident radiation, then the material will be transparent to that radiation, and it will pass through. The quantum energy of microwave radiation, for example, corresponds to the excitation modes of torsion and rotation of polar molecules such as water. It is too low to cause vibration.
{ "domain": "physics.stackexchange", "id": 74963, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "particle-physics, atoms, vibrations, molecules", "url": null }
python, graphs, ipython Title: How do I show plots when using Graphlab? Sorry, if this topic is not connected directly to Data Science. I want to understand how the Graphlab tool works. Firstly I want to execute the toy examples from the Gallery site. When I try to execute the example code, everything is OK except one command: I can not see the graphlab plot after show(). The command show() returns to me some kind of object in IPython and nothing in the IPython Notebook. If the example code has the plot, which depends directly on the matplotlib module, I can produce the real plots and save it on my machine. Consequently, I suppose the main error depends on the graphlab (or object from its class). If somebody already used this tool and rendered the plot, can he/she tell me, how I can execute the plots command? In [8]: import graphlab In [9]: from IPython.display import display from IPython.display import Image graphlab.canvas.set_target('ipynb') In [10]:import urllib
{ "domain": "datascience.stackexchange", "id": 134, "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, graphs, ipython", "url": null }
# Showing that infinite product $\prod{(1+\frac{i}{k})}$ diverges In Bak and Newman's Complex Analysis they ask to show that the infinite product $\prod_{k \ge 1}{(1+\frac{i}{k})}$ diverges (with $i$ being the imaginary unit). My intuition is that it does not diverge to $0$, but rather just kind of oscillates randomly around the origin for large partial products. However, I am having a hard time proving this. If I break it down into two products of $r$ and $e^{i\theta}$ this doesn't help, because $\theta \rightarrow 0$ pretty clearly, and then I do not get my desired result of perpetual rotation. The $r$ term, $\prod_{k \ge 1}{\sqrt{1+\frac{1}{k^2}}}$ is not very informative either. I guess I have two questions: is my assumption that it oscillates kind of randomly at $\infty$ incorrect? If it is correct, how might I go about showing that this is the behavior?
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.985042914724116, "lm_q1q2_score": 0.8250916021271949, "lm_q2_score": 0.8376199552262967, "openwebmath_perplexity": 202.19008950600207, "openwebmath_score": 0.9478875398635864, "tags": null, "url": "http://math.stackexchange.com/questions/251223/showing-that-infinite-product-prod1-fracik-diverges" }
homework-and-exercises, quantum-field-theory, path-integral \tag{7}& = \langle q_{j+1}|1-it\,\hat{p}^2/2m+O(\delta t^2)|q_j\rangle - i\delta t\langle q_{j+1}|V(q_j)|q_j\rangle \\ & = \langle q_{j+1}|1-it\,(\hat{p}^2/2m+V(q_j))+O(\delta t^2)|q_j\rangle \\ \end{align} \\ $$ $(5)$ should be possible since we're only interested in the limit $\delta t \to 0$. But this seems to be a rather sloppy argument, because in the following steps, before we take the limit $\delta t \to 0$, a Gaussian integral over $p$ is used. So we really need the exponential function and not just some approximation. Even $(7)$ seems a bit sloppy. Shouldn't I have some limits on the $V(q)$ function to know that $V(\hat{q})|q_j\rangle = V(q_j)|q_j\rangle$? Any hints? Your argument is essentially correct. In the usual physicist's derivation of the path integral, one uses the Zassenhaus formula to expand the exponential as $$ \mathrm{e}^{\delta t(p^2/(2m) + V(q))} = \mathrm{e}^{\delta t p^2/(2m)}\mathrm{e}^{\delta t V(q)}\mathrm{e}^{-\delta t^2 / 2[p^2,V(q)]}\dots$$
{ "domain": "physics.stackexchange", "id": 25698, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, quantum-field-theory, path-integral", "url": null }
java, sql, swing, email import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; public class DAO { static Connection conn; static ResultSet users; static PreparedStatement ps; protected static ResultSet retriveUsers() { FactoryConnection.closeConnections(conn, ps, users); // if there is any new connection, it will close the previous one try { conn = FactoryConnection.getConnectionToMySql(); ps = (PreparedStatement) conn.prepareStatement("select * from users"); users = ps.executeQuery(); return users; } catch (Exception e) { e.printStackTrace(); } return null; } } Class FactoryConnection, this class will create the connection to MySql (getConnectionToMySql)database and close the connections (closeConnections) when called: package project;
{ "domain": "codereview.stackexchange", "id": 41474, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, sql, swing, email", "url": null }
fluid-mechanics, thermodynamics, heat-transfer, steam, steamengine Superheater tubes are not for use by the unknowledgeable. Stick with saturated steam for your first attempt. Understand the steam tables before you try this. A pressure relief valve to keep from blowing up the boiler if it heats up too much Control of the heating to keep the pressure in the desired range. On a steam locomotive this was the fireman's rate of shoveling coal. Modern boilers use pressure control via the fuel feed. A good steam system will have a condenser that draws a vacuum on the turbine outlet to increase its efficiency. It isn't strictly necessary, but your system doesn't have a way to get rid of waste heat. Eventually the water tank will be filled with water near the boiling point, which will just make it flash to steam that much quicker entering your furnace.
{ "domain": "engineering.stackexchange", "id": 5360, "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, thermodynamics, heat-transfer, steam, steamengine", "url": null }
machine-learning, function, approximation (Kernel regressors, sometimes called the Nadaraya-Watson Estimator.) Here you write the function at any point as a weighted combination of nearby values. More concretely, since this is in the statistics literature, you typically suppose you have some examples $((x_i,f(x_i)))_{i=1}^n$ drawn from some distribution, and fix some kernel $K$ (can think of this as a gaussian, but zero mean is what matters most), and write $$ \hat f(x) := \sum_i f(x_i) \left(\frac{ K(c_n(x-x_i)) }{ \sum_j K(c_n(x-x_j))}\right), $$ where $c_n\to\infty$ (you are more sensitive to small distances as $n$ increases). The guarantee is that, as $n\to\infty$, a probilistic criterion of distortion (expectation of sup-norm, high probability, whatever) goes to zero. (It hardly matters what $K$ looks like---it matters more how you choose $c_n$.)
{ "domain": "cstheory.stackexchange", "id": 1041, "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, function, approximation", "url": null }
java, performance, android, batch, jni cs_insn *insn = cs_malloc(handle); const uint8_t *code = (uint8_t *)(byte_buf+offset); size_t code_size = size-offset; // size of @code buffer above uint64_t addr = virtaddr; // address of first instruction to be disassembled // disassemble one instruction a time & store the result into @insn variable above while(cs_disasm_iter(handle, &code, &code_size, &addr, insn)) { // analyze disassembled instruction in @insn variable ... // NOTE: @code, @code_size & @address variables are all updated // to point to the next instruction after each iteration. __android_log_print(ANDROID_LOG_VERBOSE, "Disassembler", "inloop"); jobject dar=env->NewObject(darcls,ctor); jfieldID fid = env->GetFieldID(darcls, "mnemonic","Ljava/lang/String;"); if (fid == NULL) {
{ "domain": "codereview.stackexchange", "id": 32178, "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, android, batch, jni", "url": null }
Now we consider the logarithmic function with arbitrary base and obtain a formula for its derivative. To derive the function {x}^{\ln\left(x\right)}, use the method of logarithmic differentiation. Unfortunately, we can only use the logarithm laws to help us in a limited number of logarithm differentiation question types. : Khan Academy, essay on corruption with quotes, what is considered smartphpne addiction essay essay! Exercise appears under the Differential calculus course logarithm, the exponent or power to which a base be... For anyone, anywhere, properties of logarithms Value Theorem ( Khan Academy Inverse Trig derivatives logarithm! Resources Khan Academy is a nonprofit with the mission of providing a free, world-class education for anyone anywhere! Both Illustrative Mathematics and Khan Academy is: ∫ ⁡ = ⁡ − + largest of. Method of logarithmic functions 10 100 - Exponential and logarithmic functions on Brilliant, the symmetry mixed! See videos in lower-right for help: Paul 's
{ "domain": "cmccintl.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9808759638081522, "lm_q1q2_score": 0.8173880676218309, "lm_q2_score": 0.8333245973817158, "openwebmath_perplexity": 1750.0349962657733, "openwebmath_score": 0.4318494498729706, "tags": null, "url": "https://cmccintl.com/sanctuary-meaning-ouut/logarithmic-differentiation-khan-academy-ef0524" }
c#, .net, asynchronous, http, stream public override long Position { get => _position; set => Seek(value, SeekOrigin.Begin); } public override void Flush() { } public override int Read(byte[] buffer, int offset, int count) { EnsureStreamOpen().GetAwaiter().GetResult(); int read = _underlyingStream.Read(buffer, offset, count); _position += read; return read; } public override int Read(Span<byte> buffer) { EnsureStreamOpen().GetAwaiter().GetResult(); int read = _underlyingStream.Read(buffer); _position += read; return read; }
{ "domain": "codereview.stackexchange", "id": 44789, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, .net, asynchronous, http, stream", "url": null }
javascript, google-apps-script, google-sheets /* Specify PDF export parameters // From: https://code.google.com/p/google-apps-script-issues/issues/detail?id=3579 exportFormat = pdf / csv / xls / xlsx gridlines = true / false printtitle = true (1) / false (0) size = legal / letter/ A4 fzr (repeat frozen rows) = true / false portrait = true (1) / false (0) fitw (fit to page width) = true (1) / false (0) add gid if to export a particular sheet - 0, 1, 2,.. */ var url_ext = 'export?exportFormat=pdf&format=pdf' // export as pdf + '&size=a4' // paper size + '&portrait=1' // orientation, false for landscape + '&fitw=true&source=labnol' // fit to width, false for actual size + '&sheetnames=false&printtitle=false' // hide optional headers and footers + '&pagenumbers=false&gridlines=false' // hide page numbers and gridlines + '&fzr=false' // do not repeat row headers (frozen rows) on each page + '&gid=1809314965'; // the sheet's Id
{ "domain": "codereview.stackexchange", "id": 17987, "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, google-apps-script, google-sheets", "url": null }
newtonian-mechanics, newtonian-gravity, orbital-motion, solar-system, satellites Can we say that the net force on a satellite revolving around the earth is not equal to zero ? Yes, but even without taking into account the Sun or the Moon, the net force on a satellite in orbit around the Earth is not zero anyway. If the net force on the satellite were zero then it would travel in a straight line at a constant speed (due to Newton's First Law) so it would not be in orbit. In a comment you suggest that net force on the satellite must be zero if its angular momentum is conserved. This is not correct. Its angular momentum about the centre of the Earth is conserved if there is no net torque acting on it - zero torque is not the same as zero force. Since the direction of the gravitational force is through the centre of the Earth (as long as we omit the effect of the Sun, Moon and other planets) then its torque (about the centre of the Earth) is always zero. So the angular momentum of the satellite is constant even though there is a non-zero net force acting on it.
{ "domain": "physics.stackexchange", "id": 98465, "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": "newtonian-mechanics, newtonian-gravity, orbital-motion, solar-system, satellites", "url": null }
beginner, c, sorting, homework void overallSort(info *s, size_t itemNum) { size_t destIndex = 0; while(destIndex < itemNum) { destIndex += groupByDest(s, destIndex, itemNum); } } size_t groupByDest(info *s, size_t firstItemIndex, size_t itemNum) { info temp; size_t i, j = firstItemIndex + 1, groupSize = 1; for(i = firstItemIndex + 1; i < itemNum; i++) { if(strcmp(s[i].dest, s[firstItemIndex].dest) == 0) { if(i != j) { temp = s[j]; s[j] = s[i]; s[i] = temp; } j++; groupSize++; } } sortByMonth(s, firstItemIndex, firstItemIndex + groupSize - 1); return groupSize; }
{ "domain": "codereview.stackexchange", "id": 20530, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "beginner, c, sorting, homework", "url": null }
c#, algorithm If you protest that the unary negation is not addition or subtraction, you can change it too: public static ulong SquareByAddition3(int value) { ulong sum = 0; // Convert to ulong once. // If you consider negating a value to not be Addition or Subtraction, then // we break up the assigment to number into 2. // First, when value is not negative. ulong number = (ulong)(value > 0 ? value : 0); var first = 0; var last = value; // Second, when value is negative. We must be careful around edge case of int.MinValue // so we use an intermediate cast to long before subtracting it from 0. if (value < 0) { // Here we technically use subtraction rather than directly negating. number = (ulong)(0 - (long)value); first = value; last = 0; } for (var i = first; i < last; i++) { sum += number; } return sum; }
{ "domain": "codereview.stackexchange", "id": 31173, "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#, algorithm", "url": null }
c++, exception-handling, exception return val1; } double getVal2() {/*the same as before*/}; // ... more values the same way }; If I want to throw exceptions like MyConfigFileException instead of calling exit: class MyConfigFileException : public MyIOException // MyIOException is derived from std::exception { private: std::string m_msg; public: MyConfigFileException(const std::string msg) : msg(msg) {} virtual const char* what() const throw() { return m_msg.c_str(); } }; How would you suggest I do this? Shall I just throw it? Shall I catch where the getValX() function is called or I shall catch it in main()? I am new to exceptions. Throwing Yes, just throw it: if (val1 < 0) throw MissingConfigValueException("getVal1() failed or val1 < 0");
{ "domain": "codereview.stackexchange", "id": 7659, "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++, exception-handling, exception", "url": null }
ros, rosbag, ros-kinetic, pcd, pointcloud if you are still having trouble you can see where messages are going by running: rosrun rqt_graph rqt_graph Comment by Mennaa on 2020-12-19: Hey, Hope you have managed to solve your problem now. If you don't mind can you share the solution of your problem with me? cause I have the same problem and my team and I wanna extract an occupancy grid map from a camera having pointcloud2 message being published. @kkrasnosky @pallyra1 Thank you.
{ "domain": "robotics.stackexchange", "id": 30060, "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, rosbag, ros-kinetic, pcd, pointcloud", "url": null }
c#, algorithm, design-patterns, graph, breadth-first-search public static IEnumerable<Path> GetPathsWithMinStops(INode startNode, INode endNode, int minStops, bool inclusive) { return inclusive ? GetAllPaths(startNode, endNode).Where(path => path.VisitedCount >= minStops) : GetAllPaths(startNode, endNode).Where(path => path.VisitedCount > minStops); } public static IEnumerable<Path> GetPathsWithMaxStops(INode startNode, INode endNode, int maxStops, bool inclusive) { return inclusive ? GetAllPaths(startNode, endNode).Where(path => path.VisitedCount <= maxStops) : GetAllPaths(startNode, endNode).Where(path => path.VisitedCount < maxStops); } public static IEnumerable<Path> GetPathsWithExactStops(INode startNode, INode endNode, int stops) { return GetAllPaths(startNode, endNode).Where(path => path.VisitedCount == stops); }
{ "domain": "codereview.stackexchange", "id": 9938, "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#, algorithm, design-patterns, graph, breadth-first-search", "url": null }
php, strings, regex Working Code (Demo) Regex101 Demo $regex = <<<REGEX ~ ^ # start of string anchor (CONF|ESD|TRACKING) # start capture group 1 KEY, three literal words (?: # start non-capturing group 1 \h*[:;'\h]\h* # require a listed punctuation or space with optional leading or trailing spaces (\S+(?:\h+\S+)*?) # start capture group 2 LINE, require one or more non-whitespace characters then lazily match zero or more repetitions of whitespace then non-whitespace substrings (?: # start non-capturing group 2 \h*L\h*[:;'\h]\h* # require literal L then a listed punctuation or space with optional leading or trailing spaces ( # start capture group 3 LINE_DATA (?:\d+(?:\(\d+\))?) # require a number optionally followed by another number in parentheses
{ "domain": "codereview.stackexchange", "id": 42883, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php, strings, regex", "url": null }
c++, beginner, object-oriented void Animal::addFriend(const Animal& newFriend) { friends.push_back(&newFriend); } Dog d1(1, 2, "doggy"); Dog d2(1, 2, "lassy"); makeFriends(d1, d2); I think your friends vector is wrong. You should have std::vector<Animal*> rather than std::vector<Animal> *. Otherwise you get problems with ownership. I would suggest to use auto &elem for range based loops. In any case you should at least use Animal* a : friends rather than passing by copy void print_friends() { for(auto &animal : friends) { std::cout << animal->getName() << endl; } };
{ "domain": "codereview.stackexchange", "id": 21924, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, beginner, object-oriented", "url": null }
$$\int\limits_0^{\infty} \frac{\log(x)}{1+e^x}\,dx=-\log^2\left(\sqrt{2}^{\sqrt{2}}\right)$$ $\log(x)/(1+e^x)=e^{-x} \log(x)/(1+e^{-x})$ then expand $1/(1+e^{-x})$ using the geometric series. Up to changes of variables you are then left to integrate $\log(x) e^{-x}$ using any method, and then computing a certain infinite series.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9861513926334711, "lm_q1q2_score": 0.8062522017049101, "lm_q2_score": 0.8175744695262777, "openwebmath_perplexity": 363.6037854716632, "openwebmath_score": 0.9583919644355774, "tags": null, "url": "https://math.stackexchange.com/questions/2585960/evaluate-int-0-infty-frac-log-x1ex-dx/2586013" }
newtonian-mechanics, general-relativity, newtonian-gravity, potential-energy, units This is incorrect. Here is a plot of the potential for your scenario for the situation where $R<<r_0$ Inside the shell the field is 0, but the potential is non-zero. The absence of a field means that the potential is uniform, not that it is zero. The potential is continuous, so inside the shell the potential is $-\frac{GM}{r_0}$ After resolving this mistake, all of the rest of the question is seen to be based on a flawed premise and so it goes away.
{ "domain": "physics.stackexchange", "id": 78972, "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": "newtonian-mechanics, general-relativity, newtonian-gravity, potential-energy, units", "url": null }
computer-architecture, cpu, performance, high-performance-computing How and where can I get the material for its preparation? Any recommendation? I am trying the following material (Chapter 1 & 2) if its right for above topic? https://nap.nationalacademies.org/catalog/12980/the-future-of-computing-performance-game-over-or-next-level The topic cover broad range of work, It should start with 1- CPU-GPU Architecture, you can compare the latest one with the previous one in comparison section and show how it contribute towards the performance. Performance is not only based on CPU-GPU, next point should be 2- SDRAM , explain the concept of SDRAM, SDR SDRAM, DDR SDRAM, again you can compare DDR4 with DDR5 3- M.2 SSD NVMe, explain about utilizing the full capacity of SSD, you can compare it with SATA 3.0 and AHCI 4- PCIe, again compare it with PCIe 5.0 with PCIe 4.0 5- Explain about the motherboard. All these major component contribute towards the performance of the system.
{ "domain": "cs.stackexchange", "id": 20040, "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": "computer-architecture, cpu, performance, high-performance-computing", "url": null }
beam Sign normally doesn't matter, if you're consistent, but it's causing an error in my working out the moment. Evaluating it, I get -1852.5 which is incorrect. The answer is 1132.5. If I change the sign of $6\cdot20$ to $-6\cdot20$, I get the ‘correct’ answer, -1132.5. $$\begin{gather} F_x = 20\cdot6 + A_x = 0 \\ A_x = -120 \\ M_D = -30\cdot7\cdot3.5+2\cdot E_y = 0 \\ E_y = 367.5 \\ F_y = D_y + E_y - 30\cdot7 = 0 \\ D_y = -157.5 \\ F_y = -D_y - 60 + A_y = 0 \\ A_y = 60-157.5 = -97.5 \\ \sum M_A = M_A + 6\cdot20\cdot3-60\cdot4-D_y\cdot11=0 \end{gather}$$ A moment is defined as the cross-product of distance and force vectors: $$\begin{align} M &= r\times F \\ &= \det\left(\left|\begin{matrix} i & j & k \\ r_x & r_y & r_z \\ F_x & F_y & F_z \\ \end{matrix}\right|\right) \\ &= (r_yF_z-r_zF_y)\hat{i} -(r_xF_z-r_zF_x)\hat{j} + (r_xF_y-r_yF_x)\hat{k} \end{align}$$
{ "domain": "engineering.stackexchange", "id": 1129, "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": "beam", "url": null }
comparative-review, go The different with two method above is the parameters. I would like to know what's a good practice for this. Any ideas on what can be improved? In Go you have a choice as to whether you treat structs like an object with its own methods, and you have an object-oriented feel to your code, or you treat data like parameters, and you pass the data around in a more procedural format. Let's look at your first method first. The ReviewData struct is a struct, and you've declared a method on it that has no parameters. The data required in the method comes from the instance of the struct itself, r.ShopID. The logic there is clear (as an aside .... semantically it's a bit ambiguous because, if you have an r instance, it seems like it should Exist... it's a bit odd to see logic like if abc.Exists() {... because if abc did not exist it seems like abc should be nil ;-)
{ "domain": "codereview.stackexchange", "id": 24311, "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": "comparative-review, go", "url": null }
$$T(n) = \frac{2}{\sqrt{5}} \left( \varphi^{n+1} – (-\varphi)^{-(n+1)} \right)$$ And of course, this means: $$C(n) = \frac{2}{\sqrt{5}} \left( \varphi^{n+1} – (-\varphi)^{-(n+1)} \right) – 1$$ This, I think, should give the exact number of recursive calls needed. Now earlier I mentioned that many people generally put the upper bound at $O(2^n)$ for the number of calls (which is similar to the time complexity). As we can see from the equation above, however, $$\lim\limits_{n \rightarrow N} C(n) = \frac{2}{\sqrt{5}} \varphi^{N+1}$$ for large $N$. The complexity could therefore more precisely be bounded at $O(\varphi^n)$ (after getting rid of the constants, including one factor of $\varphi$). Kind of cool, I guess… (and maybe somewhat intuitive). Anyway, that’s about all I want to talk about with regards to Fibonacci Numbers. If you want to read more about Fibonacci Numbers, visit MathWorld or Wikipedia.
{ "domain": "albertgural.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9923043523664414, "lm_q1q2_score": 0.8042417440322714, "lm_q2_score": 0.8104789040926008, "openwebmath_perplexity": 179.16039618423633, "openwebmath_score": 0.9202221632003784, "tags": null, "url": "http://www.albertgural.com/math/theory/fibonacci-properties/" }
• @StevenGubkin a fun, and weird tidbit from thermodynamics perhaps brings your simple analogy new mathematical breadth, however, at the cost of physically familiar material. It is true that temperatures are in bijective correspondence with $\mathbb{R}$; see en.wikipedia.org/wiki/Negative_temperature brought to you from the bizarre world of statistical mechanics. Probably 99.9999 percent of the world ignores this. – James S. Cook Apr 9 '15 at 19:31
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9780517450056273, "lm_q1q2_score": 0.8085669107196771, "lm_q2_score": 0.8267117919359419, "openwebmath_perplexity": 404.33049534723756, "openwebmath_score": 0.7455641031265259, "tags": null, "url": "https://matheducators.stackexchange.com/questions/7778/should-we-teach-abstract-affine-spaces" }
electricity, electric-circuits, batteries The second 'wrong' is assuming that all of the power from the charger goes to charge the battery. Some of the power, $I^2_C\cdot r_B$, is dissipated by the internal resistance (the battery warms up during charging). Finally, as others have pointed out, a battery (or cell) stores energy and not electric charge. If two batteries have the same (energy) capacity (typically given in watt-hours), then for the same charging current, the battery with the largest emf will finish charging first. For example, and at the risk of simplifying too much, assume you have a 6V and a 12V battery each with the same capacity and 'small' internal resistance. If both (fully discharged) batteries are charged with a 1A charging current, the 12V battery will become fully charged in essentially half the time of the 6V battery.
{ "domain": "physics.stackexchange", "id": 52604, "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": "electricity, electric-circuits, batteries", "url": null }
c, datetime, random, file } else { fclose(fcheck); fileIsCreated = FILE_EXISTS_NUMBER; return fileIsCreated; } } int if_previously_saved_year_date(char yearDay[5]) { int diffYearDay; int lastYearDay; int yearDayInt; FILE *ftest; sscanf(yearDay, "%i", &yearDayInt); ftest = fopen("DateOfFileCreation.txt", "r"); if(ftest == NULL) { fclose(ftest); return diffYearDay = YEAR_DAY_DIFFERENT; } else { fclose(ftest); fscanf(ftest, "%i", &lastYearDay); } if(lastYearDay == yearDayInt) { return diffYearDay = YEAR_DAY_SAME; } else { return diffYearDay = YEAR_DAY_DIFFERENT; } } struct DataInfo schedule_rand() { const int BASE_VALUE = 10; const int RAND_DIVIDE_FOR_REMAINDER = 2; float maxNumFloat, minNumFloat; int incr1 = 0; int maxNumInt, minNumInt; int randZeroAmount; int randNumber; struct DataInfo SubjInfo;
{ "domain": "codereview.stackexchange", "id": 31327, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c, datetime, random, file", "url": null }
c++, algorithm, cryptography Title: Symmetric cipher Can someone please review this algo and say if it has some weak places and/or what kind of algo is this (caesar, block etc)? std::vector<unsigned char> TestCryptDecrypt(const std::vector<unsigned char>& data, const std::vector<unsigned char>& key, bool decrypt) { std::vector<unsigned char> result; unsigned int seed = 0, salt = 0, prev = 0; for (int i = 0; i < key.size() - 4; i += 4) { unsigned int part = 0; for (int j = i; j < i + 4; j++) part = part << 8 | key[j]; seed ^= part; } for (int i = 0; i < data.size(); i++) { unsigned char kc = key[i % key.size()]; seed = seed * 214013 + 2531011; salt = ((seed >> 16) + kc) % 256; unsigned int enc = data[i] ^ kc ^ salt; result.push_back(enc); } return result; }
{ "domain": "codereview.stackexchange", "id": 22722, "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++, algorithm, cryptography", "url": null }
forces, gravity, black-holes Title: Black hole gravity vs parent star gravity In the cases of black holes that form from supernova and collapse of a massive star, I understand that in most of these cases, the star loses significant amounts of mass from the explosion. Presumably, after this point as the remaining mass becomes more dense as it further collapses unto itself, it eventually becomes a black hole with gravitational force greater than that of its parent star. But, if gravity is based on mass, how can the black hole have greater gravitational force than the star from which it is formed? For a given mass the gravitational attraction remains the same -- but only if you are far away. For example, the surface gravity of Sol, our sun, is $274$ $ m/s^2$, about 28 times the surface gravity of Terra, which is $9.8$ $ m/s^2$.
{ "domain": "physics.stackexchange", "id": 30195, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "forces, gravity, black-holes", "url": null }
.... And $$\ln (-1) = \{(2k+1)\pi i\}$$. So $$\pi i$$ is one of the natural logs of $$-1$$. .... But $$3\pi i$$ is another one. ..... Now sometime very soon, you will find some wise guy giving you a "proof" that $$0 = 1$$. It goes like this: $$1 = 1$$ $$(-1)^2 = 1$$ $$(e^{\pi i})^2 = 1$$ $$e^{2\pi i} = 1$$ $$e^{2\pi i} = e^0$$ so $$\ln e^{2\pi i} = \ln e^0$$ $$2\pi i = 0$$ $$\frac {2\pi i}{2\pi i} = \frac 0{2\pi i}$$ so $$1 = 0$$. Dont fall for it! ====== Oh, I guess I should explain why if $$e^w = a+ bi$$ then $$e^{w+i2k\pi} = e^w\cdot e^{i2k\pi} = a+ bi$$. (Its because $$e^{i2k\pi} = 1$$). And I should probably explain why all $$a+bi \ne 0$$ can be written as $$a+bi = re^{i\theta}$$ where $$r$$ is a positive real number and $$\theta$$ is an angle.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9833429580381723, "lm_q1q2_score": 0.8084938938164636, "lm_q2_score": 0.8221891327004132, "openwebmath_perplexity": 220.3536927278886, "openwebmath_score": 0.9058908820152283, "tags": null, "url": "https://math.stackexchange.com/questions/3790971/what-is-ln-1-how-is-lnx-defined-on-the-negative-complex-numbers" }
machine-learning, bigdata Title: What are the ways to partition a large file that does not fit into memory so it can later be fed as training data? Is there any other way to partition a large file that does not fit into memory so it can be fed as training data other than using spark? or hadoop? Yes, of cause. But, it's insignificant, because Spark and Hadoop are better. This is my idea. Suppose that your memory can take in 100,000 examples. So splitting your data set to files with size lower than 100,000. The key and most complex step is how to train classify with those data. Good luck, For Gradient descent series optimization algorithms (GB, SGD and so on), most algorithms (SVM, GBDT, Bayes, LR, deeplearn and so on) support this. You could load one file to RAM and fed them to classifier until to find the best parameter. My code is very simple. Before each iteration, re-shuffling the order of simples and re-splitting data set will boost the classifier. import numpy as np
{ "domain": "datascience.stackexchange", "id": 4880, "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, bigdata", "url": null }
electrostatics, capacitance Title: How does the charge accumulate inside a parallel plate capacitor? I couldn't properly understand, how is it so that if I have a parallel plate capacitor, in which one plate has $+Q$ charge and another has $-Q$ charge then all the charge on the first plate will accumulate on that side where it is facing the other plate, and same for the second plate i.e. it will accumulate on the side where it is facing the first plate. My Teacher was teaching, the class about parallel plate capacitors and he just, told it (the charge distribution I described above) will be so. But I couldn't understand how or why will the charges accumulate on just 1 face of each plate ? The opposite charge between the plates attract each other so will try and be as close together as possible. The closest location on a plate to the other plate is on the side of the plate facing the other plate.
{ "domain": "physics.stackexchange", "id": 71710, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electrostatics, capacitance", "url": null }
quantum-field-theory, mathematical-physics, group-theory, representation-theory, grand-unification Title: Triality and charge I have a few questions about triality for the representations of $SU(3)$. (I have seen the wikipedia page, but it does not make the connection with physics.) What is triality, how can you compute it from the dynkin labels? What has triality to do with the fractional charges of quarks? Why does the fact that $\overline{\underline{6}}$ has the same triality as $\underline{3}$ implies that we cannot have quarks in the irreps of the subgroup $SU(3)\times G_2$ of $E_6$? These questions arises from the follows paragraph in the text "Group theory for unified model building" by Slanksy (on page 98):
{ "domain": "physics.stackexchange", "id": 14039, "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, mathematical-physics, group-theory, representation-theory, grand-unification", "url": null }
Math_QED Homework Helper 2019 Award Now you've solved it, may I just ask for clarification of this step please? I can't see what operation you performed here. It appears to me that you should get $z = iz + 3i + 7 \iff z - iz = 3i + 7$ and your line suggests to me that z=0 ? Typo, I accidentally left out the z left. Your correction is right. I corrected that post. Thanks. SammyS Staff Emeritus Homework Helper Gold Member Great, now I can't solve it any more! Last edited: Thanks for all the good suggestions :)! Starting to like doing math with complex numbers :) Last edited: SammyS Staff Emeritus Homework Helper Gold Member Thanks for all the good suggestions :)! Starting to like doing math with complex numbers, been struggling with another one though, not sure if I should make a new thread or keep it within this one? ... Cheers! fresh_42 Mentor Thanks for all the good suggestions :)! Starting to like doing math with complex numbers :) sign error #### Attachments
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9539660962919971, "lm_q1q2_score": 0.8463631085708448, "lm_q2_score": 0.8872045996818986, "openwebmath_perplexity": 933.1739845281085, "openwebmath_score": 0.7914955019950867, "tags": null, "url": "https://www.physicsforums.com/threads/complex-numbers-in-equations.954221/" }
mechanical-engineering, fluid-mechanics I'm not sure what you would use $l_a$ for, but if you're trying to equlibrate torques, it's easier to just calculate the torque due to the pressure (which you do in order to find $l_a$ anyway) So I'm going to start from your calculations and note the errors in bold. Throughout your calculation you've used the center dot to indicate scalar multiplication, while also using implied multiplication. Generally if the center dot is not everywhere, then it implies the dot product of vectors, so I've removed all instances. The actual torque is: $$\tau = \int \vec{l} \times \vec{n} \, p \, \mathrm{d}A$$ Where $\vec{n}$ is the vector normal to the surface, and $\vec{l}$ is the vector to the integrating point from axis A. As these vectors will always be perpendicular we can simplify using $l$ as the distance to point A. $$\tau = \int l \, p \, \mathrm{d}A$$ $$\tau = \int_{l_0}^{l_1} \int_0^b \! l \, p \, \mathrm{d}y\mathrm{d}l$$ At this point I'd integrate over y to get:
{ "domain": "engineering.stackexchange", "id": 337, "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": "mechanical-engineering, fluid-mechanics", "url": null }
thermodynamics, temperature, water, physical-chemistry Using 'PaulT' suggestion (comments) the heat balance by replacing some of the bath water with boiling water is: $$(300-m_{add})cT_{bath}+m_{added}cT_b=300cT_f$$ Thus: $m_{add}=34.5\:\mathrm{Gall}$.
{ "domain": "physics.stackexchange", "id": 28204, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "thermodynamics, temperature, water, physical-chemistry", "url": null }
c#, performance, sql, sql-server, database Performance-wise, this can't be helping: foreach (DataRow row in ds.Tables[0].Rows) { try { Do whatever it takes to avoid throwing and catching exceptions in a loop. And you probably don't want to catch System.Exception here, but something much more specific, that you should avoid having thrown any way. If you're catching exceptions repeatedly in that loop, chances are that you have a very much avoidable bottleneck there. Catching System.Exception is one thing; swallowing it is another - now if anything goes wrong, you have no idea what happened, where, why, or how. This is just plain weird: result.Append("The database permissions of the user in SQL Server Management Studio and the LoginDatabase table are perfectly synced and up to date."); SSMS is just a client; the permissions are in the database, not in SSMS.
{ "domain": "codereview.stackexchange", "id": 15983, "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, sql, sql-server, database", "url": null }
ros, depth-registered Comment by max_ros on 2021-12-30: Hi @lucasw, thanks for the quick answer and your thoughts! I edited the question to provied the info you asked for. As the shown frames look fairly reasonable on the grid, I also don't think tf2_static_publisher is the problem... Comment by lucasw on 2021-12-30: Try setting the monochrome camera distortion to all zeros like the other cameras- that final distortion coefficient of -25 doesn't seem right. Another test of the monochrome camera calibration is to put the monochrome camera through the image rectification nodelet to see if the undistorted output looks reasonable. The monochrome camera fx/fy parameters of 1649 (where the other cameras look to have much wider angles-of-view) makes me wonder if that camera is pointed at small part of the depth image where there are no depth points. Or are there depth values covering the whole image? Comment by max_ros on 2021-12-30: Monochrome camera calibration:
{ "domain": "robotics.stackexchange", "id": 37299, "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, depth-registered", "url": null }
Order mode indicator, specified as 'absolute' or 'relative'. This indicator specifies whether to use absolute or relative order when computing the Taylor polynomial approximation. Absolute order is the truncation order of the computed series. Relative order n means that the exponents of var in the computed series range from the leading order m to the highest exponent m + n - 1. Here m + n is the exponent of var in the O-term: O(varm + n). collapse all ### Taylor Series Expansion A Taylor series expansion represents an analytic function f(x) as an infinite sum of terms around the expansion point x = a: $f\left(x\right)=f\left(a\right)+\frac{{f}^{\prime }\left(a\right)}{1!}\left(x-a\right)+\frac{{f}^{″}\left(a\right)}{2!}{\left(x-a\right)}^{2}+\dots =\sum _{m=0}^{\infty }\frac{{f}^{\left(m\right)}\left(a\right)}{m!}\cdot {\left(x-a\right)}^{m}$ A Taylor series expansion requires a function to have derivatives up to an infinite order around the expansion point.
{ "domain": "mathworks.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9854964207345894, "lm_q1q2_score": 0.8613999753862738, "lm_q2_score": 0.8740772236840656, "openwebmath_perplexity": 1100.1087606421559, "openwebmath_score": 0.9329606294631958, "tags": null, "url": "https://in.mathworks.com/help/symbolic/sym.taylor.html" }
So, lets approximate our function in a series of countable steps. Firstly, let $f_1 = S(1/3, 2/3)$. The greatest distance from a point with positive function value is now $1/3 = \delta_1$. Let $f_2 = f_1 - (S(1/9, 2/9) + S(7/9, 8/9))$. Now, the greatest distance from a point in $x\in [0, 1]$ with $f_2(x) = 0$ to a point with $y\in [0, 1]$ with $f_2(y)<0$ is now $1/9 = \delta_2$. Proceeding in this way, we would next add $4$ spikes to get $f_3 = f_2 + \sum_{i = 1, 7, 19, 25} S(i/27, (i+1)/27)$, and $\delta_3 = 1/27$, subtract $8$ spikes to get $f_4$ I claim that the limit of the $\{f_n\}$ exists, is well defined, and satisfies your conditions because the $\delta_n\to 0$. Completed as a pennance for not reading the question properly.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9886682478041813, "lm_q1q2_score": 0.8517754649048597, "lm_q2_score": 0.86153820232079, "openwebmath_perplexity": 120.38020162360674, "openwebmath_score": 0.9193094968795776, "tags": null, "url": "https://math.stackexchange.com/questions/1415237/is-there-a-continuous-function-from-0-1-to-mathbb-r-that-satisfies/1415256" }
ros, ros2, ros-melodic, ros-kinetic Originally posted by Py on ROS Answers with karma: 501 on 2019-11-03 Post score: 0 Yeah, sorry about that. Looking at future distro information is a little hard to find unless you know where to look. Noetic (last ROS1 distro) will be targeting Ubuntu 20 (https://github.com/ros-infrastructure/rep/pull/202/files#diff-41ae062315c36c45afaa5c192b2ca7c5R346) ROS2 will still be Bionic (Ubuntu 18) https://github.com/ros/rosdistro/blob/master/eloquent/distribution.yaml#L7 So 19 is not supported directly by either at this point. Originally posted by stevemacenski with karma: 8272 on 2019-11-03 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by gvdhoorn on 2019-11-04: The wiki/Distributions page does contain information on current releases and links to REP 3. It doesn't show what is being targeted for future releases though, so you'd have to look at the PRs against ros-infrastructure/rep for that. Perhaps that could be added. done: diff. Edit:
{ "domain": "robotics.stackexchange", "id": 33960, "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, ros-melodic, ros-kinetic", "url": null }
visible-light, waves, electromagnetic-radiation Title: Color filters that subtract just one color? Below is how your normal color filters work: They let only a single color/wavelength pass. But if this is used say in photography everything would just look very blue with a blue filter, like below:
{ "domain": "physics.stackexchange", "id": 41624, "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": "visible-light, waves, electromagnetic-radiation", "url": null }
Is this the right way to approach this problem? I'm not certain that the above argument is entirely correct, and would really appreciate some pointers in the right direction. Many thanks! 2. Originally Posted by gusztav Hello, I would be extremely grateful for any help with this problem: Let $r,n,k \in \mathbb{N}$ be numbers such that $r \geq (n-3) \cdot k$ and $n \geq 5$. Find the number of ways we can put $r$ indistinguishable balls into $n$ distinguishable boxes, so that: -exactly three boxes remain empty, -two boxes contain exactly $k$ balls, and that -each of the remaining boxes has at least $k$ balls. [snip] PaulRS and Gustav,
{ "domain": "mathhelpforum.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9859363729567546, "lm_q1q2_score": 0.8014354461046698, "lm_q2_score": 0.8128673087708699, "openwebmath_perplexity": 183.4668547516302, "openwebmath_score": 0.8446630239486694, "tags": null, "url": "http://mathhelpforum.com/discrete-math/56872-balls-boxes-problem.html" }
differential-geometry, gauge-theory, group-theory, topological-field-theory, chern-simons-theory \begin{align} \int d^3x \, \delta w(g) = \frac{1}{24 \pi^2} \epsilon^{\mu \nu \rho} \int d^3 x \, 3 \partial_{\mu}\mathrm{Tr} \left[(f^{-1} \delta f) f^{-1} \partial_{\nu} f f^{-1} \partial_{\rho} f \right]. \end{align} Using Stokes' theorem and requiring that the variation $\delta f$ vanishes at the boundary (or equivalently, considering a manifold without a boundary, which is the case for $S^3$), we see that \begin{align} \int d^3 x \, \delta w(g) =0. \end{align} Thus we see that the winding number is unaffected by small variations of the mapping. Now, in order to complete the proof, we will use the fact that maps between $S^3$ and $SU(2)=S^3$ are classified by the third homotopy group of the sphere $\pi_3(S^3)= \mathbb{Z}$. This means that the function $f$ can only wrap around the $SU(2)$ an integer number of times and so the integral $\int_{\mathcal{M}} f^* \omega$ can yield only an integer number times $\int_{SU(2)} \omega.$ The above example only shows that
{ "domain": "physics.stackexchange", "id": 68576, "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": "differential-geometry, gauge-theory, group-theory, topological-field-theory, chern-simons-theory", "url": null }
quantum-field-theory, harmonic-oscillator Obviously, pushing on the mass labeled by a in the mattress corresponds to adding a term such as $J_a(t) q_a$ to the potential V. I don't understand the factor $q_a$ in that term. If the matress is completely at rest, then $q_a=0$ for all points. So this term would vanish, regardless how strong the source $J_(t)$ is. What am I missing? One adds $Jq$ to the Lagrangian (or Hamiltonian). In deriving the equations of motion for $q$, one takes a partial derivative of the Lagrangian with respect to $q$. Thus adding $Jq$ to the Lagrangian adds $J$ (without $q$) to the equation of motion. The configuration $q=0$ is then (usually) no longer a solution of the equations of motion.
{ "domain": "physics.stackexchange", "id": 25657, "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, harmonic-oscillator", "url": null }
c++, makefile obj/KnightMovesImplementation.o: $(SRC_DIR)KnightMovesImplementation.cpp \ $(SRC_DIR)KnightMoves.h $(SRC_DIR)KMMethodLimitations.h $(SRC_DIR)KMBaseData.h \ $(SRC_DIR)KnightMovesImplementation.h $(SRC_DIR)KMPath.h \ $(SRC_DIR)KMMethodLimitations.h $(SRC_DIR)KMBaseData.h \ $(SRC_DIR)KnightMovesImplementation.h $(SRC_DIR)KMPath.h \ $(SRC_DIR)KMBoardLocation.h $(SRC_DIR)KMMove.h $(SRC_DIR)KMOutputData.h \ $(SRC_DIR)KMMoveFilters.h $(SRC_DIR)KMBoardDimensionConstants.h obj/KnightMovesImplementation.o: $(SRC_DIR)KnightMovesImplementation.cpp \ $(SRC_DIR)KnightMoves.h $(SRC_DIR)KMMethodLimitations.h $(SRC_DIR)KMBaseData.h \ $(SRC_DIR)KnightMovesImplementation.h $(SRC_DIR)KMPath.h \ $(SRC_DIR)KMBoardLocation.h $(SRC_DIR)KMMove.h $(SRC_DIR)KMOutputData.h \ $(SRC_DIR)KMMoveFilters.h $(SRC_DIR)KMBoardDimensionConstants.h $(SRC_DIR)KnightMoves.h: $(SRC_DIR)KMMethodLimitations.h: $(SRC_DIR)KMBaseData.h: $(SRC_DIR)KnightMovesImplementation.h: $(SRC_DIR)KMPath.h:
{ "domain": "codereview.stackexchange", "id": 20682, "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++, makefile", "url": null }
optics, visible-light, reflection Edit: (Credit @BenjaminFranz for pointing this out) The regulatory mechanism does not consist of only the iris/pupil. The retina also does a lot of regulation, which is why it takes half a minute or more to get used to a dark room, whereas our irises can dilate within a few seconds.
{ "domain": "physics.stackexchange", "id": 2405, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "optics, visible-light, reflection", "url": null }
mechanical-engineering, mechanical, pulleys Title: Bushed 3" V-belt pulley with unkeyed 3/4" shaft? Shortly I will have two 3/4" unkeyed shafts needing 3" type-A V-belt pulleys, one each. They'll each have their own motor driving them, and will need to run to 5000 RPM and possibly higher in the future. Is anyone making pulleys for keyless bushings? Or will vibration be reasonable using H-type bushings with compatible pulleys while ignoring the keyways? Here are four shaft connection methods. Figure 1. Image source: PTI International. I've used something like the Adaptor style successfully. The ones I used had a slot cut on the shaft clamp. The inner and outer ring are conical fit and as you tighten them up they pull together progressively squeezing on the shaft. They're a nice job.
{ "domain": "engineering.stackexchange", "id": 4259, "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": "mechanical-engineering, mechanical, pulleys", "url": null }
terminology, graphics Title: What's the difference between all these terms? What's the difference between them - Physically based simulation, Physically based animation, Physical simulation for computer animation, Physically based animation for Computer graphics, Physically based modelling for interactive simulation and games and Cognitive modelling ? These terms are not precisely defined and may overlap, but I think the following are both useful and non-controversial:
{ "domain": "cs.stackexchange", "id": 4571, "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": "terminology, graphics", "url": null }
textbook-and-exercises, linear-algebra Title: Is the norm of a inner product symmetric? I was reading about the Inversion Test and during the derivation (in Machine Learning with Quantum Computers, Schuld and Petruccione) I find the follwing: Assume we have $|a\rangle = A|0\rangle$ and $|b\rangle = B|0\rangle$. For the inversion test, run $B^\dagger A|0\rangle$ and measure. The probability of measuring a $|0\rangle$ is given by $|\langle 0 | (B^\dagger A|0\rangle)|^2$. Hence, the expectation value of the projective measurement $M = |0\rangle \langle 0|$ would be (this is a bit confusing, but not the point of this question): $$ \langle 0 |A^\dagger B (|0\rangle \langle 0) | B^\dagger A | 0 \rangle \\ = \langle 0 |A^\dagger B|0\rangle \; \langle 0 | B^\dagger A | 0 \rangle \\ = |\langle 0 | B^\dagger A |0\rangle|^2 \\ = |\langle a| b \rangle|^2 $$ It is the last step I find puzzling, because I believe it should be (since $A|0\rangle = a$ and $\langle 0| B^\dagger = \langle b|$): $$ ... = |\langle b| a \rangle|^2 $$
{ "domain": "quantumcomputing.stackexchange", "id": 3735, "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": "textbook-and-exercises, linear-algebra", "url": null }
ros, gazebo, timestamp, ros-kinetic subscribe to "/scan" topic when a scan is received, listen to the camera pose at that time istant and publish the odom->map transform to "close" the tree The main problem is that there is a delay between the moment the callback is executed and the laser scan timestamp. So, what should happen is that the pose that I get from Gazebo is more new w.r.t. to camera_link->odom transform. A better solution would be to use message_filters::Synchronizer, but since gazebo_msgs/LinkStates is not stamped, this is not possible. My question is: is it possible (perhaps through a Gazebo plugin) to attach a timestamp to the gazebo_msgs/LinkStates message? Of course also better solutions are welcome :) Thanks. Originally posted by schizzz8 on ROS Answers with karma: 183 on 2018-06-22 Post score: 0 Wouldn't this be a job for gazebo_ros_p3d? See #q222033. Edit: No. This publishes the robot odometry. Which is different from the robot pose wrt the gazebo world.
{ "domain": "robotics.stackexchange", "id": 31073, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, gazebo, timestamp, ros-kinetic", "url": null }
opencv2 Originally posted by arebgun with karma: 2121 on 2011-07-08 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 6075, "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": "opencv2", "url": null }
• I should have mentioned that it is by Jensen's inequality. The statement is in en.m.wikipedia.org/wiki/Jensen%27s_inequality. @Dr. Mathva – Song Dec 13 '18 at 23:44
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9835969698879862, "lm_q1q2_score": 0.8771826370558871, "lm_q2_score": 0.8918110404058913, "openwebmath_perplexity": 480.8203853774128, "openwebmath_score": 0.827904999256134, "tags": null, "url": "https://math.stackexchange.com/questions/3023032/finding-the-minimal-number-of-members" }
classical-electrodynamics, plasma-physics two linearly polarized waves with different phase velocities and amplitudes. One with a polarization parallel and one with a polarization vertical to the magnetic field. Because of this, the phase difference of the waves changes along z in the plasma producing an elliptical polarization of the composite wave which changes direction and ellipticity along z. Finally, in general, an elliptically polarized wave exits the slab with constant ellipticity and polarization. A detailed discussion would involve external and internal reflections, which however would not change the qualitative outcome.
{ "domain": "physics.stackexchange", "id": 33404, "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-electrodynamics, plasma-physics", "url": null }
python, strings, python-3.x, formatting Title: Formatting a string in Python with three possible replacement fields I'm looking for a much simpler way of formatting a string in Python which will have a different number of replacement fields in different cases. Here's what I'm doing now, which is working fine: if '{yes}' in reply and '{value}' in reply: reply = reply.format(yes=get_yes(), value=value) elif '{no}' in reply and '{value}' in reply: reply = reply.format(no=get_no(), value=value) elif '{yes}' in reply: reply = reply.format(yes=get_yes()) elif '{no}' in reply: reply = reply.format(no=get_no()) elif '{value}' in reply: reply = reply.format(value=value) The only problem is that this code has a Cognitive Complexity of 11 on Code Climate, which is higher than the allowed value of 5, and so I'm trying to find out a way of reducing it. Additional information about variables and methods reply is a string with will have one of the following combinations of replacement fields:
{ "domain": "codereview.stackexchange", "id": 28409, "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, strings, python-3.x, formatting", "url": null }
homework-and-exercises, moment-of-inertia Title: Moment of inertia question If we have five identical rigid rods, each of length l and mass m, are connected together to form the system shown in the figure. The system may rotate about an axis passing through AB. The question is to find the moment of inertia of the system with respect to axis AB. So what I did considered BC as a rod rotating about its end. I then considered DC as a mass connected to BC (but I doubt this one) And the rest I do not know how to consider them. I would appreciate some guidance on how to think of moment of inertia in this problem. The missing piece you need is The Parallel Axis Theorem, which is incredibly useful for calculating moments of intertia in general. Let us know if you still have specific issues (e.g. how to implement this).
{ "domain": "physics.stackexchange", "id": 19684, "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, moment-of-inertia", "url": null }
machine-learning, time-series I would recommend 1) obtaining at least one year's worth of data if possible (though the longer, the better) and then 2) running an autocorrelation function on the time series to determine if a seasonal factor is indeed present. If it is not, then attempting to forecast future fruit prices using time series methods is likely to prove unsuccessful - prices for many commodities are subject to a strong degree of stochasticity (randomness) and this may be no exception. Additionally, you are likely to find that forecasting error will be larger over shorter-term horizons given randomness. For instance, you might find that training the model on 12 months of data and then forecasting one month ahead is subject to less error than attempting to forecast using daily data.
{ "domain": "datascience.stackexchange", "id": 12184, "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, time-series", "url": null }