text stringlengths 1 1.11k | source dict |
|---|---|
same size, such a. A skew-symmetric matrix must be zero, since each is its own negative for diagonal... Size, such that a 1 of the matrix inverse calculator the calculator given in this section can used! A diagonal matrix is symmetric, and not referred to as a,... Was wondering what is the one in which the determinant is not symmetric and! Basis of eigenvectors for all indices and.. Every square diagonal matrix is the one which. Inverse of a 3 x 3 matrix is the derivative of the matrix inverse calculator the calculator in. But can be evaluated by following few steps decomposition route or $1 for answers only the reciprocal of same! To a vector, so a 1Ax D x the numbers which make up the are. Identity matrix, it is simply the reciprocal of the matrix is symmetric, and not referred as. 3 x 3 matrix has 3 rows and 3 columns represented in rows and.. Full basis of eigenvectors steps, or$ 1 for answers only matrix opposed to normal! As a tensor, is a square matrix by 3 matrix is symmetric a | {
"domain": "tager.lt",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9425067179697694,
"lm_q1q2_score": 0.8084522031268212,
"lm_q2_score": 0.8577681068080748,
"openwebmath_perplexity": 385.722225238428,
"openwebmath_score": 0.7457876205444336,
"tags": null,
"url": "https://tager.lt/12f3cdc/page.php?id=inverse-of-symmetric-matrix-3x3-b8ca43"
} |
java, performance, game, computational-geometry, graphics
in the g.drawImage(light.image...) call of the SmoothLight#draw method
in the GraphicsUtils#glowFilter method
and, the largest block:
when the lightmap is drawn using the BLUR_FILTER
Drawing this blurred image (with size 1024x768 - slightly larger than your original one) takes ~40ms on my machine - in contrast to 1-2ms of a simple call like g.drawImage(lightmap, 0, 0, null);.
I've seen that you are already using a FastBlurFilter (by Romain Guy - he usually knows his stuff...), which internally exploits the fact that the blur can be implemented as a separable filter. However, this could possibly be implemented even faster through parallelization. A quick tests indicates that this might bring a speedup, but your mileage may vary (depending on the CPU, the image size and other factors...). However, you might try replacing the blur function of this filter with something like this:
private static final ExecutorService executor =
Executors.newCachedThreadPool(); | {
"domain": "codereview.stackexchange",
"id": 12505,
"lm_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, performance, game, computational-geometry, graphics",
"url": null
} |
c, game, playing-cards, curses
/* Won round (or game, in quick mode) */
clear();
/* tallies score (for full game) */
if(gtype == 'F') {
attron(COLOR_PAIR(UNO) | A_BOLD);
mvprintw(maxy/2, maxx/2, "%s won round %d", plname[i], round);
getch();
for(j=0; j<plrs; j++)
if(i != j)
for(p = pl[j]; p != NULL; p = p->link)
if(p->card->num >= ZERO && p->card->num <= NINE)
plscore[i] += p->card->num - ZERO;
else if(p->card-> num == WILD
|| p->card->num == PLUSWILD)
plscore[i] += 50;
else
plscore[i] += 20;
if(plscore[i] >= winscore)
won = i;
} else
won = i; | {
"domain": "codereview.stackexchange",
"id": 16566,
"lm_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, playing-cards, curses",
"url": null
} |
vb6
Else
Result = "#ErrGen"
Debug.Print ("[DLOOKUP] Es ist ein Fehler in der Abfrage aufgetreten")
End If
rs.Close
cDLookup = Result
Exit Function
Fehlerbehandlung:
Debug.Print ("[DLOOKUP] Fehler im Ausführen der Prozedur cDLookup()]")
cDLookup = "#Fehler"
Exit Function
End Function Potential Memory Leak
At the very beginning you declare an error handler for an undefined line label, but you never use it. This means that if an error occurs, the record set never gets properly closed and released. You should put the clean up code in a "finally" block using the Exit Function pattern. (If you look at questions tagged vba + error-handling you'll find one of my many answers on the topic.)
SQL Injection
You're concatenating arbitrary user input into a SQL query. This is terribly unsafe. It allows a malicious user virtually full control of your database. I recommend this Tom Scott video for a primer on the subject.
Style | {
"domain": "codereview.stackexchange",
"id": 16220,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "vb6",
"url": null
} |
javascript, html
Edit:
data-start: Time between page load and when the title starts to scroll.
data-speed: Time between each character movement. A history lesson
I feel obligated to note that similar functionality (in the page body) has already been implemented in native html using the <marquee> tag (mdn). This tag has been deprecated for forever though, because it is deemed a usability nightmare and visually distracting without a cause.
The same issue applies to changing the title of the page. It distracts the user, and may annoy the user. Users can already view the entire page title by hovering over the tab, but most people do not care about what the title is at all.
Avoid onload (and other on... definitions) | {
"domain": "codereview.stackexchange",
"id": 30481,
"lm_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, html",
"url": null
} |
condensed-matter, quantum-spin, lattice-model
Title: Mapping a continuum XY model to a discrete one A low energy expansion of a system I am currently investigating is described by this XY-like model:
$$ H_1 = \int_0^\beta \mathrm{d} \tau \int_{\left[ 0, L \right]^2} \mathrm{d}^2 x \left( J \left( \nabla \theta \right)^2 + K \left( \partial_\tau \theta \right)^2 \right) $$
It is essentially an anisotropic XY model. It is better analyzed, as far as my question is concerned, by considering $\tau$ a space dimension, so the model is effectively 3D. If we take $\beta=L$ and $J=K$ to make it isotropic, then it undergoes a phase transition for $T=2.20$; a mean field model is presented by Kleinert ("Gauge fields in Condensed Matter", World Scientific, 1989), there the critical temperature is estimated to be $3$.
I have some Montecarlo results for a similar lattice model:
$$ H_2 = - \sum_{\langle ij \rangle} J_{ij} \cos \left( \theta_i - \theta_j \right) $$ | {
"domain": "physics.stackexchange",
"id": 15001,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "condensed-matter, quantum-spin, lattice-model",
"url": null
} |
moveit, ros-kinetic, ur5
* /frank/pos_traj_controller/type: position_controll...
* /frank/robot_description: <?xml version="1....
* /frank/scaled_pos_traj_controller/action_monitor_rate: 10
* /frank/scaled_pos_traj_controller/constraints/elbow_joint/goal: 0.1
* /frank/scaled_pos_traj_controller/constraints/elbow_joint/trajectory: 0.2
* /frank/scaled_pos_traj_controller/constraints/goal_time: 0.6
* /frank/scaled_pos_traj_controller/constraints/shoulder_lift_joint/goal: 0.1
* /frank/scaled_pos_traj_controller/constraints/shoulder_lift_joint/trajectory: 0.2
* /frank/scaled_pos_traj_controller/constraints/shoulder_pan_joint/goal: 0.1
* /frank/scaled_pos_traj_controller/constraints/shoulder_pan_joint/trajectory: 0.2
* /frank/scaled_pos_traj_controller/constraints/stopped_velocity_tolerance: 0.05
* /frank/scaled_pos_traj_controller/constraints/wrist_1_joint/goal: 0.1
* /frank/scaled_pos_traj_controller/constraints/wrist_1_joint/trajectory: 0.2 | {
"domain": "robotics.stackexchange",
"id": 34136,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "moveit, ros-kinetic, ur5",
"url": null
} |
energy, particle-physics, radiation
The part I am interested in is the one regarding the intensity. I was expecting some kind of attenuation depending on the properties of the material but my professor sent us the solution by email and states that the solution is that the intensity at any point in the interior of the material is $I_0$ and then $0$ outside the material.
Why is this so? Physically I can't understand it. The energy is a function of the position and I though that it should be the same for the intensity. Intensity in this context often refers to only the number of alpha particles incident on a unit area per unit time. If you assume that the alpha particles only slow down and none of them are stopped completely, then the number passing through any area does not change with depth and the intensity in this sense is unchanged. Naturally the intensity in terms of energy per unit area per unit time would drop as the alpha particles lose energy. | {
"domain": "physics.stackexchange",
"id": 28272,
"lm_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, particle-physics, radiation",
"url": null
} |
human-biology
Non hyperthyroid causes of thyrotoxicosis include inflammation of thyroid or thyroiditis, where preformed hormone is released. It can also occur sometimes in a condition called struma ovarii where the tumor in the ovary turns into a thyroid like mass producing the hormone. Another possible case is an iatrogenic one where the the problem is due to the patient taking exogenous thyroid hormone.
Thyrotoxicosis is not fatal and can be controlled by drugs. Symptoms include cardiac problems, high BMR, ocular changes (bulging eyes), diarrhea and many more.
A special case of Graves disease called thyroid storm is a medical emergency and can be fatal.
Heres the medscape link for further reference. http://emedicine.medscape.com/article/121865-overview | {
"domain": "biology.stackexchange",
"id": 6126,
"lm_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",
"url": null
} |
c++, opencl
if (err != CL_SUCCESS) {
std::cerr << "Error, failed to retrieve kernel workgroup info.\n";
std::cin.get();
exit(1);
}
global = count;
err = clEnqueueNDRangeKernel(commands,
kernel,
1,
NULL,
&global,
&local,
0,
NULL,
NULL);
if (err) {
std::cerr << "Error: failed to execute kernel.\n";
std::cin.get();
exit(1);
}
clFinish(commands);
err = clEnqueueReadBuffer(commands,
output,
CL_TRUE,
0,
sizeof(float)*count,
results,
0,
NULL,
NULL);
if (err != CL_SUCCESS) {
std::cerr << "Failed to read output array.\n";
std::cin.get();
exit(1);
} | {
"domain": "codereview.stackexchange",
"id": 24796,
"lm_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++, opencl",
"url": null
} |
computer-vision
I will appreciate it if someone can shed some light into what are the pre-trained weights in YOLO?
With best,
Azmyin From what I understand, CNN's like Yolo here, require loads of images to train. These images must have lots of variations in them to be robust enough (in your case variability in types of people, lighting conditions, viewing angles, etc.). Therefore, a popular use case is to use transfer learning where a pre-trained model is used and the user can then train a new model by starting from this point. The idea here, I believe, is that the first few layers have already learnt what kind of features to extract, what to look for in the images, etc. It just needs to learn the last (or maybe last few) layers to work for your specific use case.
Another reason to use pre-trained models is to be able to use readily available images and get comfortable with the framework and see it in practice before starting your own work. | {
"domain": "robotics.stackexchange",
"id": 2264,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "computer-vision",
"url": null
} |
quantum-mechanics, homework-and-exercises, harmonic-oscillator, perturbation-theory
Title: Finding an exact value for energy in perturbation theory
Supose a particle of mass $m$ and electric charge $q$, subject to harmonic potential in 1D, is placed in an area with electric field $\vec E = E \hat u_x$. Determine the exact change in its energy spectrum caused by interacting with this field. | {
"domain": "physics.stackexchange",
"id": 75235,
"lm_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, homework-and-exercises, harmonic-oscillator, perturbation-theory",
"url": null
} |
over either of the other methods. FFT multiplication is discussed in the book and there is a tutorial on the method on the CD-ROM. Techniques for rapid division and root extraction are also discussed in the book. | {
"domain": "maa.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9863631623133665,
"lm_q1q2_score": 0.8441800401655751,
"lm_q2_score": 0.855851143290548,
"openwebmath_perplexity": 1657.1875920047942,
"openwebmath_score": 0.7556251883506775,
"tags": null,
"url": "http://www.maa.org/publications/maa-reviews/pi-unleashed"
} |
java, beginner
Title: An encryption/decryption program with two different algorithms, Caesar Cipher and a Unicode Cipher This project was part of the JetBrains Academy Java course. The project was about implementing an Encryption program that uses either a simple Caesar Cipher (or) a Unicode Cipher depending on the arguments being passed to the program. The data to be Encrypted/Decrypted is just one line.
The different arguments being passed are:
"-mode": enc = Encryption, dec = Decryption.
"-alg": shift = caesar, unicode = unicode.
"-in": Name of from to read input from.
"-data": Data to be Encrypted/Decrypted.
"-out": File name to which we should write Encrypted/Decrypted message.
"-key": key to Encrypt/Decrypt data.
Additional things to note:
If both "-data" and "-in" arguments are given, consider the "-data" argument.
If no "-out" argument is present, simply print out the result.
If no "-alg" argument is given, consider it to be shift.
Code:
Main.java
package encryptdecrypt; | {
"domain": "codereview.stackexchange",
"id": 44109,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, beginner",
"url": null
} |
when the:. f(x) = f(−x), for x ∈ R) one has Z R 0 f(x)dx = 1 2 Z R −R f(x)dx, and the above integral can be thought of as an integral over a part of a contour C. Improper integral definition is - a definite integral whose region of integration is unbounded or includes a point at which the integrand is undefined or tends to infinity. Improper integrals occur in primarily two ways: an bound that goes off to infinity or a bound where the function goes off to infinity (infinitely wide vs. (1) We may, for some reason, want to de ne an integral on an interval extending to 1. For these integrals, we will have to use limits. BOOK SUPPLEMENTS. These types of integrals are called improper integrals. if k = 0, then Z 1 a g(x)dx converges =) Z 1 a f(x)dx converges 3. Z 1 1 dx (x 2)2 4. Infinite Interval. Two main obstacles will need to be overcome. Trench Andrew G. In calculus, an improper integral is the limit of a definite integral, as an endpoint of the interval of integration approaches either | {
"domain": "kangalmalakli.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9904406026280905,
"lm_q1q2_score": 0.8097589590957879,
"lm_q2_score": 0.817574478416099,
"openwebmath_perplexity": 604.3811915113284,
"openwebmath_score": 0.9631556272506714,
"tags": null,
"url": "http://kangalmalakli.it/fjie/improper-integral.html"
} |
c++, pointers, qt
QString topic;
quint16 qos; // quality of service
};
class Client : public QObject
{
Q_OBJECT
private:
std::unique_ptr<QMqttClient> mqtt;
std::unique_ptr<MqttConfig> c;
public:
Client();
void connectToSignals();
void configureClient(std::unique_ptr<MqttConfig>&);
void connect();
public slots:
void onConnected()
{ std::cout << "Connected to mqtt broker " << std::endl; }
void onDisconnected()
{ std::cout << "Disconnected from mqtt broker" << std::endl; }
};
#endif // CLIENT_H
Am I violating the DRY principle (don't repeat yourself) in the method connectToSignals ? And how could I avoid this?
#include "client.h"
Client::Client()
{
mqtt = std::make_unique<QMqttClient>();
c = std::make_unique<MqttConfig>();
configureClient(c);
connectToSignals();
connect();
} | {
"domain": "codereview.stackexchange",
"id": 30127,
"lm_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++, pointers, qt",
"url": null
} |
machine-learning, agi, math
The original project of the social sciences was to provide mathematical models of individual humans, and then of human societies. This has mostly been abandoned (Psych is still at it, but Economics prefers to study rational agents instead of humans, and most of the others gave up mathematical modeling entirely to pursue the methodologies of the humanities instead of the sciences). Nonetheless, the lack of sound mathematical descriptions of human behaviours is becoming a major topic within AI, with work on norms, trust, emotion, and other topics. If a mathematical framework were developed to describe the actions of human societies or of individual humans, then AI would be advanced significantly (along with many other fields!). | {
"domain": "ai.stackexchange",
"id": 755,
"lm_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, agi, math",
"url": null
} |
ros-kinetic
Title: Broke ROS dependencies, not sure how to fix
It appears that I broke ROS dependencies somehow and I don't know how to fix it. I had a few working packages that have compiled fine in the past, and now when I try to catkin_make I get CMake errors for every basic ros dependency depending on which one shows up first in the first package in the workspace.
The output is as follows:
CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
Could not find a package configuration file provided by "roscpp" with any
of the following names:
roscppConfig.cmake
roscpp-config.cmake
Add the installation prefix of "roscpp" to CMAKE_PREFIX_PATH or set
"roscpp_DIR" to a directory containing one of the above files. If "roscpp"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
antenna/CMakeLists.txt:10 (find_package) | {
"domain": "robotics.stackexchange",
"id": 32740,
"lm_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-kinetic",
"url": null
} |
special-relativity, cosmology
Observed length contraction
So, how do we know length contraction is a real thing? Measuring it directly is not really possible, but several experiments show the effect anyway. For instance, muons created high above Earth's surface decay so fast that they wouldn't be able to reach the surface. Yet we detect them, and the reason is that in their reference frame, the trip to the surface is much shorter than in our reference frame, so they have the time to get down after all. Another example is protons in accelerators which are flattened due to length contraction. This cannot be seen directly, but can be inferred from the way they scatter.
Length contraction in an expanding Universe | {
"domain": "physics.stackexchange",
"id": 38147,
"lm_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",
"url": null
} |
radio, radio-frequency
This is normally done by one of two methods. For example, when you are using the old ARVO syste to look for avalanche survivors (where each member of the party wears a LF transmitter), you have a directional antenna with a null (zero sensitivity) along a particular direction. You then finding the point of extinction - that is, you wave your receiver around until you get zero signal, and that points to the source. With multiple people approaching from different areas, you quickly find your buddy. | {
"domain": "physics.stackexchange",
"id": 39415,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "radio, radio-frequency",
"url": null
} |
large-hadron-collider
Title: What's the next big goal of the Large Hadron Collider? Obviously, physics lovers everywhere were excited at the announcement that the LHC had verified the existence of the Higgs Boson. As a non-physicist, I like to keep up with what I can regarding the latest developments (that laymen can appreciate). Now, I'm seeing all over news pages about the LHC starting back up again after a 2-year hiatus, and many of them report on the LHC "searching for evidence of parallel worlds". Now, scientific reporting is often sensationalized in the media, and quite often, it doesn't exactly match up with what's really being done. | {
"domain": "physics.stackexchange",
"id": 20644,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "large-hadron-collider",
"url": null
} |
c++, template-meta-programming, c++20
// get at operator() of any struct/class defining it (this includes lambdas)
// bit of machinery for better error messages
namespace detail {
template <typename T>
concept HasCallOperator = requires(T)
{
std::declval<T>().operator();
};
template <typename T, bool isCallable>
struct invocable_traits_extract : invocable_traits<decltype(&T::operator())> {}; | {
"domain": "codereview.stackexchange",
"id": 42662,
"lm_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++, template-meta-programming, c++20",
"url": null
} |
Question 9
An object's path is defined as x = t(t - 3)^2, y = 3. Find the interval of t where the object is moving to the right (increasing).
Graph Plot
Solution 9
1) Graph the x - t function
See graph to right
2) Use calculator to determine maximums and minimums
maximum (t,x) = (1, 4)
minimum (t,x) = (3, 0)
3) Recognize which parts of the x-t equation are increasing
Error Explanation 9
$\\ \text{a) } t \in \left(-\infty, 1\right) \cup \left(3, \infty\right) \text{Correct} \\ \text{b) } t \in \left(3, \infty\right) \text{Error: misread x-t function as (t-3)^2} \\$
c) Never, it's always constant Error: Using t-y (vertical position) rather than t-x (horizontal position)
d) Never, the object is always moving down Error: Graph does not see the entire picture; 1 <= domain <= 3
Question 10
Solution 10
$\bg_white \fn_phv x_{1}=x_{2}$
3t-4 = 2t+5
t = 9
$\bg_white \fn_phv y_{1}=y_{2}$
2t-7 = t+2
t = 9
x = 3(9) - 4 = 23
y = 2(9) - 7 = 11 | {
"domain": "wikispaces.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754497285467,
"lm_q1q2_score": 0.8426500243059822,
"lm_q2_score": 0.855851143290548,
"openwebmath_perplexity": 1454.733835652903,
"openwebmath_score": 0.6757130026817322,
"tags": null,
"url": "http://pch-wiki.wikispaces.com/10.4+OFSA+Solutions?responseToken=004bbe007d7cd8b5a6b1266ce34c7f6c9"
} |
equation in the polar coordinate system. electric grid through a cyber attack or atmospheric nuclear blast, the Pentagon is taking steps to both protect. Ice bucket gets an unexpectedly chic update thanks to round shape and mixed materials. Polar grid coordinate dry erase boards and other dry erase polar grid options from OptiMA. You can modify certain aspects of polar axes in order to make the chart more readable. Individual grid display coloring is defined when editing a grid in the relevant grid editor (Cartesian Grid Editor dialog, or Polar Grid Editor dialog). View source: R/coord-polar. The polar grid tool in Illustrator is a powerful radial and line path creation tool in Illustrator CC 2020 2019 2018 2017 2015 2014 CS6 CS5 CS4 etc. Polar Coordinates Grid. Q: Governments are going to be spending billions on economic. for unmanned underwater vehicles (UUVs) in the polar region, a polar grid navigation algorithm for UUVs is proposed in this paper. There are certain times when the | {
"domain": "paginepets.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9799765557865636,
"lm_q1q2_score": 0.801203825813113,
"lm_q2_score": 0.8175744828610095,
"openwebmath_perplexity": 1954.5736140711267,
"openwebmath_score": 0.5762432217597961,
"tags": null,
"url": "http://mgdf.paginepets.it/polar-grid.html"
} |
acid-base, aqueous-solution, solubility, solutions
Title: How to filter out magnesium acetate (a soluble salt) quickly and cheaply from water I am conducting an experiment that involves reacting a weak acid and a weak base to form water and a salt with this overall equation
$$\ce{Mg(OH)2(s) + 2CH3COOH(l) <=> 2H2O(l) + Mg(CH3COO)2(aq)}$$
Currently, I am trying to filter out the salt to purify the water; however, there are specific restrictions.
The filtration process must be able to:
be done quickly. I can't wait a long time for the water to be distilled
be done at home. This filtration needs to be something that the average person can could do with household ingredients or ingredients they can buy at a drug store (Assume that the $\ce{Mg(CH3COO)2}$ solution is given to them pre-made) | {
"domain": "chemistry.stackexchange",
"id": 5481,
"lm_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, aqueous-solution, solubility, solutions",
"url": null
} |
polarization
There are, of course, correlations between the polarization that is initially absorbed and what polarizations can be emitted, since the angular momentum taken up in the absorption process determines the initial angular momentum state of the emission process, as well as which lower-energy orbitals are unoccupied. However, the correlations are complicated to express and not at all universal; they depend in detail on the identity and initial electron configuration of the atom. | {
"domain": "physics.stackexchange",
"id": 74319,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "polarization",
"url": null
} |
we can traverse every edge exactly once and return to the starting vertex. Click here to toggle editing of individual sections of the page (if possible). For a graph G to be Eulerian, it must be connected and every vertex must have even degree. Reading Existing Data. In other words, we can say that a graph G will be Eulerian graph, if starting from one vertex, we can traverse every edge exactly once and return to the starting vertex. In the above mentioned post, we discussed the problem of finding out whether a given graph is Eulerian or not. }$$ Then at any vertex other than the starting or ending vertices, we can pair the entering and leaving edges up to get an even number of edges. Graf yang mempunyai lintasan Euler dinamakan juga graf semi-Euler (semi-Eulerian graph). Is there a $6$ vertex planar graph which which has Eulerian path of length $9$? Euler proved the necessity part and the sufficiency part was proved by Hierholzer [115]. 3. Fortunately, we can find whether a given graph | {
"domain": "uoa.gr",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9678992932829917,
"lm_q1q2_score": 0.8187870797104523,
"lm_q2_score": 0.8459424295406088,
"openwebmath_perplexity": 524.4225499700382,
"openwebmath_score": 0.48435333371162415,
"tags": null,
"url": "http://e-pres.di.uoa.gr/xp3n0/semi-eulerian-graph-2fa2be"
} |
c++, strings, reinventing-the-wheel, floating-point
/**
* Calculates the maximum precision in the range of floating-point numbers.
*
* @param min The minimum value of the range.
* @param max The maximum value of the range.
*
* @return The maximum precision in the range.
*
* @throws None.
*/
int get_max_precision_in_range_for_float(const int min, const int max)
{
int precision = 100;
float f = min;
while (f < max)
{
float n = std::nextafter(f, FLT_MAX);
std::string s1 = std::to_string(f);
std::string s2 = std::to_string(n);
while (s1 == s2)
{
n = std::nextafter(n, FLT_MAX);
s2 = std::to_string(n);
}
int p = std::max(get_scale_of(s1), get_scale_of(s2));
if (p < precision)
{
precision = p;
// Debug outputs:
std::cout << "s1 = " << s1 << "\n";
std::cout << "s2 = " << s2 << "\n";
}
f = n;
}
return precision;
} | {
"domain": "codereview.stackexchange",
"id": 45305,
"lm_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, reinventing-the-wheel, floating-point",
"url": null
} |
asteroids, comets, interstellar
Question: What might cause astronomers like Dr. Battams be so confident that this object is a comet and not an asteroid, besides the fact that it's being called one? (Comet C/2019 Q4 (Borisov))
Is it just the orbit itself, or are there other observational data such as brightness in the infrared? It's the appearance that is mainly used to distinguish comets from asteroids. As noted in the discovery Minor Planet Electronic Circular (MPEC), numerous observers observed extended diffuse emission (i.e it looks "fuzzy" with a Full Width Half Maximum (FWHM) greater than the field stars, or shows a tail) typical of a comet. In the case of 1I/'Oumuamua, deep searches with 8-m telescopes failed to record any evidence for any extended emission, indicating it was most likely a bare rock. The much brighter magnitude of C/2019 Q4 does play a role in this, making a search for extended emission easier. | {
"domain": "astronomy.stackexchange",
"id": 3951,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "asteroids, comets, interstellar",
"url": null
} |
$$a_2 - S_2 = 3- 1/4 - (1 + 1/1! + 1/2!)$$ [I think there is some typo in your expression of $$S_n$$] $$= 1/4 = 1/(2 \cdot 2!)]$$. Suppose the equation holds for $$n$$. Then for $$n+1$$, \begin{align*} a_{n+1} - S_{n+1} &= a_n - S_n - \frac 1 {n(n+1) \cdot (n+1)!} - \frac 1{(n+1)!} \\ &= \frac 1 {n!n }-\frac 1 {n(n+1) \cdot (n+1)!} - \frac 1{(n+1)!} \\ &= \frac 1 {(n+1)! (n+1)} \left( \frac {(n+1)^2}n -\frac 1n -(n+1) \right)\\ &= \frac 1 {(n+1)! (n+1)}. \end{align*} Thus the equation holds for all $$n \geqslant 2$$ by induction principle. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9719924810166349,
"lm_q1q2_score": 0.85452405234596,
"lm_q2_score": 0.8791467722591728,
"openwebmath_perplexity": 530.4968236603773,
"openwebmath_score": 0.9999663829803467,
"tags": null,
"url": "https://math.stackexchange.com/questions/2943615/given-s-n-sum-dots-and-a-n-sum-dots-prove-that-a-n-s-n-1-over"
} |
c++, c++11, opengl, wrapper
It's good that you allow your buffer object type to be able to be given an already created buffer object. However, it's not good that you can give it such a buffer without allowing it to adopt ownership of that buffer. That is, if a user creates a buffer object and wants to wrap it in your type, and then allow your type to destroy it, that should be allowed.
Think about how unique_ptr works. Yes, there's make_unique, but you can give it a pointer you allocated yourself and it will delete it.
I'm not saying that this behavior should necessarily be the default. But if you're going to allow wrapping user-created buffers, you should also give the user the option to allow the wrapped buffer to delete it.
Regardless of any of that, this constructor must be explicit. Otherwise, buffer is implicitly convertible from integers, and that is something that can really get out of control. Do you really want someone to be able to pass NULL as the argument to a function that takes a buffer? | {
"domain": "codereview.stackexchange",
"id": 28030,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++11, opengl, wrapper",
"url": null
} |
solar-system, gas-giants, neptune, uranus
Title: Why do Uranus and Neptune have more methane than Jupiter and Saturn? So the standard theory of the solar nebula is that in the region of the gas planets, ice and rock could condense to form planetesimals, which could then accrete hydrogen and helium to form the gas giants. The giant planets are all mostly hydrogen and helium, but Uranus and Neptune have relatively large amounts of hydrogen compounds like methane (that's what gives them their color).
My question is: why did that happen? How did Uranus and Neptune get their methane? My impression is that all the gas giants were far enough out for methane to condense into ice, so how did Uranus and Neptune end up preferentially with methane?
Why does Uranus and Neptune have more methane than Jupiter and Saturn?
It's a combination of equations of state (EOS), serpentinization, and mixing (rotational and convective) that favors a preference for some reactions (and resulting compounds) over others.
See the references below. | {
"domain": "astronomy.stackexchange",
"id": 3031,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "solar-system, gas-giants, neptune, uranus",
"url": null
} |
c#, .net-datatable
}
private static void TestCreateDataReader(DataTable dt)
{
// Given a DataTable, retrieve a DataTableReader
// allowing access to all the tables' data:
using (DataTableReader reader = dt.CreateDataReader())
{
do
{
if (!reader.HasRows)
{
Console.WriteLine("Empty DataTableReader");
}
else
{
PrintColumns(reader);
}
Console.WriteLine("========================");
} while (reader.NextResult());
}
}
private static DataTable GetCustomers()
{
// Create sample Customers table, in order
// to demonstrate the behavior of the DataTableReader.
DataTable table = new DataTable(); | {
"domain": "codereview.stackexchange",
"id": 20407,
"lm_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-datatable",
"url": null
} |
How can I solve an impossible equation (three unknown and two equations) using linear algebra?
• It is not impossible to solve this equation system , the solution is just not unique. Nov 25, 2019 at 13:34
• This is just one of many solutions. Nov 25, 2019 at 13:34
• Relevant info (for those who don't look at the page you linked to): this example appears under the heading Least-Squares Solution of Underdetermined System. Nov 25, 2019 at 14:45
• By the way, Octave gives a different answer [0.91803, 3.54098, 1.27869], which is the solution of minimal norm, and agrees with the formula given in this answer. Does anyone know why Matlab picks the particular solution [0,4,2/3] instead?!? Nov 25, 2019 at 14:56
• Matlab tries to make the maximum number of elements zero. Nov 26, 2019 at 6:45
If there are fewer equations than unknowns, usually there are many solutions. It is not impossible, but indeterminate.
An extreme example is this: one unknown, but no equation ! | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9780517514031507,
"lm_q1q2_score": 0.8192356681838374,
"lm_q2_score": 0.837619959279793,
"openwebmath_perplexity": 341.3631900515109,
"openwebmath_score": 0.7105713486671448,
"tags": null,
"url": "https://math.stackexchange.com/questions/3450380/why-can-i-solve-an-impossible-equation-using-linear-algebra/3451310"
} |
go, game-of-life
return board{state:initialState, rows: len(initialState), columns: len(initialState[0])}, nil
}
func (b *board) Evolve() {
newState := make([][]int, b.rows)
for i := range newState {
newState[i] = make([]int, b.columns)
for j := range newState[i] {
newState[i][j] = nextStateForCell(b,i,j)
}
}
b.state = newState
}
func (b *board) State() [][]int {
return b.state
}
func (b *board) Rows() int {
return b.rows
}
func (b *board) Columns() int {
return b.columns
}
func (b *board) PrettyPrint() {
for i := range b.state {
for j := range b.state[i] {
print(" " + strconv.Itoa(b.state[i][j]) + "")
}
println()
}
}
func nextStateForCell(b *board, i,j int) int { | {
"domain": "codereview.stackexchange",
"id": 33047,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "go, game-of-life",
"url": null
} |
javascript, node.js, child-process
// Possibly elsewhere
for (let a = 0; a < deviceAmount; a++) {
let child = child_process.spawn("node", ["slave.js", a + 1]);
child.stdout.setEncoding("utf8");
child.stdout.on("data", function (data) {
process.stdout.write(data);
});
child.stderr.setEncoding("utf8");
child.stderr.on("data", function (data) {
process.stderr.write("ERROR: " + data);
});
child.on("close", function (code) {
process.stdout.write("Exited with code: " + code);
});
children.push(child);
} | {
"domain": "codereview.stackexchange",
"id": 43321,
"lm_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, node.js, child-process",
"url": null
} |
arrays
There is, to my knowledge, no fully satisfactory answer to this. That is, there is no purely functional data structure that provides constant time lookup and updates to all versions. You can make (externally) pure data structures that provide constant time lookup and update for the latest versions, but accesses to older versions of the array become slower. You can use monads or uniqueness types to enforce a usage of arrays that allows the compiler to use in-place updates, but this is tantamount to using an imperative approach (albeit in a controlled and contained manner). In practice, programmers in purely functional languages simply don't use arrays nearly as much as imperative programmers, and when they do use arrays, they tend to use bulk operations. If you are going to touch every element of an array anyway, then the cost of copying the array is constant per element. | {
"domain": "cs.stackexchange",
"id": 11882,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "arrays",
"url": null
} |
thermodynamics, statistical-mechanics, entropy, definition
Why does Second Law of Thermodynamics holds only for isolated systems?
How can I intuitively understand this? Is it just that it is always consistent with experimental results therefore assumed to be true? Is there some fundamental principle underlying this problem? Why do we state that Second Law of Thermodynamics holds only for isolated systems?
Because this is a theorem deduced by Clausius in 1865:
http://philsci-archive.pitt.edu/archive/00000313/
Jos Uffink, Bluff your Way in the Second Law of Thermodynamics, p. 37: "Hence we obtain: THE ENTROPY PRINCIPLE (Clausius' version) For every nicht umkehrbar [irreversible] process in an adiabatically isolated system which begins and ends in an equilibrium state, the entropy of the final state is greater than or equal to that of the initial state. For every umkehrbar [reversible] process in an adiabatical system, the entropy of the final state is equal to that of the initial state."
Clausius' deduction was based on three postulates: | {
"domain": "physics.stackexchange",
"id": 54038,
"lm_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, entropy, definition",
"url": null
} |
optics, geometric-optics, variational-principle, action, functional-derivatives
Title: Why does Fermat's principle (optics) not apply to all paths? Feynman's statement of Fermat's Principle regarding optics is the following,
"a ray going in a certain particular path has the property that if we make a small change (say a one percent shift) in the ray in any manner whatever, say in the location at which it comes to the mirror, or the shape of the curve, or anything, there will be no first-order change in the time; there will be only a second-order change in the time. In other words, the principle is that light takes a path such that there are many other paths nearby which take almost exactly the same time." | {
"domain": "physics.stackexchange",
"id": 50732,
"lm_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, geometric-optics, variational-principle, action, functional-derivatives",
"url": null
} |
javascript, performance, beginner, node.js
function makeRequest(config) {
axios(config)
.then( console.log("Notification sent!") )
.catch( (error) => console.log(error) );
} There are a bunch of things you can clean up to make the code more clean and professional looking:
Don't mix modern syntax with obsolete syntax - there are some syntactical constructs that have no business being in source code nowadays due to their pitfalls and disadvantages compared to more modern constructs. The most prominent issue here is the vars - if you're going to write in ES2015+ (which you should!), there should be no reason to use var - use const instead. (You can also use let, but only when you need to reassign the variable, which should not be common.) ESLint rules (strongly recommended): no-var, prefer-const.
There are lots and lots of places in your code where these two rules will show you where you can make improvements. | {
"domain": "codereview.stackexchange",
"id": 40186,
"lm_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, performance, beginner, node.js",
"url": null
} |
performance, matlab, machine-learning
for iter = 1:num_iters
% Derivative of the cost function used, the square error in that case.
dLogisticCostFunction = (1/m) * X' * (logisticFunction(X,theta) - y);
% Learning step
theta = theta - alpha * dLogisticCostFunction;
% Save the cost function for convergence analysis
J_history(iter) = logRegCostFunction(X,y,theta);
end
end
logistic function
function h = logisticFunction(X,theta)
% Compute the logistic function.
% If X is a matrix such as:
%
% x1_ x2_ x3_ .. xn_;
% [ x11 x12 x13 .. x1n;
% x21 x22 x23 .. x2n;
% .. .. .. .. .. ;
% xn1 xn2 xn3 .. xnn; ]
%
% and thetha' is a vector:
% [ t0, t1, t3 .. tn ]
%
% We calculate the logistic function:
% 1/ ( 1 + e^(-sum(x*theta)))
h = 1 ./ ( 1 + exp(-X*theta) );
end | {
"domain": "codereview.stackexchange",
"id": 13026,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, matlab, machine-learning",
"url": null
} |
quantum-mechanics, wavefunction, eigenvalue
Similarly, suppose an operator $O$ has degenerate spectrum at eigenvalue $n$, with orthonormal eigenfunctions $f_1$ and $f_2$. When a measurement of $O$ returns a value of $n$, can we in general determine what linear combination $c_1f_1+c_2f_2$ the collapsed state is in? Is the ratio $\frac{c_2}{c_1}$ perhaps given by the ratio $\frac{\langle f_2|S\rangle}{\langle f_1 | S\rangle}$, where $S$ is the state at the time of collapse? As you guessed in your comment, the usual formalism is to just discard all terms inconsistent with the measurement outcome and then re-normalize. Nothing is changed about the phases of existing terms consistent with the measurement.
A concrete example: If an operator $O$ has two eigenfunctions with eigenvalue 1, say $|1a\rangle$ and $|1b\rangle$, and the state before measurement is
$|\psi\rangle=\alpha_1|1a\rangle+ \alpha_2 |1b\rangle + \alpha_3|2\rangle$
then if the eigenvalue 1 is found, the state after measurement is | {
"domain": "physics.stackexchange",
"id": 65272,
"lm_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, eigenvalue",
"url": null
} |
classical-mechanics, mathematical-physics, lagrangian-formalism, variational-calculus, functional-derivatives
The chain rule
$$\tag{3} \frac{\delta f(t)}{\delta x(t)} ~=~\frac{\delta f(t)}{\delta y(t)}\frac{\delta y(t)}{\delta x(t)}\qquad\qquad(\leftarrow \text{Wrong!}) $$
for the 'same-time' FD (1) does not hold. Counterexample: Take $f(t)=y(t)^2$ and $y(t)=\dot{x}(t)$.
However, the usual FD $\frac{\delta F}{\delta x(t)}$ (where $F[x]$ is a functional) does satisfy a Leibniz rule
$$\tag{4} \frac{\delta (FG)}{\delta x(t)} ~=~\frac{\delta F}{\delta x(t)} G +F\frac{\delta G}{\delta x(t)}, $$
and a chain rule
$$\tag{5} \frac{\delta F}{\delta x(t)}~=~
\int dt^{\prime} ~\frac{\delta F}{\delta y(t^{\prime})}\frac{\delta y(t^{\prime})}{\delta x(t)}.$$ | {
"domain": "physics.stackexchange",
"id": 16229,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classical-mechanics, mathematical-physics, lagrangian-formalism, variational-calculus, functional-derivatives",
"url": null
} |
### Show Tags
16 Jun 2016, 05:41
4
36
00:00
Difficulty:
35% (medium)
Question Stats:
76% (01:46) correct 24% (02:07) wrong based on 821 sessions
### HideShow timer Statistics
If the positive integer n is added to each of the integers 69, 94, and 121, what is the value of n?
(1) 69 + n and 94 + n are the squares of two consecutive integers
(2) 94 + n and 121 + n are the squares of two consecutive integers
_________________
Manager
Joined: 21 Sep 2015
Posts: 80
Location: India
GMAT 1: 730 Q48 V42
GMAT 2: 750 Q50 V41
If the positive integer n is added to each of the integers 69, 94, and [#permalink]
### Show Tags
Updated on: 03 Aug 2016, 09:44
14
5
If the positive integer n is added to each of the integers 69, 94, and 121, what is the value of n?
(1) 69 + n and 94 + n are the squares of two consecutive integers
Difference between the two squares is 25 since 94-69=25. This difference is unique.
For example 4^2 - 3^2 = 7
5^2 -4^2 = 9 | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9289263306198164,
"lm_q1q2_score": 0.8255914407394848,
"lm_q2_score": 0.8887587890727755,
"openwebmath_perplexity": 1184.1059247428873,
"openwebmath_score": 0.5387687087059021,
"tags": null,
"url": "https://gmatclub.com/forum/if-the-positive-integer-n-is-added-to-each-of-the-integers-69-94-and-220424.html"
} |
pl.programming-languages, type-systems
So, I doubt this question is anywhere near research-level. But the answer to your question is, yes, there are such languages, and a lot, and the theory of such languages is already fairly well-researched. For a reference on dependent types, you might want to consult Chapter 2 of Advanced Topics in Types and Programming Languages (ATTAPL), or Software Foundations by Benjamin Pierce et al., and Type-Driven Development with Idris by Edwin Brady if you're more inclined to work with code. | {
"domain": "cstheory.stackexchange",
"id": 4264,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "pl.programming-languages, type-systems",
"url": null
} |
quantum-mechanics, classical-mechanics, path-integral, variational-principle, variational-calculus
$$\frac{\delta S[q]}{\delta q(t)}~=~0\tag{1}$$
vanishes at the stationary path $q$.
Let us Taylor-expand the action functional around the stationary path:
$$S[q+\delta q] ~=~S[q]
~+~\int_{[t_i,t_f]} \! \mathrm{d}t \underbrace{\frac{\delta S[q]}{\delta q(t)}}_{=0}\delta q(t)
~+~\frac{1}{2}\iint_{[t_i,t_f]^2} \! \mathrm{d}t~\mathrm{d}t^{\prime} \frac{\delta^2 S[q]}{\delta q(t)\delta q(t^{\prime})}\delta q(t)\delta q(t^{\prime})
~+~{\cal O}((\delta q)^3). \tag{2}$$
In our notation the quote of Sakurai on p. 119 below eq. (2.5.39) becomes: | {
"domain": "physics.stackexchange",
"id": 59418,
"lm_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, path-integral, variational-principle, variational-calculus",
"url": null
} |
cosmology, black-holes, hawking-radiation, multiverse
That question, where you are hypothesizing something, and 'wondering' if true, is a way to have others do your research. That is not what this site is. But I will answer it. The Hawking radiation is that from right outside the horizon of the BH, NOT from anywhere inside it. It happens because of the horizon, and is similar to that similar radiation due to other kinds of horizons, like that due to acceleration in Rindler spacetime. It does not happen near the singularity. As @JMLCarter said, Hawking radiation arises from quantum fields outside the horizon, and Hawking showed it was so using quantum field theory in a curved spacetime, meanwhile showing how that could be calculated and be consistent with theory, without having to consider gravity (or the curved spacetime) as a dynamical field. You cannot apply the same technique near the impending singularity as gravity is very much a dynamic field. You'd have to consider the changes to the spacetime, and in the process a full theory of | {
"domain": "physics.stackexchange",
"id": 45334,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cosmology, black-holes, hawking-radiation, multiverse",
"url": null
} |
proof-assistants, natural-deduction
discharged, and so it is essential to record this. But if we do this
in the exmaple above, this means we have to link the crossed A with
the line of the $\implies$I rule; but it is no longer a genuine tree
we are considering. | {
"domain": "cs.stackexchange",
"id": 11860,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "proof-assistants, natural-deduction",
"url": null
} |
homework-and-exercises, kinematics, time, speed, distance
Title: Speed in min/km given distance in meters and time in seconds How to calculate speed in min/km given distance in meters and time seconds? I used formula v = d/tbut having problems converting units.
I've tried ((distance_m/1000) / (time_sec/60)) and got something ~ 0.2 and I'm expecting something around 4:08 min/km Unit conversions are an important part of any science. Usually, to convert from one unit to another, you can just multiply by one or more conversion factors.
For example, to get ${min\over km}$ from ${m\over s}$ you convert $s$ to $min$ by the factor of $60 s\over 1 min$ and $m$ to $km$ by the factor of $1000 m \over 1 km$. To use the factors properly, flip them so that the units cancel properly. $$x{m\over s} * {60s\over 1min} * {1 km\over 1000 m} = x{60 km\over 1000 min}$$ | {
"domain": "physics.stackexchange",
"id": 42425,
"lm_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, kinematics, time, speed, distance",
"url": null
} |
let's say I let x=O,Y,I
then i would have the 5 consonants and 4 vowels so couldn't I conclude then that it is 5!x4!=2880
5. Hello, william;!
1. Calculate the number of ways the letters of the word OLYMPICS can be arranged if:
a) there are no restrictions
b) the arrangment begins with L and ends with P
c) the consonants are together (Y is a vowel here)
d) the O and S are not together
my thinking
a) 8!
b) 6!
Right!
c) The consonants are together.
We have 5 consonants and 3 vowels.
Duct-tape the consonants together.
. . Then we have 4 "letters" to arrange: . $\boxed{LMPCS},\,O,\,I,\,Y$
And there are $4!$ arrangements of the four "letters".
But in each arrangement, the 5 consonants can be ordered in $5!$ ways.
Therefore, there are: . $4! \times 5! \:=\:24 \times 120 \:=\:2,\!880$ arrangements
. . with the consonants together.
d) O and S are not together.
We know there are $8!$ possible arrangements.
Let's count the arrangement in which O and S are together. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9802808690122164,
"lm_q1q2_score": 0.8332104864343997,
"lm_q2_score": 0.8499711794579723,
"openwebmath_perplexity": 893.3547829173331,
"openwebmath_score": 0.8816826343536377,
"tags": null,
"url": "http://mathhelpforum.com/discrete-math/72184-permutations-factorials.html"
} |
c#, object-oriented, game, snake-game
Console.ForegroundColor = ConsoleColor.Green;
if (berryx == positions.xpos && berryy == positions.ypos)
{
score++;
berryx = randomnummer.Next(1, screenwidth - 2);
berryy = randomnummer.Next(1, screenheight - 2);
}
for (int i = 0; i < xpos.Count(); i++)
{
Console.SetCursorPosition(xpos[i], ypos[i]);
Console.Write("*");
if (xpos[i] == positions.xpos && ypos[i] == positions.ypos)
{
gameover = 1;
}
}
if (gameover == 1)
{
break;
}
Console.SetCursorPosition(positions.xpos, positions.ypos);
Console.ForegroundColor = positions.Black;
Console.Write("*"); | {
"domain": "codereview.stackexchange",
"id": 40750,
"lm_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, game, snake-game",
"url": null
} |
gravity, rotational-dynamics
Yes he can jump higher... unless he's standing on a pole.
This part is more complicated, I'll address more detail below
On Equator
If the astronaut jumps from the equator he leaves the ground from a point that has an apparent gravity (gravity combined with rotational acceleration) normal to the surface. For small jumps on a large asteroid, yes, he will make it back to the same spot. But what's the cutoff? I believe it would be the point at where orbital dynamics started to matter.
$$g = \frac{a}{r^2} + b \frac{V_x^2}{r}$$
I believe this would be the relevant equation, since $V_x$, the horizontal velocity in the CM frame, would be the invariant quantity. Say he jumps a distance $d$ upwards, then to the extent that $d (2 a / r^3 + b V_x^2/r^2) \ll a/r^2+b V_x^2/r $, he would land about in the same place. If this is not true he would land in a different place. I'm not entirely sure about this, but it's my best shot.
Poles | {
"domain": "physics.stackexchange",
"id": 1130,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gravity, rotational-dynamics",
"url": null
} |
c++, game, c++11, sdl
#include <iostream>
using namespace std;
SDL_Window* window; // holds window properties
SDL_Renderer* renderer; // holds rendering surface properties
SDL_Texture* font_image_score1; // holds text indicating player 1 score (left)
SDL_Texture* font_image_score2; // holds text indicating palyer 2 score (right)
SDL_Texture* font_image_winner; // holds text indicating winner
SDL_Texture* font_image_restart; // holds text suggesting to restart the game
SDL_Texture* font_image_launch1; // holds first part of text suggesting to launch the ball
SDL_Texture* font_image_launch2; // holds second part of text suggesting to launch the ball
Mix_Chunk *paddle_sound; // holds sound produced after ball collides with paddle
Mix_Chunk *wall_sound; // holds sound produced after ball collides with wall
Mix_Chunk *score_sound; // holds sound produced when updating score | {
"domain": "codereview.stackexchange",
"id": 14515,
"lm_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, c++11, sdl",
"url": null
} |
python, object-oriented, design-patterns
buid_pipeline.py
import sys
import json
import aws_pipeline
LAMBDA_FUNC_EXCEPTION = 'EXTERNALCONFIG'
def get_config_file():
'''
Gets the config file from the argument
'''
try:
return sys.argv[1]
except IndexError:
print "Error: config file is missing - please add."
sys.exit()
def read_config_file(config_file):
'''
Reads and returns the JSON object
'''
with open(config_file) as config:
data = json.load(config)
return data
def main():
'''
the main thang
'''
# get, read config file and make JSON accessible
config_file = get_config_file()
data = read_config_file(config_file)
# set various values
stream_name = data['stream']
firehose_name = data['firehose']
bucket_name = data['bucket']
prefix_name = data['prefix'] | {
"domain": "codereview.stackexchange",
"id": 20810,
"lm_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, object-oriented, design-patterns",
"url": null
} |
If they exist, they must be divisible by distinct primes, since two multiples of 3 can't differ by 2, two multiples of 5 can't differ by 2, etc. Might as well start with the smallest odd primes available — if we can do it for 3 and 5 it will certainly happen by 15. Well, a quick inspection shows that 10 and 12 are a multiple of 5 and a multiple of 3 separated by 2, but they're even and we want odds, which is a sign that we should have been be working mod 30 the whole time. So we add 15 to come up with 25 and 27.
Now we see:
If $$n \equiv 24 \pmod{30}$$ then $$n$$ is composite (divisible by 2).
If $$n \equiv 25 \pmod{30}$$ then $$n$$ is composite (divisible by 5).
If $$n \equiv 26 \pmod{30}$$ then $$n$$ is composite (divisible by 2).
If $$n \equiv 27 \pmod{30}$$ then $$n$$ is composite (divisible by 3).
If $$n \equiv 28 \pmod{30}$$ then $$n$$ is composite (divisible by 2). | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.981735721648143,
"lm_q1q2_score": 0.8094037284970695,
"lm_q2_score": 0.8244619306896955,
"openwebmath_perplexity": 226.44695393011563,
"openwebmath_score": 0.6438073515892029,
"tags": null,
"url": "https://math.stackexchange.com/questions/3296803/is-there-any-other-methods-to-prove-the-falsity-of-for-any-natural-number-n/3296880"
} |
ds.algorithms, graph-algorithms, counting-complexity
J. Scott Provan, Michael O. Ball: The Complexity of Counting Cuts and of Computing the Probability that a Graph is Connected. SIAM J. Comput. 12(4): 777-788 (1983)
Therefore, unless some complexity-theoretic collapse happens, you cannot get essentially faster algorithm than listing all of them. | {
"domain": "cstheory.stackexchange",
"id": 1233,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ds.algorithms, graph-algorithms, counting-complexity",
"url": null
} |
ros
Originally posted by KruseT with karma: 7848 on 2013-02-15
This answer was ACCEPTED on the original site
Post score: 2
Original comments
Comment by Hansg91 on 2013-02-15:
I was afraid that would be the answer. Since ROS appears to be moving towards catkin build packages, the best solution would be to convert this rosbuild package to a catkin build package?
Comment by Dirk Thomas on 2013-02-15:
You can only do that if all the packages your package depends on are already using catkin. Else they need to be converted before. | {
"domain": "robotics.stackexchange",
"id": 12913,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros",
"url": null
} |
opencv
Originally posted by NEngelhard with karma: 3519 on 2017-04-18
This answer was ACCEPTED on the original site
Post score: 3
Original comments
Comment by zubair on 2017-04-18:
no i dont have it now,, i will post soon my camera calibration values though,,
Comment by Martin Peris on 2017-04-18:
The only way to get the world coordinates of an object with a monocular camera is if you know the intrinsic parameters of the camera, you know the geometry of the object and you can detect at least 3 known points of the object in the image.
Comment by zubair on 2017-04-19:
i will post my camera intrinsics today
Comment by zubair on 2017-04-19:
guys, soon after having my camera calibration values,, what next i need to do convert these values in meters or find the blob distance from the camera ???
thanks
Comment by zubair on 2017-04-21:
so, i got it working guys,, closing this now,, with remark answer has been excepted because i dont have any other relevant option to select there | {
"domain": "robotics.stackexchange",
"id": 27632,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "opencv",
"url": null
} |
javascript, jquery
Title: Responsive Navigation The following responsive navigation on JSfiddle works well, however I am just wondering whether there is any way to improve what I have done. I am new at JQuery so all help appreciated: JSFiddle here
$(document).ready(function () {
$(".menu").click(function () {
$('#menu').animate({
'left': '0px'
});
});
$("#close").click(function () {
$('#menu').animate({
'left': '-100px'
});
});
$(".menu").click(function () {
$('#container').animate({
'left': '100px'
});
});
$("#close").click(function () {
$('#container').animate({
'left': '0px'
});
});
}); Instead of attaching multiple click handlers for the same element, you should just combine them into one function:
$(document).ready(function () {
$(".menu").click(function () {
$('#menu').animate({
'left': '0px'
}); | {
"domain": "codereview.stackexchange",
"id": 10776,
"lm_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",
"url": null
} |
then you can remember the inverse functions the... In terms of x is one over one plus x squared, and arctan x! I have limited diskquota tan y = x 2 ) Nov 10, 2008 1! > Last edited by a moderator: Nov 10, 2008 ; Nov 10, 2008 ; 10... One over one plus x squared derivative arctangent arccot x = -1 1 + x:... To use this general formula arcsine function of x is a number arcsin ( x ) 1/. Gradshteyn and Ryzhik 2000, p. 124 ) or Arthz ( Gradshteyn and Ryzhik 2000 p.!, 2008 ) returns 0 derivative arctangent convention is used throughout article! Applying the chain rule in your problem! ` ) returns 0 derivative arctangent Thread merge > Last. Divide by cos 2 ( y ) dy/dx square root of ( 2... 2 ( y ) = 1/ ( x^2 + 1 ), arccos ( x ) =! Second derivative for arctan is \\frac { -2x } { ( 1+x^2 ) ^ { -2 } use. So we 're going to use the chain rule x 2: arccot x = 1 +. Functions, but i have limited diskquota # 1 aurdav, x is one over one plus x squared and. Sec 2 ( y ) = ( â +, + ) professionals... | {
"domain": "gmina.pl",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9796676496254957,
"lm_q1q2_score": 0.8076986733936143,
"lm_q2_score": 0.8244619220634456,
"openwebmath_perplexity": 1079.0722822436946,
"openwebmath_score": 0.8275403380393982,
"tags": null,
"url": "http://chodel.gmina.pl/c0jfp8/ee20ae-derivative-of-arctan"
} |
of A will be denoted by either jAj or det(A). The transpose is found by exchanging the rows with columns and columns with rows. The program must accept two integers M and N as the input. to multiply matrices doesn't require that I transpose one of them first. Now we can represent the 4x4 matrix as a 2x2 matrix: Working with 2x2 matrix multiplication is much easier. Its inverse form is basically transpose the 3x3 rotation matrix, and rescale it, and change translation part by doing dot product with 3 rescaled axes. TRS(newVector3(6, 7, 8), Quaternion. Free matrix transpose calculator - calculate matrix transpose step-by-step. for all i and j. Similarly, the determinant of a square matrix is the product of all its eigenvalues with multiplicities. Using this online calculator, you will receive a detailed step-by-step solution to your problem, which will help you understand the algorithm how to find the transpose matrix. transpose() and numpy. Register free for online tutoring session to | {
"domain": "maboan.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9777138105645058,
"lm_q1q2_score": 0.821019501314712,
"lm_q2_score": 0.8397339716830606,
"openwebmath_perplexity": 530.073518005604,
"openwebmath_score": 0.5283272862434387,
"tags": null,
"url": "http://maboan.de/transpose-matrix-4x4.html"
} |
java, beginner, stack
Title: Array Implementation of Stack I've implemented the basic logic of a stack data structure. How can I make this code more generic? Is there any better way to display the stack contents?
StackMethods.java
import java.util.Arrays;
public class StackMethods {
private int top;
int size;
int[] stack ;
public StackMethods(int arraySize){
size=arraySize;
stack= new int[size];
top=-1;
}
public void push(int value){
if(top==size-1){
System.out.println("Stack is full, can't push a value");
}
else{
top=top+1;
stack[top]=value;
}
}
public void pop(){
if(!isEmpty())
top=top-1;
else{
System.out.println("Can't pop...stack is empty");
}
}
public boolean isEmpty(){
return top==-1;
}
public void display(){ | {
"domain": "codereview.stackexchange",
"id": 9816,
"lm_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, stack",
"url": null
} |
physical-chemistry, quantum-chemistry, redox, bond, ions
Larger and heavier atoms and molecules exhibit stronger dispersion forces than smaller and lighter ones. In a larger atom or molecule, the valence electrons are farther from the nuclei than in a smaller atom or molecule. They are less tightly held and can more easily form temporary dipoles (e.g., $\ce{Cl2}$ is a gas at room temperature and $\pu{1 atm}$ pressure, while $\ce{Br2}$ is a liquid and $\ce{I2}$ is a solid under the same conditions).
The strength of London dispersion forces varies according to molecular shapes. For example, $n$-$\ce{C5H12}$ and $neo$-$\ce{C5H12}$ are both pentanes, but former is more cylindrical shape while the latter is more spherical shape. Although, both have the same molar mass, $n$-pentane is a liquid (average boiling point of pentanes: $\pu{36.1 ^\circ C}$) at room temperature and $\pu{1 atm}$ pressure, while $neo$-pentane is a gas (boiling point: $\pu{9.5 ^\circ C}$) under the identical conditions. | {
"domain": "chemistry.stackexchange",
"id": 15178,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "physical-chemistry, quantum-chemistry, redox, bond, ions",
"url": null
} |
ds.algorithms, reference-request, optimization, heuristics
Title: Successful application of branch-and-bound methods for NP-hard problems Branch and bound is an effective heuristic for search problems, and Wikipedia lists a number of hard problems where branch-and-bound has been used. However, I haven't been able to find references to suggest that it's more than just "one method" for solving these problems.
Anecdotally, I've heard that some of the best heuristics for SAT and integer programming come from branch and bound, so my question is:
Can someone point me to any references detailing effective uses of
branch and bound for NP-hard problems ? For TSP, checkout this book...
http://www.tsp.gatech.edu/book/index.html
My understanding is that there is no one tool to kill them all. Arguably any recursive solution deploying backtracking and some scoring function is using branch and bound. As such, a large fraction of solvers to NP hard problems use some form of branch and bound. | {
"domain": "cstheory.stackexchange",
"id": 1061,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ds.algorithms, reference-request, optimization, heuristics",
"url": null
} |
classical-mechanics, statistical-mechanics, phase-space, time-evolution, ergodicity
On the other hand, from a microscopic point of view, these cells are already infinitely large - in the sense that the ideal thermodynamic limit, that strictly speaking requires an infinite volume, already hold to a sufficient approximation. (The errors in bulk scale with $N^{-1/2}$ for $N$ particles, which is small already for macroscopically very tiny cells.) Thus one can apply all arguments from statistical mechanics to the cells.
To the extent that one believes that an ergodic argument applies to the cell, it will justify (subjectively) the statistical mechanics approximation. However, the ergodic argument is theoretically supported only in few situations, and should be regarded more as a pedagogical aid for one's intuition rather than as a valid tool for deriving results. | {
"domain": "physics.stackexchange",
"id": 41253,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classical-mechanics, statistical-mechanics, phase-space, time-evolution, ergodicity",
"url": null
} |
homework-and-exercises, newtonian-mechanics, momentum, conservation-laws, collision
I'll leave it to you to get the non-trivial solution. | {
"domain": "physics.stackexchange",
"id": 74345,
"lm_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, momentum, conservation-laws, collision",
"url": null
} |
machine-learning, r, clustering
Title: Clustering mixed data I have 90000 records for customer segmentation consisting of numeric nominal and ordinal variables:
*houselhold_ID* ID for household
*quantity*: integer, number of products bought
*price*: values 1 to 3 with 1 for 0-5, 2 for 5-8 and 3 for 8-10
*product name*: nominal values 1 to 9 representing 9 different products like different kind of cheese...
*duration*: days from the current buy to the next buy.
*age*: catgeorical age groups: 1: 0-24 years, 2: 25-39 years, 3: 40-59 etc.
*salary*: 1: to 1499 2 : 1500 bis 2499 3 : 2500 bis 3499 4 : 3500 or more
*number_of_persons_household*: integer
*price_con*: price conscious: 1 to 4 for not price conscious
to very price conscious
*education*: 1 to 3 for lower education to high school/university. | {
"domain": "datascience.stackexchange",
"id": 2235,
"lm_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, r, clustering",
"url": null
} |
c++, object-oriented, socket, callback, tcp
// stop comms thread created from a (possible) previous connection
stop_comms_channel();
// start reading thread now that we know connection arguments are valid
start_comms_channel();
ret = ::connect(pimpl_->socket_, reinterpret_cast<sockaddr *>(&target), sizeof(sockaddr));
if (ret != 0) {
ret = WSAGetLastError();
if (ret == WSAEWOULDBLOCK) {
// normal asynchronous connection
ret = 0;
}
else {
char* s = NULL;
FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, ret,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
s, 0, NULL);
exception_event(ERR_INFORMATIONAL, s);
}
}
return ret == 0;
}
bool tcpclient::is_connected() const {
return connected_;
} | {
"domain": "codereview.stackexchange",
"id": 20666,
"lm_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, socket, callback, tcp",
"url": null
} |
• I tried to format the question such that it excludes all the "trivial" answers, i.e. "no, because you can just take this function and multiply by any constant to get another function that dominates it and still converges". The constant thing is just excluded by the fact that the limit has to diverge, rather than be equal to some constant, but something similar could still possibly happen. I tried to include a sort of "parameter" on $f$ to patch this, but I couldn't get it formal. But the sort of "philosophy" of the question is about the form of the function, rather than a "cop-out" like that. – Electric Moccasins Feb 5 at 21:16
• How about $f(x) = \frac{1}{x\ln^2(x)}$ for your first question – Jakobian Feb 5 at 21:19
• It's a good question; part of a good answer will surely be to identify the most fruitful way to make the vague intuition behind it more precise. – Henning Makholm Feb 5 at 21:21 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9752018398044143,
"lm_q1q2_score": 0.8062108563203465,
"lm_q2_score": 0.8267117876664789,
"openwebmath_perplexity": 347.40856294178684,
"openwebmath_score": 0.85881108045578,
"tags": null,
"url": "https://math.stackexchange.com/questions/3101694/is-there-a-greatest-function-that-converges"
} |
quantum-algorithms, mathematics, cryptography, cryptocurrency, quantum-money
A. Molina, T. Vidick, and J. Watrous. Optimal counterfeiting attacks
and generalizations for Wiesner's quantum money. Proceedings of the
7th Conference on Theory of Quantum Computation, Communication, and
Cryptography, volume 7582 of Lecture Notes in Computer Science, pages
45–64, 2013. (See also arXiv: 1202.4010.) | {
"domain": "quantumcomputing.stackexchange",
"id": 71,
"lm_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, mathematics, cryptography, cryptocurrency, quantum-money",
"url": null
} |
ros
-- ~~ - rqt_logger_level
-- ~~ - rqt_moveit
-- ~~ - rqt_msg
-- ~~ - rqt_nav_view
-- ~~ - rqt_plot
-- ~~ - rqt_pose_view
-- ~~ - rqt_publisher
-- ~~ - rqt_py_console
-- ~~ - rqt_reconfigure
-- ~~ - rqt_robot_dashboard
-- ~~ - rqt_robot_monitor
-- ~~ - rqt_robot_plugins (metapackage)
-- ~~ - rqt_robot_steering
-- ~~ - rqt_runtime_monitor
-- ~~ - rqt_service_caller
-- ~~ - rqt_shell
-- ~~ - rqt_srv
-- ~~ - rqt_tf_tree
-- ~~ - rqt_top
-- ~~ - rqt_topic
-- ~~ - rqt_web
-- ~~ - smach
-- ~~ - smclib
-- ~~ - std_msgs
-- ~~ - actionlib_msgs
-- ~~ - bond
-- ~~ - diagnostic_msgs
-- ~~ - geometry_msgs
-- ~~ - eigen_conversions
-- ~~ - kdl_conversions
-- ~~ - move_base_msgs
-- ~~ - nav_msgs
-- ~~ - rosgraph_msgs
-- ~~ - rqt_py_common
-- ~~ - sensor_msgs
-- ~~ - image_geometry
-- ~~ - map_msgs
-- ~~ - pcl_msgs
-- ~~ - shape_msgs
-- ~~ - smach_msgs
-- ~~ - std_srvs
-- ~~ - stereo_msgs
-- ~~ - tf2_msgs
-- ~~ - tf2
-- ~~ - trajectory_msgs | {
"domain": "robotics.stackexchange",
"id": 26369,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros",
"url": null
} |
soft-question, conferences
Try to be simple and direct. Most attendees will also have spent part of their mental energy on previous presentations. Chances are they will forget about your paper very soon (there are too many to remember for a human mind!). Your goal is to make them to remember something about your paper.
Leave the proofs out. You can briefly mention the proof technique if relevant, though ("by reduction to problem XYZ").
Provide the definitions and statements -- if they are very technical, you can be a bit vague ("under some regularity conditions..."). Clarity trumps precision here. Provide some background for people not in the field, but do not waste time in reviewing basic definitions. Here it is important to know what the audience is familiar with, which depends on the venue. E.g. in a TCS conference, everyone knows what a non-deterministic Turing machine is. | {
"domain": "cstheory.stackexchange",
"id": 3758,
"lm_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, conferences",
"url": null
} |
ros2
Title: Why doesn't ros2 pkg list show the packages that I built?
Hi,
I am making a new ros2 node, but it is not showing up in the package list (similar to Why doesn't ros2 pkg list show the packages that I built?, but I believe I've sourced things correctly). I first build the minimal_publisher and minimal_subscriber and this worked fine. I then copied the pendulum_msgs demo to build a custom message (obstacle_msgs) and this works fine. Lastly I wanted to create a new node (obstacle_publisher) which based off minimal_publisher and have it use the newly defined message, but its not getting installed for ros2 to find (the first 3 example are).
CMakeList.txt:
cmake_minimum_required(VERSION 3.5)
project(obstacle_publisher)
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif() | {
"domain": "robotics.stackexchange",
"id": 33202,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros2",
"url": null
} |
synthesis, atoms, nuclear-chemistry
Secondly, you will notice the asterisk (*) in the 1st, 3rd and 4th equations. This denotes the compound nucleus which initially forms in the fusion reaction. It is an extremely ($<10^{-21}$s) short lived intermediate state, not the ground state of a nucleus, but more like a highly excited state. It's formation is not considered creating a new element. It is critical to the strategy of forming an element that the intermediate state loss energy through neutron "evaporation". Notice that in the second equation, the step of the neutrons evaporating is shown, while the intermediate state is not shown. Generally speaking, in the hot fusion strategy, 3-5 neutrons will evaporate to cool the intermediate state.
For further reading see:
Future of superheavy element research: Which nuclei could be synthesized within the next few years? and
The discovery of the heaviest elements Rev. Mod. Phys. 72, 733 | {
"domain": "chemistry.stackexchange",
"id": 2618,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "synthesis, atoms, nuclear-chemistry",
"url": null
} |
space-time, special-relativity
Yes. You would have to wait 4.5 billion years to see the observer at point A looking back at you through his telescope. You would now be looking at a cooling hunk of molten rock with no moon or oceans.
No. If you waited 4.5 billion years and saw Observer A, he would have been dead for 4.5 billion years by the time you see him. In fact, his Sun would likely be expanding to the point of burning his planet to a cinder if not engulfing it entirely. But of course, you would have to wait another 4.5 billion years to see that. You would be observing the photons that bounced off Observer A all that time ago and have been traveling ever since. It is important to note that this is not him, and does not mean he still exists.
Hopefully this answers your question, though it doesn't have much to do with Special Relativity, it's still good blow-your-mind stuff. It's just speed of light stuff which we really knew and measured (albeit inaccurately) long before Einstein. | {
"domain": "astronomy.stackexchange",
"id": 2121,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "space-time, special-relativity",
"url": null
} |
c#, thread-safety, locking
You don't need bool append = File.Exists(strLogFile);, just use new
StreamWriter(strLogFile, true). According to the documentation, the
Boolean parameter has no effect if the file does not exist
you can just use true for append so no need to check if the file exists.
although braces {} are optional for single line if..else statements you really should use them because they will make your code less error prone.
Applying this will lead to
static void WriteLogToFile(string strLogMessage, string strLogFile)
{
using (StreamWriter swLog = new StreamWriter(strLogFile, true))
{
swLog.WriteLine(strLogMessage);
}
} | {
"domain": "codereview.stackexchange",
"id": 16303,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, thread-safety, locking",
"url": null
} |
python, calculator, tkinter
Buttons
You already know about unpacking, let's leverage that to remove all your button_X functions. Their main purpose is to transform a multi-parameter function like your do_xxx_mode into a parameter-less function suitable for the button command argument. But you can create them on the fly:
def create_button(root, text, row, col, *command):
if not command:
on_click = None
else:
command, *arguments = command
def on_click():
command(*arguments)
button = tk.Button(root, text=text, padx=20, pady=20, command=on_click)
… | {
"domain": "codereview.stackexchange",
"id": 45012,
"lm_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, calculator, tkinter",
"url": null
} |
c++, strings, c++11
namespace wu_manber {
namespace { // anonymous namespace, things in here are "private" to wu_manber namespace
// fast mod (ref: https://www.youtube.com/watch?v=nXaxk27zwlk&feature=youtu.be&t=56m34s)
unsigned int fastmod(const int input, const int ceil) {
// apply the modulo operator only when needed
return input >= ceil ? input % ceil : input;
}
}
template<typename CharType>
class WuManber {
public:
using StringType = std::basic_string<CharType>;
WuManber(unsigned short HBITS = 4, size_t tableSize = 32768) :
isInitialized_(false), m_(0), k_(0),
HBITS_(HBITS), tableSize_(tableSize)
{
shiftTable_ = new size_t[tableSize_];
hashPrefixTable_ = new std::vector<PatternHash>[tableSize_];
alphabetSize_ = pow(2, 8 * sizeof(CharType));
isShortPatternExist_ = false;
}
~WuManber() {
delete []shiftTable_;
delete []hashPrefixTable_; | {
"domain": "codereview.stackexchange",
"id": 36028,
"lm_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, c++11",
"url": null
} |
javascript, html, css
</tbody>
</table>
</div>
<div id="gallery">
</div>
following is my css:
body{
position: relative;
}
#header{
height: 160px;
background-color:black;
width: 960px;
position: relative;
}#logo{
position: absolute;
width:300px;
height:140px;
left:40px;
background-color: grey;
top: 10px;
}
#headercontent2, #headercontent1{
position: absolute;
width:140px;
height:140px;
right:40px;
background-color: grey;
top: 10px;
}
#headercontent1{right:200px;}
#buttons-container{
position:absolute;
top:180px;
left:0px;
height:60px;
width:960px;
background-color:black;
}
#panels-container{
position:absolute;
top:260px;
left:0px;
}
#panel1,#panel2,#panel3{
position:absolute;
left:0px;
height:300px;
width:300px;
background-color:cyan;
}
#panel2{
left:320px;
}
#panel3{
left:640px;
} | {
"domain": "codereview.stackexchange",
"id": 2445,
"lm_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, html, css",
"url": null
} |
python, beginner, object-oriented
Note that I followed Python's official style-guide, PEP8, which recommends using lower_case for variables and functions, spaces after commas and around = when using it as an assignment, but no space around the = when using it for keyword arguments.
Comparisons to None should always be done with is or is not and if conditions don't require parenthesis, since it is a keyword.
I also explicitly named the column names (they might be called differently, judging by UserName, so you would have to fix that), to ensure that you can change the table structure, as long as these names stay the same.
And I used an f-string for easy formatting in case of an invalid password. Note that in this case you do reveal the actual password (I guess this is just for testing, just make sure you don't forget to remove that information later). In a similar vein, you should not store passwords in plaintext. Hash them with a good hashing algorithm and ideally add a salt. | {
"domain": "codereview.stackexchange",
"id": 37323,
"lm_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, object-oriented",
"url": null
} |
homework-and-exercises, newtonian-mechanics, pressure, harmonic-oscillator, fluid-statics
(Here's link to a similar post, but which doesn't resolve my confusion.) Suppose you do a force balance on the portion of the fluid situated between elevations z and $z +\Delta z$ in the left column. You get: $$p(z+\Delta z)S-p(z)S+\rho g S\Delta z=\rho S\Delta z \frac{dv}{dt}\tag{1} $$where $v$ is the downward velocity in the left column:$$v=-\frac{dx}{dt}\tag{2}$$ The latter equation is correct because the fluid is incompressible. If we divide Eqn. 1 by $S\Delta z$ and take the limit as $\Delta z$ approaches zero, we obtain:$$\frac{\partial p}{\partial z}+\rho g=-\rho\frac{d^2x}{dt^2}\tag{3}$$
Eqn. 3 applies to the region above point A in the left column. Similarly, for the horizontal region between points A and B, we have: $$\frac{\partial p}{\partial y}=-\rho\frac{d^2x}{dt^2}\tag{4}$$where y is the horizontal coordinate measured from A to C. Finally, for the right hand column above point B, we have: $$\frac{\partial p}{\partial z}+\rho g=+\rho\frac{d^2x}{dt^2}\tag{5}$$ | {
"domain": "physics.stackexchange",
"id": 32033,
"lm_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, pressure, harmonic-oscillator, fluid-statics",
"url": null
} |
special-relativity, spacetime, time, time-dilation
But if you are in the frame of one of the particles, then the signal from the other (approaching) particle will reach you first and therefore you will conclude that it reached 0.9 before the particle in your reference frame.
Equivalently, suppose you will trigger emitters at +/- 0.9 with a signal when you are equidistant from them. Depending on your reference frame, your signal could reach the emitters at the same time or one could be triggered before the other.
Either way, you will need to account for this head start when determining when the particles will strike the target. | {
"domain": "physics.stackexchange",
"id": 95872,
"lm_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, spacetime, time, time-dilation",
"url": null
} |
java, serialization
private static Integer asInteger(String value) {
try {
return Integer.parseInt(value);
} catch (NumberFormatException ex) {
return null;
}
}
}
So, what do you think? I'm suggesting this serialize-method:
return input
// convert items to strings
.map(serializer::serialize)
// check for illegal values
.peek(line -> {
if (line.contains(ENDL)) {
throw new IllegalArgumentException(
"The line serializer may not return the new line " +
"character in its output.");
}
})
// join them together to one text
.collect(Collectors.joining(ENDL));
And this deserialize-method:
// split text at line breaks
String[] elements = text.split(ENDL);
return Arrays.stream(elements)
// turn every item into a java object
.map(deserializer::deserialize);
My changes: | {
"domain": "codereview.stackexchange",
"id": 17252,
"lm_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, serialization",
"url": null
} |
Another easy way of seeing that the probability must be $\frac{1}{2}$ for each of the two players (and in general, $\frac{1}{n}$ for each of $n$ players): we can build a one-to-one map from configurations where player A wins to configurations where player B wins by simply swapping the two cards drawn - that is, the configuration where A wins by drawing the 9 of Spades while B draws the 4 of Clubs maps to a configuration where A loses by drawing the 4 of Clubs while B draws the 9 of Spades. This means there must be exactly as many drawings where B wins as where A wins, and so each player has a 50-50 chance of winning. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.970687766704745,
"lm_q1q2_score": 0.8231119370762988,
"lm_q2_score": 0.8479677660619633,
"openwebmath_perplexity": 234.60657724386604,
"openwebmath_score": 0.8116822838783264,
"tags": null,
"url": "http://math.stackexchange.com/questions/232963/which-player-is-most-likely-to-win-when-drawing-cards"
} |
c++, abstract-factory, variant-type
/**
* @brief Calls cb for an "empty" of type with index
*/
template<class Variant, class Callback, class ... Args>
decltype(auto) on_type_index(size_t index, Callback&& cb, Args&&... args)
{
static constexpr auto vtable = create_vtable<Variant, Callback, Args...>();
vtable[index](std::forward<Callback>(cb), std::forward<Args>(args)...);
}
Sometimes, you want to an type of a particular index in an std::variant,
Yes, you can do that with std::variant_alternative_t, which you are already using in your code.
and do something with that type without having an actual object. | {
"domain": "codereview.stackexchange",
"id": 43768,
"lm_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++, abstract-factory, variant-type",
"url": null
} |
demodulation, derivation, cyclostationary-random-process
Title: Cyclic spectrum equality to spectral correlation density As long as I know, the cyclic auto-correlation is defined as:
$$R_x^\alpha\left(\tau\right)=\lim_{\Delta t\rightarrow\infty}\frac{1}{\Delta t}\int_{-\Delta t/2}^{\Delta t/2}x\left(t-\frac{\tau}{2}\right)x^*\left(t+\frac{\tau}{2}\right)e^{-2\pi j\alpha t}dt$$
and the cyclic spectrum is defined as:
$$S^\alpha_x\left(f\right)=\int_{-\infty}^{\infty}R_x^\alpha\left(\tau\right)e^{-2\pi j f \tau}d\tau$$
Now, the cyclic spectrum is also equivalent to the spectral correlation function which is defined as:
$$S^\alpha_x\left(f\right)=\lim_{\Delta f \rightarrow 0}\lim_{\Delta t \rightarrow \infty}\frac{1}{\Delta t}\int_{-\Delta t/2}^{\Delta t/2}\Delta f X_{1 / \Delta f}\left(t, f + \frac{\alpha}{2}\right)X_{1 / \Delta f}^*\left(t, f - \frac{\alpha}{2}\right)dt$$ | {
"domain": "dsp.stackexchange",
"id": 10869,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "demodulation, derivation, cyclostationary-random-process",
"url": null
} |
soft-question
Title: How to find a reference that is 'to be published'? How to find the references in the papers looks like e.g. that:
P.Moller, J.R.Nix and W.J.Swiatecki, Proc. Winter Workshop on nuclear dynamics V, SunValley, Idaho, 1988, to be published.
When I encountered this kind of reference before, I always gave up. But this reference seems important for me now. Usually putting title and authors in a search gives a handle . putting "P.Moller, J.R.Nix and W.J.Swiatecki, Proc. Winter Workshop on nuclear dynamics V, SunValley, Idaho, 1988" I got a number of references.
Then looking in there one can find a reference if the authors exist in later papers, since usually people keep on working on the same lines.
I found this reference, and searching it one sees a number of entries for the first author, which are references to published papers.
You can continue from those. | {
"domain": "physics.stackexchange",
"id": 39727,
"lm_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",
"url": null
} |
navigation, ros-kinetic, robot-localization
Title: position estimation only based on geometry_msgs::Twist
Hi,
I am using Rosbot 2.0 pro, running kinetic (can't upgrade due to some dependencies).
So far I used the rosbot_ekf package (which calls the robot_localization package) for navigation ( rostopics like /odom, /pose are available).
As far as I understand robot_localization calculates the position based on sensor data from wheel encoders, IMU etc.
I would like to compare this estimated value (the most likely position) with my "ground truth" (where the robot should have been, if it would work without errors).
For example when I execute following command (in position [x = 0,y = 0, z=0]) :
rostopic pub -1 /cmd_vel geometry_msgs/Twist wist "linear: x: 1.0 y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 0.0"
the robot_localization might return a new position [x = 1.01, y= -0.001, z=0] because it detected some wheel slips etc.
However the value I am missing is the "ground truth" of [x = 1.00, y=0.0, z=0]. | {
"domain": "robotics.stackexchange",
"id": 37513,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "navigation, ros-kinetic, robot-localization",
"url": null
} |
fact. It then follows that = † † = † = † = † † =. Thus, If lambda_1 through lambda_n are distinct, then they each correspond to distinct eigenvectors v_1 through v_n for A and v_1T through v_nT for A^T. Its eigenvalues. Those are the numbers lambda 1 to lambda n on the diagonal of lambda. If is an eigenvector of the transpose, it satisfies By transposing both sides of the equation, we get. What goes wrong The diagonal entries of Λ are the eigenvalues of A, and the columns of U are the eigenvectors of A. The transpose of matrix A is represented by $$A'$$ or $$A^T$$. when A is symmetric A=A^T. The eigenvalues of a matrix are on its main diagonal because the main diagonal remains the same when the matrix is transposed, and a matrix and its transpose have the same eigenvalues. Choose the correct answer below. That's just perfect. For the covariance or correlation matrix, the eigenvectors correspond to principal components and the eigenvalues to … acknowledge that you have read and | {
"domain": "levonline.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9334308110294983,
"lm_q1q2_score": 0.819063866407941,
"lm_q2_score": 0.8774767842777551,
"openwebmath_perplexity": 373.11426350705506,
"openwebmath_score": 0.8160443902015686,
"tags": null,
"url": "http://midnattssolsrallyt.com.php54.levonline.com/mrs-doubtfire-xwcehnm/dac93d-parallel-concurrent%2C-and-distributed-programming-in-java-github"
} |
c#
public AuthenticationResult Authenticate()
{
switch (authenticationResponse.Status)
{
case AuthenticationStatus.Authenticated:
{
return Authenticated();
}
case AuthenticationStatus.Canceled:
{
return AuthenticationFailed(ConnectionStatus.Canceled, Common.Resources.Authentication.CanceledAtProvider);
}
case AuthenticationStatus.Failed:
{
return AuthenticationFailed(ConnectionStatus.Faulted, authenticationResponse.Exception.Message, authenticationResponse.Exception);
}
default:
{
return AuthenticationFailed(ConnectionStatus.Faulted, authenticationResponse.Exception.Message, authenticationResponse.Exception);
}
}
} | {
"domain": "codereview.stackexchange",
"id": 2028,
"lm_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
} |
set-cover
Title: How efficiently can one find small subcovers for integer intervals? This question is inspired by one of my professors giving out
sequential lecture notes that have a significant amount of overlap :-).
What is known about the following problems?
Given a set of integer intervals whose union is an integer interval, find a subset
with the same union that minimizes the number of intervals in the subset.
Given a set of integer intervals whose union is an integer interval, find a subset with the
same union that minimizes the sum of the cardinalities of the intervals in the subset. Let me restate the first problem:
Problem: Given a set of intervals $\mathcal{S} = \{ I_1, I_2,\ldots,I_n\}$, minimize $|\mathcal{C}|$, where $ \mathcal{C} =\{ I_{j_1}, I_{j_2},\ldots,I_{j_k}\} \subseteq\mathcal{S} $ and
$ \bigcup_{l=1}^{n}I_l = \bigcup_{m=1}^{k}I_{j_m} $
Define: Graph $G(V,E)$, $V = \{v_1, v_2, \ldots, v_n ,s ,t \}$ where, | {
"domain": "cstheory.stackexchange",
"id": 2304,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "set-cover",
"url": null
} |
So the reason we don't use \displaystyle \begin{align*} 2\pi\,r \end{align*} is because that gives us the length of the circumference. But for an angle, all that we want to know is how many lengths of the radius there ARE on the circumference.
Does that make sense?
3. ## Re: Radians
Hey sakonpure6.
The reason is that radians are the natural unit for angles.
When we define sin(x) we do so in a way that makes sense mathematically in many ways. When we define in radians we get d/dx sin(x) = cos(x) and d/dx cos(x) = -sin(x).
The above helps us obtain the Taylor series expansion for radians and its formula is the simplest it can be.
If we used degrees, then you would get all kinds of effects in differentiation from the chain rule and it would be very messy.
In terms of why pi is used, well that specific number defines the ratio of a circle to its diameter through this relationship among others we get a lot of trigonometric ratios and results linking the trig functions together. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9828232879690036,
"lm_q1q2_score": 0.8012294778500738,
"lm_q2_score": 0.8152324915965392,
"openwebmath_perplexity": 570.9867542814018,
"openwebmath_score": 0.9733271598815918,
"tags": null,
"url": "http://mathhelpforum.com/trigonometry/223746-radians.html"
} |
haskell
-- increment a key in a map
incDB :: String -> DB -> DB
incDB k = (update (\x -> Just (x + 1)) k)
-- λ> inc "a" $ inc "a" $ inc "a" db
-- increment current user in a State Monad
-- (Num a, Ord k, MonadState (k, (Map k a)) m) => m x
incUser :: (MonadState AppState m) => m ()
incUser = do user <- gets $ view _1
modify $ over _2 (incDB user)
-- λ> runState incUser ("b", db)
-- 1. update logged-in user name, 2. add new entry to db if it's a new user
login :: (MonadState AppState m) => String -> m ()
login newuser = do modify $ set _1 newuser
modify $ over _2 $ insertWithKey (\k new old -> old) newuser 0 -- inserts new user if necessary
-- λ> runState (login "d") ("", db)
-- ((),("d",fromList [("a",0),("b",99),("c",152),("d",0)])) | {
"domain": "codereview.stackexchange",
"id": 21302,
"lm_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
} |
rosmake
Title: ROS enviroenment variable setup
Hi ,
I am new in ROS and I want to use ROS to make dvo (dense visual odometry) package
the command is :
rosmake dvo_core dvo_ros dvo_benchmarke
but it can't execute and the error is :
sara@sara:~$ rosmake dvo_core dvo_ros dvo_benchmark
[ rosmake ] rosmake starting...
[ rosmake ] Packages requested are: ['dvo_core', 'dvo_ros', 'dvo_benchmark']
[ rosmake ] Logging to directory /home/sara/.ros/rosmake/rosmake_output-20140225-192413
Traceback (most recent call last):
File "/opt/ros/hydro/bin/rosmake", line 55, in <module>
if rma.main():
File "/opt/ros/hydro/lib/python2.7/dist-packages/rosmake/engine.py", line 741, in main
makedirs_with_parent_perms(self.log_dir)
File "/opt/ros/hydro/lib/python2.7/dist-packages/rosmake/engine.py", line 91, in makedirs_with_parent_perms
os.chown(p, s.st_uid, s.st_gid) | {
"domain": "robotics.stackexchange",
"id": 17083,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rosmake",
"url": null
} |
programming-languages, compilers, interpreters
Title: What properties of a programming language make compilation impossible? Question:
"Certain properties of a programming language may require that the only way to get the code written in it be executed is by interpretation. In other words, compilation to a native machine code of a traditional CPU is not possible. What are these properties?"
Compilers: Principles and Practice by Parag H. Dave and Himanshu B. Dave (May 2, 2012)
The book gives no clue about the answer. I tried to find the answer on Concepts of Programming Languages (SEBESTA), but to no avail. Web searches were of little avail too. Do you have any clue? The distinction between interpreted and compiled code is probably a
fiction, as underlined by Raphael's comment:
the claim seems to be trivially wrong without further assumptions: if there is
an interpreter, I can always bundle interpreter and code in one executable ... | {
"domain": "cs.stackexchange",
"id": 5880,
"lm_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, compilers, interpreters",
"url": null
} |
Find the probability that: a) Both Adam and Beth hit with their first dart b) At least one of them hits with their first dart B hit P(hit, hit) = 0. It consists of “branches” that are labeled with either frequencies or probabilities. Homework x1. The number of "Male and Smoke" divided by the total = 19/100 = 0. T and H (in any order)? 3. Draw a tree diagram representing the results. Draw a probability tree to show this situation and find the probability that the kicker is sucessful with the penalty. Use two-way tables to calculate conditional. Marbles are drawn vice with replacement What green) A 1 о в Bliss. (a) P(C\A) = 0. Assigned Practices: 1. From the tree diagram, we can see that there is a total of 8 different possible outcomes. and Mills Inc. Click Image to Enlarge : Use a tree diagram to display possible outcomes of who will come to the party. In other cases, different problem. Just like a tree, tree diagrams branch out and can become quite intricate. The probability that the | {
"domain": "piratestorm.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9865717436787542,
"lm_q1q2_score": 0.8553929746006267,
"lm_q2_score": 0.8670357529306639,
"openwebmath_perplexity": 564.7005215453598,
"openwebmath_score": 0.6850816011428833,
"tags": null,
"url": "http://piratestorm.it/probability-with-replacement-tree-diagram.html"
} |
So if I'm reading this explanation correctly, a list of all of the eigenvalues of $$A$$ should include $$i$$ instances of an eigenvalue with algebraic multiplicity $$i$$. In other words, every $$n \times n$$ matrix has exactly $$n$$ complex eigenvalues, and there is a distinction between the number of eigenvalues that a matrix possesses and the number of distinct eigenvalues that a matrix possesses. This subtle distinction seemed arbitrary until I considered the solution to this problem, which seems to require that all eigenvalues be treated as separate entities, even if they possess the same scalar values. For example, an eigenvalue $$\lambda =2$$ with algebraic multiplicity $$2$$ should actually be thought of as two eigenvalues $$\lambda _1 = \lambda _2 = 2$$. With this understanding, it is clear that neither $$\lambda _1$$ nor $$\lambda _2$$ can be a dominant eigenvalue, since it is not true that $$|\lambda _1|>|\lambda _2|$$, nor is it true that $$|\lambda _2|>|\lambda _1|$$. In | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9857180673335565,
"lm_q1q2_score": 0.8455175222552263,
"lm_q2_score": 0.857768108626046,
"openwebmath_perplexity": 144.99868091648742,
"openwebmath_score": 0.9360548257827759,
"tags": null,
"url": "https://math.stackexchange.com/questions/3959099/how-many-eigenvalues-does-an-n-times-n-matrix-have-and-how-does-this-relate-t"
} |
php, mysql, random, pdo, url
I'm aware that separating the view from the script is better, but for a simple app like this, I don't think it's necessary.
db.php
<?php
$pdo = new PDO(
'mysql:host=host;dbname=dbname;charset=utf8mb4',
'username',
'password',
[
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => FALSE,
]
);
Any improvement is welcome. Feedback
The script looks pretty good. For a small script that runs on your local machine it appears to suffice for your needs.
Is the goal to only show the latest link? Or would there be a use for showing previous links?
Suggestions
Variable naming
This variable naming might be misleading:
$chars_length = strlen($charset) - 1;
Because the value is one less than the length of the string. If I was working with that code, I would ask you to rename it to something more appropriate, like:
$max_index = strlen($charset) - 1; | {
"domain": "codereview.stackexchange",
"id": 29859,
"lm_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, mysql, random, pdo, url",
"url": null
} |
forces, rotational-dynamics
Title: Wheel Sinkage Depth I am trying to make a realistic car physics simulation for my game and the current thing that I am fighting to solve is rolling resistance. Although it's effect is minimal, this is important concept, because it is the force which prevents car from rolling away when it is standing still. So I lead to this article: https://en.wikipedia.org/wiki/Rolling_resistance where it's told that:
$$F_\mathrm{rr} = \frac{C_\mathrm{rr} W}{r}$$
There's no problem with that except for fact that it's told that $C_\mathrm{rr}$ is equal to square root of $z / d$ where:
$z$ is sinkage depth
$d$ is the diameter of the rigid wheel | {
"domain": "physics.stackexchange",
"id": 32333,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "forces, rotational-dynamics",
"url": null
} |
machine-learning, data-mining, feature-selection, feature-engineering
Going one step further, is it valid to profile each class in my dataset and do the same? Say Categories A-F comprise the top 80% of class 0 and Categories D-H are the top 80% of class 1. I would convert:
data_id;cat_var
1;B
2;F
3;H
4;Z
to
data_id;cat_var_top80class0;cat_var_top80class1
1;1;0
2;1;1
3;0;1
4;0;0 | {
"domain": "datascience.stackexchange",
"id": 2874,
"lm_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, data-mining, feature-selection, feature-engineering",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.