text
stringlengths
1
1.11k
source
dict
c#, xamarin queue argument name is exposing an implementation detail (it's intended to be a queue, or even better it's not but you should use it as it was.) If it's a queue then maybe you're using wrong data structure and anyway parameter should be named according to its content (ticketsToProcess, for example.) try/catch block is too generic (as I said before) and too outer. If processing of a single ticket fails then maybe other tickets may be still processed (but you may keep a counter of failed operations and specifically handle some exceptions CheckConnection() method may need a more descriptive name. Connection to what? What does it do? I mean something like IsDatabaseConnectionAvailable(), note that if it also performs connection then it has to be another name (with a verb...)
{ "domain": "codereview.stackexchange", "id": 21948, "lm_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#, xamarin", "url": null }
condensed-matter, research-level, topological-field-theory, topological-order, topological-phase As far as I know there is no direct extension of this to the cobordism theories, but you can write the cobordism groups as group cohomology like objects and do this same thing. That was basically the approach of these papers: https://arxiv.org/abs/1505.05856 and https://arxiv.org/abs/1701.08264 . There, the cobordism groups are associated with particular fusion categories that "bosonize" the fermionic SPT phases. Note that while it seems possible to classify invertible TQFTs, classifying something like all 3d TQFTs even seems harder than classifying all finite groups. They are much more wild beasts. There is a really nice paper about the topological power of unitary TQFT: https://arxiv.org/abs/math/0503054 ps. why not ask anton to explain? :P
{ "domain": "physics.stackexchange", "id": 47716, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "condensed-matter, research-level, topological-field-theory, topological-order, topological-phase", "url": null }
mechanical-engineering, project-management, research From other professional engineers experience, what would be the usual method to develop a budget. It's important to remember that this budget is part of a proposal; it is inherently not set in stone, so it does not have to be perfect. You do not have to identify every expense that you will incur during the course of the project, but you need to show that you have considered, identified, and can estimate the major costs of the project. If you don't have one already, I'd highly recommend creating a timeline (possibly in the form of a Gantt chart, for which you should be able to find multiple Excel templates or other programs to create one.) It sounds like you have a decently clear goal in mind (make sure you know what you mean by "improved," though that's mostly unrelated to this question.) But you also need to have a good idea of how you'll get to that end result. Some questions I would consider asking yourself
{ "domain": "engineering.stackexchange", "id": 38, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "mechanical-engineering, project-management, research", "url": null }
### Show Tags 25 Feb 2015, 16:45 1 KUDOS Expert's post 2 This post was BOOKMARKED Hi All, It looks like everyone who posted in this thread understands the correct answer. For anyone who doesn't quite get why the math works the way that it does, here are some examples to prove the point. 200! = (200)(199)(198)(197)....(2)(1) so we know that it's a gigantic number. The reason why it will end in a "string" of 0s is because of all of the multiples of 5 involved. When multiplying integers, there are two ways to get a number that ends in a 0: 1) multiply a multiple of 5 by an even number 2) multiply a multiple of 10 by an integer. (5)(2) = 10 so we get one 0 for every multiple of 5 However, 25 = (5)(5). It has TWO 5s in it, so there will be two 0s. eg (25)(4) = 100 With 125 = (5)(5)(5), we have THREE 5s, so there will be three 0s. eg (125)(8) = 1,000
{ "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.8354835309589074, "lm_q2_score": 0.8354835309589074, "openwebmath_perplexity": 3647.319126747735, "openwebmath_score": 0.6537057161331177, "tags": null, "url": "https://gmatclub.com/forum/how-many-terminating-zeroes-does-200-have-15627.html" }
organic-chemistry, inorganic-chemistry, experimental-chemistry, biochemistry Felix G. Coe, Gregory J. Anderson, "Screening of medicinal plants used by the Garífuna of Eastern Nicaragua for bioactive compounds," Journal of Ethnopharmacology 1996, 53(1), 29-50 (https://doi.org/10.1016/0378-8741(96)01424-9). Abdel‐Azim M. Habib, "False‐positive alkaloid reactions," Journal of Pharmaceutical Sciences 1980, 69(1), 37-43 (https://doi.org/10.1002/jps.2600690111). J. W. Field, M. Kandiah, "A note on the use of mayer's reagent for the detection of quinine in alkaline urine," Transactions of the Royal Society of Tropical Medicine and Hygiene 1935, 28(4), 385-390 (https://doi.org/10.1016/S0035-9203(35)90133-X).
{ "domain": "chemistry.stackexchange", "id": 12324, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "organic-chemistry, inorganic-chemistry, experimental-chemistry, biochemistry", "url": null }
newtonian-mechanics, forces, kinematics, free-body-diagram, centripetal-force Title: Centripetal force and change of the tangential velocity I'm studying physics in the fifths semester and I'm still confused by some aspects of circular motion. So, I understand that the centripetal force changes the direction of the velocity, whereas the speed stays the same. But when the direction of the velocity changes, what causes the change of the tangential velocity at the uppermost point of the vertical circle ( since the tangential velocity has its direction in horizontal as well as in perpendicular direction as in the picture below )? Because obviously it has to change but the only applied force is the centripetal force, which does not "interact" with the tangential velocity. First some clarification. In circular motion, velocity is actually the same as tangential velocity, or in other words, there is no radial component of the velocity (otherwise it wouldn't describe a circle).
{ "domain": "physics.stackexchange", "id": 70813, "lm_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, forces, kinematics, free-body-diagram, centripetal-force", "url": null }
calibration, kinect, openni-kinect Title: Kinect extrinsic calibration (between depth and built-in cameras) Hi all, I am having some problems with this tutorial: http://www.ros.org/wiki/openni_launch/Tutorials/ExtrinsicCalibration I calibrated both the RGB and the Depth camera on the Kinect, however, when I try to do this tutorial. I always get an error which says "Timed out waiting for checkerboard". I tried to find this error, however, I don't see anyone else having this problem. I'm not sure if it is because the tutorial is broken for ROS fuerte. Anyone else having problems getting this to work? Or if there is a better calibration method out there on ROS to calibrate the kinect. Note: I'm trying to get a better calibration than the manufacture. This is because I need more accuracy (millimeter range) than what is given (centimeter range). EDIT: I tried to use the Contrast Augmentor using this command: rosrun contrast contrast_augmenter image:=/camera/ir/image_raw Then the input to the calibration was:
{ "domain": "robotics.stackexchange", "id": 14188, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "calibration, kinect, openni-kinect", "url": null }
c#, html, json, converting, json.net var pages = GetPages(htmlDocument); Debug.WriteLine("Found {0} pages", pages.Count()); var objects = ParseHtmlToObjects(pages); WriteJson(objects); } /// <summary> /// Write the object as JSON using a custom converter that /// correctly writes the property list as single properties /// and not as a list. /// </summary> /// <param name="obj">Object to be serialized</param> private void WriteJson(DataObject obj) { var converter = new CustomJsonConverter(); var data = JsonConvert.SerializeObject(obj, Formatting.Indented, converter); File.WriteAllText(_outputFile.FullName, data); }
{ "domain": "codereview.stackexchange", "id": 12450, "lm_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#, html, json, converting, json.net", "url": null }
special-relativity, relativity, time-dilation So just some notes, subscript 0 here, such as $T_0$ refers to the time in the rest frame, and subscript 1 here, such as $T_1$ represents the frame of reference where the ship is moving. As you can see the final equation I get is almost exactly right but i seem to have resulted in a plus sign where there should be a minus sign. After going through my work I can't find the source of my error. What did I do wrong? This approach is actually well-thought out and it's pretty much on point. The problem, though, occurs very early. There are two inertial frames that we're considering. I'll refer to one as observer frame and the other one as the ship frame.
{ "domain": "physics.stackexchange", "id": 40176, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "special-relativity, relativity, time-dilation", "url": null }
ros, ros2, dds, rclpy Comment by gvdhoorn on 2018-06-10: That would seem to be an entirely different issue. I recommend you open a new question to diagnose that.
{ "domain": "robotics.stackexchange", "id": 30993, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, ros2, dds, rclpy", "url": null }
the-moon Title: Is it a coincidence that on the far side of the moon almost no seas are visible? Sorry for the maybe too large pictures. They do make the surface structures of both sides of the moon visible though. Is it just a coincidence that on the side facing us is so much sea is visible? It looks as if on the far side more meteorites have hit the surface. On the other hand, some pretty big ones seem to have hit the side we see. You can see there are overlapping circles containing flat and dark grounds, the seas. I once read a science speculation article in Analog Science Fiction Science Fact with a title something like "The Brush That Painted the Face of the Man in the Moon". That might have been about 30 years ago.
{ "domain": "astronomy.stackexchange", "id": 5586, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "the-moon", "url": null }
Cool stuff! Not really an answer but a few comments, if I may A few years ago, I did an exercise trying to create a "fade in" polynomial window that pase zero derivatives up to order $n$ at both edges. That feels like a similar exercise to yours with some substitution $$f(x) = c \cdot g(a \cdot x + b) + d$$ or specifically $f(x) = 2 \cdot g(2 \cdot x - 1) -1$. The derivative of such a polynomial needs to have shape of $$\frac{\partial }{\partial x}g(x)=x^n \cdot (x-1)^n$$ You can start with a polynomial like this, integrate once, and normalize to $g(1)=1$. Matlab code below. I never bothered to derive a closed form solution, though because it's easy enough to calculated them the way I described above and it was less useful than I had hoped
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9766692339078751, "lm_q1q2_score": 0.8007645919746638, "lm_q2_score": 0.8198933315126791, "openwebmath_perplexity": 1126.2977873774507, "openwebmath_score": 0.9993211030960083, "tags": null, "url": "https://dsp.stackexchange.com/questions/36202/monotonic-symmetrical-soft-clipping-polynomial/36204" }
\mathbf{P} =\begin{bmatrix} 0 & 1 & 0 & ... & 0 & 0\\ 0 & 0 & 254/255 & ... & 0& 1/255\\ 0 & 0 & 0 & \ddots & 0 & \vdots\\ 0& 0 & 0 & ... & 0 & 1\\ 0 & 0 & 0 & ...& 0 &1 \end{bmatrix}$ MATLAB tells us that 25th and last entries of $\displaystyle \mathbf{e}_1 \mathbf{P}^{24}$ are 0.32719 and 0.67281 respectively, again verifying Jeff's claims. Thanks from JeffM1 Last edited by 123qwerty; June 16th, 2017 at 11:59 AM.
{ "domain": "mymathforum.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9848109534209825, "lm_q1q2_score": 0.8706115679179115, "lm_q2_score": 0.8840392817460332, "openwebmath_perplexity": 1050.170538587273, "openwebmath_score": 0.807102620601654, "tags": null, "url": "http://mymathforum.com/probability-statistics/340911-what-probability-getting-same-number-twice-2.html" }
• It of course refers to the rel topology and the proof is the same. – JCAA Jul 7 '20 at 22:10 • I thought the statement meant that any subset of X was compact with the original topology, not with the relative one – J.C.VegaO Jul 7 '20 at 22:13 • Well what does it mean to be compact with the original topology? – Severin Schraven Jul 7 '20 at 22:21 • @Severin Schraven That you can extract a finite subcover from a open cover made of open sets of the original topology, ( not made of the intersection of them with the set, like in the relative topology.) The reason I make a difference is because set that is not open in the original topology may be open in the relative. like for example in [-1,1] with the usual topology $\tau$ as a subset of $\mathbb{R}$ . $E=[-1,1 ]$ is not open in $(\mathbb{R},\tau)$ but it is in $(\mathbb{R},\tau_E)$ – J.C.VegaO Jul 7 '20 at 22:27
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9669140244715406, "lm_q1q2_score": 0.8679941616861733, "lm_q2_score": 0.8976952859490985, "openwebmath_perplexity": 66.34106814868436, "openwebmath_score": 0.9389252662658691, "tags": null, "url": "https://math.stackexchange.com/questions/3749178/prove-that-every-set-and-subset-with-the-cofinite-topology-is-compact" }
phylogenetics, phylogeny, nucleotide-models Title: What is the best way to account for GC-content shift while constructing nucleotide-based phylogenetic tree? Let's say I want to construct a phylogenetic tree based on orthologous nucleotide sequences; I do not want to use protein sequences to have a better resolution. These species have different GC-content. If we use a straightforward approach like maximum likelihood with JC69 or any other classical nucleotide model, conserved protein coding sequences of distant species with similar GC-content will artificially cluster together. This will happen because GC-content will mainly affect wobbling codon positions, and they will look similar on the nucleotide level. What are possible ways to overcome this? I considered the following options so far:
{ "domain": "bioinformatics.stackexchange", "id": 942, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "phylogenetics, phylogeny, nucleotide-models", "url": null }
python Title: Sendgrid + Mako email templates quick code review I created small module to help me create rich sendgrid html emails using the mako templating engine. Any feedback on the design would be appreciated: makosg.py from sendgrid.message import Message from mako.template import Template from mako.lookup import TemplateLookup class MakoMessage(Message): def __init__(self, addr_from, subject, vars={}, text="", temp_path=None, temp_filename=None): html = self.render_template_output(vars, temp_path, temp_filename) subject = self._render(subject, vars) text = self._render(text, vars) super(MakoMessage, self).__init__(addr_from, subject, text, html) def render_template_output(self, vars, temp_path, temp_filename): if temp_path and temp_filename: lookup = TemplateLookup([temp_path]) template = lookup.get_template(temp_filename) return template.render(**vars) return ""
{ "domain": "codereview.stackexchange", "id": 2665, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python", "url": null }
moment-of-inertia Let's say that a human arm and hand has the following inertia values (around its center of gravity) $$I_x = I_y = 0.3\ kg \cdot m^2$$ $$I_z = 0.02\ kg\cdot m^2$$ This would be the values if the arm is hanging down. But let's say I angle the arm outwards ("abduct" it) by 30°, can I then use $I_x,\ I_y$ and $I_z$ to find the new values? (As the angle increases, the $I_y$ value would gradually fall and reach the old $I_z$ value at 90°. Is there maybe a trigonometric relation for this??) OK, I am not a physicist, I only do bio-mechanics occasionally :) Edit 19/7: Just to clarify:
{ "domain": "physics.stackexchange", "id": 32314, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "moment-of-inertia", "url": null }
telescope Title: CCD in telescopes: Observation and Astro-photography This is a Celestron CPC 800 XLT telescope. It doesn't seem to have charge-coupled device (CCD) attached. Can a CCD be attached separately to this 8" Schmidt-Cassegrain telescope even if it didn't come along with the package? For astro-phtography how cheaper and cost-effective would a DSLR camera be than CCD? I think it is better to suit yourself with a CCD than a DSLR camera for quality photography.
{ "domain": "astronomy.stackexchange", "id": 3230, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "telescope", "url": null }
python, beginner, parsing, json, xml if __name__ == '__main__': main() ** EDIT ** Ways of doing exception handling: Don't. Just take your try and except out. If something goes wrong, your program will die with a stack trace. Not very professional, but in some cases that's just fine Use sys.exit() try: do_stuff() except IOError: print "Went wrong" sys.exit() # program will exit here Use your own exception class (my preffered method) Code: class UserError(Exception): """ This error is thrown when it the user's fault Or at least the user should see the error """ # later try: do_stuff() except IOError as error: raise UserError(error) # later def main(): try: do_program() except UserError as error: print error Its a bit bulky for a simple script like this, but for bigger programs I think its the best solution. Two other issues:
{ "domain": "codereview.stackexchange", "id": 473, "lm_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, beginner, parsing, json, xml", "url": null }
To stop the recursion, $f_0(2)=2$ and $f_1(2)=1$. But somehow the method seems too roundabout to me. While it is easy to write a code snippet for the solution, is it possible to express our solution, i.e. $f_0(n)+f_1(n)$ in a closed form expression? You're almost there. All you need is to insert your expression $f_1(n)=f_0(n-1)$ to get $$f_0(n) = f_0(n-1) + f_0(n-2)$$ which you should recognize as the recurrence that produces the Fibonacci numbers. We also have $f_0(1)=1$ and $f_0(2)=2$, so the sequence is just offset by one position from the usual Fibonacci sequence, so you have $$f_0(n) = F_{n+1}$$ and the total number of allowed sequences of length $n$ is $$f_0(n) + f_1(n) = f_0(n) + f_0(n-1) = F_{n+1}+F_n = F_{n+2}$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9881308800022472, "lm_q1q2_score": 0.8234337677383133, "lm_q2_score": 0.8333245973817159, "openwebmath_perplexity": 141.9309777120758, "openwebmath_score": 0.8510178327560425, "tags": null, "url": "https://math.stackexchange.com/questions/2022451/how-many-n-bit-sequences-of-0s-and-1s-are-there-without-two-consecutive-1s" }
electric-circuits, batteries, electrochemistry Now reduction occur at cathode so cathode is formed by component who have more positive reduction potential for its reaction. Reaction at cathode will pull the electron and at anode one with low(than cathode) reduction potential is present for negative potential it will leave electron and will generate push for them but if positive potential even if it want to pull electron it have no enough energy to resist cathode and cathode will overcome the anode creating flow.
{ "domain": "physics.stackexchange", "id": 75884, "lm_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, batteries, electrochemistry", "url": null }
species-identification, mammals Title: What species is this mammal? I saw a mammal that looked like a large squirrel. I haven't seen anything quite like it. Can you help me identify it? Squirrel-like, "hunched over" posture. It was too large to be an eastern squirrel—approximately 2.5 feet, from nose to tail. It had a fluffy tail like an eastern squirrel, not short and rat-like like a ferret. Black face with white nose, body was chestnut-brown. I saw this on the ground, not in a tree. I saw it in a pine forest in east-central Alabama. At one point, it sat up on its hind legs. It sounds pretty much like a fox squirrel (or better: as masked face fox squirrel which are found in Alabama). They look like this (taken from this website): There seems to be quite some variation in terms of fur color, some animals are more greyish: Taken from here, this website also contains some additional information.
{ "domain": "biology.stackexchange", "id": 2204, "lm_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, mammals", "url": null }
r^2} \, V(t) = \frac{1}{\pi \rho \, r^2} \, m(t)$$ The area of the cylinder is easy to compute $$S(t) = \pi r^2 + 2 \pi r \, h(t) = \pi r^2 + 2 \pi r \, \frac{1}{\pi \rho \, r^2} \, m(t) = \pi r^2 + \, \frac{2 }{ \rho \, r} \, m(t)$$ and written in terms of the mass. By assumption, $\frac{dm}{dt}(t)$ is proportional to $S(t)$ at any moment of time $t$. This means that there is a constant $k$ such that for all $t$ $$\frac{dm}{dt}(t) = k\, S(t) = k \pi r^2 + \, \frac{2 k}{ \rho \, r} \, m(t)$$ Finally we have derived the very simple linear differential equation $$\frac{d m}{ dt} = k \pi r^2 + \, \frac{2 k}{ \rho \, r} \, m$$ in terms of the mass $m = m(t)$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9850429156022934, "lm_q1q2_score": 0.8187115690849198, "lm_q2_score": 0.8311430457670241, "openwebmath_perplexity": 194.05761481039136, "openwebmath_score": 0.915837287902832, "tags": null, "url": "https://math.stackexchange.com/questions/1947290/creating-an-ode-for-a-growing-cylinder" }
c#, number-guessing-game public GuessThatNumberGame(int maxAttempts) { if (maxAttempts <= 0) { throw new ArgumentOutOfRangeException("maxAttempts"); } Number = _Randomizer.Next(MinimumNumber, MaximumNumber); MaxAttempts = maxAttempts; Attempt = 1; } /// <summary> /// Enter a guess from the player. /// </summary> public void SubmitGuess(int guessedNumber) { // No more attempts if they've already lost. if (HasBeenWon == false) { return; } // Add this to the number of attempts. Attempt += 1; // If they guessed correctly set to victory. if (guessedNumber == Number) { HasBeenWon = true; } // This was their last attempt if we're over the max now. if (Attempt > MaxAttempts) { HasBeenWon = false; } } } Sample: Victory
{ "domain": "codereview.stackexchange", "id": 32208, "lm_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#, number-guessing-game", "url": null }
genome, phylogenetics, assembly From visual inspection with IGV, a significant number of both SNPs and SVs appear to be present, but an assembly built entirely from my own sequencing data is not high enough quality for my purposes. How can I modify this reference genome to match my sample with new sequencing data (preferably with Oxford Nanopore Technologies long reads, but I can also use these to scaffold short reads if necessary), taking advantage of my knowledge that the existing reference is mostly very good, without having to access the reads which were originally used to construct the reference genome?
{ "domain": "bioinformatics.stackexchange", "id": 184, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "genome, phylogenetics, assembly", "url": null }
javascript, css, html5, sass Is my "rebuild" done in a good way? Are there points which I should change / improve? Disclaimer: this answer doesn't examine the SASS aspect. It only focuses on JS code improvement (and to further adaptation for a more general use). JS code improvement To precisely answer the question: yes, the "rebuild" is done in a good way, regarding how to achieve what it's intended to. But its default from my point of view is that it uses too many unneedded variables and statements, so harming performance (though realistically it doesn't matter in this case) and readability. The most noticeable point is that xxx = Array.prototype.slice.call(xxx); (used three times) is totally useless. I guess it's intended to turn xxx from NodeList to Array (at least in two cases from three), but it's not needed, since forEach() is also a method of NodeList. So it can be suppressed. The second important point is that the shiftOption() function is a bit overkill: its only real task is its embedded forEach().
{ "domain": "codereview.stackexchange", "id": 23227, "lm_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, css, html5, sass", "url": null }
human-biology, biochemistry, medicinal-chemistry Title: Is there a short-term, very strong anesthetic, which can be blocked/delayed by other substances? Question migrated from World Building SE. (For fictional use only, of course :) ) I am looking for an anasthetic which fulfills the following criteria: very strong effect, induces a comatose state in a very short period of time quickly wears off (30 minutes~) with only minor impediments to the recipent upon awakening. Can be 'partially blocked' or delayed by the intake of some medicine or other substance (which needs to be not too uncommon). Maybe some receptors for the anasthetic are blocked by the substance or something similar. Ideally this would result in the recipent falling into a dream-like state for some minutes before the real effect kicks in. Does the anasthetic have to be made up, or does something like this actually exist? Xenon. It is like an ideal anaesthetic. See here.
{ "domain": "biology.stackexchange", "id": 4208, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "human-biology, biochemistry, medicinal-chemistry", "url": null }
ros, gazebo7, ros-kinetic PARAMETERS * /lucrezio/angular/z/has_acceleration_limits: True * /lucrezio/angular/z/has_velocity_limits: True * /lucrezio/angular/z/max_acceleration: 6.0 * /lucrezio/angular/z/max_velocity: 2.0 * /lucrezio/base_frame_id: base_footprint * /lucrezio/left_wheel: left_wheel_joint * /lucrezio/linear/x/has_acceleration_limits: True * /lucrezio/linear/x/has_velocity_limits: True * /lucrezio/linear/x/max_acceleration: 1.0 * /lucrezio/linear/x/max_velocity: 0.7 * /lucrezio/pose_covariance_diagonal: [0.001, 0.001, 0.... * /lucrezio/publish_rate: 50 * /lucrezio/right_wheel: right_wheel_joint * /lucrezio/twist_covariance_diagonal: [0.001, 0.001, 0.... * /lucrezio/type: diff_drive_contro... * /lucrezio/wheel_separation: 0.2 * /object_groups/livingroom: ['sink', 'burner_... * /objects/burner_stove/model: burner_stove * /objects/burner_stove/model_type: sdf * /objects/burner_stove/orientation: [0.0, 0.0, 0] * /objects/burner_stove/position: [2.868422, 2.2050...
{ "domain": "robotics.stackexchange", "id": 32253, "lm_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, gazebo7, ros-kinetic", "url": null }
Hence $P(X=1)+P(X=2)+\cdots+P(X=10)=\frac{1}{20}+\cdots\frac{1}{20}=10(\frac{1}{20})=1/2.$ Alternatively, we could have reasoned with symmetry as follows: every way of picking twenty balls out of twenty balls and keeping track of what order they come out will be like putting the balls in some order. The probability a specific ball will end up in a specific position is equal to the same probability for any other specific ball, say $p$. Since at least one ball must be in the position we have that the sum of each ball's probability being there equals one, or $20p=1$, hence $p=1/20$. Sum this over the first ten positions for the red ball and you get $10(1/20)=1/2$ as the probability the red ball is in the first ten positions. Since it makes no difference whether we actually take out the last ten balls or keep them in the box, this must be our desired value. Two quicker ways could have been the following:
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9715639686018701, "lm_q1q2_score": 0.8475412902391396, "lm_q2_score": 0.8723473879530491, "openwebmath_perplexity": 192.41788502249585, "openwebmath_score": 0.9290082454681396, "tags": null, "url": "http://math.stackexchange.com/questions/65666/finding-the-probability-that-red-ball-is-among-the-10-balls" }
vba, excel, autocomplete Do to implicit conversion no does not need to be cast to a String. The compiler automatically does it for you. Dim nos As String nos = CStr(no) ' no to string (now nos) Use dynamic ranges whenever possible. Set valeurnorm = Sheets("Liste Employé").Range("A2:A200").Find(nos) Assuming the name list is the only thing in column A, you should dynamically size you range to fit the data like this: With Sheets("Liste Employé") Set valeurnorm = .Range("A2", .Cells(.Rows.Count, "A").End(xlUp)).Find(nos) End With Using Dynamic Named Ranges helps to give your code identity. And that is what we want to do as developers. If you have to comeback a year from now, you may not know what StandarValues represent but you will immediately understand what EmployeeNames are. Set employeeNames= Sheets("Liste Employé").Range("EmployeeNames").Find(nos) Alerts are necessary but having to click a MsgBox() can get irritating. I would prefer that:
{ "domain": "codereview.stackexchange", "id": 38993, "lm_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, autocomplete", "url": null }
newtonian-mechanics, classical-mechanics, rotational-dynamics, moment-of-inertia Title: Two Cylinders on Ramp Suppose I have two cylinders: a light one and a heavy one. Now, I let the cylinders roll down a ramp without slipping. My question is, which one will get to the bottom of the ramp first, and why? Let's take a look at the net force for a cylinder on an inclined plane: $$ \Sigma F_{\parallel} = mg\sin{\theta} - f\tag{1}$$ where $f$ is force of friction. Now the torque about the COM (which is the point about which there is rotation) is: $$\Sigma \tau = Rf \tag{2}$$ where $R$ is the radius of the cylinder. By Newton's second law, Eq (1) and (2) become: $$ ma = mg\sin{\theta} - f\tag{3}$$ $$I\alpha = Rf \tag{4}$$ Since there is no slipping $a = R \alpha$. We get, $$I \dfrac{a}{R} = Rf \tag{5}$$
{ "domain": "physics.stackexchange", "id": 73061, "lm_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, classical-mechanics, rotational-dynamics, moment-of-inertia", "url": null }
quantum-mechanics, energy, photons, frequency Assuming the electric field of an electromagnetic wave is of the form: $$E=E_0 sin(\frac{2 \pi}{\lambda}x-2\pi vt)$$ Where $v$ is the frequency of the wave, and $\lambda$ is the wavelength. Say the electromagnetic field interacts with some particle with unit mass and charge, located at point $x=0$ (for simplicity), we can get the particle's equation of motion along the axis of the electric field (y axis): $$\ddot{y}=E$$ $$\ddot{y}=E_0 sin(-2\pi v t)$$ Integrating with respect to time we get the velocity: $$\dot{y}=\frac{E_0}{2\pi v} cos(2\pi v t)$$ For simplicity, we'll take the maximum kinetic energy the electric field inflicts on the particle to be the energy of the electromagnetic wave: $$\varepsilon=\frac{1}{2}\dot{y}_{max}^2$$ $$\dot{y}_{max}=\frac{E_0}{2\pi v}$$ $$\varepsilon=\frac{1}{2}(\frac{E_0}{2\pi v})^2$$ $$\varepsilon=\frac{E_0^2}{8\pi ^2} \frac{1}{v^2}$$ We therefore get that: $$\varepsilon \propto \frac{1}{v^2}$$
{ "domain": "physics.stackexchange", "id": 89113, "lm_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, energy, photons, frequency", "url": null }
habitable-zone, hypergiants If a star is 100 times as luminous as the Sun, a planet at a distance of 10 AU will receive as much light from it as Earth gets from the Sun. If a star is 1,000 times as luminous as the Sun, a planet at a distance of 31.622 AU will receive as much light from it as Earth gets from the Sun. If a star is 10,000 times as luminous as the Sun, a planet at a distance of 100 AU will receive as much light from it as Earth gets from the Sun. Since the list of the few dozen most luminous stars known includes luminosities between 1,000,000 times that of the Sun and at least 6,400,000 times that of the Sun, a planet in orbit around such stars woudl have to orbit at least 1,000 AU from the star, and up to at least 2,529.822128 AU from the star, to recieve exactly as much radation from those stars as Earth receives from the Sun. https://en.wikipedia.org/wiki/List_of_most_luminous_stars[3]
{ "domain": "astronomy.stackexchange", "id": 4829, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "habitable-zone, hypergiants", "url": null }
mass, higgs edit after good comment from - Francesco Bertolaccini The release of energy in fusion and fission processes can also be calculated with $\Delta E=\Delta m c^2$ - the energies released are much larger than the energy mentioned above in the formation of the hydrogen atom from an electron and a proton. For more information the wikipedia page on fusion as a power source may be a good place to start.
{ "domain": "physics.stackexchange", "id": 17527, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "mass, higgs", "url": null }
electricity, statistical-mechanics, electric-current Title: Why is the average thermal velocity 0? Thermal velocity is the velocity of the free electron due to their random motion. So how is the average value 0? Their average speed would be non zero but their average velocity would be zero as long as they are not moving preferentially in one direction.
{ "domain": "physics.stackexchange", "id": 30726, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electricity, statistical-mechanics, electric-current", "url": null }
ros, moveit, catkin, moveit-setup-assistant, ros-jade Title: MoveIt Setup Assistant ROS Jade What is the preferred method for installing the MoveIt Setup Assistant with ROS Jade? Do I need to build from source? Thanks. Originally posted by user12821821 on ROS Answers with karma: 45 on 2015-09-03 Post score: 2 Do I need to build from source? Looking at ros.org/debbuild/jade?q=moveit (and wiki/moveit_setup_assistant), it looks like it hasn't been released for Jade yet. Building from source would seem to be your only option. Originally posted by gvdhoorn with karma: 86574 on 2015-09-04 This answer was ACCEPTED on the original site Post score: 4
{ "domain": "robotics.stackexchange", "id": 22565, "lm_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, moveit, catkin, moveit-setup-assistant, ros-jade", "url": null }
botany, taxonomy, nomenclature ined. means undescribed, and is used for a new proposed species before it has been formally described (common in paleontology when many papers about the same new specimen may be released at the same conference or where a specimen might not be identified yet still yield useful information in other ways.) if you put the exact form of the epithet (include the period) followed by the word "species" in google it will usually return the usage, failing that you can search this site.
{ "domain": "biology.stackexchange", "id": 8450, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "botany, taxonomy, nomenclature", "url": null }
python, calibration, camera-calibration Originally posted by altella on ROS Answers with karma: 149 on 2016-07-04 Post score: 0 The problem comes because python can not find modules in different paths. In my instalation "cameracalibrator.py" is on /opt/ros/indigo/lib/camera_calibration/ , while "calibrator.py" is on /opt/ros/indigo/lib/python2.7/dist-packages/camera_calibration/ One fast way to solve the problem is to copy "calibrator.py" to a directory camera_calibrator, so that the imports in python find what they are expected to find: /opt/ros/indigo/lib/camera_calibration/cameracalibrator.py /opt/ros/indigo/lib/camera_calibration/camera_calibration/calibrator.py /opt/ros/indigo/lib/camera_calibration/camera_calibration/calibrator.pyc /opt/ros/indigo/lib/python2.7/dist-packages/camera_calibration/calibrator.py /opt/ros/indigo/lib/python2.7/dist-packages/camera_calibration/calibrator.pyc /usr/share/app-install/desktop/xinput-calibrator:xinput_calibrator.desktop /usr/share/app-install/icons/xinput_calibrator.svg
{ "domain": "robotics.stackexchange", "id": 25132, "lm_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, calibration, camera-calibration", "url": null }
The book notes another description via "ovoids" in P^3(k). This then you might do your final project on that construction, and maybe also the Suzuki-Tits ovoids for q=8,32,128,... noted on page 16. Mild warning: the 3-(q^d+1,q+1,1) designs coming from P^1(F_{q^d}) are sometimes called "spherical geometries". Indeed over R there are inversive spaces of all dimensions d, each of which gives an infinite Steiner 3-design -- namely, the d-sphere with its circles -- and the derived 2-design is R^d with its lines. But once d>2 there's no directly analogous construction in the finite case: R has no algebraic extension of degree d, while quadratic forms in d+2>4 variables over a finite field don't work because they have isotropic lines whereas the Euclidean sphere contains no Euclidean lines. Feb. 22 -- intro to strongly regular graphs (chapter 2)
{ "domain": "harvard.edu", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9907319853876677, "lm_q1q2_score": 0.8277402594148112, "lm_q2_score": 0.8354835330070839, "openwebmath_perplexity": 2557.5821634393883, "openwebmath_score": 0.8611697554588318, "tags": null, "url": "http://abel.math.harvard.edu/~elkies/M155.15/notes.html" }
java, project-euler, primes Out of interest, the difference between long-based and BigInteger performance is large. Here are the time differences for a set of calculations where the (long) calculation does (n % i) == 0 and the (BI) calculation does n.mod(BigInteger.valueOf(i).equals(BigInteger.ZERO) First prime factor of 2305843009213693965 is 3 in 0.000003sec (long) and 0.001277sec (BI) First prime factor of 2305843009213693967 is 2305843009213693967 in 7.946315sec (long) and 63.071495sec (BI) First prime factor of 2305843009213693969 is 37 in 0.000005sec (long) and 0.000984sec (BI) First prime factor of 2305843009213693971 is 3 in 0.000003sec (long) and 0.000978sec (BI) First prime factor of 2305843009213693973 is 2305843009213693973 in 7.892226sec (long) and 62.610628sec (BI) First prime factor of 2305843009213693975 is 5 in 0.000005sec (long) and 0.000944sec (BI) First prime factor of 2305843009213693977 is 3 in 0.000004sec (long) and 0.000913sec (BI)
{ "domain": "codereview.stackexchange", "id": 5622, "lm_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, project-euler, primes", "url": null }
# euclidean distance in r 0 yorum
{ "domain": "kalpehli.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9553191284552528, "lm_q1q2_score": 0.833370136858242, "lm_q2_score": 0.8723473779969194, "openwebmath_perplexity": 859.4582796240163, "openwebmath_score": 0.7534364461898804, "tags": null, "url": "http://kalpehli.com/srhuil/0fv6vw9.php?id=61fab9-euclidean-distance-in-r" }
solar-system, habitable-zone, titan, europa, enceladus Title: Why the Circumstellar Habitable Zone is defined as it is, if life could be possible outside of it? According to Circumstellar habitable zone In astronomy and astrobiology, the circumstellar habitable zone (CHZ), or simply the habitable zone, is the range of orbits around a star within which a planetary surface can support liquid water given sufficient atmospheric pressure But then you have moons in the solar system such as Titan, Europe, Enceladus where some scientists believe life could be possible. The most likely cradles for life inside our solar system Life on Titan Why the CHZ is defined as it is, if life could be possible outside of it? Is it pourly defined or scientists believing there could be life outside the CHZ in the solar system are having too much wishful thinking? From your first link, the definition is:
{ "domain": "astronomy.stackexchange", "id": 3483, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "solar-system, habitable-zone, titan, europa, enceladus", "url": null }
java, search Title: Searching for a specific object in an ArrayList Is this an efficient way to search for a specific object in an ArrayList? Product is the superclasS. Mobo, CPU, RAM, GPU... are the subclasses. ArrayList(called stock) stores Product objects. I consider that they key i am searching is found when class and the attribute "model"(you can see the getter of the attribute in my code) are matching. public static boolean checkAvailability(ArrayList<Product> stock, Product product) { boolean found = false; for(Product p: stock) { if(p instanceof Mobo && (product.getModel() == p.getModel())) { found = true; break; }; if(p instanceof CPU && (product.getModel() == p.getModel())) { found = true; break; }; if(p instanceof GPU && (product.getModel() == p.getModel())) { found = true; break; }; if(p instanceof RAM && (product.getModel() == p.getModel())) {
{ "domain": "codereview.stackexchange", "id": 30137, "lm_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, search", "url": null }
$\begin{cases}\text{ }y-{y}_{1}=m\left(x-{x}_{1}\right)\hfill & \hfill \\ y-\left(-1\right)=3\left(x - 6\right)\hfill & \text{Substitute known values}.\hfill \\ \text{ }y+1=3\left(x - 6\right)\hfill & \text{Distribute }-1\text{ to find point-slope form}.\hfill \end{cases}$ Then we use algebra to find the slope-intercept form. $\begin{cases}y+1=3\left(x - 6\right)\hfill & \hfill \\ y+1=3x - 18\hfill & \text{Distribute 3}.\hfill \\ \text{ }y=3x - 19\hfill & \text{Simplify to slope-intercept form}.\hfill \end{cases}$ ### Try It 3 Write the point-slope form of an equation of a line with a slope of –2 that passes through the point $\left(-2,\text{ }2\right)$. Then rewrite it in the slope-intercept form. Solution ## Writing the Equation of a Line Using Two Points
{ "domain": "lumenlearning.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9940889319318064, "lm_q1q2_score": 0.8262301026490894, "lm_q2_score": 0.831143045767024, "openwebmath_perplexity": 180.9079426343026, "openwebmath_score": 0.855974018573761, "tags": null, "url": "https://courses.lumenlearning.com/ivytech-collegealgebra/chapter/write-the-point-slope-form-of-an-equation/" }
entanglement Title: Predicting rotations with many EPR pairs I was explaining to a colleague that you can't use EPR pairs to communicate information, as it violates the no-communication theorem. This lead me to thinking... If I have let's say 1,000,000 EPR pairs shared with someone far away. We agree ahead of time that if I perform a rotation $\theta$ on my qubit, then I mean to communicate the bit $0$, and when I perform the rotation $\phi$, then I mean to communicate the bit 1. We agree that at some time in the future (assume we have synchronized clocks), that I will perform the same rotation on all 1,000,000 of my EPR pair halves. After some agreed upon time, the holder of the other 1,000,000 pair halves measures his qubits to predict which rotation I made on my qubits. Then with high probability they can guess the message I wanted to send. I know there is something wrong in this configuration, but I can't point it down. If this would be possible, then I could communicate faster than light...
{ "domain": "quantumcomputing.stackexchange", "id": 1701, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "entanglement", "url": null }
c++, algorithm, image, pathfinding, dijkstra Output: ... to = (-1, -1), from = (0, 0). total_cost = 2 ... to = (-1, 0), from = (0, 0). total_cost = 1 ... to = (-1, 1), from = (0, 0). total_cost = 2 ... to = (-1, 2), from = (0, 1). total_cost = 3 ... to = (-1, 3), from = (0, 2). total_cost = 4 ... to = (-1, 4), from = (0, 3). total_cost = 5 ... to = (0, -1), from = (0, 0). total_cost = 1 ... to = (0, 0), from = (0, 0). total_cost = inf ... to = (0, 1), from = (0, 0). total_cost = 1 ... to = (0, 2), from = (0, 1). total_cost = 2 ... to = (0, 3), from = (0, 2). total_cost = 3 ... to = (0, 4), from = (0, 3). total_cost = 4 ... to = (1, -1), from = (0, 0). total_cost = 2 ... to = (1, 0), from = (0, 0). total_cost = 1 ... to = (1, 1), from = (0, 0). total_cost = 2 ... to = (1, 2), from = (0, 1). total_cost = 3 ... to = (1, 3), from = (0, 2). total_cost = 4 ... to = (1, 4), from = (0, 3). total_cost = 5 ... to = (2, -1), from = (1, -1). total_cost = 3 ... to = (2, 0), from = (1, 0). total_cost = 2
{ "domain": "codereview.stackexchange", "id": 43480, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, algorithm, image, pathfinding, dijkstra", "url": null }
simulations, computational-physics, software Aside (2): The Leapfrog algorithm also (originally) uses interleaved positions and velocities however it can be reformulated so they are computed "in lockstep" (i.e. both defined at $t_i$). As far as I know such a reformulation doesn't exist for the Boris algorithm. This is generally known as a "starting" problem and occurs with a number of schemes. Higher order implicit schemes for example need the values at multiple previous time levels. The trick is to start out the simulation using one or more simpler schemes to get it going. For instance, you could use a 2nd order Runge-Kutta method for one step so you have values at $t_0$ and $t_1$, and then interpolate to $t_{0.5}$ and start your algorithm with that dataset. Any method would work, but a simple explicit scheme is going to be your best choice to get things moving.
{ "domain": "physics.stackexchange", "id": 36490, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "simulations, computational-physics, software", "url": null }
python, python-3.x, gui, flask, pyqt def run_app(): application.run(port=port, threaded=True) # Application Level qtapp = QtWidgets.QApplication(sys.argv) webapp = QtCore.QThread() webapp.__del__ = webapp.wait webapp.run = run_app webapp.start() qtapp.aboutToQuit.connect(webapp.terminate) # Main Window Level window = QtWidgets.QMainWindow() window.resize(width, height) window.setWindowTitle(window_title) window.setWindowIcon(QtGui.QIcon(icon)) # WebView Level window.webView = QtWebEngineWidgets.QWebEngineView(window) window.setCentralWidget(window.webView) # WebPage Level page = QtWebEngineWidgets.QWebEnginePage() page.acceptNavigationRequest = link_clicked page.load(QtCore.QUrl(ROOT_URL)) window.webView.setPage(page) window.show() return qtapp.exec_() Some of my concerns are: Is it a good decision not to use classes at all? Is the code readable and maintainable? Are there any suggestions to improve it?
{ "domain": "codereview.stackexchange", "id": 29536, "lm_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, gui, flask, pyqt", "url": null }
gravity <body> <canvas id="myCanvas" width="500" height="180"></canvas> <script> var canvas = document.getElementById('myCanvas'); var context = canvas.getContext('2d'); var player_pos_x = 50; var player_pos_y = 100; var cannon_pos_x = 450; var cannon_pos_y = 150; var rel_x = player_pos_x - cannon_pos_x; var rel_y = player_pos_y - cannon_pos_y;
{ "domain": "physics.stackexchange", "id": 40636, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gravity", "url": null }
c++, multithreading, c++17, callback, c++20 So instead i have added a replacement list to the broadcaster storing a pair of <listenerCookie, listener> which lists what updates should be done once the current message has been broadcasted to all listeners. The updates are performed at the end of the notify_all function. This guarantees that the old callback is never called again and that the cookie held stays valid but now points to the new callback. But this design seems complicated and unsafe: it required adding an extra member function to the broadcaster class, which should only be called from inside a callback. And that is easy to misuse unless code comments (and the horrible function name :p) saying to only invoke from inside a callback are honored. Or is there a way to ensure a function can only be called by the invoked callback? Am i missing some simpler solution?
{ "domain": "codereview.stackexchange", "id": 40345, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, multithreading, c++17, callback, c++20", "url": null }
mass, astrophysics, galaxies, luminosity, galaxy-rotation-curve Title: Convert from Relative Magnitude to Mass I have data which gives me the magnitude density (${\rm mag}\,{\rm arcsec}^{-2}$) of M31 as a function of radius. How can I convert these data to the (enclosed) mass at a given radius (for velocity curve analysis)? Here's a chart of the data. The odd thing about the magnitude profile is that it looks exactly like a mass profile which leads me to believe there's a simple way to relate the two. A magnitude is a somewhat convoluted measurement of luminosity. You probably have relative magnitude $m$ per $\rm arcsec^2$. You can start by using the distance modulus $m-M$ to calculate the absolute magnitude $M$: $$m-M=5\left(\log_{10}\left(\frac{d}{\rm pc}\right) - 1\right)$$ where $d$ is the distance. Once you have the absolute magnitude you can convert that to a luminosity using: $$M-M_\odot=-2.5\log_{10}\left(\frac{L}{\rm L_\odot}\right)$$
{ "domain": "physics.stackexchange", "id": 24825, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "mass, astrophysics, galaxies, luminosity, galaxy-rotation-curve", "url": null }
galaxy, dark-matter, galaxy-cluster, density If someone could help me on this issue, regards No. You need to specify structure formation and galaxy evolution for details, but in general, you will expect many galaxies in a dark matter halo. If you need a relation, the halo occupation distribution might be a start. The Wikipedia page references three good texts on the matter.
{ "domain": "astronomy.stackexchange", "id": 3354, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "galaxy, dark-matter, galaxy-cluster, density", "url": null }
ros, laser, callback, tf-listener, transform Originally posted by balakumar-s with karma: 137 on 2013-11-27 This answer was ACCEPTED on the original site Post score: 4 Original comments Comment by balakumar-s on 2013-11-27: @tfoote my karma is 15 so not able to accept my own answer. Comment by tfoote on 2013-11-27: I voted up your question. You should now have enough karma.
{ "domain": "robotics.stackexchange", "id": 16277, "lm_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, laser, callback, tf-listener, transform", "url": null }
Let's call a sequence "fibonacci-like" if it satisfies the recurrence $$s_{n+2} = s_n + s_{n+1}$$ for all $n$. It's easy to see (or to show) that if $s$ and $t$ are two fibonacci-like sequences, then so is the sequence that you get by multiplying every term of $s$ or of $t$ of them by some constant, and so is the sequence you get by adding together corresponding terms of $s$ and $t$. For example, $1,1,2,3,5,8\ldots$ and $2,8,10,18,28,\ldots$ are both fibonacci-like, and so is what you get if you multiply every element of $1,1,2,3,5,8\ldots$ by 3, namely $3,3,6,9,15,24,\ldots$, and so is what you get if you add them together: $3,9,12,21,33,54,\ldots$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9916842229971375, "lm_q1q2_score": 0.8858808442390413, "lm_q2_score": 0.8933094060543488, "openwebmath_perplexity": 172.268803242183, "openwebmath_score": 0.940873384475708, "tags": null, "url": "http://math.stackexchange.com/questions/608465/is-there-a-proof-for-this-fibonacci-relationship" }
javascript, jquery, html, css, fancybox <td id="Cell.1.1" style= "text-Align: Center; vertical-align: Middle; background-color: #F8F8F8; width: 120px; border-color: black; border-width: 1px; border-left-style: Solid; border-right-style: Solid; border-top-style: Solid; border-bottom-style: Solid;"> <span style=""><input type="text" name="_QPQ3_QAD__LP_Q__02_QQ3__Timer" id= "_Q1_Q1_Q0" class="mrEdit" autocomplete="on" style="" maxlength="10" value= "" /></span><span style=""><input type="checkbox" name= "_QPQ3_QAD__LP_Q__02_QQ3__Timer_XNo__Ans" id="_Q1_Q1_Q0_X0" class="mrMultiple" style="" value="No__Ans" /> <label for="_Q1_Q1_Q0_X0"><span class= "mrMultipleText" style= "font-size: 8pt; text-Align: Left; vertical-align: Middle; background-color: #F8F8F8; width: 250px; border-color: black; border-width: 1px; border-left-style: Solid; border-right-style: Solid; border-top-style: Solid; border-bottom-style: Solid;"> No Answer</span></label></span></td> </tr>
{ "domain": "codereview.stackexchange", "id": 14962, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, jquery, html, css, fancybox", "url": null }
general-relativity, cosmology, spacetime Where $Γ^{\mu}_{\sigma\nu}$ are the christoffel symbols. This is the crux of general relativity, that the einstein field equations describe how mass and energy curve spacetime, and how that spacetime tells objects in it how to move, and how objects in that spacetime will follow the straightest paths in it, which creates gravity. EDIT: Another commenter here has suggested that i explain some of the other terms in the field equations, which i will. I’ll start off by giving the equation for the christoffel symbols in terms of the metric and it’s derivatives. The equation is: $$Γ^{\mu}_{\sigma\nu}=\frac{1}{2}g^{\mu\lambda}(g_{\lambda\sigma ,\nu}+g_{\lambda\nu , \sigma}-g_{\sigma\nu , \lambda})$$ The commas represent partial derivatives of the metric terms with respect to the indices following them, and $g^{\mu\lambda}$ is the inverse metric tensor, just like how you can have the inverse matrix of a matrix, which the metric tensor can be represented as.
{ "domain": "physics.stackexchange", "id": 58840, "lm_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, cosmology, spacetime", "url": null }
nuclear-physics, water, neutrons, nuclear-engineering, absorption Title: Why is water a good neutron absorber? I've seen this question asked multiple times, and the answer is never detailed. I initially assumed that either hydrogen or oxygen had relatively large neutron absorption cross sections, however that is not the case, so what actually makes water a good absorber? Water is useful for neutron shielding, even though water is not an especially good neutron absorber. Oxygen nuclei are basically invisible to neutrons, since oxygen-16 is a spinless doubly-magic nucleus. However, hydrogen has a both large scattering cross section and a low mass. Basically, in every hydrogen-neutron scattering event, the outgoing neutron momentum is spherically symmetric in a reference frame with half of the neutron’s initial speed. Since the neutron momentum is roughly halved with every scatter, neutrons with basically any energy reach thermal equilibrium with the water quickly.
{ "domain": "physics.stackexchange", "id": 92760, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "nuclear-physics, water, neutrons, nuclear-engineering, absorption", "url": null }
c#, .net, tic-tac-toe, mvp Title: TicTacToe in MVP Winforms I took the source code from this question, (thank you gaessaki for the motivation!) and did a lot of refactoring. I use 4 projects: Common: contains mainly interfaces and enumerations referenced by other projects. Model: Knows nothing of the others, just maintains the game logic and state. Presenter: References the Model directly and accesses the View via the IView interface. Acts as mediator between them. View: References the Presenter. Is pretty dumb, can only query the board situation and the game status and display them. For every action (playing a move, restarting, etc.) it simply informs the presenter.
{ "domain": "codereview.stackexchange", "id": 24974, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, .net, tic-tac-toe, mvp", "url": null }
thermodynamics, phase-transition Title: What happens when you melt a solid in a perfectly enclosed space? Here are the parameters: You have a perfectly airtight box made of a very resistant material. You have a block of a substance that melts normally (such as aluminium) that fits perfectly in the box. Since liquids are less dense than their solid counterparts but a liquid cannot be compressed, what would happen if you were to place the solid in the box, closed it and then attempted to melt it by increasing the temperature? I am assuming the box is strong enough to withstand the pressure, won't react with the melting cube and also won't melt itself. Since liquids are less dense than their solid counterparts but a liquid cannot be compressed, what would happen if you were to place the solid in the box, closed it and then attempted to melt it? Liquids are not always less dense than their solid counterparts. Liquids can be compressed, though it takes a lot of pressure to change their volume appreciably.
{ "domain": "physics.stackexchange", "id": 78225, "lm_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, phase-transition", "url": null }
$$\displaystyle \therefore \sum_{j=1}^k j = \dfrac{k(k + 1)}{2} = \dfrac{k^2 + k}{2}.$$ $$\displaystyle \sum_{j=1}^{k+1} j = \left ( \sum_{j=1}^k j \right ) + k + 1 = \dfrac{k^2 + k}{2} + \dfrac{2k + 2}{2} = \dfrac{k^2 + 3k + 2}{2} = \dfrac{(k + 1)(k + 2)}{2} = \dfrac{(k + 1)\{(k + 1) + 1\}}{2}.$$ This is why I said it is so hard to help with proofs. #### Mondo ##### New member Yes @lex, this is probably the easiest proof but here I wanted to dig deeper into the case where we have odd number of elements. I feel like we covered it all now. Thanks! #### lex ##### Full Member x+1+x=n⟹2x=n−1⟹x=n−12.x+1+x=n⟹2x=n−1⟹x=n−12.\displaystyle x + 1 + x = n \implies 2x = n - 1 \implies x = \dfrac{n - 1}{2}. And obviously the middle term is x + 1 If the number of pairs is (n-1)/2, then that's the number of elements to the left of the middle one. Add 1 and you get the middle index. Yes. I see that. Dealt with by JeffM and lev888
{ "domain": "freemathhelp.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9597620596782468, "lm_q1q2_score": 0.8405471160529613, "lm_q2_score": 0.8757869803008764, "openwebmath_perplexity": 413.20089830722316, "openwebmath_score": 0.7663042545318604, "tags": null, "url": "https://www.freemathhelp.com/forum/threads/prove-middle-term-formula.129845/" }
astrophysics, solar-system, supernova There was an answer mentioning that "the formation of many elements in earth was due to supernova nucleosynthesis" as told by someone. Hence, a question crosses my mind... If the elements were formed due to the explosion of a supernova, then there should be a remnant like a black-hole or a neutron star nearby. Were there any nearby? I'm not sure all the details of the Solar System formation are understood, but the general principles are well established. The dust cloud from which the Solar System formed was probably roughly homogenous. However once the Sun began to form, the dust cloud around it rapidly became differentiated. The heavier non-volatile elements stayed near the Sun while the lighter more volatile elements were blown outwards. That's why the inner planets are rocky while the outer planets are gaseous or icy. Incidentally, the water on Earth probably came from comets after Earth was formed, though views are mixed on this subject.
{ "domain": "physics.stackexchange", "id": 21693, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "astrophysics, solar-system, supernova", "url": null }
c++, event-handling, callback int main() { std::stringstream ss; Event_handler_raii<Test_event_handler> handler(ss); Event_channel::broadcast(Test_event{456}); // ss now contains "456" } Edit: I want to get rid of the singletons and just pass Event_channel around. But than how do I store event handler of different types under a generic interface? I am not a big user of metaprogramming, mostly i have found on the layers that I work on i don't need the amount of flexibility that is being offered. But i see a couple of issues not so much with the design but the functionality. I'll leave the review of the template architecture to others.
{ "domain": "codereview.stackexchange", "id": 27080, "lm_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++, event-handling, callback", "url": null }
c# } } } } } ProgReferences namespace YWIPSnitch { public class ProgReferences { //Variable Declarations string sqlConnString = ("SERVER=computerName; DATABASE=ywbwrat; UID=UID; password=Password;"); string registerInsertSQL = @"INSERT INTO `ywbwrat`.`register` (`computer_name`, `username`, `register_type`) VALUES (@computer_name, @username, @register_type)"; string bwUsageInsertSQL = @"INSERT INTO `ywbwrat`.`bw_info` (`computer_name`, `username`, `bytes_sent`, `bytes_received`) VALUES (@computer_name, @username, @bytes_sent, @bytes_received);"; string viewList = @"SHOW FULL TABLES IN ywbwrat WHERE TABLE_TYPE LIKE 'VIEW';";
{ "domain": "codereview.stackexchange", "id": 23271, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#", "url": null }
neuroscience, brain, hearing, neurophysiology, neurodegenerative-disorders Title: What is the mechanism behind tinnitus? I seem to have come across two contrasting explanations for tinnitus induced by loud noises- i.e. damage to the hair cells in the cochlea. On the one hand, I have read that damage to the hair cells results in them releasing excess glutamate, the neurotransmitter that carries the impulse from the hair cells to the neurones in the auditory nerve. This would result in the neurones constantly being excited, which I can understand would lead to constantly perceiving sound. On the other hand I have read that when the hair cells are damaged, the auditory cortex is no longer receiving electrical impulses from the hair cells that detect those frequencies, and so the neurones start to fire (although I am not sure why no input would lead to neurones going off by themselves! Surely there must be some input to cause the initial depolarisation to cause an action potential?) and so you perceive a constant sound.
{ "domain": "biology.stackexchange", "id": 3563, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "neuroscience, brain, hearing, neurophysiology, neurodegenerative-disorders", "url": null }
trees Notice that there is atleast a split at the insertion of these elements: $4,6,8,10,12...... $ That are all even numbers leaving 2. Thus total such splits are $n/2$ Total higher level splits are thus:$n/4$ Total splits for the higher level than the previous one: $n/8$ Thus the total splits until the $nth$ element is inserted in the B-Tree is: $n/2+n/4+n/8+......$ Which results in $n$. This is more than expected. I've made two approximations here: 1) Number of higher level splits is equal to half of the immediate lower level splits.This increases our answer. 2) Some starting elements don't contribute to the splits. Maybe these are the reasons why the answer is coming more. I can't enumerate these values exactly. Finding these values exactly would help me very much. Any help appreciated.
{ "domain": "cs.stackexchange", "id": 8812, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "trees", "url": null }
javascript, unit-testing, rational-numbers function add(f1, f2) { var r = gcd(f1.d, f2.d); return createFraction( f1.n * r[1] + f2.n * r[0], f1.d * r[1] ); } function subtract(f1, f2) { return add(f1, negate(f2)); } Testing Code function equals(f1, f2) { return f1.n === f2.n && f1.d === f2.d; } function toString(f0) { return f0.n + "/" + f0.d; } function testEquals(line, f1, f2) { if (!equals(f1, f2)) console.log(line + " failed: " + toString(f1) + " !== " + toString(f2)); else console.log(line + " good: " + toString(f1)); } var line = 0; testEquals(line++, add(createFraction(10, 40), createFraction(3, 30)), createFraction(7, 20)); testEquals(line++, subtract(createFraction(8, 3), createFraction(11, 30)), createFraction(69, 30)); testEquals(line++, multiply(createFraction(8, 3), createFraction(11, 30)), createFraction(88, 90)); testEquals(line++, divide(createFraction(8, 3), createFraction(11, 30)), createFraction(240, 33));
{ "domain": "codereview.stackexchange", "id": 20593, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, unit-testing, rational-numbers", "url": null }
beginner, php, sql, mysqli, db2 //If the existingRecords array is empty, meaning no records exist for that dealer/sku, then preform the insert if($row_cnt == 0){ //INSERT # of records equal to QUANTITY $stmt = $PDO->prepare(" INSERT IGNORE INTO placements_new (sku_id, group_id, dealer_id, start_date, expire_date, locations, order_num) SELECT id, sku_group_id, :DEALER, DATE_ADD(DATE_FORMAT(CONVERT(:SHIPDATE, CHAR(20)), '%Y-%m-%d'),INTERVAL 7 DAY) as start_date, DATE_ADD(DATE_FORMAT(CONVERT(:SHIPDATE, CHAR(20)), '%Y-%m-%d'),INTERVAL 127 DAY) as expire_date, :QUANTITY, :INVOICE FROM skus s WHERE s.frame=:FRAME AND s.cover1=:COVER AND s.color1=:COLOR "); $PDO->beginTransaction(); $i = 0; while($db2row = odbc_fetch_array($Db2ShipRslt)) {
{ "domain": "codereview.stackexchange", "id": 30211, "lm_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, php, sql, mysqli, db2", "url": null }
homework-and-exercises, lagrangian-formalism, constrained-dynamics This was found by finding the angular momentum of the point mass and relating it to the external torque due to gravity I am unsure of what I have messed up on in the Lagrangian. Could anyone help? The massless ring with a rod serve as holonomic constraints. The main object is a mass point p. The motion takes place in the $xy$ plane of an inertial coordinate system $Oxyz$ where axis $Ox$ is horizontal and axis $Oy$ is vertical. Then the position of the point p is given by the coordinates $(x_p, y_p)$. It's velocity is then $\Big(\frac{dx_p}{dt}, \frac{dy_p}{dt}\Big)$. The gravitational potential energy of the point p is as usual $U(x_p, y_p) = mg\,y_p$. Therefore the Lagrangian, in $xy$ coordinates is $$L = \frac{m}{2}\left(\Big(\frac{dx_p}{dt}\Big)^2 + \Big(\frac{dx_p}{dt}\Big)^2\right) - mg\, y_p$$ subject to the holonomic constraints imposed by the ring with a rod and the nature of the ring's motion.
{ "domain": "physics.stackexchange", "id": 52445, "lm_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, lagrangian-formalism, constrained-dynamics", "url": null }
evolution, movement Source: http://www.talkorigins.org/faqs/homs/pelvis.html As you can see, the Asutralopithecus pelvis resembles human pelvis more than chimpanzee's (wich is adapted to a primarily quadrupedal movement). Source: https://web.archive.org/web/20160817080843/http://users.rcn.com/jkimball.ma.ultranet/BiologyPages/P/Primates.html In this image you can see the position of the foramen magnum in a typical pure quadrupedal mammalian, such as a dog. The foramen inserts in the posterior part of the cranium. In the human, the foramen inserts in the base of the skull, due to de erected position. In chimpanzees, which have quadrupedal march, but can also display some bipedal movements, the foramen is slightly displaced towards the basis of the cranium, in an intermediate position between both.
{ "domain": "biology.stackexchange", "id": 3280, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "evolution, movement", "url": null }
java, json, generics, gson } Stores Stores are an extension of saveables. A store is a LinkedHashMap which will quickly and easily save all of the objects in it as a map in GSON. Unfortunately, I'm not even sure where to start on this. I cannot extend two objects (the two being a LinkedHashMap<String, T> and a Saveable), but I also cannot use interfaces for the Saveable object. I previously tried the following using the IStorable and ISaveable classes as an alternative to the abstract Saveable class I've shown you above, but this resulted in another very ugly and non-robust solution to my issue. Saveable.java public class Saveable { // Suppress default constructor private Saveable() {}
{ "domain": "codereview.stackexchange", "id": 40795, "lm_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, json, generics, gson", "url": null }
np-hardness, optimization Title: Is it NP-Complete to determine if a quadratic program (QP) has multiple solutions? If this is known, can someone point me to a proof? Edit: A QP is essentially a LP with a quadratic objective. That is, it looks like: minimize $\frac{1}{2} x^T Q x + c^T x$ s.t. $Ax \leq b$ It's known that in general, solving a QP is NP-Hard. Is it NP-Complete to know if there are at least two different solutions to the QP? [Since I could not edit my comment, I repost it here as an answer] To determine if a quadratic program (QP) has multiple solutions (so you have to answer "Yes" if the QP has more than one solutions, and "No" if it has one or no solution) can be shown to be NP-complete by modifying the proof on NP-completeness of QP here http://link.springer.com/article/10.1007%2FBF00120662.
{ "domain": "cstheory.stackexchange", "id": 2346, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "np-hardness, optimization", "url": null }
waves, acoustics, harmonic-oscillator, string, vibrations $$ \mu dx\frac{\partial^2u_i}{\partial t^2} = k(u_{i+1}-2u_i+u_{i-1}). $$ The displacement of the different masses may be thought of as various evaluations of a displacement field (called the particle displacement), such that we may write \begin{gather} u_i(t) = u(x_i,t), \\ u_{i+1}(t) = u(x_i+dx,t), \\ u_{i-1}(t) = u(x_i-dx,t). \end{gather} (Note that we are assuming that the displacement is small compared to $dx$, and so this analysis is the small signal approximation.) If we assume that $u$ is differentiable, then as $dx\rightarrow0$ we may obtain \begin{gather} u_{i+1}(t) = u(x_i,t) + dx\left.\frac{\partial u}{\partial x_i}\right|_{x_i,t} + \frac{dx^2}{2}\left.\frac{\partial^2 u}{\partial x_i^2}\right|_{x_i,t} + O(dx^3), \\ u_{i-1}(t) = u(x_i,t) - dx\left.\frac{\partial u}{\partial x_i}\right|_{x_i,t} + \frac{dx^2}{2}\left.\frac{\partial^2 u}{\partial x_i^2}\right|_{x_i,t} + O(dx^3). \end{gather}
{ "domain": "physics.stackexchange", "id": 99232, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "waves, acoustics, harmonic-oscillator, string, vibrations", "url": null }
python, python-3.x, client def query(self, page: int) -> dict[str, Any]: return { 'operationName': 'TrafficNews', 'variables': { 'filter': { 'country': { 'country': self.country, 'federalState': self.state, 'street': self.street, 'showConstructionSites': self.construction_sites, 'showTrafficNews': self.traffic_news, 'pageNumber': page, } } }, 'query': GRAPHQL, } class NewsResponse(NamedTuple): id: int type: str country: Optional[str] street: str street_number: Optional[str] headline: Optional[str] details: str @classmethod def from_json(cls, json: dict[str, Any]) -> 'NewsResponse': street_info = json.get('streetSign') or {}
{ "domain": "codereview.stackexchange", "id": 42632, "lm_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, client", "url": null }
laser There is code for this readily available in PCL. http://pointclouds.org/documentation/tutorials/random_sample_consensus.php The example given there is for planes ans spheres, but ransac for lines is also implemented. Just have a look at the PCL documentation. Besides the bare ransac, segmentation using ransac is also implemented. Just read the documentation. Best G.
{ "domain": "robotics.stackexchange", "id": 14856, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "laser", "url": null }
python, python-3.x, csv LOOKUP_FUNCS = get_lat_lon, google_lat_lon def find_coordinates(address, lookup_funcs=LOOKUP_FUNCS): for function in lookup_funcs: lat, lon = function(address) if (lat, lon) != (None, None): return lat, lon return None, None Note that I assume here that the functions return None, None, instead of 0, 0, which is arguably a better value for something non-existing. Theoretically, some address could actually be at 0, 0. Note also that csv.writer translates None to "", when writing to a file (see the documentation). A main that does as much as yours is fine, IMO, if this is the only thing this script does. But you might still want to rename it to add_lat_lon(in_file, out_file) or something like this, to be able to import the actual functionality in some other script.In your new main block (or directly under the if __name__ == '__main__': guard), you could then call that function. It is perfectly fine to return tuples. Some additional notes:
{ "domain": "codereview.stackexchange", "id": 29087, "lm_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, csv", "url": null }
star, spectroscopy, elemental-abundances Under what regime is this approximation valid? Also, I am unable to solve this equation because I don't know what $N^{\odot}(Li)$ is. How can I determine a reputable value for $N^{\odot}(Li)$? The measurement of a chemical abundance is not a question of using a simple equation. The simplest it gets is using a "curve of growth", which relates equivalent width to abundance and assumes you already know the temperature of the star and its surface gravity. For the Li 6708A line, the relevant tables, that can be interpolated, are found in Soderblom et al. (1993). http://adsabs.harvard.edu/abs/1993AJ....106.1059SS . These are LTE curves of growth based on Atlas atmospheric models.
{ "domain": "astronomy.stackexchange", "id": 1173, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "star, spectroscopy, elemental-abundances", "url": null }
python Compress_7z should start lower-case and probably should also say compress_7zip. I'm agreeing that the literal "7" would be appropriate here, given the format name. DAC is a bad variable name, as you've to read the docstring to even begin to understand what this parameter is doing. A better name might be, well, delete_files_after perhaps. The rest of the parameters should also all be lower-case. Try and apply consistent formatting, or use an IDE or command-line tool to do it for you (right now there's no whitespace after some of the commas for example, also some of the quotes are single and some are double for no good reason). The docstring is not very standard, though at least it mentions the value range of the parameters, which is obviously good.
{ "domain": "codereview.stackexchange", "id": 37445, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python", "url": null }
experimental-chemistry, home-experiment, teaching-lab You say that finance is not a problem, but do not underestimate the price of all the chemicals and equipment you will need to do any bit of serious chemistry. Scales, vacuum pumps, glassware, solvents, a dedicated fridge, a specially constructed cabinet to store flammables, a fume hood with explosion proof suction, etc (and I'm not even mentioning NMR, mass spectrometers, IR, all of which are available to you as student). To run any decent lab from your backyard be prepared to invest several thousands of dollars (or euros). This can be done of course a lot cheaper, but then you will be limited in your possibilities or you will have to exchange safety for money.
{ "domain": "chemistry.stackexchange", "id": 2956, "lm_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-chemistry, home-experiment, teaching-lab", "url": null }
c++, c++11, vectors, raii, sfinae iterator end() {return buffer + length;} iterator rend() {return std::reverse_iterator<iterator>(begin());} const_iterator end() const {return buffer + length;} const_iterator rend() const {return std::reverse_iterator<iterator>(begin());} const_iterator cbegin() const {return begin();} const_iterator crbegin() const {return rbegin();} const_iterator cend() const {return end();} const_iterator crend() const {return rend();} Non-Mutating Functions: size_type size() const {return length;} bool empty() const {return length == 0;}
{ "domain": "codereview.stackexchange", "id": 19213, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, c++11, vectors, raii, sfinae", "url": null }
gps The third is to use message filters to synchronise the data received from the two sensors and calculate the distance when data is received from both. With a message filter, you provide it a set of inputs (your two topics, /fix and /fix1), and register a callback. The callback is called when the message filter has data meeting its condition, such as a message on each topic with similar timestamps. If your GPS sensors are not producing data in sync, then you might need to use the approximate time policy filter. You can use it like this: #!/usr/bin/env python
{ "domain": "robotics.stackexchange", "id": 27727, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gps", "url": null }
qiskit If you plan on evaluating many circuits in parallel on a chip, you should be aware that each set of qubits might yield very different estimates for $\ell(\theta, x)$ due to the variation in noise and qubit imperfections across a device, as well as nonlocal effects like crosstalk (assuming you are not using a fault tolerant quantum computer of course). This might make it hard for your model parameters to converge.
{ "domain": "quantumcomputing.stackexchange", "id": 5081, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "qiskit", "url": null }
intelligence Gallup anaesthetised the chimpanzees and then painted a red alcohol-soluble dye on the eyebrow ridge and on the top half of the opposite ear. When the dye dried, it had virtually no olfactory or tactile cues. Gallup then returned the chimpanzees to the cage (with the mirror removed) and allowed them to regain full consciousness. He then recorded the frequency which the chimpanzees spontaneously touched the marked areas of skin. After 30 minutes, the mirror was re-introduced into the room and the frequency of touching the marked areas again determined. The frequency of touching increased to 4-10 with the mirror present compared to only 1 when the mirror had been removed. The chimpanzees sometimes inspected their fingers visually or olfactorily after touching the marks.
{ "domain": "biology.stackexchange", "id": 3796, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "intelligence", "url": null }
# what symmetry does system function H(z) have if h[n] is real? assuming h[n] is real... If frequency response $$H(e^{j\omega})$$ is Conjugate Symmetric: $$H(e^{-j\omega}) = H^*(e^{j\omega})$$ $$H(e^{j\omega}) = H^*(e^{-j\omega})$$ Then, what symmetry does the System Function $$H(z)$$ have? Is it the same symmetry as the frequency response $$H(e^{j\omega})$$, or is some type of symmetry like conjugate reciprocal symmetry? $$H(z) = H^*\left(\frac{1}{z^*}\right)$$ This is confusing the heck out of me, because they start with something that is conjugate symmetric as a frequency response then convert it to a z transform by substituting $$z=e^{j\omega}$$, then, suddenly by changing variable to z its "conjugate reciprocal symmetric", instead of just plain "conjugate symmetric"... except it doesn't actually tell you this anywhere... that the system function has this symmetry...
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9732407168145568, "lm_q1q2_score": 0.8213130726159843, "lm_q2_score": 0.8438951005915208, "openwebmath_perplexity": 1360.707567433571, "openwebmath_score": 0.9977032542228699, "tags": null, "url": "https://dsp.stackexchange.com/questions/54952/what-symmetry-does-system-function-hz-have-if-hn-is-real" }
So the matter is now to show that $$\displaystyle\int fg=0$$ for all $$g\in C_{0}^{\infty}$$ will imply that $$f=0$$ a.e. First note that the existence of $$\displaystyle\int fg$$ entails that $$\displaystyle\int|fg|<\infty$$. For a fixed compact set $$K$$, take a nonnegative $$g\in C_{0}^{\infty}$$ such that $$g=1$$ on $$K$$, then $$\displaystyle\int|fg|\geq\int_{K}|f|$$, then $$f\in L^{1}(K)$$. On the other hand, for a fixed $$x$$, we have $$\displaystyle\int f(\cdot)\varphi_{\epsilon}(x-\cdot)=0$$, where $$\varphi_{\epsilon}$$ is a standard nonnegative mollifier, the equation is no more than saying that $$\varphi_{\epsilon}\ast f(x)=0$$. As $$\varphi_{\epsilon}\ast f\rightarrow f$$ in $$L^{1}(K)$$, we have $$f=0$$ a.e. on $$K$$. The result follows by considering an exhaustion of compact sets to the whole space. Okay, I seem to have a proof that works assuming that $$f\in L^{\infty}_{loc}(\Omega)$$ (hence, in particular, if $$f\in C(\Omega)$$).
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9748211561049158, "lm_q1q2_score": 0.8361704886875884, "lm_q2_score": 0.8577680977182187, "openwebmath_perplexity": 130.7593300250169, "openwebmath_score": 0.9856497049331665, "tags": null, "url": "https://math.stackexchange.com/questions/3450093/int-fg-leq-1-for-any-g-in-c-0-infty-g-l2-1-then-f" }
java, rags-to-riches Title: Checking three values are consecutive This question was recently asked: Determining if three numbers are consecutive It intrigued me, even though it was broken. I have the following implementation I thought would be interesting, and I am looking for reviews on readability, usability, and for any edge cases it may miss, etc. /** * Determine whether three <code>int</code> values can be arranged in to an incrementing sequence. * * @param a the first value * @param b the second value * @param c the third value * @return true if there is an order of the three inputs which makes them sequential */ public static final boolean isSequential(int a, int b, int c) { final int x = Math.abs(a - b); final int y = Math.abs(b - c); final int z = Math.abs(a - c); return x + y + z == 4 && x * y * z == 2; } I put this together in a unit test. Here's the full file: import org.junit.Assert; import org.junit.Test; public class ThreeInARow {
{ "domain": "codereview.stackexchange", "id": 29291, "lm_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, rags-to-riches", "url": null }
between the plates, and C is the capacitance with the dielectric material between the plates, and with A and d remaining constant. Principles: Gauss' law. 1 Introduction A capacitor is a device that stores electric charge. 64 •• A parallel-plate capacitor has plates separated by a distance d. Capacitance of parallel plate capacitor in the presence of Dielectric (completely, partially, different dielectrics with different thickness). The capacitance for a parallel-plate capacitor changes to: Common dielectric values: κ vacuum = 1 κ air = 1. CBSE, ICSE AND ALL STATE BOARDS IIT JEE, NEET AND ALL OTHER COMPETITIVE EXAMS #dhanrajpayal #onlinephysics4u #capacitance. It is easy to see the relationship between the voltage and the stored charge for a parallel plate capacitor, as shown in Figure 2. (Note that the above equation is valid when the parallel plates are separated by air or free space. A potential difference of 10,000 V is applied across the capacitor. The energy stored in a capacitor
{ "domain": "agenzialenarduzzi.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9481545304202039, "lm_q1q2_score": 0.8040044772205128, "lm_q2_score": 0.847967764140929, "openwebmath_perplexity": 531.7615776063614, "openwebmath_score": 0.6449436545372009, "tags": null, "url": "http://mqeo.agenzialenarduzzi.it/capacitance-of-a-parallel-plate-capacitor-with-3-dielectrics.html" }
c++, bitwise, integer Title: Split a long integer into eight 4-bit values It's an exercise from a book. There is a given long integer that I should convert into 8 4-bit values. The exercise is not very clear for me, but I think I understood the task correctly. I googled how to return with an array in a function. In the splitter function I add the last 4 bits into the values array, then cut the them from the original number. Is this a good way to do this? #include <iostream> int * splitter(long int number) { static int values[8]; for (int i = 0; i < 8; i++) { values[i] = (int)(number & 0xF); number = (number >> 4); } return values; } int main() { long int number = 432214123; int *values; values = splitter(number); for (int i = 7; i >= 0; i--) std::cout << values[i] << " "; return 0; } There are only three issues I take with your code...
{ "domain": "codereview.stackexchange", "id": 4430, "lm_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++, bitwise, integer", "url": null }
• @EwanDelanoy I like your interpretation and I will be trying it. I guess that you are connecting the top and bottom as well so, topologically, you are working with a torus. – badjohn Jun 15 '17 at 12:37
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9845754506337406, "lm_q1q2_score": 0.8893613095914836, "lm_q2_score": 0.9032942158155877, "openwebmath_perplexity": 321.9013814036455, "openwebmath_score": 0.779970109462738, "tags": null, "url": "https://math.stackexchange.com/questions/2319655/when-is-a-sudoku-like-table-solvable" }
population-genetics, human-evolution, population-dynamics, population-biology Title: What proportion of the people who lived 1000 years ago have genetic descendants alive today? For context, I've been wondering about this for a paper I'm writing (in philosophy). Really, I want to figure out the chances that someone alive today will end up still having descendants 1000 years in the future. But people from 1000 years ago should be a good approximation. So, any ideas? And are there any published papers which talk about this? This is not a full answer, but I post it as one because the reasoning is too long to post it as a comment. You can make a rough estimation using a few assumptions. 1) Let's say 1 generation = 25 years, so 1000 years are 40 generations. 2) Let's say that half of the population is able to leave offspring, so the probability of one individual having descendants = 0.5 3) Supposing that the average number of siblings is 3.
{ "domain": "biology.stackexchange", "id": 10388, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "population-genetics, human-evolution, population-dynamics, population-biology", "url": null }
ros, static-transform-publisher, transform Original comments Comment by lucasw on 2017-06-06: Can you show the code doing the tf broadcasting? sendTransform does not have a parameter for the period because it only sends once immediately. If you want to publish a constant frame you need to do so inside a loop. However even if you're doing that it should not cause CPU usage spikes. It's just sending a relatively small message. And if as your question implies it's only being sent once. It definitely isn't the cause of your CPU spikes. Quite possibly your problem is actually that the transform becomes unavailable and some code is trying to buffer or try to transform when the tf information is unavailable. There's also a tf::StaticTransformBroadcaster. However, I'd strongly recommend moving to the tf2 static transform publisher. In tf2 static transforms are sent in a separate channel and designed to send only once using a latched publisher. So they incur as little CPU as possible. This is exactly what they were designed for.
{ "domain": "robotics.stackexchange", "id": 28066, "lm_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, static-transform-publisher, transform", "url": null }
computability, church-turing-thesis If $h(x) = g(f(x))$, then $h$ could be computable. If $g(x) = h(f(x))$, then $h$ is not computable. Well, 2 is clear I think, because we know that $g$ is not computable and $f$ is computable, so $h$ has to be not computable, otherwise $g$ would be computable. But 1 is a big problem for me. If $f$ is computable and $g$ is not computable, how can $h$ be computable? Suppose that $f(x) = 0$. Then $g(f(x))$ is computable for any function $g$, computable or not. This explains 1. As for 2, the composition of two computable functions is computable, so if both $f$ and $h$ are computable, so is $g$. Since $f$ is computable and $g$ isn't, the only conclusion is that $h$ is not computable.
{ "domain": "cs.stackexchange", "id": 17668, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "computability, church-turing-thesis", "url": null }
quantum-optics, squeezed-states \displaystyle \color{white}{\hat{S}(\xi)\hat{a}\hat{S}(\xi)^\dagger} = \cosh|\xi|\;\hat{a}+\frac{\xi}{|\xi|}\sinh|\xi|\;\hat{a}^\dagger \end{array} $$ where $[\,\cdot\,,\cdot\,]_n$ denotes $n$-time nested commutators, hence $$ \begin{cases} \mu(\xi) = \cosh|\xi| \\ \nu(\xi) = \frac{\xi}{|\xi|}\sinh|\xi| \end{cases} $$ Now, it is actually easier to work with the "single-exponential" form of the displacement operator, i.e. $\hat{D}(\lambda) = e^{\lambda\hat{a}^\dagger-\lambda^*\hat{a}}$, which you can recover with the help of Glauber's formula. Thus we have : $$ \begin{array} \hat{S}(\xi)\hat{D}(\lambda)\hat{S}(\xi)^\dagger &=& \displaystyle \hat{S}_\xi e^{\lambda\hat{a}^\dagger-\lambda^*\hat{a}} \hat{S}_\xi^\dagger \\ &=& \displaystyle \sum_{n=0}^\infty\frac{1}{n!}\hat{S}_\xi(\lambda\hat{a}^\dagger-\lambda^*\hat{a})^n\hat{S}_\xi^\dagger \\ &=& \displaystyle
{ "domain": "physics.stackexchange", "id": 92857, "lm_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-optics, squeezed-states", "url": null }
ros http://ros.informatik.uni-freiburg.de/roswiki/ http://ros.jsk.imi.i.u-tokyo.ac.jp/roswiki/ http://mirror.umd.edu/roswiki/ ...and more at http://www.ros.org/wiki/Mirrors Best bookmark them now! Originally posted by AHornung with karma: 5904 on 2011-11-22 This answer was ACCEPTED on the original site Post score: 6 Original comments Comment by AHornung on 2011-11-22: Not that I know, but maybe it's halfway working through Google cache. Comment by ParNurZeal on 2011-11-22: How about answer.ros.org? Is there an up-to-date for the forum? Comment by ParNurZeal on 2011-11-22: This helps me a lot. Thank you!
{ "domain": "robotics.stackexchange", "id": 7390, "lm_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 }
probability - pair of dice is rolled A pair of dice is rolled and the sum is determined. The probability that a sum of 5 is rolled before a sum of 8 is rolled in a sequence of rolls of the dice is ____. The given answer is 4/9. Probability sum of 5 before sum of 7 I have found this link as well but I want to know where I am going wrong. My approach: Here 2 events are independent. Getting a sum of 5 won't be dependent on getting sum of 8 in next roll. so the problem reduces to probability of getting a sum equal to 5. Hence the probability is equal to 4/36 = 1/9. Even if you assume P(A/B) where A is the the event where sum is 5 and B is the event sum of 8. then P(A/B) = P(A) —- events are independent. why to apply bayes theorem? what mistake I am doing, aren't this 2 events independent?
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9805806529525571, "lm_q1q2_score": 0.8016977224204945, "lm_q2_score": 0.8175744850834648, "openwebmath_perplexity": 273.58474579804516, "openwebmath_score": 0.8218517303466797, "tags": null, "url": "https://math.stackexchange.com/questions/3038453/probability-pair-of-dice-is-rolled" }
java, beginner, homework, integer Scanner input = new Scanner(System.in); do{ int g; int a=0; int b=0; int t; int s1; int c=0; //Read two integer values from user input System.out.print("\n Enter the first number : "); int m = input.nextInt(); System.out.print("\n Enter the second number : "); int n = input.nextInt(); for(int i = 0; i < 10; i++){ num1[i]=0; num2[i]=0; } //Placing the two integer numbers into array while(m > 0){ g = m % 10; m = m / 10; num1[a] = g; temp[a] = g; a++; } while(n > 0){ g = n % 10; n = n / 10; num2[b] = g; b++; } if(a > b) c = a; else c = b; for(int i = 0; i < c; i++){ carry[i]=0; sum[i]=0; } //finding sum and handling carry for(int i = 0; i < c; i++){ sum[i] = num1[i]+num2[i]; s1=sum[i]; t=0;
{ "domain": "codereview.stackexchange", "id": 24634, "lm_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, beginner, homework, integer", "url": null }
quantum-mechanics, optics, quantum-optics, diffraction, discrete doesn't have a connection to the number of excitations $\color{green}{n}$ of an electromagnetic field mode (in $E_\color{green}{n} = \color{green}{n} h \nu$). The only thing which is quantized in the diffraction pattern is the number of intensity minima, because $\sin \theta \in [-1, 1]$. Therefore, depending on the slit size $d$ there are cases with $\color{blue}{0}$ minima (if $d < \lambda$), cases with $\color{blue}{2}$ minima (if $\lambda < d < 2 \lambda$), and so on.
{ "domain": "physics.stackexchange", "id": 75563, "lm_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, optics, quantum-optics, diffraction, discrete", "url": null }
electromagnetism, magnetic-fields, vector-fields, calculus, magnetic-moment About the left term is the form of differentiated by the scalar $~r~$ and the right term is the form of differentiated by the direction. About the right fraction of the left term, I can guess that this fraction represents the unit vector with some direction. But why the differentiation of direction? is to be zero? ps. I will back after about 10 hours. Regarding your first question, I agree with J. Murray's comment that you should try evaluating the gradient component-wise. For example for the $x$ component you'll have $$\frac{\partial}{\partial x} \left(\frac{1}{r^3}\right) = \frac{-3}{r^4}\frac{\partial r}{\partial x} = \frac{-3}{r^4}\frac{\partial}{\partial x}\sqrt{x^2 + y^2 + z^2} \\ = \frac{-3}{r^4}\frac{x}{r}$$ if you do this for all components you'll get the expression you need. Regarding your second point, I think $\mathbf{M}$ is constant, in which case $$\nabla (\mathbf{M}\cdot\mathbf{r}) = \nabla (M_1x + M_2 y + M_3 z) = \mathbf{M}$$
{ "domain": "physics.stackexchange", "id": 80310, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetism, magnetic-fields, vector-fields, calculus, magnetic-moment", "url": null }
ros, roscpp, laser-geometry, transform Title: Fixed target frame for transformLaserScanToPointCloud? The documentation states: Since we are gathering data across the time of the scan, it is often important that the chosen target_frame is actually a fixed frame. What's meant by "fixed" in this context? I assume it means that the transform between the laser scanner frame and the target frame is static?
{ "domain": "robotics.stackexchange", "id": 10790, "lm_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, roscpp, laser-geometry, transform", "url": null }
python, performance, object-oriented, python-2.x, excel Title: Script for finding cheating students in a quiz Below is a script to find cheating students in a quiz in a daily moodle activity log exported in .xls. It works fine and is written in a procedural way. Essentially the script isolates the activity log entry in a worksheet for students listed in another worksheet, identifies when they are taking a quiz (looking ahead in the activity log) and if they are taking an unusually long time or doing something different while taking a quiz (they will complete). These different scenarios are then highlighted in a different row colour in an xl file listing all activity for each student in the list. The script also writes to a .txt file, logging a summary for each student and all quizzes completed and the students listed who did not take any quizzes. The questions are simple: How can I make it run faster? How can I write it in a OOP paradigm, and will it run faster? #!/usr/bin/env python # -*- coding: utf-8 -*-
{ "domain": "codereview.stackexchange", "id": 8081, "lm_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, object-oriented, python-2.x, excel", "url": null }
machine-learning, neural-network, deep-learning $ℒ_{X_i}(W_i)$ and it is quite possible that it does not correspond to a local minimum! We can now compute a gradient update and continue with training. To be clear: the shape of $ℒ_{X_{i+1}}$ will -- in general -- be different from that of $ℒ_{X_{i}}$. Note that here I am referring to the loss function $ℒ$ evaluated on a training set $X$; it is a complete surface defined over all possible values of $W$, rather than the evaluation of that loss (which is just a scalar) for a specific value of $W$. Note also that if mini-batches are used without shuffling there is still a degree of "diversification" of loss surfaces, but there will be a finite (and relatively small) number of unique error surfaces seen by the solver (specifically, it will see the same exact set of mini-batches -- and therefore loss surfaces -- during each epoch).
{ "domain": "datascience.stackexchange", "id": 11640, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "machine-learning, neural-network, deep-learning", "url": null }