text
stringlengths
1
1.11k
source
dict
c, tree /*********************************** TREE FUNCTIONS ****************************/ /** * @brief Free a whole tree from memory by freeing each node recursively, starting from the leaves. * * @param root * Pointer to the root of the tree. */ void delete_tree(Node *root); /** * @brief Print a text representation of a tree to screen. * * @param root * Pointer to the root of the tree. */ void print_tree(Node *root); /** * @brief Remove a whole branch recursively from its parent and free it from memory. * * @param parent * Pointer to the parent. * @param index_of_child * parent->children[index_of_child] is supposed to point to the root of the branch that is to be deleted. */ void delete_branch(Node *parent, int index_of_child); /*********************************** TREE DICTIONARY FUNCTIONS ****************************/
{ "domain": "codereview.stackexchange", "id": 45425, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c, tree", "url": null }
javascript In submit(), you could improve errors.innerHTML = ''. Why don't you just set errors to document.getElementById('errors').innerHTML instead, seeing as you don't use errors other than for that? In submit() you should also improve your line spacing as well, as it seems a little strange.
{ "domain": "codereview.stackexchange", "id": 14338, "lm_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", "url": null }
electromagnetic-radiation, statistical-mechanics, thermal-radiation The classical view treats all electromagnetic modes of the cavity as equally likely because you can add an infinitesmal amount of energy to any mode But the existence of the modes is conditioned to the existence of certain movements by the particle, so I don't see it as a "degree of freedom". For example, for a high frequency mode to exist there should be electrons jiggling with a certain frequency. I expected some sort of statistic on electrons speed and acceleration for a given temperature, like from the Maxwell-Boltzmann distribution, to derive the expected electromagnetic radiation spectrum for the blackbody. 1) Why are the electromagnetic modes are considered "degrees of freedom" if their existence is conditioned to the motion of the electrons? If they actually aren't, please explain it 2) Does an alternative (non cavity + modes) approach exist? I was thinking fluctuations of charge density on the surface of a solid metal sphere due to temperature.
{ "domain": "physics.stackexchange", "id": 10085, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetic-radiation, statistical-mechanics, thermal-radiation", "url": null }
java, queue An existing interface like java.util.Queue also helps you use "standard" method naming. You called your methods enqueue and dequeue, when they would have been better as add and poll, respectively, following the "standard". Generalize The interface in java.util is defined with a type parameter, as Queue<E>. Indeed your implementation would work just fine with any kind of object, not only integers. You could follow the example and generalize your implementation so it can work with anything. If you don't know how to go about that, you can get ideas from an existing implementation, for example the PriorityQueue of OpenJDK Allow null values Your implementation doesn't allow null values. I suppose it's because that would break your realign method. If you think about it, that realign method is ugly. Suppose you have 1000 elements, if you call dequeue followed by enqueue, your call will move 999 elements one by one, and in a really awkward way with that comparator and sorting.
{ "domain": "codereview.stackexchange", "id": 8361, "lm_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, queue", "url": null }
= 45+10+1 = 56 How many subsets of the set {1, 2, 3, , n} are coprime? A set of integers is called coprime if every two of its elements are coprime. something that generates: Too late to answer, but an iterative approach sounds easy here: 1) for a set of n elements, get the value of 2^n. Jan 19, 2011 · how many subsets with an odd number of elements does a set with 10 elements have? How many subsets of a set with $100$ elements have more than $2$ element? Approach. A set with no element (also called the NULL set) {} 2. Second, the subsets can have 3 and 4 elements. Example 1: How many number of subsets containing three elements can be formed from the set. Example: Q = {x, y, z}. Asked in Math and Arithmetic , Algebra How many subsets does the set 1 2 3 have ? Answer and Explanation: The number of elements in the given set is, {eq}n=10 {/eq}. Because the set A = {a, e, i, o, u} contains "5" elements. Therefore the set has subsets. { } or ∅, the empty set, sometimes called the "null"
{ "domain": "antonim.info", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9901401467331061, "lm_q1q2_score": 0.8721125356383084, "lm_q2_score": 0.8807970654616711, "openwebmath_perplexity": 272.84858860194447, "openwebmath_score": 0.7845133543014526, "tags": null, "url": "http://antonim.info/v1eyn/how-many-subsets-in-a-set-with-10-elements.html" }
sampling, z-transform, laplace-transform $$H(f)=\text{sinc}(fT)e^{-j2\pi f T/2}\tag{1}$$ with $\text{sinc(x)}=\sin(\pi x)/(\pi x)$. From (1) it can be seen that $H(f)$ has a linear phase response with a corresponding group delay of $T/2$. Now if the sampling frequency is very high compared to the bandwidth of the sampled signal, then the $\text{sinc}$ function can be approximated by a constant around $f=0$, or, equivalently, the rectangular impulse response can be approximated by an impulse at its center (which is $t=T/2$). So for low-frequency signals (compared to the sampling frequency), the zero-order hold operation can be approximated by a delay of $T/2$.
{ "domain": "dsp.stackexchange", "id": 2389, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "sampling, z-transform, laplace-transform", "url": null }
html, css, sass, scss .page--profil & { /* ... */ } .page--portfolio & { /* ... */ } .page--impressum & { /* ... */ } } } possible solutions/ideas: additional CSS file only used on these sites (extra HTTP request) page-specific CSS in style tags inside the actual html document (hard to manage) Using SASS mixins to generate the CSS for the four pages (won't reduce bloat) Some days passed and I feel like I should share the changes I have made so far. Naming I started using page names instead of color names on classes and variables. This leaves me with the benefit of being able to change the color scheme of an entire page only by changing the value of the color variable. .page--home -> .page--blog .nav__item--green -> .nav__item--blog $green-color -> $blog-color Generating page-specific CSS with a mixin
{ "domain": "codereview.stackexchange", "id": 6261, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "html, css, sass, scss", "url": null }
gazebo Get:2 http://archive.ubuntu.com quantal-proposed Release.gpg [933 B] Hit http://archive.ubuntu.com quantal-backports Release.gpg Hit http://archive.ubuntu.com quantal Release Get:3 http://archive.ubuntu.com quantal-updates Release [49.6 kB] Get:4 http://archive.ubuntu.com quantal-proposed Release [49.6 kB] Ign http://security.ubuntu.com quantal-security InRelease
{ "domain": "robotics.stackexchange", "id": 3001, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gazebo", "url": null }
Thus we have proved that the integrand $$f(x)=\sqrt{x+\sqrt{x+\dotsb}}$$ is bounded and continuous almost everywhere on $$[0,2]$$, so it is Riemann integrable on $$[0,2]$$. The function $$\tilde f\colon [0,2]\to\mathbf R$$ defined by $$\tilde f(x) = \frac{1}{2} + \frac{1}{2}\sqrt{4x+1},\quad\text{for each x\in[0,2],}$$ is continuous on $$[0,2]$$ and agrees with $$f$$ almost everywhere, so $$\int_0^2 f(x)\,\mathrm dx = \int_0^2\tilde f(x)\,\mathrm dx$$. Since $$\tilde f(x)$$ is continuous on the entire closed interval $$[0,2]$$, its integral can be evaluated via the fundamental theorem of calculus. Since $$F(x) = \frac{x}{2} + \frac{(4x+1)^{3/2}}{12}$$ satisfies $$F'(x) = \tilde f(x)$$ for each $$x\in [0,2]$$, by the fundamental theorem of calculus, \begin{align*} \int_0^2\tilde f(x)\,\mathrm dx = F(2)-F(0) = \bigg[\frac{2}{2} + \frac{(4\cdot 2+1)^{3/2}}{12}\bigg] - \bigg[\frac{0}{2}+\frac{(4\cdot0+1)^{3/2}}{12}\bigg]=\frac{19}{6}, \end{align*} as desired.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.977022625406662, "lm_q1q2_score": 0.8342920779409594, "lm_q2_score": 0.8539127510928476, "openwebmath_perplexity": 117.98254086171619, "openwebmath_score": 0.9795090556144714, "tags": null, "url": "https://math.stackexchange.com/questions/2412828/solve-int-02-sqrtx-sqrtx-sqrtx-dotsb-dx" }
algorithms, probability-theory, randomized-algorithms, randomness, online-algorithms Title: Online generation of uniform samples A source provides a stream of items $x_1, x_2,\dots$ . At each step $n$ we want to save a random sample $S_n \subseteq \{ (x_i, i)|1 \le i \le n\}$ of size $k$, i.e. $S_n$ should be a uniformly chosen sample from all $\tbinom{n}{k}$ possible samples consisting of seen items. So at each step $n \ge k$ we must decide whether to add the next item to $S$ or not. If so we must also decide which of the current items to remove from $S$ . State an algorithm for the problem. Prove its correctness. Due to the dubious nature of the question, I only provide hints. Have you tried the obvious? With probability $\frac{1}{n}$, add the new element to the sample. If it is added, choose one of the elements already in the sample uniformly at random and drop it. Sounds about fair, does it not?
{ "domain": "cs.stackexchange", "id": 5542, "lm_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, probability-theory, randomized-algorithms, randomness, online-algorithms", "url": null }
mechanical Title: Internal involute spline 1.375 - 21T could anybody help me by providing an internal involute spline data sheet similar to the attached picture for an 1-3/8" splined shaft with 21 teeth, 16DP and 30 degree pressure angle. Thanks for your help. From Machinery's Handbook for a flat root side fit spline. There are a few other different styles, this is what I use. This is a class 5 tolerance (typical industry level) per ANSI B92.1-1970
{ "domain": "engineering.stackexchange", "id": 3048, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "mechanical", "url": null }
human-biology, neuroscience, cell-biology, general-biology, neurology While this answer was appreciated, i'm interested in other biological processes... What happens to stress and anxiety? Do our adrenal glands stop secreting as much corticosteroids? What effect does exercise have on circadian rhythms? With exercise, can you circumvent the problem of not getting enough light in the winter? What effect does exercise have on memory? It should probably help, since it would lead to decreased damage to the hippocampus. How does exercise effect sleep, learning, memory, metabolic processes??? I'm searching for the comprehensive list of different primary and secondary effects of exercise from a biological standpoint. I'm really interested in what the short term and long term effects of exercise are on the brain. Although current research has little to say about the effects of exercise on personality, there has been recent correlations demonstrated between personality and the "drive" to exercise--specifically, aggression as a personality trait has been linked to
{ "domain": "biology.stackexchange", "id": 768, "lm_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, neuroscience, cell-biology, general-biology, neurology", "url": null }
special-relativity, photons, speed-of-light, quantum-chromodynamics, gluons QCD is a non-linear theory with gluons interacting with each other via 3 and 4 vertices. Specifically the 3-gluon vertex (please correct me if I am wrong) under specific conditions can be viewed as a gluon decay into two gluons. However, massless particles cannot decay according to Special Relativity. What is the explanation of why massless gluons can interact with each other and apparently even decay while not experiencing time? In our laboratory experiments gluons are always off mass shell so the problem does not arise as they take virtual masses under the integrals. Your question would be relevant in the quark gluon plasma at cosmological times, where anyway symmetry is unbroken and all elementary particles in the table have zero mass. Calculations are not done in the rest system of zero mass particles, but in some appropriate observer frame, and interactions take place following the rules of quantum field theory.
{ "domain": "physics.stackexchange", "id": 49497, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "special-relativity, photons, speed-of-light, quantum-chromodynamics, gluons", "url": null }
java, beginner, game, random, dice import java.io.IOException; import java.util.Random; import java.util.Scanner; public class helloworld { private static int point; private static enum possibleResults {UNDEFINED, WIN, LOSE}; private static possibleResults gameResult = possibleResults.UNDEFINED; private static String causeOfLose; private static String causeOfWin; public static int rollDice(int n) { int sum = 0; Random randomNumbers = new Random(); for(int i=0; i<n; i++) { sum += (1 + randomNumbers.nextInt(6)); } System.out.printf("Rolling dice... You got %d\n", sum); return sum; }
{ "domain": "codereview.stackexchange", "id": 10426, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, beginner, game, random, dice", "url": null }
approximation-algorithms, clustering Fix any optimal solution $(x, y)$ to the standard $k$-median linear-program relaxation: $$ \begin{align*} & & \min \textstyle \sum_{j\in C}\sum_{f\in L} d(j, f) x_{jf} \\ & (\forall j\in C) & \textstyle \sum_{f\in L} x_{jf} = 1, \\ & & \textstyle \sum_{f\in L} y_f = k, \\ & (\forall j\in C, f\in L) & 0 \le x_{jf} \le y_f. \end{align*} $$ Let $\alpha_j = \sum_{f\in L} d(j, f) x_{jf}$ be the assignment cost incurred by $(x, y)$ for client $j$. Let OPT $= \sum_j \alpha_j$ be the total assignment cost. The LP is a relaxation of the actual instance, so the true optimum is at least OPT. The rounding scheme has two phases. In the first phase it generates a set $S\subseteq L$ of facilities and a partial assignment of clients to facilities in $S$, by sampling $h=\lceil k\ln(1/\epsilon)\rceil$ times as follows:
{ "domain": "cstheory.stackexchange", "id": 5242, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "approximation-algorithms, clustering", "url": null }
ros, knowrob, rosjava, catkin-workspace -- Configuring incomplete, errors occurred! See also "/home/al/ros_catkin_ws/build_isolated/knowrob_common/CMakeFiles/CMakeOutput.log". See also "/home/al/ros_catkin_ws/build_isolated/knowrob_common/CMakeFiles/CMakeError.log". <== Failed to process package 'knowrob_common': Command '/home/al/ros_catkin_ws/devel_isolated/rosprolog/env.sh cmake /home/al/ros_catkin_ws/src/stacks/knowrob/knowrob_common -DCATKIN_DEVEL_PREFIX=/home/al/ros_catkin_ws/devel_isolated/knowrob_common -DCMAKE_INSTALL_PREFIX=/home/al/ros_catkin_ws/install_isolated -G Unix Makefiles' returned non-zero exit status 1 I think it occures because workspaces is not chained. There is a tutorial that describes how to chain workspaces, but after a default installation (according to mentioned tutorials) we have the following directories: ~/ros_catkin_ws and ~/rosjava. It's not clear how to chain them.
{ "domain": "robotics.stackexchange", "id": 20665, "lm_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, knowrob, rosjava, catkin-workspace", "url": null }
c, lexical-analysis if (!isdigit(lexer_look(lexer, 0))) { token->flt = (double)v; token->num = 0; return token; } double places = 10; double dbl = 0; while (can_adv(lexer, 1)) { char c = lexer_look(lexer, 0); if (isdigit(c)) { dbl += (c - '0') / places; lexer_adv(lexer, 1); places *= 10; } else break; } token->flt = v + dbl; return token; } static token_t* lexer_num(lexer_t* lexer) { token_t* token = token_new(lexer, _int_rep); unsigned int v = 0; while (can_adv(lexer, 1)) { char c = lexer_look(lexer, 0); if (isdigit(c)) { v = (v * 10) + (c - '0'); lexer_adv(lexer, 1); } else if (c == '.') { lexer_adv(lexer, 1); return lexer_float(lexer, token, v); } else { break; } } token->num = v; return token; }
{ "domain": "codereview.stackexchange", "id": 21400, "lm_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, lexical-analysis", "url": null }
java, console, compression public final class App { private static final String ENCODE_OPTION_SHORT = "-e"; private static final String ENCODE_OPTION_LONG = "--encode"; private static final String DECODE_OPTION_SHORT = "-d"; private static final String DECODE_OPTION_LONG = "--decode"; private static final String HELP_OPTION_SHORT = "-h"; private static final String HELP_OPTION_LONG = "--help"; private static final String VERSION_OPTION_SHORT = "-v"; private static final String VERSION_OPTION_LONG = "--version"; private static final String ENCODED_FILE_EXTENSION = "het"; public static void main(String[] args) { Set<String> commandLineArgumentSet = getCommandLineOptions(args); if (commandLineArgumentSet.isEmpty() || commandLineArgumentSet.contains(HELP_OPTION_LONG) || commandLineArgumentSet.contains(HELP_OPTION_SHORT)) { printHelpMessage(); System.exit(0); }
{ "domain": "codereview.stackexchange", "id": 23126, "lm_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, console, compression", "url": null }
c++, beginner, simulation, sdl constexpr int WIDTH = 64; constexpr int HEIGHT = 32; constexpr int SCALE = 10; constexpr int FPS = 60; constexpr int TICKS_PER_FRAME = 1000 / FPS; constexpr int INSTRUCTIONS_PER_STEP = 10; constexpr std::array<SDL_Keycode, 16> keymap{ SDLK_x, SDLK_1, SDLK_2, SDLK_3, // 0 1 2 3 SDLK_q, SDLK_w, SDLK_e, SDLK_a, // 4 5 6 7 SDLK_s, SDLK_d, SDLK_z, SDLK_c, // 8 9 A B SDLK_4, SDLK_r, SDLK_f, SDLK_v}; // C D E F void sdl_error() { std::cerr << "SDL has encountered an error: "; std::cerr << SDL_GetError() << "\n"; SDL_Quit(); exit(1); } void init_sdl(SDL_Window*& window, SDL_Texture*& texture, SDL_Renderer*& renderer) { if (SDL_Init(SDL_INIT_VIDEO) < 0) { sdl_error(); } window = SDL_CreateWindow("chip8", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, WIDTH * SCALE, HEIGHT * SCALE, SDL_WINDOW_SHOWN); if (window == nullptr) { sdl_error(); }
{ "domain": "codereview.stackexchange", "id": 35571, "lm_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, simulation, sdl", "url": null }
quantum-mechanics, angular-momentum, quantum-spin, lie-algebra, spinors \begin{align} |\langle S_y, -1|\psi\rangle|^2 \end{align} Spinors. In the above context, spinors are simply the matrix representations of states of a particular spin system in a certain ordered basis, and the Pauli spin matrices are, up to a normalization, the matrix representations of the spin component operators in that basis specifically for a system with spin-$1/2$. Matrix representations often facilitate computation and conceptual understanding which is why we use them. More explicitly, suppose that one considers a spin-$1/2$ system, and one chooses to represent states and observables in the basis $B =(|S_z, -1/2\rangle, |S_z, 1/2\rangle)$ consisting of the normalized eigenvectors of the $z$ component of spin, then one would find the following matrix representations in that basis \begin{align} [S_x]_B &= \frac{\hbar}{2}\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} = \frac{\hbar}{2}\sigma_x\\
{ "domain": "physics.stackexchange", "id": 51273, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, angular-momentum, quantum-spin, lie-algebra, spinors", "url": null }
c++, mathematics, c++20 template <std::convertible_to<T> U, std::size_t S> requires (S <= N) constexpr vector& operator=(vector<U, S> const& rhs) noexcept { [this, &rhs]<std::size_t... I>(std::index_sequence<I...>) noexcept { ((data[I] = rhs.data[I]), ...); }(std::make_index_sequence<S>{}); return *this; } // move operators template <std::convertible_to<T> U, std::size_t S> requires (S <= N) constexpr vector(vector<U, S> &&rhs) noexcept { [this, rhs = std::move(rhs)]<std::size_t... I>(std::index_sequence<I...>) noexcept { ((data[I] = std::exchange(rhs.data[I], U(0))), ...); }(std::make_index_sequence<S>{}); }
{ "domain": "codereview.stackexchange", "id": 40822, "lm_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++, mathematics, c++20", "url": null }
c#, design-patterns, socket, server, udp var s = new PacketState(socket, 256) { Destination = new IPEndPoint(new IPAddress(ipAddress), 11000) }; socket.BeginReceiveFrom( s.Buffer, 0, s.Buffer.Length, SocketFlags.None, ref remoteEndPoint, new AsyncCallback(ReceivedData), s); } private static void OnSend(IAsyncResult result) { Socket socket = (Socket)result.AsyncState; socket.EndSendTo(result); } } } First things first: you should check out C# naming guidelines and try to follow those. I'm leaning towards converting all of the IDatagram implementations in to structs Don't. You should read this page, which explains when you should use struct and when you shouldn't. The relevant part is: AVOID defining a struct unless the type has all of the following characteristics:
{ "domain": "codereview.stackexchange", "id": 19003, "lm_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#, design-patterns, socket, server, udp", "url": null }
phase, dsp-core, pll, electrical-signal If the system is sampled and the product is done in discrete time, the sampling rate must be high enough to support the double frequency component above as otherwise it can alias to be within the bandwidth of the subsequent low pass filter. Sampling at an even higher frequency will only provide more samples in the determining the mean (which is the purpose of the low pass filter), so will not be detrimental to the result other than needlessly increasing filter complexity to achieve the same cutoff frequency. Here is a simulation using the OP's parameters demonstrating in simplest form the desired result and operation: Python code: Fs = 64*10**6 N = 2048 f = 100000 t = np.linspace(0, (N-1)/Fs,N) amp = 1 phase = np.pi/4 y = amp * (np.sin( f * 2 * np.pi* t) ) z = amp * (np.sin(f * 2 * np.pi * t+ phase) ) x = y * z print(f"Actual phase : {phase:0.3f}") print(f"Measured phase: {np.arccos(2*np.mean(x)):0.3f}")
{ "domain": "dsp.stackexchange", "id": 11915, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "phase, dsp-core, pll, electrical-signal", "url": null }
java, programming-challenge, stream, lambda private static void printDuplicate(String line) { int length = Integer.parseInt(line.split(";")[0]); int total = Arrays.stream(line.split(";")[1].split(",")) .mapToInt(Integer::parseInt) .sum(); System.out.println(total - (length - 1) * (length - 2) / 2); } } This ended up shorter than I expected. Is this best? I was thinking of doing it my way as well, but the boolean comparison requires a for loop (am I wrong?). I like the way you have solved this, and cannot think of any serious criticisms. The most significant thing I can think of is the double-duty method printDuplicate. I would prefer that method to be just findDuplicate and then print the value outside the function. That makes the function more reusable. Other trivials are: new File(args[0]).toPath() should be: Paths.get(args[0]) Finally, I would expect the 'expected' value to be a simpler algorithm. The code: (length - 1) * (length - 2) / 2
{ "domain": "codereview.stackexchange", "id": 12191, "lm_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, programming-challenge, stream, lambda", "url": null }
electricity, particle-accelerators Title: Linear particles accelerator Why in a linear accelerator is used an AC voltage? Wouldn't it work with a constant electric field? (Image Source: <https://commons.wikimedia.org/wiki/File:Linear_accelerator_animation_16frames_1.6sec.gif> - Author: Chetvorno, CC0, via Wikimedia Commons) DC fields where used in early accelerators, such as Van de Graaff generators and pelletrons. The LHC accelerates protons to 7 TeV. How are you going to create and maintain a 7,000,000,000 volt DC field?
{ "domain": "physics.stackexchange", "id": 67889, "lm_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, particle-accelerators", "url": null }
c++, game infile >> in; while (in != "Player:") { infile >> x >> y; infile >> in; map[x][y].setName(in); infile.ignore(1000, '\n'); getline(infile, in); map[x][y].setDescription(in); while (true) { if (infile.peek() == '\n') break; else { infile >> in2; if (in2 == "null") break; map[x][y].addItem(in2); } } infile.ignore(1000, '\n'); getline(infile, in); map[x][y].setHint(in); infile >> numIn; map[x][y].setActions(numIn); infile >> in; map[x][y].setEmpty(false); } //Load player data infile >> x >> y; player.setLocation(x,y); infile >> numIn; player.setHealth(numIn); infile >> numIn; player.setMaxHealth(numIn); infile >> numIn; player.setMana(numIn); infile >> numIn; player.setMaxMana(numIn); while (true) {
{ "domain": "codereview.stackexchange", "id": 37347, "lm_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", "url": null }
homework-and-exercises, newtonian-mechanics I am just wondering if you can think of forces as length? Calculate them just like a length, like any length, M, Cm and so on. I managed to the exercise by doing exactly this. MG on ball = 441 newton which means the Y-component of T (String is equal to 441N as well). I then used this component and the length to find the tension in the String, just like finding the length of the sida a triangle. 441N/Cos(20 degrees) = 470N in the string. And then I did exactly the same for the other part of the string which was equal to 160N. The string pushes upwards with a force of 470N and the ball pushes to the right with a force of 160N.
{ "domain": "physics.stackexchange", "id": 23639, "lm_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", "url": null }
Christopher A. 7 Hernando, Antonio 7 Logar, Alessandro 7 Pfister, Gerhard 7 Torrente, Maria-Laura 7 Villarreal, Rafael Heraclio 7 Zanello, Fabrizio 6 Bernardi, Alessandra 6 Bruns, Winfried 6 Constantinescu, Alexandru 6 Harbourne, Brian 6 Orecchia, Ferruccio 6 Peterson, Chris 6 Recio, Tomas 6 Römer, Tim 6 Sharifan, Leila 5 Boffi, Giandomenico 5 Guida, Margherita 5 Mirò-Roig, Rosa Maria 5 Murai, Satoshi 5 Niesi, Gianfranco 5 Pech, Pavel 5 Sommen, Franciscus 5 Thoma, Apostolos 5 Zhu, Guangjun 4 Barile, Margherita 4 Beltrametti, Mauro C. 4 Bertone, Cristina 4 Charalambous, Hara 4 Chiantini, Luca 4 Crupi, Marilena 4 Domokos, Mátyás 4 Fassino, Claudia 4 Fatabbi, Giuliana 4 Fontana, Roberto 4 Hauenstein, Jonathan D. 4 Idà, Monica 4 Jayanthan, A. V. 4 Jiang, Zhaolin 4 Laita, Laura 4 Lorenzini, Anna 4 Maruri-Aguilar, Hugo 4 Mehta, Dhagash 4 Nanduri, Ramakrishna 4 Nguyen Cong Minh 4 Palezzato, Elisa 4 Perdon, Anna-Maria 4 Puthenpurakal, Tony J. 4 Roanes-Macías, Eugenio 4 Sommese, Andrew John 4
{ "domain": "zbmath.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9732407199191508, "lm_q1q2_score": 0.8001879349383775, "lm_q2_score": 0.8221891239865619, "openwebmath_perplexity": 6619.9250412216215, "openwebmath_score": 0.24322541058063507, "tags": null, "url": "https://zbmath.org/software/143" }
quantum-mechanics, mathematical-physics, perturbation-theory Title: How to carry out the perturbation expansion of an anharmonic oscillator to high orders? I think this is a standard problem in quantum mechanics. Consider the anharmonic oscillator $E \psi = \left(- \frac{1}{2} \frac{\partial^2}{\partial^2 x } + \frac{1}{2}x^2 + \epsilon x^4 \right) \psi$. Formally, the ground state energy has the asymptotic expansion $E(\epsilon) \sim \sum_{n=0}^\infty a_n \epsilon^n$. How to calculate the coefficients $a_n$ to high orders, say, for $n= 20$? As mentioned in the comments by Bubble, this is answered in Ground State Energy Calculations for the Quartic Anharmonic Oscillator, Robert Smith. Notes for Math 4901, University of Minnesota, Morris (2013).
{ "domain": "physics.stackexchange", "id": 24820, "lm_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, mathematical-physics, perturbation-theory", "url": null }
python, beginner, simulation, physics def generate_test_spectrum() -> Tuple[ np.ndarray, # w np.ndarray, # E_in np.ndarray, # E_out ]: """ Testing the finite_sample_transmission_xuv function """ w = np.linspace(start=0, stop=1, num=300) chi_0 = (1 + 1j) * np.sin(5 * np.pi * w)**2 chi_sin = np.sin(1 * np.pi * w) chi_sin2 = chi_sin**2 chi_nd = (1 + 1j) * np.outer(chi_sin2, chi_sin2.T) E_in = gaussian_spectrum(w=w, E0=1, w_0=0.5, sigma=0.1) E_out = finite_sample_transmission_xuv( w=w, chi_0=chi_0, chi_nd=chi_nd, E_in=E_in, a=1, N=1e8, tau=0, ) return w, E_in, E_out def test_plot() -> None: w, E_in, E_out = generate_test_spectrum() fig = plt.figure() fig.suptitle('Finite Sample Transmission XUV (Gaussian test)') grid = fig.add_gridspec(nrows=2, ncols=2)
{ "domain": "codereview.stackexchange", "id": 41443, "lm_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, simulation, physics", "url": null }
linear-systems, adaptive-filters So, what I think is that the right after the microphone symbol in the diagram is my echoed voice x_echo[n] On the bottom line at the speakers, only my original voice should be present since that's what's meant to be going through the speakers - so x[n].
{ "domain": "dsp.stackexchange", "id": 7033, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "linear-systems, adaptive-filters", "url": null }
the package provides the following functionality: kdevine (): Multivariate kernel density estimation based on vine copulas. Kernel density estimation of 100 normally distributed random numbers using different smoothing bandwidths. The smoothing method of spectral density estimation is called a nonparametric method because it doesn't use any parametric model for the underlying time series process. The kernel function acts as our weighting function, assigning less mass to observations farther from. zip Unzip the file into a directory on the matlab path. density(x, nout = 201, xout = NULL, na. While a more generic API could be designed for handling this vector-to-raster pipeline, the initial implementation will branch off to a heatmap specific. stats library class kde for the kernel density estimation: from scipy. NASA Technical Reports Server (NTRS) Macready, William G. The code fragment computes the kernel density estimate with the plug-in bandwidth matrix ^ = []. Download the source
{ "domain": "gemsnroll.de", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9808759654852754, "lm_q1q2_score": 0.8195057291394147, "lm_q2_score": 0.8354835452961425, "openwebmath_perplexity": 845.7672518412246, "openwebmath_score": 0.5653823018074036, "tags": null, "url": "https://gemsnroll.de/kernel-density-estimation-code.html" }
power-spectral-density As was indicated in the comments already, the specification calls out a specific bandwith to ensure repeatability. Specifications are used to validate implementations as conforming to an existing standard. This particular scheme for measuring the emission mask of a transmitter implementation is likely in use because that was the one that was chosen when the standard was designed. Due to the imprecise definitions of concepts like SNR and bandwidth, there are many ways that you could define such a requirement, but this is the one that the authors chose. That doesn't make it right or wrong; it just is.
{ "domain": "dsp.stackexchange", "id": 841, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "power-spectral-density", "url": null }
robotic-arm, mechanism Title: What is meant by the phrase "movement positional jitter"? I was searching online for the meaning of this statement but the closest I came across is that jitter here refers to some sort of "deviation". Therefore, if we say that the movement positional jitter of a robotic arm gripper is within $5\%$ to minimize wear on the arm then what is meant by this statement? We can think of "jitter" as a fairly quick, fairly small perturbation upon the intended controlled behavior. A semi-quantitative design guideline (like "within 5%") needs a numerator and denominator. An arm that is supposed to move 20 cm allowing 1 cm wobble (5% of the distance) sounds pretty sloppy. A controller that overshoots by 5% might be acceptable if it settles down to an accurate, repeatable position. It's hard to be more specific with something so general. Many things could present as jitter, with different causes, hence different ways to mitigate them. Here are a few. underdamped servoing
{ "domain": "robotics.stackexchange", "id": 2458, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "robotic-arm, mechanism", "url": null }
optics, visible-light, electromagnetic-radiation, optical-materials, glass Any photon has certain frequency - which for visible light is related to the colour of light, whilst for lower or upper frequencies in the electromagnetic spectrum it is simply a measure of the energy transported by photon. A material's absorption spectrum (which frequencies are absorbed and how much so) depends on the structure of the material at atomic scale. Absorption may be from atoms which absorb photons (remember - electrons go to upper energetic states by absorbing photons), from molecules, or from lattices. There are important differences in these absorption possibilities:
{ "domain": "physics.stackexchange", "id": 59593, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "optics, visible-light, electromagnetic-radiation, optical-materials, glass", "url": null }
fluid-dynamics, navier-stokes, turbulence viscosity, beside damping smallest scales of turbulence, could trigger instability that can evolve in turbulent flows or regions in the flow. As an example, think as pipe flows, stable in the inviscid limits, unstable for viscous flows (you can have a look at historically noteworthy criteria of stability criteria for oarallel flows, as the Rayleigh, Fjortroft crieteria, and Orr-Sommerfeld equations); or you can think at boundary transition to turbulent regime in real-life flows on solid boundaries at high Reynolds number; in a very extreme case, you can compare the results of a Euler and Navier-Stokes numerical simulation of an airfoil at large angle of incidence: with Euler inviscid equations you have no separation, while with Navier-Stokes taking into account viscosity influence you have large separation regions, turbulent at large Reynolds number;
{ "domain": "physics.stackexchange", "id": 90792, "lm_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, turbulence", "url": null }
that is de ned for x2R there are three basic steps in solving the problem by the Fourier transform: (1)Apply the Fourier transform to the equation and to the given conditions to transform the problem. 324 B Tables of Fourier Series and Transform of Basis Signals Table B. How to determine and display the two dimensional fourier transform of a thin, rectangular object? The object should be 2 by 10 pixels in size and solid white against a black background. Spatial Transforms 8 Fall 2005 2-D Convolution •Alternatively, we can write for a Wx×Wy window, -which emphasizes that the convolution is a weighting of local pixels 1. We now look at the Fourier transform in two dimensions. View and Download PowerPoint Presentations on Fourier Transform Properties PPT. Lecture 2 2d Fourier Transforms And S. Fourier Transform Theorems; Examples of Fourier Transforms; Examples of Fourier Transforms (continued) Transforms of singularity functions. 17, 2012 • Many examples here are taken from the textbook.
{ "domain": "mpl-bauen.de", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9908743628803028, "lm_q1q2_score": 0.8361940220815403, "lm_q2_score": 0.8438951025545426, "openwebmath_perplexity": 618.223011256596, "openwebmath_score": 0.8325456380844116, "tags": null, "url": "http://fpri.mpl-bauen.de/2d-fourier-transform-examples-and-solutions.html" }
javascript, jquery, playing-cards // This function use JQuery lib function makeCardDealer(_card, _holeCard) { // .card is created in the template card css class var card = $(".card.templateDealer").clone(); card.removeClass("templateDealer"); // .cardFace is created in the template card css class // It will search for this css class and add the content aka innerHTML card.find(".dealerCardFace").html(_card.face); // .suit is created in the template card css class // It will search for this css class and add the content aka innerHTML card.find(".dealerCardSuit").html("&" + _card.suit + ";"); // &spades; -> ♠, &clubs; -> ♣, &hearts; -> ♥, &diams; -> ♦ // more char, https://www.w3schools.com/charsets/ref_utf_symbols.asp // hearts and diamonds are red color. otherwise, default black color. if (_card.suit === "hearts" || _card.suit === "diams") { card.addClass("red"); } if (_holeCard) { card.addClass("holeCard"); }
{ "domain": "codereview.stackexchange", "id": 35048, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, jquery, playing-cards", "url": null }
rust println!("Commute summary:"); println!(" abcdefghijklmnopqrstuvwxyz"); let empty: HashSet<char> = HashSet::new(); for a in 'a'..='z' { print!("{}:", a); let commset = state.single_commutes.get(&a).unwrap_or(&empty); let mut in_center = true; for b in 'a'..='z' { if a == b { print!("\\"); } else if commset.contains(&b) { print!("#"); } else { print!(" "); in_center = false; } } if in_center { print!(" (*)"); } println!(); } println!(); println!("Leftover facts:"); for fact in state.facts { println!(" {}={}", fact.lhs, fact.rhs); } }
{ "domain": "codereview.stackexchange", "id": 43862, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rust", "url": null }
pcl, cmake Title: CMake search path ROS installation somehow sets CMake the search path to point to favor ROS packages in /opt/ros. I want find_package(PCL) to choose the version in /usr/lib rather than /opt/ros/groovy (The ROS version is missing all of the Grabber stuff) How can I prevent this behavior? Is there some environment variable I need to set? Originally posted by joschu on ROS Answers with karma: 131 on 2013-06-06 Post score: 0 CMake uses the environment variable CMAKE_PREFIX_PATH to specify the search path for all find_*() commands. Originally posted by Dirk Thomas with karma: 16276 on 2013-06-10 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by joschu on 2013-06-13: What variable or file does ROS modify when it gets installed, which adds it to the front of the search path? CMAKE_PREFIX_PATH is unset on my machine. Comment by Dirk Thomas on 2013-06-13: When you source the setup.bash/sh these environment variables will be set.
{ "domain": "robotics.stackexchange", "id": 14452, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "pcl, cmake", "url": null }
algorithms, computer-vs-human, human-computing Title: Why can I look at a graph and immediately find the closest point to another point, but it takes me O(n) time through programming? Let me clarify: Given a scatterplot of some given number of points n, if I want to find the closest point to any point in the plot mentally, I can immediately ignore most points in the graph, narrowing my choices down to some small, constant number of points nearby. Yet, in programming, given a set of points n, in order to find the closest point to any one, it requires checking every other point, which is ${\cal O}(n)$ time. I am guessing that the visual sight of a graph is likely the equivalent of some data structure I am incapable of understanding; because with programming, by converting the points to a more structured method such as a quadtree, one can find the closest points to $k$ points in $n$ in $k\cdot\log(n)$ time, or ammortized ${\cal O}(\log n)$ time.
{ "domain": "cs.stackexchange", "id": 2878, "lm_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, computer-vs-human, human-computing", "url": null }
cc.complexity-theory, complexity-classes, oracles Do we have any easy conditions to decide if $\mathsf{L^O}$ and $\mathsf{O}$ are in fact the same? For easy conditions it means we only have to check some properties about $\mathsf{O}$, then we can decide if they are equal, without using definitions of the classes to prove the inclusion $\mathsf{L^O} \subseteq \mathsf{O}$. Another related question would be:
{ "domain": "cstheory.stackexchange", "id": 425, "lm_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, complexity-classes, oracles", "url": null }
friction, gazebo-9 Original comments Comment by Raskkii on 2018-05-11: Have you set intertias for your gripper parts? Also if you look at this tutorial: http://gazebosim.org/tutorials?tut=simple_gripper - they have set no mu1 or mu2 at all. You could try that if everything else fails. Comment by raequin on 2018-05-14: Thanks for your input. Yes, the gripper parts have inertial values. I cleared all the collision properties I'd set (mu1, mu2, kp, kd, min_depth, and max_vel). This made things a little better (the cone gets picked up at least) but the grasp is unstable as shown in the top animation. Comment by Raskkii on 2018-05-15: What happens when you have the cylinder roll off the block for example? Does it roll off naturally or jump all over the place? Trying to see if it's the gripper causing the problems or the cylinder. Comment by RobotBoy on 2020-04-09:
{ "domain": "robotics.stackexchange", "id": 4263, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "friction, gazebo-9", "url": null }
c#, strings Title: StringTokenizer for .NET Core Splitting a string in tokens is a more complex topic than String.Split() wants to make us believe. There are at least three common policies according to which a string might be interpreted and split in tokens. Policy 1: Equivalent to String.Split() There is not much to mention about this policy. Given a string s and a delimiter d, break s into segments delimited by d. The main drawback here is that if the delimiter is part of at least one of the tokens, reconstructing the desired tokens might be costly. Policy 2: Escape special characters A character is declared as the escape character e (commonly the backslash \) resulting in the character following it losing its special meaning. A token string then might look like this: token_1 token_2 very\ long \ token which would be equivalent to { "token_1", "token_2", "very long token" } Policy 3: Place tokens in quotation marks
{ "domain": "codereview.stackexchange", "id": 39395, "lm_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#, strings", "url": null }
roslaunch Originally posted by joq with karma: 25443 on 2012-03-29 This answer was ACCEPTED on the original site Post score: 0 Original comments Comment by prince on 2012-03-29: edited original question. Comment by prince on 2012-03-31: Appending the path did not help. It is still giving same error Comment by joq on 2012-03-31: Maybe there is something wrong with your $PYTHONPATH, then. Comment by prince on 2012-03-31: What PYTHONPATH shall point to? In my understanding, this tells where to look for python. What else? Comment by tfoote on 2012-04-01: Your python path needs to have roslib/src, typical setup scripts say: export PYTHONPATH=${ROS_ROOT}/core/roslib/src:${PYTHONPATH} Comment by prince on 2012-04-02: thanks a lot tfoote. it did work now. I was struggling with this for long time. I even installed diamondback a fresh but this problem persisted.
{ "domain": "robotics.stackexchange", "id": 8786, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "roslaunch", "url": null }
numerator or both contain fractions. In cases that involve simple numbers, addition and subtraction of fractions is easy … In complex fractions either or both the numerator and the denominator contain fractions or mixed numbers. After doing so, we can expect the problem to be reduced to a single fraction which can be simplified as usual. The following calculator can be used to simplify ANY expression with complex numbers. Apply the division rule of fractions by multiplying the numerator by the reciprocal or inverse of the denominator. Complex fractions aren't necessarily difficult to solve. When possible reduce, simplify and convert to mixed numbers, any final fraction results. This lesson is also about simplifying. There are two methods used to simplify such kind of fraction. This means we have to work a bit on the complex numerator. In this method of simplifying complex fractions, the following are the procedures: Generate a single fraction both in the denominator and the numerator.
{ "domain": "zynotsoft.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9674102580527665, "lm_q1q2_score": 0.8627471501242396, "lm_q2_score": 0.8918110418436166, "openwebmath_perplexity": 656.9784341071735, "openwebmath_score": 0.8443188667297363, "tags": null, "url": "https://zynotsoft.com/gene-tunney-ebib/b51e80-simplifying-complex-numbers-fractions" }
bond, molecular-orbital-theory, theoretical-chemistry By assuming that the HOMO is anti-bonding (it is not!) and taking away one electron, the bond order has to increase to 3.5. This is wrong. When we have a look at the MO diagram, a calculated version can be found here, we know that the HOMO, i.e. 3σ, is a bonding orbital, while the anti-bonding orbital is the 2σ. Upon ionisation, we would indeed remove one bonding electron and therefore the bond order has to decrease to 2.5 as you suggested.
{ "domain": "chemistry.stackexchange", "id": 7300, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "bond, molecular-orbital-theory, theoretical-chemistry", "url": null }
• Note that every even integer $\,k\ge 4\,$ has form $\,4+2n,\, n\ge 0,\,$ including $\,k = 100!\,$ in the OP. Indeed $\,k\ge 4\,\Rightarrow\, k = 4+N,\ N\ge 0,\,$ and $\,k\,$ even $\,\Rightarrow\, N\,$ even, so $\,N = 2n.\ \ \$ Jan 25, 2020 at 17:45 • Further, said law is in fact a convenient operational form of CRT, as explained in the linked post. Jan 25, 2020 at 18:10 • Or: $\ \ \underbrace{{5^{\large 4}}\mid 15^{\large 2N}}_{\textstyle 4\le 2N}\Rightarrow\, 15^{\large 2N}\!\bmod 5^{\large 4}\cdot 8\,=\, 5^{\large 4}\underbrace{\left[\dfrac{\color{#0a0}{15}^{\large 2N}}{\color{#c00}{5^{\large 4}}}\bmod 8\right]}_{\textstyle \color{#0a0}{15}\equiv-1,\ \color{#c00}{5^{\large 2}}\!\equiv 1}\!\! =\, 5^{\large 4}$ $\ \ \$ Jan 25, 2020 at 22:26 Well $$100!$$ has so many divisors it's obvious that $$\phi(5000)|100!$$[1] so for any $$a$$ where $$\gcd(a,5000)=1$$ or for any $$k|5000$$ where $$\gcd(a,k) = 1$$ that $$a^{100!} \equiv 1\pmod {5000\text{ or } k}$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9796676454700793, "lm_q1q2_score": 0.8032229717753341, "lm_q2_score": 0.8198933337131076, "openwebmath_perplexity": 229.6562649012663, "openwebmath_score": 0.8368672728538513, "tags": null, "url": "https://math.stackexchange.com/questions/3521965/find-15100-bmod-5000-using-elementary-number-theory" }
observational-astronomy, units, interferometry Title: How are people converting intensities in Janskys to Kelvin? I'm reading some ALMA proposals and I am often seeing a conversion from Jy to Kelvin when, for example, people quote noise levels or source flux. For example on their sensitivity calculator (https://almascience.nrao.edu/proposing/sensitivity-calculator) 1 mJy is equivalent to around 1 K when the angular resolution is 1". I can tell it somehow depends on the resolution because it won't give me a conversion unless I enter a resolution. What's happening under the hood here? And why does their documentation treat sensitivities entered in Kelvin differently from when they're entered in Jy? Is this an interferometry thing?
{ "domain": "astronomy.stackexchange", "id": 2214, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "observational-astronomy, units, interferometry", "url": null }
recurrence-relation I have seen there is a closed-form for this recurrence but I am unsure whether it can be used out of the blue or not. I don't know if I have to prove it by deriving it from the recurrence or if there are simpler ways of solving such a problem by mere substitution. On the other hand, I think substitution is not the right tool to use here. I have tried with both reverse and forward substitution, but in neither approach I could determine the function as with other problems (e.g. QuickSort). Is it possible to solve this problem with only substitution at all? If so, how can I devise it? You can use induction. First, check directly that $P(n) \geq 2^{n-2}$ for all $n \leq 4$ (the relevant values are $1,1,2,5$). Now suppose that $P(n) \geq 2^{n-2}$ holds for all $n \leq m$, where $m \geq 4$. Then $$ P(m+1) = \sum_{k=1}^m P(k) P(m+1-k) \geq \sum_{k=1}^m 2^{k-2} 2^{m+1-k-2} \geq m 2^{m+1-4} \geq 2^{m+1-2}, $$ since $m \geq 4$.
{ "domain": "cs.stackexchange", "id": 6671, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "recurrence-relation", "url": null }
magnetism Is it just this, or is there another part to it, like charged iron atoms inducing a dipole in $\ce{O2}$ or something? First of all, in your question i feel a confusion about the nature of magnetism and paramagnetism. These magnetic interactions have nothing to do with attraction/repulsion of electric charges, and magnets do not attract or repel Coulomb charges (when we discuss the magnetic part of the interaction). In short static, magnetic and electric properties are two different stories. Second, iron is ferrOmagnetic and not ferrImagnetic (capitalisation is by me). Forget ferrimagnetic materials for a second, and let's just talk about ferromagnetic, paramagnetic and diamagnetic materials:
{ "domain": "chemistry.stackexchange", "id": 1657, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "magnetism", "url": null }
quantum-mechanics, electromagnetism, electrons, potential-energy how can relativistic effects (Heisenberg uncertainty principle) shift the energy level to lower kinetic energy (from s to d) without the electron actually moving to the higher energy (d orbital) level? How can an s orbital electron's energy level shift closer to a d orbital electron's energy level without moving to that higher energy level as per QM and change the absorption frequency? I understand that electrons do not orbit in a classical way, I understand they are existing around the nucleus at a certain energy level as per QM. It doesn't look like it.
{ "domain": "physics.stackexchange", "id": 50588, "lm_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, electromagnetism, electrons, potential-energy", "url": null }
By choosing the new basis $$[P_0,P_1,\ldots,P_{n-1}]$$ carefully, one can arrange that the basis-changed matrix is lower triangular. Concretely column$$~j$$ of$$~M$$, which describes $$f(P_{j-1})$$ (since we number columns from$$~1$$), has as entries $$(P_{j-1}[x_1],P_{j-1}[x_2],\ldots,P_{j-1}[x_n])$$, so lower-triangularity means that $$x_i$$ is a root of $$P_{j-1}$$ whenever $$i. This can be achieved by taking for $$P_k$$ the product $$(X-x_1)\ldots(X-x_k)$$, which is monic of degree $$k$$. Now the diagonal entry in column$$~j$$ of$$~M$$ is $$P_{j-1}[x_j]=(x_j-x_1)\ldots(x_j-x_{j-1})$$, and $$\det(V_n)$$ is the product of these expressions for $$j=1,\ldots,n$$, which is $$\prod_{j=1}^n\prod_{i=1}^{j-1}(x_j-x_i)=\prod_{1\leq i.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.982823294006359, "lm_q1q2_score": 0.8556432767399386, "lm_q2_score": 0.870597270087091, "openwebmath_perplexity": 672.4633188289199, "openwebmath_score": 0.9721505045890808, "tags": null, "url": "https://math.stackexchange.com/questions/525334/vandermonde-determinant-by-induction" }
php, design-patterns $codeBase->checkoutFromRepository(1); // Roll back to the second commit echo $codeBase->getCode(); // Prints: "First day code Second day code Third day code" After a bit of experimenting, I get there I'm also a self-taught programmer, but I've been at if for 33 years. I've seen a lot of things, but I never heard of a Memento design pattern. So, eventhough it is quite clear from your explanation and code what it is, the first thing to to is to look up what it exactly is. Here for instance: https://sourcemaking.com/design_patterns/memento There are just too many fancy names for these things, but I understand what they get at. I think we can also agree that you've tried to make the absolute simplest implementation of this design pattern; Just keeping track of one string, nothing more. Let us discuss the code, starting from the beginning, which is your last piece of source code.
{ "domain": "codereview.stackexchange", "id": 13241, "lm_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, design-patterns", "url": null }
c++, performance, c++11, array, template-meta-programming Features Currently, the class has the following features: Compile-time specification of the element type and number of dimensions, (Copy|Move) (constructor|assignment), Same iterators as std::array. They iterate over the underlying 1D data array, A clone() method, The ability to (access|assign) cells using either an index "tuple" (think variadic templates, not std::tuple) with operator() or at() or a "linear" index (actual index in the underlying 1D data array) with operator[], typedefs (templated usings, actually) for dimensions 1 to 9 (it's totally arbitrary. orca_array defines a maximum of 7), Pretty Printing to std::ostream with an overloaded operator<< Concerns
{ "domain": "codereview.stackexchange", "id": 16369, "lm_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, c++11, array, template-meta-programming", "url": null }
quantum-field-theory, phase-space, scattering-cross-section Any help is highly appreciated! The dependence on one of the momentum variables is easily cancelled by virtue of the dirac delta which ensures conservation of 4-momentum. In general, the modulus square of the amplitude will depend on the momentum of the particles involved in the process but what one does is the integrate first on one of the output momenta, as you say. If we consider the process with momenta $p_1,p_2 \rightarrow p_3,p_4$, then the integration on $p_3$, for example, goes something like this $$\int |M(p_1,p_2,p_3,p_4)|\delta(p_1+p_2-p_3-p_4)\,\mathrm{d}^4p_3\,\mathrm{d}^4p_4 = \int |M(p_1,p_2,\color{red}{p_4-p_1-p_2},p_4)|)\,\mathrm{d}^4p_4\tag{1}$$ and only then, if possible, one proceeds with the second integration. Of course, in realty, the calculation is more difficult than what is portrayed in equation $(1)$, but the concept is the same.
{ "domain": "physics.stackexchange", "id": 78481, "lm_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, phase-space, scattering-cross-section", "url": null }
programming-languages, type-theory, dependent-types, inductive-datatypes, homotopy-type-theory I tried thinking about the case of $Fin : Nat \to Set$ (the integers less than a certain value). I think that both $Fin (x + y)$ and $Fin (y + x)$ have no inhabitants however because the standard constructors for them have no constructors that unify with $x + y$ or $y + x$. So they both have no inhabitants but what does that mean about their equivalence? This seemed like a bad case to think about to me. My main question is the following: how does one think about the equivalence between these two types?
{ "domain": "cs.stackexchange", "id": 4582, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "programming-languages, type-theory, dependent-types, inductive-datatypes, homotopy-type-theory", "url": null }
quantum-mechanics, angular-momentum, atomic-physics, quantum-spin, spectroscopy Is this because $m_l$ and $m_s$ are bad quantum numbers, that we need $J$ to determine the energy levels? Or is it something else that I'm missing ? Is this because $m_l$ and $m_s$ are bad quantum numbers, that we need $J$ to determine the energy levels?
{ "domain": "physics.stackexchange", "id": 81553, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, angular-momentum, atomic-physics, quantum-spin, spectroscopy", "url": null }
c#, .net, asp.net-core public RequestArgumentsBuilder<T> Method(HttpMethod httpMethod) { _args.Method = httpMethod; return this; } public RequestArgumentsBuilder<T> Endpoint(string endpoint) { Guard.Against.NullOrWhiteSpace(endpoint, nameof(endpoint)); _args.Endpoint = endpoint; return this; } public RequestArgumentsBuilder<T> WithParameters(IEnumerable<KeyValuePair<string, string>> parameters) { if(parameters != null) _args.Parameters = parameters; return this; } public RequestArgumentsBuilder<T> WithContent(HttpContent content) { if(content != null) _args.Content = content; return this; }
{ "domain": "codereview.stackexchange", "id": 42426, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, .net, asp.net-core", "url": null }
We have seen that several of the sets associated with a matrix are subspaces of vector spaces of column vectors. Specifically these are the null space (Theorem NSMS), column space (Theorem CSMS), row space (Theorem RSMS) and left null space (Theorem LNSMS). As subspaces they are vector spaces (Definition S) and it is natural to ask about bases for these vector spaces. Theorem BNS, Theorem BCS, Theorem BRS each have conclusions that provide linearly independent spanning sets for (respectively) the null space, column space, and row space. Notice that each of these theorems contains the word “basis” in its title, even though we did not know the precise meaning of the word at the time. To find a basis for a left null space we can use the definition of this subspace as a null space (Definition LNS) and apply Theorem BNS. Or Theorem FS tells us that the left null space can be expressed as a row space and we can then use Theorem BRS.
{ "domain": "runestone.academy", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9908743631497862, "lm_q1q2_score": 0.8006930924813145, "lm_q2_score": 0.8080672204860316, "openwebmath_perplexity": 365.6440636151513, "openwebmath_score": 0.9681013226509094, "tags": null, "url": "https://runestone.academy/ns/books/published/fcla/section-B.html" }
astrophysics In the case of mercury where M = 3.285 × 10^23 kg or 0.055 M⊕ the total radiated power by hawking radiation is 3.3×10^-15 watts Note: It is inversely proportional to the mass Step 2: Now we have to convert the total radiated power to the mass of the energy, via the mass-energy equivalence equation which is $E = mc^2$ and since we want to find out the mass not energy we have to do: $M = e/c^2$ and by plugging in our value of e we get the mass losing per second = 3.672×10^-32 kilograms per second Step 3: Now all we have to do is divide the total mass of the body by mass losing per second in order to find out the total evaporation time, which in this case is $3.285 × 10^23 kg/3.672×10^-32 kg/s$. Voila! Via this method we find out the total evaporation time of a black hole of the mass of mercury is 8.946×10^54 seconds or 2.1*10^37 gigayears or the lifetime of the universe (13.8 billion years)
{ "domain": "astronomy.stackexchange", "id": 6968, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "astrophysics", "url": null }
quantum-algorithms, quantum-gate, quantum-state, teleportation \end{align*} So after Alice measures her qutrits, whatever is inside the parenthesis is the state that Bob holds. However, I don't wee what operations can be used multiple times to "fix" the output. It seems to me that Alice could communicate to Bob with one trit which two coefficients need to be transposed, and use one trit to tell Bob how to fix the remaining $w$'s. That doesn't seem to fit the desired protocol though, making me doubt the computations that I have performed above. If anyone could help me out (or point out a better approach), it would be appreciated. Thanks! I tested this out in Quirk by embedding each qutrit into two qubits, and I get a simular result to you, where in addition to the cyclic shift fixup and the phasing operation you need to transpose states 1 and 2. Presumably there's some simple change to the circuit that fixes this, such as picking a different F, but I did't check too hard to see if it was possible. Here's the circuit (and in the simulator itself):
{ "domain": "quantumcomputing.stackexchange", "id": 384, "lm_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, quantum-gate, quantum-state, teleportation", "url": null }
special-relativity, cosmology, time, planets, radioactivity Title: Does the Earth's revolution around the Sun affect radioactive decay? Premises: The radioactivity is either hastened or slowed inside a fast moving aircraft. Speed of fastest aircraft: 3,529.6 km/h. The earth's revolution is: 107278.87 km/h. The earth's revolution is significantly higher than the speed of moving aircraft. Questions: Are all the premises correct and if not, which part is not correct? Does this mean that the earth's revolution affects modern dating methods? Sources:
{ "domain": "physics.stackexchange", "id": 4676, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "special-relativity, cosmology, time, planets, radioactivity", "url": null }
crystal-structure, cheminformatics where the first two lines give the two lattice vectors (in some basis), while the next two give the positions of the atoms in the unit cell. I have tried using Open Babel for this, converting from the CIF format to a VASP one. This works well for the example above, but fails for a material such as tin sulfide (SnS), which has a structure similar to black phosphorus---four atoms in a unit cell, only two of which are explicitly listed in the CIF file. The positions of the other two are implied by the symmetry group, and programs such as Mercury correctly visualize the structure based on the CIF file. However, converting the CIF into VASP only gives you two of the four unit cell atoms. I tried all other formats in Open Babel, with no success. Is there a reliable way to convert a CIF file into a description in terms of a Bravais lattice plus atom basis vectors? You can use Open Babel. You just need to "fill" the unit cell (i.e., generate all the symmetric atoms).
{ "domain": "chemistry.stackexchange", "id": 3356, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "crystal-structure, cheminformatics", "url": null }
# Finding Ellipse Axes Consider the following ellipse, generated by the bounding region of the following points ps = {{-11, 5}, {-12, 4}, {-10, 4}, {-9, 5}, {-10, 6}}; rec = N@BoundingRegion[ps, "FastEllipse"]; Graphics[{rec, Red, Point@ps}] We have that the ellipse 'rec' is given in the form Ellipsoid[{-10.4, 4.8}, {{2.77333, 0.853333}, {0.853333, 1.49333}}] How can I retrieve the lengths of the two main axes of such ellipsoid? Following this representation and Mathematica's general definition of Ellipsoid I tried the following, using the eigenvalues of rec[[2]] eigs = Eigenvectors[Inverse[rec[[2]]]] eigv = Eigenvalues[Inverse[rec[[2]]]]; lens = 2/Sqrt[eigv] Out[]= {2.06559, 3.57771} where the 2 factor comes from the fact what what I retrieve from the eigenvalues is actually half the length of the main axis. Indeed we get
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9632305297023093, "lm_q1q2_score": 0.8515336153340314, "lm_q2_score": 0.8840392710530071, "openwebmath_perplexity": 4270.224787556017, "openwebmath_score": 0.3861517608165741, "tags": null, "url": "https://mathematica.stackexchange.com/questions/257623/finding-ellipse-axes" }
quantum-mechanics, wavefunction, schroedinger-equation, quantum-tunneling Evanescent waves also occur in accoustics although the physics is a little different since acoustic waves are longitudinal. Nevertheless, the physics here also involves reflection and transmission at a boundary. Mathematically, if $E<V$ then the coefficient of $\psi$ on the right hand side of $$ \psi^{\prime\prime}(x)=\frac{2m}{\hbar^2}(V-E)\psi(x) $$ is positive so the solution are exponentials rather than sines or cosines. There is no “loss of energy” as the energy of the solution is fixed. Roughly speaking, as in optics, the wave “doesn’t propagate” in the forbidden region. In the optics case the lack of propagation of the wave implies lack of energy, but this explanation does not work well for QM as the energy is fixed (as mentioned above).
{ "domain": "physics.stackexchange", "id": 95744, "lm_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, wavefunction, schroedinger-equation, quantum-tunneling", "url": null }
graphs, type-theory, dependent-types In JavaScript, all types are dynamic, so it's easy to just say "A graph is a list of nodes and a list of edges", because the language doesn't ever require that you formally specify what a node or an edge looks like. It doesn't care, and if you make a mistake, it will just crash at runtime. Notice that your JavaScript version of a graph doesn't actually specify how nodes and edges are represented. What does an edge look like? If you insert an edge as a 2-element array, but try to access it as an object, you will have a runtime error. Haskell and Coq's definitions try to solve this issue with type safety. They have a formal definition of the different forms a Graph can take, so that you always know at compile-time which operations on it are valid or not. Let's look at the versions and their tradeoffs: data Graph a = Empty | Vertex a | Overlay (Graph a) (Graph a) | Connect (Graph a) (Graph a)
{ "domain": "cs.stackexchange", "id": 11732, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "graphs, type-theory, dependent-types", "url": null }
cryptography, security, encryption Title: Key secrecy vs Algorithm secrecy it's a well known statement that "Cryptographic security must rely on a secret key instead of a secret algorithm." I would like to ask about some details about it. And which are their differences? I see the obvious thing that for a multi user system, generating a key is overwhelmingly easier than generating a distinct alghorithm for every user pair, (and even for a single pair of users one could argue that updating the key is easier) But, Is it the only argument? I mean, if we define AlgorithmA = AlgorithmX + key A AlgorithmB = AlgorithmX + key B Then a change on the key is not different from a change in the algorithm. The only different I see is that for a new pair of users/keys Most of the Algorithm structure remains constant in the case of secret key, Most of Algorithm structure need to change in the case of secret Algorithm
{ "domain": "cs.stackexchange", "id": 217, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cryptography, security, encryption", "url": null }
Just for fun here is a way to modify your approach to get the correct answer as suggested by @ArsenBerk in a comment. Assuming you want to choose the $1$ boy first in $\binom{15}{1}$ ways, then we must break the remaining choices from $31$ students into cases where $k=0,1,\ldots, 6$ remaining boys from $14$ are chosen and $6-k$ girls are chosen from $17$. For each $k$ this may be done in $\binom{14}{k}\binom{17}{6-k}$ ways. However each of these cases must be divided by the number of equivalent ways that $1$ of the $k+1$ chosen boys can be selected first, there are clearly $\binom{k+1}{1}$ of these so dividing each term by this, summing and multiplying this sum by the initial $\binom{15}{1}$ term gives: $$\binom{15}{1}\sum_{k=0}^{6}\binom{14}{k}\binom{17}{6-k}/\binom{k+1}{1}\tag{Answer}$$ which you can confirm equals $\binom{32}{7}-\binom{17}{7}$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9845754483707558, "lm_q1q2_score": 0.8161528030357418, "lm_q2_score": 0.8289388125473629, "openwebmath_perplexity": 310.09551449501174, "openwebmath_score": 0.8594229221343994, "tags": null, "url": "https://math.stackexchange.com/questions/2651512/number-of-ways-of-choosing-seven-children-from-a-classroom-of-32-15-boys-17-gi/2651553" }
java, csv, homework Title: Analyzing baby name data in CSV files First time using code review. I am still a student so there will be a lot to be desired. Basically as part of the homework we are told what methods to create (Method names are given with their parameters). We essentially are parsing a bunch of files or raw CSV data looking for either specific names at a rank, names at a specific rank, total births, etc. The code does exactly what it is meant to and works but I feel it could seriously be improved if not minimised somehow. Feel free to be as harsh as possible, I am looking for serious feed back. Examples of the CSV data would be: 2012(Test CSV File) Sophia,F,10 Emma,F,9 Isabella,F,8 Olivia,F,7 Ava,F,6 Jacob,M,8 Mason,M,7 Ethan,M,7 Noah,M,6 William,M,5 2013 (Test CSV file) Sophia,F,10 Emma,F,8 Olivia,F,8 Isabella,F,7 Ava,F,6 Noah,M,12 Liam,M,9 Jacob,M,8 Mason,M,8 William,M,7
{ "domain": "codereview.stackexchange", "id": 43271, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, csv, homework", "url": null }
c++ int main() { translateWord(Language::english, Language::polish, "Hello"); return 0; } Demo but the fact that order of word should be identical is error prone IMO. having a struct struct translated_word { std::string polish; std::string ukrainian; std::string german; std::string english; std::string norwegian; std::string chinese; }; seems a grouping less error prone.
{ "domain": "codereview.stackexchange", "id": 42614, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++", "url": null }
quantum-field-theory, group-representations, lattice-model Title: One-Plaquette Action and SU(2)'s Irreducible Representations I have a typical single-plaquette partition function for a gauge-field $$ Z=\int [d U_{\text{link}}] \exp[-\sum_{p} S_{p}(U,a)]$$ with $U$ as the product of the the $U$'s assigned to each link around a plaquette. Now the $U$'s are irreducible representations of my group elements, which in my case is SU(2), and lets take the 1/2 representation as an example, then define the character as $\Xi_{r}\equiv \text{Tr}[U]$ which for our case is $\Xi_{1/2}=\text{Tr}[U]$. Now I have to take the product of these representations, however (and here's my question), how do I know which group elements/that-element's-representation to assign to each link? I'm not sure how to compute the Trace without knowing first how to do the product of the link's representations, but I don't even know how to assign the elements to the links. Thanks, I'm not completely sure what OP is asking(v1). However here is my interpretation. OP asks:
{ "domain": "physics.stackexchange", "id": 3538, "lm_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, group-representations, lattice-model", "url": null }
java, programming-challenge, playing-cards // A backward lexicographical comparison of card ranks. for (int i=myReorderedCards.size(); i-->0; ) { final Rank myRank = myReorderedCards.get(i).rank(); final Rank otherRank = otherReorderedCards.get(i).rank(); result = Integer.compare(myRank.value(), otherRank.value()); if (result!=0) return result; } return 0; } @Override public String toString() { return Joiner.on(' ').join(cards); } private static <E> ImmutableMultiset<Integer> histogram(Multiset<E> multiset) { final List<Integer> result = Lists.newArrayList(); for (final Multiset.Entry<E> e : multiset.entrySet()) result.add(e.getCount()); return ImmutableMultiset.copyOf(result); } HandValue toHandValue() { for (final HandValue v : HAND_VALUES) { if (v.apply(this)) return v; } throw new RuntimeException("Impossible: " + cards); }
{ "domain": "codereview.stackexchange", "id": 13362, "lm_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, programming-challenge, playing-cards", "url": null }
electromagnetism The fact that magnetically induced EMF is non-conservative is the basis of countless claims of perpetual motion machines, so it is good to say early that you can't do this. Magnetic fields that are changing give rise to non-conservative forces, the integral around a loop is the change in flux inside, but the process of extracting energy from the EMF reduces the magnetic field, and the amount of energy stored in it. Feynman discusses transformers and the EMF around a loop. He also discusses something else even more counterintuitive and not at all discussed by other people. He shows two moving charges, A and B, so that A is moving perpendicular to the line joining A and B and B is moving along the line joining A and B.
{ "domain": "physics.stackexchange", "id": 91115, "lm_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", "url": null }
deep-learning, research, papers, academia Title: How does publishing in the deep learning world work, with respect to journals and arXiv? Let's say I implemented a new deep learning model that pushed some SOTA a little bit further, and I wrote a new paper about for publication. How does it work now? I pictured three options:
{ "domain": "ai.stackexchange", "id": 1989, "lm_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, research, papers, academia", "url": null }
electromagnetism, electric-circuits Title: Can we double the electric energy? If I have $x$ amount of electrical energy and convert that into mechanical energy using an AC Motor, and then convert that energy back into electric using an AC generator, will the amount of energy remain about the same? If yes, then since the number of coils is proportional to the magnetic field and the magnetic field is proportional to the current.
{ "domain": "physics.stackexchange", "id": 16926, "lm_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", "url": null }
This is essentially fine, although you are tacitly assuming that $$c$$ itself is a member of the partition, $$P$$. This isn't a big deal though - a $$P$$ such that $$U(P,f)-L(P,f)<\epsilon$$ is guaranteed by integrability, and you can always just add $$c$$ to this partition if it is not already there. Namely, if $$P_{c}$$ is this new partition, called a refinement of $$P$$, one must have $$U(P_{c},f)-L(P_{c},f)\leq U(P,f)-L(P,f)<\epsilon$$ and you can proceed as you have done in your proof. An alternative approach is given by Lebesgue's Criterion for Riemann Integrability, which states that Riemann/Darboux Integrability is equivalent to boundedness plus continuity up to a null set (see Wikipedia for a good explanation of null sets). Since your functions is integrable on $$[a,b]$$, it is bounded and continuous up to a null set on $$[a,b]$$, and hence, on $$[a,c]$$ and $$[c,b]$$ as well.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9956005865761918, "lm_q1q2_score": 0.8558817271067747, "lm_q2_score": 0.8596637433190939, "openwebmath_perplexity": 117.69271930193221, "openwebmath_score": 0.9292044043540955, "tags": null, "url": "https://math.stackexchange.com/questions/3016686/riemann-darboux-integrability-of-subinterval" }
atomic-physics, spectroscopy If you know approximately where the resonance is to within a bandwidth of $\sim \Omega$, then Ramsey can be used to more precisely find the resonance (ultimately limited by the longest gap time $T$ that can be used). If you don't have any idea where the resonance is, then you can first find it by applying an approximate $\pi$ pulse over a wider range of frequencies and finding which frequency gives the largest population transfer.
{ "domain": "physics.stackexchange", "id": 74564, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "atomic-physics, spectroscopy", "url": null }
python, python-3.x, strings def delete(self, root_obj: Any, obj: Any) -> Any: """Delete object's attribute.""" delattr(obj, self._index.get(root_obj)) @dataclasses.dataclass class Item: _index: "Path" def get(self, root_obj: Any, obj: Any) -> Any: """Index object.""" return obj[self._index.get(root_obj)] def set(self, root_obj: Any, obj: Any, value: Any) -> Any: """Set object's index to value.""" obj[self._index.get(root_obj)] = value def delete(self, root_obj: Any, obj: Any) -> Any: """Delete object's index.""" del obj[self._index.get(root_obj)] @dataclasses.dataclass class Literal: _index: Any def get(self, root_obj: Any, obj: Any) -> Any: """Get literal value.""" return self._index def set(self, root_obj: Any, obj: Any, value: Any) -> NoReturn: """Unable to change a literal, the path is misconfigured.""" raise TypeError("Can't set to a literal")
{ "domain": "codereview.stackexchange", "id": 37783, "lm_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, strings", "url": null }
You could keep increasing the value of $$m$$ for the expression $$\left(\frac1{n(n+1)}\right)^m$$ for positive number $$m$$ to increase the accuracy of the bound! Try it yourself! Question 1: Prove the partial fraction $$\left ( \frac1{n(n+1)} \right)^2 \equiv \left ( \frac 1{n^2} + \frac1{(n+1)^2} \right) - 2 \left (\frac1n -\frac1{n+1}\right)$$. And determine the value of $$\displaystyle \sum_{n=1}^\infty \left ( \frac1{n(n+1)} \right)^2$$. Thus show that $$\pi > 3$$. Question 2: Given that $$\displaystyle \sum_{n=1}^\infty \frac1{n^4} = \frac{\pi^4}{90}$$ and find the partial fraction of $$\left(\frac1{n(n+1)}\right)^5$$, prove that $$\pi^2 < \frac32 \left(\sqrt{1729}-35\right)$$. Consider the example given and the answer you've found, can you determine a systematic way to increase the upper bound of $$\pi^2$$? Question 3: Suppose we restrict $$m$$ (as mentioned above) to an odd number, why does the accuracy of the upper bound increases when the number $$m$$ increases?
{ "domain": "brilliant.org", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9859363713038173, "lm_q1q2_score": 0.8014354469958493, "lm_q2_score": 0.8128673110375458, "openwebmath_perplexity": 536.9941980520126, "openwebmath_score": 0.9429739117622375, "tags": null, "url": "https://brilliant.org/discussions/thread/fun-ways-to-find-the-upper-bounds-of-pi2-using/" }
nlp, word-embeddings, one-hot-encoding int32_t FastText::getSubwordId(const std::string& subword) const { int32_t h = dict_->hash(subword) % args_->bucket; return dict_->nwords() + h; } void FastText::getSubwordVector(Vector& vec, const std::string& subword) const { vec.zero(); int32_t h = dict_->hash(subword) % args_->bucket; h = h + dict_->nwords(); addInputVector(vec, h); } Long story short, FastText makes use of integer IDs assigned at the beginning and use those IDs to access the embeddings. I hope this helps. All the code samples are taken from FastText repo. Feel free to dive in to understand more.
{ "domain": "datascience.stackexchange", "id": 7040, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "nlp, word-embeddings, one-hot-encoding", "url": null }
c#, asp.net I wonder if it's necessary to change it as below, being afraid of values are changed by bad users: protected void GrvList_SelectedIndexChanged(object sender, EventArgs e) { // change to EditView FrmaddEditUsers.ActiveViewIndex = 1; // Get Username from gridview and display in txtbox string ToBeEditedUser = GrvList.DataKeys[GrvList.SelectedIndex].Value.ToString(); UserName.Text = HttpUtility.HtmlEncode(ToBeEditedUser); } Since you are taking data from the user and passing it straight back, I would go with the encoded method. Also, on the serverside, since you are separating out the acquisition of the data from its reuse it should help with debugging.
{ "domain": "codereview.stackexchange", "id": 1546, "lm_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#, asp.net", "url": null }
$$\ln (1+\cos x )=\ln( 2\cos^2\frac{x}{2})=\ln2+2\ln\cos\frac{x}{2}$$ And this $$\ln2$$ adds together with the arbitrary constant $$c$$ in indefinite integral and gets cancelled in definite integral. • Thank you so much! This makes perfect sense! – Seigemann Aug 12 at 11:58 • You're welcome! – Ak19 Aug 12 at 11:58 As Ben suggested in comments, it's always good to check an integral by taking the derivative: $$\dfrac d {dx} \ln(1+\cos x)=\dfrac{-\sin x}{1+\cos x}=\dfrac{-2\sin\dfrac x2 \cos \dfrac x2}{2\cos^2\dfrac x2}=\dfrac{-\sin\dfrac x2}{\cos \dfrac x2}=\dfrac d {dx} 2 \ln \cos \dfrac x2$$ • N.B. The expressions are undefined when $x=\pi$ – J. W. Tanner Aug 12 at 13:11 $$1+\cos \, x=2\cos^{2}(\frac x 2)$$ so $$\ln (1+\cos \, x)=2 \ln (\cos (\frac x 2))+\ln 2$$ . Also, $$-\tan (\frac x 2)$$ is same as $$-\frac {\sin \, x} {1+\cos \, x}$$ because $$\sin \,x =2 \sin (\frac x 2)\cos (\frac x 2)$$ and $$1+\cos \, x=2\cos^{2}(\frac x 2)$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9719924777713886, "lm_q1q2_score": 0.8682900257680929, "lm_q2_score": 0.89330940889474, "openwebmath_perplexity": 354.44910860580154, "openwebmath_score": 0.8150451183319092, "tags": null, "url": "https://math.stackexchange.com/questions/3320950/integrating-int-frac-sin-x1-cos-x-dx-i-get-ln1-cos-x-wolfr" }
periodic-trends N(2856) < O(3388) = F(3374) < Ne(3952). where all numbers are in kJ/mol. The inclusion of neon in this sequence indicates that the second ionization of fluorine is indeed lowered by the favorable half-filled shell configuration. But this effect is only enough to balance one additional nuclear charge in the same period comparing fluorine with oxygen. With fluorine versus nitrogen, the larger difference in nuclear charge (two instead of one) wins out.
{ "domain": "chemistry.stackexchange", "id": 17382, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "periodic-trends", "url": null }
textbook, lesson plans, widgets, interactive Demonstrations, and more. A complex symmetric matrix diagonalizable ,Write this as M=A+iB, where both A,B are real and A is positive definite. If the Learn what a symmetric matrix is. Is it useful in some way? 119-134, 1990. But if you know or can prove that it has an inverse, you can diagonalise your matrix (any symmetric real-valued matrix is diagonalisable … Schaum's Outline of Theory and Problems of Matrices. To see a definition, select a term from the dropdown text box below. A is a symmetric 2 × 2 matrix. For example, the matrix. A positive definite matrix is a symmetric matrix where every eigenvalue is positive. is a unitary matrix. Two examples of Unlimited random practice problems and answers with built-in Step-by-step solutions. may be obtained from, A matrix is symmetric if BOOK FREE CLASS Nash, J. C. "Real Symmetric Matrices." A matrix that has only real entries is Hermitian if and only if it is symmetric. A. Sequence
{ "domain": "ericlowitt.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9559813513911654, "lm_q1q2_score": 0.8253862797627046, "lm_q2_score": 0.8633916117313211, "openwebmath_perplexity": 440.82724691647195, "openwebmath_score": 0.7352793216705322, "tags": null, "url": "http://www.ericlowitt.com/site/what-is-symmetric-matrix-7b0aea" }
collections, vba, type-safety, vb6 The correct code should be: Private Function IsReferenceType() As Boolean If this.ItemTypeName = vbNullString Then Exit Function IsReferenceType = IsObject(this.Encapsulated(1)) End Function In these snippets: Private Function IsComparable() As Boolean If IsReferenceType Then IsComparable = TypeOf First Is IComparable End If End Function Private Function IsEquatable() As Boolean If IsReferenceType Then IsEquatable = TypeOf First Is IEquatable End If End Function It is assumed that only reference types can implement IComparable and IEquatable, and that is correct in VB6. Therefore, the presence of CompareValueTypes and EquateValueTypes functions is somewhat awkward, but their usage makes a quite enjoyable reading: If isRef Then '... isSmaller = CompareReferenceTypes(Item(i), smallest) < 0 '... Else '... isSmaller = CompareValueTypes(Item(i), smallest) < 0 '... End If
{ "domain": "codereview.stackexchange", "id": 20273, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "collections, vba, type-safety, vb6", "url": null }
Prove or disprove: either (ar + s) or (ar - s) is irrational If s is rational, then this is false. (I might go through the process of proving this) If s is irrational then I have no idea how to prove this. I would assume only if s = ar + n or s = n - ar for some rational number n will either (ar + s) or (ar - s) be rational. Otherwise, it is irrational. 8. Originally Posted by ecMathGeek This is the only part of the thorem that is as of yet unjustified. I don't know how to prove this. It is trivial. Let, P(n) = an^2+bn+c And, x = y (mod z) & Then, x^2 = y^2 (mod z) Thus, ax^2 = ay^2 (mod z) * Using & again we find that, bx = by (mod z) ** And, c = c (mod z) *** Adding * and ** and *** we get: ax^2+bx+c = ay^2+by+c (mod z) Thus, P(x) = P(y) (mod z) Now prove it for the n>2 case. Again trival. 9. Originally Posted by Jhevon let r be a rational number let a be an irrational number let s be a real number Prove or disprove: either (ar + s) or (ar - s) is irrational
{ "domain": "mathhelpforum.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9711290955604489, "lm_q1q2_score": 0.8348444857562116, "lm_q2_score": 0.8596637559030337, "openwebmath_perplexity": 760.9893787106698, "openwebmath_score": 0.8931063413619995, "tags": null, "url": "http://mathhelpforum.com/number-theory/12889-solved-easy-number-theory-question-you-guys-not-me.html" }
the following categories: Indexing and length operations apply, isDefinedAt, length, indices, and lengthCompare. Pointwise and Uniform Convergence 1. Sequences and Patterns Limits and Convergence. We are introduced to Sequences in Calculus with discussions about Series following in subsequent lessons. The following geometric sequence calculator will help you determine the nth term and the sum of the first n terms of an geometric sequence. It's denoted as an infinite sum whether convergent or divergent. How can I find out if 1/n! is divergent or convergent? I cannot solve it using integral test because the expression contains a factorial. It is useful to consider the more general case. Example: "n^2" What is Sigma? This symbol (called Sigma) means "sum up" It is used like this: Sigma is fun to use, and can do many clever things. The sequence is said to be convergent, in case of existance of such a limit. Let's consider that we have points in sequence along with a point L is known as the
{ "domain": "macchiaelettrodomestici.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9905874087451302, "lm_q1q2_score": 0.8276194740974071, "lm_q2_score": 0.8354835391516132, "openwebmath_perplexity": 354.85524078365097, "openwebmath_score": 0.86317378282547, "tags": null, "url": "http://jaye.macchiaelettrodomestici.it/sequence-calculator-convergence.html" }
particle-physics, lagrangian-formalism, quantum-spin, field-theory Also, if you expanded the Proca equation you'd find it's similar to 4 Klein-Gordon equations. The intuition being that both Lagrangians describe bosons, but the additional spin-1 information in the Proca equation (which corresponds to boson polarisation) is hidden inside of four boson fields. In short, the equations are interconnected, but describe different physics from each other, so a ''master equation'' is usually not talked about. Perhaps some BSM/SUSY/ST person might disagree however.
{ "domain": "physics.stackexchange", "id": 78661, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "particle-physics, lagrangian-formalism, quantum-spin, field-theory", "url": null }
apply the resulting integration formula to an example, and discuss reasons why this formula does not appear in calculus texts. Legendre's Equation. A curve C is defined by r  (iv). But, paradoxically, often integrals are computed by viewing integration as essentially an inverse operation to differentiation. Techniques of Integration 7. 1 Aug 2013 DIFFERENTIATION OF FUNCTIONS OF A SINGLE VARIABLE (4) Give an example of a function defined on [0,1] which has no maximum  You will see plenty of examples soon, but first let us see the rule: ∫u v dx u is the function u(x); v is the function v(x); u' is the derivative of the function u(x). 5 Fourier Series. y = 2 - 3x is a function 2. pdf), Text File (. (1) d dx. EasternOregonUniversity 1UniversityBlvd. In this section you will learn the following: • The notion of successive differentiation. com provides Maths Formulas, Mathematics Formulas, Maths Coaching Classes. Difference formulas for f ′and their approximation errors: Recall: f ′ x lim
{ "domain": "brian229.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9891815503903562, "lm_q1q2_score": 0.8285582199824016, "lm_q2_score": 0.8376199694135333, "openwebmath_perplexity": 830.7896849780968, "openwebmath_score": 0.876122772693634, "tags": null, "url": "http://brian229.com/8vpu/differentiation-formulas-and-examples-pdf.php" }
c++, game If the wumpus wakes he moves(p = .75) one room or stays still(p = .25).After that, if he is where you are, he eats you up and you lose!" Each turn you may move or shoot a crooked arrow. Moving: you can move one room(thru one tunnel). Arrows : you have 5 arrows.You lose when you run out.Each arrow can go from 1 to 3 rooms.You aim by telling the computer the rooms you want the arrow to go to.If the arrow can't go that way (if no tunnel) it moves at random to the next room.If the arrow hits the wumpus, you win.If the arrow hits you, you lose. Warnings When you are one room away from a wumpus or hazard, the computer says : Wumpus: "I smell the wumpus" Bat : "I hear a bat" Pit : "I feel a breeze" "Press any key to start")"; char c; std::cin.get(c); } std::vector<Room_number> select_rooms_to_shoot() { for(;;){ std::cout << "Enter the rooms you want to shoot the arrow (e.g. 2-3-12, e.g. 4-5, e.g. 2)\n";
{ "domain": "codereview.stackexchange", "id": 31439, "lm_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", "url": null }
crystal-structure, crystallography (credit) where the energy about an individual molecule is plot: often, there are multiple energetic minima, but only one global energetic minimum. For the solidification of a material, the situation is even more complex, because minimization of the energetic minimum comprises both the molecule in question, as well as its interactions with nearest molecules around. If the rate of crystallization is too high (e.g., just crushing out a compound as a precipitate), it may happen that the molecules in the solid state again found an energetic minimum, but not not the global one. Like maybe an alkyl group still is in gauch orientation to an other.
{ "domain": "chemistry.stackexchange", "id": 14778, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "crystal-structure, crystallography", "url": null }
javascript, userscript, firefox user_pref("security.ssl3.rsa_fips_des_ede3_sha", false); user_pref("security.ssl3.ecdh_rsa_aes_256_sha", false); user_pref("security.ssl3.ecdh_ecdsa_aes_256_sha", false); user_pref("security.ssl3.rsa_camellia_256_sha", false); user_pref("security.ssl3.ecdhe_rsa_aes_256_sha", true); user_pref("security.ssl3.ecdhe_ecdsa_aes_256_sha", true); user_pref("security.ssl3.ecdhe_ecdsa_aes_128_gcm_sha256", true); user_pref("security.ssl3.ecdhe_rsa_aes_128_gcm_sha256", true); user_pref("security.ssl3.dhe_rsa_camellia_256_sha", false); user_pref("security.ssl3.dhe_rsa_aes_256_sha", false); user_pref("security.ssl3.dhe_dss_aes_128_sha", false); user_pref("security.ssl3.dhe_dss_aes_256_sha", false); user_pref("security.ssl3.dhe_dss_camellia_128_sha", false); user_pref("security.ssl3.dhe_dss_camellia_256_sha", false);
{ "domain": "codereview.stackexchange", "id": 20225, "lm_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, userscript, firefox", "url": null }
astronomy, astrophysics, stars, nasa The upper limit is the smallest object that fuses hydrogen into helium. Above this limit, the dwarf would shine like a regular star e.g. the Sun. But below this limit, hydrogen will be fused, but not all the way to helium. So a little bit of energy is produced, but relatively little, because the real energy kick comes from the last step of the proton-proton chain, when two 3He atoms fuse into 4He and two protons. So if the core isn't hot enough for this step to happen, some energy is produced, but really not much.
{ "domain": "physics.stackexchange", "id": 3075, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "astronomy, astrophysics, stars, nasa", "url": null }
projectile * Technically superposition holds if and only if the equations are linear, so the one implies the other.
{ "domain": "physics.stackexchange", "id": 98602, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "projectile", "url": null }
programming, qiskit, hamiltonian-simulation, optimization Title: From QUBO matrix to Ising model in Qiskit Given a general QUBO matrix $Q$ for a quadratic minimization problem, is there a Qiskit way to obtain the Pauli gate list or the Ising model for it? A related question is Qiskit: Taking a QUBO matrix into `qubit_op', but it seems to be about a graph related model. The solution given there is also for a particular graph metric for the stable_set. I prepared this code based on Qiskit tutorial. Firstly, lets prepare a QUBO task. # Importing standard Qiskit libraries and configuring account from qiskit import QuantumCircuit, execute, Aer, IBMQ from qiskit.compiler import transpile, assemble from qiskit.tools.jupyter import * from qiskit.visualization import * #quadratic optimization from qiskit.optimization import QuadraticProgram from qiskit.optimization.converters import QuadraticProgramToQubo # Prepare QUBO task
{ "domain": "quantumcomputing.stackexchange", "id": 2449, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "programming, qiskit, hamiltonian-simulation, optimization", "url": null }
c, linked-list, generics, collections, macros scan = scan->prev; \ } \ } \ \ return scan; \ } \ \ FMOD SNAME##_node *PFX##_back_node(SNAME *_list_) \ { \ return _list_->tail; \ } \
{ "domain": "codereview.stackexchange", "id": 34160, "lm_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, linked-list, generics, collections, macros", "url": null }
java, algorithm, homework, hash-map public Dictionary() { this(DEFAULT_BUCKET_COUNT); } public Dictionary(int bucketCount) { this.bucketCount = bucketCount; ... create empty buckets ... } Bucket/Node Both of these can be static since they don't access the outer classes' members. You don't really need Bucket and may consider rewriting the code to remove it to see the difference. It's not a huge improvement but may simplify the code. As with Dictionary, add and contains make more sense than put and get. Be consistent with naming across methods. In Bucket, get takes in while put takes key, but in and key represent the same things and as such should use the same name: key. Also, stick with curr to avoid confusion with Node.next. @Czippers nailed this one: get and put should use the same looping construct since they're both walking the list in order and possibly stopping at some point.
{ "domain": "codereview.stackexchange", "id": 24238, "lm_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, homework, hash-map", "url": null }
thermodynamics, statistical-mechanics, temperature, equilibrium, spin-chains Title: Prove that negative absolute temperatures are actually hotter than positive absolute temperatures Could someone provide me with a mathematical proof of why, a system with an absolute negative Kelvin temperature (such that of a spin system) is hotter than any system with a positive temperature (in the sense that if a negative-temperature system and a positive-temperature system come in contact, heat will flow from the negative- to the positive-temperature system). Arnold Neumaier's comment about statistical mechanics is correct, but here's how you can prove it using just thermodynamics. Let's imagine two bodies at different temperatures in contact with one another. Let's say that body 1 transfers a small amount of heat $Q$ to body 2. Body 1's entropy changes by $-Q/T_1$, and body 2's entropy changes by $Q/T_2$, so the total entropy change is $$ Q\left(\frac{1}{T_2}-\frac{1}{T_1}\right). $$
{ "domain": "physics.stackexchange", "id": 93264, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "thermodynamics, statistical-mechanics, temperature, equilibrium, spin-chains", "url": null }
newtonian-mechanics, newtonian-gravity, orbital-motion, celestial-mechanics Please give me the real physics behind it? What you are missing is that Earth speed is varying along its orbit, contrary to a circular one. More precisely, at any point of the orbit, the acceleration of the Earth has a component tangent to the orbit, and a component perpendicular to the orbit. For a circular orbit, the former is always zero, and the latter is therefore exactly equal to the gravitational force, i.e. a centripetal acceleration. That was in an inertial frame, so now if we take a frame rotating along with the Earth, that's the picture you had in mind: the centrifugal force, which is opposite to the centripetal acceleration in the inertial frame, compensates the gravitational force.
{ "domain": "physics.stackexchange", "id": 43475, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-mechanics, newtonian-gravity, orbital-motion, celestial-mechanics", "url": null }