text
stringlengths
49
10.4k
source
dict
operators, momentum, observables \nonumber\\ &\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\boldsymbol{=}i\hbar\!\!\!\int\limits_{\boldsymbol{-\infty}}^{\boldsymbol{+\infty}}\!\!\!\!\delta\left( x_{\boldsymbol{r}}\!\boldsymbol{-}\!x_{\boldsymbol{c}}\right)f\left(x_{\boldsymbol{c}}\right)\mathrm dx_{\boldsymbol{c}} \quad \Longrightarrow \nonumber\\
{ "domain": "physics.stackexchange", "id": 51057, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "operators, momentum, observables", "url": null }
python, csv, sqlite, geospatial header = reader.next() if self.conn is None: self.conn = sqlite3.connect('data.db') c = self.conn.cursor() c.execute("DROP TABLE IF EXISTS email_list") sql = """CREATE TABLE email_list (\n""" + \ ",\n".join([("%s varchar" % name) for name in header]) \ + ")" c.execute(sql) for line in reader: if line: try: c.execute('INSERT INTO email_list VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', line) except sqlite3.ProgrammingError as e: print e.message print line try: c.execute('ALTER TABLE email_list ADD COLUMN CITY varchar') c.execute('ALTER TABLE email_list ADD COLUMN STATE varchar') c.execute('ALTER TABLE email_list ADD COLUMN COUNTRY varchar') c.execute('ALTER TABLE email_list ADD COLUMN POSTAL_CODE varchar') except sqlite3.OperationalError as e: print 'error creating new columns: ' print e.message self.conn.commit() self.conn.close() print 'converted csv to sqlite, stored in data.db' def convert_rows(self): print 'converting coordinates...' self.conn = sqlite3.connect('data.db') c = self.conn.cursor() results = c.execute('SELECT LATITUDE AS lat, LONGITUDE AS lon, Email as email FROM email_list WHERE POSTAL_CODE IS NULL AND CITY IS NULL AND COUNTRY IS NULL AND STATE IS NULL') rows = [] for row in results: lat, lon, email = row data = {'lat': lat, 'lon': lon, 'email': email} rows.append(data) self.conn.commit() self.conn.close()
{ "domain": "codereview.stackexchange", "id": 5053, "lm_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, csv, sqlite, geospatial", "url": null }
Case 2. Permutations of $$(x,x,y)$$, $$x\ne y$$. $$(1,1,2)$$ $$(1,1,3)$$ $$(1,1,4)$$ $$(2,2,1)$$ $$4$$ combos, $$3$$ perms each, $$2^3=8$$ sign choices, so $$4\cdot3\cdot8=\boxed{96}$$ solutions. Case 3. Perms of $$(x,y,z)$$ with $$x,y,z$$ all different. $$(1,2,3)$$ Just $$1$$ combo, $$6$$ perms, $$8$$ sign choices, so $$1\cdot6\cdot8=\boxed{48}$$ solutions. Case 4. Perms of $$(x,x,0)$$. $$(1,1,0)$$ $$(2,2,0)$$ $$(3,3,0)$$ $$3$$ combos, $$3$$ perms each, $$2^2=4$$ sign choices, so $$3\cdot3\cdot4=\boxed{36}$$ solutions. Case 5. Perms of $$(x,y,0)$$, $$x\ne y$$. $$(1,2,0)$$ $$(1,3,0)$$ $$(1,4,0)$$ $$(1,5,0)$$ $$(2,3,0)$$ $$(2,4,0)$$ $$6$$ combos, $$6$$ perms each, $$4$$ sign choices, so $$6\cdot6\cdot4=\boxed{144}$$ solutions.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9603611563610179, "lm_q1q2_score": 0.8200646424264666, "lm_q2_score": 0.8539127566694178, "openwebmath_perplexity": 289.1258247692788, "openwebmath_score": 0.7990229725837708, "tags": null, "url": "https://math.stackexchange.com/questions/3157381/determine-the-number-of-ordered-triple-x-y-z-of-integer-numbers-negatives" }
quantum-mechanics, operators, hilbert-space Title: Do the eigenstates of the number operator in an arbitrary Hilbert space form a complete basis? Do the eigenstates of the number operator in an arbitrary Hilbert-space form a complete basis? For simplicity I will restrict myself to the case of just one mode. Given we have 2 operators $\hat{a}$ and $\hat{a}^\dagger$, which satisfy the commutation relations $[ \hat{a}, \hat{a}^\dagger] = 1$, $[ \hat{a}, \hat{a}] = 0$ and $[ \hat{a}^\dagger, \hat{a}^\dagger] = 0$, We can derive that there must be a vacuum state $|0\rangle$ with $\hat{a} | 0 \rangle = 0$ and that the states $|n \rangle = (\hat{a}^\dagger)^n |0 \rangle$ are eigenstates of $\hat{a}^\dagger \hat{a}$. Is there any hint that the states $|n\rangle$ do form a complete basis? What additional assumptions have to be made to derive this? The "number operator" is a densely defined closed positive form only in the Fock irreducible representation and its unitarily equivalent ones (such as the Schrödinger and Bargmann-Fock representations in quantum mechanical systems, or the Q-space representation for free scalar boson fields). On any other irreducible representation of the canonical commutation relations it is still a closed and positive form, but it is not densely defined (see Bratteli and Robinson's book, second volume, for a proof). Therefore the eigenstates of the number operator, counting multiplicity, can be a basis only in the Fock space.
{ "domain": "physics.stackexchange", "id": 42621, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, operators, hilbert-space", "url": null }
inorganic-chemistry, acid-base, salt Title: Why is sodium bisulfate acidic? So, as I know, the rule says that if you get a salt from strong acid and strong base it should be neutral. In this situation with sodium bisulfate and also trisodium phosphate we get an acid salt, although bought of them are produced from strong acid and strong base. Can someone explain why they have an acidic character and perhaps also give an explanation how I can determine if a salt will have an acidic character in water? Sodium bisulfate $\ce{NaHSO4}$ has still one acidic hydrogen, as sulphuric acid is a diprotic acid, therefore it is acidic. By other words, just a half of sulfuric acid is neutralized here. Note that the anion $\ce{HSO4-}$ lays at boundary between strong and weak acids. OTOH, trisodium phosphate $\ce{Na3PO4}$ is strongly basic, as hydrogenphosphate anion $\ce{HPO4^2-}$ is very weak acid.
{ "domain": "chemistry.stackexchange", "id": 16372, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "inorganic-chemistry, acid-base, salt", "url": null }
# The Stacks Project ## Tag: 012Y This tag has label homology-definition-double-complex and it points to The corresponding content: Definition 11.19.1. Let $\mathcal{A}$ be an additive category. A double complex in $\mathcal{A}$ is given by a system $(\{A^{p, q}, d_1^{p, q}, d_2^{p, q}\}_{p, q\in \mathbf{Z}})$, where each $A^{p, q}$ is an object of $\mathcal{A}$ and $d_1^{p, q} : A^{p, q} \to A^{p + 1, q}$ and $d_2^{p, q} : A^{p, q} \to A^{p, q + 1}$ are morphisms of $\mathcal{A}$ such that the following rules hold: 1. $d_1^{p + 1, q} \circ d_1^{p, q} = 0$ 2. $d_2^{p, q + 1} \circ d_2^{p, q} = 0$ 3. $d_1^{p, q + 1} \circ d_2^{p, q} = d_2^{p + 1, q} \circ d_1^{p, q}$ for all $p, q \in \mathbf{Z}$.
{ "domain": "columbia.edu", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9875683517080176, "lm_q1q2_score": 0.8313603727602694, "lm_q2_score": 0.8418256532040708, "openwebmath_perplexity": 605.3236574633927, "openwebmath_score": 0.9903067946434021, "tags": null, "url": "http://stacks.math.columbia.edu/tag/012Y" }
# Measuring forecast accuracy of the conditional mean Consider a dependent variable $y$, independent variables $x_1,\dotsc,x_K$, a model $$y = X \beta + \varepsilon,$$ and an estimated coefficient $\hat\beta$. If the model is correctly specified, the true conditional mean of $y$ given $X$ is $$\mathbb{E}(y|X) = X \beta.$$ Since we do not know $\beta$, we use its sample estimate $\hat\beta$ to get the estimated conditional mean $$\hat{\mathbb{E}}(y|X) = X \hat\beta.$$ For a new set of observations $x_{1,i},\dotsc,x_{K,i}$, we can predict the conditional mean of the corresponding $y_i$ using the new $x$s and the estimated coefficient $\hat\beta$ as follows: $$\hat{\mathbb{E}}(y_i|x_{1,i},\dotsc,x_{K,i}) = (x_{1,i},\dotsc,x_{K,i}) \hat\beta.$$ Now let us evaluate the forecast accuracy. We take the realized value $y_i$ and compare it to the predicted value $\hat{\mathbb{E}}(y_i|x_{1,i},\dotsc,x_{K,i})$. If the two are close, we say that the forecast is accurate. Here is what bugs me: • Aren't we predicting the true conditional mean $\mathbb{E}(y_i|x_{1,i},\dotsc,x_{K,i})$ rather than the actual realization $y_i$? • If so, we are committing a measurement error when using $y_i$ in place of the unobserved $\mathbb{E}(y_i|x_{1,i},\dotsc,x_{K,i})$ when evaluating forecast accuracy. Isn't this problematic?
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9648551596627306, "lm_q1q2_score": 0.8482493069529616, "lm_q2_score": 0.8791467801752451, "openwebmath_perplexity": 688.1923195249794, "openwebmath_score": 0.8175317049026489, "tags": null, "url": "https://stats.stackexchange.com/questions/206020/measuring-forecast-accuracy-of-the-conditional-mean" }
quantum-operation, nielsen-and-chuang, linear-algebra, kraus-representation How does showing "there is unitary matrix $u$ such that $uWu^\dagger$ is diagonal with at most $d^2$ non-zero entries" proves "all quantum operations $\mathcal{E}$ on a system of Hilbert space dimension $d$ can be generated by an operator-sum representation containing at most $d^2$ elements"? The missing step that you ask about in your last paragraph is to use the following fact (labeled Theorem 8.2 in my edition of Nielsen and Chuang): If $\{E_1,\ldots,E_n\}$ and $\{F_1,\ldots,F_n\}$ are two sets of operators defining operations $\mathcal{E}$ and $\mathcal{F}$ respectively, then $\mathcal{E}=\mathcal{F}$ iff there is an $n$-by-$n$ unitary matrix $u$ such that $E_i = \sum_j u_{ij} F_j$. Use the $u$ that diagonalizes $W$ to define new operators $F_i = \sum_j u^*_{ij}E_j$. Then for all but $d^2$ of the $F_i$ we have $\operatorname{tr}(F_i^\dagger F_i)=0$ (and hence $F_i=0$). By the above theorem the $F_i$ describe the same operation as the original $E_i$.
{ "domain": "quantumcomputing.stackexchange", "id": 4237, "lm_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-operation, nielsen-and-chuang, linear-algebra, kraus-representation", "url": null }
filters, audio, filter-design, equalization, c++ <band12 freq="500" width="115.78" gain="0" /> <band13 freq="629.961" width="145.874" gain="0" /> <band14 freq="793.701" width="183.789" gain="0" /> <band15 freq="1000" width="231.56" gain="6" /> <band16 freq="1259.92" width="291.747" gain="0" /> <band17 freq="1587.4" width="367.579" gain="0" /> <band18 freq="2000" width="463.12" gain="0" /> <band19 freq="2519.84" width="583.495" gain="0" /> <band20 freq="3174.8" width="735.157" gain="0" /> <band21 freq="4000" width="926.24" gain="0" /> <band22 freq="5039.68" width="1166.99" gain="0" /> <band23 freq="6349.6" width="1470.31" gain="0" /> <band24 freq="8000" width="1852.48" gain="0" /> <band25 freq="10079.4" width="2333.98" gain="0" /> <band26 freq="12699.2" width="2940.63" gain="0" /> <band27 freq="16000" width="3704.96" gain="0" /> </Bands> </Filter>
{ "domain": "dsp.stackexchange", "id": 2815, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "filters, audio, filter-design, equalization, c++", "url": null }
ros, opencv, ros-groovy, opencv3, cmake So, even if you include the correct headers gcc wil always find the old ones if you don't delete the CPATH variable... I've tried adding /usr/local/include to CPATH, but the same behaviour appears, it only seems to work unsetting CPATH... Any ideas? I would like to keep CPATH as it is to avoid breaking anythin when I need to use ROS! Originally posted by Jep with karma: 195 on 2014-02-12 This answer was ACCEPTED on the original site Post score: 0 Original comments Comment by bchr on 2014-02-12: Try to use make in verbose mode, get the exact compilation command used by gcc, and paste it here. It may also help us if you give us more information on the rest of your CMakeLists.txt. Comment by Jep on 2014-02-14: thanks! II've edited the answer Comment by bchr on 2014-02-14: You can probably overwrite CPATH in your CMakeLists.txt only, so that this does not affect whatever you do after. You can access it with $ENV{CPATH}, you could try to save it and set it back at the end. Comment by bchr on 2014-02-14: Still, the fact that OpenCV 3 precedes ROS' OpenCV in your path, yet this still fails, is quite surprising (if you do not use OpenCV2-only headers, obviously). Comment by Jep on 2014-02-17: Yep... It's very strange for me. I don't understand it always find opencv2 headers even if setting /usr/local/include to CPATH as well... I've tried unsetting CPATH from CMakeLists but it didn't work... Seems that setting them in CMakeLists it's only somehow temporal... Thanks! Comment by J.M.T. on 2015-06-02: Could you post your FindOpenCV3.cmake file? I'm have the same trouble...
{ "domain": "robotics.stackexchange", "id": 16953, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, opencv, ros-groovy, opencv3, cmake", "url": null }
have a compact support @LarryEppes because in general any subspace of a separable metric space is separable yes, the separable points is in the larger space that's right 3:00 PM 15 The problem statement, all variables and given/known data: Show that if X is a subset of M and (M,d) is separable, then (X,d) is separable. [This may be a little bit trickier than it looks - E may be a countable dense subset of M with X\cap E = \varnothing.] Definitions Per our boo... This is true for metric spaces but not topological spaces in general I think but C(U) is a metric space but if the dense subset still in the C_c(U)? @LarryEppes just look at my link yes, I will read a minute, txh 3:03 PM You could probably find a countable set of piecewise linear stuff Piecewise linear stuff whose graphs are like polyhedra with vertices at rational coordinates Something like that @AkivaWeinberger This is very false for arbitrary topological spaces, for every space X you can put a topology on X\cup\{p\} such that \{p\} is dense, if you start with a nonseparable X then you have a counterexample Oh lol What if we want it to be Hausdorff Sorgenfrey plane Oh neat Is there a name for a separable space all of whose subspaces are separable? "Completely separable" or something like that? hereditarily separable In set theoretic topology there was (there is?) a lot of interest in S-spaces, which are regular and hereditarily separable but not Lindelöf spaces and L-spaces, which are regular and hereditarily Lindelöf but not separable spaces What is the weakest P such that P+separable\implieshereditarily separable? P=metric space works but I wonder if it can be weakened 3:13 PM What's Lindelöf again? Every (open) cover has countable subcover. Every open cover has a countable subcover, it's a weaker version of compactness Oh interesting that's way too many adjectives Is \Bbb R^n Lindelöf? I'm guessing yes but I don't
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9833429599907709, "lm_q1q2_score": 0.839689086749822, "lm_q2_score": 0.8539127455162773, "openwebmath_perplexity": 383.8928336469595, "openwebmath_score": 0.8634619116783142, "tags": null, "url": "https://chat.stackexchange.com/transcript/36/2019/3/27" }
ros, rviz, remote, server Title: Running RViZ through X forwarding on headless machine Hello, is there possibility to run RViZ remotely on headless machine using X forwarding (ssh -X)? The problem is that remote machine (server) doesn't have graphic card with OpenGL support so, there is MESA installed. For instance, glxgears runs, but RViZ crashes (Segmentation fault) as well as Gazebo (GLXBadDrawable). Of course that I can overcome this by running RViZ locally but I would like to avoid ROS installation on client's machine. Thanks for any hint. gdb output: 0x00007fffed1cacc0 in xcb_glx_get_string_string_length () from /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0
{ "domain": "robotics.stackexchange", "id": 16869, "lm_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, rviz, remote, server", "url": null }
c++, performance, programming-challenge, graph int main(void) { int numTests = 0; Node *nodes = NULL; Edge *edges = NULL; scanf("%d", &numTests); for (int i=0; i<numTests; i++) { int numNodes = 0; int e = 0; scanf("%d", &numNodes); nodes = (Node *) calloc(numNodes, sizeof(*nodes)); edges = (Edge *) calloc(2*numNodes, sizeof(*edges)); // Read in list of edges. For each edge, we create two Edge // structures and add one to each endpoint Node. for (int j = numNodes - 1; j > 0; j--) { int from = 0; int to = 0; int weight = 0; scanf("%d %d %d", &from, &to, &weight); from--; to--; edges[e].to = to; edges[e].next = nodes[from].edges; edges[e].weight = weight; nodes[from].edges = &edges[e]; nodes[from].numEdges++; e++; edges[e].to = from; edges[e].next = nodes[to].edges; edges[e].weight = weight; nodes[to].edges = &edges[e]; nodes[to].numEdges++; e++; } int search = 0; int cur = -1; uint64_t dist = 0; for (int nodesLeft = numNodes-1; nodesLeft > 0; nodesLeft--) { Edge *edge; // Either use the node known to have 1 edge, or find the next // node that has 1 edge. if (cur == -1) { while (nodes[search].numEdges != 1) { search++; if (search >= numNodes) { printf("ERROR, reached end of nodes\n"); exit(1); } } cur = search++; }
{ "domain": "codereview.stackexchange", "id": 27269, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, performance, programming-challenge, graph", "url": null }
ros, ros-kinetic, rqt, package, gui Title: Renaming rqt package [Kinetic] I'm attempting to renamed my package from rqt_truckee_gui to rqt_truckee but it causes the following error: admin@pc1:~/git/x-ros/catkin_ws$ rqt -s rqt_truckee [ERROR] [1522742453.102027186]: Skipped loading plugin with error: XML Document '/home/hpcadmin/git/x-ros/catkin_ws/src/truckee/rqt_truckee_gui/plugin.xml' has no Root Element. This likely means the XML is malformed or missing.. RosPluginProvider._parse_plugin_xml() plugin file "/home/hpcadmin/git/x-ros/catkin_ws/src/truckee/rqt_truckee_gui/plugin.xml" in package "rqt_truckee_gui" not found RosPluginProvider._parse_plugin_xml() plugin file "/home/hpcadmin/git/x-ros/catkin_ws/src/truckee/rqt_truckee_gui/plugin.xml" in package "rqt_truckee_gui" not found qt_gui_main() found no plugin matching "rqt_truckee"
{ "domain": "robotics.stackexchange", "id": 30519, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, ros-kinetic, rqt, package, gui", "url": null }
java, design-patterns, mvc, controller, ddd and use it like this. @Path("/app/jobs") public class AssignJobController { @Autowired CommandHandler<AssignJobCommand> handler; @PUT @Path("{job_id}/assigned_to/{user_id}") public Response assignTo( @PathParam("job_id") @NotNull String jobId, @PathParam("user_id") @NotNull String userId ) throws JobException { handler.handle(new AssignJobCommand(jobId, userId)); return Response.status(Response.Status.CREATED).build(); } } You can use decorators like this, for example: @Configuration public class Config { @Autowired JobDAO jobDAO; @Bean public CommandHandler<AssignJobCommand> assignJobCommandHandler() { // pass in the dependencies as shown in the tutorial // I use a DAO instead of a UnitOfWork, as they are more common with Spring applications. CommandHandler<AssignJobCommand> handler = new AssignJobCommandHandler(jobDAO); // you can use multiple decorators // this kind of decorators do not need to use reflection, proxies, bytecode manipulation etc magic. They are plain-old java objects. handler = new TransactionCommandHandlerDecorator(handler); handler = new DeadlockRetryCommandHandlerDecorator(handler); ... ... return handler; } } Testing Now that we pass the dependencies in the handlers, we can test them. One way to do it is using a mocking framework, there are others. Test may look like this, for example: @RunWith(MockitoJUnitRunner.class) public class AssignJobCommandHandlerTest { @Mock JobDAO jobDAO; AssignJobCommandHandler handler; @Before public void setUp() { handler = AssignJobCommandHandler(jobDAO); } @Test public void assignsAJobToAUser() { long jobId = 123L; long userId = 456L;
{ "domain": "codereview.stackexchange", "id": 14715, "lm_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, design-patterns, mvc, controller, ddd", "url": null }
vba having a one line code instead of the UDF would be a big improvement According to MSDN: For example, for an input box that can accept both text and numbers, set Type to 1 + 2. Is it possible to combine input types including reference too? (note that I can assign return value of inputBox without set which will combine my reference to a cell value, which isn't acceptable). The signature of your function doesn't match that of the function it's wrapping - that makes it potentially annoying to use, because one may or may not want to supply a title or a default; the only mandatory value in Application.InputBox is the prompt parameter - I'd expect an inputbox wrapper function to have an identical signature. xlInputReference is confusing - it looks like a legit Excel object model enum member, but it's not. Avoid naming your own constants with xl prefixes, as these indicate Excel object model members, not custom user code. I'd make an enum instead, and expose it to the client: Public Enum InputType InputFormula = 0 InputNumber = 1 InputText = 2 InputBoolean = 4 InputCellRef = 8 InputErrorValue = 16 InputValueArray = 64 End Enum That way the client code doens't need to remember or even try to figure out what values are legal and what they stand for - they even get IntelliSense for them! One problem you're not dealing with, is that it's totally legal to supply a 3 and accept both text and numbers, or a 12 to accept both a boolean and a cell reference, or ...well any combination is a valid one. Using the above enum, you could make a little utility function to verify whether an enum flag is set: Private Function HasFlag(ByVal value As InputType, ByVal flag As InputType) As Boolean HasFlag = (value And flag) = flag End Function
{ "domain": "codereview.stackexchange", "id": 19371, "lm_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", "url": null }
c#, t-sql, extension-methods, oracle public static SanitizedDateFieldGreaterThanAndLessThanEqualConditionBuilder SanitizeField(this IConditionBuilder source, IColumnSanitizer columnSanitizer) { return new SanitizedDateFieldGreaterThanAndLessThanEqualConditionBuilder(columnSanitizer); } } The Sanitization is available by means of an interface IColumnSanitizer and has two different implementations, for Sql Server and Oracle respectively public interface IColumnSanitizer { string Sanitize(string columnName); } public class SqlSanitizer : IColumnSanitizer { public string Sanitize(string columnName) { return "[" + columnName + "]"; } } public class OracleSanitizer : IColumnSanitizer { public string Sanitize(string columnName) { return "\"" + columnName + "\""; } } Below is how context classes are implemented: public abstract class FieldSearchContext { public virtual string FieldId { get; } protected FieldSearchContext(string fieldId) { FieldId = fieldId; } } public class DateContext : FieldSearchContext { public DateContext(string fieldId, DateTime? fromDate, DateTime? endDate) : base(fieldId) { FromDate = fromDate; EndDate = endDate; } public DateTime? FromDate { get; } public DateTime? EndDate { get; } } public class TextContext : FieldSearchContext { public TextContext(string fieldId, string text) : base(fieldId) { Text = text; } public string Text { get; } } public class NumericContext : FieldSearchContext { public NumericContext(string fieldId, decimal number) : base(fieldId) { Number = number; } public decimal Number { get; } }
{ "domain": "codereview.stackexchange", "id": 34931, "lm_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#, t-sql, extension-methods, oracle", "url": null }
4 Let $x \in B$. We want to prove $x \in \overline{A}$, i.e. that $x \notin A$. So assume $x \in A$. But then, we have $x \in A$ and $x \in B$, which means $x \in A \cap B$. However, by assumption, $A \cap B$ is a empty. This is a contradiction. This proves $x \notin A$. Actually, the converse is also true: $A \cap B$ is empty if and only if $B$ is ... 3 Let's assume $A\cap B =\varnothing$ (start hypothesis) Let $x \in B$ Since $A$ and $B$ are disjoint (start hypothesis), then $x \notin A$ By definition of $\overline A$, since $x \notin A$ then $x \in \overline A ~~~~(= \Omega - A)$ Therefore $B\subseteq \overline A$, because for all $x \in B$, we have $x \in \overline A$ Note that the reciprocal ... 3 A way to do this is to take a denumerable set in $D \subset (0,1)$, to define a bijection as the identity outside $D$, to map the first element of $D$ to $1$ [and the second to $0$] and to "push" the remaining elements of $D$ down by $1$ [or $2$] to get a bijection with $(0,1]$, and $[0,1]$. 3 A counterexample would be sufficient and just writing A=B=C={a} would disprove the statement. 3
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9740426443092216, "lm_q1q2_score": 0.8179366885276758, "lm_q2_score": 0.8397339616560072, "openwebmath_perplexity": 250.3643489448454, "openwebmath_score": 0.9414424300193787, "tags": null, "url": "http://math.stackexchange.com/tags/elementary-set-theory/hot" }
organic-chemistry, reaction-mechanism, solvents Title: How is carbon-halogen bond broken during Finkelstein reaction? Finkelstein reaction is a halogen exchange reaction between haloalkane and a salt of a different halogenide: $$\ce{R−CH2−Cl + KI -> R−CH2−I + KCl}$$ From an answer of a previous question: As per Le chatelliar's principle the forward reaction is favored in presence of dry acetone which will dissolve $\ce{KI}$ but not $\ce{KCl}$ or $\ce{KBr}$. On account of insolubility of $\ce{KCl/KBr}$; they are not available for backward reaction[...]
{ "domain": "chemistry.stackexchange", "id": 13775, "lm_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, reaction-mechanism, solvents", "url": null }
quantum-mechanics, electromagnetic-radiation, visible-light, wave-particle-duality Title: Lack of Momentum exchange between photons upon apparent coalition When two light beams made up of photons collide, say at an angle, in the same plane, they do not impart any momentum to the photons in each other. But, momentum is imparted by the same photons on matter like electrons. So, why not momentum tranfer on photons of another beam but on matter? I made an assertion that, since, photons are particles of energy, while electrons on a surface(pocessing wave like nature) are particles of matter, therefor some difference has arisen. Please entlighten me. Maxwell's equations for electromagnetism are linear so if only photons are involved they cannot interact and exchange momentum. Once we we include interactions with virtual electrons that emerge from the vacuum, however, then photons can interact with these electrons and exchange momentum. This process is called Delbrück scattering. It is hard to see because it occurs only at fourth order in QED perturbation theory and as a consequence one needs very intense fields. Light-light scattering has however been detected at by the ATLAS collaboration in 2019.
{ "domain": "physics.stackexchange", "id": 84323, "lm_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, electromagnetic-radiation, visible-light, wave-particle-duality", "url": null }
electrostatics, electric-fields, charge, gauss-law Title: Question about cancellation of electric field Why can't I cancel the two opposite electric field shown below? I already searched about this and saw the article that says "It can't cancel each other because they aren't in the same region." I don't get it. The comment by @QuantumMechanic addresses this to some extent, but I think the key point that you're missing which is responsible for your confusion is that an Electric Field is not like the "vectors" you are familiar with in introductory classical mechanics. Instead, the Electric Field is a vector field. This means that it is represented by a vector at every point in space. In other words, you should always talk about an Electric Field vector at a point (i.e. it is a local quantity). Now, vectors do cancel out when they oppose each other at a particular point in space, but that isn't the case in the problem that you have considered. The vectors that point "upwards" are "above" the plate, and those that point "downwards" are "below" the plate. So, using the idea of a vector field, you can "draw" the same system as in your question as shown below (blue arrows for vectors pointing "up" and the red ones for vectors pointing "down"). Of course, every point in space has such an arrow, and I can't plot every one of them, so I've only plotted a small number of arrows. It should be obvious in this representation why all the vectors "above" are independent of those below: Let's now come to the question you had in the comments: why do we "cancel" the contribution outside a pair of oppositely charged sheets? Well, you can make the same sort of "diagram" as above. Consider two oppositely charged sheets at $z=0$ and $z=1$. Blue arrows still represent fields pointing "up" and red ones represent fields pointing "down". The diagram is a little messy, but you should be able to see that in between the two sheets, at every point, you would have a vector pointing up no matter what. Therefore, at every point the vectors add up constructively.
{ "domain": "physics.stackexchange", "id": 82925, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electrostatics, electric-fields, charge, gauss-law", "url": null }
python, beginner, python-3.x, battleship Title: Python simple battleship game I'm relatively new to Python, I decided to make a simple battleship game. Is there anything I should do to make it shorter, or in practice, "better"? from pprint import pprint as pp import random Rows = 0 Columns = 0 turns = 0 Answer = "NaN" print("Welcome to battleship!") while (Rows > 10) or (Columns > 10) or (Rows <= 0) or (Columns <= 0): Rows = int(input("Please enter the number of rows you want. \n")) Columns = int(input("Please enter the number of columns you want. \n")) def create_grid(Rows, Columns): #Creates the 2D Data Grid grid = [] for row in range(Rows): row = [] for col in range(Columns): row.append(' ') grid.append(row) return grid grid = create_grid(Rows,Columns) def display_grid(grid, Columns): #Prints the labels for the grid column_names = 'abcdefghijklmnopqrstuvwxyz'[:Columns] print(' | ' + ' | '.join(column_names.upper()) + ' |') for number, row in enumerate(grid): print(number + 1, '| ' + ' | '.join(row) + ' |') grid = create_grid(Rows, Columns) display_grid(grid, Columns) def random_row(grid): #Makes a random row integer return random.randint(1,len(grid)) def random_col(grid): #Makes a random column integer return random.randint(1,len(grid[0])) def update_gridHit(grid, GuessRow, GuessColumn): grid[GuessRow-1][GuessColumn-1] = 'O' def update_gridMiss(grid, GuessRow, GuessColumn): grid[GuessRow-1][GuessColumn-1] = 'X' ShipRow = random_row(grid) ShipColumn = random_col(grid)
{ "domain": "codereview.stackexchange", "id": 19000, "lm_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, python-3.x, battleship", "url": null }
homework-and-exercises, atomic-physics, quantum-chemistry $[C]=[He]2s^22p^2$ = $[He]2s^22p_x^12p_y^1$. The first excited state of carbon $C^*$, and the one that explains the existence of $C(+4)$ chemical compounds, is $[He]2s^12p_x^12p_y^12p_z^1$ where all three lone 2p electrons have the same $m_s$ value.
{ "domain": "physics.stackexchange", "id": 25118, "lm_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, atomic-physics, quantum-chemistry", "url": null }
c++, algorithm movePeopleIntoLift(mPassangers, peopleOnFloor, newPassengers); } bool Lift::goUpToNextFloorPushedUp() { auto optNextFloorUp = nextFloorAboveLiftPushedUp( mCurrentFloor, mQueues); if(optNextFloorUp) { arriveToFloor(*optNextFloorUp); return true; } return false; } bool Lift::goUpToHighestFloorPushedDown() { auto optHighestFloorDown = highestFloorAboveLiftPushedDown( mCurrentFloor, mQueues); if(optHighestFloorDown) { arriveToFloor(*optHighestFloorDown); return true; } return false; } void Lift::goUpWithPassengers() { auto higherFloor = getNextFloorUpWithPerson(); arriveToFloor(higherFloor); } int Lift::getNextFloorUpWithPerson() const { auto itPosPassengerUp = std::find_if(mPassangers.cbegin(), mPassangers.cend(), [curr = mCurrentFloor](const auto& val) { return val > curr; } ); // there should be always a person who wants to get higher assert(itPosPassengerUp != mPassangers.cend()); auto optPosUp = nextFloorAboveLiftPushedUp( mCurrentFloor, mQueues); if(optPosUp && *optPosUp < *itPosPassengerUp) { return *optPosUp; } return *itPosPassengerUp; }
{ "domain": "codereview.stackexchange", "id": 40285, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, algorithm", "url": null }
parallel-computing, linear-programming, process-scheduling Title: Questions about Amdahl's law? Doing exam papers now and I came across two questions which I cannot get my head around sadly. Both are regarding Amdahl's law and Parallel Computing but they seem rather simple and frustratingly enough I cannot really find a definitive answer to any of those questions. The questions are: Why must Amdahl's law always apply to a computation? Why is the existence of superlinear speedup not in contradiction with Amdahl? The best description of Amdahl's law I found is this one: At the most basic level, Amdahl's Law is a way of showing that unless a program (or part of a program) is 100% efficient at using multiple CPU cores, you will receive less and less of a benefit by adding more cores. At a certain point - which can be mathematically calculated once you know the parallelization efficiency - you will receive better performance by using fewer cores that run at a higher frequency than using more cores that run at a lower frequency. I just cannot find a suitable answer on why the law must be always applied to a computation. And superlinear speedup is just when a parallelised speedup can reach far beyond the speedup of a sequential processor. How would it actually contradict Amdahl's law I do not really know apart from it looking a bit like a glitch in the matrix. Amdahl's law is used to get an idea about where to optimize while considering parallelism.The theory of doing computational work in parallel has some fundamental laws that place limits on the benefits one can derive from parallelizing a computation. Amdahl's Law have detalied explanation of Amdahl's law and it's use. Processor comes with some other resources like cache which can affect the performance. So if we add more processor, cache memory also increases. Each processor will get less data size to process that can fit into processor's cache which will increase the Performance(Superlinear speedup). But Amdahl's Law considers processors as the only resource but does not consider cache memory.
{ "domain": "cs.stackexchange", "id": 10431, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "parallel-computing, linear-programming, process-scheduling", "url": null }
homework-and-exercises, thermodynamics, physical-chemistry, ideal-gas Title: Why is the ideal gas law only valid for hydrogen? I got this question in school: Explain, based on the properties of an ideal gas, why the ideal gas law only gives good results for hydrogen. We know that the ideal gas law is $$P\cdot V=n\cdot R\cdot T$$ with $P$ being the pressure, $V$ the volume, $n$ the amount of substance, $R$ the gas constant and $T$ the temperature (Source: Wikipedia - "Ideal gas"). An ideal gas must fulfill the following: The particles do have an infinitely small volume (or no volume), The particles do not interact with each other through attraction or repulsion, The particles can interact through elastic collisions. Now, why does only hydrogen sufficiently fulfill these conditions? I initially assumed that the reason is that it has the smallest volume possible as its nucleus only consists of a single proton. However, two things confuse me: (Let's first assume that my first idea was correct and the reason is the nucleus' scale/volume) helium's nucleus consists of two protons and two neutrons. It is therefore four times as large than hydrogen's nucleus. However, hydrogen's nucleus is infinitely times larger than an ideal gas molecule (which would have no volume), so why does the difference of $4$ significantly affect the accuracy of the ideal gas law, while the difference of an infinitely times larger hydrogen (nucleus) doesn't? My first idea is not even true, as atoms do not only consist of their nucleus. In fact, most of their volume comes from their electrons. In both hydrogen and helium, the electrons are in the same atomic orbital, so the volume of the atoms is identical. Other possibilities to explain that the ideal gas law only work for hydrogen and therefore only leave the collisions or interactions. For both of these, I do not see why they should be any different for hydrogen and helium (or at least not in such a rate that it would significantly affect the validity of the ideal gas law). So where am I wrong here? Note: I do not consider this a homework question. The question is not directly related to the actual problem, but I rather question whether the initial statement of the task is correct (as I tested every possible explanation and found none to be sufficient).
{ "domain": "physics.stackexchange", "id": 69477, "lm_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, thermodynamics, physical-chemistry, ideal-gas", "url": null }
Second way. This one is similar to Davide Giraudo's answer. \begin{align} \sum_{i=0}^{k} \dfrac{\dbinom{r}{i} \dbinom{n - r}{k - i}}{\dbinom{n}{k}} i &= \sum_{i=1}^{k} \frac{r! k! (n-k)!}{(i-1)! (r-i)! n!} \binom{n-r}{k-i} \\ &= \frac{kr}{n} \sum_{i=1}^{k} \frac{(r-1)! (k-1)! (n-k)!}{(i-1)! (r-i)! (n-1)!} \binom{n-r}{k-i} \\ &= \frac{kr}{n} \sum_{i=1}^{k} \frac{\dbinom{r-1}{i-1} \dbinom{n-r}{k-i}}{\dbinom{n-1}{k-1}} \\ &= \frac{kr}{n} \sum_{i=0}^{k-1} \frac{\dbinom{r-1}{i} \dbinom{(n-1)-(r-1)}{k-1-i}}{\dbinom{n-1}{k-1}} \\ &= \frac{kr}{n}, \end{align} where the last equality follows because the summand is the probability of choosing $k-1$ balls from an urn containing $n-1$ balls, $r-1$ of which are red, and obtaining $i$ red balls. Summing up those probabilities over all possible values of $i$ must give $1$. (This argument for the last equality is really equivalent to the Chu-Vandermonde identity cited by Davide.)
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9867771807752851, "lm_q1q2_score": 0.8157803418927542, "lm_q2_score": 0.8267118026095991, "openwebmath_perplexity": 329.81289737841263, "openwebmath_score": 0.9992175698280334, "tags": null, "url": "http://math.stackexchange.com/questions/92719/is-there-a-binomial-identity-for-this-expression-frac-binomrk-binomn" }
stereo ROS_ASSERT(l_step == r_step); ROS_ASSERT(l_image_msg->width == r_image_msg->width); ROS_ASSERT(l_image_msg->height == r_image_msg->height); cv_bridge::CvImagePtr l_image_rect(new cv_bridge::CvImage(l_cv_ptr->header, l_cv_ptr->encoding)); cv_bridge::CvImagePtr r_image_rect(new cv_bridge::CvImage(r_cv_ptr->header, r_cv_ptr->encoding)); // Downsample if desired if (config_.downsample) { // Copy cam info to be able to modify sensor_msgs::CameraInfo l_info_msg_new(*l_info_msg); sensor_msgs::CameraInfo r_info_msg_new(*r_info_msg); // Modify cam info l_info_msg_new.binning_x = 2; l_info_msg_new.binning_y = 2; r_info_msg_new.binning_x = 2; r_info_msg_new.binning_y = 2; // Update camera models l_model_.fromCameraInfo(l_info_msg_new); r_model_.fromCameraInfo(r_info_msg_new);
{ "domain": "robotics.stackexchange", "id": 14892, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "stereo", "url": null }
eyes, vision, light, uv Title: Are there specific conditions that allow humans to see ultraviolet wavelengths It is fairly common knowledge that the lens in its normal state absorbs ultraviolet (UV) radiation. An interesting notion has come up from time to time in my reading that suggests there are a small number of conditions that result in humans being able to 'see' ultraviolet. What conditions may cause this? Also, those affected, would they 'see' it has a different shade of violet? You will be interested in Aphakia, which is the lack of an eye lens usually through surgery but sometimes from birth. These individuals supposedly see UV as a whitish-blue or whitish-violet: This appears to be because the three types of colour receptor (red, green and blue) have similar sensitivity to ultraviolet, so it comes out as a mixture of all three - basically white, but slightly blue because the blue sensors are somewhat better at picking up UV.1
{ "domain": "biology.stackexchange", "id": 1289, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "eyes, vision, light, uv", "url": null }
java, observer-pattern } My Subscriber interface import java.util.Map; public interface Subscriber { public void update(Map map); } And an example subscriber import java.util.Map; public class ExampleSubscriber implements Subscriber { @Override public void update(Map map) { System.out.println(map.get("oldCachedValue")); System.out.println(map.get("newCachedValue")); } public static void main(String[] args) { ExampleSubscriber subscriber = new ExampleSubscriber(); Broker.getInstance().register(Broker.CommonTopics.ON_CACHE_RESET,subscriber); } } Example event emmitter Map m = new HashMap(); m.put("oldCachedValue","Yes"); m.put("newCachedValue","No"); Broker.getInstance().sendMessage(Broker.CommonTopics.ON_CACHE_RESET,m); First of all, mutex should be final, since you are synchronizing on it. In the current state of your code, it wouldn't make much difference, since it is private anyway and never exposed outside the class, but still, if you make it final, then the field mutex is protected against modification by the compiler, reducing the risk of bugs. If you don't ever intend to change brokerInstance, i.e. if Broker is intended to be a singleton, you can also make brokerInstance final and initialize it immediately with its declaration. This would eliminate the need for the if construct in the method getInstance(). After googling about this, I found out that the purpose of what you are doing is probably lazy initialization. However, in this question on stackoverflow, some points are made in favor of the approach with the final variable (especially the point about thread safety might be interesting to you).
{ "domain": "codereview.stackexchange", "id": 29960, "lm_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, observer-pattern", "url": null }
graph-theory, expanders Title: Existence of long induced paths in expander graphs Let's say that a graph family $\mathcal{F}$ has long induced paths if there is a constant $\epsilon > 0$ such that every graph $G$ in $\mathcal{F}$ contains an induced path on $|V(G)|^{\epsilon}$ vertices. I am interested in properties of graph families that ensure the existence of long induced paths. In particular, I am currently wondering whether constant-degree expanders have long induced paths. Here is what I know. Random graphs with constant average degree (in the Erdős–Rényi model) have long (even linear-size) induced paths with high probability; see for example Suen's article. Unique-neighbor expander graphs (as defined by Alon and Copalbo) have large induced trees. In fact, any maximal induced tree is large in such graphs.
{ "domain": "cstheory.stackexchange", "id": 2795, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "graph-theory, expanders", "url": null }
Since the exponential function is strictly increasing and maps $$[0,1] \rightarrow [e^0,e^1]$$ it has an inverse function that maps $$[e^0,e^1] \rightarrow [0,1]$$ (the natural logarithm). So we have $$e^x \leq z \Leftrightarrow x \leq log(z)$$. And therefore $$P(e^x \leq z) = P(x \leq log(z))$$. (ii) Combining (i) and (ii) gives $$P(y \leq z) = P(e^x \leq z) = P(x \leq log(z))$$. As far as your integration is concerned it is: $$\int_{{-\infty}}^{y} f_y(e^x) dy=\int_{{-\infty}}^{\ln y} f_y(e^x) e^x dx = \int_{{-\infty}}^{\ln y} f_x(e^x)dx$$, by applying the Method of Transformation to $$f_y$$ to transfrom it to $$f_x \times \frac{1}{e^x}$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9706877700966098, "lm_q1q2_score": 0.8002951004706332, "lm_q2_score": 0.8244619177503206, "openwebmath_perplexity": 205.9294258149369, "openwebmath_score": 0.8807347416877747, "tags": null, "url": "https://math.stackexchange.com/questions/3316053/why-does-the-transformation-in-the-scope-of-the-cumulative-distribution-function" }
statistical-mechanics, phase-transition, ising-model, critical-phenomena Even for $q=1$ (Bernoulli percolation), it is not known in general that $m_{q,p_c(q)}=0$ (it is known when $d=2$ and when $d\geq 11$, I think). So, even the problem of determining the order of the phase transition for general values of $q$ is largely open above dimension 2. The only exceptions are $q=2$ (the Ising model, see this paper) and $q\gg 1$. In the latter case, the transition is known to be first order (the first proof is due to Kotecký and Shlosman). Note that, when $d\geq 3$, the phase transition is expected to be of first order for all $q>2$. This has been proved (for integer $q$) for models with interactions of sufficiently long (but finite) range in this paper (see also this one); this even applies to the two-dimensional model, showing that the behavior of the planar (that is, nearest-neighbor) model is far from generic.
{ "domain": "physics.stackexchange", "id": 70647, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "statistical-mechanics, phase-transition, ising-model, critical-phenomena", "url": null }
pdesurf(p,t,u) ``` You can also run this example by typing pdedemo3. ### Domain Decomposition Problem This example shows how to perform one-level domain decomposition for complicated geometries, where you can decompose this geometry into the union of more subdomains of simpler structure. Such structures are often introduced by the PDE app. Assume now that Ω is the disjoint union of some subdomains Ω1, Ω2, . . . , Ωn. Then you could renumber the nodes of a mesh on Ω such that the indices of the nodes of each subdomain are grouped together, while all the indices of nodes common to two or more subdomains come last. Since K has nonzero entries only at the lines and columns that are indices of neighboring nodes, the stiffness matrix is partitioned as follows: $K=\left(\begin{array}{ccccc}{K}_{1}& 0& \cdots & 0& {B}_{1}^{T}\\ 0& {K}_{2}& \cdots & 0& {B}_{2}^{T}\\ ⋮& ⋮& \ddots & ⋮& ⋮\\ 0& 0& \cdots & {K}_{n}& {B}_{n}^{T}\\ {B}_{1}& {B}_{2}& \cdots & {B}_{n}& C\end{array}\right)$ while the right side is $F=\left(\begin{array}{c}{f}_{1}\\ {f}_{2}\\ ⋮\\ {f}_{n}\\ {f}_{c}\end{array}\right)$ The Partial Differential Equation Toolbox function assempde can assemble the matrices Kj, Bj, fj, and C separately. You have full control over the storage and further processing of these matrices. Furthermore, the structure of the linear system Ku = F is simplified by decomposing K into the partitioned matrix. Now consider the geometry of the L-shaped membrane. You can plot the geometry of the membrane by typing
{ "domain": "mathworks.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9828232919939075, "lm_q1q2_score": 0.8253101005357715, "lm_q2_score": 0.8397339656668287, "openwebmath_perplexity": 807.9017156702987, "openwebmath_score": 0.6983999013900757, "tags": null, "url": "http://www.mathworks.com/help/pde/ug/elliptic-pdes-1.html?nocookie=true" }
python, classifier Title: Certainity of a classifier How to build a classifier that by default will predict that it is for class 1, but if the classifier believes with 80 certainity that it belongs to 0, it will be classed as 0. How to check how certain a classifier is on it's prediction. Many classifiers will give the option to get predicted probability. Then you can just put a threshold. Here is how it can be done in with sklearn: from sklearn.ensemble import RandomForestClassifier from sklearn.datasets import make_classification # Make a dataset X, y = make_classification(n_samples=1000, n_features=4, n_informative=2, n_redundant=0, random_state=0, shuffle=False) clf = RandomForestClassifier(n_estimators=100, max_depth=2, random_state=0) clf.fit(X, y) # 1 if proba is less than 0.8, otherwise 0 predictions = 1 - (clf.predict_proba(X)[:, 0] > 0.80)
{ "domain": "datascience.stackexchange", "id": 4932, "lm_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, classifier", "url": null }
python, rock-paper-scissors if ((a) % 3 + 1 == b): return "Win"; elif ((b) % 3 + 1 == a): return "Lose" else: return "Draw" #-------------------------------------------------# def scoreBoard(u, s, name): if (os.path.isfile("score.json")): jsonFile = open("score.json", "r") data = json.load(jsonFile) jsonFile.close() if name in data: print "Current Score : ", u, s print "Top Score : ", data[name]["user"], data[name]["sys"] if (u > (data[name]["user"])): data[name]["user"] = u if (s > (data[name]["sys"])): data[name]["sys"] = s else: data.update({name:{'user':0,'sys':0}}) jsonFile = open("score.json", "w+") json.dump(data, jsonFile, indent=4) jsonFile.close() else: data = {name:{"user":0, "sys":0}} jsonFile = open("score.json", "w") json.dump(data, jsonFile, indent=4) jsonFile.close() os.chmod("score.json", 0666) #-------------------------------------------------# def topScore(): if (os.path.isfile("score.json")):
{ "domain": "codereview.stackexchange", "id": 13023, "lm_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, rock-paper-scissors", "url": null }
a = np.linspace(1, 100, 53) a array([ 1. , 2.90384615, 4.80769231, 6.71153846, 8.61538462, 10.51923077, 12.42307692, 14.32692308, 16.23076923, 18.13461538, 20.03846154, 21.94230769, 23.84615385, 25.75 , 27.65384615, 29.55769231, 31.46153846, 33.36538462, 35.26923077, 37.17307692, 39.07692308, 40.98076923, 42.88461538, 44.78846154, 46.69230769, 48.59615385, 50.5 , 52.40384615, 54.30769231, 56.21153846, 58.11538462, 60.01923077, 61.92307692, 63.82692308, 65.73076923, 67.63461538, 69.53846154, 71.44230769, 73.34615385, 75.25 , 77.15384615, 79.05769231, 80.96153846, 82.86538462, 84.76923077, 86.67307692, 88.57692308, 90.48076923, 92.38461538, 94.28846154, 96.19230769, 98.09615385, 100. ]) ## Vectorized computing vs. looping Loops over very long arrays may run slowly. An advantage of arrays is that, with arrays, loops can be avoided the whole array be manipulated directly and simultaneously. If you are a programmer, you are likely already quite familiar with the powerful idea of array computing and vectorization. If not, then consider the following example,
{ "domain": "cdslab.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9615338123908151, "lm_q1q2_score": 0.8012697830497202, "lm_q2_score": 0.8333246035907932, "openwebmath_perplexity": 1516.4741989630986, "openwebmath_score": 0.38048723340034485, "tags": null, "url": "https://www.cdslab.org/python/notes/scientific-computing/vectorization/vectorization.html" }
classification, class-imbalance, auc Note: I'm not totally sure about the proper way to deal with $P=NaN$ but I think it's ok to assume P=1 in order to put these points on the curve (this is not essential to the point anyway). It's easy to see that the AUC is very different whether the focus class is 0 or 1: In the former case the curve is entirely in the top part of the graph and the area is almost the maximum. In the latter the curve is mostly in the bottom part of the graph and the area is less than 0.5.
{ "domain": "datascience.stackexchange", "id": 8815, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "classification, class-imbalance, auc", "url": null }
ros, kinect, driver, freenect Title: kinect green light keeps freshing. Seems no driver I have installed freenect from sudo apt-get install ros-hydro-freenect-stack and also blacklist gspca_kinect(I am using Ubuntu 12.04 LTS) But when I try the command roslaunch freenect_launch freenect.launch It says that [ INFO] [1380174487.842752473]: No devices connected.... waiting for devices to be connected and then I try lsusb it shows me like Bus 002 Device 015: ID 045e:02c2 Microsoft Corp. Bus 002 Device 016: ID 045e:02be Microsoft Corp. Bus 002 Device 017: ID 045e:02bf Microsoft Corp. These are kinect's and I could not find something like camera or others. Could you please help me? Since for this Sept I could not even run kinect on Ubuntu and I feel confused. Thank you so much and I will wait for the reply. Originally posted by Battery on ROS Answers with karma: 25 on 2013-09-25 Post score: 0 Original comments Comment by brianaxelrod on 2013-10-03: I'm having this problem too. Where you able to find a solution? Comment by bit-pirate on 2013-10-03: Does it work using openni_launch? I'm using Ubuntu 12.04 with Hydro and not having any issues with my Kinects. Comment by Battery on 2013-10-04: Do you mean that you can launch Kinect successfully? What is your version of Kinect? Could you plz leave your email and we could discuss directly. Comment by bit-pirate on 2013-11-12: @brianaxelrod please post your comment as an answer in order to be able to mark this question properly as closed. Thx. It turns out that it was the specific kinect. Changing the kinect seemed to fix it. I'll have another chance to use it on Tuesday or Thursday so I can grab some more information and test it. @Battery, how would i grab the version? feel free to email me at kinect-problems@mit.edu in the next 48hours.
{ "domain": "robotics.stackexchange", "id": 15657, "lm_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, kinect, driver, freenect", "url": null }
ros-melodic link_directories(${GAZEBO_LIBRARY_DIRS}) include_directories( ${catkin_INCLUDE_DIRS} ${GAZEBO_INCLUDE_DIRS} ) include_directories( ${catkin_INCLUDE_DIRS} ${GAZEBO_INCLUDE_DIRS} ) add_executable(my_sensor_exe src/my_sensor.cpp) target_link_libraries(my_sensor_exe ${catkin_LIBRARIES}) ### INSTALL ### install(TARGETS my_sensor_exe RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} ) and I have <run_depend>robot_sensors</run_depend> in the robot_gazebo pkg's package.xml file. Can anybody see any problem? Why is the node not launching? Originally posted by kump on ROS Answers with karma: 308 on 2018-10-31 Post score: 0 I guess the problem is due to the fact that you are trying to run the node in upload_robot.xacro file. Try to remove the following line from upload_robot.xacro and put it in simulation.launch. <node name="$(arg sensor)_node" pkg="robot_sensors" type="$(arg sensor)_exe" /> If you need to run the node only if argument sensor is defined, use an if statement in the launch. Originally posted by dhindhimathai with karma: 136 on 2018-10-31 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 31992, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros-melodic", "url": null }
c#, beginner, game, console if (roundsInRange) { Console.WriteLine("Choose Rock, Paper, or Scissors: "); Console.WriteLine("1 - Rock"); Console.WriteLine("2 - Paper"); Console.WriteLine("3 - Scissors"); selectMode = Console.ReadLine(); computer = r.Next(0, rpsList.Count); if (int.TryParse(selectMode, out inputMode)) { switch (inputMode) { case 1: player = "rock"; break; case 2: player = "paper"; break; case 3: player = "scissors"; break; default: Console.WriteLine("Invalid input"); break; } } if (player == rpsList[computer].ToString()) countTies++; else if (player == "rock" && rpsList[computer].Equals("scissors") || player == "paper" && rpsList[computer].Equals("rock") || player == "scissors" && rpsList[computer].Equals("paper")) countWins++; else countLoses++; countRounds++; Console.WriteLine($"Opponent Answer: {rpsList[computer]}"); Console.WriteLine($"Ties: {countTies} Wins: {countWins} Loses: {countLoses}"); Reset(countRounds, countWins, countLoses, countTies); } } while (inPlay); } public static void Reset(int rounds, int wins, int loses, int ties) { if (rounds == roundsInput) { string playAgain; if (wins > loses) { Console.WriteLine("You win!"); } if (wins == loses) { Console.WriteLine("Tie!"); } if (wins < loses) { Console.WriteLine("You Lose!"); } Console.WriteLine("Would you like to play again? Type: y/n"); playAgain = Console.ReadLine();
{ "domain": "codereview.stackexchange", "id": 34962, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, beginner, game, console", "url": null }
javascript, game, html5, canvas I would tend to have a for loop to check the different possible ways of winning or drawing rather than one very long if condition, although your way of doing it is at least simple and transparent. You start a new game from within the checkWin function, which in turn is called from canvasClicked. This is okay but could get confusing if you put code after the call to newGame, which will then be carried out after the new game has been set up. Finally if (firstGame === true){ firstGame = false; }
{ "domain": "codereview.stackexchange", "id": 4742, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, game, html5, canvas", "url": null }
reinforcement-learning, q-learning, game-ai, combinatorial-games, tic-tac-toe # current player makes a move current_player.play_step(env.get_state()) env.reset_env() if t % 1000 == 0: print(t) print(p1.q_table[(0, 0)]) print(p1.q_table[(0, 1)]) print(p1.q_table[(0, 2)]) print(p1.q_table[(0, 3)]) print(p1.q_table[(0, 4)]) print(p1.q_table[(0, 5)]) print(p1.q_table[(0, 6)]) print(p1.q_table[(0, 7)]) print(p1.q_table[(0, 8)]) print(p1.epsylon) env.reset_env() # p1.sym = env.x while True: while True: first_move = input("Do you want to make the first move? y/n :") if first_move.lower() == 'y': first_player = Human(env, env.x) second_player = p2 break else: first_player = p1 second_player = Human(env, env.o) break current_player = None while not env.game_over(): # alternate between players # p1 always starts first if current_player == first_player: current_player = second_player else: current_player = first_player # draw the board before the user who wants to see it makes a move if current_player.ai == True: current_player.play_step(env.get_state(), random=False) if current_player.ai == False: current_player.play_step() env.draw_board() env.draw_board() play_again = input('Play again? y/n: ') env.reset_env() # if play_again.lower != 'y': # break
{ "domain": "ai.stackexchange", "id": 906, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "reinforcement-learning, q-learning, game-ai, combinatorial-games, tic-tac-toe", "url": null }
thermodynamics, statistical-mechanics, quantum-information, entropy, information In Landauer's/Bennett's thinking, there is no need to account for that - temporary decrease of entropy possible with any memory device is so small it is fluctuation. There are two commonly used variants of 2nd law. One is the simple but less accurate classical thermodynamics version, where entropy of system that only exchanges work with outsides can't decrease. This is useful and accurate enough for many applications of thermodynamics to macroscopic systems. There is also the more informed statistical physics version, which takes into account fluctuations: decrease of entropy of such thermodynamic system can happen, but probability of such event is very low, and the greater the entropy drop, the lower the probability. The idea of Maxwell's demon originally is to break the second variant: maybe there can be a device that takes advantage of the fluctuations and accumulates their effect in single direction that reliably and measurably decreases entropy of the system. If such device was constructed and verified to work, the second variant of 2nd law would become incorrect. We know the first variant is overly confident about what cannot happen, because we know about molecules and any mechanical or probabilistic model of them in simulations can result in temporary entropy decrease. It just will occur with very low probability but it is possible. Landauer argues that informationally irreversible operations have to be also thermodynamically irreversible, thus erasing $N$ bits of information must increase thermodynamic entropy by something like $Nk_B\ln 2$.
{ "domain": "physics.stackexchange", "id": 73718, "lm_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, statistical-mechanics, quantum-information, entropy, information", "url": null }
c++, multithreading, mvc, c++17, curses Title: Multithreaded MVC game engine This is an attempt at a multithreaded model-view-controller based engine for 2d console games (board games, roguelikes that sort of thing.) The code below will provide a fully working example but is missing a lot of bits as I am specifically interested in a critique of the multithreading and MVC bits though any other advice you may have will be gratefully received. You will need a c++17 capable compiler and the ncurses library to compile it. There are multiple source files: model.h #ifndef MODEL_H #define MODEL_H #include <functional> #include <memory> #include <mutex> #include <queue> constexpr inline const int MAXROWS = 10; constexpr inline const int MAXCOLS = 10; struct Command; class Model { public: Model(); std::function<void()> render; std::function<void()> shutdownController; bool at(int, int) const; void gameloop(); void move(int, int); void receiveCommand(Command*); void quit(); private: void update(); std::queue<std::unique_ptr<Command>> commands_; std::mutex mutex_; std::array<std::array<bool, MAXCOLS>, MAXROWS> board_; int row_; int col_; }; #endif model.cc #include <algorithm> #include <chrono> #include <csignal> #include <cstdlib> #include "command.h" #include "model.h" constexpr const double TICK = 1E6 / 60.0; volatile static std::sig_atomic_t endflag = 0; static void end(int sig) { switch (sig) { case SIGINT: case SIGTERM: endflag = 1; break; case SIGHUP: exit(EXIT_FAILURE); break; default: break; } }
{ "domain": "codereview.stackexchange", "id": 44520, "lm_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, mvc, c++17, curses", "url": null }
homework-and-exercises, classical-mechanics, perturbation-theory An interesting way to approach this problem is to consider only small radial oscillations about the circle. Find the oscillation frequency by expanding the effective potential about the minimum. See how this is related to the frequency of the circular orbit. What happens when $\eta\rightarrow 0$? You should find that in that case (inverse square force law), the small-oscillation frequency is identical to the circular orbit frequency. This is another way of seeing that the orbits must be ellipsoidal. But, for non-zero $\eta$, this is no longer the case. For small $\eta$, you instead get near-ellipses that just fail to close. These precessing ellipses are described by the radial formula you gave.
{ "domain": "physics.stackexchange", "id": 3982, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, classical-mechanics, perturbation-theory", "url": null }
include, ubuntu, tinyxml, ros-fuerte, ubuntu-precise if we look at the c++ compilation command with all the includes. Is there maybe missing this libtinyxml library include? Maybe this undefined reference error also could point in to this direction? But I dont know how to add this include properly.. I'm grateful for all tips! Originally posted by ajr_ on ROS Answers with karma: 97 on 2012-05-21 Post score: 1 Solved the final undefined reference error by adding this line at the END of my CMakeList.txt target_link_libraries(${PROJECT_NAME} tinyxml) I guess it's correct way according to ROS wiki for tinyxml Originally posted by ajr_ with karma: 97 on 2012-05-22 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by ajr_ on 2012-05-22: Also noted that if this is already added to control_toolbox there would not have been any errors in my rosmake. Should it perhaps be already added to control_toolbox CMakeList.txt?
{ "domain": "robotics.stackexchange", "id": 9478, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "include, ubuntu, tinyxml, ros-fuerte, ubuntu-precise", "url": null }
c++, parsing, console, boost Reduce the scope of variables There are a number of member variables that do not really need to exist. For example, m_is_sequence could instead be a local variable within decodeEscSequenceData instead of a member value. This makes the object less complex and the code easier to understand and maintain. Remember to unlock resources We don't have the code for session.hpp but in several points in the code we see code like this: session_ptr session = m_weak_session.lock(); However, there does not appear to be a matching unlock() call anywhere. Unless this is implicitly handled by the session object, that could be a problem.
{ "domain": "codereview.stackexchange", "id": 18353, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, parsing, console, boost", "url": null }
c++, c++11, collision, sfml // Object can completely fit within the bottom quadrants bool bottomQuadrant = (Rect.top > horizontalMidpoint); // Object can completely fit within the left quadrants if (Rect.left < verticalMidpoint && Rect.left + Rect.width < verticalMidpoint) { if (topQuadrant) { index = 1; } else if (bottomQuadrant) { index = 2; } } // Object can completely fit within the right quadrants else if (Rect.left > verticalMidpoint) { if (topQuadrant) { index = 0; } else if (bottomQuadrant) { index = 3; } } return index; } void QuadTree::insert(SceneNode& object) { if (mChildren[0] != nullptr) { auto index = getIndex(object.getBoundingRect()); if (index != -1) { mChildren[index]->insert(object); return; } } mObjects.push_back(&object); if (mObjects.size() < MaxObjects && mlevel > MaxLevels) return; if (mChildren[0] == nullptr) { split(); } for (auto i = mObjects.cbegin(); i != mObjects.cend();) { int index = getIndex((*i)->getBoundingRect()); if (index != -1) { auto& temp(**i); i = mObjects.erase(i); mChildren[index]->insert(temp); } else { ++i; } } } void QuadTree::getCloseObjects(const sf::FloatRect& Bounds, ObjectsContainer& returnObjects) { auto index = getIndex(Bounds); if (index != -1 && mChildren[0] != nullptr) { mChildren[index]->getCloseObjects(Bounds, returnObjects); }
{ "domain": "codereview.stackexchange", "id": 16122, "lm_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, collision, sfml", "url": null }
waves, differential-equations where the right-hand side is known as soon as we know nothing but the differential equation, $u(x,0)$ and $\partial_tu(x,0)$. It also clear that, even if the series does not converge to the solution, knowing the first two initial conditions necessarily implies that you also know the third and the fourth one, and so on, using the equation. So you cannot fix them freely without facing some contradiction. At most two initial conditions are permitted. Whether or not they really determine a (unique) solution depends on many other mathematical regularity conditions.
{ "domain": "physics.stackexchange", "id": 48129, "lm_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, differential-equations", "url": null }
special-relativity, astrophysics, relativity, doppler-effect and so (in units where $c=1$) the source wavelength is $\lambda=c\tau=10$. Let's visualize this on a spacetime diagram on drawn on rotated graph paper. The source and receiver meet briefly at event O. So, after O, they are receding from each other. With velocity $v=\frac{PQ}{OP}=(3/5)c$, the time-dilation factor is $\gamma=\frac{1}{\sqrt{1-(v/c)^2}}=\frac{OP}{OQ}=(5/4)$ and the Bondi $k$-factor $k=\frac{OR}{OT}=\sqrt{\frac{1+(v/c)}{1-(v/c)}}=2$. Suppose a light-signal was emitted at the meeting event O, and then again at event $T$, one period ($\tau_{source}=10$) later in the source frame. So, the source wavelength is the distance between wavefronts in the source frame (that is, the "separation between two lightlike signal-lines" in the source frame). From the diagram, $\lambda_{source}=c\tau=10$, as expected.
{ "domain": "physics.stackexchange", "id": 40869, "lm_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, astrophysics, relativity, doppler-effect", "url": null }
Videos Study Guides We have links to the best online AP Calculus practice exams. Develop facility with finding antiderivatives that follow directly from derivatives of basic functions (power, exponential, logarithmic, and trigonometric). Integration is the algebraic method of finding the integral for a function at any point on the graph. Lecture 19 - Double Integrals in Polar Coordinates. Wikipedia is a free online encyclopedia, created and edited by volunteers around the world and hosted by the Wikimedia Foundation. An antiderivative of a function f is a function whose derivative is f. In 2 experiments, the authors investigated a potential interaction involving the processing of concurrent feedback using design features from the specificity of practice literature and the processing of terminal feedback using a manipulation from the guidance hypothesis literature. To find an antiderivative for a function f, we can often reverse the process of differentiation. Good luck with your TEAS test studying. New Delhi Mittal Publications AVAILABLE theory practice gandhi gandhian non-violence nonviolence J. This is a can’t-miss conference for those who want to be part of an expanded educational program focused on the journey of transformation and recognition success. 5 Centroids by Integration Centroidal Axis. The basic idea of Integral calculus is finding the area under a curve. If we know F(x) is the integral of f(x), then f(x) is the derivative of F(x). Our Customers. Solve Math problems online. The provider is a psychologist who provides continuing and comprehensive mental and behavioral health care for individuals and families; consultation to agencies and communities; training, education and supervision; and research-based practice. 1 For set. we showed that an antiderivative of the sum x + e x x + e x is given by the sum (x 2 2) + e x (x 2 2) + e x —that is, an antiderivative of a sum is given by a sum of antiderivatives. Given: v i = 10 m/s, a = 2 m/s 2, Δt = 4 s Unknown: Δx = ? The value that is not given or asked for is v, so we must use the equation that does not contain v. CEP811 - Adapting Innovative Technologies to Education Instructor: David Wong CEP 811 - Application of instructional principles and methods to educational problems in the K-12 classroom. Being able to do an
{ "domain": "quellidellalambra.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9748211612253741, "lm_q1q2_score": 0.8102158269803681, "lm_q2_score": 0.8311430436757312, "openwebmath_perplexity": 1585.5757865630837, "openwebmath_score": 0.5003786683082581, "tags": null, "url": "http://vcfk.quellidellalambra.it/antiderivative-practice-khan.html" }
to! Radius of a torus is formed by revolving the circle about the y-axis, it will generate a given... A Helena tenant to get the torus position is fixed, with center the... Dimensions that a constant curvature scalar determines whether the volume due to a… License conditions the inner and radius! Be volume of a torus and may have any number of holes to be: in this context a with! The z-axis the circle ( x – a ) rotated on an axis in the origin and the of... Notice that this circular region is the region between the curves: y=sqrt { r^2-x^2 +R. ’ t have to a Helena tenant to get help volume of a torus 3 years.! 2Π 2 Rr volume = 2π 2 Rr 2 where, R = Major radius =. A cylinder assuming the radius of the tube three Riemannian dimensions that a constant curvature scalar determines whether volume. Y = 0, about the formula – volume = 2 × Pi^2 R. Place the torus on a plane p perpendicular to the left below R + a (. The axis of revolution step produced $\pi$ 0.5 ² scalar determines whether the due. To be describe a toroidal polyhedron diameter, or some hint ( 0 Author. Formula and procedure for calculating the volume of this donut-shaped '' solid given the inner radius –... Region bounded by the formula and procedure for calculating the volume of intercepted torus description: in this a... In the origin and the volume of intercepted torus 1 ) ( 3 ) for you rotate about... Have to a Helena tenant to get help cylinder assuming the radius is a 3d.. You 'll learn about the z-axis 2 * D * b 2 ) 2. Diameter, or band width of a torus is now the volume of a cone is given the. Is a 3d cylinder is shown in the same plane the Robertson-Walker metrics are maximally symmetric so they must a. And 60 degs determines a strip embedded by two ellipses y-R ) ^2=r^2 about the line the. Three Riemannian dimensions that a constant curvature scalar determines whether the volume to. Torus that is generated by a circular cross-section rotated on an axis the. 2Pi and you get the area I was looking for values and the
{ "domain": "barnabasinstitute.org", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9719924793940119, "lm_q1q2_score": 0.8013707982732136, "lm_q2_score": 0.8244619328462579, "openwebmath_perplexity": 861.7796938378502, "openwebmath_score": 0.77825528383255, "tags": null, "url": "http://barnabasinstitute.org/qtno0/7e9ae4-volume-of-a-torus" }
neuroscience, neurophysiology Title: Questions concerning synaptic input and dendritic processing In the article How Spike Generation Mechanisms Determine the Neuronal Response to Fluctuating Inputs, I read (p.11629) I have four questions concerning some formulations: What is "the membrane time constant" if this depends on the membrane resistance and capacitance which varies over the membrane? Maybe "local membrane time constant"? Or "mean membrane time constant"? What do the authors probably mean with "instantaneous postsynaptic currents"? Occurring at the same time all over the dendritic tree? What do they probably mean with "exponentially decaying synaptic currents"? The decaying of the PSPs while travelling down the dendritic tree? What's the relation between "synaptic decay time constant" and "membrane time constant"?
{ "domain": "biology.stackexchange", "id": 7739, "lm_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, neurophysiology", "url": null }
nomenclature Title: Does the term 'silver nitrate' express all of its constituent chemical elements? My professor gave my class a set of practice questions for the mid-term. One of those questions asks for the molar mass of a number of chemicals, such as lithium bromide and silver nitrate. We haven't studied those chemicals, so there's little reason for the professor to expect us to have memorized the elements that constitute those chemicals. In the case of lithium bromide, the term informs us of its constitution. Whereas,'silver nitrate' informs us that the chemical $ \mathrm{AgNO_3}$, includes silver and nitrogen, but I don't see anything in the term that would inform the reader that the chemical includes $ \mathrm{O_3}$. Is there anything in the term 'silver nitrate' that would inform a reader that the chemical includes $ \mathrm{O_3}$? More generally, is there a set of rules that relates the chemical constituents of chemical substances to the linguistic constituents of the terms that designate them? You should know that nitrate is a polyatomic ion with the molecular formula $\ce{NO3^-}$. For example: Sulfate is a polyatomic ion with the molecular formula $\ce{SO4^{2-}}$; Sulfite is a polyatomic ion with the molecular formula $\ce{SO3^{2-}}$; Nitrate is a polyatomic ion with the molecular formula $\ce{NO3^-}$; Nitrite is a polyatomic ion with the molecular formula $\ce{NO2^{-}}$ At first glance, the nomenclature of the polyatomic negative ions seems difficult. When the name of the ion ends in either -ite or -ate: The -ite ending indicates a low oxidation state. The -ate ending indicates a high oxidation state. I agree with you that at the beginning, it seems difficult. But by practicing, you find this quite easy.
{ "domain": "chemistry.stackexchange", "id": 3509, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "nomenclature", "url": null }
My brain balked at this question: The functions of f and g are defined as f(x) = 2x+1 and g(x) = 3x-2 find g^-1f^-1(x) I had a go and did this: first worked out f^-1(x): (y-1)/2 then g^-1(x): (x+2)/3 then applied the inverse of g to the inverse of f: ( (x+2)/3 -1)/2 (hope I've notated that correctly-can't use Latex yet) Well, that might be nonsense. The answer in the book put it like this: (fg)^-1(x) = g^-1f^-1(x) does that correspond to what I got above or have I 'lost the plot'? $$\displaystyle f(x) = 2x + 1 \implies f^{-1}(x) = \dfrac{x - 1}{2} \ \because$$ $$\displaystyle f(f^{-1}(x)) = f \left ( \dfrac{x - 1}{2} \right ) = 2 * \dfrac{x - 1}{2} + 1 = x - 1 + 1 = x.$$ $$\displaystyle g(x) = 3x - 2 \implies g^{-1}(x) = \dfrac{x + 2}{3}\ \because$$ $$\displaystyle g(g^{-1}(x)) = g \left ( \dfrac{x + 2}{3} \right ) = 3 * \dfrac{x + 2}{3} - 2 = x + 2 - 2 = x.$$ So all of this is well done. But now I am not sure what the problem even is. $$\displaystyle g^{-1} f^{-1}(x)$$ is meaningless.
{ "domain": "freemathhelp.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9777138190064203, "lm_q1q2_score": 0.8126200495962483, "lm_q2_score": 0.831143054132195, "openwebmath_perplexity": 709.2376829933124, "openwebmath_score": 0.8134908080101013, "tags": null, "url": "https://www.freemathhelp.com/forum/threads/confusion-over-inverse-of-a-function-involution.111481/" }
filters, filter-design, acoustics, poles-zeros Title: Using all-pole filter to model the Room Impulse Response Why is all pole model pretty useful in modelling room acoustics? Is it related to reverberation? It's not because of reverberation. When you want to model the Frequency Response of the room, it's common to simplify your approximation by using either all-pole or all-zero models. You don't want to use the full zero-pole model. To get some intuition: zeros correspond to time delays and antiresonances poles correspond to resonances of your Room Response In practice all-zero models are not being used due to various reasons, such as: required filter length is comparable to the IR length, and almost 40x the length of corresponding all-pole filter filter will be valid only for specific distances and positions between the source and receiver (remember: time-delays). That is why the all-pole model is used instead. As mentioned above, poles correspond to the resonances, i.e. standing waves, which are: independent of the source location (quite intuitive) independent of the receiver location (except of the nodes) Additionally the required filter length is way less than in case of all-zero models. According to Mourjopoulos, for $RT_{60}\approx0.5 \mathrm{s}$, the required order is within the range of $50 < N < 500$. The same author, concludes that all-pole filters are easier to manipulate than all-zero filters, due to their filter length. Morevover, author mentioned that all-pole filters are sufficient approximation than using raw impulse response data. Here is some literature: Mourjopoulos J. - On the Variation and Invertibility of Room Impulse Response Functions Mourjopoulos J., Paraskevas M. A. - Pole and Zero Modelling of Room Transfer Functions
{ "domain": "dsp.stackexchange", "id": 4477, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "filters, filter-design, acoustics, poles-zeros", "url": null }
gazebo, ros-melodic, spawn-model, xacro, robot <node pkg="gazebo_ros" type="spawn_model" name="spawn_urdf" args="-file /home/xyz/ros_ws/src/turtlebot3/turtlebot3_description/urdf/turtlebot3_$(arg model).gazebo.xacro -x $(arg x_pos) -y $(arg y_pos) -z $(arg z_pos) -param robot_description" /> </launch> But then I get this error: spawn_model: error: argument -param: not allowed with argument -file [spawn_urdf-4] process has died [pid 3277, exit code 2, cmd /opt/ros/melodic/lib/gazebo_ros/spawn_model -file /home/xyz/ros_ws/src/turtlebot3/turtlebot3_description/urdf/turtlebot3_waffle_pi.gazebo.xacro -x -2.0 -y -0.5 -z 0.0 -param robot_description __name:=spawn_urdf __log:=/home/xyz/.ros/log/e5538a02-69f2-11eb-82a4-40b89aaac2f7/spawn_urdf-4.log]. log file: /home/xyz/.ros/log/e5538a02-69f2-11eb-82a4-40b89aaac2f7/spawn_urdf-4*.log Originally posted by Giuseppe_ on ROS Answers with karma: 23 on 2021-02-08 Post score: 1 My understanding of this suggests to me that I need two files, a .urdf.xacro for the visual part and a .gazebo.xacro for the various sensors and plugin.
{ "domain": "robotics.stackexchange", "id": 36056, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gazebo, ros-melodic, spawn-model, xacro, robot", "url": null }
geometric-optics, lenses This is similar to a mirror with focal length given by the left hand side of the equation. It can be rearranged to $$\frac 1f=-\bigg(\frac{2(\mu-1)}{R_1}-\frac{2(\mu-1)}{R_2}\bigg)+\frac 2{R_2}=\frac{-2}{f_{\text{lens}}}+\frac{1}{f_{\text{mirror}}}$$ which is the required equation.
{ "domain": "physics.stackexchange", "id": 40371, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "geometric-optics, lenses", "url": null }
python, beginner def option_castle(): print('You ran inside the castle and see a glass front cubbord with garlic inside.You hear the Vampire coming,''You will: ') print(''' A. Take the garllic to scare the vampire. B. Hide C. Escape from backdoor.''') choice = input('>>> ') if choice in answer_A: print("The garlic did stopped the vampire but it did not stopped it's blood thirsty bats.\n\n RIP") return "Gameover" elif choice in answer_B: print("This is not hide n'seek \n\n RIP" ) return "Gameover" elif choice in answer_C: return "village" else: print('Invalid input') time.sleep(1) option_castle() def option_cave(): print('You ran inside a dark cave, you were not sure if its a good idea or not but in there you see a shiny silver dagger.' 'Hurry bats are coming: ') print(''' A. You pick up the dagger and fight. B. You pick up the dagger and hide. C. You run.''') choice = input('>>> ') if choice in answer_A: print('You picked the silver dagger and stood there like a fearsome warrior. The vampire attacked you but you were cunning and avoiding its attack stabbed the vampire right in its heart. Well done vampire slayer, you may live.') return "Gameover" elif choice in answer_B: print("Cowards don't get to fight and live. \n\n RIP") return "Gameover" elif choice in answer_C: return "village" else: print("Invalid input") time.sleep(1) option_cave()
{ "domain": "codereview.stackexchange", "id": 38995, "lm_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", "url": null }
quantum-mechanics, angular-momentum, symmetry, representation-theory, rotation Are there any arguments on physical grounds we could have made to arrive at the above conclusion without going through the math? Is there a general way to classify which states you can reach from a given starting state via finite rotations? Are there any arguments on physical grounds we could have made to arrive at the above conclusion without going through the math?
{ "domain": "physics.stackexchange", "id": 75801, "lm_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, angular-momentum, symmetry, representation-theory, rotation", "url": null }
thermodynamics, magnetism $$dy(1)=dA(T,M)=-SdT+BdM$$ $$dy(2)=dG(T,B)=-SdT-MdB$$ Now changing the order of the equation, we can find enthalpy, $$y(0)=U(M,S)$$ $$dy(0)=dU=BdM+TdS$$ $$dy(1)=dH(S,B)=-MdB+TdS$$
{ "domain": "chemistry.stackexchange", "id": 3726, "lm_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, magnetism", "url": null }
c++, ros-kinetic, usb-cam, camera Original comments Comment by Delb on 2020-06-18: Have you tried to remap the topics ? Comment by サイトダニエロ on 2020-06-18: oh, hello! thanks for commenting. Yes, I've tried to change the <remap from="image" to="/usb_cam/image_raw"/> to <remap from="image" to="/raspImages"/> but it just throw a error on image_view, saying that it couldn't read from that topic, so the remap worked for changing what topic a node should subscribe but I don't know how to make it change a publisher's topic. Comment by Delb on 2020-06-18: Can you show the full launch file please ? There might be more remapping required. Comment by サイトダニエロ on 2020-06-18: <launch> <node name="usb_cam" pkg="usb_cam" type="usb_cam_node" output="screen" > <param name="video_device" value="/dev/video0" /> <param name="image_width" value="640" /> <param name="image_height" value="480" /> <param name="pixel_format" value="yuyv" /> <param name="camera_frame_id" value="usb_cam" /> <param name="io_method" value="mmap"/> </node> <node name="image_view" pkg="image_view" type="image_view" respawn="false" output="screen"> <remap from="image" to="/usb_cam/image_raw"/> <param name="autosize" value="true" /> </node> </launch> from link text
{ "domain": "robotics.stackexchange", "id": 35156, "lm_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++, ros-kinetic, usb-cam, camera", "url": null }
ros Title: How do latch transforms work? I am getting this error after publishing latch transforms for camera-link to base-link. The code is at the end of the errors... [ERROR] [1380316527.758532146, 2.527000000]: Error getting latest time from frame 'camera_link' to frame 'base_link': Could not find a connection between 'base_link' and 'NO_PARENT' because they are not part of the same tree.Tf has two or more unconnected trees. (Error code: 2) [ERROR] [1380316527.758625055, 2.527000000]: Error getting latest time from frame 'hokuyo_frame' to frame 'base_link': Could not find a connection between 'base_link' and 'NO_PARENT' because they are not part of the same tree.Tf has two or more unconnected trees. (Error code: 2) [ERROR] [1380316527.767405664, 2.528000000]: Error getting latest time from frame 'camera_frame' to frame 'base_link': Could not find a connection between 'base_link' and 'NO_PARENT' because they are not part of the same tree.Tf has two or more unconnected trees. (Error code: 2) [ERROR] [1380316527.767563302, 2.528000000]: Error getting latest time from frame 'camera_link' to frame 'base_link': Could not find a connection between 'base_link' and 'NO_PARENT' because they are not part of the same tree.Tf has two or more unconnected trees. (Error code: 2) [ERROR] [1380316527.767687690, 2.528000000]: Error getting latest time from frame 'hokuyo_frame' to frame 'base_link': Could not find a connection between 'base_link' and 'NO_PARENT' because they are not part of the same tree.Tf has two or more unconnected trees. (Error code: 2)
{ "domain": "robotics.stackexchange", "id": 15685, "lm_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 }
thermodynamics, water, phase-transition Title: What makes water boil? Basically how boiling takes place? Also like to know... What makes boiling point alter at various altitudes? Why bubbles rise through boiling water? I'll give somewhat satisfying answer... Heat - We know that Heat is a form of energy that is transferred by difference in temperature of regions. Here, it's just the amount of energy required by the $H_2O$ molecules in the liquid state to get converted to gaseous state. As we provide heat, it gets absorbed by water to get converted into water vapors. Convection - It's the transfer of heat through water (proper term is fluid) caused by molecular motion. You see, Convection can be brought to focus by taking normal experiments into account. Particles (even Chalk) would rise and fall in somewhat rotatory motion due to this flow of heat. The water vapor formed at the bottom of the liquid (water) flows to the top in the form of united water vapor bubbles. 'Cause it's a gas and its so hot down there..! (This explains bubble formation when water is boiled.) Now, why boiling point differ with altitude: The atmospheric vapor pressure is 1 atm only for us (I mean, at sea level). For higher elevations, the pressure is too low out there in atmosphere. It should also be noticed that the volume change is too high when a liquid changes to gas. By Ideal gas equation, For 'n' moles of gas $\implies$ $P=\frac{nRT}{V}$ which shows that pressure is inversely proportional to volume. So, we could relate this expansion with pressure. Expanding against low pressure takes somewhat lower energy than expanding against high pressure. And hence the boiling point would be low at higher altitudes. Wiki says it somewhat clearly with a formula. Using this water boiling point calculator, Boiling point at sea level (1 atm or 29.92 inches of Hg) is approximately 212 °F whereas at a height of about 5000 ft. (24.9 inches of Hg), it is 203 °F.
{ "domain": "physics.stackexchange", "id": 4655, "lm_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, water, phase-transition", "url": null }
Graph the polar equation $r=2\sin 3\theta\text{.}$ Solution We'll graph the equation in stages in order to see how the graph is traced out. Begin with the window settings \begin{equation*} \begin{aligned}[t] \theta\text{min}\amp=0~~~~~~~~~~~\theta\text{max}=\dfrac{\pi}{3}~~~~~~\theta\text{step}=0.5\\ \text{Xmin}\amp=-4.5~~~~\text{Xmax}=4.5~~~~~~\text{Xstep}=1\\ \text{Ymin}\amp=-3~~~~~~~\text{Ymax}=3~~~~~~~~~~~~\text{Yscl}=1\\ \end{aligned} \end{equation*} Watch as your calculator produces the graph shown in figure (a). Observe that, as $\theta$ increases from $0$ to $\dfrac{\pi}{3}\text{,}$ $r$ first increases, reaching its maximum value of 2 at$\theta = \dfrac{\pi}{6}$ and then decreases back to 0. You can verify the values in the table below, which shows the points at multiples of $\dfrac{\pi}{18}\text{.}$ These points create the first loop of the graph.
{ "domain": "yoshiwarabooks.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9884918492405834, "lm_q1q2_score": 0.8127272583619356, "lm_q2_score": 0.822189134878876, "openwebmath_perplexity": 440.1261558904399, "openwebmath_score": 0.7893000841140747, "tags": null, "url": "https://yoshiwarabooks.org/trig/Polar-Graphs.html" }
ros, gazebo, ros-melodic, gazebo-ros-control Title: Problem with ros_control and gazebo I'm new to ros, I exported urdf from solidworks. when I add transmission to urdf and launch it gazebo is not opening it's giving me error as [ INFO] [1597656176.792430594, 0.245000000]: Loading gazebo_ros_control plugin [ INFO] [1597656176.793072386, 0.245000000]: Starting gazebo_ros_control plugin in namespace: / [ INFO] [1597656176.794135347, 0.245000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [robot_description] on the ROS param server. Segmentation fault (core dumped) [gazebo-1] process has died [pid 16223, exit code 139, cmd /home/xxxxx/catkin_ws/src/gazebo_ros_pkgs/gazebo_ros/scripts/gzserver -e ode worlds/empty.world __name:=gazebo __log:=/home/xxxx/.ros/log/5c2a3c2a-e069-11ea-a169-28d2447fbe91/gazebo-1.log]. log file: /home/xxxxx/.ros/log/5c2a3c2a-e069-11ea-a169-28d2447fbe91/gazebo-1*.log but if I launch removing transmission tags it's launch perfectly. I also tried with rrbot it gives me same error edit: I've noticed it's because of this <gazebo> <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so"> <robotNamespace>/</robotNamespace> </plugin> </gazebo>
{ "domain": "robotics.stackexchange", "id": 35420, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, gazebo, ros-melodic, gazebo-ros-control", "url": null }
slam, navigation, ros-kinetic, slam-gmapping, gmapping the last two lines in my bashrc contains the following lines: source /opt/ros/kinetic/setup.bash source /home/arav/catkin_ws/devel/setup.bash The gmapping works when i do source /opt/ros/kinetic/setup.bash. and rosrun gmapping slam_gmapping But my gmapping.launch is inside the catkin_ws, so when I source ~/catkin_ws/devel/setup.bash or source ~/.bashrc, the gmapping does not work ad gives the ERROR. Edit 3: Following @gvdhoorn's advice I cleaned my catkin_ws workspace by removing devel and build folders and catkin_make again. This partially solved the problem of finding the slam_gmapping node. However, I am getting a new error now. P.S. gmapping still does not work. process[gmapping-2]: started with pid [23549] /opt/ros/kinetic/lib/gmapping/slam_gmapping: symbol lookup error: /opt/ros/kinetic/lib/gmapping/slam_gmapping: undefined symbol: _ZN8GMapping14sampleGaussianEdj [gmapping-2] process has died [pid 23549, exit code 127, cmd /opt/ros/kinetic/lib/gmapping/slam_gmapping __name:=gmapping __log:=/home/arav/.ros/log/f518ac08-ff53-11e8-a0af-a0d3c148ec01/gmapping-2.log]. log file: /home/arav/.ros/log/f518ac08-ff53-11e8-a0af-a0d3c148ec01/gmapping-2*.log Originally posted by AlexR on ROS Answers with karma: 654 on 2018-12-11 Post score: 0
{ "domain": "robotics.stackexchange", "id": 32154, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "slam, navigation, ros-kinetic, slam-gmapping, gmapping", "url": null }
statistical-mechanics, hamiltonian-formalism Title: The Liouville equation and the BBGKY hierarchy. The Liouville equation of motion is written in terms of an $N$ particle distribution $f_N$. \begin{equation} \frac{\partial f_N}{\partial t}=\{H,f_N\} \end{equation} Where $\{\cdot ,\cdot \}$ is the Poisson bracket and $f_N=f_N(q_1,\dots ,q_N,p_1,\dots ,p_N)$. Let us now define an $n$ particle probability distribution function $f_n$ with $n< N$. \begin{equation} f _n(q_1,\dots,q_n,p_1,\dots ,p_n,t)=\frac{N!}{(N-n)!}\int \prod ^N_{i=n+1}d q^id p_if_{N+1}( q_1,\dots ,q_{N+1},p_1 ,\dots,p_{N+1},t) \end{equation} Now $f_n$ satisfies, \begin{equation} \frac{\partial f _n}{\partial t}=\{H_n,f_n\}+\sum ^n_{i=1}\int dq_{n+1}dp_{n+1}\frac{\partial U(q_i-q_{n+1})}{\partial q_i}\frac{\partial f _{n+1}}{\partial p_i}\ \ \ \ \ \ \ \ \ \ \ \ \ \ (*) \end{equation} With the $n$-body Hamiltonian $H_n$, \begin{equation} H_n=\sum ^n_{i=1}\bigg(\frac{p_i^2}{2m}+U(q_i)\bigg)+\sum _{i<j\leq n}U(q_{ij}) \end{equation}
{ "domain": "physics.stackexchange", "id": 24346, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "statistical-mechanics, hamiltonian-formalism", "url": null }
physical-chemistry, thermodynamics, free-energy Great. Because the decomposition is complete, we now know that our final state is $2~\mathrm{mol}~\ce{N2O(g)} + 4~\mathrm{mol}~\ce{H2O(g)}$ at $298~\mathrm{K}$ and $1~\mathrm{bar}$, and our initial state is $2~\mathrm{mol}~\ce{NH4NO3(s)}$ at $298~\mathrm{K}$ and $1~\mathrm{bar}$. So, $$\begin{align} \Delta G &= [(2~\mathrm{mol})\cdot G_\mathrm{m}(\ce{N2O(g)})] + [(4~\mathrm{mol})\cdot G_\mathrm{m}(\ce{H2O(g)})] - [(2~\mathrm{mol})\cdot G_\mathrm{m}(\ce{NH4NO3(s)})] \end{align}$$ We can't quite find the absolute molar Gibbs free energies, so the best we can do is to use Gibbs free energies of formation. $$\begin{array}{c|c} \text{Compound} & \Delta_\mathrm{f}G^\circ / \mathrm{kJ~mol^{-1}}\text{ (at }298~\mathrm{K}\text{)} \\ \hline \ce{NH4NO3(s)} & -183.87 \\ \ce{N2O(g)} & +104.20 \\ \ce{H2O(g)} & -228.57 \end{array}$$ $$\scriptsize \text{(data from Atkins & de Paula, }\textit{Physical Chemistry}\text{ 10th ed., pp 975-7)}$$
{ "domain": "chemistry.stackexchange", "id": 5546, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "physical-chemistry, thermodynamics, free-energy", "url": null }
c++, c++14, sdl, tetris void Tetromino_table::insert(const Tetromino& tetromino) noexcept { for (const auto& block_pos : block_positions(tetromino)) { if (on_screen(block_pos)) { Util::at(blocks_, block_pos) = tetromino.color_; } } } int Tetromino_table::clear_rows() noexcept { auto rows_cleared = clear_and_count_rows(); if (rows_cleared > 0) apply_gravity(); return rows_cleared; } auto Tetromino_table::blocks() const noexcept -> const Matrice& { return blocks_; } void Tetromino_table::clear_row(Row& row) noexcept { for (auto& block : row) { block = boost::none; } } void Tetromino_table::apply_gravity() noexcept { Util::for_each_row(blocks_, [this](auto n, auto& row) { if (n == 0 || !empty(row) || empty(Util::row(this->blocks_, n - 1))) return; this->shift_row(n - 1); this->clear_row(Util::row(blocks_, n - 1)); this->apply_gravity(); }); } void Tetromino_table::shift_row(std::size_t n) noexcept { Util::row(blocks_, n + 1) = Util::row(blocks_, n); } int Tetromino_table::clear_and_count_rows() noexcept { int counter = 0; Util::for_each_row(blocks_, [this, &counter](auto, auto& row) { if (filled(row)) { ++counter; this->clear_row(row); } }); return counter; }
{ "domain": "codereview.stackexchange", "id": 23924, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, c++14, sdl, tetris", "url": null }
not be same,... Some of the number inside the radical of their products when you are dealing with imaginary numbers [ 3 FALSE! Of 8, which is not a perfect square steps will be useful to simplify the expression by together! Is 2 shorten once they understand what they are like radicals number the! Video below then complete the practice skill multiplying together all the exponents ( or )... Essential Question How do I multiply and divide radicals to identify if they are radicals. Selected among thousands of others on the outside of a negative number for simplifying radicals that have coefficients selected. Sheet and Answer Key for task cards and worksheets for all! are like radicals product two... Is such a factor, we write the radicand as the square root is a reverse operation of.! Factor, we are using the product of two radicals does not to... Multiply by the conjugate in order to define the square root of a negative number do.: How do you simplify a radical, you are looking for factors that create a perfect square relate to...: How do you simplify a radical, but that radical is commonly known as the root! Fraction as a whole number outside of the common mistakes students often make radicals. Thew following steps will be useful to simplify and shorten once they understand what they doing... Multiply radicands to radicands ( they do not know if y is or... Form and show How to simplify radicals, we write the radicand as the product of! Factor, we write the radicand as the product rule of radicals and simplify answers of 75 that take... To negative radicands is commonly known as the product rule of negative exponents, product! Recording Sheet and Answer Key for task cards and worksheets for all! ( they do have... Sqrt ( 4 ) can be simplified into 2 by multiplying together all the exponents the! Find the prime factorization of the common mistakes students often make with (... Dealing with imaginary numbers the square root the original number algebra review! For factors that create a perfect square original number your variable and radical alone... All! root the original number expression by multiplying the numbers both inside outside... Prime factors outside the radical sign first Essential Question How do I multiply and divide?!
{ "domain": "gob.mx", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.981735721648143, "lm_q1q2_score": 0.8116124997470036, "lm_q2_score": 0.8267117940706734, "openwebmath_perplexity": 607.5708475436666, "openwebmath_score": 0.7944364547729492, "tags": null, "url": "http://gob2018.morelia.gob.mx/m879h4w8/viewtopic.php?id=becddd-how-to-simplify-radicals-with-a-number-on-the-outside" }
As a result, the following is the probability function of the random variable $N$. \displaystyle \begin{aligned} P(N=n)&=P(N>n-1)-P(N>n) \\&=F_{n-1}(1)-F_n(1) \\&=\frac{1}{(n-1)!}-\frac{1}{n!} \\&=\frac{n-1}{n!} \end{aligned} Now evaluate the mean. \displaystyle \begin{aligned} E(N)&=\sum \limits_{n=2}^\infty \frac{n(n-1)}{n!} \\&=\sum \limits_{n=2}^\infty \frac{1}{(n-2)!} \\&=\sum \limits_{m=0}^\infty \frac{1}{m!} \\&=e \end{aligned} With the above derivation, the proof that $e=$ 2.718281828… is the average number of random numbers to select in order to obtain a sum that exceeds 1 is completed. ________________________________________________________________________ Reference 1. Shultz H. S., Leonard B., Unexpected Occurrences of the Number e,Mathematics Magazine, October 1989, Volume 62, Number 4, pp. 269–271. ________________________________________________________________________ $\copyright \ \text{2015 by Dan Ma}$
{ "domain": "wordpress.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9867771774699747, "lm_q1q2_score": 0.8519751290039814, "lm_q2_score": 0.8633916029436189, "openwebmath_perplexity": 215.07585780412978, "openwebmath_score": 0.943716287612915, "tags": null, "url": "https://probabilityandstats.wordpress.com/2015/12/12/a-randomized-definition-of-the-natural-logarithm-constant/" }
c++, c++11, multithreading Then by the time it tries to assign something to _t, other threads might have accessed _stop atomically as well. You might think: but surely, if I just set _stop to false, then no other thread calling start() will be able to get true from the call to exchange()? But that is only true if no thread is calling stop(). So, you still need a proper mutex to ensure only one thread can call start() or stop() at any given time. But you can use an atomic flag to signal a running thread to stop, avoiding the need for the thread to hold any mutex. Note that since C++20, the atomic types have wait() and notify_all() member functions, so you can still wait, but you don't need a mutex and condition variable.
{ "domain": "codereview.stackexchange", "id": 44447, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, c++11, multithreading", "url": null }
ros, planning-environment, ompl, ros-electric Title: OMPL: Planning scene hasn't been set When trying to do an example OMPL IK plan (like that in the tutorial) the service call returns with an error code of '0' and the OMPL Planner outputs the error "Planning scene hasn't been set" Node: /ompl_planning Time: 1316551688.465001943 Severity: Error Location: /tmp/buildd/ros-electric-arm-navigation-1.0.5/debian/ros-electric-arm-navigation /opt/ros/electric/stacks/arm_navigation/ompl_ros_interface /src/ompl_ros_planning_group.cpp:OmplRosPlanningGroup::computePlan:415 Published Topics: /rosout, /ompl_planning/sync_planning_scene/result, /ompl_planning/sync_planning_scene/feedback, /ompl_planning/sync_planning_scene/status Planning scene hasn't been set Why is my planning scene not set? I'm using mostly the stock output from the arm wizard (ros electric). I can call the constraint aware IK solver directly without issue. Originally posted by John Hoare on ROS Answers with karma: 765 on 2011-09-20 Post score: 0 John, If you are calling the planner directly (not using move_arm or the planning components visualizer) you'll need to call a service that gets the planning scene to all the arm navigation components - this tutorial offers an explanation of the current system design: http://www.ros.org/wiki/arm_navigation/Tutorials/Understanding%20the%20Planning%20Scene%20architecture A lot of the diamondback tutorials haven't been updated for this. Just add this to the tutorial code (I can also give python if that's easier), which will get the current scene from the monitor and pass it to the components: //above your main static const std::string SET_PLANNING_SCENE_DIFF_NAME = "/environment_server/set_planning_scene_diff";
{ "domain": "robotics.stackexchange", "id": 6730, "lm_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, planning-environment, ompl, ros-electric", "url": null }
ros, ros2, colcon, fedora /usr/bin/ld: /usr/lib64/libSM.so: undefined reference to 'uuid_generate@UUID_1.0' collect2: error: ld returned 1 exit status /usr/bin/ld: /usr/lib64/libssh.so.4: undefined reference to 'EVP_KDF_derive@OPENSSL_1_1_1b' gmake[2]: *** [CMakeFiles/covariance_visual_test_target.dir/build.make:130: covariance_visual_test_target] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:394: CMakeFiles/covariance_visual_test_target.dir/all] Error 2 /usr/bin/ld: /usr/lib64/libssh.so.4: undefined reference to 'EVP_KDF_derive@OPENSSL_1_1_1b' /usr/bin/ld: /usr/lib64/libSM.so: undefined reference to 'uuid_unparse_lower@UUID_1.0' /usr/bin/ld: /usr/lib64/libcurl.so: undefined reference to 'SSLv3_client_method@OPENSSL_1_1_0' /usr/bin/ld: /usr/lib64/libSM.so: undefined reference to 'uuid_unparse_lower@UUID_1.0' /usr/bin/ld: /usr/lib64/libcurl.so: undefined reference to 'SSLv3_client_method@OPENSSL_1_1_0' collect2: error: ld returned 1 exit status gmake[2]: *** [CMakeFiles/line_test_target.dir/build.make:130: line_test_target] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:511: CMakeFiles/line_test_target.dir/all] Error 2
{ "domain": "robotics.stackexchange", "id": 35412, "lm_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, colcon, fedora", "url": null }
python, python-3.x Title: Collate Votes by District I have a function that is taking in a list where each element is a vote in JSON format. I am then building and returning a dictionary that looks like this: { "District A" : { "Match A" : { "Candidate A" : { 0 : 10 1 : 20 } } } Each element in the list could look something like this: { "district": "district a", "list": { "matches": [ { "match": "King", "list": { "candidates": [ { "match": "King", "candidate": "Candidate 1", "ranking": 0 }, { "match": "King", "candidate": "Candidate 2", "ranking": 1 }, { "match": "King", "candidate": "Candidate 3", "ranking": 2 }, { "match": "King", "candidate": "Candidate 4", "ranking": 3 }, { "match": "King", "candidate": "Candidate 5", "ranking": 4 } ] } }, { "match": "Queen", "list": { "candidates": [ { "match": "Queen", "candidate": "Candidate 1", "ranking": 2 }, { "match": "Queen", "candidate": "Candidate 2", "ranking": 0 }, { "match": "Queen", "candidate": "Candidate 3", "ranking": 0 }, { "match": "Queen", "candidate": "Candidate 4", "ranking": 1 }, { "match": "Queen", "candidate": "Candidate 5", "ranking": 0 } ] } } ] } } Here is my code that works: def collate_by_district(votes): collated_votes = {}
{ "domain": "codereview.stackexchange", "id": 28545, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x", "url": null }
waves Title: A particular solution for the wave equation in 1+1D I am dealing with the one-dimensional spatial wave equation $$\frac{\partial^2 \phi}{\partial z^2}-\frac{1}{v^2}\frac{\partial^2\phi}{\partial t^2}=0,$$ where $\phi=\phi(z,t)$ is required to solve. According to the algebraic approach on Wikipedia (essentially change of variables), we obtain the general solution should be in the form: $$F(z-vt)+G(z+vt)\tag{1}$$ Looking back to the wave equation, there is a trivial solution: $$\phi(z,t)=(a+bz)(c+dt)\tag{2}$$ where $\{a,b,c,d\}$ are arbitrary constants. But it seems that this solution (2) is not compatible with $F(z-vt)+G(z+vt)$. Looking back to the wave equation, there is a trivial solution: $$\phi(z,t)=(a+bz)(c+dt)\tag{2}$$ where $\{a,b,c,d\}$ are arbitrary constants. But it seems that this solution is not compatible with $F(z-vt)+G(z+vt)$?
{ "domain": "physics.stackexchange", "id": 86872, "lm_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", "url": null }
quantum-field-theory, operators, renormalization Or, in another words, I cannot obtain any sensible result with the $\phi^2$, but there is a combination of $\phi^2$ and other stuff - $m^2 \phi$, $\Box \phi$ - that gives a finite result. i apologize if the analogies are silly, I wanted to try to give myself some easy explanation. The fact that renormalization mixes a composite operator with other operators can be understood using lattice QFT, which is manifestly finite from the beginning. Lattice QFT is messy, but for this question, the only important thing is that the lattice provides a non-perturbative cutoff. Renormalization is about changing the scale of the cutoff, and the goal is to understand what this does to a composite operator like $\phi^2$. Work in euclidean signature for simplicity. In Wilson's picture, renormalization amounts to lowering the cutoff from $\Lambda_H$ to $\Lambda_L$ by integrating out modes with wavenumbers between those two scales. The subscripts $H$ and $L$ stand for high and low. Write $$ \phi(x) = \phi_H(x)+\phi_L(x), \tag{1} $$ where $\phi_{H}(x)$ is the part involving only wavenumbers between the two cutoffs, and $\phi_L(x)$ is the part involving only wavenumbers below $\Lambda_L$. The correlation functions of interest are generated by $$ Z[J,K]\propto \int [d\phi]\ \exp\left(-S[\phi] +\int \phi(x) J(x) +\int \phi^2(x) K(x)\right). \tag{2} $$ The quadratic source term $\int\phi^2 K$ is redundant in equation (2), because we can generate insertions of $\phi^2(x)$ either by taking one derivative with respect to $K(x)$ or by taking two derivatives with respect to $J(x)$.
{ "domain": "physics.stackexchange", "id": 72043, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-field-theory, operators, renormalization", "url": null }
java, beginner, game, api, snake-game public boolean moveEntity(Entity entity, int newX, int newY) { if (!checkForValidCoordinates(newX, newY)) { return false; } // check if another entity is already on field that can not be passed for (Entity ent : positions.get(newX).get(newY)) { if (!ent.isWalkable()) { return false; } } // check if entity is on field if (!placedEntities.contains(entity)) { return false; } // check if entity is moveable if (!entity.isMoveable()) { return false; } positions.get(entity.getXCoordinate()).get(entity.getYCoordinate()).remove(entity); positions.get(newX).get(newY).add(entity); entity.updateCoordinates(newX, newY); return true; } public boolean moveEntity(Entity entity, Direction direction) { switch (direction) { case UP: return moveEntity(entity, entity.getXCoordinate() - 1, entity.getYCoordinate()); case DOWN: return moveEntity(entity, entity.getXCoordinate() + 1, entity.getYCoordinate()); case LEFT: return moveEntity(entity, entity.getXCoordinate(), entity.getYCoordinate() - 1); case RIGHT: return moveEntity(entity, entity.getXCoordinate(), entity.getYCoordinate() + 1); } return false; } public boolean hasPositionEntities(int x, int y) { if (positions.get(x).get(y).isEmpty()) { return false; } return true; } public List<Entity> getEntitiesOfPosition(int x, int y) { // user is not allowed to modify list, thats why a copy is given return new ArrayList<Entity>(positions.get(x).get(y)); }
{ "domain": "codereview.stackexchange", "id": 34526, "lm_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, game, api, snake-game", "url": null }
recommender-system, data-cleaning Title: Data scheduling for recommender I do at the moment some data experiments with the Graphlab toolkit. I have at the first next SFrame, with the three columns: Users Items Rating The pair in the same row from every Users and Items values build the unique key and the Rating is the corresponded float value. These values are not normalised. First of all, I do someself next normalisation: Division of every rating value of specific user by the rating maximum from this user (scale between 0 and 1) Take the logarithm by every rating value Afterward I create a recommender model and evaluate the basic metrics for it. In this topic I invite everybody to discuss another interesting normalisation methods. If anybody could tell some good method for data preparation, it would be great. The results could be evaluated because of the metrics and I can publish it here. PS My dataset is comming from some music site, the users rated some tracks. I have approximately 100 000 users and 300 000 tracks. Total number of ratings is over 3 millions (actually the matrix is sparse). This is the most simple data set, which I analyze now. In the future I can (and will) use some additional information about the users and tracks (f.e. duration, year, genre, band etc). At the moment I just interest to collect some methods for rating normalisation without to use additional information (users & items features). My problem is, the data set doesn't have any Rating at the first. I create someself the column Rating, based on the number of events for unique User-Item pair (I have this information). You can of course understand that some users can hear some tracks many times, and another users only one time. Consequently the dispersion is very high and I want to reduce it (normalise the ratings value). Another good normalization is zScore normalization. Was already implemented in python in the module scipy.stats
{ "domain": "datascience.stackexchange", "id": 271, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "recommender-system, data-cleaning", "url": null }
c#, parsing, asp.net, csv Title: Parsing pipe delimited lines I am parsing the following line of code via a specific format. Line is: S|111111|87654321|Bar UK|BCreace UK|GBP|24/08/2010| The Format is: Index Field Length S0 - 1 S1 - 6 S2 - 34 .... ... S6 - 10 I am validating using many if statements. Could anyone suggest a better approach? private static StatementLineResult Validate(string delimitedRecord) { if (delimitedRecord == null) throw new ArgumentNullException("delimitedRecord"); var items = delimitedRecord.Split('|'); if(items.Length != 19) throw new Exception("Improper line format"); var errorMessage = new Dictionary<string, string>(); var bankIdentifierCodes = new List<string> {"ABCDGB2L", "EFGHGB2L"}; if (items[0].Length != 1 || items[0] != "S") errorMessage.Add("Record Identifier","Invalid Record Identifier"); var sortCode = 0; if (!int.TryParse(items[1], out sortCode) || items[1].Length > 6) errorMessage.Add("Sort Code", "Invalid sort code"); if (string.IsNullOrEmpty(items[2]) || items[1].Length > 34) errorMessage.Add("Account Number", "Invalid account number"); if (string.IsNullOrEmpty(items[3]) || items[1].Length > 35) errorMessage.Add("Account Alias", "Invalid account alias"); if (string.IsNullOrEmpty(items[4]) || items[1].Length > 35) errorMessage.Add("Account Name", "Invalid account name");
{ "domain": "codereview.stackexchange", "id": 15728, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, parsing, asp.net, csv", "url": null }
enzymes, 3d-structure Title: Please explain this notation MW around 9 MDa I am a computational science student and was reading about the structure of Pyruvate dehydrogenase (PDH). link to article The article mentions "PDH is a large complex (MW around 9 MDa) consisting of multiple copies of three enzymes." What does MW around 9 MDa denote ? I am not a regular student of biology but rather an engineering student so please try to provide simple explanations. The molecular weight of PDH enzyme is approximately 9$\times$10$^6$ gm/mol The Dalton (or atomic mass unit (amu) ) is a unit of mass defined as 1/12 weight of carbon-12 atom in ground state. 1 Da = 1/12 m(12C) The number of atoms in 1 mole is Avogadro's number (6.023 x 10^23) so weight of 1 carbon atom is = (12/ 6.023 x 10^23 ) g This means 1Da (1 amu) = 1/12 x (12/ 6.023 x 10^23 ) g = 1/ 6.023 x 10^23 g which is g/mole (1 MOLE = 6.023 x 10^23 ) => 1 Da = 1g/mole
{ "domain": "biology.stackexchange", "id": 7637, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "enzymes, 3d-structure", "url": null }
quantum-mechanics, nuclear-physics, many-body, second-quantization, wick-theorem That is, can we say $c_a^\dagger c_b$ is normal-ordered with respect to the vacuum $\left|-\rangle\right.$, so $\langle c_a^\dagger c_b \rangle$ should be 0 there but isn't normal-ordered with respect to the state $\left|\Phi\rangle\right.$ where $c^\dagger_a c_b \ne :c^\dagger_a c_b:$ (whatever $:c^\dagger_a c_b:$ actually is)? Is there a way to prove that some combination $c_a^\dagger c_b$, $c_a c_b$, etc. always has a vanishing normal-ordered product (I think I can show this with Boguliubov quasiparticles in this case)? If we have the freedom of #2, then #1 is trivial without having to calculate anything, since $$ \rho_{ba} = \left.\langle\Phi\right| c_a^\dagger c_b\left|\Phi\rangle\right. = \left.\langle\Phi\right| \langle c_a^\dagger c_b \rangle + :c_a^\dagger c_b:\left|\Phi\rangle\right. = \langle c_a^\dagger c_b \rangle. $$ From there we can do the more general decomposition $$\left.\langle\Phi\right| c_a^\dagger c_b^\dagger c_d c_c \left|\Phi\rangle\right. = \rho_{ca} \rho_{db} - \rho_{da}\rho_{cb} + \kappa_{ba}^* \kappa_{cd},$$
{ "domain": "physics.stackexchange", "id": 46058, "lm_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, nuclear-physics, many-body, second-quantization, wick-theorem", "url": null }
evolutionary-algorithms, neat, fitness-functions, fitness-design But this blows up the score too much and now the food quality is not respected and they just gulp on anything slightly above 0. A human analogy can help you here (a variance). Initialize all the agents with an initial value $x$; we will call this energyUnits. I Will talk later more about this. Now, add some value, as an incentive, whenever the agent eats good food, to the energyUnits. You need to add a function that will keep decrementing the value of the agent's energyUnits, as humans degrade energy (calories) with time. We will call this function normalDegrade. This is the core part of the solution for your problem. Now, for the bad (or poisonous) food you can be more creative with. You can simply subtract a given value whenever an agent eats poisonous food. Or you can extend your normalDegrade function with a very high downward slope. In this case, the energy units (value) of the agent will fall very rapidly. This will force the agent to look for good food to survive. Since the ratio of food is 9:1 with poisonous, you need to initialize the value of $x$ (energyUnits) very high. You need to do some trial and error to find the right fit for you here. Also, I am assuming that the agent is being removed from the population whenever the value of $x$ is zero or some negative value (which depends). This is important, as it makes sure that the algorithm is not wasting time in processing bad agents. Because of this, another problem arises of the population coming to extinction. For this, you need to keep generating new agents for which any of the genetic algorithms will do. A new population with better parents of the already present generation will keep the population fit and efficient. A good fitness function is a core to solving any problem of this kind, and sometimes it is hard to find. You might need to do some trial and error with different values to look for the right fit.
{ "domain": "ai.stackexchange", "id": 455, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "evolutionary-algorithms, neat, fitness-functions, fitness-design", "url": null }
How likely is it that one will have a child in his “reverse year”? That restricts it more, since the resulting age has to be within the childbearing years. For example, in your case your age at her birth was 1974 – 1947 = 27. If we suppose that, say, a child can be born to a parent aged 16 to 45, then your scenario is feasible for people born in about 30% of all years, and considerably more likely for, say, 10-15%. (Actually, this is a little more subtle than what I just said, and I checked by making a spreadsheet to actually count years that would work.) With appropriate statistical information, one might come up with a probability of actually having a child in a given year. But that’s beyond my level of interest. But I recalled my twin brother pointing out something similar based on our father’s age, and was able to find it: Reversal of Age Digits Every Eleven Years. What he describes there will also apply to you and your daughter: Because you were a multiple of 9 years old when she was born, every 11 years your ages have reversed digits, as they are this year. So not only is your situation this year not unique, it is not unique to you: It also happened when she was 3, and 14, and 25, and 36! But it will stop happening when you pass 100 … This site uses Akismet to reduce spam. Learn how your comment data is processed.
{ "domain": "themathdoctors.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9822877012965886, "lm_q1q2_score": 0.8551769928379297, "lm_q2_score": 0.8705972717658209, "openwebmath_perplexity": 632.7284854220119, "openwebmath_score": 0.667602002620697, "tags": null, "url": "https://www.themathdoctors.org/a-sample-of-ask-dr-math-part-2-questions-outside-of-school/" }
java, beginner, comparative-review do { System.out.printf("Choose your Vote: 1. %s 2. %s 3. %s\n", a.getName(), b.getName(), c.getName()); Scanner in2 = new Scanner(System.in); String choice = in2.next(); if (choice.equals("1")) { System.out.printf("Sure to vote for %s? Y/y=yes", a.getName()); Scanner in3 = new Scanner(System.in); String sure = in3.next(); if (sure.equals("Y") || sure.equals("y")) { a.addVote(); break; } } else if (choice.equals("2")) { System.out.printf("Sure to vote for %s? Y/y=yes", b.getName()); Scanner in3 = new Scanner(System.in); String sure = in3.next(); if (sure.equals("Y") || sure.equals("y")) { b.addVote(); break; } } else if (choice.equals("3")) { System.out.printf("Sure to vote for %s? Y/y=yes", c.getName()); Scanner in3 = new Scanner(System.in); String sure = in3.next(); if (sure.equals("Y") || sure.equals("y")) { c.addVote(); break; } } else { System.out.print("You have to chose one of the 3 Nominees! No chance to not Vote!"); } } while(true); voters[i].voted(); }
{ "domain": "codereview.stackexchange", "id": 23680, "lm_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, comparative-review", "url": null }
G = np.arange(1,10).reshape(3,3) G @ G.T array([[ 14, 32, 50], [ 32, 77, 122], [ 50, 122, 194]]) Next, create a skew-symmetric matrix by using the same upper triangle matrix, and creating a transposed additive inverse of it, then add the two matrices together. $\boldsymbol{V} = -\boldsymbol{U} + \boldsymbol{U}^T$ v = (u * -1) + u.T print(f'matrix V:\n{v}') matrix V: [[ 0 -2 -3] [ 2 0 -6] [ 3 6 0]] Check for skew-symmertic $\boldsymbol{V}^T = -\boldsymbol{V}$ # is the s matrix skew-symmetric? np.array_equal(v.T, (v * -1)) True ### Augmented Matricies Augmented matrices often used for solving a system of equations, they are the concatenation of two matrices with the same number of rows (${m} = {m}$). $\boldsymbol{A} = \begin{pmatrix} 1 & 0 & 0 \\ 4 & 5 & 0 \\ 7 & 8 & 9 \\ \end{pmatrix} \sqcup \begin{pmatrix} 1 & 4 & 7 \\ 0 & 5 & 8 \\ 0 & 0 & 9 \\ \end{pmatrix} = \left( \begin{array}{ccc|ccc} 1 & 0 & 0 & 1 & 4 & 7 \\ 4 & 5 & 0 & 0 & 5 & 8 \\ 7 & 8 & 9 & 0 & 0 & 9 \\ \end{array} \right)$ print(f'matrix L:\n{l}\n') print(f'matrix U:\n{u}') matrix L: [[1 0 0] [4 5 0] [7 8 9]] matrix U: [[1 2 3] [0 5 6] [0 0 9]]
{ "domain": "imti.co", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9845754515389344, "lm_q1q2_score": 0.8049637678177641, "lm_q2_score": 0.8175744850834648, "openwebmath_perplexity": 2873.933939181521, "openwebmath_score": 0.5088154077529907, "tags": null, "url": "https://imti.co/linear-algebra-matrices/" }
probability-theory Title: Dempster-Shafer theory initial belief values I am looking to implement D-S Theory in my (computer science) research, I'll be using it to determine the probability that a triggered sensor event is a true positive. How would you calculate an initial belief value without having the ability to perform data mining on a dataset (a cold start)? One solution that has been postulated is to use the manufactures performance statistics that the sensors are working correctly and then adjust this over time to take account for false positives. Although this will result is a very high initial belief rate for some sensors (95% belief). If the 95% (initial) belief corresponds to the probability of a true positive according to the performance statistics, then that seems appropriate to me.
{ "domain": "cs.stackexchange", "id": 5577, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "probability-theory", "url": null }
Therefore the equation is equivalent to $$2\sin x \cos x= \cos x$$ You can factor $$\cos x$$ and continue from there. • So, would $2\sin x = 1$? That would mean that, $\sin x = \frac{1}{2}$. How can I get the answer my professor provided? – LuminousNutria Dec 2 '18 at 17:30 • You also have $\cos x =0$ to solve for more solutions – Mohammad Riazi-Kermani Dec 2 '18 at 18:08 so we have: $$\sin(2x)=\cos(x)$$ note from the double angle formula that: $$\sin(2x)=2\sin(x)\cos(x)$$ so we get: $$2\sin(x)\cos(x)=\cos(x)$$ from this we get two types of solutions: $$\cos(x)=0\tag{1}$$ $$2\sin(x)=\cos(x)\tag{2}$$ if we continue first with $$(1)$$ we get: $$\cos(x)=0$$ $$x=\frac\pi2,\frac{3\pi}2$$ as we are restricted with $$0\le x\le2\pi$$. Now we can move on with $$(2)$$: $$2\sin(x)=\cos(x)$$ rearranging gives: $$\tan(x)=\frac{1}{2}$$ and there are a further two solutions to this.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9825575162853135, "lm_q1q2_score": 0.8250869196460159, "lm_q2_score": 0.8397339656668287, "openwebmath_perplexity": 282.1247672220493, "openwebmath_score": 0.9531715512275696, "tags": null, "url": "https://math.stackexchange.com/questions/3022911/solve-sin2x-cosx-on-the-interval-0-2-pi" }
java, design-patterns Now if we have an extra calculator class, all these properties can be weighted in there. Having an extra class for this might for example be necessary if we plan to support different markets. For example, a market of a cat-show will assess fur and color higher than other properties. On the other side, a meat market will assess age and weight higher than other properties. So decoupling the price calculation from your model classes might be preferable.
{ "domain": "codereview.stackexchange", "id": 40498, "lm_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, design-patterns", "url": null }
python, python-3.x, regex, pandas main.py import re from typing import Iterable, Union import pandas as pd indexs=... def make_index_tuples() -> Iterable[tuple[str, str, Union[str, None]]]: pattern = r""" (?:(\d{2,4}mb)\s+)? # capture group 1: match level if any ([A-Za-z0-9\s-]*) # capture group 2: match parameter between (?:\s\(|\((.*)\))? # capture group 3: matching anything between(UNIT) if any """ # sometimes there is a space between the parameter and unit sometimes not for index in indexs: level, param, unit = re.search(pattern, index, re.VERBOSE).groups() if level is None: level = "surface" param = param.strip().replace(" ", "_").lower() yield level, param, unit def start(): df_index = pd.MultiIndex.from_tuples( tuple(make_index_tuples()), names=("level", "parameter", "unit"), ) if __name__ == "__main__": start()
{ "domain": "codereview.stackexchange", "id": 43214, "lm_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, regex, pandas", "url": null }
electrostatics, charge, gauss-law Title: Using Gauss's law when point charges lie exactly on the Gaussian surface Suppose you place a point charge $+Q$ at the corner of an imaginary cube. Since electric field lines are radial, there is no flux through the three adjacent (adjacent to the charge) sides of the cube. However there is some amount of flux passing through the other three sides of the cube (flowing out of the cube). We can estimate that the flux through these three surfaces combined is equal to $Q/(8\epsilon)$. As, if you consider $7$ other cubes having the charge at the corner, each of them would have equal flux flowing out by symmetry and since the total flux through the $8$ cubes is $Q/\epsilon$, each cube would have a flux of $Q/(8\epsilon)$. Now apply Gauss' law to the cube, and we find that the cube encloses a charge of $Q/8$. This means that 1/8th of the charge belongs to this cube. But the charge we placed was a point charge with no dimensions. It cannot be split into parts. What is wrong? Gauss's law applies to situations where there is charge contained within a surface (or entirely outside of it, of course), but it doesn't cover situations where there is a finite amount of charge actually on the surface - in other words, where the charge density has a singularity at a point that lies on the surface. For that, you need the "Generalized Gauss's Theorem" [PDF], which was published in 2011 in the conference proceedings of the Electrostatics Society of America. (I found out about this paper from Wikipedia.) The Generalized Gauss's Theorem as published in that paper says that $$\iint_S \vec{E}\cdot\mathrm{d}\vec{A} = \frac{1}{\epsilon_0}\biggl(Q_{\text{enc}} + \frac{1}{2}Q_{\text{con}} + \sum_{i}\frac{\Omega_i}{4\pi}q_{i}\biggr)$$ where
{ "domain": "physics.stackexchange", "id": 99910, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electrostatics, charge, gauss-law", "url": null }
python, python-3.x, file else: print("Enter a y or n only") option_two() return elif USER_INPUT == 3: #Write a new file user_message(3) USER_INPUT = input("Is this file located on the desktop? y/n") if USER_INPUT == "y": USER_INPUT = input("What is the name of the file?") write_file("//home//alpha//Desktop//{0}".format(USER_INPUT)) elif USER_INPUT == "n": USER_INPUT = input("Enter the full path for the file") write_file(USER_INPUT) else: print("Enter a y or n only") option_two() return elif USER_INPUT == 4: #Delete a file user_message(4) USER_INPUT = input("Is this file located on the desktop? y/n") if USER_INPUT == "y": USER_INPUT = input("What is the name of the file?") delete_path("//home//alpha//Desktop//{0}".format(USER_INPUT), path_exists) elif USER_INPUT == "n": USER_INPUT = input("Enter the full path for the file") delete_path(USER_INPUT, path_exists) else: print("Enter a y or n only") option_two() return elif USER_INPUT == 5: user_message(5) print("Moving back to main") return except(ValueError): print("Invalid input, try again\n\n") option_two() In my opinion this can be greatly simplified. First, there is no need for this to be a recursive function (which are seldom the best choice in Python due to the maximum recursion depth). Just make it an infinite loop. Second, all of your options are almost the same. You ask if the file is on the desktop, then for the file name/path and then do something with that path. So, just define a function for that first part: USERNAME = "alpha"
{ "domain": "codereview.stackexchange", "id": 31955, "lm_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, file", "url": null }
machine-learning, markov-property, hidden-markov-model Title: Is the Markov property assumed in the forward algorithm? I'm majoring in pure linguistics (not computational), and I don't have any basic knowledge regarding computational science or mathematics. But I happen to take the "Automatic Speech Recognition" course in my graduate school and struggling with it. I have a question regarding getting the formula for a component of the forward algorithm. $$ \alpha_t(j) = \sum_{i=1}^{N} P(q_{t-1} = i, q_t=j, o_1^{t-1}, o^t|\lambda) $$ When $q$ is a hidden state, $o$ is a given observation, and $\lambda$ contains transition probability, emission probability and the start/end state. Is the Markov assumption (the current state is only dependent upon the one right before it) assumed here? I thought so, because it contains $q_{t-1}=i$ and not $q_{t-2}=k$ or $q_{t-3}=l$. In general, to formally state that the Markov property holds, you need to have $P( x_t \mid x_{t-1:1}) = P(x_t \mid x_{t-1})$. So, you cannot conclude only from $P(q_{t-1} = i, q_t=j, o_1^{t-1}, o^t|\lambda)$ that the Markov property holds, because $P(q_{t-1} = i, q_t=j, o_1^{t-1}, o^t|\lambda)$ is the joint probability of $q_{t-1} = i, q_t=j, o_1^{t-1}$ and $o^t$ given $\lambda$. Nonetheless, the theory of hidden Markov model often assumes that a few properties (including the Markov property) hold
{ "domain": "ai.stackexchange", "id": 1187, "lm_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, markov-property, hidden-markov-model", "url": null }
rviz, moveit, joystick core service [/rosout] found process[joy-1]: started with pid [18647] process[moveit_joy-2]: started with pid [18653] [ INFO] [1451737269.241626212]: Loading robot model 'abb_irb2400'... [ INFO] [1451737270.145544577]: Loading robot model 'abb_irb2400'... Traceback (most recent call last): File "/home/benjamin/moveit/src/moveit_ros/visualization/python/moveit_ros_visualization/moveit_joy.py", line 609, in <module> app = MoveitJoy() File "/home/benjamin/moveit/src/moveit_ros/visualization/python/moveit_ros_visualization/moveit_joy.py", line 380, in __init__ self.updatePlanningGroup(0) File "/home/benjamin/moveit/src/moveit_ros/visualization/python/moveit_ros_visualization/moveit_joy.py", line 398, in updatePlanningGroup next_planning_group = self.planning_groups_keys[self.current_planning_group_index] IndexError: list index out of range terminate called after throwing an instance of 'class_loader::LibraryUnloadException' what(): Attempt to unload library that class_loader is unaware of. [moveit_joy-2] process has died [pid 18653, exit code -6, cmd /home/benjamin/moveit/src/moveit_ros/visualization/python/moveit_ros_visualization/moveit_joy.py __name:=moveit_joy __log:=/home/benjamin/.ros/log/c348c3e0-b148-11e5-96a0-8c2937e5b4fe/moveit_joy-2.log].
{ "domain": "robotics.stackexchange", "id": 23334, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rviz, moveit, joystick", "url": null }
Can the roots of the derivative of the polynomial in complex variable be as close as we want them to be from the roots of the polynomial itself? The (probably) famous Gauss-Lucas theorem states that the roots of the derivative $P'(z)$ are contained in the convex hull of the roots of $P(z)$, where $P(z)$ is complex variable polynomial. I am interested here in could it be the case that we always have some polynomial of any degree (except $1$) $P(z)$ such that some root of its derivative is "at a small as we want distance" from some root of $P(z)$. To be more precise, here is the statement of the question: Is it true that for every $\varepsilon>0$ and for every $n\in \mathbb N \setminus \{1\}$ there exists polynomial $P(z)$ in complex variable of degree $n$ with $n$ different roots such that there is root $z_a$ of $P'(z)$ and root $z_b$ of $P(z)$ which are such that we have $|P'(z_a)-P(z_b)|<\varepsilon$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9901401429507652, "lm_q1q2_score": 0.8830179238445046, "lm_q2_score": 0.8918110533454179, "openwebmath_perplexity": 110.90299211567454, "openwebmath_score": 0.8334363102912903, "tags": null, "url": "https://math.stackexchange.com/questions/1527968/can-the-roots-of-the-derivative-of-the-polynomial-in-complex-variable-be-as-clos" }
So I have that $O$ is closed, but I'm not sure if it is convex? If I can show that, the rest of the proof is straightforward. • Surely any vector subspace of a real (or complex) vector space is convex? – Lord Shark the Unknown Aug 31 '17 at 12:40 • Can't you just use the definition of convexity? Take two functions, compute the convex combination and show it is an odd function. – user8469759 Aug 31 '17 at 12:40 • Note that for any $f \in L^2(-1, 1)$ we have $f(x) = \frac{f(x) + f(-x)}{2}+\frac{f(x)-f(-x)}{2}$, where $x \mapsto \frac{f(x) + f(-x)}{2}$ is an even function, and $x \mapsto \frac{f(x) - f(-x)}{2}$ is an odd function. Furthermore, if $g$ is even, and $h$ is odd, then $\langle g, h \rangle = \int_{-1}^{1} f\overline{g} = 0$, as it is an integral of an odd function on a symmetric interval. – mechanodroid Aug 31 '17 at 12:45 • @mechanodroid How does that show the subspace of odd functions is closed though? ...we need to show that it contains all its limit points..i.e. that any sequence of odd functions in $L^2(-1,1)$ converges to an odd function. – eurocoder Sep 1 '17 at 6:07 • I'm with Lord Shark here. It's a subspace, so it's convex, as all subspaces are. – Michael Grant Sep 2 '17 at 2:31 There are several ways to show $O\oplus E = H$. The first is a direct proof I have provided in the comments:
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9843363476123224, "lm_q1q2_score": 0.8202716844504064, "lm_q2_score": 0.8333245911726382, "openwebmath_perplexity": 77.97438411164924, "openwebmath_score": 0.99871826171875, "tags": null, "url": "https://math.stackexchange.com/questions/2412176/is-the-subspace-of-odd-functions-of-l2-1-1-convex" }
visible-light, acoustics, everyday-life Title: Why does a tubelight make noise when switched on? I have noticed that when certain tube-lights are switched 'ON' , they make certain noise corresponding to their "blinking". In blinking, there are alternate periods of the tube lighting up and then going out. The "sound" is heard at the instant the tube lights up. I can not properly describe the "noise" or the "sound" I'm referring to, but it seems as if the tube-light is struck gently with something. It feels as if the gas molecules inside the tube-light are striking its inner surface. Can anybody explain this ? I am not sure, but I suspect what you hear is sound from the ballast as the field changes in it, causing it to physically change size slightly. You get similar thumps from large transformers as they are powered on. The ticking sound as the tube warms up happens significantly later in my experience: it's just the normal slip-stick sound that lots of things made from parts make as they warm or cool (car engines, notably). A test of this theory would be to take a tube light fitting apart and separate the ballast from the tube (just by adding suitably long wires) which would allow you to tell what makes the noise. Don't do this experiment unless you are competent with mains electricity!
{ "domain": "physics.stackexchange", "id": 36118, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "visible-light, acoustics, everyday-life", "url": null }
javascript, sudoku should be addNumber(sudoku); Use comments to describe why, or what if what isn't obvious - for example: // Go one step back if sudoku doesn't have unique solution anymore is good, whereas //Solve sudoku solveSudoku(sudoku, 0); doesn't communicate anything useful. solveSudoku is somewhat confusing: it returns a value that often isn't used by callers, and reassigns the solution into a variable completely disconnected from the caller. For example: let sudoku = generate(); solveSudoku(sudoku, 0); showSudoku(elements, sudoku); The purpose of solveSudoku is mysterious until you read the function to find out what its side-effects are. Functions are easiest to make sense of at a glance when they're pure, or at least not too impure. Here, consider returning the value from solveSudoku and using it, eg: const sudoku = generate(); solution = solveSudoku(sudoku, 0).solution; // with `numUniqueSolutions` as the other property in the object showSudoku(elements, sudoku); That makes a lot more sense at a glance. You could go further and avoid the reassignment of the solution variable at all, but that would require some significant refactoring. The above approach also makes it much clearer what sort of value solveSudoku is returning: numUniqueSolutions (This isn't obvious at a glance from your current implementation of solveSudoku)
{ "domain": "codereview.stackexchange", "id": 39979, "lm_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, sudoku", "url": null }