text stringlengths 49 10.4k | source dict |
|---|---|
c#, design-patterns, unity3d
void OnCollisionEnter2D(Collision2D collision)
{
if (collision.gameObject.tag != "Platform")
return;
if (collision.contacts[0].normal.y > 0)
{
_onGroundStatus = OnGroundStatus.OnGround;
}
else
{
if(col... | {
"domain": "codereview.stackexchange",
"id": 18290,
"lm_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, unity3d",
"url": null
} |
statistical-mechanics, probability
Thanks a lot. One way to sidestep all these pesky issues is to write it not as $f(x)$ or $p(\epsilon)$. Instead, they are $\frac{\mathrm d P}{\mathrm d x}$ and $\frac{\mathrm d P}{\mathrm d \epsilon}$, where $P$ is the cumulative probability distribution function.
This is particularl... | {
"domain": "physics.stackexchange",
"id": 94483,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "statistical-mechanics, probability",
"url": null
} |
homework-and-exercises, charge, potential-energy, capacitance, dielectric
The constant charge situation is easier and let the capacitor and the dielectric be the system.
If the dielectric moves a distance $\Delta x$ the work done is $F \Delta x$ and the change in potential energy of the system is $\Delta U$ so $F\De... | {
"domain": "physics.stackexchange",
"id": 59118,
"lm_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, charge, potential-energy, capacitance, dielectric",
"url... |
ros, gazebo, ros2, camera
<gazebo reference="link_5">
<material>Gazebo/Orange</material>
</gazebo>
<gazebo reference="camera_link">
<sensor type="camera" name="camera1">
<update_rate>30.0</update_rate>
<camera name="head">
<horizontal_fov>1.3962634</horizontal_fov>
<image>
... | {
"domain": "robotics.stackexchange",
"id": 38295,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, gazebo, ros2, camera",
"url": null
} |
Ex 4.8.19 For $$k\not= 0$$ and $$c \neq 0$$ show that $$y^2 -x^2 =k$$ is orthogonal to $$yx =c$$. In the case where $$k$$ and $$c$$ are both zero, the curves intersect at the origin. Are the curves $$y^2 -x^2 =0$$ and $$yx=0$$ orthogonal to each other?
Ex 4.8.20 Suppose that $$m\neq 0$$. Show that the family of curves... | {
"domain": "libretexts.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9957353645484887,
"lm_q1q2_score": 0.8021964590638407,
"lm_q2_score": 0.8056321866478979,
"openwebmath_perplexity": 132.11453500192312,
"openwebmath_score": 0.916492760181427,
"tags":... |
c++, c++14, logging
Title: Simple log writer class I've written a simple log writing class. My code is also hosted on my Github.
Specifically, I am looking for criticism on these items:
Resource management. What is a more correct/safe way to obtaining a hold to stream-like objects?
Clarity. Is my code as clear as it ... | {
"domain": "codereview.stackexchange",
"id": 23063,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++14, logging",
"url": null
} |
ros, colcon
Originally posted by alberto on ROS Answers with karma: 100 on 2022-03-14
Post score: 0
Regarding VS IDE, I noticed that colcon build creates some .vcxproj files in the build folder, but I think I should't touch them (!SEE EDIT!).
So I was tired of searching and I decided to install VS Code.
Then, in orde... | {
"domain": "robotics.stackexchange",
"id": 37502,
"lm_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, colcon",
"url": null
} |
javascript, jquery, performance, html, validation
self.validate = function (form) {
var elements = form.elements;
var status = true;
var element, validate, types, result, //create variables outside the loop
i, j;
for (i = 0; i < elements.length; i++) {
element = ... | {
"domain": "codereview.stackexchange",
"id": 5973,
"lm_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, performance, html, validation",
"url": null
} |
javascript, jquery, html
$("select[name=banner_type] option[value=13]").show();
// OTHER
$("select[name=banner_type] option[value=1]").hide();
$("select[name=banner_type] option[value=3]").hide();
$("select[name=banner_type] option[value=5]").hide();
$("select[name=banner_type] ... | {
"domain": "codereview.stackexchange",
"id": 7851,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, jquery, html",
"url": null
} |
python, tkinter
load.py:
import pandas as pd
df = pd.read_csv('data.csv',index_col=0)
df1 = pd.read_csv('data.csv')
elements = df1['Element'].values.tolist()
types = sorted(list(set(df1['Type'].values.tolist())))
def read(element: str):
data = df.loc[element]
return data | {
"domain": "codereview.stackexchange",
"id": 42692,
"lm_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, tkinter",
"url": null
} |
c++, file
} You could add state to the reader: e.g. have a std::string variable target outside of the loop, read the lines in a while loop and...
while (getline(file, line)) {
if (line=="enemy" || line=="player") {
target=line; // remember where to put things
}
else {
const std::string::size_type p=line.... | {
"domain": "codereview.stackexchange",
"id": 25798,
"lm_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++, file",
"url": null
} |
neural-networks, reference-request, terminology, philosophy, books
Title: Is there a recent book that covers the theoretical and philosophical aspects of artificial intelligence? What are some recent books that introduce AI and neural networks while also discussing the related philosophical issues, like epistemology a... | {
"domain": "ai.stackexchange",
"id": 2901,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neural-networks, reference-request, terminology, philosophy, books",
"url": null
} |
or Depth first Search is a recursive algorithm for searching all the vertices of a graph or tree data structure. Give a linear algorithm to compute the chromatic number of graphs where each vertex has degree at most 2. Complexity The time complexity of BFS is O(V + E), where V is the number of nodes and E is the number... | {
"domain": "solotango.it",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9702398991698342,
"lm_q1q2_score": 0.9075105082061864,
"lm_q2_score": 0.9353465147977104,
"openwebmath_perplexity": 1105.8471170780324,
"openwebmath_score": 0.5393127202987671,
"tags": ... |
filters, fourier-transform, convolution, frequency-response, impulse-response
Title: Discrete Time Fourier Analysis Suppose we're given the following:
$ x[n] = 2 + (-1)^n $, and are given the impulse response $ h[n] = u[n] a^n $, of an LTI system where $ |a| < 1$. We're asked to find the output $y[n]$, if $x[n]$ is i... | {
"domain": "dsp.stackexchange",
"id": 7320,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "filters, fourier-transform, convolution, frequency-response, impulse-response",
"url"... |
c++, iterator, c++17
template <typename DataT, bool Reverse>
ArrayIterator<DataT, Reverse>::operator const_iterator() const
{
using type = const std::remove_const_t<DataT>;
return ArrayIterator<type, Reverse>(reinterpret_cast<type*>(_ptr), _unit);
}
template <typename DataT, bool Reverse>
ArrayIterator<DataT,... | {
"domain": "codereview.stackexchange",
"id": 30206,
"lm_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++, iterator, c++17",
"url": null
} |
java, algorithm, reinventing-the-wheel, stack, mergesort
The sort() methods structure falls into three cases size is 1, size is 2, and size is greater than 2. It would help readability to extract the second and third case as separate methods :
public static <E extends Comparable<? super E>> void sort(final Stack<E> st... | {
"domain": "codereview.stackexchange",
"id": 19796,
"lm_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, reinventing-the-wheel, stack, mergesort",
"url": null
} |
classification, regression, data
Title: Why isn't all data periodic? Let's say we have 2 classes (-1 and 1), 1 feature (x), and an arbitrary amount of data points.
Why can't we always find a frequency and phase that fit a sine wave or a square wave to our data points? When graphed, as frequency is increased, the sine ... | {
"domain": "datascience.stackexchange",
"id": 8798,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classification, regression, data",
"url": null
} |
c++, mathematics
int main() {
int thirdTerm;
int thirdLastterm;
int sum;
int total;
int constantNumber = 1;
int a = 0;
std::vector<int> vSeries;
while (std::cout << "Please enter the third term in the series: " && !(std::cin >> thirdTerm)) {
std::cin.clear(); //clear bad input ... | {
"domain": "codereview.stackexchange",
"id": 24375,
"lm_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",
"url": null
} |
signal-analysis, signal-power
"As sound pressure is a root-power quantity, the appropriate version
of the unit definition is used"
This leaves me confused. How do I determine whether I'm dealing with a power or root-power quantity, and what is their relation to RMS? Given that RMS means Root Mean Square the answer is... | {
"domain": "dsp.stackexchange",
"id": 10286,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "signal-analysis, signal-power",
"url": null
} |
electronic-configuration, atoms, ionization-energy
Title: Why does increasing subshell cause ionization energy to decrease? I know that increasing subshell decreases ionization energy; for example, going from Beryllium to Boron. I do not understand why this is.
The answer my textbook (Chemistry 2e on OpenStax) gives i... | {
"domain": "chemistry.stackexchange",
"id": 15841,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electronic-configuration, atoms, ionization-energy",
"url": null
} |
python, python-3.x, object-oriented, pdf
File = namedtuple("File", ["filename", "font_size", "line_height", "orientation"])
dataclasses might also be used to get a similar result.
Code duplication
There is a massive amount of duplicate code in generate_pdf. You could layout the document using a list and string forma... | {
"domain": "codereview.stackexchange",
"id": 34887,
"lm_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, object-oriented, pdf",
"url": null
} |
javascript, strings, array, sorting
Is this code readable enough?
Are there any other Design Patterns that could be applied? Any other points which could be improved? Sorting is hard.
console.log( sortArray([ '123', '9' , '1' , '11' ]) ); returns ["1", "9", "11", "123"], that does not sound good. After removing the... | {
"domain": "codereview.stackexchange",
"id": 20939,
"lm_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, strings, array, sorting",
"url": null
} |
quantum-gate, measurement, quantum-enhanced-machine-learning, swap-test
which one can rewrite as:
$$\frac{\mathrm{i}\sin\left(\theta_d\right)}{2}|1\rangle|\zeta\rangle|\psi\rangle-\frac{\mathrm{i}\sin\left(\theta_d\right)}{2}|1\rangle|\psi\rangle|\zeta\rangle+\frac{2\cos\left(\theta_d\right)-\mathrm{i}\sin\left(\theta... | {
"domain": "quantumcomputing.stackexchange",
"id": 3435,
"lm_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-gate, measurement, quantum-enhanced-machine-learning, swap-test",
... |
c++, concurrency, lock-free, atomic
long count()
{
return write_count.load(std::memory_order_relaxed) - read_count.load(std::memory_order_relaxed);
}
private:
// Separate into individual cache line.
__declspec(align(CACHE_LINE_SiZE)) std::atomic_long write_count;
why not use __declspec(align(C... | {
"domain": "codereview.stackexchange",
"id": 16260,
"lm_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++, concurrency, lock-free, atomic",
"url": null
} |
swift
ViewModel:
class BreachViewModel : BreachViewModelType {
var breaches = [BreachModel]()
init() {
// add init for ClosureHTTPManager here, to allow it to be teestable in the future
}
func fetchData(completion: @escaping ([BreachModel]) -> Void) {
ClosureHTTPManager.shared.get(url... | {
"domain": "codereview.stackexchange",
"id": 34217,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "swift",
"url": null
} |
javascript, unit-testing, node.js, promise, express.js
it('should return a 200 ok', () => {
return todo.findAll(request, response)
.then(() => {
expect(response.statusCode).to.equal(200);
}).catch((err) => {
... | {
"domain": "codereview.stackexchange",
"id": 23548,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, unit-testing, node.js, promise, express.js",
"url": null
} |
Oh, you're right. My mistake.
Title: Re: FE-P3
Post by: Meng Wu on April 11, 2018, 11:56:10 PM
Also for $(20)$, $\ln(e^x)$ can be simplified as $\ln(e^x)=x$.
Title: Re: FE-P3
Post by: Tim Mengzhe Geng on April 11, 2018, 11:57:57 PM
Also for $(20)$, $\ln(e^x)$ can be simplified as $\ln(e^x)=x$.
Thanks again and I will m... | {
"domain": "toronto.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668662546612,
"lm_q1q2_score": 0.8524640520247776,
"lm_q2_score": 0.8688267830311354,
"openwebmath_perplexity": 3963.8078734568635,
"openwebmath_score": 0.9062466025352478,
"tags": n... |
java, bloom-filter
/**
* The array holding the counts of each bucket.
*/
private final int[] array;
/**
* The array of hash functions.
*/
private final AbstractHashFunction[] hashFunctions;
/**
* Constructs a counting Bloom filter with array capacity {@code capacity}
* a... | {
"domain": "codereview.stackexchange",
"id": 15251,
"lm_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, bloom-filter",
"url": null
} |
If the numbers can be negative, then this conclusion no longer holds. For example, if $a_1=1$, $a_2=2$ and $b_1=b_2=-1$, then $\min(a_1,a_2)\min(b_1,b_2)=1\cdot(-1)=-1>-2=\min(-1,-2)=\min(a_1b_1,a_2b_2)$,
I am extremely grateful
Sarrah | {
"domain": "mathhelpboards.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9780517443658749,
"lm_q1q2_score": 0.8480058440227938,
"lm_q2_score": 0.8670357666736772,
"openwebmath_perplexity": 118.56513439330884,
"openwebmath_score": 0.9771186113357544,
... |
correlation coefficient is -1, it indicates a strong negative relationship. Thanks for contributing an answer to Cross Validated! Please be sure to answer the question. An r of +0. Correlation Covariance is a measure of the linear relationship between two variables, but perhaps a more com-mon and more easily interpreta... | {
"domain": "melandrisrl.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9854964220125032,
"lm_q1q2_score": 0.8212384090946907,
"lm_q2_score": 0.8333245973817158,
"openwebmath_perplexity": 690.1947899677858,
"openwebmath_score": 0.5935089588165283,
"ta... |
array, swift, ios
Sum of [0, 3, 5, 6, 9, 10, 12, 15, 18, 20, 21, 24, 25, 27, 30, 33, 35, 36, 39, 40, 42, 45, 48, 50, 51, 54, 55, 57, 60, 63, 65, 66, 69, 70, 72, 75, 78, 80, 81, 84, 85, 87, 90, 93, 95, 96, 99, 100, 102, 105] = 2625
Sum of [0, 3, 5, 6, 9, 10, 12, 15, 18, 20, 21, 24, 25, 27, 30, 33, 35, 36, 39, 40, 42, 4... | {
"domain": "codereview.stackexchange",
"id": 43729,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "array, swift, ios",
"url": null
} |
c++, object-oriented
Temperature(string, float, char);
This is confusing as a consumer of the class. You should give these parameters names:
Temperature(string patient, float temperature, char degree);
You have some non-optimal namings. For example, newPatient, newTemp, and newDegree don't really make sense. Why are... | {
"domain": "codereview.stackexchange",
"id": 19576,
"lm_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++, object-oriented",
"url": null
} |
python, classes, selenium
Because even though the browser and webpage get launched smoothly over here, back in test.py, driver still has to be defined so that it can be plugged into MainPage and SearchResults respectively:
driver = webdriver.Chrome # I use inert driver over here to avoid launching another empty browse... | {
"domain": "codereview.stackexchange",
"id": 41492,
"lm_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, classes, selenium",
"url": null
} |
# A simple method of factorization $2^{30}+1$
How can you factor $2^{30} + 1$? This task was supposed to be at one interview, there is an assumption that there should be a simple solution.
Observe that $$x^k+1=\frac{x^{2k}-1}{x^k-1}=\frac{\prod_{d\mid 2k}\Phi_{d}(x)}{\prod_{d\mid k}\Phi_{d}(x)}=\prod_{d\mid 2k,\ d\nm... | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9896718453483273,
"lm_q1q2_score": 0.8684140604189982,
"lm_q2_score": 0.8774767762675405,
"openwebmath_perplexity": 239.6242308531144,
"openwebmath_score": 0.8364754319190979,
"tag... |
acid-base, kinetics, isotope
The entire point of the above reference is that
$\ce{H3O+ + H2O <=> H2O + H3O+}$
(which would correspond to an equilibrium constant of 1) is not a genuine thermodynamic process because the products and reactants are the same.
$\ce{D3O+ + D2O <=> D2O + D3O+}$
would also correspond to an ... | {
"domain": "chemistry.stackexchange",
"id": 9098,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "acid-base, kinetics, isotope",
"url": null
} |
inorganic-chemistry, stoichiometry, mole
My Attempt
$$\frac{n_\ce{FeS2}}{2} = \frac{600/120}{2} = \frac{5}{2} \lt \frac{n_\ce{O2}}{11/2} = \frac{800/32}{11/2} = \frac{50}{11}\implies \ce{FeS2}~\text{is limiting reagent}$$
By Mole-Mole Analysis, we have
$$\frac{n_\ce{FeS2}}{2} = \frac{n_\ce{Fe2O3}}{1} = \frac{n_\ce{SO2... | {
"domain": "chemistry.stackexchange",
"id": 11810,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "inorganic-chemistry, stoichiometry, mole",
"url": null
} |
boost
/usr/include/boost/bind/bind.hpp:1380:5: note: template<class R, class F> boost::_bi::bind_t<R, F, boost::_bi::list0> boost::bind(boost::type<R>, F)
/usr/include/boost/bind/bind.hpp:1388:5: note: template<class R, class F, class A1> boost::_bi::bind_t<R, F, typename boost::_bi::list_av_1<A1>::type> boost::bind(b... | {
"domain": "robotics.stackexchange",
"id": 11202,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "boost",
"url": null
} |
special-relativity, vectors, metric-tensor, complex-numbers
Title: Quaternions and 4-vectors I recently realised that quaternions could be used to write intervals or norms of vectors in special relativity:
$$(t,ix,jy,kz)^2 = t^2 + (ix)^2 + (jy)^2 + (kz)^2 = t^2 - x^2 - y^2 - z^2$$
Is it useful? Is it used? Does it bri... | {
"domain": "physics.stackexchange",
"id": 52167,
"lm_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, vectors, metric-tensor, complex-numbers",
"url": null
} |
c++, performance, programming-challenge
// 4. Sum them all
time_point t4 = the_clock::now();
int sum = 0;
for(int i = 24; i < LIMIT; ++i) //can start at 24, as that is the 1st sum of 2 abundant numbers
{
if(!isSumOfAb[i])
sum += i;
}
// Output
time_point t5 = the_clock::... | {
"domain": "codereview.stackexchange",
"id": 9452,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, performance, programming-challenge",
"url": null
} |
java, algorithm, bitwise, vectors, bitset
(The missing class BruteForceBitVector is here.)
Typical benchmark demo output
Seed = 1706175245835
Built the bit vector in 74 milliseconds.
Preprocessed the bit vector in 117 milliseconds.
--- Benchmarking rank operation ---
rankFirst() ran for 623 milliseconds.
rankSecond() ... | {
"domain": "codereview.stackexchange",
"id": 45358,
"lm_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, bitwise, vectors, bitset",
"url": null
} |
python, performance, numpy, computational-geometry, cython
When I time the two versions I gained only a factor of two in speed-up I need at least 10 times that (or 100x !). Is there something to do ?
How does one deal with variable sized list with Cython ?
I do not know if this could be useful but my inputs are of fix... | {
"domain": "codereview.stackexchange",
"id": 26217,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, numpy, computational-geometry, cython",
"url": null
} |
audio, frequency, dwt
Which is a 2D numpy array (2D because the audio is stereo, but don't focus on that cause I'm also working with mono).
coefficientsDetail is presented like this:
array([[-0.70710678],
[ 0. ],
[ 0.70710678],
...,
[ 0. ],
[ 0. ],
[ 0. ... | {
"domain": "dsp.stackexchange",
"id": 10960,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "audio, frequency, dwt",
"url": null
} |
# What is approximately the distribution of your total earning?
You play a game in a casino: you roll two dice and if the sum of the spots equals seven, you win $$5$$€.
In every other case, you lose $$1$$€. You decide to play this game $$120$$ times.
What is approximately the distribution of your total earning?
So th... | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.978712643239288,
"lm_q1q2_score": 0.8024399782733885,
"lm_q2_score": 0.8198933403143929,
"openwebmath_perplexity": 310.9263255151988,
"openwebmath_score": 0.9070925116539001,
"tags... |
The group operation is not defined by composition, unless you mean the composition $S \to S\times S \to G\times G \to G$, where the first map is the diagonal $s \to (s,s)$, the second map is the product of the two given maps $\alpha, \beta$, and the third map is the group operation on $G$. When the author writes $(\alp... | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9822877028521422,
"lm_q1q2_score": 0.8619346704709501,
"lm_q2_score": 0.877476800298183,
"openwebmath_perplexity": 171.8989550887023,
"openwebmath_score": 0.9451440572738647,
"tags... |
neural-network, deep-learning, computer-vision
I would say the graphic describes
$$\varphi \left (W_2 \varphi(W_1 x) + x \right ) \qquad \text{ with } \varphi = ReLU$$
The $\mathcal{F}(x)$ does not make sense to me. Assuming both weight layers are simple MLPs without bias, where the first one has a weight matrix $W_1$... | {
"domain": "datascience.stackexchange",
"id": 1374,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neural-network, deep-learning, computer-vision",
"url": null
} |
special-relativity, lorentz-symmetry, poincare-symmetry
My question: In what sense is this BMS a symmetry? I know that Poincaré is a symmetry in the sense that the fundamental equations of motion of the fields are kept invariant (look the same) once all the objects in the equations are transformed by Poincaré. Is that... | {
"domain": "physics.stackexchange",
"id": 45216,
"lm_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, lorentz-symmetry, poincare-symmetry",
"url": null
} |
which are the two eigenvalues of A. the vector Using Mathematica, it is possible to solve the system of ODEs shown below. In this case a small number was chosen (x = 1) to keep the solution simple. \end{array}\right]$. Exercise $$\PageIndex{1}$$: Calculating Eigenvalues and Eigenvectors using Numerical Software. Eigenv... | {
"domain": "com.br",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9890130593124399,
"lm_q1q2_score": 0.8263041290358484,
"lm_q2_score": 0.8354835371034368,
"openwebmath_perplexity": 402.3403455863307,
"openwebmath_score": 0.9638453722000122,
"tags": null,
... |
quantum-mechanics, classical-mechanics, symmetry, group-theory, representation-theory
I am a bit confused by the authors' argument here. For quantum physics, we still have the Hilbert space on which we can view the operators act. What's the significance here for the existence of configuration space? And can somebody e... | {
"domain": "physics.stackexchange",
"id": 32818,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, classical-mechanics, symmetry, group-theory, representation-the... |
Let G be a graph with n vertices. Therefore, your graph has at most $\frac{n(n-1)}{2}-k(n-k)$ edges, with equality if the two pieces are complete graphs. formalizes this argument). Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers ... | {
"domain": "madagas-car.pl",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9728307708274402,
"lm_q1q2_score": 0.8399339254567376,
"lm_q2_score": 0.8633916099737806,
"openwebmath_perplexity": 705.4726990497503,
"openwebmath_score": 0.35139915347099304,
"tags"... |
java, beginner, generator
the ID should be numerical
depending on the entity-type the ID could vary in shape/pattern
the pattern and information encoded into the ID should tell something about it. Thus it contains informational parts, each encoded as a number. Parts may be workstation-id, running-counter or creation-d... | {
"domain": "codereview.stackexchange",
"id": 36963,
"lm_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, generator",
"url": null
} |
ios, swift, audio
func play() {}
func pause() {}
func stop() {}
func preload() {}
func unload() {}
}
We want a way to assign our the delegate property so we can control who is updated of particular events happening on the player.
We want an initializer that takes an NSURL so we can set up an audio pl... | {
"domain": "codereview.stackexchange",
"id": 18721,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ios, swift, audio",
"url": null
} |
typescript, angular-2+
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent implements OnInit {
opportunity: any = {}; // Object value is shown above
backgrounds: any = {
preferred: [],
required: []
};
skills: any = {
preferred: [... | {
"domain": "codereview.stackexchange",
"id": 30373,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "typescript, angular-2+",
"url": null
} |
$$P(A|B^c) = 1/n$$, $$P(B) = p$$, $$P(B|A) = \dfrac{P(A|B) P(B)}{P(A|B) P(B) +P(A|B^c) P(B^c)} = \dfrac{p}{p + \dfrac{1}{n} (1 - p)} = \dfrac{np}{(n - 1) p + 1}$$, $$\dfrac{P(B|A)}{P(B)} = \dfrac{n}{np + 1 - p}$$ increases from 1 to $$1/p$$ as $$n \to \infty$$, Polya's urn scheme for a contagious disease. $$P(W_1W_3) =... | {
"domain": "franchising-und-cooperation.de",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.951142225532629,
"lm_q1q2_score": 0.8006959234117534,
"lm_q2_score": 0.8418256512199033,
"openwebmath_perplexity": 365.9173186778106,
"openwebmath_score": 0.82188826... |
database, cheminformatics
Where is a cheatsheet or complete list of the "formal" IUPAC naming conventions?
Where is a cheatsheet or complete list of the "trivial" or "informal" chemical names?
Does the Wikipedia page have all of the naming conventions, or are some missing? Then this page titled "Trivial and semisyste... | {
"domain": "bioinformatics.stackexchange",
"id": 2018,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "database, cheminformatics",
"url": null
} |
Thus, when f(2a-x ) =f(x)
$\displaystyle \left( i \right) \quad and\quad \left( ii \right) \Rightarrow \int _{ 0 }^{ 2a }{ f\left( x \right) } dx\\ =\int _{ 0 }^{ a }{ f\left( x \right) } dx+\int _{ 0 }^{ a }{ f\left( x \right) } dx\\ =2\int _{ 0 }^{ a }{ f\left( x \right) } dx$
and when f(2a -x) = -f(x) when
$\disp... | {
"domain": "ucale.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9946150621978416,
"lm_q1q2_score": 0.8012939143937593,
"lm_q2_score": 0.8056321936479701,
"openwebmath_perplexity": 2890.916827909202,
"openwebmath_score": 0.9998791217803955,
"tags": null... |
object-oriented, ruby
This code will return the instance variable immediately unless it's nil or false. Otherwise, it'll actually evaluate the right-hand expression (i.e. sum up the character count), assign the result to the instance variable, and then return the value.
If you want to memoize return values, you should... | {
"domain": "codereview.stackexchange",
"id": 8241,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "object-oriented, ruby",
"url": null
} |
graphs
Claim: In a breadth-first search of an undirected graph for each cross edge $(a,b)$ $$0 \leq depth(b)-depth(a) \leq 1$$
Proof: Assume that $depth(b)-depth(a) > 1$. Then $depth(b)$ is at least $depth(a) + 2$. But $(a,b) \in E$ (a cross-edge) and hence $depth(b) = depth(a)+1$, a contradiction (see the following f... | {
"domain": "cs.stackexchange",
"id": 9516,
"lm_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",
"url": null
} |
c#, linked-list, generics, collections
if (size == 0) return false;
long c = 0;
var curr = head;
while (curr.Next != null && c < index) { curr = curr.Next; c++; }
if (curr.Prev == null && curr.Next == null)
{
curr = null;
hea... | {
"domain": "codereview.stackexchange",
"id": 11628,
"lm_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",
"url": null
} |
newtonian-mechanics, causality, determinism, reversibility, steady-state
Title: Reversibility = non-causality. Can this be right? I read yesterday the Norton Dome's paper, which shows that some Newtonian systems can be non-causal, based on specific solutions of Newton's laws. The author justifies the solutions in very... | {
"domain": "physics.stackexchange",
"id": 66007,
"lm_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, causality, determinism, reversibility, steady-state",
"url"... |
stresses
Title: Calculating Forces using equations of equilibrium The homogeneous bar shown in Fig. P-106 is supported by a smooth pin at C and a cable that runs from A to B around the smooth peg at D. Find the stress in the cable if its diameter is 0.6 inch and the bar weighs 6000 lb.
When using the equilibrium of m... | {
"domain": "engineering.stackexchange",
"id": 2911,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "stresses",
"url": null
} |
Math Focus: Mainly analysis and algebra
Quote:
Originally Posted by v8archie \begin{align} f(xy) &= f(x) + f(y) &(x\ne 0,\, y\ne 0) \\[8pt] \text{differentiating with respect to $x$} \implies y f'(xy) &= f'(x) \\ f'(xy) &= \frac{f'(x)}{y} \\ \text{differentiating the original equation with respect to $y$} \implies x f... | {
"domain": "mymathforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9566341975270265,
"lm_q1q2_score": 0.8111949597400172,
"lm_q2_score": 0.8479677622198946,
"openwebmath_perplexity": 1510.6061530137974,
"openwebmath_score": 1.0000100135803223,
"tags... |
given function written in some elements in common, those elements be... The expression is undefined collectively referred to as the range the solution.. Just the even integers '' a we write the range ( actual output values for a function is all values... | {
"domain": "rinconesdelatlantico.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9808759654852756,
"lm_q1q2_score": 0.8337163050132154,
"lm_q2_score": 0.8499711832583696,
"openwebmath_perplexity": 508.54508552900694,
"openwebmath_score": 0.837804973125... |
soft-question, mass, metrology
Title: How are weights and scales used by the public calibrated? My physics teacher has a set of masses: things from 1 to 10 grams. My chemistry teacher has electronic balances that measures things in grams. In France, there is a block of metal we hope no one accidentally breaks, because... | {
"domain": "physics.stackexchange",
"id": 21095,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "soft-question, mass, metrology",
"url": null
} |
entropy, thermal-radiation
which is also quite close to what I understand from here.
How could absorbing radiation decrease the generated entropy ? How does absorption affect the entropy $S_c$ created during the emission ?
I thought $j_s$ represented the entropy acquired by a body absorbing the radiation, correspond... | {
"domain": "physics.stackexchange",
"id": 38328,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "entropy, thermal-radiation",
"url": null
} |
ros, filesystem, rosmake
A shell script example:
$ROS_CUSTOM_PACKAGE_BIN/binaryFile
In this way, I need to do some additional tasks initially when I start working on a package, but still I can cut down much time. Since using multiple computers might be common, I wonder if ROS has already similar/better functionality.... | {
"domain": "robotics.stackexchange",
"id": 7071,
"lm_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, filesystem, rosmake",
"url": null
} |
c++, algorithm, c++20
Image<ElementT>& operator=(Image<ElementT>&& other) = default; // Move Assign
Image(const Image<ElementT> &input) = default; // Copy Constructor
Image(Image<ElementT> &&input) = default; // Move Constructor
p... | {
"domain": "codereview.stackexchange",
"id": 42617,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, algorithm, c++20",
"url": null
} |
haskell
Return a Maybe
fiboMaybe :: Integer -> Maybe Integer
fiboMaybe n = (`div` p2) <$> divR5 nom
where
nom = pow fphi n - pow fpsi n
p2 = 2^n | {
"domain": "codereview.stackexchange",
"id": 38104,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "haskell",
"url": null
} |
algorithms, board-games
Title: Mastermind (board game) - Five-guess algorithm The algorithm (from here) -
Create a set S of remaining possibilities (at this point there are 1296). The first guess is aabb.
Remove all possibilities from S that would not give the same score of colored and white pegs if they were the an... | {
"domain": "cs.stackexchange",
"id": 2105,
"lm_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, board-games",
"url": null
} |
c#
Title: Should we create a new constant or modify an existing one I was fixing a bug in the code and it was something like this:
int const ROW_LOC = 1;
//....
Foo ( x , y , ROW_LOC ) ;
so it was passing that constant to a method ... and this ROW_LOC constant is being used in multiple other places in the code too.
F... | {
"domain": "codereview.stackexchange",
"id": 2863,
"lm_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
} |
machine-learning, linear-regression
calculating a 'normal' regression that also gives me the coefficient estimators and all the other statistics connected with it.
Could anyone tell me what is the difference here? They both solve the exact same objective, which is minimizing the mean squared error. However the second... | {
"domain": "datascience.stackexchange",
"id": 12054,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning, linear-regression",
"url": null
} |
which gives the result
$$f^{(4n)} (x) = \Bbb e^x (-4)^n \sin x , \\ f^{(4n+1)} (x) = \Bbb e^x (-4)^n (\cos x + \sin x), \\ f^{(4n+2)} (x) = \Bbb e^x (-4)^n 2 \cos x , \\ f^{(4n+3)} (x) = \Bbb e^x (-4)^n (2 \cos x - 2 \sin x) ,$$
whence one finally gets
$$f^{(4n)} (0) = 0 , \\ f^{(4n+1)} (0) = (-4)^n , \\ f^{(4n+2)} ... | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9808759593358227,
"lm_q1q2_score": 0.801939153024829,
"lm_q2_score": 0.8175744806385543,
"openwebmath_perplexity": 549.940854076621,
"openwebmath_score": 0.9751067757606506,
"tags"... |
c++, performance, php, mysql, comparative-review
echo "freqs=" . round((microtime(true) - $start) * 1000, 2) . "\n";
And the slightly depressing (from a c++ POV) performance results. 370ms vs 262ms (lowest on 10 trials for both). (UPDATE: at top. After bypassing mariadb++ and using C-lib directly with mysql_use_resul... | {
"domain": "codereview.stackexchange",
"id": 36736,
"lm_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, php, mysql, comparative-review",
"url": null
} |
neural-network, numpy
print (np.shape(features))
print (np.shape(labels))
training_split = 0.8
alldata = np.column_stack(features , labels)
np.random.shuffle(alldata)
splitidx = int(len(alldata))*training_split
train , test = alldata[:splitidx,:], alldata[splitidx:, :]
print (np.shape(train))
print (np.shape(test)... | {
"domain": "datascience.stackexchange",
"id": 3574,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neural-network, numpy",
"url": null
} |
homework-and-exercises, newtonian-mechanics, forces, string
Title: How could a cord withstand a force greater than its breaking strength? How could a 100 N object be lowered from a roof using a cord with a breaking strength of 80 N without breaking the cord?
My attempt to answer this question is that we could use a c... | {
"domain": "physics.stackexchange",
"id": 20376,
"lm_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, forces, string",
"url": null
} |
Kudos [?]: 41115 [1] , given: 5670
Re: Math: Triangles [#permalink] 05 Mar 2012, 03:43
1
KUDOS
Expert's post
budablasta wrote:
Bunuel, you posted this in 2009. It's 2012 now and I am finding this so useful. Talk about leaving behind a legacy. you deserve a nice, large, value-saver family pack of Kudos!
You might fin... | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9763105245649665,
"lm_q1q2_score": 0.8135835707613073,
"lm_q2_score": 0.8333245932423308,
"openwebmath_perplexity": 1582.4772377983493,
"openwebmath_score": 0.7091482877731323,
"tags": ... |
waves, pressure, acoustics, density
Title: Why does sound not move through a wall? I'm learning a bit about sound and was wondering:
If the speed of sound is determined by the amount of matter the source is surrounded with, why doesn't it go through a wall?
Example:
Speed of sound in air is 343 m/s but in water, it mo... | {
"domain": "physics.stackexchange",
"id": 57828,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "waves, pressure, acoustics, density",
"url": null
} |
Model the cross-section as a parabola centred at the origin. Then we know that: $$y = ax^2$$ for some constant $a$. But from the given dimensions, we also know that the parabola contains the point $(3/4, 2)$. Substituting, we find that: $$2 = a(3/4)^2 \iff 2 = \frac{9a}{16} \iff a = \frac{32}{9}$$ Now the area of the c... | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9833429585263219,
"lm_q1q2_score": 0.8215668572034495,
"lm_q2_score": 0.8354835411997897,
"openwebmath_perplexity": 274.5100505747845,
"openwebmath_score": 0.9953742027282715,
"tag... |
lambda-calculus
Title: How is this expression a valid lambda expression? Can you explain how this expression follows the grammar of the lambda calculus?
$$\lambda x.x((\lambda y.yy)x)x = λx.x(xx)x$$
I am not sure why we have the parentheses following the $.x$ (on both sides of the equation). When in doubt, write down ... | {
"domain": "cs.stackexchange",
"id": 7982,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lambda-calculus",
"url": null
} |
quantum-state, entanglement, textbook-and-exercises
\langle\psi|X^0_1Z_2X^0_1+X^1_1Z_2X^1_1|\psi\rangle
$$
Next, think about a term like $X^0_1Z_2X^0_1$, but expand out the tensor product. This is just $(X^0X^0)\otimes Z$. But since $X^0$ is a projector, it's just $X^0$. So, our full expression looks like
$$
\langle\p... | {
"domain": "quantumcomputing.stackexchange",
"id": 2839,
"lm_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-state, entanglement, textbook-and-exercises",
"url": null
} |
programming-languages, notation, history
Title: Is there any reason why the modulo operator is denoted as %? I would like to know if there is any reason why many programming languages use the notation % for the modulo operator?
It is used in the most "famous" languages:
C
C++
C#
Go
Java
Julia
Lua
Perl
Python The earl... | {
"domain": "cs.stackexchange",
"id": 17377,
"lm_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, notation, history",
"url": null
} |
ros, catkin, path, binary, rosrun
Title: How to get the binary path for any package?
Hi
How do I get the binary path where the executables are stored for a specific package.
Need it for a console script.
Should work anywhere in devel and in install.
Regards,
Christian
Originally posted by cyborg-x1 on ROS Answers wi... | {
"domain": "robotics.stackexchange",
"id": 22049,
"lm_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, catkin, path, binary, rosrun",
"url": null
} |
lagrangian-formalism, field-theory, variational-principle, action, variational-calculus
But is it provable that $$\int d^4 x [(\frac{\partial \mathcal{L}}{\partial \phi}-\partial_\mu\frac{\partial\mathcal{L}}{\partial(\partial_\mu \phi)})\delta \phi]\neq 0$$ for $$\frac{\partial \mathcal{L}}{\partial \phi}-\partial_\m... | {
"domain": "physics.stackexchange",
"id": 60100,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lagrangian-formalism, field-theory, variational-principle, action, variational-cal... |
c++, design-patterns
Title: Very simple implementation of observer pattern in C++ I'm reading on design patterns for a software engineering class. I am doing small implementations of some I find the most interesting / applicable to better understand them.
I'd like a code review on my design, more particularly on the d... | {
"domain": "codereview.stackexchange",
"id": 3850,
"lm_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",
"url": null
} |
genetics, evolution, molecular-genetics
Title: What are chemical candidates for replicator molecule? I have read Selfish gene by Richard Dawkins and idea is that at random some molecule was synthesized that had a property if there is enough 'materials' to construct copy of itself - it would. And then it made bunch of ... | {
"domain": "biology.stackexchange",
"id": 5979,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "genetics, evolution, molecular-genetics",
"url": null
} |
energy, sun, stars
Then figure that cooking meat with sunlight does require at least some sort of magnifier, so we can probably multiply that by a factor of at least 3, and probably more like 7-10 or so.
Of course, for now I'm ignoring a such minor details as how you even design (not to mention building) a system even... | {
"domain": "physics.stackexchange",
"id": 36474,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "energy, sun, stars",
"url": null
} |
bash, linux, shell, awk
Running this script on file.log gives this result:
curl -X PUT http://localhost:8080/api/user/alice/lastLoginTime/2021-05-27T09:45:54.497Z
curl -X PUT http://localhost:8080/api/user/bob/lastLoginTime/2021-05-27T09:29:16.464Z
curl -X PUT http://localhost:8080/api/user/admin/lastLoginTime/2021-05... | {
"domain": "codereview.stackexchange",
"id": 41423,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "bash, linux, shell, awk",
"url": null
} |
java, object-oriented
Board.java
import java.util.*;
class Board {
private static int grid;
private static int piece;
ArrayList locations = new ArrayList();
public Board(int grid) {
this.grid = grid;
this.piece = 420/grid;
for(int i=0; i<grid*grid; i++) locations.add(new Inte... | {
"domain": "codereview.stackexchange",
"id": 1301,
"lm_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, object-oriented",
"url": null
} |
cc.complexity-theory, space-bounded
Title: Tight Lower bounds on Savitch's theorem First of all, I apologize in advance for any stupidity. I am by no means an expert on complexity theory (far from it! I am an undergraduate taking my first class in complexity theory) Here's my question. Now Savitch's Theorem states tha... | {
"domain": "cstheory.stackexchange",
"id": 326,
"lm_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, space-bounded",
"url": null
} |
ocean, waves
Title: What causes waves to form the characteristic "breaking" shape as they approach the shoreline? We all know that as waves approach the shallow shores, the waves begin to form a characteristic shape. The upper portion of these breaking waves appears to curl forward and downwards over the bottom segme... | {
"domain": "earthscience.stackexchange",
"id": 2705,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ocean, waves",
"url": null
} |
java
Title: Reading Map from csv with Singleton There are 2 csv:
1 - areaMap.csv
2 - currencyMap.csv
Enum AreaMapFromCsv is the Singleton to store the Map<String, Enum> read from 1 csv.
Enum CurrencyMapFromCsv is the Singleton to store the Map<String, String> read from 2 csv.
Interface IMapFromCsv provides default ... | {
"domain": "codereview.stackexchange",
"id": 28222,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java",
"url": null
} |
object-oriented, vba, library, logging
Dim logFormatter As DatabaseLogMessageFormatter
Set logFormatter = DatabaseLogMessageFormatter.Create(sqlInsert)
LogManager.Register DatabaseLogger.Create("DbLogger", TraceLevel, logFormatter, connString, sqlInsert)
LogManager.Log TraceLevel, "logger has been create... | {
"domain": "codereview.stackexchange",
"id": 9835,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "object-oriented, vba, library, logging",
"url": null
} |
The function $$A\rightarrow S=\sqrt{A}$$ is defined and differentiable on the set of SPD matrices. Let $$K=DS_A(H)$$ be the derivative of $$S$$ in $$A$$, where $$H$$ is a variable SYMMETRIC matrix. Here $$SS=A$$ implies $$KS+SK=H$$, a Sylvester equation in the unknown $$K$$. We may assume $$A=diag((\lambda_i)_i)$$ wher... | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9830850827686584,
"lm_q1q2_score": 0.8149173728343461,
"lm_q2_score": 0.8289388040954683,
"openwebmath_perplexity": 256.31494691939264,
"openwebmath_score": 0.9986990094184875,
... |
java, game
g.setColor(Color.white);
g.fillRect(1300,y,30,150);
g.setColor(Color.white);
g.fillOval(bx,by,20,20);
}
}
} Thanks for sharing your code.
Naming
Finding good names is the hardest part in programming, so always take your time to think about the names of your identifiers.
Naming Conve... | {
"domain": "codereview.stackexchange",
"id": 27325,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, game",
"url": null
} |
cr.crypto-security, relativization, advice-and-nonuniformity, search-problem, random-oracles
As shown earlier in this answer, there are infinitely many n such that $1\hspace{-0.04 in}\big/\hspace{-0.07 in}\left(\hspace{-0.02 in}n^{2+j}\hspace{-0.02 in}\right) \; < \; \operatorname{Prob}_{\mathcal{O}}\left[A^{\mathcal{... | {
"domain": "cstheory.stackexchange",
"id": 3714,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cr.crypto-security, relativization, advice-and-nonuniformity, search-problem, rand... |
inorganic-chemistry, physical-chemistry, reaction-mechanism
The picture below shows how complicated the trajectories become when there is a Lennard jones potential between two atoms as one approaches the other from the left but at different position vertically. You can see that the species get pulled together at a lar... | {
"domain": "chemistry.stackexchange",
"id": 16511,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "inorganic-chemistry, physical-chemistry, reaction-mechanism",
"url": null
} |
# Determining the condition for the real part and imaginary parts of complex function using its modulus
So if I have a function like the following, where $$f$$ is a complex function and B is real: $$S(\lambda) = 1 + iBf(\lambda)$$ Suppose that I know that its modulus must be equal to 1, therefore:
Now how do I determ... | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9877587250685455,
"lm_q1q2_score": 0.8005576090014593,
"lm_q2_score": 0.8104789040926008,
"openwebmath_perplexity": 212.29675668140317,
"openwebmath_score": 0.7245088219642639,
"ta... |
homework-and-exercises, newtonian-mechanics, reference-frames, rotational-dynamics, free-body-diagram
Title: A tilted disk rolling on the floor First of all, an image to describe the situation we have: | {
"domain": "physics.stackexchange",
"id": 72888,
"lm_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, reference-frames, rotational-dynamics... |
co.combinatorics, hash-function
Here is an example of what should be a function like this:
for $m=4$:
$ f(\{0,3\}) = 3, f(\{0,2\}) = 2 , f(\{0,1\}) = 1$
$ f(\{1,3\}) = 5, f(\{1,2\}) = 4$
$ f(\{2,3\}) = 6$
$\binom{4}{2} = 6$ Excuse me if this is a naive answer, I haven't read the problem very carefully and I've just... | {
"domain": "cstheory.stackexchange",
"id": 802,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "co.combinatorics, hash-function",
"url": null
} |
This tells us how to find B and C when given any prime A. It also tells us that B and C will be consecutive integers. How interesting.
Filed under Uncategorized
## Mathematical Toy Part 2
Warning: the following post contains some intense mathematics, caution is advised.
In the previous post, I investigated a simple... | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9850429147241161,
"lm_q1q2_score": 0.8292343833947299,
"lm_q2_score": 0.8418256412990657,
"openwebmath_perplexity": 342.26479036699277,
"openwebmath_score": 0.6682217121124268,
"tags":... |
quantum-field-theory, spin-statistics
$$
\psi_{\sigma}(x)=\frac{1}{(2\pi)^{3/2}}\int\frac{d^3\textbf{p}}{[2\omega(\textbf{p})]^{1/2}}\sum_{\sigma'}\left[\xi D_{\sigma,\sigma'}^{(j)}[L(\textbf{p})]a(\textbf{p},\sigma')e^{ip\cdot x}+\eta\{D^{(j)}[L(\textbf{p})]C^{-1}\}_{\sigma,\sigma'}b^*(\textbf{p},\sigma')e^{-ip\cdot ... | {
"domain": "physics.stackexchange",
"id": 67549,
"lm_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, spin-statistics",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.