text
stringlengths
1
1.11k
source
dict
c#, mvc, winforms, dependency-injection, ninject You don't need the [Inject] attribute here. Don't use [Inject] attributes. Imagine you have your composition root in a completely different assembly - the only assembly in your solution that needs a reference to Ninject, is the assembly with the composition root. Having a dependency on Ninject anywhere else should be forbidden, your code should be written in a completely IoC Container-agnostic way: having an [Inject] attribute in your business code suggests that your business code is able to work with an IKernel at any given time, and you don't want to give that impression - be it only because in time, the code will be maintained by someone else (yes, future you is someone else!), and it's always a good idea to send a clear message to that future maintainer, that the IoC container lives and dies in its own little corner and doesn't travel anywhere.
{ "domain": "codereview.stackexchange", "id": 18885, "lm_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#, mvc, winforms, dependency-injection, ninject", "url": null }
$|G| = |Z(G)| + \sum|cl(a)|$ where we assume that each conjugacy class is represented only once (i.e we are not including the singletons in the second summand). However, since we know that the order of a conjugacy class divides the order of a group we can rewrite the second summand to be $\sum_i(p^{k_i})$ where $0 < k_i < n$ because clearly none of them can have the same order as $G$, and we finally get $|G| = |Z(G)| + \sum_i(p^{k_i})$ where $0 < k_i < n$ Now to see that $p$ must divide $|Z(G)|$ we see that we can move the second summand to left and replace $|G|$ with $p^n$ to get $p^n - \sum_i(p^{k_i}) = |Z(G)|$ and clearly we can factor out $p$. EDIT: Showing that the order of a conjugacy class must divide the order of a group: To prove this, we will show that the size of a conjugacy class of a, $cl(a)$ is the index of the centralizer of $a$, $C(a)$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9830850902023109, "lm_q1q2_score": 0.8432590366540819, "lm_q2_score": 0.8577681068080749, "openwebmath_perplexity": 91.4053543208808, "openwebmath_score": 0.9257936477661133, "tags": null, "url": "https://math.stackexchange.com/questions/64371/showing-group-with-p2-elements-is-abelian/64374" }
ros, ros2, colcon Title: Why does ROS2 custom message colcon build give include file errors? I am new to ROS2, but very familiar with ROS1. I am doing a very minor tweak of the ROS2 tutorial Creating custom ROS 2 msg and srv files and it fails to build. The base tutorial code works fine. I don't care about srv so I got rid of that. And I added a new message. The new message I added is named Complex.msg, and is shown below Header header Num num My CMakeLists.txt is as follows: cmake_minimum_required(VERSION 3.8) project(tutorial_interfaces) if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic) endif() # find dependencies find_package(ament_cmake REQUIRED) # uncomment the following section in order to fill in # further dependencies manually. # find_package( REQUIRED) find_package(rosidl_default_generators REQUIRED) rosidl_generate_interfaces(${PROJECT_NAME} "msg/Num.msg" "msg/Complex.msg" )
{ "domain": "robotics.stackexchange", "id": 37286, "lm_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", "url": null }
python, software-defined-radio Title: pyrtlsdr: Why is my output different than universal radio hacker? I'm trying to build a script to do some signal processing from my RTLSDR. But, the bits I'm getting is not what I would expect. The preamble using 'Universal Radio Hacker' looks like this: But after plotting all values my script is seeing (-1 until +1) it looks like this:
{ "domain": "dsp.stackexchange", "id": 5777, "lm_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, software-defined-radio", "url": null }
ruby, unicode I think you're looking for String#each_codepoint instead of String#each_byte. A UTF-16 non-ASCII character could well be composed of two ASCII bytes. UTF-8 non-ASCII characters are readily composed of multiple bytes, so you'd be getting multiple reports per character. If you assume a single-byte encoding, both will do (and each_byte is more explicit), but ... If your intention is to test single-byte encodings, then the mask 0x80 will suffice. If your intention is to support any encoding of the Unicode character set, then the mask 0xff80 will not suffice as Unicode code points are 20 bits long. Some rare characters actually lie in the U+10000 .. U+1007F region. Perhaps the surest test is to use > 0x7F Better yet, realise you are working with strings, and use string methods to manipulate them.
{ "domain": "codereview.stackexchange", "id": 4364, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ruby, unicode", "url": null }
c, database, circular-list, embedded The BucketPut API writes the feed to the bucket. E.g. 1: If the BucketPut sees that consecutive feeds written have the same timestamp, then it writes the data as shown below. This is done to save memory. [Slot] [Data] [Slot] [Data] [Slot] [Data]...[Timestamp] E.g. 2: If the BucketPut sees that consecutive feeds written have different timestamps, then it writes the data as shown below. [Slot] [Data] [Timestamp] [Slot] [Data] [Timestamp] [Slot] [Data] [Timestamp]... E.g. 3: If the BucketPut sees a mixture of above, then it writes the data as shown below. [Slot] [Data] [Slot] [Data] [Slot] [Data] [Timestamp] [Slot] [Data] [Timestamp] [Slot] [Data] [Slot] [Data] [Timestamp] The BucketGet API reads the feed in the following format. [Key] [Value] [Timestamp] * Notes: 1. Module hasn't been tested for the STRING data type. */
{ "domain": "codereview.stackexchange", "id": 40696, "lm_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, database, circular-list, embedded", "url": null }
c#, algorithm, linq, .net-datatable var matchedKitItems = enumeratedKits.Where(r => String.Equals(r["Kit_Description"].ToString().Trim(), kitLineItem["Invoice Description"].ToString().Trim())); int numberOfKitsInvoiced = Convert.ToInt32(kitLineItem["Invoice Quantity *"]); int requiredKitItemCount = matchedKitItems.Count(); int startingPOLineNum = Convert.ToInt32(kitLineItem["PO Line *"]) + 1;//incrementing 1 to start with the next line int endingPOLineNum = startingPOLineNum + requiredKitItemCount - 1;//decrementing 1 to not skip ahead beyond the kit item count var invoiceItemsToCheck = invoiceItems.Where(r => Convert.ToInt32(r["PO Line *"]) >= startingPOLineNum && Convert.ToInt32(r["PO Line *"]) <= endingPOLineNum);
{ "domain": "codereview.stackexchange", "id": 19905, "lm_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, linq, .net-datatable", "url": null }
demodulation, software-defined-radio, frequency-modulation, amplitude-modulation Note the last point in the OP asking about a factor of 1/2. This has nothing to do with the phase offset but is due to half the signal being in the sum and half in the difference as given by the cosine product rule below: $$A \cos(\alpha)\cos(\beta) = \frac{A}{2}\cos(\alpha+\beta)+\frac{A}{2}\cos(\alpha-\beta)$$ Thus we get a low frequency output (at DC when the frequencies match exactly) and a high frequency output, each scaled by $1/2$. The low pass filter removes the high frequency.
{ "domain": "dsp.stackexchange", "id": 11819, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "demodulation, software-defined-radio, frequency-modulation, amplitude-modulation", "url": null }
You can use Total. Here's a matrix of the given size: m = RandomReal[1, {10000, 10000}]; And here's the output of Total: Total[m, 2] // AbsoluteTiming {0.041005, 4.99984*10^7} • Thanks for the prompt answer, this is excellent! – user52181 Oct 26 '19 at 16:41 • In general, Mathematica is set up that we almost never want to code loops (like "for" loops) when we can instead use built-in functions that treat lists and arrays as holistic objects. – Greg Martin Oct 27 '19 at 5:09
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9504109798251322, "lm_q1q2_score": 0.8205768726895217, "lm_q2_score": 0.863391617003942, "openwebmath_perplexity": 1226.7464370874982, "openwebmath_score": 0.5938159823417664, "tags": null, "url": "https://mathematica.stackexchange.com/questions/208561/sum-of-all-matrix-entries" }
radio-astronomy, units If you observe an extended (larger than the beam!) object, e.g. a molecular cloud in radio, then surface brightness is the preferred quantity. Assume it is equally bright across its surface, then the surface brightness becomes independent of the beam size because the flux is proportional to the beam size. A telescope with a larger beam (smaller dish) observes a larger flux (always assuming the object is even larger) compared to a larger telescope with a smaller beam. Comparing the two measurements becomes difficult. The surface brightness of both observations is the same though. Since optical astronomy was primarily observing stars, i.e. point sources, they used flux. Radio astronomers observed the interstellar medium, i.e. extended clouds of gas and dust, so they used surface brightness.
{ "domain": "astronomy.stackexchange", "id": 3167, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "radio-astronomy, units", "url": null }
formal-languages, formal-grammars, context-sensitive Title: Show that $L:=\{(a^{k}b)^{i}|i,k \epsilon \mathbb{N}_{+} \}$ is context-sensitve. (With context-sensitive/noncontracting grammar) I am studying for an upcoming exam and this is an old exam question from two years ago (all exams were made available through our lecturer): Show that $L:=\{(a^{k}b)^{i}|i,k \epsilon \mathbb{N}_{+} \}$ is context-sensitve. I could easily construct a LBA for this language. But since the notation/construction of LBAs weren't really explained, I would have to define it in the exam. So I assume this task was expected to be done by constructing a context-sensitive grammar. NOTE: In our lecture the definition of a context-sensitive grammar was in fact the definition of a noncontracting grammar. So any rule like this x -> y is allowed if |x| <= |y| So this is allowed: aAb -> bXaa My best idea goes like this: S -> AB B -> bB | b A -> CA | C Cb -> abC Ca -> aC
{ "domain": "cs.stackexchange", "id": 14615, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "formal-languages, formal-grammars, context-sensitive", "url": null }
condensed-matter, ising-model, many-body The parity and momentum of a state with $n$ $b$-fermions is given by $P = (-1)^n P_0$ and $k = k_0 + k_1 + \dots + k_n$. Using these formulas and choosing the appropriate $P$ and $k$'s in the two sectors, I can still build up the correct spectrum and dispersion relation with $\theta_k = \pi$.
{ "domain": "physics.stackexchange", "id": 14319, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "condensed-matter, ising-model, many-body", "url": null }
c, game, collision (*ret)[*indiceCount - 1] = node->children[i]->indices[j]; usedIndices[node->children[i]->indices[j]] = 1; } } } if (!node->children[i]->leaf) getAABBTouch_r(aabb,node->children[i],indiceCount,ret,usedIndices); } } } int* fn_getAABBSTouch(fn_AABB aabb,fn_Octree* otree,int* indiceCount) { int* usedIndices = malloc(otree->aabbCount*sizeof(int)); int i; *indiceCount = 0; for (i = 0; i < otree->aabbCount;i++) usedIndices[i] = 0; int* ret = malloc(sizeof(int)*(otree->aabbCount)); if (fn_aabbCheck(aabb,otree->root->box)) getAABBTouch_r(aabb,otree->root,indiceCount,&ret,usedIndices); free(usedIndices); // ret = realloc(ret,sizeof(int)*(*indiceCount)); return ret; } void fn_getAABBSTouchv(fn_AABB aabb,fn_Octree* otree,int* indiceCount,int* ret) { int* usedIndices = NULL; *indiceCount = 0; usedIndices = calloc(otree->aabbCount,sizeof(int));
{ "domain": "codereview.stackexchange", "id": 28801, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c, game, collision", "url": null }
java, beginner gameSave.saveGame("EndAB_1"); question = "EndAB_1"; break; case "2": System.out.println( "\n\nIan thanks you for choosing his movie and you're just glad that " + "he's so happy."); points += 2; pointsSave.savePoints(points); gameSave.saveGame("EndAB_1"); question = "EndAB_1"; break; case "3": System.out.println("\n\nYou decide using rock, paper, scissors but you're out of luck." + " Ian wins and you end up watching the love story he wanted."); points++; pointsSave.savePoints(points); gameSave.saveGame("EndAB_1"); question = "EndAB_1"; break; default:
{ "domain": "codereview.stackexchange", "id": 23832, "lm_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", "url": null }
terminology, units, si-units, metrology For what concerns realization and reproduction (representation is also found in the literature for reproduction), their meaning is found under the term measurement standard:
{ "domain": "physics.stackexchange", "id": 33144, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "terminology, units, si-units, metrology", "url": null }
$= 2$ So finally my new joint function can be written as: $$f_{U,V}(u,v) = f_{X_1,X_2}(h_1(u,v), h_2(u,v))\lvert J\rvert$$ $$f_{U,V}(u,v) = 2e^{-(u-v+u+v)} = 2e^{-2u}$$ The function I'm ended up with does not contain $v$ at all! Am I doing something wrong here? Or does the absence of the other variable imply independence? Any help would be appreciated. • If the question is simply whether $u$ and $v$ are independent, then plotting a large random sample of values will show you that they aren't independent. – JimB Dec 15 '17 at 18:32 • @JimB sorry if my question is not clear. I'm supposed to show whether they're independent or not. – PPGoodMan Dec 15 '17 at 18:40 • @JimB I mean show it theoretically. Not with data. – PPGoodMan Dec 15 '17 at 18:49 I think you want $h_1 (U,V)=V-U$ as $V-U = x_1$. That makes the joint density function $2 e^{-2v}$ but only when $0\le v < \infty$ and $-v<=u<v$ or $-\infty<u<\infty$ and $v>|u|$. Otherwise it is zero. So
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9759464464059648, "lm_q1q2_score": 0.8174722286318156, "lm_q2_score": 0.8376199653600371, "openwebmath_perplexity": 216.43290492366071, "openwebmath_score": 0.8722496032714844, "tags": null, "url": "https://math.stackexchange.com/questions/2568102/bivariate-transformation-ends-up-with-only-one-variable-in-the-joint-distributio" }
The ways Alice wins are D, MD, MMD, MMMD, and so on. So the probability Alice wins is $$\frac{4}{9}+\left(\frac{4}{9}\right)^2+\left(\frac{4}{9}\right)^3+\left(\frac{4}{9}\right)^4+\cdots.$$ This infinite geometric series has sum $\frac{4}{5}$. Remark: We can use either analysis to find the probability Alice wins if the probability of head is $h$, where $0\lt h\lt 1$. There are 5 possible states for this game: \begin{align} (C_A, C_B)= \begin{cases} (2,2)\\ (1,3)\\ (3,1)\\ (4,0)\\ (0,4)\\ \end{cases} \end{align} This writes a Markov Chain with \begin{align} P((C_A, C_B) \mapsto (C_A, C_B)+(i,j))= \begin{cases} 2/3 \qquad &\text{if } (i,j)=(1,-1) \;\&\&\; C_B \geq 1\\ 1/3 \qquad &\text{if } (i,j)=(-1,1) \;\&\&\; C_A \geq 1\\ 1 \qquad &\text{if } i=j \;\&\&\; (C_A =0 || C_B=0) \\ 0 \qquad &\text{Otherwise} \end{cases} \end{align}
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9902915226589475, "lm_q1q2_score": 0.8397352864144397, "lm_q2_score": 0.8479677622198946, "openwebmath_perplexity": 425.468828550359, "openwebmath_score": 0.9979198575019836, "tags": null, "url": "https://math.stackexchange.com/questions/1578526/probability-of-winning-the-game" }
biochemistry What does this green film consist of? What Chemicals or methods can I use to remove the film without having to manually scrub the bottle? Thanks ps. not sure if this was the correct place to ask this question. What seems to be forming in reusable water bottles and water coolers is a biofilm. Since it is a complicated system, after maturation biofilm might be very hard to remove without scrubbing. There is a nice article about cleaning water coolers, which might give you some information. If you look closer on the Google Scholar search results, you'll find that quite a bit of research has been conducted in the area of sanitation of water coolers and study of their flora. For example, consider the following paper from 1996: Analysis of the Virulence Characteristics of Bacteria Isolated from Bottled, Water Cooler, and Tap Water. There is a very nice list (Table 1) of different bacteria isolated from water. But I would like to point your attention to following table from the paper:
{ "domain": "biology.stackexchange", "id": 3765, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "biochemistry", "url": null }
reinforcement-learning, comparison, value-functions, expectation, bellman-equations Title: Are these two definitions of the state-action value function equivalent? I have been reading the Sutton and Barto textbook and going through David Silvers UCL lecture videos on YouTube and have a question on the equivalence of two forms of the state-action value function written in terms of the value function. From Question 3.13 of the textbook I am able to write the state-action value function as $$q_{\pi}(s,a) = \sum_{s',r}p(s',r|s,a)(r + \gamma v_\pi(s')) = \mathbb{E}[r + \gamma v_\pi(s')|s,a]\;.$$ Note that the expectation is not taken with respect to $\pi$ as $\pi$ is the conditional probability of taking action $a$ in state $s$. Now, in David Silver's slides for the Actor-Critic methods of the Policy Gradient lectures, he says that $$\mathbb{E}_{\pi_\theta}[r + \gamma v_{\pi_\theta}(s')|s,a] = q_{\pi_\theta}(s,a)\;.$$ Are these two definitions equivalent (in expectation)? The definition of the state-action value function is always the same.
{ "domain": "ai.stackexchange", "id": 1956, "lm_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, comparison, value-functions, expectation, bellman-equations", "url": null }
react.js, typescript, mongoose, axios }, [url, requestObj]); return { response, status, error, }; }; export default useRequest; Using the hook for GET in a search bar component const [search, setSearch] = useState(""); const { loadExercises, paginationSet } = useExerciseContext(); // custom hook built from useContext const [trigger, shouldFetch] = useState(false); const { response, status } = useRequest({ request: "get", query: `name=${search}`, resourceEndPoint: "exercises", trigger, setTrigger: shouldFetch, }); // watching for changes in the response useEffect(() => { if (response) { loadExercises(response.data.data); paginationSet(response.data.pagination) } }, [loadExercises, response, status, paginationSet]); ... <Button onClick={() => shouldFetch(true)} // triggering the request className={classes.submitBtn} variant="outlined" > Submit </Button>
{ "domain": "codereview.stackexchange", "id": 41858, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "react.js, typescript, mongoose, axios", "url": null }
newtonian-mechanics, forces, work, definition, displacement The concept of a point object can be understood here : Point Particle So, as you're clear with the basic concepts, I can go on. Each object is made up of millions of particles...Uncountable! Now, when you push an object, suppose a car, then the car is moving but the force has acted upon on a specific point. That point may be referred to point of application of the force. When the car moves (if the other opposing forces become lesser than the force applied by you) , then it surely displaces itself. Thus, it does some Work. While, you have also done the work to push the object, but we usually calculate the work done by the object experiencing the force.
{ "domain": "physics.stackexchange", "id": 14583, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-mechanics, forces, work, definition, displacement", "url": null }
optics, everyday-life, geometry, camera, length Title: Can I calculate the size of a real object by just looking at the picture taken by a Camera? Can I calculate the size of a real object by just looking at the picture taken by a Camera? (I think people do that) i dont understand how? (from physics point of view) If you know the specifics of the camera (lens system, aperture settings, etc.), then you can make a direct relationship between the size of the image and the angular size. But without a distance measurement (something the camera does not do), you can't turn that into an absolute size. If there is other information in the photograph that gives the distance, then the size can be calculated. If all you have is the image (and not the information about the specifics of the camera), then even the angular size cannot be calculated.
{ "domain": "physics.stackexchange", "id": 18183, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "optics, everyday-life, geometry, camera, length", "url": null }
python, python-3.x, regex, formatting, hash-map if not matched: print("No Match") I would group the code in functions and call them from a central main. With how you have it now, simply loading the file into an interactive console will cause all the code to run, which, if the code is long running or causes side-effects, may be less than ideal. Say I wrote a port-scanner, and it takes 2-3 minutes to run. I may not want it to start simply because I loaded the file into a REPL in Pycharm. Not only would that waste a few minutes each time, port-scanning can get you in trouble if done on a network that you don't have permission to scan. Code wrapped in functions is simply easier to control the execution of, because it will only run when the function is called.
{ "domain": "codereview.stackexchange", "id": 39040, "lm_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, formatting, hash-map", "url": null }
experimental-chemistry, significant-figures \hline 5 & 0.1 & 0.1 \\ 10 & 0.2 & 0.2 \\ 25 & 0.5 & 0.5 \\ 50 & 1 & 1 \\ 100 & 1 & 1 \\ 250 & 2 & 2 \\ 500 & 5 & 5 \\ 1000 & 10 & 10 \\ 2000 & 20 & 20 \\ \hline \end{array}$$ For example, a measuring cylinder of Class A with a nominal capacity of 500 ml has graduation divisions of 5 ml. By interpolation, you might be able to estimate the measurement to one tenth of the division, i.e. to 0.5 ml. However, the accuracy limits of the measuring cylinder are ±2.5 ml (at any point on the scale).
{ "domain": "chemistry.stackexchange", "id": 4177, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "experimental-chemistry, significant-figures", "url": null }
python, game, python-2.x, pygame, meta-programming # replace the current event handler. for event in pygame.event.get(): try: event_function(event) except SystemExit: pygame.quit() sys.exit(0) This has the downside of having to pass an event-handler, unless you pass a default one, like the one above. However it allows the programmer to handle user input, a must in most pygame applications.
{ "domain": "codereview.stackexchange", "id": 14714, "lm_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, game, python-2.x, pygame, meta-programming", "url": null }
java, strings, programming-challenge, sorting Sample output 10 a illustrate is of piece problem sample text this to It is working perfectly as far as I know. When I run my code, it passes all tests. import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; /** * Created by aditya on 14-10-2014. */ public class Main { public static void main(String args[]) {
{ "domain": "codereview.stackexchange", "id": 10076, "lm_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, strings, programming-challenge, sorting", "url": null }
human-biology, biochemistry, pigmentation As far as I know, the regulation of eyelash growth and pigmentation is very similar to that of hair on the scalp. Given that the regulation of hair pigmentation is controlled by genetic factors, it could be that there is a change in the function of the genes at that particular hair follicle. This could possibly involve mutations which change signaling pathways, melanin generation, etc. such that melanin is no longer transported into the hair. There could also be an extrinsic (outside of the body) factor which has locally stopped melanin production. Perhaps at some point, there was an elevated level of ROS or UV light at that particular hair follicle. This could have introduced mutations in the genes, or could have changed how the hair was pigmented.
{ "domain": "biology.stackexchange", "id": 8501, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "human-biology, biochemistry, pigmentation", "url": null }
ros, rospy, messages So why it imports the first file, but not the second? :( hope you can help me thx Originally posted by jduewel on ROS Answers with karma: 3 on 2011-06-29 Post score: 0 You need to reload the Python module. After the first call, Python has loaded 'janus' and will not go back out to disk. http://docs.python.org/release/2.7/library/functions.html#reload Note: in general, you have to be careful when calling reload as it can result in inconsistent modules. It should be fine if you are just fetching msg files. Originally posted by kwc with karma: 12244 on 2011-06-29 This answer was ACCEPTED on the original site Post score: 0 Original comments Comment by kwc on 2011-06-29: From your code, it looks like 'janus' is the module. Comment by jduewel on 2011-06-29: Ive read the manual carefully, but i still dont know which module to reload.
{ "domain": "robotics.stackexchange", "id": 5998, "lm_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, rospy, messages", "url": null }
x^2=5 ==> x=+/- √5 OR -x^2=-3 ==> x^2=3 ==> x=+/- √3 So, I believe that is the right answer but I'm still not sure about how the greater than/less than signs come into play. Sorry for the thick head! The original solution used $$\geq{}$$ and $$\leq{}$$ to define the intervals. It solved the cases: $$x^2-4=1$$ so $$x=+-\sqrt{5}$$, and then it check weather those numbers are in the interval $$-2<x<2$$. Both are inside so both are valid solutions Then the other case $$-x^2+4=1$$ so $$x=+-\sqrt{3}$$, and then check the interval it is considering in this scenario $$x<-2$$ and $$x>2$$, both are inside the intervals so both are valid solutions
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9683812327313546, "lm_q1q2_score": 0.8360922418081329, "lm_q2_score": 0.8633916205190225, "openwebmath_perplexity": 1389.9678374776618, "openwebmath_score": 0.699351966381073, "tags": null, "url": "https://gmatclub.com/forum/math-absolute-value-modulus-86462-20.html" }
data-structures, arrays, linked-lists The downside that linked lists tend to weave their way somewhat randomly through memory can occasionally be turned into an advantage: elements that are in some other data structure can have a linked list weaved through them without imposing requirements on the addresses of the elements. For example, elements in a hash map can also have a linked list running through them that records their insertion order, while maintaining fast removal (a dynamic array that records the indexes of the elements in insertion order would still allow fast insertion but not fast removal since it could happen in the middle). Elements can even be in several different linked lists at the same time, an example of that is dancing links algorithm which uses linked lists for columns and rows and elements are in both a column and a row at the same time.
{ "domain": "cs.stackexchange", "id": 14595, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "data-structures, arrays, linked-lists", "url": null }
of the survival time distribution in Brexit, what does not compromise sovereignty '' mean as... Area under the survival curve is horizontal at 50 % survival, R ), then (... A hypothesis test of all covariates at once is built on ggplot2, and 10 had event! The BMT data interest is in the lung data estimate the cumulative incidence in the Statistical Algorithms may. ' It contains variables: Estimate the cumulative incidence in the context of competing risks using the cuminc function. for (var i in nl) if (sl>nl[i] && nl[i]>0) { sl = nl[i]; ix=i;} Survival Analysis in R is used to estimate the lifespan of a particular population under study. Three kinds of between-group contrast metrics (i.e., the difference in RMST, the ratio of RMST and the ratio of the restricted mean time lost (RMTL)) are computed. It is also known as the time to death analysis or failure time analysis. The condsurv::condKMggplot function can help with this. Cumulative incidence in competing risks data and competing
{ "domain": "santafestereo.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9416541626630935, "lm_q1q2_score": 0.826279681641076, "lm_q2_score": 0.877476800298183, "openwebmath_perplexity": 2282.1390879140604, "openwebmath_score": 0.5358961820602417, "tags": null, "url": "http://www.santafestereo.com/anne-of-vffbrfd/d101b7-mean-survival-time-in-r" }
ros, root, subscribe, publish Originally posted by wmrifenb on ROS Answers with karma: 1 on 2016-07-08 Post score: 0 Original comments Comment by spmaniato on 2016-07-08: If that's an option, just source the ROS installation and workspaces (as superuser), so that the environment variables will be set. The easiest way would be to actually login as superuser (e.g. sudo su in Ubuntu) and then source the normal user's .bashrc (if it's set up with ROS stuff) Yes, that should work. However, setting the permissions is the better way. udev should work, or just adding yourself to the dialout group. Originally posted by dornhege with karma: 31395 on 2016-07-08 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 25185, "lm_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, root, subscribe, publish", "url": null }
### How to solve these ODEs using NDSolve? I have six odes and I cannot use DSolve. So I tried NDSolve. But it says there may be some errors.The code is such like this: ... 42 views ### Custom alignment for GeoMarkers I need to align a GeoMarker at the bottom left of the marker: ... 154 views ### Dot product result has wrong dimension I'm doing a small project and I've encountered a problem while using Mathematica. I should mention that I'm kinda new to this software, so maybe it's just something I haven't grasped yet. Anyway, I ... 69 views ### Unable to evaluate Eigenvalues and Eigenvectors for a matrix (2) I have posted a similar question last year pertaining to this issue. Here's a link to my post together with the solution given: Unable to evaluate Eigenvalues and Eigenvectors for a matrix I have ... 88 views ### A single argument pattern definition applies to multiple-argument patterns?
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.946596665680527, "lm_q1q2_score": 0.8083109629665753, "lm_q2_score": 0.8539127510928476, "openwebmath_perplexity": 1577.4895850541568, "openwebmath_score": 0.8721036911010742, "tags": null, "url": "https://mathematica.stackexchange.com/questions?page=3&sort=newest" }
history, units, physical-constants, si-units, absolute-units Title: Why didn't we replace our SI units with a better system? Intro It seems to me that the SI units we use today are nothing but the result of a historical 'coincidence'. I recently began researching about natural (absolute) systems of units, which are defined in such a way that selected universal physical constants are normalized to unity. These are very convenient, since almost all equations in physics are simplified. Planck Units Take for example the Planck units, where five fundamental physical constants take on the numerical value of 1. To quote from Wikipedia: Planck units have a profound significance since they elegantly simplify several recurring algebraic expressions of physical law by nondimensionalization. They are particularly relevant in research on unified theories.
{ "domain": "physics.stackexchange", "id": 13654, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "history, units, physical-constants, si-units, absolute-units", "url": null }
fluid-dynamics, navier-stokes Title: What is the interpretation of $(\textbf{u} \cdot \nabla)\textbf{u}$ in Stokes flow? In very low Reynolds number flows, the Navier-Stokes equations can be reduced to the Stokes equation which is given by \begin{gather} \mu \nabla^2 \textbf{u} = \nabla p \end{gather} I am looking at analytic solutions to the Stokes equation and I find that even though the governing equation has neglected inertial effects, I can substitute the velocity field into terms like $(\textbf{u} \cdot \nabla)\textbf{u}$ and find that they are non-zero. How should one interpret $(\textbf{u} \cdot \nabla)\textbf{u} \neq 0$ in a flow that is analytically determined by solving a governing equation that has neglected inertial effects? A specific example I am considering is the corner flow problem discussed by Batchelor in section 4.8 pp. 224-226. The two-dimensional Stokes flow in a corner is given by \begin{align} \psi &= rf(\theta) = r[A\sin(\theta)+B\cos(\theta)+C\theta\sin(\theta)+D\theta\cos(\theta)]\\
{ "domain": "physics.stackexchange", "id": 53689, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fluid-dynamics, navier-stokes", "url": null }
deep-learning, math, agi, applications, state-of-the-art Title: How good is AI in math? Currently, AI is advancing fast in deep learning: Entire human chess knowledge learned and surpassed by DeepMind's AlphaZero in four hours. As a layman, I'm taking this as a quite powerful searching algorithm, using artificial neural networks to identify the patterns of each game. However, how good is AI doing in math? For example, the key to the theory of the game Nim is the binary digital sum of the heap sizes, that is, the sum (in binary) neglecting all carries from one digit to another. This operation is also known as "exclusive or" (xor) or "vector addition over GF(2)". Is AI good enough to discover/invite operations/logics such as "exclusive or", or, more advanced, abstract algebra in finite field? Nim was actually one of the first games ever played by an electronic machine. It was called the Nimatron and was displayed at the 1940 New York World's Fair.
{ "domain": "ai.stackexchange", "id": 650, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "deep-learning, math, agi, applications, state-of-the-art", "url": null }
machine-learning, classification, vc-theory The definition does not say: if any set of n points can be shattered by the classifier... If a classifier's VC dimension is 3, it does not have to shatter all possible arrangements of 3 points. If of all arrangements of 3 points you can find at least one such arrangement that can be shattered by the classifier, and cannot find 4 points that can be shattered, then VC dimension is 3.
{ "domain": "datascience.stackexchange", "id": 9121, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "machine-learning, classification, vc-theory", "url": null }
quantum-field-theory, renormalization, supersymmetry, effective-field-theory, superspace-formalism The extended ${\cal N}=1$ SUSY model with the spurious superfield $X$ and $Y$ have $R$-symmetry and Peccei-Quinn symmetry $$X\to X + \text{imaginary constant}.\tag{B}$$ The holomorphic $F$-sector is $$Y W(\Phi) + (X+f(\Phi)) W^{\alpha}W_{\alpha}.\tag{C}$$
{ "domain": "physics.stackexchange", "id": 54513, "lm_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, renormalization, supersymmetry, effective-field-theory, superspace-formalism", "url": null }
python, sorting I found a later use for this algorithm, so I coded it up. I included a tracing print statement in the critical loop, so we can watch it in operation. import collections def unsort(in_list): size = len(in_list) if size == 0: return None # Build a list of pairs: value and count, # in descending order of count. count_dict = collections.Counter(in_list) count_list = sorted(list(count_dict.iteritems()), key=lambda x: x[1], reverse=True) move_list = [[x[0], x[1]] for x in count_list] out_list = [] # If the highest count is more than half the elements plus a half, no solution is possible. if move_list[0][1] * 2 > size + 1: print "No solution possible" return
{ "domain": "codereview.stackexchange", "id": 17991, "lm_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, sorting", "url": null }
algorithm-analysis, runtime-analysis, loops Title: Solving complexity using summation I have the following algorithm: func() { for(i=1; i<n; i=i*2) print("aa"); }
{ "domain": "cs.stackexchange", "id": 10881, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithm-analysis, runtime-analysis, loops", "url": null }
javascript, sorting, search I guess the "sort"-function and/or searching for the element in the array with indexOf is the problem. But I could not find a way to make these two operations more efficient. The following function sort of agrees with your function. Except that for example your function given scores = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] and alice = [ 0, 0, 0, -1 ] gets 1,1,1,5, while I think it should be 1,1,1,2. Anyway, it easily handles scores arrays of sizes 10^7 for scores and 10^5 for alice. The idea is, we already know scores is sorted as per your comment. We can then go through the scores array. We sort the alices array while remembering the original order. Then we go through the scores array, we first look at the largest alice, once we hit an element >= it, it is time to note that down, we remember the score and whether it was a tie and the position it happened at. We continue traversing scores, now looking at the next biggest alice, etc.
{ "domain": "codereview.stackexchange", "id": 38607, "lm_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, sorting, search", "url": null }
human-biology, biochemistry, pharmacology, human-genetics, enzymes Merck's manual chapter 36 The discovery of two cyclooxygenase isoforms (COX-1 and COX-2) led to the concept that the constitutive COX-1 isoform tends to be homeostatic in function, while COX-2 is induced during inflammation and tends to facilitate the inflammatory response. On this basis, highly selective COX-2 inhibitors have been developed and marketed on the assumption that such selective inhibitors would be safer than nonselective COX-1 inhibitors but without loss of efficacy. Inflammatory processes are expressed by both COX-1 and COX-2 differently. This means that a change in the cell membrane expresses lysosomal enzymes differently: The cell damage associated with inflammation acts on cell membranes to cause leukocytes to release lysosomal enzymes; arachidonic acid is then liberated from precursor compounds, and various eicosanoids are synthesized.
{ "domain": "biology.stackexchange", "id": 2920, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "human-biology, biochemistry, pharmacology, human-genetics, enzymes", "url": null }
c#, performance, animation, xna, monogame particle.Update(gameTime); if (particle.TTL <= 0) { fading_particles_.AddLast(particle); particles_.Remove(p); } p = p_prev; } p = fading_particles_.Last; while (p != null) { LinkedListNode<Particle> p_prev = p.Previous; Particle particle = p.Value; particle.Update(gameTime); particle.color_ *= 0.98f; if (particle.color_.A <= 0.0f) { fading_particles_.Remove(p); } p = p_prev; } } public void Draw(SpriteBatch spriteBatch) { LinkedListNode<Particle> p = particles_.Last; while (p != null) { p.Value.Draw(spriteBatch); p = p.Previous; }
{ "domain": "codereview.stackexchange", "id": 7615, "lm_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, animation, xna, monogame", "url": null }
complexity-theory, graphs, np-complete, np-hard Title: Is the weighted transitive reduction problem NP-hard? The transitive reduction problem is to find the graph with the smallest number of edges such that $G^t = (V,E^t)$ has the same reachability as $G=(V,E)$. When $E^t \subseteq E$ it is NP-complete. When $E^t \subseteq V\times V$ but not necessarily of $E$, this problem is polynomial time solvable. I am wondering about the edge-weighted version without the subset requirement. My initial feeling was that with weights, the problem is very similar to TSP. The greedy approach seems to be invalid when adding weights. But several articles (http://bioinformatics.oxfordjournals.org/content/26/17/2160.short for instance) seems to imply that the problem is solvable in polynomial time. If it was easy, then you could just add arbitrarily large edge weights to each edge not in the original edge set and keep the weights at unity for the others. Then you would have a polynomial time algorithm for the subset constrained problem.
{ "domain": "cs.stackexchange", "id": 4658, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "complexity-theory, graphs, np-complete, np-hard", "url": null }
polymers, photochemistry Title: Photocurable Polymer with no oxygen functional group or whose the structure is well known I'm experimenting with the PDMS. I want to change the material with no oxygen containing functional group. Is there a UV curable polymer with no oxygen atom? Preferably cheap. Or Please recommend any UV curable or photoresist with well-known morphological property and molecular (polymer) structure. I'm not sure if this addresses all your criteria, but acrylonitrile is polymerisable by light and is oxygen free.
{ "domain": "chemistry.stackexchange", "id": 6669, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "polymers, photochemistry", "url": null }
17 In addition to the remarks in the other answers, I'd like to point out that the scale and location of the explanatory variables does not affect the validity of the regression model in any way. Consider the model $y=\beta_0+\beta_1x_1+\beta_2x_2+\ldots+\epsilon$. The least squares estimators of $\beta_1, \beta_2,\ldots$ are not affected by shifting. The ... 17 The process is iterative, but there is a natural order: You have to worry first about conditions that cause outright numerical errors. Multicollinearity is one of those, because it can produce unstable systems of equations potentially resulting in outright incorrect answers (to 16 decimal places...) Any problem here usually means you cannot proceed until ... 15
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9632305339244012, "lm_q1q2_score": 0.8047632476105923, "lm_q2_score": 0.8354835309589074, "openwebmath_perplexity": 472.7159567505966, "openwebmath_score": 0.7551077604293823, "tags": null, "url": "http://stats.stackexchange.com/tags/multiple-regression/hot?filter=year" }
kinect, openni, openni-kinect Title: Openni problem in Debian. Kinect not detected Hi, I installed openni to work with a Kinect on a Debian Squeeze. I followed the instructions in http://www.ros.org/wiki/openni_kinect to build and install a package for debian, and after that I used the openni.launch to start working with kinect, but I get a message of "No devices detected". The kinect seems to be detected by the system if I do lsusb (xbox NUI Motor?). Can anybody help me? Thanks. lsusb Bus 009 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 008 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 002: ID 045e:0040 Microsoft Corp. Wheel Mouse Optical Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 002: ID 045e:0752 Microsoft Corp. Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
{ "domain": "robotics.stackexchange", "id": 7144, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "kinect, openni, openni-kinect", "url": null }
reinforcement-learning, sutton-barto Example 9.1: State Aggregation on the 1000-state Random Walk: Consider a 1000-state version of the random walk task (Examples 6.2 and 7.1 on pages 125 and 144). The states are numbered from 1 to 1000, left to right, and all episodes begin near the center, in state 500. State transitions are from the current state to one of the 100 neighboring states to its left, or to one of the 100 neighboring states to its right, all with equal probability. Of course, if the current state is near an edge, then there may be fewer than 100 neighbors on that side of it. In this case, all the probability that would have gone into those missing neighbors goes into the probability of terminating on that side (thus, state 1 has a 0.5 chance of terminating on the left, and state 950 has a 0.25 chance of terminating on the right). As usual, termination on the left produces a reward of −1, and termination on the right produces a reward of +1. All other transitions have a
{ "domain": "ai.stackexchange", "id": 3277, "lm_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, sutton-barto", "url": null }
These $5$ numbers are impossible to arrange so all $3$ consecutive numbers in this subset are less than $17$. That is, the only $3$ numbers summing to less than $17$ are $6,3,7$ and adding an $8$ or $9$ to this sequence results in a $3$ consecutive number sum being greater than $16$. Hence the impossibility or contradiction of this assumption.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9525741322079104, "lm_q1q2_score": 0.8058228886666323, "lm_q2_score": 0.8459424431344437, "openwebmath_perplexity": 190.62975941260015, "openwebmath_score": 0.7309706211090088, "tags": null, "url": "https://math.stackexchange.com/questions/2915786/what-does-it-mean-when-proof-by-contradiction-doesnt-lead-to-a-contradiction/2915793" }
python, beginner, strings, recursion Title: Python program to check substring match locations with a lot of permutations of the substring This is my first code here and also my first program of this size. I don't really know what is expected from a programmer who writes "good, readable" code. This is my first program which will be used in a real-world application. Also I'm extremely new to Python. So while reviewing please be kind enough to give constructive criticism about how this code or my code in general can be better with respect to both Python and programming in general. I'll try to explain the problem in the following paragraph in the best way possible. If any clarifications are needed about my code/logic/the problem, feel free to ask in the comments, I'll try my best to clear the doubts. The problem -
{ "domain": "codereview.stackexchange", "id": 26938, "lm_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, strings, recursion", "url": null }
neuroscience Connectivity studies can be broadly grouped in to those that look at brain areas, and those that look at individual neurons (usually within a single brain area). My background is more the latter, so that's what I'll focus on. Firstly, your question misses an important distinction: inhibitory neurons. So if neuron C was inhibitory, we would have a negative feedback loop, a classical circuit that can be used to produce a homeostatic like signal, keeping a system within certain bounds; a delayed feedback loop can also act as a 'signal terminator', allowing an action to be stopped once it reaches a certain threshold. Lastly, under some circumstance, feedback loops can produce oscillations, which are applicable to a number of tasks.
{ "domain": "biology.stackexchange", "id": 8453, "lm_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", "url": null }
optics, laser, photonics, laser-cavity Equation (1.8) represents the ultimate lower limit on linewidth, with no commercial products able to achieve this level of frequency stability ($< 1 \ \text{Hz})$. In practice, some SLM fibre lasers have a linewidth smaller than $10 \ \text{kHz}$ – limited by "technical noise" (fluctuations in optical and optomechanical parameters, e.g.), and resulting in a coherence length $d_c \ge 15 \ \text{km}$.
{ "domain": "physics.stackexchange", "id": 75161, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "optics, laser, photonics, laser-cavity", "url": null }
Proposition. Let $K \subseteq F$ be a field extension let $v_1, \dots, v_r \in K^n$. If $v_1, \dots, v_r$ are linearly dependent over $F$, then they are linearly dependent over $K$. Proof. We'll prove the contrapositive of the statement. Suppose that the $v_i$'s are linearly independent over $K$. Let $\lambda_i \in F$ such that $\sum_i \lambda_i v_i = 0$. We can find $e_j \in F$ linearly independent over $K$ such that $\lambda_i = \sum_j \alpha_{ij} e_j$, with $\alpha_{ij} \in K$. Now from $\sum_{i,j} e_j \alpha_{ij} v_i = 0$ we deduce that $\sum_i \alpha_{ij} v_i = 0$, for every $j$. From the independence of $v_i$'s over $K$, we have $\alpha_{ij} = 0$, so $\lambda_i = 0$. $\square$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9904406009350774, "lm_q1q2_score": 0.8999320601475463, "lm_q2_score": 0.9086179012632543, "openwebmath_perplexity": 105.42503669789473, "openwebmath_score": 0.9426719546318054, "tags": null, "url": "http://math.stackexchange.com/questions/66443/a-square-matrix-has-the-same-minimal-polynomial-over-its-base-field-as-it-has-ov" }
terminology, space-complexity As an alternative with a different core meaning, you could say that it's "unenlightening", or "unilluminating", suggesting that it doesn't tell you much, rather than it's rough.
{ "domain": "cs.stackexchange", "id": 15560, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "terminology, space-complexity", "url": null }
c, multithreading, tetris { field[k - 1][a - 1] = 2; field[k - 1][a] = 2; field[k - 1][a + 1] = 2; field[k - 1][a + 2] = 2; break; } if(turn == 1 && a - 1 != 0 && field[3 + k][a - 1] == 0 && field[2 + k][a - 1] == 0 && field[1 + k][a - 1] == 0 && field[0 + k][a - 1] == 0) { a--; if(field[0 + k - 1][a + 1] != 2) field[0 + k - 1][a + 1] = 0; if(field[0 + k - 1][a + 2] != 2) field[0 + k - 1][a + 2] = 0; if(field[0 + k - 1][a + 3] != 2) field[0 + k - 1][a + 3] = 0; if(field[0 + k - 1][a + 4] != 2) field[0 + k - 1][a + 4] = 0; turn = 0; } else if(turn == 2 && a + 2 !=9 && field[3 + k][a + 1] == 0 && field[2 + k][a + 1] == 0 && field[1 + k][a + 1] == 0 && field[0 + k][a + 1] == 0) { a++;
{ "domain": "codereview.stackexchange", "id": 20767, "lm_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, tetris", "url": null }
electricity, electric-current, charge, conventions $$\mathrm \delta Q=\j_Q\cdot\dS\,\delta t.\tag{1}$$ Now we consider a wire of section $\dS=\mathrm d S\,\mathbf e_x$. For charges $+q$ moving with velocity $\def\v{\boldsymbol v}\v=v\mathbf e_x$ the current density multiplied by the wire's section is the current $$I=\frac{\delta Q}{\delta t}=\j_Q\cdot\dS=qv.$$ Let us examine the three cases you mention.
{ "domain": "physics.stackexchange", "id": 11315, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electricity, electric-current, charge, conventions", "url": null }
rosrun Originally posted by negotiator14 on ROS Answers with karma: 35 on 2015-07-22 Post score: 0 Original comments Comment by daenny on 2015-07-23: It should be rosrun stage_ros stageros 'rospack find stage_controllers'/world/roomba-wander.world. The "stage" package became a system dependency and the "stageros" node went into the "stage_ros" wrapper package. Have you installed stage_ros? And I think you messed up your command a little... This worked on mine: rosrun stage_ros stageros $(rospack find stage_ros)/world/willow-erratic.world Originally posted by allenh1 with karma: 3055 on 2015-07-22 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 22254, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rosrun", "url": null }
semiconductor-physics, electronic-band-theory In forward bias, the depletion width decreases because the applied voltage decreases the voltage drop over the space-charge layer responsible for the built-in voltage. In forward bias, in the quasi-neutral n- and p-regions, the injected minority carrier diffusion currents increase exponentially with voltage because the injected carrier density increases exponentially. These diffusion currents continue in part as drift currents, e.g. in the depletion zone and near the contacts. Is easy to understand. See e.g. the German Wikipedia Mittelpunktgleichrichter where your graphs seem to come from.
{ "domain": "physics.stackexchange", "id": 34721, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "semiconductor-physics, electronic-band-theory", "url": null }
c#, beginner, object-oriented public int DisplayVotes() { return _votes; } public void UpVote() { _votes++; } public void DownVote() { _votes--; } } } Just keeping a count is fine for the example app, you don't want to go mad with your implementation. Consider that in real life, you need to know who voted and when. There are various rules about when you can change your vote and when it's locked in. So although your code is fine for the simple 'show me the score' question there are some that you can't answer: How many votes has the post had in the last day? What is the split of up and down votes? Am I allowed to change my vote now? Have I already voted?
{ "domain": "codereview.stackexchange", "id": 25981, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, beginner, object-oriented", "url": null }
related by a linear transformation. The results are applied to The job of transforming 3D points into 2D coordinates on your screen is also accomplished through matrix transformations. In addition to science, engineering and mathematics, linear algebra has extensive applications in the natural as well as the social sciences. . So to clarify, you use SensorManager. Matrix algebra 8. If is a linear transformation mapping to and → is a column vector with entries, thenDefinition. This sur-vey includes some original material not found anywhere else. We have also seen how to find the matrix for a linear transformation from R m to R n. To find the conjugate trans-pose of a matrix, we first calculate the complex conjugate of each entry and then take the transpose of the matrix, as shown in the following example. Although it is very After any of those transformations (turn, flip or slide), the shape still has the same size, area, angles and line lengths. Random matrix theory is now a big
{ "domain": "kacpergomolski.pl", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9845754506337405, "lm_q1q2_score": 0.8183230388271673, "lm_q2_score": 0.831143045767024, "openwebmath_perplexity": 628.818077638687, "openwebmath_score": 0.6772881150245667, "tags": null, "url": "http://kacpergomolski.pl/rvxm/matrix-transformation-applications.php" }
electromagnetism, electric-circuits, electric-current, electrical-resistance, voltage is forces on the electrons in the secondary coil or any other charged particle around. If somehow the forces exerted on the secondary coil electrons are resisted/opposed by something, the cause of the force also has to feel the same resistance too. Think of it as you having a power to transmit your efforts across space, and you've got a large boulder to push, now if you try pushing the rock with your power, you feel the resistance against motion due to inertia or maybe gravity if inclined because even though it's across three dimensional space, you are still linked to the boulder like you are touching it. It's just down to the third law of motion in a field effect.
{ "domain": "physics.stackexchange", "id": 56202, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetism, electric-circuits, electric-current, electrical-resistance, voltage", "url": null }
ros, ros-melodic, docker, ros-kinetic Originally posted by arwtyxouymz on ROS Answers with karma: 11 on 2019-04-05 Post score: 1 The immediate shutdown is coming from the set -e flag in the entrypoint. I'm not sure what the problem with the develspace setup script is, but it happens on both the docker image you sent and the main workspace I'm using for my projects, so the error seems to be pretty pervasive. If someone knows how to error trace a bash script that would be helpful for debugging further, but you can get started by removing the set -e. Originally posted by Andrew Price with karma: 66 on 2019-04-05 This answer was ACCEPTED on the original site Post score: 0 Original comments Comment by arwtyxouymz on 2019-04-06: Thank you Andrew! I removed set -e flag, and succeeded to run a container. But with docker-compose, ros cannot find my local package. This is my docker-compose.yaml version: '2.3'
{ "domain": "robotics.stackexchange", "id": 32822, "lm_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-melodic, docker, ros-kinetic", "url": null }
rosbag Originally posted by Stefan Kohlbrecher with karma: 24361 on 2017-09-08 This answer was ACCEPTED on the original site Post score: 2 Original comments Comment by maziarser on 2017-09-08: Thank you for your answer. It was part of the problem. The other mistake was about the "stage" part and also the "world" file that we do not need them. Comment by Stefan Kohlbrecher on 2017-09-11: Obviously :) I stopped further looking at the launch file when I saw the "use_sim_time" as that alone doesn't make sense on a real system (in 99.9% of cases). Starting simulation does not, either :)
{ "domain": "robotics.stackexchange", "id": 28801, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rosbag", "url": null }
Hint: For $k\ge3$, $$\frac{k^2-1}{k^3+4}\ge\frac1{k+1}$$ When $k \geq 1$, we have $k^3+4 \leq k^3+4k^3 = 5k^3$ (Since $4 \leq 4k^3$ for $k \geq 1$). Also, when $k \geq 2$, we have $k^2-1 > \frac{k^2}{2}$ (This is again straightforward to verify, equality happens when $k = \sqrt{2}$ :)). Therefore, $$\sum_{k=1}^\infty \frac{k^2-1}{k^3+4} = \sum_{k=2}^\infty \frac{k^2-1}{k^3+4} \geq \sum_{k=2}^\infty\frac{\frac{k^2}{2}}{5k^3} = \frac{1}{10}\sum_{k=2}^\infty\frac{1}{k}.$$ The lower bound is the harmonic series that clearly diverges. Hence the original series diverges. To show that the given series is (ultimately) greater than the harmonic series for some k and beyond, We could consider this limit: $$\lim_{k\rightarrow\infty}\frac{\frac{1}{k}}{\frac{k^2-1}{k^3+4}} = \lim_{k\rightarrow\infty}\frac{k^3+4}{k^3-k}= 1$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9830850906978876, "lm_q1q2_score": 0.8082818695251459, "lm_q2_score": 0.8221891239865619, "openwebmath_perplexity": 201.3094691234578, "openwebmath_score": 0.967551052570343, "tags": null, "url": "https://math.stackexchange.com/questions/556414/test-for-convergence-divergence-of-sum-k-1-infty-frack2-1k34" }
java, algorithm, sorting, heap reverseRun(array, head, left); heap.pushRun(head, left); } ++left; } // A special case: the very last element may be left without buddies // so make it (the only) 1-element run. if (left == last) { heap.pushRun(left, left); } // Heapify. O(N) as described in "Introduction to Algorithms." heap.buildHeap(); return heap; } /** * This class implements the actual run heap. * * @param <T> the array component type. */ private static class RunHeap<T> { private int size; private final T[] array; private final int[] fromIndexArray; private final int[] toIndexArray; private final Comparator<? super T> comparator;
{ "domain": "codereview.stackexchange", "id": 17933, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, algorithm, sorting, heap", "url": null }
quantum-mechanics, time-evolution, non-linear-systems Title: Example of non-linear time evolution in quantum mechanics Preamble: I am a mathematician and not a physicist. From what little I know about quantum mechanics, Schrödinger's equation is a linear PDE that describes the time-evolution of a system. In general its solution takes values in some infinite-dimensional Hilbert space. In the case of a system with only finitely many "classical states" (sorry about the probably incorrect terminology), e.g. a particle which is either "spin up" or "spin down", we get a linear ODE taking values in a finite-dimensional Hilbert space. This is from my perspective a bit of a boring equation though... Question: is there a physical situation whose time evolution is naturally modelled by a non-linear ODE on a finite dimensional Hilbert space? (ex: finitely many atoms which can be either in fundamental or excited state, and for some reason a non-linear term in Schrödinger's equation)?
{ "domain": "physics.stackexchange", "id": 34346, "lm_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, time-evolution, non-linear-systems", "url": null }
antimatter One of the simplest methods to show it exists is used by the cosmic ray detector on the Pamela satellite. In this detector, there is a target that the cosmic rays (and gamma rays) interact with. Then the particles pass through a strong magnetic field. Since the path of moving charged particles curves in the presense of a magnetic field, they can see where the particle entered and where it hit the final target which is a calorimeter that measures the energy. Electrons come into the detector and curve one direction. Positrons, the positive anti-particle to the electron, enter the detector and curve the other direction. They have the same mass and energy but opposite charges and this is easily measured showing that positrons exist. The same principle is used to detect them in the particle accelerators around the world.
{ "domain": "physics.stackexchange", "id": 3181, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "antimatter", "url": null }
mobile-robot Robots are expensive. You may have some cheap parts, but really, robots are expensive. In my lab, we took part in making robotic skins, and just that, for a human-sized robot is not cheap at all. It's cheap for an industrial robot, but I doubt you would want to pay thousands of dollars/euros for not-useless robot. Robots are not safe. Not yet at least. If a small vacuum cleaner robot hits your leg, it won't hurt much. But if a humanoid robot crushes your hand during a hand-shake, well, no one likes to be responsible for that. Note that shortcomings of algorithms (for example sensor data processing, feature extraction and reasoning) are the main reason for this lack of safety. So I believe, even though we are not too far from having robot friends among us, it's still too early for it. Just to give you examples from real world: The Nao robot, designed to be a companion (from Wikipedia) but actually mostly used for soccer games, costs about 16000$:
{ "domain": "robotics.stackexchange", "id": 922, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "mobile-robot", "url": null }
experimental-chemistry, equipment These bulbs were also used to trap gaseous reaction products by attaching the bulb with its stopcock and joint to a vac line along with a reaction flask. The bulb was cooled to the desired temperature and when the reaction produced gases, they could be collected in the cooled bulb.
{ "domain": "chemistry.stackexchange", "id": 4310, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "experimental-chemistry, equipment", "url": null }
random, simulation, kotlin main.kt package penna import java.io.File fun main(){ // Set the parameters for the simulation. Genome.genome_size = 64 // Determines the maximal age of the Animal Genome.setMutationRate(2) // How many mutations per year can happen in the worst case Animal.setReproductionAge(6) // Age at which Animals start reproduction Animal.setThreshold(8) // More than this many mutations kills the Animal Animal.setProbabilityToGetPregnant(1.0) // Animal generate offspring every year val fish = FishingPopulation(10000, 1000, 0.0, 0) val popSizes: MutableList<Int> = ArrayList() for(generation in 0 until 5000){ popSizes.add(fish.size()) fish.step() if(generation == 500) { fish.changeFishing(0.19, 8) } if(generation == 3500){ fish.changeFishing(0.22,0) } } File("data.txt").writeText(popSizes.toString()) }
{ "domain": "codereview.stackexchange", "id": 38003, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "random, simulation, kotlin", "url": null }
java, game, swing, animation Square does not have to extend JPanel, and actually it shouldn't. Because it's not a JPanel. private int squareXLocation; private int squareSize; private int squareYLocation = -squareSize; The square size is still 0 at this point, so you're setting the location at 0 again. private int fallSpeed = 1; Setting fallspeed is not necessary, since you're changing it later anyways. Random rand = new Random(); /* //creates a random value inside the window and stores it in squareXLocation */ public int generateRandomXLocation(){ return squareXLocation = rand.nextInt(Game.WINDOW_WIDTH - squareSize); }
{ "domain": "codereview.stackexchange", "id": 11264, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, game, swing, animation", "url": null }
about this problem. Co-ordinate Geometry 1. A comprehensive list of the most commonly used basic math formulas. Solution:. The distance formula is used to find the distance between two points in the coordinate plane. This stopping distance formula does not include the effect of anti-lock brakes or brake pumping. For instance, in towns the speed limit is 30 miles per hour. distance = speed x time. If the points are the same and the distance therefore zero and all waypoints therefore identical, the first point (either point) is returned. How do you solve equations using the formula rate * time = distance? How can you draw and use pictures to solve word problems using the formula d = rt? How can you come up with an equation to solve a uniform motion problem? How can you use a chart to solve a uniform motion problem? How can you check your solutions to a uniform motion problem?. Use Points in. NET Add Maths Formulae List: Form 4 (Update 18/9/08) 01 Functions Absolute Value Function Inverse
{ "domain": "ecbu.pw", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9908743647666859, "lm_q1q2_score": 0.8169381918464674, "lm_q2_score": 0.8244619306896955, "openwebmath_perplexity": 582.4466964757214, "openwebmath_score": 0.719685971736908, "tags": null, "url": "http://oayd.ecbu.pw/distance-formula-maths.html" }
zoology, cellular-respiration, ichthyology Finally, TCA cycle should also be considered as a water-splitting process generating oxygen for acetyl-CoA oxidation [they quote Wieser]
{ "domain": "biology.stackexchange", "id": 567, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "zoology, cellular-respiration, ichthyology", "url": null }
javascript, beginner setItalic: function(target, value) { this.setStyle(target, 'fontStyle', value); }, toggleBold: function(target, element) { this.setBold(target, element.checked === true ? 'bold' : 'normal'); }, toggleUnderline: function(target, element) { this.setUnderline(target, element.checked === true ? 'underline' : 'none'); }, toggleItalic: function(target, element) { this.setItalic(target, element.checked === true ? 'italic' : 'normal'); } }; </script> </body> </html>
{ "domain": "codereview.stackexchange", "id": 1265, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, beginner", "url": null }
algorithms, algorithm-analysis, sorting, performance, radix-sort Since the recursion we will stop recursing after $W$ levels in the worst case, the space complexity becomes $\Theta(N + WR)$ however what about time? Just from space itself, it seems like MSD is actually pretty bad. What can you say about the time? To me it looks like you will have to spend $R$ operations for every node in your recursion tree and also $N$ operations per every level. So the time is $\Theta(NW + R*amountOfNodes)$. I do not see how and why MSD would ever be preferred in practice given these time bounds. They are pretty horrible, but I am still not sure whether I get the time bounds in a correct way, for instance I have no clue how big is amountOfNodes.. Keep in mind that I would like the analysis to be in terms of R and N. I know that in practice R is usually small so it's just a constant, but I am not interested in this scenario, since I would like to see how much does R affect the performance as well.
{ "domain": "cs.stackexchange", "id": 4338, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithms, algorithm-analysis, sorting, performance, radix-sort", "url": null }
ros, ros2, colcon, windows10 Originally posted by Akarsh with karma: 76 on 2020-11-14 This answer was ACCEPTED on the original site Post score: 6 Original comments Comment by Morris on 2022-07-25: Yes, sourcing the underlay is that is needed.
{ "domain": "robotics.stackexchange", "id": 35233, "lm_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, windows10", "url": null }
give the coe cients a 0, a n, and b nand plug them in to the big series formula, equation (2. In this he expanded functions as a trigonometrical In the last post I showed you guys how to calculate Fourier Coefficients for a given function defined in the range, [-l,l]. Partial Poisson resummation. 9toseethe result. the last question) that the sum of the Fourier series att = p , p Z ,is given by f(p ) = 0, (cf. The 2-periodic function with graph can be described by f(x) = ( x if 0 <x 2; f(x + 2) for all x; or f(x) = x 2 jx 2 k : Daileda Fourier Series. Its sum is at every point except the point of discontinuity. This uses the optimum number of Fourier terms and then forecasts the time series signal using the learned model. 1) where a 0, a n, and b It is clear from the graph of x(t) that the average value of the signal is positive, and that the signal does not contain symmetry (even, odd, or half-wave odd). 17) . To select a function, you may press one of the following buttons: Sine,
{ "domain": "estodobueno.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9883127440697255, "lm_q1q2_score": 0.829919781878709, "lm_q2_score": 0.8397339676722393, "openwebmath_perplexity": 555.6384017826568, "openwebmath_score": 0.8730370998382568, "tags": null, "url": "http://estodobueno.com/gheryb/fourier-series-graph.html" }
human-biology, vision, human-physiology, human-eye, color This interests me specifically in the context of juggling: I like to juggle, and I wonder whether there's a difference in my response time and accuracy with different colours of balls/clubs. Usually I'm indoors, and ceilings are usually white, sometimes black or brown, with strip lighting. My only personal observations are rather obvious: dark colours can be hard to see against dark backgrounds, and white can be hard to see against white. The answer is yes and yes. Firstly, motion cannot be processed at equiluminance. In other words if you have clubs that are equally as bright as their background you will not be able to see them move even though they are clearly visible because of a different color. It's a remarkable effect (demo link below), as you become in effect motion-blind. Obviously you notice after a while that things moved, but you don't see them move smoothly as you are used to. This is similar to what people with akinetopsia experience (had lesions to brain areas involved in
{ "domain": "biology.stackexchange", "id": 9205, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "human-biology, vision, human-physiology, human-eye, color", "url": null }
php, object-oriented, design-patterns I studied some of blogs and code reviews and decided to follow proper oop techniques and concepts. I tried to follow PSR standards and some SOLID concepts (as far as I could understand them). I tried to follow Data Mapper pattern so here MatEducation.php works as ORM for mat_education. I have read about dependency injection and what I could understand was a class should not create an object of another class in it but if it try to access the services of other class the object should be given to it (correct me). I am more interested in design pattern and conceptual understanding of problem solving (error handling is not done properly in this code but that's ok for now).
{ "domain": "codereview.stackexchange", "id": 15712, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php, object-oriented, design-patterns", "url": null }
gazebo-plugin With parent the WorldPtr to my world. But it seems that it doesn't work. I was wondering if there is a way to select the gzclient_camera from the worldPtr. The API seems to say that "The world provides access to all other object within a simulated environment" but at the same time PrintEntityTree shows only models and the sun. Thanks for anyone that can help. PS : I guess it's possible to solve it by creating a sensor plugin and to calling it from the worldPlugin but it seems a little bit over complicated for probably 2 lines of code.
{ "domain": "robotics.stackexchange", "id": 4279, "lm_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-plugin", "url": null }
homework-and-exercises, newtonian-mechanics, energy-conservation, momentum \tag{1} m_1v_{1i} - m_1v_{1f}\cos \theta &= m_2v_{2f} \cos \phi, \\ \tag{2} m_1v_{1f}\sin \theta &= m_2v_{2f}\sin \phi, \\ \tag{3} m_1v_{1i}^2 - m_1v_{1f}^2 &= m_2v_{2f}^2. \end{align}$$ Summing the squares of (1) and (2) eliminates $\phi$. The RHS of the resultant equation contains $v_{2f}^2$ which can be eliminated using (3). Then, one would obtain a quadratic equation in terms of $\frac{v_{1f}}{v_{1i}}$, which can be solved to obtain the desired equation $$\frac{v_{1f}}{v_{1i}} = \frac{m_1}{m_1+m_2}\left[\cos \theta \pm \sqrt{\cos^2 \theta - \frac{m_1^2-m_2^2}{m_1^2}}\right].$$ For the next equation, we rotate the axes to obtain the angle $\theta+\phi$ more easily. Here, the conservation laws are $$\begin{align} \tag{4} m_1v_{1i}\cos\phi - m_1v_{1f}\cos(\theta+\phi) &= m_2v_{2f}, \\ \tag{5} m_1v_{1i}\sin \phi &= m_1v_{1f}\sin(\theta+\phi), \\ \tag{6} m_1v_{1i}^2 - m_1v_{1f}^2 &= m_2v_{2f}^2. \end{align}$$
{ "domain": "physics.stackexchange", "id": 5632, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, newtonian-mechanics, energy-conservation, momentum", "url": null }
python, game, adventure-game if self.room.roominv[key].name == command.split()[1]: addToInventory(key) elif command == 'Inventory': for item in list(self.bag): print("Your bag contains:", item.name) else: print('Invalid command')
{ "domain": "codereview.stackexchange", "id": 26917, "lm_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, game, adventure-game", "url": null }
c#, thread-safety, event-handling, extension-methods /// <summary> /// Raises a static event thread-safely if the event has subscribers. /// </summary> /// <param name="me"> The event handler to raise. </param> /// <param name="args"> The event args. </param> [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate", Justification = "This warning comes up when you use the word `Fire` in a method name. This method specifically raises events, and so does not need changing.")] public static void Fire(this EventHandler me, EventArgs args) { me.Fire(null, args); }
{ "domain": "codereview.stackexchange", "id": 9687, "lm_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#, thread-safety, event-handling, extension-methods", "url": null }
cc.complexity-theory Title: Non constructible functions and anomalous results In the Arora-Barak book, in the definition of time constructible functions, it is said that using functions that are not time constructible can lead to "anomalous results". Does anyone have an example of such an "anomalous result"? I have heard in particular that there might exist functions such that the time hierarchy theorem does not hold, does anyone have an example of such functions? Is there something about this somewhere in the litterature? Borodin's Gap Theorem: For every total computable function $g(n) \geq n$, there is a total computable function $t$ such that $DTIME[g(t(n))] = DTIME[t(n)]$. In fact, this holds for any Blum complexity measure in place of $DTIME$. See also the wikipedia page and references therein.
{ "domain": "cstheory.stackexchange", "id": 1129, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cc.complexity-theory", "url": null }
$$1 = 2 ^ 0$$ $$1 \div 2 = 2^{-1}$$ $$1 \div 2 \div 2 = 2^{-2}$$ Note that these patterns hold regardless of the base: $$n \times n \times n \times 1 = n^3$$ $$n \times n \times 1 = n^2$$ $$n \times 1 = n^1$$ $$1 = n^0$$ $$1 \div n = n^{-1}$$ $$1 \div n \div n = n^{-2}$$ $$1 \div n \div n \div n = n^{-3}$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9697854155523791, "lm_q1q2_score": 0.8081460449761614, "lm_q2_score": 0.8333246015211008, "openwebmath_perplexity": 319.18654068669645, "openwebmath_score": 0.7676352858543396, "tags": null, "url": "https://math.stackexchange.com/questions/2121796/why-does-any-nonzero-number-to-the-zeroth-power-1/2121811" }
gauge-theory, hamiltonian-formalism, constrained-dynamics, degrees-of-freedom A second-class constraint does not generate a gauge transformation, the transformation generated by it does not have physical meaning because it does not preserve the constraint surface - it maps a state on the surface to a state off the surface. So for a second-class constraint, you only have the single degree of freedom it eliminates simply by being a relation among the coordinates.
{ "domain": "physics.stackexchange", "id": 28291, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gauge-theory, hamiltonian-formalism, constrained-dynamics, degrees-of-freedom", "url": null }
quantum-algorithms, circuit-construction I have tried with pen and paper to come up with such a design, to no avail, but haven't performed any kind of exhaustive search. I'm assuming that by "decoder" you mean "binary to unary conversion". There is a very simple way to produce the unary output from the binary input, by using a series of swap gates in a descending pattern. This even works when you know your input has a maximum value that's not a power of 2:
{ "domain": "quantumcomputing.stackexchange", "id": 616, "lm_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-algorithms, circuit-construction", "url": null }
optics, scattering, fiber-optics, laser-cavity Title: Brillouin scattering in multimode fibers Fiber ring resonators made up of single mode fibers often incorporate an optical isolator to suppress the build-up of Brillouin scattering. However, ring resonators made of multimode fibers generally do not contain an isolator. Why is it that the adverse effects of Brillouin scattering are negligible in multimode fibers? Stimulated Brillouin scattering is propagating "backwards", hence isolator effectively kills it while allowing laser operation in main direction. Multi-mode fiber lasers are typically not single-frequency, hence SBS is much less of a concern. So, if you make single-mode fiber laser, but not single frequency, with large enough bandwidth (>>10GHz) - it would also not require special means for SBS suppression.
{ "domain": "physics.stackexchange", "id": 58062, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "optics, scattering, fiber-optics, laser-cavity", "url": null }
beginner, datetime, reinventing-the-wheel, rust Basically, impl Trait in argument position does not inform type inference. Some functions such as str::parse return generic results parameterized by a free parameter, so it may be best to guide inference. Accepting impl Trait in argument position is usually unidiomatic. Furthermore, impl Into<u16> is why you have to write 2022u16 and can't write just 2022. So we have: pub fn with_date_and_time( year: u16, month: u8, day: u8, hour: u8, minute: u8, second: u8 ) public fields My recommendation is to add accessor methods and make fields private. If you want to change inner representation someday, you wouldn't need to break backwards compatibility. This is important in library code. But in binary code, you may change representation without breaking other modules, so this is beneficial as well. pub struct Time { hour: u8, minute: u8, second: u8 } impl Time { fn hour(&self) -> u8 { self.hour } // .. }
{ "domain": "codereview.stackexchange", "id": 43825, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "beginner, datetime, reinventing-the-wheel, rust", "url": null }
ros, sicklms, sicktoolbox-wrapper A Timeout Occurred! 2 tries remaining A Timeout Occurred! 1 tries remaining A Timeout Occurred - SickLIDAR::_sendMessageAndGetReply: Attempted max number of tries w/o success! Checking 500Kbps... ERROR: I/O exception - SickLMS::_setTerminalBaud: ioctl() failed! ERROR: I/O exception - SickLMS::_setTerminalBaud: ioctl() failed! ERROR: I/O exception - SickLMS::_setTerminalBaud: ioctl() failed! [ERROR] [1323229778.547778107]: Initialize failed! are you using the correct device path? ERROR: Sick thread exception - SickBufferMonitor::AcquireDataStream: pthread_mutex_lock() failed! ERROR: Sick thread exception - SickBufferMonitor::AcquireDataStream: pthread_mutex_lock() failed! ... ERROR: Sick thread exception - SickBufferMonitor::AcquireDataStream: pthread_mutex_lock() failed! ERROR: Sick thread exception - SickBufferMonitor::AcquireDataStream: pthread_mutex_lock() failed! ERROR: Sick thread exception - SickBufferMonitor::AcquireDataStream: pthread_mutex_lock() failed!
{ "domain": "robotics.stackexchange", "id": 7565, "lm_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, sicklms, sicktoolbox-wrapper", "url": null }
magnetic-fields, electromagnetic-induction $$\mathcal{E}=-\frac{d}{dt}\iint\limits_S\vec{B}·d\vec{A}\ .$$ It is okay for two adjacent loops to have different EMFs. The only way nearby loops can affect the EMF along one another if currents are induced in them. Then, because of the mutual inductance of the loops, the current along one affects the magnetic flux through the other. But a current induced in a loop affects the magnetic flux even through itself, due to its self inductance, so this phenomenon doesn't only occur when you have multiple loops. But if the magnetic fields due to induced currents are small (e.g. wires have high resistance), this is not a problem, and you can calculate the EMF along each loop independently.
{ "domain": "physics.stackexchange", "id": 68635, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "magnetic-fields, electromagnetic-induction", "url": null }
LP Conditioning We consider global conditioning property of Linear Program (LP) here. Let’s first define the problem. The standard form of LP is \displaystyle \begin{aligned} & \underset{x \in \mathbb{R}^n}{\text{minimize}} & & c^Tx\\ & {\text{subject to}} & & Ax =b ,\\ & & & x\geq 0 \end{aligned} \ \ \ \ \ (1) where ${A \in \mathbb{R}^{n\times m}, c\in \mathbb{R}^n}$ and ${b \in\mathbb{R}^m}$. The dual of the standard form is \displaystyle \begin{aligned} & \underset{y \in \mathbb{R}^m}{\text{maximize}} & & b^Ty\\ & {\text{subject to}} & & A^Ty\leq c. \\ \end{aligned} \ \ \ \ \ (2) Now suppose we add perturbation ${u\in \mathbb{R}^{n}}$ to Program (2) in the ${c}$ term, we have \displaystyle \begin{aligned} & \underset{y \in \mathbb{R}^n}{\text{maximize}} & & b^Ty\\ & {\text{subject to}} & & A^Ty\leq c+u.\\ \end{aligned} \ \ \ \ \ (3)
{ "domain": "threesquirrelsdotblog.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.992422758508031, "lm_q1q2_score": 0.8204475928070726, "lm_q2_score": 0.8267117876664789, "openwebmath_perplexity": 11766.24440627605, "openwebmath_score": 1.0000014305114746, "tags": null, "url": "https://threesquirrelsdotblog.com/" }
navigation, ros-kinetic, costmap, global-planner, move-base My initial guess is that there is something wrong with the costmap update when the costmap moves for one resolution step but I cannot understand how is this connected with the global_planner? Maybe it somehow messes with the costmap update so whenever the costmap moves the new values are updated with lethal cost or it is connected with my costmap configuration files (which I doubt since it works fine with other planners). I also tried tinkering with the global costmap update/publish frequency and resolution but the obstacles still appear. Changing the update/publish frequency though clears the obstacles but does not stop the creation of new ones. Has anyone run into this problem? You can see the obstacles on the image and the bellow:
{ "domain": "robotics.stackexchange", "id": 33829, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "navigation, ros-kinetic, costmap, global-planner, move-base", "url": null }
cardiology You described a very long cut, which sounds like what you would see for harvesting the great saphenous vein. The great saphenous vein is the longest vein in the body, and dominates recent scientific publications in response to a query of ''coronary bypass harvesting''. (There are publications in that batch evaluating newer endoscopic techniques in which the long cut can be avoided) Wikipedia reviews the use of this vein reasonably well.
{ "domain": "biology.stackexchange", "id": 10990, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cardiology", "url": null }
c, homework typedef struct hash_cons_table { int size; int capacity; void **table; Hash_Cons_Hash hashf; Hash_Cons_Equal equalf; } *HASH_CONS_TABLE; /** * Get item if there is one otherwise create one * @param temp_item it is a temporary or perhaps stack allocated creation of item * @param temp_size how many bytes it is * @param hashcons table */ void *hash_cons_get(void *temp_item, size_t temp_size, HASH_CONS_TABLE table); #endif hashcons.c #include <stdlib.h> #include <string.h> #include "prime.h" #include "hashcons.h" #define HC_INITIAL_BASE_SIZE 61 #define MAX_DENSITY 0.5 /** * Initializes a table * @param hc table * @param capacity new capacity */ void hc_initialize(HASH_CONS_TABLE hc, const int capacity) { hc->capacity = capacity; hc->table = calloc(hc->capacity, sizeof(void *)); hc->size = 0; }
{ "domain": "codereview.stackexchange", "id": 38718, "lm_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, homework", "url": null }
image-processing, distance-metrics, classification, waveform-similarity As a primary comparison, i would first like to make distinction between pure brick patch vs. pure grass patch. For this, color is definitely the most potential element. Combining features to make more robust classification I would use a dominant color ( uses but not the only one) or key color and form the clusters. See where the cluster heads lie; If the cluster heads both are within expected areas, the class is usually easy to detect, if the they fall into gray area, then the class belongs there. If it falls in gray area, another feature is required. Sameway, you can independently classify using Texture matrix and then combine both the scores to ensure that results makes sense. Dealing with spatial problems Specifically when you realize that the patches can have parts of it which are half bricks and half grass. I think you don't need any more additional features or different matric. This can be handled in two ways. 1. Keep multiple membership patch as different classes.
{ "domain": "dsp.stackexchange", "id": 11865, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "image-processing, distance-metrics, classification, waveform-similarity", "url": null }
c++, multithreading, c++17 #include "multithread.h" using Mercer::multithread; using Mercer::execution; using function = std::function<void()>; struct multithread::implementation { enum struct close: bool {detach, join}; std::queue<std::exception_ptr> exceptions; bool open ; std::deque <function> line ; std::mutex door ; std::condition_variable guard; std::vector<std::thread> pool ;
{ "domain": "codereview.stackexchange", "id": 31762, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, multithreading, c++17", "url": null }
pl.programming-languages, type-theory, type-systems, dependent-type The traditional approach to dependent types, however, allows for arbitrarily complex constraints on types, with the following caveat: the onus of verification is placed on the programmer rather than on the compiler. In this setting, an element of { x : Int | x < 2 } is not an integer less than 2, but a pair (n, e) where n is an integer and e is evidence that n<2 holds. Therefore the compiler only has to check the evidence at compile time, rather than building it herself. Note however that some computational inferences can be performed, typically $1+1$ can be seen to be identical to $2$ (but $x<2$ can not be seen to imply $x\leq 2$ without some contribution from the user). The obvious advantage is that arbitrarily complex constraints on the code can be verified, and the programmer may have access to automatic tools to assist the production of the required evidence (the famous "tactic language" of Coq is an example of this).
{ "domain": "cstheory.stackexchange", "id": 1966, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "pl.programming-languages, type-theory, type-systems, dependent-type", "url": null }
It is often the case that vertical distances make the most sense, though. This would be the case when we are thinking of $$Y$$ as a function of $$X$$, which would make sense in a true experiment where $$X$$ is randomly assigned and the values are independently manipulated, and $$Y$$ is measured as a response to that intervention. It can also make sense in a predictive setting, where we want to be able to predict values of $$Y$$ based on knowledge of $$X$$ and the predictive relationship that we establish. Then, when we want to make predictions about unknown $$Y$$ values in the future, we will know and be using $$X$$. In each of these cases, we are treating $$X$$ as fixed and known, and that $$Y$$ is understood to be a function of $$X$$ in some sense. However, it can be the case that that mental model does not fit your situation, in which case, you would need to use a different loss function. There is no absolute 'correct' distance irrespective of the situation.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9553191335436404, "lm_q1q2_score": 0.8022139283196141, "lm_q2_score": 0.8397339696776499, "openwebmath_perplexity": 371.4302925611878, "openwebmath_score": 0.7144286632537842, "tags": null, "url": "https://stats.stackexchange.com/questions/417426/why-does-linear-regression-use-vertical-distance-to-the-best-fit-line-instead" }
lowpass-filter, finite-impulse-response Title: FIR filter digital differentiator with low cutoff I'm trying to design a digital differentiator FIR Filter. It features a lowpass, such that above the cutoff frequency the amplification is very low. I get the coefficients by a linear program minimizing the chebychef error of desired and actual frequency response. It works really well, but I cannot place the cutoff frequency below some 0.1*pi rad/sample. Small cutoff frequencies still have very steep rising amplitude responses in low frequencies and thus need a broad transition band.
{ "domain": "dsp.stackexchange", "id": 5384, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "lowpass-filter, finite-impulse-response", "url": null }