text
stringlengths
1
1.11k
source
dict
java, performance, object-oriented, graphics // gameManager protected GameManager gameManager; // worldManager protected WorldManager worldManager; public GameState(GameManager gameManager) { this(gameManager, null); } public GameState(GameManager gameManager, WorldManager worldManager) { this.gameManager = gameManager; this.worldManager = worldManager; } public abstract void init(); public abstract void update(); public abstract void controllerUserInput(); public abstract void changingState(); } My game works fine, but with this code, my objects on the screen visibly lag. Can I get a performance review of my code? Java You tabbing, makes your code less readable, after every bracket { you should be indenting the following lines } break; } else { break; looks like you're going to break either way, how bout doing this } break;
{ "domain": "codereview.stackexchange", "id": 7833, "lm_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, object-oriented, graphics", "url": null }
& 4.55 & 1822.65 & 0.75 & 150.00 & 4.42 & 1821.51 \\ 200.00 & 5.06 & 2027.71 & 0.75 & 150.00 & 4.93 & 2026.44 \\ 200.00 & 5.57 & 2233.28 & 0.75 & 150.00 & 5.44 & 2231.88 \\ 200.00 & 6.08 & 2439.36 & 0.75 & 150.00 & 5.95 & 2437.84 \end{tabular}$$ $$\displaystyle \noindent \small {Sceond data set. Months 349-360}\\ \begin{tabular}{lllllll} 1 & 2 & 3 & 4 & 5 & 6 & 7 \\ \hline 200.00 & 278.06 & 111500.59 & 0.75 & 150.00 & 277.76 & 111431.07 \\ 200.00 & 279.25 & 111979.84 & 0.75 & 150.00 & 278.95 & 111910.02 \\ 200.00 & 280.45 & 112460.29 & 0.75 & 150.00 & 280.15 & 112390.17 \\ 200.00 & 281.65 & 112941.94 & 0.75 & 150.00 & 281.35 & 112871.52 \\ 200.00 & 282.85 & 113424.79 & 0.75 & 150.00 & 282.55 & 113354.08 \\ 200.00 & 284.06 & 113908.85 & 0.75 & 150.00 & 283.76 & 113837.84 \\ 200.00 & 285.27 & 114394.13 & 0.75 & 150.00 & 284.97 & 114322.81 \\ 200.00 & 286.49 & 114880.61 & 0.75 & 150.00 & 286.18 & 114808.99 \\ 200.00 & 287.70 & 115368.31 & 0.75 & 150.00 & 287.40 & 115296.39 \\ 200.00 &
{ "domain": "0calc.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9787126444811033, "lm_q1q2_score": 0.8503317417955442, "lm_q2_score": 0.8688267660487573, "openwebmath_perplexity": 421.94371016368615, "openwebmath_score": 0.999707818031311, "tags": null, "url": "https://web2.0calc.com/questions/11-you-deposit-200-each-month-into-an-account-earning-3-interest-compounded-monthly-a-how-much-will-you-have-in-the-account-in-30-years" }
c#, programming-challenge, time-limit-exceeded, matrix, chess var queen = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse); var obstacles = new Tuple<int, int>[countObstacles]; for (int i = 0; i < countObstacles; i++) { var obstacle = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse); obstacles[i] = new Tuple<int, int>(obstacle[0] - 1, obstacle[1] - 1); }
{ "domain": "codereview.stackexchange", "id": 24132, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, programming-challenge, time-limit-exceeded, matrix, chess", "url": null }
intermolecular-forces, phase, sublimation So, at a given temperature, if the atmospheric pressure is low enough, any substance will go from solid to gas (i.e sublime), without having a chance to melt (so to speak). To gain a better understanding of this process, I urge you to look at a phase diagram. (this particular one is for carbon dioxide, easier to find than iodine's the principal remains the same.)
{ "domain": "chemistry.stackexchange", "id": 15843, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "intermolecular-forces, phase, sublimation", "url": null }
genetics, human-genetics The cause for the high Bilirubin levels in the blood of Thalassemia patients is the abnormal high rate of Hemoglobin breakdown.
{ "domain": "biology.stackexchange", "id": 9761, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "genetics, human-genetics", "url": null }
#### Alexmahone ##### Active member Because you told us nothing about $A\text{ or }B$. A and B are 2 arbitrary sets. #### Plato ##### Well-known member MHB Math Helper A and B are 2 arbitrary sets. $$\left( {\forall x \in \mathcal{ U}} \right)\left[ x \notin A\cap B \right]$$. #### Deveno ##### Well-known member MHB Math Scholar if for ALL x in A, x is not in B, that would be sufficient. why? because that asserts that A is a subset of A - B = A - A∩B. since A - B is automatically a subset of A, we get immediately that A = A - B = A - A∩B, hence A∩B = Ø (if y was in A∩B, then y would not be in A-B, a contradiction since A = A-B). however, you have to be careful. just picking "some" x in A, and showing it is not in B, just shows x is in A-B, which can happen when A and B are not disjoint. the choice of x has to be completely arbitrary (a "for all" choice, not a "there exists" choice).
{ "domain": "mathhelpboards.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9688561694652216, "lm_q1q2_score": 0.8215587886283325, "lm_q2_score": 0.8479677526147223, "openwebmath_perplexity": 524.9395059144684, "openwebmath_score": 0.8272367119789124, "tags": null, "url": "https://mathhelpboards.com/threads/prove-that-a-and-b-are-disjoint.750/" }
electromagnetic-radiation, fiber-optics Title: Does light travel forever in a medium? Light will travel forever in a vacuum. What about light in a medium? Does it travel forever too, but at a slower rate. Let’s say I run a fiber optic cable across the universe. I know it will travel slower in the cable, but will it eventually stop, or will it continue across the universe? Even the best optical fiber has some attenuation. The very popular SMF-28 type, for example, has a maximum attenuation of 0.18 dB/km at 1550 nm, which is the optimum wavelength for attenuation. That means that after a mere 1000 km, the power that entered the fiber will be reduced by 180 dB. If you started with 1 W, you'd have only an attowatt remaining. Whether you consider an arbitrarily large attenuation factor "stopped" or not is a semantic choice, but practically it means no receiver in the world could detect your signal after even 1000 km.
{ "domain": "physics.stackexchange", "id": 47788, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetic-radiation, fiber-optics", "url": null }
fourier-transform Title: Intel oneAPI MKL (Fourier Transform Functions) I am learning the Fourier transform from examples and one particular statement in the comment, According to the Fourier Transform theory, FFT result is sized N/2+1 for 1D FFT... in the below link to the example https://www.intel.com/content/www/us/en/developer/articles/technical/use-onemkl-with-opencv-for-fft-calculation.html?wapkw=mkl_malloc%20MKL_complex16 is not clear at all. Why the resulting FFT size is N/2+1 and what theory do they refer? This complete comment is for the quick reference
{ "domain": "dsp.stackexchange", "id": 11482, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fourier-transform", "url": null }
python, windows with open(filepath, "w") as f: f.write(shebang + comment + imports + logging + functions + main) print("Created .py file: {}".format(filepath)) def open_py_idle(filename: str): """Opens a .py file in IDLE using subprocess""" idle_path = r"C:\Users\Dave\AppData\Local\Programs\Python\Python35" +\ r"-32\Lib\idlelib\idle.bat" subprocess.run([idle_path, filename], shell=True) def main(): """Creates .bat and .py file in cwd. Auto opens .py file""" filename = handle_input() cwd = os.getcwd() python_file = os.path.join(cwd, filename + ".py") # ensure an existing python file is not overwritten if not os.path.exists(python_file): # make .bat file named "filename" in cwd make_batch(filename, cwd) # make .py file make_py(python_file) # open .py file in idle open_py_idle(python_file) else: print("\n.py file already exists: {}".format(python_file))
{ "domain": "codereview.stackexchange", "id": 23341, "lm_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, windows", "url": null }
general-relativity, string-theory Title: Why String theory introduced in cosmological models to study nature of universe? Why String theory ? simple cosmological model is not sufficient for study of nature of universe A simple cosmological model has nothing to predict about the fate of collision of particles at high energies, or any other question about short-distance physics, for that matter. To describe the Universe not just in a broad macroscopic sketch, but also in the microscopic details, one needs a quantum theory, and string theory is the only known consistent theory that reconciles particle physics (such as gauge theories with chiral fermions) and general relativity (the latter including cosmological models).
{ "domain": "physics.stackexchange", "id": 500, "lm_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, string-theory", "url": null }
java, game, xml if (!duplicateTags.isEmpty()) { throw new UncheckedCardLoadingException("Tags " + duplicateTags + " have been input multiple times, this is not allowed."); } } private List<Card> getValidatedCards(CardInfo cardInfo) { List<Card> cards = cardInfo.getCards().getCards(); List<String> duplicateIds = cards.stream() .collect(Collectors.groupingBy(Card::getId)) .entrySet() .stream() .filter(entry -> entry.getValue().size() > 1) .map(Entry::getKey) .collect(Collectors.toList()); if (!duplicateIds.isEmpty()) { throw new UncheckedCardLoadingException("Card ids " + duplicateIds + " are duplicaties, this is not allowed."); } return cards; }
{ "domain": "codereview.stackexchange", "id": 10470, "lm_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, game, xml", "url": null }
lagrangian-formalism, nuclear-physics, feynman-diagrams, scattering-cross-section I use the following Lagrangians to Describe the Interactions of the protons with the exchange mesons: \begin{equation} \begin{array}{c} \mathcal{L}_{\mathrm{NNps}}=-g_{p s} \bar{\psi} i \gamma_{5} \psi \varphi_{\mathrm{ps}} \\ \mathcal{L}_{\mathrm{NNs}}=-g_{s} \bar{\psi} \psi \varphi_{\mathrm{s}} \\ \mathcal{L}_{\mathrm{NNv}}=-g_{v} \bar{\psi} \gamma_{\mu} \psi \varphi_{\mathrm{v}}^{\mu}-\frac{f_{\mathrm{v}}}{4 M_{p}} \bar{\psi} \sigma_{\mu \nu} \psi \cdot\left(\partial^{\mu} \varphi_{\mathrm{v}}^{\nu}-\partial^{\nu} \varphi_{\mathrm{v}}^{\mu}\right) \end{array} \end{equation} Each proton described by the Dirac Spinor \begin{equation} u\left(\boldsymbol{q}, \lambda\right)=\sqrt{E+m}\left(\begin{array}{c} 1 \\ \frac{2 \lambda q}{E+m} \end{array}\right)\left|\lambda\right\rangle \end{equation} What i did is to calculate the Matrix Elements for each of these interaction in the C.O.M frame like this (i will only include the calculations on one vertex of the feynman diagrams)
{ "domain": "physics.stackexchange", "id": 79202, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "lagrangian-formalism, nuclear-physics, feynman-diagrams, scattering-cross-section", "url": null }
ros, bash, permission, environment, ros-groovy Title: open shell bash permission denied Each time I open a new shell window, I get the following: “source: command not found bash: /opt/ros/groovy/setup.bash: Permission denied I get this problem trying to setup ROS Groovy environment on Ubuntu 12.10 Originally posted by alfre7ra on ROS Answers with karma: 1 on 2013-03-27 Post score: 0 Please post the relevant lines you added to your ~/.bashrc (or other bash startup script). Looks like a typo. Originally posted by Boris with karma: 3060 on 2013-03-27 This answer was ACCEPTED on the original site Post score: 2
{ "domain": "robotics.stackexchange", "id": 13566, "lm_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, bash, permission, environment, ros-groovy", "url": null }
rna-seq, groupgo, clusterprofiler Title: groupGO parameters explanation (ont and level) I need to use groupGO in clusterProfiler to find functional profile of a list of genes, and I am having trouble finding out what some parameters of the function mean and which I should select for my specific case. The function is defined as: groupGO(gene, OrgDb, keyType = "ENTREZID", ont = "CC", level = 2, readable = FALSE)
{ "domain": "bioinformatics.stackexchange", "id": 528, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rna-seq, groupgo, clusterprofiler", "url": null }
c#, wpf, active-directory principal.Certificates, [DirectReportCity] = () => result.DirectReportCity = principal.GetCity(), [DirectReportComment] = () => result.DirectReportComment = principal.GetComment(), [DirectReportCompany] = () => result.DirectReportCompany = principal.GetCompany(), [DirectReportContext] = () => result.DirectReportContext = principal.Context, [DirectReportContextType] = () => result.DirectReportContextType = principal.ContextType, [DirectReportCountry] = () => result.DirectReportCountry = principal.GetCountry(), [DirectReportDelegationPermitted] = () => result.DirectReportDelegationPermitted = principal.DelegationPermitted,
{ "domain": "codereview.stackexchange", "id": 20538, "lm_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#, wpf, active-directory", "url": null }
circuits and with the latch, we introduce the clock. I will now give you two examples of where logical depth, in a system context, is not representative of speed. The first assumption that made is "0"s and "1"s are things. Digital is a special case of analog; however, I personally never run anything at a "1" because it is inefficient for power. After you are above threshold, you lose transistor gain. If you are trying to have power performance, you might not make the same choices as for speed performance. You are doing the same electrical work at a high total cost. The second assumption is that everything is clocked. In a system context, I often add logic to make things go faster. Asynchronous systems give you the average speed as a delay, instead of the worst case delay as a synchronous, clocked system.
{ "domain": "cs.stackexchange", "id": 12961, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "circuits", "url": null }
python, python-3.x, comparative-review Title: Comparison of two ways of looping in Python I wrote a small script to demonstrate two ways of looping in Python: with and without using the index. I want to know which way is better. Please see the example: #################################################################################################### # Imagine there is some registration info of some people and their nationalities # Stored in a Python dictionary people_nationality_info = {'person_1': 'UK', 'person_2': 'Iceland', 'person_3': 'France', 'person_4': 'Spain', 'person_5': 'Norway', 'person_6': 'Sweden', 'person_7': 'Denmark', 'person_8': 'Germany'}
{ "domain": "codereview.stackexchange", "id": 43983, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x, comparative-review", "url": null }
python, autocorrelation Title: Autocorrelation strange results? I'm trying to do autocorrelation with numpy in python but i'm getting strange results : For a simple 440Hz sine wave sample : This is the result of autocorrelation : Is this normal ? Maybe I'm not understanding everything UPDATE : Here is my code : def autocorrelation(signal): res = np.correlate(signal, signal, mode='same') res = res[len(res)//2:] plt.plot(signal) plt.show() plt.plot(res) plt.show() I think you have some overflow/underflow issues? At about 32768, there are signal glitches in the autocorrelation results. Could it be that your calculations are done on 16 bits?
{ "domain": "dsp.stackexchange", "id": 5227, "lm_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, autocorrelation", "url": null }
electric-circuits, electric-fields, solid-state-physics, electric-current, conductors The speed of the pulse is like the speed of electricity. The speed of the spring is like drift velocity. The speed of the pulse depends on the properties of the spring. A stiff spring has strong forces between the coils. A pulse travels faster in a stiff spring than a Slinky. Likewise in a light spring, the forces accelerate a small mass to a high velocity.
{ "domain": "physics.stackexchange", "id": 90207, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electric-circuits, electric-fields, solid-state-physics, electric-current, conductors", "url": null }
Remark: This related question here was unanswered ## 1 Answer If you only want upper bounds, there is a nice approach based on collisions. (Proving that the max-loaded bin is not too small w.h.p. seems to need completely different techniques.) Define a $$k$$-way collision to be a case of $$k$$ different balls that land in the same bin. For example, if they all land in the same bin, there are $${m \choose k}$$ total $$k$$-way collisions. Let $$C_k$$ be a random variable for the number of $$k$$-way collisions. The probability that a fixed set of $$k$$ balls collides is $$\sum_{i=1}^n p_i^k = \|p\|_k^k$$. Therefore $$\mathbb{E} C_k = {m \choose k} \|p\|_k^k$$. Now to upper-bound the chance that the max-loaded bin has $$\geq k$$ balls, we can use Markov's inequality:
{ "domain": "mathoverflow.net", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9911526462237642, "lm_q1q2_score": 0.8323045501453249, "lm_q2_score": 0.8397339736884711, "openwebmath_perplexity": 363.632968858698, "openwebmath_score": 0.9977673888206482, "tags": null, "url": "https://mathoverflow.net/questions/323711/concentration-of-the-load-of-the-maximally-loaded-bin-m-balls-n-bins-with" }
Given any of lots of pairs $\{a,b\}, \{d,e\}$, you can add a number to each to make matching sum and product. We want $$a+b+c=d+e+f\\abc=def\\f-c=a+b-d-e\\\frac fc = \frac {ab}{de}$$ and we can solve the last two to get $$c=(a+b-d-e)\frac 1{\frac {ab}{de}-1}\\f=(d+e-a-b)\frac 1{\frac {de}{ab}-1}$$ As long as $a+b \neq d+e$ and none are zero we have a solution. As long as the pair with the greater sum also has the greater product both $c,f$ will be positive. Well it can't be true for 2 values. $n >0,m>0$ then $nm>0$. Let $(n+k)+(m-k) = n+m$ and $(n+k)(m-k)=nm$ Then $nm +k (m-n) - k^2 = nm$ so $k (m-n)= k^2$. If $k \ne 0$ then $m-n=k$ so $m-k = n$ and $n+k=m$. If $k =0$ then $n+k=n$ and $m+k=m$. So $n,m$ are the only positive integers (indeed positive reals) where $a+b=n+m;ab=nm$. This shouldn't surprise us. It's just a restatement of the arithmetic mean vs geometric mean property. Can we extend that via induction? To be honest I'm not sure but I think we can.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9808759663238371, "lm_q1q2_score": 0.8195057157769696, "lm_q2_score": 0.8354835309589073, "openwebmath_perplexity": 375.2731529029612, "openwebmath_score": 0.9875301122665405, "tags": null, "url": "https://math.stackexchange.com/questions/1941758/sum-and-product-of-n-positive-integers" }
ros2, micro-ros Title: How to use micro-ROS for an Arduino DUE As the question states, I'm trying to get micro-ROS on an Aruino-DUE. I know it isn't an officially supported board, but it does have community support however I can't figure out how to install that version of micro-ROS. I'm very new so sorry if this is an obvious answer. Thank you you should setup micro-ros-setup on your ubuntu computer, and also download arduino ide image, download micro-ros-arduino library into the arduino ide, and try upload example to arduino due, if you want do with video I made a video about how to use micro-ros with esp32 board. https://www.youtube.com/watch?v=ggxNLKZqITU
{ "domain": "robotics.stackexchange", "id": 38720, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros2, micro-ros", "url": null }
pressure, atmospheric-science, weather, climate-science (iv) Winds redistribute mass between the air columns: air will move from high pressure points to low pressure points, so from column B to column A. The density change over time is $\frac{d\rho}{dt} = \sum\limits_{i} \rho \frac{dV_i}{dt}$. More mass in colder column A means that surface pressure is higher $p_A(0) > p_B(0)$ whilst at higher altitude, due to lower volume of colder air, we will still have $p_A(z) < p_B(z)$. So we will have horizontal winds from warm columns of air to colder columns of air at higher altitudes, and surface winds from colder columns of air to warmer columns of air. Since volume is conserved, the volume outflows at higher latitude in the warmer column must equate the volume inflows at lower latitude (and viceversa for the colder column of air) which means air also moves up in the warmer column and down colder column. This is exactly how a Hadley cell works!
{ "domain": "physics.stackexchange", "id": 92746, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "pressure, atmospheric-science, weather, climate-science", "url": null }
rviz, ros-groovy, osx, ogre /opt/ros/groovy/include/urdf_interface/link.h:38:2: warning: "Please Use #include <urdf_model/link.h>" [-W#warnings] #warning "Please Use #include <urdf_model/link.h>" ^ In file included from /Users/kevin/tmp/groovy2/src/rviz/src/rviz/robot/robot.cpp:39: /opt/ros/groovy/include/urdf_interface/model.h:38:2: warning: "Please Use #include <urdf_model/model.h>" [-W#warnings] #warning "Please Use #include <urdf_model/model.h>" ^ 2 warnings generated. [ 16%] Building CXX object src/rviz/CMakeFiles/rviz.dir/robot/tf_link_updater.cpp.o 1 warning generated. [ 16%] Building CXX object src/rviz/CMakeFiles/rviz.dir/scaled_image_widget.cpp.o [ 16%] Building CXX object src/rviz/CMakeFiles/rviz.dir/screenshot_dialog.cpp.o [ 17%] Building CXX object src/rviz/CMakeFiles/rviz.dir/selection_panel.cpp.o [ 17%] Building CXX object src/rviz/CMakeFiles/rviz.dir/selection/selection_handler.cpp.o [ 17%] Building CXX object src/rviz/CMakeFiles/rviz.dir/selection/selection_manager.cpp.o
{ "domain": "robotics.stackexchange", "id": 12433, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rviz, ros-groovy, osx, ogre", "url": null }
organic-chemistry, intermolecular-forces The lesson to learn here is that the entropy of the solvent can actually be very important when considering both the equilibrium arrangements of heterogeneous systems as well in chemical reactions. $\textbf{Bringing it All Together:}$ So, I hope you see what I mean when I said that noticing $\ce{C-H}$ and $\ce{C-F}$ bonds have almost identical intermolecular forces behave basically answers the question. When we consider explicitly the interactions of a substance with the ligands you have asked about (in comparison to a lipid), we see that dipole interactions might be a little stronger between the solvent and the ligand, but the ligand-ligand interactions should also be a bit stronger than in the lipid. So, again, $\Delta H\approx 0$. In contrast, the stronger dipole means that the solvent is more tied up, so the entropy change should increase (not accounting for the effect of the cube thing the ligands are mounted on).
{ "domain": "chemistry.stackexchange", "id": 8642, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "organic-chemistry, intermolecular-forces", "url": null }
quantum-mechanics, classical-mechanics, education, dimensional-analysis, commutator This isn't a perfect solution, because the students might assume that "commutation relations" means "between the position observable and the momentum observable," which is untrue in QED. That problem also has an easy solution, though, one that is strangely missing from the standard curriculum: After teaching non-relativistic QM and before teaching QED, teach non-relativistic QFT! Non-relativistic QFT a great pedagogical bridge for many reasons, and this is one of those reasons. Using non-relativistic QFT, where the math is easy, we can show students how the position-momentum commutation relation arises from the field-field commutation relation. From there, learning why we can't construct a strict position operator in the relativistic case — and why we can still get $E=\hbar\omega$ directly from the field-field commutation relation — should be a relatively easy conceptual step.
{ "domain": "physics.stackexchange", "id": 70566, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, classical-mechanics, education, dimensional-analysis, commutator", "url": null }
sorting, randomized-algorithms, permutations Title: Is there a "sorting" algorithm which returns a random permutation when using a coin-flip comparator? Inspired by this question in which the asker wants to know if the running time changes when the comparator used in a standard search algorithm is replaced by a fair coin-flip, and also Microsoft's prominent failure to write a uniform permutation generator, my question is thus: Is there a comparison based sorting algorithm which will, depending on our implementation of the comparator: return the elements in sorted order when using a true comparator (that is, the comparison does what we expect in a standard sorting algorithm) return a uniformly random permutation of the elements when the comparator is replaced by a fair coin flip (that is, return x < y = true with probability 1/2, regardless of the value of x and y)
{ "domain": "cs.stackexchange", "id": 1180, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "sorting, randomized-algorithms, permutations", "url": null }
probabilistic-algorithms, random-graphs This term doesn't look quite right for what I'm supposed to prove, does it? This answer shows an approach to the problem in the question. (Threshold of isolated vertices) Let $G(n,p)$ be a random graph with $n$ vertices and each edge is present with probability $p$ independently. Suppose that $p\le c{\log n}/n$ for some constant $c$. Then the possibility of the appearance of at least one isolated vertex in $G(n, p)$ goes to 1 when $n$ goes to infinity. Assume the above proposition on the threshold of isolated vertices holds. Applying it to the case of $G(2n, p+q)$ where $p+q\le c \log (2n)/2n$, we know the appearance of at least one isolated vertex goes to 1 when $2n$ goes to infinity. Since the random graph in the question has less edges than the random graph above, the appearance of at least one isolated vertex in the random graph in the question also goes to 1 when $n$ goes to infinity. (This loose argument can be made rigorous.)
{ "domain": "cs.stackexchange", "id": 13683, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "probabilistic-algorithms, random-graphs", "url": null }
gazebo Thank you~ Originally posted by sam on ROS Answers with karma: 2570 on 2011-08-09 Post score: 0 Original comments Comment by 130s on 2011-08-30: The result seems the same with my case (gazebo crashes, http://answers.ros.org/question/1882/gazebo-crashes-after-c-c-pr2_teleop), although the phenom might be different, which I'm not sure about because you haven't provided error output nor backtrace. Comment by sam on 2011-08-29: I have updated the origin post of second point. And I found that the third point is fixed by updating ROS. Comment by sam on 2011-08-12: Should I just copy and paste the message when crash or what file should I cat? Comment by hsu on 2011-08-12: Can you obtain a backtrace or coredump of the crash? Thanks. Comment by sam on 2011-08-09: Why I type 1,2,3 in sequence but it shows 1,1,1?I confused. When I reedit it, the edit box show that 1,2,3,but showing box show 1,1,1. To obtain a back trace of gazebo, please take a look at the troubleshooting pages.
{ "domain": "robotics.stackexchange", "id": 6378, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gazebo", "url": null }
homework, noise So my question is how do I determine the minimal SNR when I measure signal $S$ over time $t$, but the thing I am interested in is fluctuation (max 10%) in $S_y$. All constants are known to me, however i only know the mean of $C_y$, as it fluctuates and so $S_y$ does too. Thanks for any help. If I need to clarify any details please tell me and I will do so. This is a work-in-progress until more information is added to the question. First, I'm assuming that you know the magnitudes of your decaying exponentials, but you don't know their time constants (either $C_x$ or $C_y$) or your signal level $S_0$. Second, you say that there is Gaussian noise, but not whether it's additive. I'm going to assume it's additive. That means your signal is really: $$ S(t)=S_0(\frac{1}{20}e^{\frac{-t}{C_y}}+\frac{19}{20}e^{\frac{-t}{C_x}}) + n(t) $$ where $n(t)$ is additive, white, Gaussian noise with zero mean and variance $\sigma^2$.
{ "domain": "dsp.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": "homework, noise", "url": null }
temperature, earth, atmospheric-science, sun, weather Title: What causes the perceived intensity of the sun to change on a short timescale? I was inspired by this question to ask, what causes the "beating down" feeling of the sun to vary day to day? While the linked post explains why the sun feels hotter in the summer than in the winter, what causes more short term variations in the perceived intensity of the sun? Why does the sun often feel more intense on some days and less intense on others? Why can the sun often feel oppressively hot even when the air is cool, while other times the sun might feel pleasant even when the air is warm? Also related: Why is the sun brighter in Australia compared to parts of Asia? When you feel "heat" from the Sun, what you're actually feeling is the infrared radiation that the Sun emits. The reason infrared radiation feels hot is because your body is mostly water, and infrared radiation tends to vibrate the bonds of water molecules.
{ "domain": "physics.stackexchange", "id": 48114, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "temperature, earth, atmospheric-science, sun, weather", "url": null }
plasma-physics, sun, fusion Title: What should be the temperature in the star core center for helium to not be stable so only fermion soup is present? What should be the temperature in the star core center for helium to not be stable so only fermion soup is present? Of course, then there should be a distance from that center for fusion to be possible to build heavier elements. Binding energy of the nuclei When helium nuclei smash together, they don't usually go back to protons. In general, when small nuclei collide they tend to fuse and form bigger nuclei, not to divide. The reason can be understood by looking at this figure, which represents the average binding energy per nucleon as a function of atomic number.
{ "domain": "physics.stackexchange", "id": 81358, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "plasma-physics, sun, fusion", "url": null }
and $$\displaystyle \cos 2x = 1-2\sin^2 x$$ Now put into final solution of Integral • how my solution is different from yours? – Yogesh Tripathi Aug 11 '15 at 13:25
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9790357591818725, "lm_q1q2_score": 0.82005989472364, "lm_q2_score": 0.837619961306541, "openwebmath_perplexity": 736.3301952661021, "openwebmath_score": 1.0000098943710327, "tags": null, "url": "https://math.stackexchange.com/questions/1393098/why-i-am-getting-different-answer/1393158" }
java, csv, homework if(name == null || gender == null){ highestRankEver.add(-1); return highestRankEver; } for(File f : dr.selectedFiles()){ FileResource fr = new FileResource(f); nameRank = getRank(fr, year, name, gender); println("FileResource: "+fr); println("Name Rank: " + nameRank); for(Map.Entry<Integer, ArrayList<String>> entries : nameRank.entrySet()) { //highestRanking = entries.getKey(); println("Entries: " + entries); println("Entries key: " + entries.getKey());
{ "domain": "codereview.stackexchange", "id": 43271, "lm_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, csv, homework", "url": null }
thermodynamics, ideal-gas If the expansion is irreversible and adiabatic, the gas does less work, looses less internal energy and so there is entropy increase as the cooling is now not as large as when expansion is adiabatic and reversible, and so the two process, entropy increase due to expansion and decrease due cooling no longer match.
{ "domain": "chemistry.stackexchange", "id": 14717, "lm_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, ideal-gas", "url": null }
zoology, taxonomy, ichthyology, classification First you should have a look at this recent answer to get a short introduction to phylogeny. Phylogeny of animals Here is a basic tree of all animals
{ "domain": "biology.stackexchange", "id": 6184, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "zoology, taxonomy, ichthyology, classification", "url": null }
lab-techniques, electrophysiology, neurology From what I can tell the main thing driving price is the number of leads or sensors. They seem to range from 1 lead in consumer EEG toys to 100 leads, with a lot of products being advertised that have 16 or 24 leads. There are of course a lot of other features, so feel free to answer using either specific products or in terms of whatever features you've found important. I have been working with BCI since some time and would recommend you to try these ones. They all have been widely used in MS/PhD research and their results are more or less accepted everywhere:
{ "domain": "biology.stackexchange", "id": 5610, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "lab-techniques, electrophysiology, neurology", "url": null }
gym The Canadian AI startup montreal.ai had offered to maintain the gym website. However this offer was not taken up by open ai. This issue was discussed in depth on the following threads https://www.reddit.com/r/MachineLearning/comments/6zvlm2/d_openai_closing_down_gym_toolkit_website/?st=jca6ia3n&sh=48a0d8f3 https://github.com/openai/gym/issues/718
{ "domain": "ai.stackexchange", "id": 401, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gym", "url": null }
python, number-guessing-game turns = 1 computer_guess = randint(1, 10) while True: user_guess = raw_input("Guess Number: ") print 4-turns, "Turns left" if turns == 4: print "You lost!, LOOSER!" exit() else: if int(user_guess) == int(computer_guess): print "Congratulations, You won!\n" play_again = raw_input("Do You Want To Play Again? (Y / N): ") if play_again.upper() == 'Y': continue else: exit() else: turns += 1 print "Try again - N was ", computer_guess I’ll build on @zondo advices which are missing an important point: Use functions Not only they allow you to give a meaningfull name to a logical section, they also improve overall readability and let you test individual behavior easily. Out of your main loop, you can easily extract two functions: one that prompt the user for a (valid) number, and one that as the user if he wants to play again.
{ "domain": "codereview.stackexchange", "id": 19451, "lm_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, number-guessing-game", "url": null }
cc.complexity-theory, structural-complexity Because of these last two examples - especially sorting, where the standard proof is nonconstructive - it seems to me that the question may not just be about natural interpretations in terms of efficient algorithms, but also somehow about the constructiveness / effectiveness of the proofs of various complexity results (depending on what the OP had in mind). That is, the standard sorting lower bound is not constructive or algorithmic, but there is a constructive, algorithmic proof of the same result. [1] Atallah, M. J. and Kosaraju, S. R. An adversary-based lower bound for sorting. Inform. Proc. Lett. 13(2):55-57, 1981.
{ "domain": "cstheory.stackexchange", "id": 1728, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cc.complexity-theory, structural-complexity", "url": null }
21 Jan 2010, 02:49 Bunuel wrote: Bullet wrote: Can any body please explain Question No.3 using probability Why we need to add twice 7/10*6/9*3/8 + 7/10*6/9*5/8 = 7/15 Thanks and appreciated The solution you are posting for the third question is not right. Below is the solution of this question using the "probability". 3. A bag of 10 marbles contains 3 red marbles and 7 blue marbles. If three marbles are selected at random, what is the probability that at least two marbles are blue? Probability of at least two marble are blue is the sum of the two probabilities: A. Two marbles are blue and one is red - BBR. This can occur in $$\frac{3!}{2!}=3$$ # of ways, which is basically the # of permutations of three letters B, B, and R: BBR, BRB, RBB. $$3*\frac{7}{10}*\frac{6}{9}*\frac{3}{8}$$; B. All three marbles are blue - BBB. This can occur only one way, namely BBB. $$\frac{7}{10}*\frac{6}{9}*\frac{5}{8}$$
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. Yes\n2. Yes\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 1, "lm_q1q2_score": 0.8418256512199033, "lm_q2_score": 0.8418256512199033, "openwebmath_perplexity": 861.5667530124982, "openwebmath_score": 0.9170461297035217, "tags": null, "url": "https://gmatclub.com/forum/a-bag-of-10-marbles-contains-3-red-marbles-and-7-blue-56728.html" }
php, programming-challenge } /** * Parse input string and render canvas * * @param string $input raw, unparsed command * @return string multi line canvas grid OR input parse error message */ public function controller($input) { $this->command = substr($input, 0, 1); $output = ""; if(in_array($this->command, $this->supported_commands)) {
{ "domain": "codereview.stackexchange", "id": 8835, "lm_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, programming-challenge", "url": null }
acoustics, explosions Also, note, explosion usually means detonation. A detonation is an exothermic reaction which spreads by the compression (adiabatic) heating from the shockwave, and the chemical energy maintains the shockwave. A shockwave is essentially a highly nonlinear soundwave, and as the overpressure decays with distance from the source is will grade into a soundwave. Fireworks (pyrotechnics) are not explosives, but are the (relatively) slow reaction of chemicals (combustables, and an oxidizer) due to heat. Fireworks may generate shockwaves in air, if the package ruptures at sufficiently high pressure. Likewise volcanic blasts are not detonations, but shockwaves formed by the escape of high pressure gas.
{ "domain": "physics.stackexchange", "id": 1447, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "acoustics, explosions", "url": null }
c#, tree, graph Title: Balanced tree in C# Given the adjacency list to represent a tree from the root (node 0) to the leaves, I want to write a function that takes this adjacency list as a parameter and return whether the tree is balanced. Definition: a tree is said to be balanced if a path from a root to any leaf has the same length. I should be grateful if you could share your thoughts about this function. using System; public class MainClass { static bool isBalanced(int[][] sons) { bool balanced = true; getMaxHeight(sons, 0, ref balanced); return balanced; } static int getMaxHeight(int[][] sons, int startNode, ref bool balanced) { if(!balanced) return 0; int[] children = sons[startNode]; if(children.Length == 0) return 1; // balanced should not be changed int minHeight = int.MaxValue; int maxHeight = int.MinValue;
{ "domain": "codereview.stackexchange", "id": 30610, "lm_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#, tree, graph", "url": null }
training Training dataset to be 70% (for setting model parameters) Validation dataset to be 15% (helps to tune hyperparameters) Testing dataset to be 15% (helps to access model performance) If you plan to keep only split data into two, ideally it would be Training dataset to be 75% Testing dataset to be 25%
{ "domain": "datascience.stackexchange", "id": 9836, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "training", "url": null }
ros, android-core, service, gradle, rosjava Originally posted by damonkohler with karma: 3838 on 2013-02-19 This answer was ACCEPTED on the original site Post score: 0 Original comments Comment by denis on 2016-01-11: Hi, I've succesfully created a service (using your suggestion). I'm trying to use this package on the rosjava_tutorial_services package, but the compiler says that the custom_msg package doesn't exist. Do you have some suggestion on how to build the project in a correct way?
{ "domain": "robotics.stackexchange", "id": 12632, "lm_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, android-core, service, gradle, rosjava", "url": null }
python, python-3.x, automation if reincident: basic_log("Go check if the advertising has changed") time.sleep(10) if (advcoords:=ImageSearchNode(node_name="Advertising", path=prefix+"advertising.png").execute(find=True, frequency=2, duration=2)): tl_adv = get_coords("advertising_coords") CoordNode("Clicking advertising", [advcoords[0]+tl_adv[0], advcoords[1]+tl_adv[1]]).execute() reincident = True ###### COORDINATES NEEDS ADJUSTMENTS FROM HERE ####### # todo coordinates are not being correctly corrected. Sometimes the game screen tilts to another place define_correction(pwcoords)
{ "domain": "codereview.stackexchange", "id": 37171, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x, automation", "url": null }
java, algorithm, sorting for (int i = 0; i < size; ++i) { array[i] = random.nextInt(100); } return array; } } When comparing to Arrays.sort on random integer arrays of size one million components, I get the following figures: Seed = 602726627320375 Comb sort in 499.82 milliseconds. Arrays.sort in 948.06 milliseconds. Arrays identical: true Anything to improve there? I made an argument validation to the method. Changed the while loop to do_while loop. Swapped the condition check order in the do_while loop (I think it should be more efficient and a bit more readable that way). public static <T> void sort(T[] array, int fromIndex, int toIndex, Comparator<? super T> comparator) { if (fromIndex >= toIndex) { throw new IllegalArgumentException("fromIndex must be lower than toIndex"); }
{ "domain": "codereview.stackexchange", "id": 17027, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, algorithm, sorting", "url": null }
sampling, modulation, complex, quadrature, constellation-diagram I've seen some other posts mentioning that you have to demodulate by the carrier frequency prior to plotting an IQ data constellation plot. The plot pictured has not been demodulated. One problem I had was that it isn't clear to me what the carrier frequency is. I tired taking a power spectrum of the IQ data and using the largest frequency component as the carrier, but when using that frequency as the carrier I got similar results to plot pictured above. Would anyone know: Why my IQ plot looks the way it does/how I can fix it How I can find the carrier frequency/sample rate the meta file says frequency=0.0, but I'm not sure if that means that 0.0 is the carrier the meta file says sample_rate=1.0, does this mean 1.0Hz? that seems awfully low What do freq_lower/upper_edge and scale mean in the meta files Direct Answers to OP's Questions Why my IQ plot looks the way it does/how I can fix it
{ "domain": "dsp.stackexchange", "id": 11922, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "sampling, modulation, complex, quadrature, constellation-diagram", "url": null }
robotc, quadrature-encoder, vex motor[leftMotor] = 60; motor[rightMotor] = 60; WriteMotorSpeed(motor);
{ "domain": "robotics.stackexchange", "id": 1349, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "robotc, quadrature-encoder, vex", "url": null }
c++, recursion, c++20 With your current implementation, this doesn't work, right? Worse, if the STL's std::string were non-explicitly constructible from char, like this— std::string example = 'x'; // fortunately does not compile today
{ "domain": "codereview.stackexchange", "id": 39902, "lm_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++, recursion, c++20", "url": null }
java, javafx Formatting You seem to be following the old school of line-length considerations. Lines in this day and age can (and should) be longer than 80 characters. For one you're using 4 spaces for indentation, and secondly nowadays even the smaller screens are able to support 100-120 characters in width with relative ease. Forcing the code to adhere to outdated styling regulations makes it hard to read that code. ToString is not a user-level representation Your code is currently using toString to display a domain object to the user. That's not how this should work. A user representation is usually one that contains less information than the whole object. In general you want to be able to toString an object for logging purposes, incorporating all information available in the object. Note also that polymorphism makes it nearly trivial to make the code you've written display nonsensical data: public class SpecialExercise extends Exercise { public SpecialExercise() {
{ "domain": "codereview.stackexchange", "id": 33856, "lm_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, javafx", "url": null }
homework-and-exercises, newtonian-mechanics, friction The force equations (from the friction force) for the block and the plate become $$ \begin{align} \frac{dv_{\mathrm{block}}}{dt} = -kg \\ \frac{dv_{\mathrm{plate}}}{dt} = \frac{kmg}{M} \end{align}$$ which together with the initial conditions $v_\mathrm{block}(0) = u$ and $v_\mathrm{plate}(0) = 0$ gives $$ \begin{align} v_{\mathrm{block}} &= u - kgt \\ v_{\mathrm{plate}} &= \frac{kmgt}{M} \end{align}$$ and setting them equal I get the same $t$ as you. The only thing I can add is that the final velocity, which you can get by $$ v_\mathrm{final} = \frac{kmgt}{M} = \frac{mu}{M+m} $$ can also easily be found by conservation of momentum: The initial momentum is $mu$ and the final momentum is $(M+m)v_\mathrm{final}$ and setting them equal directly gives you $v_\mathrm{final}$. It's also a good sanity check that your answer actually conserves momentum! Also, it is customary to call the friction coefficients $\mu$ but it's really up to you.
{ "domain": "physics.stackexchange", "id": 36429, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, newtonian-mechanics, friction", "url": null }
experimental-physics, nuclear-physics, measurements, neutrons, protons This is exactly the kind of data we took in my disseration experiment (our purpose was a little more subtle than just making the momentum measurement, but we got that for free). We took events like $A(e,e'p)$ using a $5$-$6 \,\mathrm{GeV}$ electron beam on protium, deutrium, carbon, and iron targets.
{ "domain": "physics.stackexchange", "id": 99968, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "experimental-physics, nuclear-physics, measurements, neutrons, protons", "url": null }
control, raspberrypi, joystick, rasbperrypi, remote Title: How can I control RC car? Hello. Please help me. I'm sorry in poor English. I want to remote control RC car by using PS3 joystick. RC car by Raspberry Pi 2 PS3 joystick by PC joystick: rosrun joy joy_node Problem is a program for controlling RC car by using ROS is I do not know. but I can control RC car by using wiringPi. Please teach me. Raspberry Pi 2 ubuntu14.04 xubuntu ROS indigo PC ubuntu 14.04 LTS ROS indigo
{ "domain": "robotics.stackexchange", "id": 22959, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "control, raspberrypi, joystick, rasbperrypi, remote", "url": null }
velocity Title: What's the velocity for a person falling from a building? I saw that in the neighborhood a person fell our of 25th floor down the street (ground floor). I was intrigued by some questions about such situation, but all of them are out of one question: What's the velocity of a person falling from a building, in terms of km/h. Is it dependent upon the weight of the person? How to approach such a question logically and physically? I have a very little background in physics, so kindly explain it to me simply, please. What's the velocity of a person falling from a building?
{ "domain": "physics.stackexchange", "id": 53534, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "velocity", "url": null }
java Unnecessary comments if(currentPlayer.inJail){ //if player doesn't escape jail on turn, skips to showOptions // ... } else { //if player is not in jail
{ "domain": "codereview.stackexchange", "id": 42006, "lm_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", "url": null }
java, tree, file-system, swing, gui @Override protected void process(List<File> chunks) { for (File child : chunks) { node.add(new DefaultMutableTreeNode(child)); } } @Override protected void done() { progressBar.setIndeterminate(false); progressBar.setVisible(false); tree.setEnabled(true); } }; worker.execute(); }
{ "domain": "codereview.stackexchange", "id": 3822, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, tree, file-system, swing, gui", "url": null }
quantum-chemistry, electrons, theoretical-chemistry Title: Why does the quantum number n limit the value of l, and why does l, likewise, limit the value of m? Any quantum number that represents the size of an orbital is a positive integer, $n$. Any quantum number that represents the shape of an orbital is a non-negative integer, $l : l < n$. Any quantum number that represents the orientation of an orbital, $m$, is an integer such that $|m| \leq l$. Why do $n$ and $l$ restrict the ranges of $l$ and $m$, respectively? To be clearer, I ask why the quantum numbers limit each other, not what they signify, which is already explained in the related question: What do the quantum numbers actually signify? While it may seem that quantum numbers were invented out of the blue, that isn’t the case. They derive directly from solving the Schrödinger equation: $$\hat{H}\Psi = E \Psi$$
{ "domain": "chemistry.stackexchange", "id": 3541, "lm_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-chemistry, electrons, theoretical-chemistry", "url": null }
astronomy, galaxies I originally thought they represented a galaxy's Numerical Hubble stage, but then realized the data contains numbers outside of the Hubble stage. (E.g 20 for VCC0003.) What morphological classification scheme is the database using? In the search by parameters screen you'll notice you can set limits on the morphological type. The types are given names, but the limits are input as though they are ordered. A little experimenting confirms the numbers you see reported as "type" correspond to the limits options, in the order of the drop-down menu. That is, we have: -3: dS0 5: Sb 13: Pec -2: dE/dS0 6: Sbc 14: S/BCD -1: dE 7: Sc 15: Sm/BCD 0: E-E/S0 8: Scd 16: Im/BCD 1: S0 9: Sd 17: BCD 2: S0a-S0/Sa 10: Sdm-Sd/Sm 18: S(dS) 3: Sa 11: Sm 19: dIm/dE 4: Sab 12: Im 20: ?
{ "domain": "physics.stackexchange", "id": 22045, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "astronomy, galaxies", "url": null }
javascript, beginner, html let colors = [ 'black', 'brown', 'red', 'grey', 'lightgrey', 'blue', 'lightblue', 'yellow', 'green', 'lightgreen' ]; createColorTable(colors); /** * function for drawing table **/ function drawPaintingArea(height, width) { let paintingArea = document.getElementById("paintingArea"); // clear table for redrawing paintingArea.innerHTML = ""; for (i = 0; i < width; i++) { let row = document.createElement("tr"); for (j = 0; j < height; j++) { let column = document.createElement("td"); column.style.backgroundColor = "white"; column.setAttribute("onclick", "tableClickHandler(this)"); row.appendChild(column); } paintingArea.appendChild(row); } } function tableClickHandler(box) { if (box.style.backgroundColor == "white") box.style.backgroundColor = window.currentColor; else box.style.backgroundColor = "white"; } drawPaintingArea(20, 20);
{ "domain": "codereview.stackexchange", "id": 37937, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, beginner, html", "url": null }
newtonian-mechanics Title: How do we know the point about which a body experiences torque? Say, I have a ladder which is kept slanted across a wall. It is obvious that it the ladder were to fall, it would rotate about the point which is in contact with the ground. How do we justify this? In a freely falling body, the rotation is always about the center of mass right? Then why should it fall about that particular point? The ladder rotates about the point of contact with the ground because, given sufficient friction, that point does not move relative to the ground. The other points of the ladder do move. Since the ladder can assumed to be rigid we get rotation about the point of contact with the ground. How do we know the point about which a body experiences torque?
{ "domain": "physics.stackexchange", "id": 60061, "lm_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", "url": null }
# Math Help - Determine the co-ordinates 1. ## Determine the co-ordinates This is my first post. I graduated from mathematics in university 16 years ago so I am somewhat out of practice. I recently ran into my high school teacher from several years ago and he posed a math problem to me. I need some help with it, even a push in the right direction. Thanks. Here is the problem: A line segment has its endpoints on the x and y axes. The line segment passes through point (6,6). The line segment's length is 21. Determine the unknown points on the x and y axes. Thanks Norm F 2. ## Re: Determine the co-ordinates Let the x-intercept be denoted by (a, 0) Let the y-intercept be denoted by (0, b) Then a^2 + b^2 = 21^2 Now draw the rectangle with vertices (0, 0), (6, 0), (0, 6), and (6, 6) Draw a line segment from the y-axis to the x-axis through (6, 6)
{ "domain": "mathhelpforum.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9850429125286726, "lm_q1q2_score": 0.8372580768198257, "lm_q2_score": 0.8499711699569787, "openwebmath_perplexity": 568.9348276298406, "openwebmath_score": 0.6785532832145691, "tags": null, "url": "http://mathhelpforum.com/pre-calculus/187656-determine-co-ordinates.html" }
machine-learning, computational-learning-theory, bias-variance-tradeoff, approximation-error Bias-complexity tradeoff If we increase the size and complexity of the hypothesis class, the approximation error decreases, but the estimation error may increase (i.e. we may have over-fitting). On the other hand, if we decrease the size and complexity of the hypothesis class, the estimation error may decrease, but the bias may increase (i.e. we may have under-fitting). So, we have a bias-complexity trade-off (where the bias refers to the approximation error or inductive bias) and the complexity refers to the complexity of the hypothesis class. Error excess
{ "domain": "ai.stackexchange", "id": 3995, "lm_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, computational-learning-theory, bias-variance-tradeoff, approximation-error", "url": null }
beginner, c, memory-management The third thing to note is that the type of garbage_heap.buffer can change so it might be better if sizeof(*garbage_heap.buffer) * len was used rather than explicity stating sizeof(void*)*len. That way if the type of buffer changes the code only needs to change where buffer is declared rather than in multiple places. The for loop to initialize the contents of garbage_heap.buffer to NULL might be replaced with a call to void * memset ( void * ptr, int value, size_t num );: memset(garbage_heap.buffer, 0, sizeof(*garbage_heap.buffer) * len);
{ "domain": "codereview.stackexchange", "id": 36134, "lm_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, memory-management", "url": null }
ros, gazebo, ros2, camera <collision> <geometry> <cylinder length="0.3" radius="0.03"/> </geometry> <dynamics damping="0.0" friction="0.0"/> </collision> </link> <joint name="joint_5" type="fixed"> <parent link="link_4"/> <child link="link_5"/> <origin rpy="1.57 0 0" xyz="0.0 -0.2 0 "/> <dynamics damping="10" friction="1.0"/> </joint> <!-- Camera --> <link name="camera_link"> <collision> <origin xyz="0 0 0" rpy="0 0 0"/> <geometry> <box size="${camera_link} ${camera_link} ${camera_link}"/> </geometry> </collision> <visual> <origin xyz="0 0 0" rpy="0 0 0"/> <geometry> <box size="${camera_link} ${camera_link} ${camera_link}"/> </geometry> <material name="red"/> </visual> <inertial> <mass value="1e-5" /> <origin xyz="0 0 0" rpy="0 0 0"/> <inertia ixx="1e-6" ixy="0" ixz="0" iyy="1e-6" iyz="0" izz="1e-6" /> </inertial> </link>
{ "domain": "robotics.stackexchange", "id": 38295, "lm_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, ros2, camera", "url": null }
photons, electrons $$ A more general treatment of this case, including multiple excitations, was first given in R. H. Dicke, Phys. Rev. 93(1) (1953) – Coherence in Spontaneous Radiation Processes. You can observe photons interacting with many electrons at the same time also in an everyday object – a mirror. This was discussed already in some other questions here,[2 and duplicates] but in a nutshell: If a photon would only interact with $1$ electron of the mirror it would be scattered in all directions. But since the photon extends over many electrons the scattering interferes destructively for most directions. Calculating the direction of positive interference results in the macroscopic law of reflection. There are also various processes in which a single emitter interacts with multiple photons, but this is another topic.
{ "domain": "physics.stackexchange", "id": 77124, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "photons, electrons", "url": null }
python, python-3.x, reinventing-the-wheel, converting In [53]: to_base(16777215,64) Out[53]: ('63,63,63,63', 64) In [54]: to_base(33554431,64) Out[54]: ('1,63,63,63,63', 64) In [55]: to_base(86399,60) Out[55]: ('23:59:59', 60) In [56]: to_base(86399,365) Out[56]: ('236,259', 365) In [57]: to_base(2**32-1,256) Out[57]: ('255.255.255.255', 256) If your goal is to have good code, most of this shouldn't exist and you should make better use of built-ins, but it seems like that isn't your goal. If your goal is to demonstrate that you know how to write functions equivalent to the built-ins, you haven't quite hit your mark, because the built-ins are able to deal with negative numbers and your functions are not. As for a review laundry-list:
{ "domain": "codereview.stackexchange", "id": 42026, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x, reinventing-the-wheel, converting", "url": null }
As I mentioned earlier, you can convert from the null space representation to the span representation by solving the system of equations. It turns out that you can convert in the other direction the same way: if you plug each of the spanning vectors into a linear equation with unknown coefficients, you end up with a system of linear equations in the coefficients. The solution to this system then gives you a system of linear equations that describe the same space.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.975946443607529, "lm_q1q2_score": 0.8001719853223286, "lm_q2_score": 0.819893335913536, "openwebmath_perplexity": 109.75545229314166, "openwebmath_score": 0.801369845867157, "tags": null, "url": "https://math.stackexchange.com/questions/2851908/why-cant-we-find-the-intersection-line-of-two-planes-just-by-using-algebra" }
c#, linq, enum Title: Compare List to Enum Where Contains Any I have a List that I want to compare to an Enum. If a.Value is found in the Enum we return true. I feel that I should be able to make this a single line, but have struggled. private bool IsFound(IEnumerable<SomeAttribute> attributes) { foreach (AttributesInMethod option in Enum.GetValues(typeof(AttributesInMethod))) { if (attributes.Any(a => option.GetDisplayNameENUM().Contains(a.Value))) { return true; } } return false; } I would suggest a two lines of code solution instead of one. :) Let me show you first the solution then the explanation. Solution private static readonly Lazy<IEnumerable<string>> enumValues = new Lazy<IEnumerable<string>>(() => Enum.GetValues(typeof(AttributesInMethod)).Cast<AttributesInMethod>().Select(option => option.GetDisplayNameENUM()));
{ "domain": "codereview.stackexchange", "id": 39013, "lm_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#, linq, enum", "url": null }
In the context of the extended real number line (i.e. real numbers and $\pm \infty$), this is true. It's not hard to prove - the supremum of a set is defined as the least upper bound of the set. Every number* is an upper bound to the empty set (since "upper bound" means "greater than or equal to every element"). So, the least upper bound is the least number - which is $-\infty$. This acts similarly for the infimum.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9755769092358046, "lm_q1q2_score": 0.8212656669325317, "lm_q2_score": 0.8418256512199033, "openwebmath_perplexity": 134.92014826396138, "openwebmath_score": 0.923119843006134, "tags": null, "url": "https://math.stackexchange.com/questions/1147371/what-is-inf-emptyset-and-sup-emptyset" }
heat, lattice-model On the other hand, the wood and plastic materials are typically (electrical and heat) insulators because there are no shared electrons. The electrons are just sharply associated with the individual molecules and then there is a gap (an energy gap). There are no nearby free electron states which the electrons could occupy. You may still imagine that there is a "band" of shared electrons but this band is always completely filled with the electron, and the closest electron states that remain empty are separated by a nonzero, finite energy from the highest-energy occupied states - so you would need a huge amount of work to transfer an electron from one state to another one.
{ "domain": "physics.stackexchange", "id": 261, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "heat, lattice-model", "url": null }
bioinformatics You should not decide based on which method gives you the highest bootstrap. For publication, it is recommended to use either Bayesian consensus tree (MrBayes is popular program) or a maximum likelihood tree (RAxML or MEGA are popular for ML). For maximum likelihood bootstrap (BS) is used and the confidence is relatively high if at least reaches 80 (%). For Bayesian, instead of bootstrap Bayesian posterior probability (BPP) is used. For BPP it has to be at least 0.95 to be significant.
{ "domain": "biology.stackexchange", "id": 6520, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "bioinformatics", "url": null }
noble-gases So it is rock or soil types or weather or something else that causes the different amounts? Radon nuclides are short-lived members of the natural radioactive decay chains of thorium and uranium. On a time scale that would be relevant for geology, you should better ask why some locations have more uranium or thorium. The distribution of radon concentrations in the ground air is a result of the distribution of uranium or thorium in the ground.
{ "domain": "chemistry.stackexchange", "id": 12215, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "noble-gases", "url": null }
ros, opencv, cv-bridge Title: How to specify my own OpenCV3 for cv_bridge The ROS1 package cv_bridge can be downloaded here: https://github.com/ros-perception/vision_opencv.git and be found at vision_opencv/cv_bridge. I just checked its CMakeLists.txt and I found OpenCV3: find_package(OpenCV 3 REQUIRED COMPONENTS opencv_core opencv_imgproc opencv_imgcodecs CONFIG ) catkin_package( INCLUDE_DIRS include LIBRARIES ${PROJECT_NAME} CATKIN_DEPENDS rosconsole sensor_msgs DEPENDS OpenCV CFG_EXTRAS cv_bridge-extras.cmake ) catkin_python_setup() include_directories(include ${Boost_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS})
{ "domain": "robotics.stackexchange", "id": 30689, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, opencv, cv-bridge", "url": null }
proof-assistants, homotopy-type-theory $$ With this principle, we can easily prove True = False. Barrier 2: The pattern matching in Idris is too strong for HoTT, as Neel Krishnaswami suspected in a comment above. We can derive Streicher's K. This leads to uniqueness of identity proofs, and is therefore incompatible with univalence. We can once again show True = False.
{ "domain": "cstheory.stackexchange", "id": 3009, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "proof-assistants, homotopy-type-theory", "url": null }
scikit-learn, regression, random-forest Any ideas? This is indeed expected behavior, because of the way tree models handle multioutput problems. The nodes contain some number of samples, and the score for each output is the average of those samples' corresponding output. Since averaging commutes with sums, the property of summing to 1 is preserved. I'm not sure if this will help, but in symbols: $$ \sum_{\text{output }i} p_i = \sum_{\text{output }i} \left(\operatorname*{avg}_{\text{sample }j}(p_i^j)\right) = \operatorname*{avg}_j \left(\sum_{\text{output }i} p_i^j\right) = \operatorname*{avg}_j 1 = 1.$$ Then for the entire forest, you're just applying another averaging, and so the property is again maintained.
{ "domain": "datascience.stackexchange", "id": 9175, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "scikit-learn, regression, random-forest", "url": null }
python, performance, python-3.x, time-limit-exceeded Again, I solved it, but I need a bump in the efficiency since there are 1018 numbers in the test cases and more than 200 test cases and I need to solve it in 2 seconds: def is_prime(n): if n in range(0, 2): return False for i in range(2, n): if n % i == 0: return False return True
{ "domain": "codereview.stackexchange", "id": 28582, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, performance, python-3.x, time-limit-exceeded", "url": null }
the first term of your derivative how to make b the subject of formula Can you derive the formula for the volume of a frustum of a cone? These formulae are often quoted, but rarely proved. Directional Derivative. with video tutorials and quizzes, using our Many Ways(TM) approach from multiple teachers. Volume and Surface Area problems? Problem 1) Water in the Jan 24, 2016 More resources available at www. 1 Introduction to Derivatives Rules Introduction Objective 3. Where: h = perpendicular distance between A 1 and A 2 (h is called the altitude of the frustum) A 1 = area of the lower base A 2 = area of the upper base Hi, I'm working on a related rates problem, and I need to find the derivative of the volume of a cone. This formula works Solid of Revolution - Finding Volume by Rotation. Calculus is not needed, although many calculus-based derivations can be found on Google. Learn how to use this formula to solve an example problem. From The volume of a cylinder is calculated using the
{ "domain": "godirectconcept.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9787126438601955, "lm_q1q2_score": 0.804686891289986, "lm_q2_score": 0.8221891239865619, "openwebmath_perplexity": 257.1556219574417, "openwebmath_score": 0.8881735801696777, "tags": null, "url": "http://godirectconcept.com/ijhqhm/derivative-formula-of-cone.php" }
electrostatics, photons, quantum-electrodynamics, coulombs-law, virtual-particles Title: Electrostatics as the infrared limit of a "sea of photons" Textbooks giving an intro to field theory (and sometimes advanced quantum mechanics) often casually remark (in chapter one or two) that ordinary Coulomb scattering, or that classical electrostatics, or even classical electrodynamics, can be understood in the form of the exchange of "an infinite number" of "soft photons" in the "infrared limit". Sometimes, vague hints are made of the "IR divergence" of QED. Such statements are never made precise (no formulas are written down; no limits are taken). An obvious suggestion is made that one must take the photon energy to zero as one takes the number of exchanged photons to infinity (while still somehow staying at the "tree level"; this is, of course, absurd if taken at face value, as exchanging more than one photon implies a Feynman diagram with a loop in it, and so obviously no longer at tree level.) One is encouraged to think of some (thermal!?) bath of an infinite number of
{ "domain": "physics.stackexchange", "id": 94423, "lm_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, photons, quantum-electrodynamics, coulombs-law, virtual-particles", "url": null }
electrochemistry, equilibrium, redox Title: Acid dissociation constant from conductometric data $\ce{0.007 M}$ aq. solution of anilinium hydrochloride had molar conductivity equal to $\pu{119.4 S cm2 mol-1}$, which became $\pu{103 S cm2 mol-1}$ when a few drops of aniline were added to the solution. Molar conductivity of $\ce{HCl}$ in the same ionic concentration was found to be $\pu{413 S cm2 mol-1}$. Find out the hydrolysis constant of anilinium hydrochloride. I knew that $K_\text{h}=\dfrac{[\ce{PhNH2}][[\ce{H3O+}]}{[\ce{PhNH3+}]}$ and I tried to find out degree of hydrolysis $h=\dfrac{Λ_m^c}{Λ_m^∞}$ and hence $K_\text{h}$ but that attempt miserably failed. Can anyone please explain and give the correct method to go about this? More details, from the comments: I took the equilibrium, $\ce{PhNH2 + HCl <=> PhNH3+ + Cl-}$ So I guessed that x=0.007 and found concentration, $K_h=0.007$. This was blatantly incorrect. But I am not able to proceed after writing down the reaction. Further comment:
{ "domain": "chemistry.stackexchange", "id": 17774, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electrochemistry, equilibrium, redox", "url": null }
roslaunch Title: array/list as command line argument in roslaunch file I am drawing some points inside rviz. I want to pass these points as command line argument to roslaunch file. In other word, I looking for a way to enter command like below- roslaunch render_points renderer.launch points:=[x1, y1, z1], [x2, y2, z2], [x3, y3, z3], [x4, y4, z4] After this command, I should be able to get these points back inside python in similar way such as points = rospy.get_param("~points", None) # where points[0] is [x1, y1, z1] and points[1] is [x2, y2, z2] and so on.. I am not sure, whether it is possible or not. If not, please suggest some workaround to do the same.
{ "domain": "robotics.stackexchange", "id": 25980, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "roslaunch", "url": null }
machine-learning, classification, accuracy, f1score [EDIT]I have also tried to use the same approch but with a .jsonl file, and in this case it works fine giving a reasonable accuracy. Maybe it is wrong to do so, but could the problem be here, so that I am not handling correctly a .json file? Can somebody please help me? It is normal to get 100% accuracy in this case. I mean it is inevitable to get 100% accuracy. If you train your algorithm even with 10% of your data you will again get 100% accuracy. The abnormal thing in this code is using a vectorizer. Vectorizer is an algorithm that is used to extracting words from the documents as mentioned in the source: Tf-idf stands for term frequency-inverse document frequency and is often used in information retrieval and text mining. If you print what it extracts from your lista_asm variable, you will see almost every unique word in your feature's samples. print(tfidf_vectorizer.get_feature_names()) Output (just 6 of them fitted the image, in total 23125 of them available):
{ "domain": "datascience.stackexchange", "id": 8594, "lm_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, classification, accuracy, f1score", "url": null }
c++, performance, audio, signal-processing Now your loop only has one addition per iteration, instead of 3 additions and 2 multiplies. Unnecessary Copy Currently, you create a temp array, fill it in, then copy to the final destination: double values[PLUG_MAX_PROCESS_BLOCK]; for (int sampleIndex = 0; sampleIndex < blockSize; sampleIndex++) { // ... values[sampleIndex] = (bp0 * value + bp1); } std::memcpy(envelope.mValue[voiceIndex], values, PLUG_MAX_PROCESS_BLOCK); Instead, you could just write to the final destination directly: double *values = envelope.mValue[voiceIndex]; for (int sampleIndex = 0; sampleIndex < blockSize; sampleIndex++) { // ... values[sampleIndex] = (bp0 * value + bp1); }
{ "domain": "codereview.stackexchange", "id": 32269, "lm_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, audio, signal-processing", "url": null }
vba, excel I write the comments for almost all codes for you to understand. I am not a software engineer you will notice quickly. I just want to learn if there is way to do the same task with easier, more readable and flexible codes. What I mean with flexible is, easily change the code when number of shifts has changed or etc. You can find the Excel here https://www.dropbox.com/s/uaizjqph7ltfx58/Analiz%20v1.3.xlsm?dl=0 To make the code more readable and more flexible, i.e. more maintainable, you might try to apply some general principles and some useful features of VBA/Excel. The two most useful, albeit in practise hard to get completely right, principles are good naming and the single responsibility principle. In short, the single responcibility principle tells you that each unit of your code, like e.g. a Sub, should do one thing and only one. Let me explain these two points a little further with reference to the code.
{ "domain": "codereview.stackexchange", "id": 23449, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "vba, excel", "url": null }
beginner, rust, caesar-cipher let mut buf: Vec<Letter> = Vec::with_capacity(cmp::max(self.len(), other.len())); let mut self_iter = self.iter(); let mut other_iter = other.iter(); loop { match (self_iter.next(), other_iter.next()) { (Some(sval), Some(oval)) => buf.push(func(*sval, *oval)), (Some(sval), None) => { buf.push(*sval); buf.extend(self_iter); break; } (None, Some(oval)) => { buf.push(*oval); buf.extend(other_iter); break; } (None, None) => break, } }
{ "domain": "codereview.stackexchange", "id": 41486, "lm_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, rust, caesar-cipher", "url": null }
$$\begin{cases}U_xt^3+V_xt^2+W_xt-x=0\\ U_yt^3+V_yt^2+W_yt-y=0\end{cases}$$ $$\begin{cases}U_x&:=&3b_x-3c_x+d_x\\V_x&:=&3c_x-6b_x\\ W_x&:=& 3b_x\end{cases} \ \ \text{and} \ \ \begin{cases}U_y&:=&3b_y-3c_y+d_y\\V_y&:=&3c_y-6b_y\\ W_y&:=& 3b_y\end{cases}$$ one gets the following "determinantal" expression for $f$: $$f(x,y)=\left|\begin{array}{rrrrrrrr} U_x&V_x&W_x&-x&0&0&0\\ 0&U_x&V_x&W_x&-x&0&0\\ 0&0&U_x&V_x&W_x&-x&0\\ 0&0&0&U_x&V_x&W_x&-x\\ U_y&V_y&W_y&-y&0&0&0 \\ 0&U_y&V_y&W_y&-y&0&0\\ 0&0&U_y&V_y&W_y&-y&0 \\ 0&0&0&U_y&V_y&W_y&-y \end{array}\right|=0.$$ You could leave it under this form if you use a software like Matlab. But if you have to do the operation $\approx10^9$ times, it is your interest to expand it once for all (using a CAS) in order to get a much more efficient formula.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9711290959782384, "lm_q1q2_score": 0.8292595162078977, "lm_q2_score": 0.8539127492339909, "openwebmath_perplexity": 255.70909733405583, "openwebmath_score": 0.7316858768463135, "tags": null, "url": "https://math.stackexchange.com/questions/2641995/design-an-algorithm-to-check-if-point-lies-on-a-b%C3%A9zier-curve" }
ros-melodic, rospy, roscore Thank you gvdhoom and chased11 so much for your kind help. After setting only ROS_IP and ROS_MASTER_URI for each device (ROS_IPs set to their own ips for each device and ROS_MASTER_URI is set to http://(ip address of master):11311 for each device) i am able to connect to ros master from the other computer and can subscribe to the topic from there.
{ "domain": "robotics.stackexchange", "id": 38401, "lm_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-melodic, rospy, roscore", "url": null }
commonly used tests, such as the Wechsler Intelligence Scales, have an average score of 100 and a standard deviation of 15. In this measuring dispersion lesson, students compute the mean, and then the distance from the mean for each data point. Standard Deviation Radical Math PPT. D) Standard deviation is the square root of variance. Grouped Data. The cumulative standard deviation formula is derived from an SD formula called the Raw Score Formula. Compute the mean, variance and standard deviation for data set I. The unbiased estimate of the population standard deviation has been moved into the Statistics option, but the Extension worksheet for this chapter investigates the idea of the distribution of the sample mean and sample variance. Example: Based on the grouped data below, find the median. Lesson 7 - Standard Deviation. 68% of the data lie within 1 standard deviation 95% of the data lie within 2 standard deviations 99. Table Table3 3 shows the calculation of the range,
{ "domain": "kdgshop.de", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9877587254288981, "lm_q1q2_score": 0.8029167947657637, "lm_q2_score": 0.8128673269042767, "openwebmath_perplexity": 564.275361940718, "openwebmath_score": 0.657807469367981, "tags": null, "url": "http://fijh.kdgshop.de/standard-deviation-for-grouped-data-worksheet.html" }
ros, gazebo, simulation, turtlebot, base-controller Update 10/18/2011) As in the comment area in the selected answer, I assume the root cause is that in the launch file I didn't surround the subscriber node by group tag. Originally posted by 130s on ROS Answers with karma: 10937 on 2011-10-11 Post score: 3 As you are spawning the robots successfully, i think you can define namespace of each bot in the launch file separately. Having done this you should publish the cmd_vel to each bot with separate topics which get created according to their namespace in launch file. Below is example of launch file i used. <launch> <group ns="Robot"> <node pkg="velocity_obstacle" name="rosaria" type="robot_node" output="screen"> <param name="port" value="10.2.36.7"/> </node> </group> <group ns="Obstacle1"> <node pkg="velocity_obstacle" name="rosaria" type="robot_node" output="screen"> <param name="port" value="10.2.36.6"/> </node> </group> </launch>
{ "domain": "robotics.stackexchange", "id": 6937, "lm_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, simulation, turtlebot, base-controller", "url": null }
ros Title: Running a launch file on remote node Hello all, I'm trying to use a Raspberry Pi 3 as a ROS node, publishing a topic containing a point-cloud, generated by an Orbbec Astra RGBD camera. The Raspberry Pi 3 is running Ubuntu Mate Xenial, with ROS Kinetic installed, and Orbbec's ROS packages (ros_camera_astra and ros_camera_launch) cloned and built. I can happily use roslaunch astra_launch astra.launch to run up a local ROS master and node, publishing the point cloud (amongst other data). The machine I want to use as a master is running Ubuntu Trusty, with ROS indigo installed. It also has Orbbec's ROS packages installed, and can successfully roslaunch astra_launch astra.launch. My goal is to run the Astra node on the Pi 3, and view the published data in Rviz on the master machine. This is the launch file I am attempting to use on the master machine: <launch> <node name="rviz" pkg="rviz" type="rviz" /> <group>
{ "domain": "robotics.stackexchange", "id": 27085, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros", "url": null }
plane for different initial conditions depending on the coordinates of the mouse pointer. Phase Plane Plot of the Van der Pol Differential Equation x ' ' (t)-λ 1-x (t) 2 x ' (t) + k x (t) = 0. The attachment file is Matlab toolbox to draw phase plain. Then locate the eigenvectors in the space, and correspondingly draw arrows whose tip has a direction that depends on the sign of the eigenvalue (trajectories shrink towards the origin for eigenvalues. phase plot and the actual trajectory), being careful to scale both axes to achieve the desired weighting of amplitude and velocity. Once again use the mouse to set the initial data. Toting his gun and the small vial of water he claimed was explosive nitroglycerin, Rivera-Rios took the chief flight attendant Esther De La Fuente hostage and demanded she take him to the captain. Spins that are moving in the same direction as a magnetic field gradient develop a phase shift that is proportional to the velocity of the spins. 2 Parameterized
{ "domain": "ammastyle.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.972414724168629, "lm_q1q2_score": 0.8060723026465414, "lm_q2_score": 0.8289388083214156, "openwebmath_perplexity": 847.6896301243131, "openwebmath_score": 0.5837233662605286, "tags": null, "url": "http://ammastyle.it/vapl/phase-plane-plotter.html" }
species-identification, zoology, entomology Your specimen reminds me quit a bit of one of the better known species, the boll weevile (Anthonomus grandis), which is native to Mexico but is typically found in/around cotton fields. (I don't suppose you live near or work with cotton?). Though, your specimen is also larger than the typical 0.3-1.0 cm size of the boll weevil.
{ "domain": "biology.stackexchange", "id": 12235, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "species-identification, zoology, entomology", "url": null }
javascript, html, css, ecmascript-6, event-handling document.addEventListener('click', e => { let node = e.target; do { if (node.classList.contains('download') && !node.classList.contains('is-open')) { e.preventDefault(); const btn = node.querySelector('.btn');
{ "domain": "codereview.stackexchange", "id": 37761, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, html, css, ecmascript-6, event-handling", "url": null }
quantum-mechanics, operators Title: Does the momentum operator commute with the Pauli matrix? I tried to calculate the effect of spin orbit coupling $H_s=\alpha(\sigma_xp_y-\sigma_yp_x)$ as in the Rashba effect. But I just found out that it is not hermitian. Some paper propose some way by adding the hermitian conjugate to ensure the hermicity. However, when I tried to add a h.c. term, the Hamiltonian turned out to be 0. $H_s=\alpha(\sigma_xp_y-\sigma_yp_x)=\alpha\left( \begin{array}{cccc} 0&\frac{\hbar}{i}\frac{\partial}{\partial y}+\hbar\frac{\partial}{\partial x}\\\frac{\hbar}{i}\frac{\partial}{\partial y}-\hbar\frac{\partial}{\partial x}&0 \end{array}\right)$ This matrix is just anti-hermitian and will end up to be 0 after adding up its hermit conjugate. Am I doing this correctly? The momentum and spin operators do commute. Since $H_s$ is a sum of products of commuting Hermitian operators, it is Hermitian (assuming $\alpha$ is real).
{ "domain": "physics.stackexchange", "id": 15946, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, operators", "url": null }
# What is the position of the surviving mouse? I have this question that I think it may be very interesting to all maths' lovers. A cat caught $n$ (integer) mice and put them in line, numbered them from 1 to $n$, from left to right. He starts eating every other mouse, starting with the mouse at the 1st position, i.e. 1, 3, 5 ... (all mice at the odd positions will be gone). He then starts a new iteration, no matter if there is a surviving mouse at the end of the line, by going back to the left and eats every other mouse again, starting always with the first surviving mouse from the previous iteration. Until there is one mouse left. What is the position of the surviving mouse in the original sequence from 1 to n?
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9928785704113701, "lm_q1q2_score": 0.8295336958543141, "lm_q2_score": 0.8354835330070839, "openwebmath_perplexity": 171.6747416287251, "openwebmath_score": 0.6153453588485718, "tags": null, "url": "https://math.stackexchange.com/questions/2219700/what-is-the-position-of-the-surviving-mouse/2219723" }
Then possible $y$ values are in the interval $(0,\sqrt{3} d)$ and for each $y$-value the $x$ values are in the interval $(y/\sqrt{3}-d,d-y/\sqrt{3})$. The moment of inertia is thus given by the area integral $$I=\frac{m}{A} \int_{A} \mathrm{d} F \; y^2=\frac{m}{\sqrt{3} d^2} \int_0^{\sqrt{3} d} \mathrm{d} y 2 \int_0^{d-y/\sqrt{3}} \mathrm{d} x \; y^2.$$ The integration is straight forward. With the $x$ integral done you get $$I=\frac{2m}{\sqrt{3} d^2} \int_0^{\sqrt{3}d} \mathrm{d} y \; \left(d y^2-\frac{y^3}{\sqrt{3}} \right )$$ After the integration and some algebra you finally get $$I=\frac{m d^2}{2}.$$ 8. Oct 6, 2012 ### Studiot Since vanhees has done the algebra whilst I was asleep, (thanks mate) there is little left for me to do except add value. Have your heard of the transfer theorem/ parallel axis theorem/theorem of Pappus? You need to always check what axis of rotation is being used. Standard tables often refer to Ixx and Iyy
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.973240719919151, "lm_q1q2_score": 0.8348148462549307, "lm_q2_score": 0.8577681031721325, "openwebmath_perplexity": 1811.4080764928624, "openwebmath_score": 0.7622583508491516, "tags": null, "url": "https://www.physicsforums.com/threads/moment-of-inertia-of-a-uniform-triangle-involves-integration.640571/" }
php, sql, ajax Have I made an example of MVC design? Would the PHP that calls SQL routines be the model, the display PHP file the View, and the JavaScript functions the Controller? Is this an example of RESTful design? I use the GET parameter in the AJAX call and access the $_GET array in the PHP files. But the function doesn't expect to GET any data. It just wants the PHP file to call a routine on the database. Is that a violation of RESTful design? First lets define MVC design and break apart your question: M: Model (datastructure or business logic) V: View (the display of your information) C: Controller (the one that connects the M to the V)
{ "domain": "codereview.stackexchange", "id": 6559, "lm_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, sql, ajax", "url": null }
c++, game, snake-game, fltk // Determines either game is paused or not bool Snake_window::is_pause() { return Fl::has_timeout(cb_game_loop, this) ? false : true; } // Pauses game if it's playing, or starts if it's already // paused, that is, pause prevents snake's moves void Snake_window::pause() { if (!is_pause()) { Fl::remove_timeout(cb_game_loop, this); // Stop timeout cout << "Paused the game\n"; } else start(); // Start timeout }
{ "domain": "codereview.stackexchange", "id": 39152, "lm_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++, game, snake-game, fltk", "url": null }
electrostatics, electricity, electric-circuits 2.) electric potential difference in the battery allows the battery to generate electrons that can move through the wire, bump with the free-floating electrons in the wires and move through to the end of the wire 2.a) To me this seems to be the most reasonable hypothesis. Also, lastly can someone explain what electric potential difference looks like and how it occurs in batteries. I heard it has to do something with chemical reactions or something? You are right - electrons "circulate". That is, they move in a circuit (that name looks a bit like "circle" ... can you see?). The power source (battery) can indeed push electrons into the wire at one end, collect them at the other end, then give them some more energy and let them go again.
{ "domain": "physics.stackexchange", "id": 84777, "lm_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, electricity, electric-circuits", "url": null }