text stringlengths 1 1.11k | source dict |
|---|---|
### Definitions and context
Mrs. Fletcher replied:
Thanks so much for all that information!
Actually, I told the students (apparently incorrectly), that with the absence of clarity, I personally would have assumed that width is horizontal, and that length is... well... the other one.... :) I used the example of the doorway into the classroom, which has a window over its top. The door is taller than it is "wide" (there we go again), and it occurred to me that if someone tried to bring something into the room that wouldn't fit horizontally, we would describe that object as being too "wide." With that in mind, the window at the top of the door is horizontally longer than the vertical sides, but since the door beneath it is the same size horizontally, then it follows that the window is "wider than it is long." Again, we're assuming that the word "height" isn't part of the vocabulary at the moment. Did I confuse you with all that? | {
"domain": "themathdoctors.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9793540698633749,
"lm_q1q2_score": 0.8052142711741017,
"lm_q2_score": 0.8221891305219504,
"openwebmath_perplexity": 840.0696621954695,
"openwebmath_score": 0.6400913596153259,
"tags": null,
"url": "https://www.themathdoctors.org/what-are-length-and-width/"
} |
Functions with unbounded domains are considered in [Fich, 520].
Theorem 3. Let both a function $$f(x,y)$$ and its derivative $$f’_y(x,y)$$ are continuous for $$x\ge a$$ and $$y\in [c,d]$$. If an integral $$I(y)=\int_a^\infty f(x,y) dx$$ converges for each $$y\in [c,d]$$ and an integral $$J(y)=\int_a^\infty f’_y(x,y) dx$$ converges uniformly with respect to $$y$$ in $$[c,d]$$ then for each $$y\in [c,d]$$ we have $$I’(y)=J(y)$$.
The proof (in Russian) is here and here.
Also there is stated that essentially the same formulations and arguments provide a generalization of Theorem 3*. For this it suffices to replace in them a point $$x=\infty$$ by a point $$x=b$$.
References
[Fich] Grigorii Fichtenholz, Differential and Integral Calculus, v. II, 7-th edition, M.: Nauka, 1970. (in Russian). | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9632305318133553,
"lm_q1q2_score": 0.8005823620159366,
"lm_q2_score": 0.8311430499496096,
"openwebmath_perplexity": 218.69086282735174,
"openwebmath_score": 0.9850214123725891,
"tags": null,
"url": "https://math.stackexchange.com/questions/3322191/can-the-leibniz-integral-rule-be-used-on-integrals-with-singular-endpoints"
} |
energy, information, biology
There is the possibility that dark matter contains atomlike entities. According to standard conceptions, the bulk of the dark matter must consist of large halos surrounding and outweighing the visible galaxies, made of particles that hardly interact with each other; but there is room for a fraction of the dark matter to be self-interacting and possibly having its own "dark chemistry" and hence "dark biology". Alternatively, dark matter that is in an extended quantum state, like a superfluid, may contain topological defects, and perhaps something could be made of those. Again, whether either of these would satisfy the questioner is debatable. | {
"domain": "physics.stackexchange",
"id": 52183,
"lm_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, information, biology",
"url": null
} |
catkin
Errors:
CMakeFiles/face_detector.dir/src/face_detection.cpp.o: In function `people::FaceDetector::FaceDetector(std::string)':
face_detection.cpp:(.text._ZN6people12FaceDetectorC2ESs[_ZN6people12FaceDetectorC5ESs]+0xd49): undefined reference to `people::Faces::FACE_SIZE_MIN_M'
face_detection.cpp:(.text._ZN6people12FaceDetectorC2ESs[_ZN6people12FaceDetectorC5ESs]+0xdb6): undefined reference to `people::Faces::FACE_SIZE_MAX_M'
face_detection.cpp:(.text._ZN6people12FaceDetectorC2ESs[_ZN6people12FaceDetectorC5ESs]+0xe23): undefined reference to `people::Faces::MAX_FACE_Z_M'
face_detection.cpp:(.text._ZN6people12FaceDetectorC2ESs[_ZN6people12FaceDetectorC5ESs]+0xe90): undefined reference to `people::Faces::FACE_SEP_DIST_M'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/lazewatd/people_ws/devel/lib/face_detector/face_detector] Error 1
make[1]: *** [people/face_detector/CMakeFiles/face_detector.dir/all] Error 2
make: *** [all] Error 2
Invoking "make" failed | {
"domain": "robotics.stackexchange",
"id": 17086,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "catkin",
"url": null
} |
game, sql, mysql
CREATE TABLE maps(
maps_id INT NOT NULL UNIQUE,
MapName VARCHAR(30) NOT NULL,
PRIMARY KEY (maps_id),
INDEX(maps_id)
) ENGINE=InnoDB;
CREATE TABLE game_searching_player(
AccountName VARCHAR(50) NOT NULL,
MapID INT NOT NULL,
PRIMARY KEY (AccountName, MapID),
FOREIGN KEY (AccountName) REFERENCES accounts(AccountName)
ON DELETE CASCADE ,
FOREIGN KEY (MapID) REFERENCES maps(maps_id)
ON DELETE CASCADE ,
INDEX(AccountName)
) ENGINE=InnoDB; | {
"domain": "codereview.stackexchange",
"id": 3512,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "game, sql, mysql",
"url": null
} |
cc.complexity-theory, complexity-classes, np-hardness, approximation-hardness
An easy observation is that many problems are uninteresting when we consider additive approximation. For example, traditionally the objective function of the Max-3SAT problem is the number of satisfied clauses. In this formulation, approximating Max-3SAT within an O(1) additive error is equivalent to solving Max-3SAT exactly, simply because the objective function can be scaled by copying the input formula many times. Multiplicative approximation is much more essential for the problems of this kind.
[Edit: In earlier revision, I had used Independent Set as an example in the previous paragraph, but I changed it to Max-3SAT because Independent Set is not a good example to illustrate the difference between multiplicative approximation and additive approximation; approximating Independent Set even within an O(1) multiplicative factor is also NP-hard. In fact, a much stronger inapproximability for Independent Set is shown by Håstad [Has99].] | {
"domain": "cstheory.stackexchange",
"id": 296,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cc.complexity-theory, complexity-classes, np-hardness, approximation-hardness",
"url": null
} |
navigation, ekf, clearpath, actionlib, jackal
And now it doesn't, it consistently follows a bowed/curved trajectory every time. The radius of the curve changes but otherwise the trajectory is identical. The final stretch back to the starting point also has a funny kink it. Example:
Now before I go any further, I do understand that this problem is largely aesthetic and doesn't matter. And I know that I could work around this by adding more goal points and breaking the longer lines down into a series of shorter ones. However the fact remains that I can't currently explain this behaviour and I'd like to solve the problem if only for my own education.
So I would like to correct this behaviour and answer a few questions
Here is all the relevant system information:
System Information | {
"domain": "robotics.stackexchange",
"id": 26133,
"lm_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, ekf, clearpath, actionlib, jackal",
"url": null
} |
c, game, collision
Title: Octree Implementation The fn_AABB struct represents an axis aligned bounding box, by a center(position) and half lengths(hwidth). They also contain a set of planes for use in collision but that is not important to the octree.
The fn_getAABBSTouch function returns any aabbs in the octree that are contained within the AABB passed as an argument.
An octree works by partitioning 3d space into 8 rectangular regions and then recursively subdividing those regions to improve performance in collision queries.
fn_octree.h
#pragma once
#include "fn_aabb.h"
struct fn_OctreeNode
{
int* indices;
int indiceCount;
fn_AABB box;
struct fn_OctreeNode* children[8]; //8 of them at max
bool leaf;
};
typedef struct
{
struct fn_OctreeNode* root;
fn_AABB* aabbs;
int aabbCount;
}fn_Octree;
fn_Octree fn_createOctree(fn_AABB* aabbs,int aabbcount);
fn_Octree fn_createOctreeParam(fn_AABB* aabbs,int aabbcount,int max_elm,int max_depth); | {
"domain": "codereview.stackexchange",
"id": 28801,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c, game, collision",
"url": null
} |
javascript
quantity = itemTemplateIDQty.value;
} else if ((itemTemplateIDQty === null || itemTemplateIDQty.value == null || Number.parseInt(itemTemplateIDQty.value) <= 0) &&
(itemTemplateQty !== null && itemTemplateQty.value !== undefined && itemTemplateQty.value !== null && Number.parseInt(itemTemplateQty.value) > 0)) {
quantity = itemTemplateQty.value;
}
}
console.log("quantity: ", quantity); .getElementsByClassName() returns an HTMLCollection, not a single element. You can use bracket notation [n] to get an element at index n of the collection returned.
One if statement can be used to evalaute !itemData.isDynamicRecommendation. One if..else..if can be used to evaluate itemTemplateQty[0] && itemTemplateQty[0].value <= 0 or itemTemplateIDQty[0] && itemTemplateIDQty[0].value <= 0.
To convert the string .value to an integer you can use + operator preceding +itemTemplateQty[0].value.value or alternatively use .valueAsNumber. | {
"domain": "codereview.stackexchange",
"id": 33277,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript",
"url": null
} |
quantum-mechanics, double-slit-experiment, quantum-interpretations, measurement-problem
Title: Does a particle "exist" between emission and detection? In considering a simple Young's double slit setup:
The classical idea that a particle must exist with defined position and momentum between the source and detection plate leads to philosophical angst, and Quantum Mechanics is most often interpreted (and in fact seems to make the most sense) if particles are not, in fact, "lumps of potato" between source and detection, but instead can only be said to truly exist at the point of detection.
In other words, the question of particle history, i.e. "What was particle 'b' DOING before I detected it?" is nonsensical in QM, and a ton of effort is spent getting us to stop thinking in this way.
My question is this: | {
"domain": "physics.stackexchange",
"id": 27608,
"lm_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, double-slit-experiment, quantum-interpretations, measurement-problem",
"url": null
} |
Fourier Transform Python | {
"domain": "flcgorizia.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9838471628097781,
"lm_q1q2_score": 0.8322780687569786,
"lm_q2_score": 0.845942439250491,
"openwebmath_perplexity": 552.3158417307098,
"openwebmath_score": 0.6439871788024902,
"tags": null,
"url": "http://ozad.flcgorizia.it/fourier-transform-python.html"
} |
javascript, algorithm, programming-challenge, combinatorics
/*
* A is a set of arrays
* ind is a list of indices
*
* This function will return true if ind is a sandwich to the set A
* It does so by verifying that the following list is sorted:
*
* # List comprehension in a Python-fashion
* [ A[i][ind[i]] for i in range(0, len(A)) ]
*
*/
function is_sandwich (A, ind) {
if (ind.length !== A.length) {
return false;
}
var l = [];
for (var i=0; i<ind.length; ++i){
l.push(A[i][ind[i]]);
}
return sorted_ascend(l);
}
/*
* face is an object
* times is an integer
*
* repeat ``face'' on an array, ``times'' times
* e.g., array.repeat_push("hello", 3) pushes "hello" 3 times.
*
* I use this function to initialize an array with a 0 repeated avariable number of times.
* Is there a better way to do this?
*
*/
function repeat_face (face, times) {
l = [];
for (var i=0; i<times; ++i) {
l.push(face);
}
return l;
} | {
"domain": "codereview.stackexchange",
"id": 2577,
"lm_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, algorithm, programming-challenge, combinatorics",
"url": null
} |
bond offering investors Companies require capital for their growth and usually do not have enough reserves! This allows investments with different maturities ) * ( 365 / 180 = 2.03 left to maturity such deep or! Re-Investment is ignored in the above example, if an investor find an “ equivalent yield BEY... We learn how to calculate BEY for both of these bonds is 10.22 percent, what is the uncertainty a... On an annualized basis bond equivalent yield a year 365 / d ) * ( /. Or Quality of WallStreetMojo carry a $1,000 face value is the current price. It does not Endorse, Promote, or the coupon rate, is part the... These investments don ’ t offer annual payments to remember that these don! The most return is part of the bond this price will be lesser than the par value price! Shareholders have a stake in the case of a bond expressed in annual bond equivalent yield becomes a factor, multiply. Calculation, then d would be 180 days the days to maturity they capital... 100 to get a percentage | {
"domain": "dotsstores.ca",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9706877684006775,
"lm_q1q2_score": 0.8191586481464862,
"lm_q2_score": 0.8438950966654774,
"openwebmath_perplexity": 2500.1265378407634,
"openwebmath_score": 0.21707573533058167,
"tags": null,
"url": "http://dotsstores.ca/e-commerce-apkbmgz/e7a22e-bond-equivalent-yield"
} |
object-oriented, comparative-review, php5, finance
$loan_acc->activated_on = date("Y-m-d");
$loan_acc->status = 2; // Activate(Std)
$loan_acc->balance = $loan->loan_amount;
$loan_acc->save();
}
}
private function Save_TransactionWithFee_Charge ($transaction, $loan, $loanId){
$return_Val = [];
$fee_charge = new FeeCharge();
$fee_charge->charge_type = 4; // upfront charge
$fee_charge->charge_amount = floatval(Request::input('commission_fee')) * $transaction->amount / 100.0;
$fee_charge->charge_date = date('Y-m-d');
$fee_charge->receipt = Request::input('invoice_number');
$fee_charge->note = "Upfront charge for " . $loan->contract_id;
$return_Val['feeCharge'] = $fee_charge->save();
if($return_Val['feeCharge'] != false) { | {
"domain": "codereview.stackexchange",
"id": 19929,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "object-oriented, comparative-review, php5, finance",
"url": null
} |
waves, oscillators
To arrive at the desired result (after time average integration, and possibly $x$ integration over a given spatial domain) you simply need to notice that for satisfying the wave equation : $c^{2}=\omega^{2}/k^{2}=\kappa / \mu$. So indeed:
$$\left< e_{p}\right>=\frac{1}{4}\kappa A^{2}k^{2}= \frac{1}{4}A^{2}\mu\omega^{2}=\left< e_{k}\right>$$
(Note: I presume in your notation $y_{m}=A$, but I'm not sure what $v$ stands for) | {
"domain": "physics.stackexchange",
"id": 66517,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "waves, oscillators",
"url": null
} |
ros, python, rqt-gui, rqt
Title: ROS rqt plugin: ImportError (unrelated to previous post)
Hello all. I am new to creating Plugins in ROS rqt_gui. I recently had the Plugin user interface working (it would pop up the widgets described in a separate .ui file I created); however, this was only the front end user interface popping up with no functionality. Once I tried adding back end functionality (allowing sliders to actually change data for other nodes through topics) it has stopped working. The user interface no longer comes up at all. This happened immediately after adding back end functionality and running a catkin_make. My current error is:
RosPluginProvider.load(drone_GUI/My Plugin) exception raised in __builtin__.__import__(drone_GUI.my_module, [MyPlugin]):
Traceback (most recent call last):
File "/opt/ros/hydro/lib/python2.7/dist-packages/rqt_gui/ros_plugin_provider.py", line 77, in load | {
"domain": "robotics.stackexchange",
"id": 21177,
"lm_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, python, rqt-gui, rqt",
"url": null
} |
quantum-mechanics, classical-mechanics, particle-physics, relativity, education
The thing is that I could've taken a course and study, but due to the prerequisitse and things, I can't.
I don't want to wait another year or two years to learn those fields. Since you are at the university now, you could register to take the classes offered by the university in the seven fields you listed. Each class will have it's own recommendations for textbooks. There are no magical textbooks. What really helps is to have a good teacher (hopefully the professor/instructor in class) who can explain the difficult points along the way. | {
"domain": "physics.stackexchange",
"id": 19644,
"lm_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, particle-physics, relativity, education",
"url": null
} |
general-relativity, gravity, lagrangian-formalism, differential-geometry, variational-principle
The inverse metric becomes
$$g^N~\stackrel{(20)+(21)}{\approx}~\frac{2\Lambda}{d-2}R^N.\tag{22}$$
And hence
$$R~\stackrel{(22)}{\approx}~\frac{2d}{d-2}\Lambda,\tag{23}$$
and
$$g_{\mu\nu}~\stackrel{(2)+(22)}{\approx}~\frac{d-2}{2\Lambda}R_{\mu\nu}(\Gamma).\tag{24}$$
So the EH Lagrangian density becomes Born-Infeld-like:
$${\cal L}(\Gamma)~\stackrel{(1)+(17)+(23)+(24)}{\approx}~\frac{1}{\kappa}\left(\frac{d-2}{2\Lambda}\right)^{\frac{d}{2}-1}\sqrt{-\det(R_{\mu\nu}(\Gamma))}.\tag{25}$$
Note that the Eddington-Schrödinger action (25) only works for a non-zero cosmological constant $\Lambda\neq 0$. | {
"domain": "physics.stackexchange",
"id": 16941,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, gravity, lagrangian-formalism, differential-geometry, variational-principle",
"url": null
} |
mechanical-engineering, structural-engineering, structural-analysis, automotive-engineering, vibration
In general, BCC (body-centered cubic) materials (like steel) show a marked drop in strength (close to 50% or more depending on the steel). For these material there is stress (called the endurance limit), for which the material can be loaded indefinitely.
Also, FCC (face-centered cubic) materials (like aluminium) exhibit a very bad fatigue behaviour.
In any case, when there is high number of cyclic loads (like in the case of motor engine), the allowable stress tends to fall quite a lot. Therefore, there is a need to increase the cross-sections/thicknesses in order to reduce operating loads.
Just for giving an order of magnitude: an engine operating at 4000rpm, performs 1 million revolutions in little over 4 hours of continuous operation.
Vibrational Considerations
A second reason, has to do with vibrations. More specifically how to avoid having the engine operating in a frequency region that magnifies vibrations. | {
"domain": "engineering.stackexchange",
"id": 3676,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mechanical-engineering, structural-engineering, structural-analysis, automotive-engineering, vibration",
"url": null
} |
cosmology, big-bang, stress-strain, cosmological-inflation, cosmological-constant
quintessence): what if there was a phenomenon (a field with negative potential?) that counterbalances the theoretically predicted negative pressure of dark energy with positive pressure? The main way in which I can imagine this is that the universe is like a rubber membrane with a certain elasticity (or plasticity). During inflation the membrane would be in the linear range of the stress-strain curve and expand fast. During the post-inflationary phase the expansion would be much slower because the membrane is partially plastic due to strain hardening. But if the universe keeps expanding, there will be a point in the stress-strain curve where the membrane breaks, followed by an immediate Big Rip (much faster than the classical Big Rip scenario). This would be the analogue of a balloon that pops. So is this a scenario that has been proposed in the literature, next to the Big Rip, the Big Crunch, and the Big Freeze scenarios for the future of the universe: the Big Break? And if not, are | {
"domain": "physics.stackexchange",
"id": 91015,
"lm_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, big-bang, stress-strain, cosmological-inflation, cosmological-constant",
"url": null
} |
performance, c, linked-list, unit-testing
*head = current->next;
free (current);
return data;
}
extern int ll_print (const struct ll_node *head)
{
assert (head);
int ret_val = 0;
for (; head; head = head->next) {
if (ret_val > 0) {
ret_val += fputc ('-', stdout);
}
ret_val += printf (" %jd ", head->data);
}
ret_val += fputc ('\n', stdout);
return ret_val;
}
extern void ll_delete (struct ll_node *head)
{
while (head) {
struct ll_node *current = head;
head = head->next;
free (current);
}
}
Unit tests:
I used the criterion framework for the tests.
tests.c:
#include <criterion/criterion.h>
#include <stdint.h>
#include "../src/list.h"
#define SIZE 10
struct ll_node *head = 0;
void setup (void)
{
intmax_t limits[SIZE];
for (intmax_t i = 0; i < SIZE; i++) {
limits[i] = i;
}
head = ll_build_head (SIZE, limits);
cr_assert (head);
}
void tear_down (void)
{
ll_delete (head);
} | {
"domain": "codereview.stackexchange",
"id": 44420,
"lm_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, c, linked-list, unit-testing",
"url": null
} |
c
There are some languages, for example German, French, and Italian, where the scientific discipline makes no reference to computers at all: in German, it is called Informatik, in French informatique, in Italian informatica – all are a neologism based on information and the Greek suffix -ik. In Spanish, it is called ciencias de la informática (similar to German, French, and Italian) or ciencias de la computación: note the subtle difference to English, it is the science of computation, not the science of computers. Danish uses the terms datalogi (a neologism formed by combining data with the -logi suffix as in geology, meteorology, metrology, etc.) for the stricter sense of the science of information, data, computation, and processes, and informatik for a broader inter-disciplinary view of the effects of "datalogi" on society, politics, humanity, and the broader world in general; what might be called Social Informatics in English. | {
"domain": "cs.stackexchange",
"id": 19586,
"lm_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
} |
algorithms, search-algorithms
Title: Search a number Given n numbers, design an algorithm to find the smallest $n^{\frac{2}{3}}$numbers, in sorted order. (Assume $n^{\frac{2}{3}}$ is an integer.)
I don't understand this question. Can I simply $x = n^{\frac{2}{3}}$ and fetch the $A[x]$? That would only give you the $x$-th number. What the question is asking is to return a sorted list containing the smallest $n^{\frac{2}{3}}$ numbers of the input.
For example if $n=8$ and the input consists of the numbers $\langle 4, 3, 6, 1, 2, 5, 8, 7\rangle$ then you need to return the $x = n^\frac{2}{3} = 4$ smallest numbers in sorted order, i.e., $\langle 1, 2, 3 ,4 \rangle$. | {
"domain": "cs.stackexchange",
"id": 16217,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, search-algorithms",
"url": null
} |
algorithms, graphs, minimum-spanning-tree
Therefore your problem isn't easier than finding an MST for a graph with $n$ vertices and at most $2n$ edges, which is not expected to be solvable in linear time. However, no nontrivial lower bounds are known, to the best of my knowledge. | {
"domain": "cs.stackexchange",
"id": 19173,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, graphs, minimum-spanning-tree",
"url": null
} |
scattering-cross-section, weak-interaction
This in my mind is completely analogous to the collision between any two physical bodies. And the qualitative rule is: the collision is an energy transfer that occurs in a time interval and in a certain volume or area, which completely define the expected result. These time interval and volume area of interest are completely related to the relative momenta of the bodies.
You can throw a baseball to a window, and it won't break as long as the speed is low enough. Because at these speeds the whole window is involved in stopping the ball, the whole window receives the tension of the impact and that tension can distribute throughout the surface in the time scale involved. | {
"domain": "physics.stackexchange",
"id": 25008,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "scattering-cross-section, weak-interaction",
"url": null
} |
Statement 1: k > 0 Pick easy numbers. Case 1: k = 1. $$k^2 + k -2$$ becomes $$1^2 + 1 - 2 = 0$$. So the expression is not greater than 0, and we have a NO. Case 2: k = 2; $$k^2 + k -2$$ becomes $$2^2 + 2 - 2 = 4$$ The expression is greater than 0, and we have a YES. Statement 1 alone is not sufficient. Statement 2: We can reuse Case 2. If k = 2; $$k^2 + k -2$$ becomes $$2^2 + 2 - 2 = 4$$ The expression is greater than 0, and we have a YES. Case 3: k = -2. $$k^2 + k -2$$ becomes $$(-2)^2 - 2 - 2 = 0$$. 0 is not greater than 0, we have a NO. Not sufficient. Together. We know that k is a positive integer divisible by 2, so k = 2, 4, 6, et. No matter what we pick $$k^2 + k - 2$$ will be positive, and the answer will always be YES. The statements together are sufficient and the answer is C _________________ Veritas Prep | GMAT Instructor Veritas Prep Reviews Save$100 off any live Veritas Prep GMAT Course | {
"domain": "beatthegmat.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9875683469514965,
"lm_q1q2_score": 0.8050977974572362,
"lm_q2_score": 0.8152324848629214,
"openwebmath_perplexity": 4560.657635474228,
"openwebmath_score": 0.33742931485176086,
"tags": null,
"url": "https://www.beatthegmat.com/is-k-2-k-2-0-t298464.html"
} |
python, python-3.x, image
image_size = 28
res = np.zeros((image_size, width, 3))
extra_margin = width - (len(n_arr) - 1) * margin_min - len(n_arr) * image_size
if extra_margin < 0:
return "Current given minimum margin would result in exceeded width"
start_idx = 0
for x in n_arr:
img = images[np.random.choice(id_dict[int(x)])].reshape((28, 28, 1))
res[:, start_idx:start_idx+28, :] = img
start_idx += 28
additional_margin = np.random.randint(0, margin_max - margin_min)
additional_margin = np.min((extra_margin, additional_margin))
extra_margin -= additional_margin
start_idx += additional_margin
return res | {
"domain": "codereview.stackexchange",
"id": 37071,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x, image",
"url": null
} |
nomenclature
Except for the use of enclosing marks to set off parts of the name dealing with specific structural features, the suggested name is correct. The preferred IUPAC name is 3-{(E)-[(4-methylphenyl)methylidene]amino}benzoic acid. | {
"domain": "chemistry.stackexchange",
"id": 11540,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "nomenclature",
"url": null
} |
fft, window-functions, stft, neural-network
Title: normalize STFT output by magnitude I am using torch.stft() to generate spectrograms for neural networks and come across the below code.
S = torch.stft(
input=y, # shape(1 x num_samples)
n_fft=self.n_fft,
hop_length=self.hop_length,
window=self.window,
center=self.center,
onesided=True,
normalized=True
)
And torchaudio has the below implementation:
if normalized:
S /= self.window.pow(2).sum().sqrt() | {
"domain": "dsp.stackexchange",
"id": 10944,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fft, window-functions, stft, neural-network",
"url": null
} |
chapter use the Argand diagram or complex plane will eventually be de ned so that i2 =.! Number line Amin, published by Ilmi Kitab Khana, Lahore - PAKISTAN ways in which they be... 5 3 the two real numbers, and is called the imaginary part, complex conjugate.. Using geometric intuition, division etc., need to be defined is known as the Argand diagram or plane... Will eventually be de ned so that i2 = 1 ned so that i2 = 1 multiplication, etc.. Numbers will eventually be de ned so that i2 = 1 following complex numbers 5 3 - PAKISTAN 1 LEVEL. Vancouver Yue-Xian Li March 17, 2015 1 numbers a and b may thought. The complex plane plane, using the cor-respondence x + iy ↔ (,! Points in a plane, using the cor-respondence x + iy ↔ ( x, y ) real! Want to reserve i complex numbers will eventually be de ned so i2! Ned so that i2 = 1 numbers will eventually be de ned so that i2 = 1 real axis purely! On complex numbers may be thought of as points in the complex numbers and DIFFERENTIAL EQUATIONS | {
"domain": "capbaiv.org",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.978712645102011,
"lm_q1q2_score": 0.825930806088555,
"lm_q2_score": 0.8438951005915208,
"openwebmath_perplexity": 1181.3583314796545,
"openwebmath_score": 0.7839613556861877,
"tags": null,
"url": "https://www.capbaiv.org/mlqelw/a5ca66-complex-numbers-pdf-notes"
} |
# Homework Help: Combination or probability question
1. Jul 12, 2015
### rajeshmarndi
1. The problem statement, all variables and given/known data
A bag contains 4 black and 5 white balls from which 6 balls are drawn. Determine the number of ways in which at
least 3 black balls can be drawn.
The book has solved it as combination.
2. Relevant equations
3. The attempt at a solution
When we are drawing say black ball, isn't it the probability of getting 3 black balls at least?
Also will it be correct to number the black ball e.g B1, B2, B3 & B4, which I feel it to be of no sense.
2. Jul 12, 2015
### HallsofIvy
Sorry, but I have no idea what this means. Isn't what '"the probability of getting 3 black balls at least"?
"At least 3 black balls" means "3 black balls or 4 black balls". Do each of those separately, then add.
You could- and it would make sense- so you could distinguish between the different black balls. But it is not necessary. | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9643214511730025,
"lm_q1q2_score": 0.809773482172678,
"lm_q2_score": 0.8397339716830606,
"openwebmath_perplexity": 413.306004858109,
"openwebmath_score": 0.7769777178764343,
"tags": null,
"url": "https://www.physicsforums.com/threads/combination-or-probability-question.823012/"
} |
• With probability $\frac{1.5}{2+1.5}=\frac{3}{7}$ person B finishes the individual task first. If this happens then the conditional additional expected time for the second task is $\frac{1}{1+2}=\frac{1}{3}$ hours | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9865717460476701,
"lm_q1q2_score": 0.8133908379999517,
"lm_q2_score": 0.8244619220634457,
"openwebmath_perplexity": 341.23228260546483,
"openwebmath_score": 0.7568016052246094,
"tags": null,
"url": "https://math.stackexchange.com/questions/1187929/exponential-distribution-and-expected-times"
} |
quantum-mechanics, angular-momentum, quantum-spin, eigenvalue
Consider an example where we have a single spin $\frac{1}{2}$ particle with say $j_{1} = l$, $m_{1} = m_{l}$, $j_{2} = s = \frac{1}{2}$ and $m_{2} = m_{s} = \pm\frac{1}{2}$. Consider now the angular-momentum configuration in which $m_{l}$ and $m_{s}$ are both maximal-that is, $l$ and $\frac{1}{2}$, respectively. The total $m = m_{l} + m_{s}$ is $l + \frac{1}{2}$, which is possible only for $j = l + \frac{1}{2}$ and not for $j = l - \frac{1}{2}$. Why does it followws that $|j_{1}j_{2}; m_{l}= l, m_{s} = \frac{1}{2} \rangle$ must be equal to $|j_1j_2;j=l+\frac{1}{2}, m = l + \frac{1}{2} \rangle$ up to phase factor? There are two ingredients needed. | {
"domain": "physics.stackexchange",
"id": 40273,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, angular-momentum, quantum-spin, eigenvalue",
"url": null
} |
randomness, sorting
Here is some intuition about the last "standard calculation". Suppose you choose a $k$-subset $S$ uniformly at random from $[m+k]$. What's the expectation of $\max S$? The $k$ chosen elements divide the $m$ unchosen elements into $k+1$ intervals of total size $m$. By a symmetry argument the expected number of elements in each of these intervals is the same, so each interval has size $m/(k+1)$ in expectation. In particular, the expected size of the last interval is $m/(k+1)$, so the expectation of the largest element is $m+k - m/(k+1)$.
In our case $m+k = {n \choose 2}$ and $k=n-1$. | {
"domain": "cstheory.stackexchange",
"id": 5489,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "randomness, sorting",
"url": null
} |
python, performance
@staticmethod
def _get_suffix_str(string):
return [string[i:] for i in range(len(string))]
def _get_lcsubstr(self):
try:
substr_len =0
max_len = 0
lcs = None
for i,n in enumerate(self._suffix_str_array):
if n[-1] != self._suffix_str_array[i+1][-1]:
substr = commonprefix([n,self._suffix_str_array[i+1]])
substr_len = len(substr)
if substr_len > max_len:
max_len = substr_len
lcs = substr
except IndexError:
pass
return lcs | {
"domain": "codereview.stackexchange",
"id": 16705,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance",
"url": null
} |
complexity-theory, np-hard, board-games, tiling
Alternatively, all of their states must be guaranteed to be able to take up a well defined area; this guarantees a satisfiable tiling, but does not guarantee that a particular tiling will occur. This is the same way a Dominosa game is made:
First the tiles are generated into a set;
Then the tiles are placed down in a random configuration,
As each tile is placed, it is removed from the tile-set.
Then the tiles are removed from the board, leaving behind their squares.
This does not guarantee that the intended configuration will be chosen,
Rather, it guarantees that the intended configuration is able to be chosen, and thus a solution exists. We can do the same thing here. | {
"domain": "cs.stackexchange",
"id": 2115,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "complexity-theory, np-hard, board-games, tiling",
"url": null
} |
material-science, elasticity
Title: Origin of Elasticity Why is it that not all bodies possess Elastic behavior? What is the origin of elasticity or plasticity? I mean, it's a physical property. So, how does it relate to atoms or molecules in different phases? (It should have some relation with atoms) A toy model of a solid
A very simple model of a solid is to imagine a bunch of molecules linked to their nearby neighbors by springs (you don't need to imagine a crystalline lattice, it can be amorphous).
The springs are the effective electromagnetic interactions between the molecules; they are strongly repulsive at close range and attractive at modest ranges which implies a zone of equilibrium. And for small displacements they really are roughly linear which means that the spring model makes sense. | {
"domain": "physics.stackexchange",
"id": 61050,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "material-science, elasticity",
"url": null
} |
electromagnetism, magnetic-moment
The first term is zero in the magnetostatic case where $\nabla'\cdot\mathbf{J}(\mathbf{x}') = 0$ (see for example here for a proof).
We have the general vector calculus identities:
$$\nabla(\mathbf{A}\cdot\mathbf{B}) = (\mathbf{A}\cdot\nabla)\mathbf{B} + (\mathbf{B}\cdot\nabla)\mathbf{A} + \mathbf{A}\times(\nabla\times\mathbf{B}) + \mathbf{B}\times(\nabla\times\mathbf{A}) \tag{4}\label{4}$$
$$\nabla\times(\psi\mathbf{A}) = \psi(\nabla\times\mathbf{A}) + (\nabla\psi)\times\mathbf{A} \tag{5}\label{5}$$
Using ($\ref{4}$) with $\mathbf{A} = \mathbf{x}'$ and $\mathbf{B} = \mathbf{B}(\mathbf{x})$ we have:
$$\mathbf{J}(\mathbf{x}')\times\nabla(\mathbf{x}'\cdot\mathbf{B}(\mathbf{x})) = \mathbf{J}(\mathbf{x}')\times\left[(\mathbf{x}'\cdot\nabla)\mathbf{B}(\mathbf{x})\right] \tag{6}\label{6}$$ | {
"domain": "physics.stackexchange",
"id": 60541,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, magnetic-moment",
"url": null
} |
neuroscience, human-anatomy, neuroanatomy
Axons often degrade if their targets are damaged. Therefore, if a hand is lost in an accident, for example, the neurons projecting to the muscles of the hand will atrophy.
If the axons themselves are in place, there are already prosthetics that operate based on muscle contractions in existing muscles. It takes some time to train users to use these devices, but most movements you make involve all sorts of muscles you may not realize are involved, and it is quite possible for brain plasticity to allow muscles in, for example, the shoulder, to control a bionic hand after an amputation. | {
"domain": "biology.stackexchange",
"id": 6643,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neuroscience, human-anatomy, neuroanatomy",
"url": null
} |
I try to use the recurrence relations and think about using mathematical induction, but failed because of insufficient data.
Can I get some clues?
• What are the first few terms? – vadim123 Jul 25 '17 at 14:52
• @vadim123 $a_1=1$ and $a_2=0.5$ is given. – user362325 Jul 25 '17 at 14:52
• What are the next 10 terms? – vadim123 Jul 25 '17 at 14:53
• just curious, where is the problem from? – Tai Jul 25 '17 at 14:55
• user362325 I believe you asked this earlier. Did you delete the earlier question you wrote, in order to ask it again? In any case: you've earlier asked a question concluding "I try to use the recurrence relations and think about using mathematical induction, but failed because of insufficient data." – amWhy Jul 25 '17 at 15:07
Rearrange the equation, you get $$(n+1)^2\,a_{n+1}\,a_{n-1}-n(n+1)\,a_{n+1}\,a_n\,=n\,a_n\,a_{n-1}$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9861513897844354,
"lm_q1q2_score": 0.8382002505297771,
"lm_q2_score": 0.8499711699569787,
"openwebmath_perplexity": 762.1006524413411,
"openwebmath_score": 0.8219034671783447,
"tags": null,
"url": "https://math.stackexchange.com/questions/2371261/how-can-i-find-the-general-term-of-sequence-with-this-relations"
} |
lagrangian-formalism, field-theory, variational-calculus, boundary-terms, higher-spin
&=-(s-1)(2s-3)\int\text{d}^3x\delta h^{\alpha(2s)}\partial_{\alpha(2)}\partial_{\alpha(2)}h_{\alpha(2s-4)}.
\end{align}
Putting all three terms together gives
$$\delta\mathcal{S}_s[\varphi^1]=\int\text{d}^3x\delta h^{\alpha(2s)}\bigg\{2\square h_{\alpha(2s)}+s\partial^{\beta(2)}\partial_{\alpha(2)}h_{\beta(2)\alpha(2s-2)}-(s-1)(2s-3)\partial_{\alpha(2)}\partial_{\alpha(2)}h_{\alpha(2s-4)}\bigg\}.$$
Setting the variation in the action equal to zero gives the required EoM:
$$\square h_{\alpha(2s)}+\frac{1}{2}s\partial^{\beta(2)}\partial_{\alpha(2)}h_{\beta(2)\alpha(2s-2)}-\frac{1}{2}(s-1)(2s-3)\partial_{\alpha(2)}\partial_{\alpha(2)}h_{\alpha(2s-4)}=0.$$ | {
"domain": "physics.stackexchange",
"id": 42694,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lagrangian-formalism, field-theory, variational-calculus, boundary-terms, higher-spin",
"url": null
} |
transform is not 1 /jω in fact, the integral ∞ −∞ f (t) e − jωt dt = ∞ 0 e − jωt dt = ∞ 0 cos. , make it 8 cycles long). The DTFT is often used to analyze samples of a continuous function. Example: cos(pi/4*(0:159))+randn(1,160) specifies a sinusoid embedded in white Gaussian noise. Over a time range of 0 400< 0. 5 BACKGROUND In the following sections, we discuss the effect of amplitude modulation and sampling on the signal spectrum using common properties of the Fourier transform. Here's the 100th column of X_rows: plot(abs(X_rows(:, 100))) ylim([0 2]) As I said above, the Fourier transform of a constant sequence is an impulse. In signal processing, the Fourier transform can reveal important characteristics of a signal, namely, its frequency components. Amyloid Hydrogen Bonding Polymorphism Evaluated by (15)N{(17)O}REAPDOR Solid-State NMR and Ultra-High Resolution Fourier Transform Ion Cyclotron Resonance Mass Spectrometry. The Fast Fourier Transform (FFT) is an efficient way to do | {
"domain": "agenzialenarduzzi.it",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.981735721648143,
"lm_q1q2_score": 0.8678929482289481,
"lm_q2_score": 0.8840392878563336,
"openwebmath_perplexity": 1078.9064028815767,
"openwebmath_score": 0.8407778143882751,
"tags": null,
"url": "http://qjsk.agenzialenarduzzi.it/fourier-transform-of-cos-wt-in-matlab.html"
} |
special-relativity
Title: When spinning a pole with uneven mass at relativistic speeds will its center of gravity change? Scenario:
You have a pole that is a meter long and it is balanced when you rest it on your finger at the 10 cm mark due to the uneven weight distribution. (center of gravity at 10 cm mark)
You also have the ability to spin it on this 10 cm mark up to relativistic speeds.
Due to one side of the pole having a rotational radius of 10 cm, and the other 90 cm, you will get one side going at a speed significantly faster than the other side.
When you get it spinning so that the 90 cm side is going close to the speed of light does the center of gravity move on the pole? If so does the COG moving move the poles position in space? OK, using the modern (Lorentz invariant) definition of mass, the answer is that the center of mass does not change due to relalativisitc effects, but can be expected to change as the bar stretches under tension.
Let's tackle those two statements one at a time. | {
"domain": "physics.stackexchange",
"id": 27426,
"lm_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",
"url": null
} |
machine-learning, python, nlp, machine-translation
A slightly less ambitious objective would be to study the limitations of current MT systems, since this doesn't require understanding how they work. Note that even simply training a state of the art model using existing software is not trivial, and requires quite a lot of computational resources. I'd suggest looking at the resources and papers published at the Workshop on Machine Translation (check also the previous years). Note also that there are many sub-tasks related to MT to look at: | {
"domain": "datascience.stackexchange",
"id": 8183,
"lm_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, python, nlp, machine-translation",
"url": null
} |
$$\frac{1}{n^3} \sum_{k=1}^n \sin{\left ( \frac{k}{n}\right)}$$
which, in absolute value, is less than $(1/n^3) (n) = 1/n^2$, which obviously vanishes as $n \to \infty$.
-
Could you be more detailed about the claim "the $1/n^2$ term vanishes"? A simple estimation would do, say $|\sin x|\leq 1$, but still, I think it should be written out, since people (not you, but in general) tend to hand wave limits that have $n$ both in the summand and in the summation sign, and fall into snake pits. – Pedro Tamaroff Jul 9 '13 at 18:50
@PeterTamaroff: you are as always too kind. I hope my addendum address your concern. – Ron Gordon Jul 9 '13 at 18:58
Of course. I cannot upvote now, used up all my votes! – Pedro Tamaroff Jul 9 '13 at 18:58
@PeterTamaroff: approval from you is good enough in my book. – Ron Gordon Jul 9 '13 at 18:59
@RonGordon For your answer (after "NB In general..."), did you mean to put: $$\dfrac{b-a}{n}$$ instead of $1/n$? – Adriano Jul 9 '13 at 19:23 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9879462201288629,
"lm_q1q2_score": 0.8416835430055172,
"lm_q2_score": 0.8519527944504227,
"openwebmath_perplexity": 1022.3554883009314,
"openwebmath_score": 0.9999526739120483,
"tags": null,
"url": "http://math.stackexchange.com/questions/439889/calculating-this-riemann-sum-limit"
} |
microbiology, bacteriology, lab-techniques, cell-culture
I am wondering now what exactly the purpose of this streak purification is. If you want to grow your bacteria why would you not just put a few drops of the liquid culture on the agar plate? Why is it particularly useful to use this technique? Or, why would you choose this method over the "spread plate" technique, where a liquid culture undergoes a set of dilutions first and each dilution is then placed directly on the surface of separate agar plates. The purpose of this technique is to dilute the bacterial cells so much that you get single cells, as can be seen on the image of the plate. You can then pick the colonies grown from these single cells, characterize them, test them for the mutations/plasmids, or whatever change you introduced, and can be sure that you have only the descendants of a single cell in your culture. | {
"domain": "biology.stackexchange",
"id": 6152,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "microbiology, bacteriology, lab-techniques, cell-culture",
"url": null
} |
computability, pl.programming-languages, functional-programming, function
My background is rather limited, so I would prefer sources with fewer prerequisites, but references to more advanced sources may be cool too, as that way I'll know what I want to work towards. The extent to which this is possible is actually a major open question in the theory of the lambda calculus. Here's a quick summary of what's known: | {
"domain": "cstheory.stackexchange",
"id": 1404,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "computability, pl.programming-languages, functional-programming, function",
"url": null
} |
java, strings, android
Note that the results from the above code may, or may not include the terminating period. If the match is in the last sentence of a text, and that text ends with a period, then the period may be returned as part of the result. If there is a match in the middle of the text, then the period will not be included. | {
"domain": "codereview.stackexchange",
"id": 13520,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, strings, android",
"url": null
} |
organic-chemistry, home-experiment, alcohols, organic-oxidation
(or simply verification). OP can do this at home since he/she has done simple distillation at home. Ethanol/water binary system give an azeotrope, which boils at $\pu{78.1 ^\circ C}$ and gives $95\%$ ethanol. Methanol, on the other hand, make no azeotrope with water, and boils at $\pu{64.7 ^\circ C}$. The temperature range of $\pu{13.4 ^\circ C}$ need only about ≤20 theoretical plates to separate. If you get first distillate below, say, $\pu{67 ^\circ C}$, then you got methanol or something other than ethanol. So, don't drink it. | {
"domain": "chemistry.stackexchange",
"id": 9952,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, home-experiment, alcohols, organic-oxidation",
"url": null
} |
java, interview-questions, graph, git
The graph of the history of a repository with a single branch. The
repository was branched at Commit B. Commits E and F were made against
this branch
E-F
/
A-B-C-D
The graph of the history of a repository with a single branch which is
then later merged back into master. The repository was branched at
Commit B. Commits E and F were made against this branch. Commit G
resulted from merging commits F and D.
E-F
/ \
A-B-C-D-G
Implement a function that will find the most recent common ancestor of
any two commits from a given commit graph. The commit graph is
represented as a String[] called commits containing all commit IDs in
sorted date order (most recent first) and a String[][] called parents.
The parent IDs for the commit ID at index i can be found at
parents[i]. The last item in the parents array is always null since
this represents the parent of the root commit. For example, the
following commit graph:
E-F
/ \
A-B-C-D-G | {
"domain": "codereview.stackexchange",
"id": 7801,
"lm_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, interview-questions, graph, git",
"url": null
} |
# Find a Subgroup of $\mathbb{Z}_{12} \oplus \mathbb{Z}_{18}$ Isomorphic to $\mathbb{Z}_9 \oplus \mathbb{Z}_4$
This is what I have so far:
$$\mathbb{Z}_{12} = \{0, 1, 2,\cdots, 11\}$$ $$\mathbb{Z}_{18} = \{0, 1, 2,\cdots, 17\}$$ $$\mathbb{Z}_9 = \{0, 1, 2,\cdots, 8\}$$ $$\mathbb{Z}_4 = \{0, 1, 2, 3\}$$
Using that fact that isomorphisms must contain the same number of elements, we must find a subgroup in $\mathbb{Z}_{12}\oplus \mathbb{Z}_{18}$ with the same number of elements as in $\mathbb{Z}_{9}\oplus \mathbb{Z}_{4}$.
Now, let's determine the number of elements in $\mathbb{Z}_{9}\oplus \mathbb{Z}_{4}$: $$|\mathbb{Z}_{9}\oplus \mathbb{Z}_{4}| = \text{lcm}(|\mathbb{Z}_{9}|, |\mathbb{Z}_{4}|) = \text{lcm}(|9|, |4|) = 36$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.969785413369235,
"lm_q1q2_score": 0.8336893726203615,
"lm_q2_score": 0.8596637577007394,
"openwebmath_perplexity": 141.8451154542431,
"openwebmath_score": 0.872907280921936,
"tags": null,
"url": "https://math.stackexchange.com/questions/563289/find-a-subgroup-of-mathbbz-12-oplus-mathbbz-18-isomorphic-to-math"
} |
mechanical-engineering, gears, vibration
Note that the per-rev frequencies depend on how fast you turn shafts. Modes, etc can vary depending on how you affix and agitate something.
While it is possible to design models for a specific gearbox (you'd have to precisely measure every part), it is not cost-effective. Much of the vibrations and interactions result from deviations from the nominal values. What you can however do is track a specific gearbox's vibrations over its lifetime. You look at it when it is new (and good) while spun at a specific rpm. Then you look at it again when spun at the same rpm.
You asked for a hypothesis on a broken tooth so here goes:
Assuming your gearbox still functions with the break (Depending on the specifics of the break and gearbox, you could expect the output to stop altogether or turn the output differently. Such cases are better detected with other sensors): | {
"domain": "engineering.stackexchange",
"id": 4005,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mechanical-engineering, gears, vibration",
"url": null
} |
Thus, instead of comparing labels, we should instead be comparing "ideas". Why is it reasonable to say that $2\in\mathbb{Z}$ is equal to $2\in\mathbb{Q}$? On the other hand, $2\in\mathbb{Z}$ is not "equal" to $2\in\mathbb{Z}/4\mathbb{Z}$ - if they were equal, then why is $2+2+2=2$ only valid in $\mathbb{Z}/4\mathbb{Z}$, but not $\mathbb{Z}$?
The answer of course, is that in the first case there is an injective ring homomorphism $\mathbb{Z}\hookrightarrow\mathbb{Q}$, thus allowing us to think of $\mathbb{Z}$ as a subring of $\mathbb{Q}$, without losing any information, whereas of course there is no such injection between $\mathbb{Z}/4\mathbb{Z}$ and $\mathbb{Z}$.
Thus, when we ask: Is $2\in\mathbb{Z}$ equal to $2\in\mathbb{Q}$, what we really mean is: Is the image of $2\in\mathbb{Z}$ under the injection $\mathbb{Z}\hookrightarrow\mathbb{Q}$ the same as $2\in\mathbb{Q}$? | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9678992914310606,
"lm_q1q2_score": 0.8476736102295621,
"lm_q2_score": 0.8757869932689566,
"openwebmath_perplexity": 126.45957879638934,
"openwebmath_score": 0.9193872809410095,
"tags": null,
"url": "https://math.stackexchange.com/questions/1375610/is-the-real-number-sqrt6-in-mathbbr-equal-to-the-5-adic-number-sqrt/1375876#1375876"
} |
ros, python, c++, quaternion, tutorials
which agrees with the result by doing rosrun tf tf_echo base_link r_wrist_roll_link
But the result of my program is
end Cartesian pose: trans,0.59,-0.36,0.93,rol,0.83,-0.27,0.49,0.00
Here is the code snippet:
tf::TransformListener listener;
ros::NodeHandle node;
ROS_INFO("Now calling the client function...");
success = call_execute_cartesian_ik_trajectory(node, "base_link", position, orientations);
ROS_INFO("Finished calling");
tf::StampedTransform transform;
try{
listener.lookupTransform("base_link", "r_wrist_roll_link",
ros::Time(0), transform);
}
catch (tf::TransformException ex){
ROS_ERROR("%s",ex.what());
} | {
"domain": "robotics.stackexchange",
"id": 6367,
"lm_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, python, c++, quaternion, tutorials",
"url": null
} |
optimization, vbscript, asp-classic
Nothing else is taking more than 3% of the processing time. I've run a fairly typical report checking system-wide compliance with two online test from 11 March 2010 to 11 March 2011. (a report that is being run constantly this month by just about every VP, and the source of half the support calls I've been taking.)
The SQL for that run ends up looking like:
SELECT LEmp.LawsonID, LEmp.LastName, LEmp.FirstName, LEmp.MidInit, LEmp.winUserName, LPos.Position, LEmp.AccCode, LDept.DisplayName, LEmp.EmpStatus,
Log.VerificationID, Log.WinLogon, Log.Name, Log.Position, Log.Pass, Log.DoneTime, Log.Title
FROM ((Lawson_Employees AS LEmp LEFT JOIN Lawson_DeptInfo AS LDept ON LEmp.AccCode = LDept.AccCode)
INNER JOIN Lawson_PositionCodes AS LPos ON LEmp.PosCode = LPos.PosCode)
LEFT JOIN (
SELECT V.VerificationID, V.WinLogon, V.LawsonID, V.Name, V.Position, V.Pass, V.DoneTime, C.Title | {
"domain": "codereview.stackexchange",
"id": 165,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optimization, vbscript, asp-classic",
"url": null
} |
electromagnetism, general-relativity, astrophysics, black-holes
You might already be familiar with the phenomenon of synchrotron radiation from electrons interacting with a magnetic field. As an electron moves in the field, it experiences an acceleration in the plane perpendicular to the magnetic field (flux) that can produce cyclical motion in that plane. If you consider a situation where the radius of the cyclical motion is small compared to other relevant length scales in the problem, then you can see how the electron might appear as though is "trapped" on the field line, as it continues to move freely in the direction parallel to the field line. | {
"domain": "physics.stackexchange",
"id": 2384,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, general-relativity, astrophysics, black-holes",
"url": null
} |
# Solving an inequality
## Homework Statement
The range of k for which the inequality ##k\cos^2x-k\cos x+1≥0## for all x, is
a. k<-1/2
b. k>4
c. -1/2≤k≤4
d. -1/2≤k≤2
## The Attempt at a Solution
I am not sure about how to begin with this. This seems to me a quadratic in cos(x) and here, the discriminant should be less than zero.
##k^2-4k<0##
This gives me ##0<k<4## but this is not given in any of the options.
Any help is appreciated. Thanks!
Related Precalculus Mathematics Homework Help News on Phys.org
I like Serena
Homework Helper
Hey Pranav!
It seems you are not done yet.
Your solution would be right if cos x could take on any value.
However, cos x is limited in range.
This means that the actual solution will have to contain your solution and perhaps have more solution values.
Is there any answer that matches that?
Alternatively, you could try and find the minima and maxima of ##\cos^2x - \cos x##.
Fill those in and solve for k.
But of course that is more work... | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9653811581728097,
"lm_q1q2_score": 0.8205461543009823,
"lm_q2_score": 0.8499711718571775,
"openwebmath_perplexity": 1400.7190193988713,
"openwebmath_score": 0.8207471370697021,
"tags": null,
"url": "https://www.physicsforums.com/threads/solving-an-inequality.666547/"
} |
If $\left| \alpha - \frac{p}{q} \right| < \frac{1}{2 q^2}$, then $p/q$ is a convergent.
But it's a trap! This forces $p/q = p_n/q_n$, but it doesn't force $p/q$ to be in lowest terms. I suspect sufficient cleverness could route around this, but I didn't see how.
UPDATE This is also false for $\ZZ^2$. I don't have the energy to write down a complete proof, but here is the sketch.
Case 1 There are slopes $0 < m_1 < m_2$ and a radius $R$ such that the region $$\left\{ (x,y) : m_1 < \frac{y}{x} < m_2, \ x^2+y^2 > R^2, \ GCD(x,y)=1 \right\}$$ is monochromatic. Then we can find a fraction $p/q$ with $m_1 < p/q < m_2$. All points on the line $py-qx=1$ for $y>>0$ will lie in the above region, so we have a monochromatic ray.
Case 2 Every region as above is bi-colored.
Mimicing fedja's argument here, recursively build an $a$ so that all sufficiently large solutions to $|x^5 - a^5 y^5| <1$ have the same color. | {
"domain": "mathoverflow.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9890130596362788,
"lm_q1q2_score": 0.817628760891234,
"lm_q2_score": 0.8267117940706734,
"openwebmath_perplexity": 131.62203611790935,
"openwebmath_score": 0.9519188404083252,
"tags": null,
"url": "http://mathoverflow.net/questions/138676/is-there-an-algebraically-normal-function-from-mathbbzn-to-0-1"
} |
slam, navigation, turtlebot, ros-kinetic, costmap-2d
Title: On speed limit in SLAM
Hello. I am a ROS beginner. I am doing SLAM of turtlebot 3 (waffle) in the ubuntu 16.04, ros (kinetic) personal computer environment.
I'd like to limit the speed of the robot in real time during SLAM.
So there are two questions.
First, what is the difference between max_vel_x and max_trans_vel of dwa_local_planner_params?
Second, is it possible to change the values of max_vel_x and max_trans_vel in real time using local cost map information?
Thank you.
Originally posted by saito on ROS Answers with karma: 50 on 2018-11-15
Post score: 0
max_vel_x is how fast your robot can move in x axis, and max_trans_vel is how fast your robot can move.
I tried changing these two params in real time by using "rosparam set", but seems like the real velocity of robot didn't affect by it. So I think the answer would be no. I think there are also speed limits in robot's description files so maybe you want to consider them too. | {
"domain": "robotics.stackexchange",
"id": 32056,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "slam, navigation, turtlebot, ros-kinetic, costmap-2d",
"url": null
} |
scikit-learn, encoding, features
[[1. 0. 1. 0. 1.]
[0. 1. 0. 1. 1.]]
This representation contains 5 slots instead of 4, because the first slot is interpreted as using banana or orange, the second one as apple or banana and the last one only has the option cucumber.
(This would also not solve the problem of having different amounts of feature values per datapoint. And replacing empty ones with None does not solve the problem either, because then None faces this positional ambiguity.)
Any idea how to encode those "Multi-Muliti-"features, that can take multiple values and consist of a varying amount of elements? Thank you in advance! I think you can transform this into a text preprocessing problem and then use CountVectorizer. You basically build "documents" by putting together all the words in your raw data and then use CountVectorizer on those documents.
from sklearn.feature_extraction.text import CountVectorizer | {
"domain": "datascience.stackexchange",
"id": 9000,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "scikit-learn, encoding, features",
"url": null
} |
human-biology, cardiology, heart-output
These are located in the carotid and aortic bodies and measure the concentration of $\ce{O2}$. The receptor cells of these structures make connection with afferent nerves, to send a signal to the central nervous system in times of hypoxemia.
$\ce{CO2}$/$\ce{O2}$ Exchange
Blood is the tissue responsible for distributing chemicals around your body. It is therefore also involved in the $\ce{CO2}$/$\ce{O2}$ exchange between tissues. Blood cells use hemoglobin as as a carrier molecule for this exchange.
When $\ce{O2}$ is delivered to tissues, it will be processed by the mitochondria of the cells to synthesise ATP, and $\ce{CO2}$ as a biproduct. ATP is also responsible for muscle contractions, and so, with exercise comes an increased utilisation of ATP. With ATP stores running low, your cells will begin to use more $\ce{O2}$, and therefore, they will produce more $\ce{CO2}$.
$\ce{CO2}$ and Acidity | {
"domain": "biology.stackexchange",
"id": 7236,
"lm_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, cardiology, heart-output",
"url": null
} |
population-genetics
Title: Linkage disequilibrium I want to know what ranges of value can D' in linkage disequilibrium take? Because I read in my book (An introduction to population genetics by Nielsen and Slatkin) that D' is guaranteed to be between 0 and 1. Whereas at the link provided below, it says D' can be between -1 and 1.
http://csg.sph.umich.edu/abecasis/class/666.03.pdf
Could someone explain this discrepancy? Because now I am totally confused. The whole point about using D' rather than D is because D' is bounded between -1 an 1 for any allele frequency, while the bounds for D depends upon the allele frequency of interest.
Recall the definition of D
$$D = p_{ab} - p_ap_b$$
Let, $D_{min}$ and $D_{max}$ be the minimal and maximal values of $D$ for a specific allele frequency.
For $p_a = p_b = 0.5$, the $D_min$ is when when $p_{ab} = 0$ ($D_{min} = -0.25$) and $D_{max}$ is when $p_{ab} = 1$ ($D_{max}=0.75$). | {
"domain": "biology.stackexchange",
"id": 6272,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "population-genetics",
"url": null
} |
# Combinatorics problem with coins
#### lavoisier
I guess more and more people in the world tend to use virtual money (credit cards, direct debit cards...) to pay for their shopping.
Here in Europe, however, people often still use cash in many situations.
This obviously has a side effect concerning coins.
Except when you go to a bar, restaurant, etc, and round the sum to leave a tip, in all other cases you have to pay an exact amount of money, which is most often a decimal number.
So, if you pay the exact amount, or a whole number in excess of it plus the decimal part, you will get no small coins in return: at most pieces of 1.00 and 2.00.
But if you pay an amount corresponding to a whole number, you will most often get back small coins, i.e. pieces of 0.01, 0.02, 0.05, 0.10, 0.20 and 0.50.
Suppose you want to get rid of these small coins by spending them, but of course you don't want to carry a lot of weight around with you. | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.969785415552379,
"lm_q1q2_score": 0.8123116202851207,
"lm_q2_score": 0.8376199592797929,
"openwebmath_perplexity": 542.0920112836055,
"openwebmath_score": 0.5920782685279846,
"tags": null,
"url": "https://www.physicsforums.com/threads/combinatorics-problem-with-coins.753066/"
} |
nuclear-physics, radiation, randomness
The alpha tunneling rate is given from particle-in-a-box quantum mechanics by the equation below. See here for an interactive demonstration.
$$\log(\tau) = A - B \frac{Z}{\sqrt{E_{\alpha}}}$$
Here $\tau$ is the decay time, $Z$ is final number of protons and $E_{\alpha}$ is the energy of the emitted alpha particles. If $\tau$ is in seconds and $E_{\alpha}$ in MeV, then $A=-46.83$ and $B=-1.454$.
The effect of temperature is to add a thermal kinetic energy of $\frac{3}{2}k_{B} T$, so that the energy barrier is slightly lowered $E_{\alpha} \rightarrow E_{\alpha}-\frac{3}{2}k_{B} T$. One can verify from the above equation that, because $E_{\alpha}$ is of order 5 MeV (or $5\cdot 10^{10}$ K), photons need to heat the atom up to $\sim 10^{8}$ Kelvin to produce a 1% change in the alpha decay time. Such temperatures are actually possible with lasers at the National Ignition Facility (NIF), where they study nuclear fusion, rather than alpha decay. | {
"domain": "physics.stackexchange",
"id": 74237,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "nuclear-physics, radiation, randomness",
"url": null
} |
quantum-mechanics, condensed-matter, wavelength, degrees-of-freedom
you are not plucking the string, it is vibrating, due to thermal fluctuations (i.e. the molecules in the air are hitting the string and lead to vibrations.) These thermal fluctuations are exciting your degrees of freedom (the different oscillation modes of the string), and are largest at long wavelengths. This is because long-wavelength oscillations are easiest to excite, energetically. | {
"domain": "physics.stackexchange",
"id": 91947,
"lm_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, condensed-matter, wavelength, degrees-of-freedom",
"url": null
} |
• A professional engineer rather than a professional mathematician, I am not very handy with notation like $\forall x\in[0,1]$. An engineer would normally write $0 \le x \le 1$ and, if necessary, write "for all" out in words. If my notation is imperfect, corrections would be appreciated. – thb Jun 4 '17 at 19:48
• Write whatever is legible. If that means more words, so be it. I'd phrase it as "for all $x \in [0,1]$" or "for all $x$ with $0 \leq x \leq 1$", without really preferring one over the other; I tend to avoid the $\forall$ symbol except in formal logic, because it's just a bit less readable. – Patrick Stevens Jun 4 '17 at 21:05
• @thb : I would write this as follows: $$0 \le \int_0^1 x^k e^{x-1}\,dx \le \int_0^1 x^k \, dx = \frac 1 {k+1} \to 0 \text{ as } k\to\infty.$$ – Michael Hardy Jun 4 '17 at 21:08
• @thb : I wonder why you write $x^k e^{x-1} \le x^k e^1$ when you could just go with $x^k e^{x-1} \le x^k. \qquad$ – Michael Hardy Jun 4 '17 at 21:12 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9496693731004241,
"lm_q1q2_score": 0.8410570879722723,
"lm_q2_score": 0.8856314753275017,
"openwebmath_perplexity": 431.9036062092121,
"openwebmath_score": 0.8614785075187683,
"tags": null,
"url": "https://math.stackexchange.com/questions/2309722/how-to-find-a-meaningful-bound-on-a-sequence-that-is-known-to-go-to-0/2309758"
} |
html, html5, typescript, angular-2+
poll-list.component.ts
import { Component, OnInit } from '@angular/core';
import { PollService } from './poll.service';
import { AuthService } from '../auth/auth.service';
import { Poll } from './poll.model';
@Component({
selector: 'app-poll-list',
templateUrl: './poll-list.component.html',
styleUrls: ['./poll-list.component.css']
})
export class PollListComponent implements OnInit {
polls: Poll[] = [];
pollsToDisplay: Poll[] = [];
showOnlyMyPolls = false;
constructor(private pollService: PollService, private authService: AuthService) { }
ngOnInit() {
this.pollService.getPolls()
.subscribe(
(polls: Poll[]) => {
this.polls = polls;
this.pollsToDisplay = polls;
}
);
} | {
"domain": "codereview.stackexchange",
"id": 25670,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "html, html5, typescript, angular-2+",
"url": null
} |
## Singular Value Decomposition¶
Another important matrix decomposition is singular value decomposition or SVD. For any $$m\times n$$ matrix $$A$$, we may write:
$A= UDV$
where $$U$$ is a unitary (orthogonal in the real case) $$m\times m$$ matrix, $$D$$ is a rectangular, diagonal $$m\times n$$ matrix with diagonal entries $$d_1,...,d_m$$ all non-negative. $$V$$ is a unitary (orthogonal) $$n\times n$$ matrix. SVD is used in principle component analysis and in the computation of the Moore-Penrose pseudo-inverse.
## Stabilty and Condition Number¶
It is important that numerical algorithms be stable and efficient. Efficiency is a property of an algorithm, but stability can be a property of the system itself.
### Example¶
$\begin{split}\left(\begin{matrix}8&6&4&1\\1&4&5&1\\8&4&1&1\\1&4&3&6\end{matrix}\right)x = \left(\begin{matrix}19\\11\\14\\14\end{matrix}\right)\end{split}$
A = np.array([[8,6,4,1],[1,4,5,1],[8,4,1,1],[1,4,3,6]])
b = np.array([19,11,14,14])
la.solve(A,b) | {
"domain": "duke.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9948603889024311,
"lm_q1q2_score": 0.8014915505208438,
"lm_q2_score": 0.8056321866478979,
"openwebmath_perplexity": 404.6518442289017,
"openwebmath_score": 0.8634533882141113,
"tags": null,
"url": "http://people.duke.edu/~ccc14/sta-663-2017/13B_LinearAlgebra2.html"
} |
2. Originally Posted by Diamondlance
I want to find the area inside $f=3+3\cos{\theta}$ and outside $g=3+3\sin{\theta}$ (we're in polar coordinates).
After making a sketch and finding the intersection points at $\theta=\frac{\pi}{4},\; \frac{5\pi}{4}$, I set up the integral
$\frac{1}{2}\int_{-3\pi/4}^{\pi/4}(f^2-g^2)\;d\theta$ thinking it would give me the area I want, and obtained $18\sqrt{2}$.
However, the answer in the back of my textbook is $9\sqrt{2}+\frac{27\pi}{8}+\frac{9}{4}$.
I checked the actual integration in Maple, so either the integral was set up incorrectly or the back of the textbook answer is wrong. I can't see what if anything I've done wrong, however I'm quite rusty at these types of problems so I wanted to ask if you see anything wrong with what I did. Thanks in advance.
I agree with your set up and calculation. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9835969689263265,
"lm_q1q2_score": 0.8217790766973667,
"lm_q2_score": 0.8354835391516133,
"openwebmath_perplexity": 264.46564075962766,
"openwebmath_score": 0.9255973100662231,
"tags": null,
"url": "http://mathhelpforum.com/calculus/167181-cardioid-area-problem.html"
} |
c++, performance, file, file-structure, heap-sort
swapped = true;
} else {
swapped = false;
}
}
} else {
if ( left > top ) {
writeData( &left, posTop );
posTop = posLeft;
swapped = true;
} else {
swapped = false;
}
}
} else {
swapped = false;
}
} while ( swapped );
writeData( &top, posTop );
}
util.h
#ifndef UTIL_H
#define UTIL_H
// Includes
#include <iomanip>
#include <iostream>
#include <stddef.h>
#include <sstream>
#include <string>
#include <thread>
#include <unistd.h>
#include <sys/ioctl.h>
// Constants
constexpr size_t hashSize = 8;
constexpr size_t offsetSize = 6;
constexpr size_t writeSize = hashSize + offsetSize;
constexpr long long defaultTimeout = 100; | {
"domain": "codereview.stackexchange",
"id": 22193,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, performance, file, file-structure, heap-sort",
"url": null
} |
hash
Title: Computing hash of a compound key Why is the initial value of hash 17 and not 0?
/**
* Returns an integer hash code for this date.
*
* @return an integer hash code for this date
*/
@Override
public int hashCode() {
int hash = 17;
hash = 31*hash + month;
hash = 31*hash + day;
hash = 31*hash + year;
return hash;
}
https://algs4.cs.princeton.edu/code/edu/princeton/cs/algs4/Date.java.html There is no compelling reason that I'm aware of. The hash algorithm would also work about as well with an initial value of 0, as far as I can see. | {
"domain": "cs.stackexchange",
"id": 15052,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "hash",
"url": null
} |
waves, atomic-physics
(There is obviously another problem in the analogy that is independent from the lacking dimension, which is that there will probably always different amplitudes for sonic waves and no way to model the "spin", but that's that.) A perfect analogy would be one in which wave function satisfied by the vibrating system satisfies the exact same differential equation as the Coulomb-Schrödinger equation governing the shapes of atomic orbitals.
I can't think of any physical examples with an exact match.
But, it turns out that the angular part of the Schrödinger equation alone already qualitatively characterizes the shape of atomic orbitals closely. In this case, any spherically vibrating object would do:
Take a look at this paper: http://www.acs.psu.edu/drussell/Publications/Basketball.pdf
(figure 4) | {
"domain": "physics.stackexchange",
"id": 18777,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "waves, atomic-physics",
"url": null
} |
organic-chemistry, physical-chemistry, bond, intermolecular-forces
The main reason why you observe this is that cations in solution have an ordered solvent shell around them, especially in polar solvents where there will be defined solvent geometry around the shell; often octahedral for metal ions in water. The formation of a complex with a bidentate ligand such as malonate is more favourable than that with a monodentate ligand such as acetate because the same number of solvent ligands are lost with half the number of ligands complexed. This results in a greater increase in entropy - you can see this in terms of the degrees of freedom gained by the water molecules more than compensating for those lost by the new ligands. | {
"domain": "chemistry.stackexchange",
"id": 3077,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, physical-chemistry, bond, intermolecular-forces",
"url": null
} |
approach discussed on the page Optimization Problems in 2D Geometry. For example, according to (6) and (7), the uniformly polarized cylinder of material shown in Fig. To find solid volume, take measurements with a tool like a ruler. On the contrary, volume is measured in cubic units. How do the radius and surface area of the balloon change with its volume? We can find the answer using the formulas for the surface area and volume for a sphere in terms of its radius. The volume of a sphere with radius r is given by the formula V=4/3π r³. For example, a student might compare the areas in a given cross-section, reducing the problem to a comparison of the area under a line and under a quadratic-like curve. A = units sq. See Figure 8-2. The volume of a sphere is 4/3 the volume of a cylinder (with same radius and height). Consolidate volumes of prisms, pyramids, cylinders, cones and spheres. What is the relationship between the volume of a cone and cylinder when they both have the same radius | {
"domain": "antennablutv.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9825575183283514,
"lm_q1q2_score": 0.8428065076853339,
"lm_q2_score": 0.8577681122619883,
"openwebmath_perplexity": 417.44691924699725,
"openwebmath_score": 0.7241692543029785,
"tags": null,
"url": "http://antennablutv.it/bkza/relationship-between-volume-of-cylinder-cone-and-sphere.html"
} |
statistical-mechanics, probability, fermions, bosons
+B\ E(n_\text{a}, n_\text{b})] \equiv{}
\\
&\qquad
\exp[A\ (n_\text{a} + n_\text{b})
+B\ (\epsilon_\text{a}\ n_\text{a} + \epsilon_\text{b}\ n_\text{b})]
\equiv{}
\\
&\qquad
\exp[(A\ +B\ \epsilon_\text{a}) n_\text{a}]\cdot
\exp[(A\ +B\ \epsilon_\text{b}) n_\text{b}]
\end{aligned}
$$
where the coefficients $A$ and $B$ are obtained using the constraints above. Note how this maximum-entropy distribution turns out to be factorizable into distributions for the single modes.
First let's find the normalization factor of the distribution. It's
$$\begin{aligned}
\sum_{(n_\text{a}, n_\text{b})}
\bigl\{\exp[(A\ +B\ \epsilon_\text{a}) n_\text{a}]\cdot
\exp[(A\ +B\ \epsilon_\text{b}) n_\text{b}]\bigr\}
\equiv{}\\\qquad
\sum_{n_\text{a}}
\exp[(A\ +B\ \epsilon_\text{a}) n_\text{a}]
\cdot
\sum_{n_\text{b}}
\exp[(A\ +B\ \epsilon_\text{b}) n_\text{b}] \ .
\end{aligned}$$
We can calculate each sum explicitly, and here is where the difference between Bosonic and Fermionic systems appears. | {
"domain": "physics.stackexchange",
"id": 75581,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "statistical-mechanics, probability, fermions, bosons",
"url": null
} |
periodic-trends, periodic-table
Title: How long the block starting with element 121 will be? I remember from my chemistry classes that (after the initial irregularities) a new block of elements starts every two periods. After the initial s-block and p-block following it shortly, we have d-block starting at period IV, and f-block starting at period VI.
Now that Element 118 has been discovered, we're about to open period VIII and we're two elements short of a new block.
What block will it be? How many groups, what name etc? As you noted, this is a very appropriate question in light of the IUPAC announcement that we have just finished filling Period 7!
The names of the subshells s, p, d, and f are named after the old spectroscopic terms sharp, principal, diffuse, and fundamental. We ran out of fancy names after that, so the subsequent subshells are named in alphabetical order - g, h, and so on - which means that after the 8s block is filled, we would theoretically have a 5g block. | {
"domain": "chemistry.stackexchange",
"id": 4826,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "periodic-trends, periodic-table",
"url": null
} |
quantum-mechanics, physical-chemistry
If you figuratively gave me a hydrogen atom as a gift, how would I determine which n, m, l values actually apply for the probability density function for its electron? First of all, there is no particular reason why you should expect the hydrogen atom to be in one of the listed states. Those states are one particular choice of basis states for the hydrogen atom, meaning that in general the atom may be in any superposition thereof. This particular set of basis states consists of simultaneous eigenstates of $H$, $L^2$, and $L_z$. So if you have a way to measure the energy of the electron, then you can determine the quantum number $n$. If you have a way to measure the total angular momentum of the electron, then you can determine $\ell$. Finally, if you have a way to measure the angular momentum around the z-axis, then you can determine $m$. | {
"domain": "physics.stackexchange",
"id": 90162,
"lm_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, physical-chemistry",
"url": null
} |
LukeD
That's about as good as you con do it at this point. When you get into some later calculus classes, you might learn other techniques for approximating functions like the logarithm
For instance, for x between -1 and 1 (exclusive, i.e., it doesn't work if x = -1 or if x = 1), a formula that you can use for the natural log (log base e) is
Log(1+x) = x - x^2/x + x^3/x - x^4/4 + x^5/5 - ... (and so on)
since x is between -1 and 1, the terms you are adding and subtracting keep getting smaller, so you can stop after some point and be confident that your answer is pretty close (though this depends on how close x is to 0, for x closer to -1 or 1, you'd want to keep going until you get to around x^30/30)
A more complicated formula that you can use and not have to take it to as many terms (though i believe that it's only valid for 0 < x < 2) is
$$\ln (z) = 2 \sum_{n=0}^\infty \frac{1}{2n+1} {\left ( \frac{z-1}{z+1} \right ) }^{2n+1}$$
11. May 5, 2008
uman | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9796676502191266,
"lm_q1q2_score": 0.805472093534146,
"lm_q2_score": 0.8221891305219504,
"openwebmath_perplexity": 556.3235731664646,
"openwebmath_score": 0.7320918440818787,
"tags": null,
"url": "https://www.physicsforums.com/threads/bases-to-the-power-of-logs.233281/"
} |
c++, performance, primes
For every non-prime you are a doing a search through the list of non primes. For both std::vector and std::list this is an O(n) operation.
The usual way of implementing this is to have an array where the removed elements are represented by their index into the array and thus represent a complexity of O(1) to both set and check if an element has already been set to false.
std::vector<bool> sieve(number + 1, true);
Then the following lines can be replaced:
if(std::find(listOfNonPrimes.begin(), listOfNonPrimes.end(), i) != listOfNonPrimes.end())
continue;
listOfNonPrimes.push_back(i);
// Change too
sieve[i] = false;
Other things:
Every time through the loop you do a test:
if (i == current_prime_check) {
container.push_back(i);
continue;
} | {
"domain": "codereview.stackexchange",
"id": 1046,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, performance, primes",
"url": null
} |
performance, strings, functional-programming, time-limit-exceeded, clojure
Title: Clojure reverse multiple times I have a piece of Clojure code that reverses a string recursively.
It is working but too slow (because I got the problem from Codewars and I cannot validate it before it timeouts).
The algorithm is :
take a string ex. "abc" and reverse it (r "abc") -> "cba"
take the first position and reverse from there "c" + (r "ba") -> "cab"
take the second position and reverse from there "ca" + (r "b") -> "cab"
and so on..
First iteration :
(defn reverse-fun [s]
(loop [r s p 0]
(if (= p (count s))
r
(let [[b e] (split-at p r)
e (reverse e)]
(recur (apply str (concat b e)) (inc p)))))) | {
"domain": "codereview.stackexchange",
"id": 19078,
"lm_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, strings, functional-programming, time-limit-exceeded, clojure",
"url": null
} |
So what's the sample variance? So I guess I'm-- hm-- yeah, so what is the sample variance? What's the variance about anyway? What's the key point of variance?
It's the distance from the mean. So this will be a distance from the sample mean, and this will be a distance from the expected mean. So not distance from zero, but distance from mu and m, from the center of the thing.
So the sample variance-- so, again, we have n samples. But for some wonderful reason in statistics you divide by n minus 1 this time. And the reason has to do with the fact that you used one-- this will involve the mean. So this would be the first output minus mu squared up to the n-th output minus mu squared.
So it's the average distance from mu-- average squared distance from mu-- but with this little twist that, of course, when n is large, it's not a very significant difference between n and n minus 1. I Think that's about right. All this is that I'm just doing one experiment over and over. | {
"domain": "mit.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9867771766922545,
"lm_q1q2_score": 0.8179778906709458,
"lm_q2_score": 0.8289388019824946,
"openwebmath_perplexity": 610.2312734417585,
"openwebmath_score": 0.7315199971199036,
"tags": null,
"url": "https://ocw.mit.edu/courses/mathematics/18-065-matrix-methods-in-data-analysis-signal-processing-and-machine-learning-spring-2018/video-lectures/lecture-19-saddle-points-continued-maxmin-principle/"
} |
information-theory, entropy, mutual-information
Title: How to prove the positivity of the conditional quantum mutual information, $I(A;B|C)\ge0$? I was reading Wilde's 'Quantum Information Theory' and saw the following theorem at chapter 11 $(11.7.2)$:
$$
I(A; B | C) \ge 0,
$$
where,
$$
I(A;B|C) := H(A|C) + H(B | C) - H(AB|C).
$$
I know that the mutual information is non-negative, i.e.
$$
I(A;B) \ge 0,
$$
where,
$$
I(A;B) := H(A) + H(B) - H(AB).
$$
Now if we have access to an additional subsystem $C$, this can't decrease the mutual information of $A$ and $B$. But I was looking for sort of formal proof of this. I was trying to apply the non-negativity of mutual info. into this, but not sure how to proceed. Thanks in advance! Here's a relatively simple proof just based on the data processing inequality (DPI) for the relative entropy $D(\rho\|\sigma) = \mathrm{tr}[\rho (\log \rho - \log \sigma)]$ -- if you're willing to accept the DPI as a basis for a formal proof. Recall that the DPI says that for any channel $\Phi$ we have
$$ | {
"domain": "quantumcomputing.stackexchange",
"id": 2871,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "information-theory, entropy, mutual-information",
"url": null
} |
electronic-configuration, transition-metals
Title: Why does Co(I) have a 3d8 configuration? Why is the electron configuration of $\ce{Co^+}$ $[\ce{Ar}](\mathrm{3d})^8$?
Since neutral $\ce{Co}$ itself has a $[\ce{Ar}](\mathrm{4s})^2(\mathrm{3d})^7$ configuration, wouldn't the ionised electron be lost from the $\mathrm{4s}$ orbital, leading to an electron configuration of $[\ce{Ar}](\mathrm{4s})^1(\mathrm{3d})^7$? For lighter elements, the shells fill in order. Starting at the transition metals, an outer s orbital may fill before an inner d orbital, so the electron configuration of unioninzed cobalt is written $\ce{[Ar]}4\mathrm s^1\,3\mathrm d^7$, rather than $\ce{[Ar]}3\mathrm d^7\,4\mathrm s^1$.
There is a video diagramming the electron configuration of $\ce{Co}$, $\ce{Co^{2+}}$ and $\ce{Co^{3+}}$, thought it does not explain the reasoning, nor does it cover the less common $\ce{Co^{+}}$ ion, produced by photoionization or as found in some esoteric metal-organic compounds, or in the theoretical $\ce{CoCl}$. | {
"domain": "chemistry.stackexchange",
"id": 15423,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electronic-configuration, transition-metals",
"url": null
} |
source to the destination in the most optimal way. * @param source source station from which shortest distance will be calculated to the stations */ public void computePaths(Vertex source) { source. Find a shortest path to a given target vertex $$t$$ from each vertex $$v$$. If shortest paths are needed for all the vertices rather than for a single one, then see all pairs shortest path. A graph is a pictorial representation of a set of objects where some pairs of objects are connected by links. An edge-weighted graph G (V, E) and the source r. Explain how PathFinder. We need to find a shortest path from some given vertex ‘v’ to destination vertex ‘w’. Original version of the algorithm was designed to construct the minimum spanning tree for the graph. The problem of finding the longest path in a graph is known to be not be possible in polynomial time, that I am aware of. Finding the best path through a graph (for routing and map directions) Determining whether a graph is a DAG. | {
"domain": "calcolailtuomutuo.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9857180685922241,
"lm_q1q2_score": 0.8058979314131833,
"lm_q2_score": 0.8175744739711883,
"openwebmath_perplexity": 468.0280469654051,
"openwebmath_score": 0.42271119356155396,
"tags": null,
"url": "http://calcolailtuomutuo.it/eapk/shortest-path-from-source-to-destination-in-graph.html"
} |
reinforcement-learning, dqn, deep-rl, exploration-exploitation-tradeoff
Title: Why do some DQN implementations not require random exploration but instead emulate all actions? I've found online some DQN algorithms that (in a problem with a continuous state space and few actions, let's say 2 or 3), at each time step, compute and store (in the memory used for updating) all the possible actions (so all the possible rewards). For example, on page 5 of the paper Deep Q-trading, they say
This means that we don't need a random exploration to sample an action as in many reinforcement learning tasks; instead we can emulate all the three actions to update the Q-network. | {
"domain": "ai.stackexchange",
"id": 2145,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reinforcement-learning, dqn, deep-rl, exploration-exploitation-tradeoff",
"url": null
} |
quantum-mechanics, universe, space-expansion
For a photon its wavelength scales with the expansion of space. We can think of a photon of a given wavelength $\lambda$ in a region of space as being in a cavity. As one photon leaves another enters. Then the wavelength expands with the space $\lambda~\propto~a$ for $a$ the scale factor, and as energy is $E = h\nu$ $= hc/\lambda$ the energy scales inversely with the scale factor $E~\propto~a^{-1}$. The energy density, energy per volume, then scales as $\rho~\propto~a^{-4}$. | {
"domain": "physics.stackexchange",
"id": 31398,
"lm_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, universe, space-expansion",
"url": null
} |
ros, xtion, ros-fuerte, asus
#--avin mod--
# Kinect
SUBSYSTEM=="usb", ATTR{idProduct}=="02ae", ATTR{idVendor}=="045e", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTR{idProduct}=="02ad", ATTR{idVendor}=="045e", MODE:="0666", OWNER:="root", GROUP:="audio"
SUBSYSTEM=="usb", ATTR{idProduct}=="02b0", ATTR{idVendor}=="045e", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTR{idProduct}=="02be", ATTR{idVendor}=="045e", MODE:="0666", OWNER:="root", GROUP:="audio"
SUBSYSTEM=="usb", ATTR{idProduct}=="02bf", ATTR{idVendor}=="045e", MODE:="0666", OWNER:="root", GROUP:="video"
Originally posted by jarvisschultz with karma: 9031 on 2013-12-12
This answer was ACCEPTED on the original site
Post score: 6 | {
"domain": "robotics.stackexchange",
"id": 16423,
"lm_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, xtion, ros-fuerte, asus",
"url": null
} |
quantum-chemistry, theoretical-chemistry, ab-initio, multi-reference
During CASSCF, on the other hand, all MO expansion coefficients are optimized during the energy-minimization procedure, in addition to the multielectron expansion coefficients.
CI is able to recover the dynamical correlation of the system (configuration with large weight, many configurations with small weight), whereas (properly selected) CASSCF recovers the static correlation of the system (a few configurations with about the same weight, many configurations with small weight). By having a wave function that have some configurations with about the same weight, means that the wave function has some multi-reference character. I think that it is the MO optimization that leads to this multi-reference capabilities of CASSCF, but I'm not sure I understand why. | {
"domain": "chemistry.stackexchange",
"id": 9092,
"lm_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-chemistry, theoretical-chemistry, ab-initio, multi-reference",
"url": null
} |
c++, performance, multithreading, lock-free, producer-consumer
if (newTail != _head.load(std::memory_order_relaxed)) { // When _tail + 1 == _head we can not add.
if (!_isBusy.at(_tail.load(std::memory_order_relaxed)
).exchange(true, std::memory_order_relaxed)) { // Check that the index is not busy
pushIndex = _tail.load(std::memory_order_relaxed);
_tail.store(newTail, std::memory_order_relaxed);
keepTrying = false;
}
}
else {
keepTrying = false;
}
_canUpdate.store(true, std::memory_order_release); // Allow access to the critical section for other
// threads to update the indexes
} | {
"domain": "codereview.stackexchange",
"id": 45149,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, performance, multithreading, lock-free, producer-consumer",
"url": null
} |
proof-techniques, induction
Now, if one could prove $P(n): n^2 = (n * n)$ via the base and the induction cases:
$P(n)$ is valid for $n := 0$;
$P(n)$ is valid for $n := n + 1$;
One should also be allowed to prove it by saying that:
$P(n)$ is valid for $n := 0$;
$P(n)$ is valid for $n := n + 2$;
and via $P(n)$ is valid for $n := n + 3$;
and via $P(n)$ is valid for $n := n + 4$;
and, in fact, via $P(n)$ is valid for $n := n + m,\ \forall m > 0$.
Second question: is this inference correct? | {
"domain": "cs.stackexchange",
"id": 2946,
"lm_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-techniques, induction",
"url": null
} |
algorithms, linear-programming, greedy-algorithms, knapsack-problems
I implemented an easy greedy algorithm that orders each element in respect of their $\frac{\text{# of people satisfied}}{\text{cost}}$ for example if element "a" satisfies 3 people if choose and has a cost of 10, its ratio would be $3/10$. I chose each element in a non-increasing order. Until i run out of people to satisfy.
How do i find the approximation factor for this algorithm? I think it should be around 2 since it's very similar to a greedy approach to knapsack problem, but i have no clue on how to demonstrate it. So if you are not updating the #satisfied/cost ratio after every selection, this algorithm won't perform well. Let $n$ be the number of people and $m$ the number of meals. We denote the cost of meal $i$ by $w_i$. Let's say people $1...n-1$ are all satisfied by meals $1...m-1$ which all have the same cost, but person $n$ will only eat meal $m$. If the cost of meal $m$ is any more than $w_1/(n-1)$, then your algorithm will select every meal. | {
"domain": "cs.stackexchange",
"id": 15099,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, linear-programming, greedy-algorithms, knapsack-problems",
"url": null
} |
python, performance, python-2.x, image
import numpy as np
def pixelate_mode(mode):
if mode == 'mean':
return np.mean
elif mode == 'min':
return min
elif mode == 'max':
return max
def pixelate(img, (pixel_width, pixel_height), mode):
width, height = img.size
W = 0
while W * pixel_width < width:
H = 0
while H * pixel_height < height:
l = []
for x in xrange(pixel_width * W, pixel_width * (W + 1)):
for y in xrange(pixel_height * H, pixel_height * (H + 1)):
if x < width and y < height:
l.append(img.getpixel((x, y)))
color = pixelate_mode(mode)(l)
for x in xrange(pixel_width * W, pixel_width * (W + 1)):
for y in xrange(pixel_height * H, pixel_height * (H + 1)):
if x < width and y < height:
img.putpixel((x, y), color)
H += 1
W += 1
return img | {
"domain": "codereview.stackexchange",
"id": 17990,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, python-2.x, image",
"url": null
} |
formal-languages, turing-machines
It's a lot of questions but they are related, please help me. There's is a significant difference between "arbitrarily long" and "infinite".
As a simple example, an integer can have an arbitrarily great magnitude; formally, for every integer, there exists a larger integer (its successor), which in turn has a successor, and so on. But all integers are finite; $\omega \notin \mathbb{N}$. (Or, if you prefer, $\infty \notin \mathbb{N}$.)
Similarly, the Kleene star operator $A^*$ represents the concatenation of an arbitrarily large number of elements from $A$, but not an infinite number of elements of $A$. | {
"domain": "cs.stackexchange",
"id": 14456,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "formal-languages, turing-machines",
"url": null
} |
c++, object-oriented, role-playing-game
and how is anybody supposed to know? If you ever want somebody else to read and understand your code (such as in a code review), make their life not harder than it already is. Choosing one-character names for your variables is high up on the list of worst things you can do for that goal.
Use telling method and function names. Is void incrementOrDecrementD(int); really so much more of a nuisance to write than void incdecD(int);? Couldn't you have come up with a better name, e.g. void modifyD(int);? Finding good and descriptive names for things is hard. Still, that is no excuse to be sloppy and go with a name whose meaning you yourself might not remember half a year later when you have to make some changes to your code.
Avoid magic numbers.
Ghoul::Ghoul (std::string noc): d_b_min(5), d_b_max(13), i_b_min(6), i_b_max(14), c_b_min(5), c_b_max(12), e_b_min(7), e_b_max(16), | {
"domain": "codereview.stackexchange",
"id": 26622,
"lm_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, role-playing-game",
"url": null
} |
java, object-oriented, role-playing-game
Title: Text-Based RPG Dungeon Game in Java I'm trying to follow as many OO concepts as possible. This project is for my github, as a means to enhance my portfolio for possible internships in the future.
Question 1: Is there anything that's declared static that shouldn't be?
Question 2: Should I have created a constructor for the Dungeon class, that way each dungeon is its own instance instead of have a factory make it every time?
Some notes about the program:
I generate a 30x30 array of Room objects, which also randomly generate a random monster in each room. As of now, the player can select new game, and pick a character. From there, they spawn in the middle room [14][14] where they fight each monster and can move room to room.
Any general tips or advice about the code of the program would be greatly appreciated!
ProjectMoria class:
package projectmoria;
import java.util.Random;
import java.util.Scanner; //needed for user_input
public class ProjectMoria { | {
"domain": "codereview.stackexchange",
"id": 37720,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, object-oriented, role-playing-game",
"url": null
} |
c++, iterator, c++14
Iterator Interface
Even though it won't be fully utilized in the simple example of for (auto i : range(10)), you should prefer to provide a complete interface for range_iterator. You're missing operator== and postfix-increment. Prefix-increment (and postfix-increment) should return references to this.
Additionally, you should inherit from std::iterator<std::forward_iterator_tag, int, std::ptrdiff_t, int, int> just in case somebody wants to use range() as a normal container somewhere else.
For example, it'd be nice to support the following:
auto r = range(10);
std::vector<int> v(r.begin(), r.end());
which currently will fail to compile. | {
"domain": "codereview.stackexchange",
"id": 17052,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, iterator, c++14",
"url": null
} |
particle-physics, experimental-physics, terminology, quarks, baryons
There are some obvious followup questions the could be related to the answer to that question (e.g. what could be wrong with the predictions in the theoretical literature and what changes to the Standard Model could give rise to this if the theoretical predictions are correct), but I am limiting this question to just this very fundamental definitional issue and will save other question for a time at which I understand what the quantity that is measured to be anomalous means. Up down symmetry I interpret as : in hadronic reactions and in decays where hadrons are involved, if an up quark is involved in the calculation, the corresponding reaction where symmetrically a down quark is involved should have the same crossection and decay times.
Why? Take the quark example of $Σ$ baryon ,
it has a $Σ^+$ going to $uus$ and a $Σ^-$ going to $dds$
up down symmetry means in this case the same lifetime for the two charges. | {
"domain": "physics.stackexchange",
"id": 91072,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "particle-physics, experimental-physics, terminology, quarks, baryons",
"url": null
} |
ros2
Can anyone please helpme
Originally posted by Flash on ROS Answers with karma: 126 on 2021-02-09
Post score: 1
I was able to resolve this issue by sourcing and running the launch file by using /bin/bash -c
ExecStart=/bin/bash -c 'source /opt/ros/foxy/setup.bash; source home/$USER/dev_ws/install/setup.bash; ros2 launch pkg_name launch_file_name.launch.py; sleep 60'
Originally posted by Flash with karma: 126 on 2021-03-25
This answer was ACCEPTED on the original site
Post score: 4
Original comments
Comment by robopo on 2021-11-23:
Hi there, why do you have sleep 60? How is this important? Some sort of protection?
Comment by Flash on 2021-11-23:
not that necessary, just gave it 60 sec before it starts again. If you have any other processes that need to close before you restart this might be a good option. | {
"domain": "robotics.stackexchange",
"id": 36064,
"lm_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
} |
ros
Title: How to fix catkin Depends error..? ROS2 galactic
Console:
sx-VirtualBox:~/catkin_ws/src$ catkin_make
Command 'catkin_make' not found, but can be installed with:
sudo apt install catkin
sx-VirtualBox:~/catkin_ws/src$ sudo apt install catkin
[sudo] password for kris-x:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
catkin : Depends: python3-catkin-pkg (>= 0.4.14-2) but it is not going to be installed
**E: Unable to correct problems, you have held broken packages.**
Originally posted by krishan.iot.w on ROS Answers with karma: 3 on 2021-08-19
Post score: 0
You cannot use Catkin with ROS 2. | {
"domain": "robotics.stackexchange",
"id": 36815,
"lm_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
} |
spring, differential-equations, vibrations, non-linear-systems, linear-systems
Title: How to determine the linearity of a numerically simulated mass-spring system? I did some numerical simulation of a mass-spring system, which is a 2D 1-degree-of-freedom spring-mounted cylinder vibrating due to moving fluid surrounding it.
The cylinder's motion may be described as:
\begin{equation}
\frac{\partial^2 {Y_2}}{\partial t^2}+4\pi^2Y_2=C
\end{equation}
where $C$ represents the hydraulic force coefficient upon the cylinder.
By computational fluid dynamics, the time histories of $Y_2$ and C are obtained. For example, the figure below.
Now, I have a question: by the time histories (discrete numerical output) of $Y_2$ and $C$, can we more or less figure out this system is linear or non-linear?
Relevant question: | {
"domain": "physics.stackexchange",
"id": 38066,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "spring, differential-equations, vibrations, non-linear-systems, linear-systems",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.