text stringlengths 1 1.11k | source dict |
|---|---|
java, json
Lastly, in the near future there will be a script initiated by a cron job that will call this program with changing parameters at set intervals of time. I need a way for this program to exit on failure in such a way that a top level script can catch it and stop running. The only way I know how to do this now is with Sys.exit(#), but is this the best way?
Please feel free to be pendantic/critical. I would like to be able to submit this as an example of side projects I've done to future employers with confidence :D
Main Class
public class WeatherTracker { | {
"domain": "codereview.stackexchange",
"id": 13449,
"lm_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, json",
"url": null
} |
-
This explains it very well! Thank you so much. – SNS Feb 27 '12 at 23:42
$2772=99 \times 28$
so
$277227722772\ldots277227722772 = 99 \times 28 \times 100010001\ldots000100010001$
and so is divisible by both $9$ and $11$ (and $4$ and $7$ and other numbers). | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9857180631379971,
"lm_q1q2_score": 0.8492337821284358,
"lm_q2_score": 0.8615382165412809,
"openwebmath_perplexity": 178.18845245428682,
"openwebmath_score": 0.8312530517578125,
"tags": null,
"url": "http://math.stackexchange.com/questions/114181/whole-numbers-and-division"
} |
condensed-matter, resource-recommendations, education, many-body
Perturbation Theory
Plasma theory of interacting electron gas
Bose-Einstein condensation and superfluidity
Superconductivity & BCS Theory
Currently, I am using the book Condensed Matter Field Theory, which does have some (i.e. 4 to 8) end-of-chapter problems and solutions, but the number of exercises is not large. I found a problem book on Quantum Field Theory by Voja Radovanovi ́c which contains some important topic such as Green's functions and re-normalization but is missing the other topics.
Can anyone suggest a good problem and solutions book? By "good" I mean that the book contains at least Quantum fields to Green's Function in the above list. Here is a problems and solutions (solutions in the back of the book) for topics 2,3,6, and 7
Theoretical Physics 9:
Fundamentals of Many-body Physics
Second Edition
Author: Wolfgang Nolting
Here is the book's structure:
Chapter 1 is on Second Quantisation
Chapter 2 is many body systems models
Chapter 3 is on Green's functions | {
"domain": "physics.stackexchange",
"id": 81517,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "condensed-matter, resource-recommendations, education, many-body",
"url": null
} |
c++, algorithm, random, c++17, binary-tree
max = std::max( max, freq );
min = std::min( max, freq );
}
const auto epsilon = 0.001; // error tolerance
EXPECT_LT( max - min, epsilon );
}
TEST_F( random_node_tests, unbalanced_tree )
{
// actually test the probability function.
// fix the tree to be an unbalanced tree with 11 nodes
const auto values = std::initializer_list<int>
{ 4, 3, 6, 2, 1, 0, 5, 7, 9, 10, 11 };
// seed the generator
const auto rand =
random_node<int>( values, 6358 );
// storage for 10k draws
auto results = std::map<int, int>();
const std::size_t iters = 1e6;
for( auto index = std::size_t(); index < iters; ++index )
{
results[ rand.pick_random() ]++;
}
double max = 0.0f, min = 0.0f;
for( const auto& [key, value] : results )
{
auto freq = static_cast< double >( value ) / iters; | {
"domain": "codereview.stackexchange",
"id": 38339,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, algorithm, random, c++17, binary-tree",
"url": null
} |
to both of..: //www.tutorialspoint.com/videotutorials/index.htmLecture by: Er D_t = 0$ here > >, Uni students may not return February... Perpendicular distance for parallel lines, taking partials, we want $D_s = -2d ( ). Calculates the shortest distance between two lines in space 22 Registered Office: International House, Queens,. A little bit the length of a line ; shortest distance between parallel lines )! )$ //www.tutorialspoint.com/videotutorials/index.htmLecture by: Er a formula using this approach and use this directly! Have the distance between parallel LinesWatch more videos at https: //www.tutorialspoint.com/videotutorials/index.htmLecture by Er. ; Planes > >, Uni students may not return until February ( e+bt-ds ) $and$ =. D_S = -2d ( e+bt-ds ) $and$ D_t = 2b ( e+bt-ds ) $in space as and. The line you 're given2 taking partials, we shall move on to explore the...$ and $D_t = 2b ( e+bt-ds )$ fp3 - shortest distance perpendicular! Lines in space as line1 and line2 is | {
"domain": "phileasguides.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9724147169737825,
"lm_q1q2_score": 0.8284514428010357,
"lm_q2_score": 0.8519528019683106,
"openwebmath_perplexity": 751.5349426013706,
"openwebmath_score": 0.43332409858703613,
"tags": null,
"url": "http://www.phileasguides.com/disney-over-ujgfyh/shortest-distance-between-two-lines-vectors-dd442a"
} |
homework-and-exercises, electricity, potential
The resistance of thermistor (and 750 Ω combination) decreases
Therefore potential difference across thermistor and 750 Ω combination decreases
Therefore potential at A increases
However, Electric potential is the amount of energy needed to bring a charge/particle from earth to that point.
In that case, it is similar to Work done in required to bring a charge from one point to another.
$$
W = VQ\: \therefore W \propto V
$$
So as the potential difference across thermistor and $750\Omega$ decreases, the Work required to bring a particle to A should be lesser, which implies the Electric potential at that point to be actually reduced since less energy is required to bring any point from infinity to A
Can anyone explain this apparent contradiction?
However, Electric potential is the amount of energy needed to bring a
charge/particle from earth to that point. | {
"domain": "physics.stackexchange",
"id": 88136,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, electricity, potential",
"url": null
} |
electrical-engineering, motors
And some motors don't appear to have any of these at all. So what gives? What function do these serve, and why does that function appear to be optional, or at least handled in different ways for different motors? Those contain the start capacitors that are needed in single-phase electric motors to get the armature spinning when the motor is first turned on. The start capacitor is connected to the AC mains and a small set of windings that accompany the main running windings in the motor. The capacitor delays the phase of the current in the start winding so that when the field winding comes on and turns the armature a little bit, the start winding then adds a slightly delayed extra kick in the same direction- an action which gets the armature turning instead of just vibrating back and forth, which is what it would do in the absence of the start winding and start capacitor. | {
"domain": "engineering.stackexchange",
"id": 5240,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrical-engineering, motors",
"url": null
} |
species-identification, zoology, entomology, arthropod
Title: What insect is this? I found it in Russia.
Where do they usually live? What do they eat?
Full length is approximately 2 cm. Seems to be it's a Woodlouse!
http://en.wikipedia.org/wiki/Woodlouse | {
"domain": "biology.stackexchange",
"id": 7365,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "species-identification, zoology, entomology, arthropod",
"url": null
} |
ParaDRAM - NOTE: Generating the output report file:
ParaDRAM - NOTE: Please see the output report and progress files for further realtime simulation details.
Accepted/Total Func. Call Dynamic/Overall Acc. Rate Elapsed/Remained Time [s]
========================= ========================= =========================
30000 / 130260 0.200 / 0.2298 1.3140 / 0.000
ParaDRAM - NOTE: The time cost of calling the user-provided objective function must be at least 52.5143 times more
ParaDRAM - NOTE: (that is, ~24.6651 microseconds) to see any performance benefits from singlechain parallelization
ParaDRAM - NOTE: model for this simulation. Consider simulating in the serial mode in the future (if used within the
ParaDRAM - NOTE: same computing environment and with the same configuration as used here).
ParaDRAM - NOTE: Computing the Markov chain's statistical properties...
ParaDRAM - NOTE: Computing the final decorrelated sample size... | {
"domain": "cdslab.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9926541736428375,
"lm_q1q2_score": 0.8376959878731101,
"lm_q2_score": 0.8438950947024555,
"openwebmath_perplexity": 6924.640919095357,
"openwebmath_score": 0.46039295196533203,
"tags": null,
"url": "https://www.cdslab.org/paramonte/notes/examples/c/mvn/"
} |
homework-and-exercises, newtonian-mechanics, conservation-laws, projectile
Title: A question of projectile
A stone is projected from a horizontal plane. It attains height $H$ & strikes a stationary smooth wall & falls on the ground vertically below the maximum height. Assume the collision to be elastic, find the height of the point on the wall where ball will strike. | {
"domain": "physics.stackexchange",
"id": 34953,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-mechanics, conservation-laws, projectile",
"url": null
} |
algorithms, shortest-path, traveling-salesman
██████ █████
██G███ █░GG█
MAZE1 => █O░GR█ MAZE2 => █O███
██G███ █░░R█
██████ █████
Here in this case ans will be
MAZE1 => M[2][1] => [2][2] => [1][2] => [2][2] => [3][2] => [2][2] => [2][3] => [2][4] = 7
MAZE2 => M[1][1] => [1][2] => [2][2] => [3][2] => [3][3] => [3][2] => [2][2] = 6
As you can see, the nodes appear multiple times
First i thought of using recursion technique (backtracking) but couldn't come to an algorithm. and
So i thought of using this way. | {
"domain": "cs.stackexchange",
"id": 3224,
"lm_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, shortest-path, traveling-salesman",
"url": null
} |
• How about a house? (Square plus triangle) Gerhard "Welcome To The Suburban Future" Paseman, 2016.12.03. – Gerhard Paseman Dec 4 '16 at 2:30
• Any pentagon with two parallel sides tiles the plane. (See for instance the first picture in 3.bp.blogspot.com/-2YKhXVT62rc/Vd2KGHpYwnI/AAAAAAAAGWU/…) – Noam D. Elkies Dec 4 '16 at 2:36
• However, you can use these good tilers to estimate the ratio. Pick a good tiler nearest the shape of the bad tiler and embed a scaled down copy into the bad tiler. The best scale factor among many choices should allow a good estimate of the waste factor. Gerhard "It Is Like Urban Renewal" Paseman, 2016.12.03. – Gerhard Paseman Dec 4 '16 at 2:52 | {
"domain": "mathoverflow.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9678992914310605,
"lm_q1q2_score": 0.8283777187200707,
"lm_q2_score": 0.8558511469672594,
"openwebmath_perplexity": 916.1982884399735,
"openwebmath_score": 0.7146950364112854,
"tags": null,
"url": "https://mathoverflow.net/questions/256351/terrible-tilers-for-covering-the-plane"
} |
c++, game, c++17, qt
That now eliminates the need for createRooms. Then we could change the helper function connectRoomsAsDodekaeder() to a private member function of Dungeon and use a lambda instead of a separate additional helper function.
void Dungeon::connectRoomsAsDodekaeder()
{
auto makeNeighbours = [this](std::size_t src, std::array<std::size_t, 3>n){
for (const auto i: n) {
this->mRooms[src].addNeighbour(&(this->mRooms[i]));
}
}; | {
"domain": "codereview.stackexchange",
"id": 36733,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, game, c++17, qt",
"url": null
} |
ros, ros-kinetic, 2dlidar
Title: What does 'nan' mean in lidar's scan data?
Hello, I'm working with the ROS kinetic of Ubuntu 16.04.
I'm also using Hokuyo's lidar sensor and recently realized that there are some strange data in the returned data of /scan topic.
The nan data, which stands for 'not a number', is that; if so, what is the 'nan'?
Although I've worked with a lidar sensor for over 2 years, I have no idea about when the nan data is created.
What's the nan in this? It doesn't matter when it comes to the g-mapping or other packages, but I need to do another work whit this data and nan makes no sense.
If someone familiar with lidar's range data is here, would you please give me some help?
The below is the /scan data including nan.
header:
seq: 6147
stamp:
secs: 1627028918
nsecs: 664962817
frame_id: "base_footprint"
angle_min: -2.07394194603
angle_max: 2.07394218445
angle_increment: 0.00613592332229
time_increment: 2.71259814326e-05
scan_time: 0.0277769993991
range_min: 0.019999999553 | {
"domain": "robotics.stackexchange",
"id": 36743,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-kinetic, 2dlidar",
"url": null
} |
newtonian-mechanics, rotational-dynamics, reference-frames
Even though I set out to prove that the motion of $m_1$ will be circular, I didn't quite reach there. Does the moment equation prove that $m_1$ will have circular motion ?
Is what I have done correct ? | {
"domain": "physics.stackexchange",
"id": 84253,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, rotational-dynamics, reference-frames",
"url": null
} |
inorganic-chemistry, experimental-chemistry, combustion
Title: Combustion of NaCl(aq) when testing conductivity In a experiment that dealt with electric conduction of many concentrated solutions, NaCl(s) created an unknown, to me, substance after adding a drop or two of water. Furthermore, it isn't the reaction of water and NaCl(s) that I don't understand, but the reaction between the anode and cathode when they came in contact with NaCl(aq), sparks were present and it seemed to have "burned" NaCl(s). The question is: what is the correct name for the part that "burnt"? There is not "burning", one might see a spark. It is a well known phenomenon. Do you see lightening in the sky? Air is an insulator, yet when very high voltage is present it becomes a conductor. It is called dielectric barrier discharge. In the same way, discharge between two electrodes can occur in pure water (almost an insulator). Adding NaCl to water makes it a good conductor but still it is mostly water, and if the electrodes are close enough, electrical breakdown can | {
"domain": "chemistry.stackexchange",
"id": 14808,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "inorganic-chemistry, experimental-chemistry, combustion",
"url": null
} |
c++, memory-management, c++20
Bad use of a polymorphic memory resource
I do not see the point of making FileArenaResource a polymorphic memory resource, nor using PMR for all_chunks_: there is nothing polymorphic about all_chunks_, it's just a single array of bytes, nothing more. You can only allocate something once from FileArenaResource.
all_chunks_ is a one-off thing, so I wouldn't try to force it to deallocate itself using RAII. But if you do want that, consider using a std::unique_ptr<unsigned char[], Deleter>, where Deleter is taking care of deallocating the mapped file. | {
"domain": "codereview.stackexchange",
"id": 43549,
"lm_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++, memory-management, c++20",
"url": null
} |
truncated cone from vertex (see Fig. height of the cone 30 2722 13. I can use the countour function. OPEN ENDED Draw the cross sections of a polyhedron, cylinder, or cone. Let S be a solid that lies between the horizontal planes z = a and z = b. 5 mm 2, 4 mm 2, 6 mm 2, 10 mm 2, 16 mm 2. R R R ππ π =− = 72. If the height of hemisphere and cone is 49cm and height of cone is 35cm find the volume of solid. The doctors tell you, “The cross-sectional area of the aneurysm is 2. The graph of the function and a representative washer are shown in (a) and (b). The limit case of a full conical vessel with its vertex at the bottom is solved herein. The cross-section is going to look like a washer, with an inner radius equal to the height of y = x^2 wherever we are in the solid, and the outer radius equal to y = 2x at that same x. What is the volume of a cone with base radius r and height h ? De nition. The Cheeger constant is defined as the infimum of the boundary area to volume ratio of regions in | {
"domain": "realtaveneta.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9907319863454372,
"lm_q1q2_score": 0.8319512998068282,
"lm_q2_score": 0.8397339656668286,
"openwebmath_perplexity": 458.5886632202463,
"openwebmath_score": 0.7276838421821594,
"tags": null,
"url": "http://qzex.realtaveneta.it/cross-sectional-area-of-a-cone-as-a-function-of-height.html"
} |
climate, rainfall, humidity
Salt trapping moisture on land, with moisture eventually evaporating from the salt leading to humid air above the land which results in rain - This is not peculiar to salt; soil does the same thing. Forests transpire leading to localized rainfall - recirculating the water within a region.
Salt deposits on land do not draw in rain clouds. Neither do they force or entice the clouds to dump rain on any such deposits.
You were closer to the truth in the title to your question. The reason why the UK receives as much rain as it does is because it is a small island in a very active ocean. The furthest point from the coast is "Church Flatts Farm in Derbyshire, which is which is 70 miles (113 km) from the nearest coast, the mean low water line at Fosdyke Wash, on the edge of The Wash, south of Boston, in Lincolnshire".
Because of this, the air in the UK is humid and it just takes a cold front to cause the atmospheric moisture to precipitate. | {
"domain": "earthscience.stackexchange",
"id": 2553,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "climate, rainfall, humidity",
"url": null
} |
html, css, form, layout
To sum it up, you're approach is fine, and it's even better than the other one, where "Info Needed" and "Enter It Here" aren't associated with the columns in any way. | {
"domain": "codereview.stackexchange",
"id": 24481,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "html, css, form, layout",
"url": null
} |
computer-networks
However it is cheaper these days to have a IP network that is ten times faster than you need, compared to a ATM network at the speed you need…… IP got the mass market and the computer network vendors sold their kit for a lot less then the telecom equipment vendors.
This was partly due to the telecom service providers demanding lots of “bells and whistles”, then deciding once the telecom equipment vendors had designed what was asked for, that “of the shelf” Ethernet switches where good enough. So the customer was wrong, resulting in most large telecom equipment vendors closing down.
Therefore an ATM connection is superior to a IP connect when you need a continues fixed bandwidth and someone will sell you a ATM connect for a not much greater price then a IP connection! | {
"domain": "cs.stackexchange",
"id": 6651,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "computer-networks",
"url": null
} |
python, performance, machine-learning
# With this initial population, run 100 generations
improvements = 100
for i in range(self.generations):
t_g0 = time.time()
if improvements == 0:
print("No improvements after 100 generations")
break
# Next generation will be those selected by the selection method + the 10 best by expected return from the current generation
t_s0 = time.time()
next_gen_selected = self.next_generation(current_generation)
current_generation.sort(key=lambda x: x.expected_return, reverse=True)
next_gen_selected = next_gen_selected + current_generation[:10]
t_s1 = time.time()
print(f"Next generation selection: {str(int(t_s1 - t_s0))} seconds") | {
"domain": "codereview.stackexchange",
"id": 36640,
"lm_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, machine-learning",
"url": null
} |
ros
Title: Connect ROS with RobotStudio via abb_robot_driver
Hello,
I installed the abb_robot_driver node from here in my workspace, it worked without any errors while building.
I am running:
Ubuntu 20.04, kernel: 5.14.0-1054-oem
ROS Noetic
I have now installed Robot studio on a seperate Windows PC, Robot Ware 7 is also installed. I open the robot I want (ABB IRB4600-40/255) and create a controller. It is indicated that the controller is running.
When I now try to use the first example of the abb_robot_driver here which is:
roslaunch abb_robot_bringup_examples ex1_rws_only.launch robot_ip:=<WindowsPC IP>
I get the warning
[ WARN] [1667469851.804625427]: Failed to establish RWS connection to the robot controller (attempt 1/5), reason: 'Failed to collect general system info'
Until I receive:
[FATAL] [1667469856.931221918]: Runtime error: 'Failed to establish RWS connection to the robot controller' | {
"domain": "robotics.stackexchange",
"id": 38098,
"lm_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
} |
• @Paresh: Also, i dont think this is the third answer of the same type of question. When I wrote it, there were no answers. – AJed Dec 16 '12 at 14:55
• Probably I did not phrase it very well. I meant that the proof is incomplete. And by probably wrong, I meant the approach. I was not sure if the correct proof takes this approach or some other approach. For the reason why this proof is incomplete, take for example, the Prim's algorithm (instead of the Kruskal's). We start from a random vertex, and grow the MST from there. Then, the minimum weight edges might be encountered later, and one of them might form a cycle. In other words, what prevents one of the min weight edges being left out for a different MST with the same total weight? – Paresh Dec 16 '12 at 15:15 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9688561712637256,
"lm_q1q2_score": 0.8031224841365371,
"lm_q2_score": 0.8289388125473628,
"openwebmath_perplexity": 315.86448519231914,
"openwebmath_score": 0.7391459941864014,
"tags": null,
"url": "https://cs.stackexchange.com/questions/7414/minimum-spanning-tree-with-two-minimum-edge-weights"
} |
differential-geometry, tensor-calculus, vectors, covariance
The one-form (or covector) field $\mathrm df$, which eats a vector field $X$ and spits out $\mathrm df(X) := X(f)$
The vector field $\nabla f$, which is dual to $\mathrm df$ under the duality provided by the metric tensor $g$. Explicitly, in component form we have that $(\nabla f)^\mu = g^{\mu\nu} (\mathrm df)_\nu$.
In any coordinates $\{\xi^\mu\}$, the components of $\mathrm df$ are given by $(\mathrm df)_\mu^{(\xi)} = \partial f/\partial \xi^\mu$. If we change coordinates from $\{\xi^\mu\}$ to $\{x^\mu\}$, then the components of the gradient change accordingly:
$$\left(\mathrm df\right)_\mu^{(x)} = \frac{\partial f}{\partial x^\mu} = \frac{\partial \xi^\nu}{\partial x^\mu} \frac{\partial f}{\partial \xi^\nu} = \frac{\partial \xi^\nu}{\partial x^\mu}(\mathrm df)_\nu^{(\xi)}$$
If, as in your example, $x=a\xi$, then $\frac{\partial \xi^\nu}{\partial x^\mu} = \frac{1}{a}\delta^\nu_\mu$ and so $(\mathrm df)_\mu^{(x)} = \frac{1}{a}(\mathrm df)_\mu^{(\xi)}$. | {
"domain": "physics.stackexchange",
"id": 80039,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "differential-geometry, tensor-calculus, vectors, covariance",
"url": null
} |
c++, c++11, tic-tac-toe
using Move = std::uint16_t;
using MoveSet = std::bitset<9u>;
MoveSet GetPossibleMoves(const Grid& grid) noexcept
{
return ~(grid.x ^ grid.o);
}
void MakeMove(const Move move, Grid& grid)
{
if(GetPossibleMoves(grid).test(move)) { // Throws std::out_of_range if move does not correspond to a valid position within the bitset
if(grid.turn[0u]) {
grid.x[move] = true;
}
else {
grid.o[move] = true;
}
grid.turn.flip();
}
else {
throw std::invalid_argument("Invalid move.");
}
}
std::int16_t AlphaBeta(const Grid& grid, std::int16_t alpha, std::int16_t beta, std::uint16_t depth) noexcept
{
switch(CheckGrid(grid)) {
case GridState::VictoryX :
{
return depth - 10u;
}
case GridState::VictoryO :
{
return 10u - depth;
}
case GridState::Draw :
{
return 0u;
} | {
"domain": "codereview.stackexchange",
"id": 25738,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++11, tic-tac-toe",
"url": null
} |
performance, android, kotlin
fun setQuestion(ques: String?) {
this.question = ques
}
fun getAns(): String? {
return ans
}
fun setAns(answer: String?) {
this.ans = answer
}
}
I need both setter and getter methods and i need to set values for different fields at different times(not at time time of creation of object for this class).
Is the above way idle or is there any 1 or few lines code for this in kotlin? Use Data Class which automatically generates field accessors, hashCode(), equals(), toString() and other methods. Read this for a quick introduction.
data class ABCDRequest (
@JsonProperty("name")
private var name: String? = null,
@JsonProperty("question")
private var question: String? = null,
@JsonProperty("ans")
private var ans: String? = null
)
For the official documentation on Data Class, head over to this link. | {
"domain": "codereview.stackexchange",
"id": 35063,
"lm_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, android, kotlin",
"url": null
} |
optics, interference, education, diffraction
Title: How to demonstrate interference or diffraction in class? High School physics teacher here. I was wondering about a simple experiment that I can perform in class to demonstrate interference or diffraction. Can you suggest anything?
I am not looking to actually make predictions, do measurement, verify result and perform rigorous experiment. Just a simple experiment through which I can say that - "THIS IS INTERFERENCE. Now we will study the details behind it." If you point a laser pointer at a sufficiently high resolution digital screen (anything made in the last decade should work), the reflected spot should be split into several dots; the spacing and arrangement of the dots carries information about the size and shape of the pixels on the screen. (This is a simplified variation of a technique researchers use to measure the molecular structure of crystals.) Lower-tech variations include: | {
"domain": "physics.stackexchange",
"id": 87345,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics, interference, education, diffraction",
"url": null
} |
quantum-mechanics, hilbert-space, operators, hamiltonian, mathematics
Title: Conditions for the Hamiltonian's spectrum to be discrete I came across this article [1], in which the author studies some Hamiltonian that have a discrete spectrum even though they do not go to infinity at infinity.
In there, the author makes several claims, that I don't really get :
If $H_1 \geqslant H_2$ and $H_2$ has a discrete spectrum, then so does $H_1$.
If $\operatorname{Tr}e^{-tH}< \infty$ for any $t$, then $H$ has a discrete spectrum. | {
"domain": "physics.stackexchange",
"id": 89722,
"lm_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, hilbert-space, operators, hamiltonian, mathematics",
"url": null
} |
general-relativity, forces, gravity, newtonian-gravity, approximations
But when we see in the sense of general theory of relativity we see that gravity is a curvature of space-time so when they move in opposite direction to each other and will never meet!
I have seen many people say at small instances GR can be approximated to Newtonian gravity but From this simple example it isn't the case , when can we approximate GR to Newtonian gravity? Suppose we have an object in a gravitational field and the potential energy of the object is $\Phi$. Then the magnitude of the deviations from Newtonian physics due to general relativity are of order $\Phi/c^2$. So Newtonian physics will be a good approximation when:
$$ \frac{\Phi}{c^2} \ll 1 \tag{1} $$ | {
"domain": "physics.stackexchange",
"id": 94265,
"lm_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, forces, gravity, newtonian-gravity, approximations",
"url": null
} |
c++, multithreading
Convert the wait() method in to a function pointer. This would save my program from a jmp at the top of every other method, and simply check for thread != NULL at the top of every method. Still not ideal, but I feel like the fewer jumps, the better. (I've also considered just using the inline keyword on the function... but would this include the entire contents of the wait function when all I really need is the if (thread != NULL) check to determine whether the rest of the code should be executed or not?) | {
"domain": "codereview.stackexchange",
"id": 5724,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, multithreading",
"url": null
} |
opencv, cv-bridge
Original comments
Comment by ahendrix on 2014-05-30:
Are any images published on the /image_converter/output_video topic? You should be able to verify that images are being published with rostopic hz or rostopic echo
Comment by lanyusea on 2014-05-30:
@ahendrix nothing... I ran rostopic echo /image_converter/output_video but got nothing. I think the subscribe of video topic failed.
Comment by lanyusea on 2014-05-30:
I guess maybe the image_transport matters because when I subscribe I just use the code image_sub_ = it_.subscribe("/camera/image", 1, &ImageConverter::imageCb, this); while for image_view, I need to set _image_transport=compressed to see the video. But I don't know what to change here...
Comment by lanyusea on 2014-05-31: | {
"domain": "robotics.stackexchange",
"id": 18099,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "opencv, cv-bridge",
"url": null
} |
Ronald L. Rivest, https://www.youtube.com/watch?v=LOLebQ8nKHA, https://www.youtube.com/watch?v=QXY4RskLQcI, Karatsuba algorithm for fast multiplication using Divide and Conquer algorithm, Merge K sorted arrays | Set 3 ( Using Divide and Conquer Approach ), Maximum Sum SubArray using Divide and Conquer | Set 2, Search in a Row-wise and Column-wise Sorted 2D Array using Divide and Conquer algorithm, Divide and Conquer Algorithm | Introduction, Closest Pair of Points using Divide and Conquer algorithm, Maximum Subarray Sum using Divide and Conquer algorithm, Tiling Problem using Divide and Conquer algorithm, The Skyline Problem using Divide and Conquer algorithm, Longest Common Prefix using Divide and Conquer Algorithm, Convex Hull using Divide and Conquer Algorithm, Advanced master theorem for divide and conquer recurrences, Dynamic Programming vs Divide-and-Conquer, Generate a random permutation of elements from range [L, R] (Divide and Conquer), Merge K sorted arrays of different sizes | {
"domain": "heaveyduty.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9626731105140615,
"lm_q1q2_score": 0.808389308732794,
"lm_q2_score": 0.8397339656668287,
"openwebmath_perplexity": 781.7602093644065,
"openwebmath_score": 0.6605963706970215,
"tags": null,
"url": "https://heaveyduty.com/docs/7p3l3.php?a930b0=strassen%27s-matrix-multiplication-4x4-example-code"
} |
These are properties of Fourier series: If x(t)fourierseries ← coefficient → fxn & y(t)fourierseries ← coefficient → fyn. To find the Fourier Series for this square wave, we need to find its Fourier coefficients, so we plug in into the expression for , and integrate. Square Waves and Triangle Waves These are the typical examples of Fourier series, and they do illustrate how the Fourier series converges to x(t) (you don’t really believe it until you see it). Find the Fourier series for the sawtooth wave defined on the interval $$\left[ { - \pi ,\pi } \right]$$ and having period $$2\pi. The convention is that a sawtooth wave ramps upward and then sharply drops. Exercise 4. Examples of Fourier series 7 Example 1. Press question mark to learn the rest of the keyboard shortcuts. The function is defined over the interval -L x L. Representing Periodic Functions by Fourier Series 23. How do I find the Fourier series of a Sawtooth Learn more about fourier, fourier series, coefficients, | {
"domain": "cenews24.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9877587218253717,
"lm_q1q2_score": 0.8165917829206087,
"lm_q2_score": 0.826711791935942,
"openwebmath_perplexity": 740.4227252301312,
"openwebmath_score": 0.8933987021446228,
"tags": null,
"url": "http://vwhi.cenews24.it/fourier-series-of-sawtooth-wave-pdf.html"
} |
c++, makefile, portability
MACRO( TO_RELATIVE_PATHS filePaths )
SET( resPaths "" )
FOREACH( curPath ${${filePaths}} )
FILE( RELATIVE_PATH relPath ${CMAKE_CURRENT_SOURCE_DIR} ${curPath} )
SET( resPaths ${resPaths} ${relPath} )
ENDFOREACH( curPath )
SET( ${filePaths} ${resPaths} )
ENDMACRO( TO_RELATIVE_PATHS filePaths )
MACRO( COPY_TO_BUNDLE resourcePath bundlePath )
LIST( APPEND BUNDLE_COPY_RESOURCES ${resourcePath} )
SET_SOURCE_FILES_PROPERTIES( ${resourcePath} PROPERTIES MACOSX_PACKAGE_LOCATION ${bundlePath} )
ENDMACRO( COPY_TO_BUNDLE )
MACRO( ADD_FRAMEWORK fwname fwpath appname )
TARGET_LINK_LIBRARIES( ${appname} ${fwpath}/${fwname} )
MESSAGE( STATUS "Framework ${fwname} found at ${fwpath}" )
ENDMACRO() | {
"domain": "codereview.stackexchange",
"id": 11210,
"lm_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++, makefile, portability",
"url": null
} |
neural-network, cross-validation, training, mnist
Title: What do I initialise each model in cross validation with in a multi-layer Perceptron? So, as far as my understanding goes, cross-validation is used to determine the best model.
I understand that once we determine the best model, we then train it on the entire dataset. I'm supposed to be using cross-validation for the multi-layer perceptron that can classify the MNIST dataset. I don't seem to get how cross-validation fits in training the model.
Let's say I'm using 5-fold cross-validation, which means I will have to make 5 different models but, how will the training of these individual model proceed? In particular, I have the following questions: | {
"domain": "datascience.stackexchange",
"id": 3860,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neural-network, cross-validation, training, mnist",
"url": null
} |
coordinate-systems, vectors, differentiation
But $\vec i$ and $\vec j$ are constant vectors (they have constant magnitude and constant direction), so $\frac {d \vec i} {dt} = \frac {d \vec j} {dt} = 0$ and we have
$\displaystyle \frac {d \vec A} {dt} = \left(\frac {df(t)}{dt}\right) \vec i + + \left(\frac {dg(t)}{dt}\right) \vec j$
If we express $\vec A$ as $\vec A = |A|\vec k$ where $k$ is a unit vector in the direction of $\vec A$ then we have
$\displaystyle \frac {d\vec A}{dt} = \left(\frac{d|A|} {dt} \right) \vec k + |A|\left( \frac {d\vec k}{dt}\right)$
but in general the direction of $\vec k$ changes with time, so $\frac {d \vec k}{dt} \ne 0$ and
$\displaystyle \frac {d\vec A}{dt} \ne \left(\frac{d|A|} {dt} \right) \vec k$ | {
"domain": "physics.stackexchange",
"id": 80696,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "coordinate-systems, vectors, differentiation",
"url": null
} |
java, thread-safety, tree, swing, event-handling
Title: Correctly implementing the Swing TreeModel Ideally the Code Review would target the correctness of the approach implementing the Swing TreeModel.
In particular, is the structural separation[1], event message passing, threading[2], object synchronisation, etc. all best practice ?
[1] My understanding is that the TreeModel should have separation between the underlying Tree Model and the object reports changes to the Swing JTree.
[2] My understanding is that there should be separate threads for UI and Model changes. | {
"domain": "codereview.stackexchange",
"id": 6768,
"lm_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, thread-safety, tree, swing, event-handling",
"url": null
} |
ros, moveit, rosservice, controller-manager
Because this looks interesting: or trajectory_msgs/JointTrajectory (for Universal Robots and other non-ros_control robots
Comment by gvdhoorn on 2022-02-16:
It's a really old comment (as "Universal Robots" don't need that at all any more), but sure. Try and see whether it works sufficiently.
(I doubt it, but perhaps for your use-case it's enough) | {
"domain": "robotics.stackexchange",
"id": 37439,
"lm_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, moveit, rosservice, controller-manager",
"url": null
} |
assembly, x86
This means that you'll have to scale up the other calculations too in order to add them to EBP:EBX using:
add ebx, ...
adc ebp, ...
Because addition is associative, you can start by calculating the e * e part. You did not rearrange the expression and had to move around some more the registers in the end. Not a big deal, but nicer my way:
mov eax, [e]
imul eax
add ebx, eax
adc ebp, edx
Then comes 100 * (a + b):
movsx eax, word [a]
movsx edx, byte [b]
add eax, edx ; eax = a + b
mov edx, 100
imul edx ; edx:eax = 100 * (a + b)
add ebx, eax
adc ebp, edx
I'll leave 3 / (c + d) to you...
... and finally the end will be:
sub ebx, eax
sbb ebp, edx
mov [result + 0], ebx
mov [result + 4], ebp
did I make it unnecessarily complicated?
It was a bit hard to read your program because you didn't insert some blank lines between the different operations. | {
"domain": "codereview.stackexchange",
"id": 39665,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "assembly, x86",
"url": null
} |
ros, transform, ros-kinetic, tf2
Originally posted by gvdhoorn with karma: 86574 on 2018-04-05
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by patnolan33 on 2018-04-05:
Alright great, that worked. Don't know how I missed that timeout argument to lookupTransform. I'd like to wrap it in a class as per your first comment, but the buffer was the issue. Thank you for your help! (Do I have to post an answer, or can I somehow mark your comment as the answer?)
Comment by gvdhoorn on 2018-04-05:
Check also canTransform(..) in the same class. | {
"domain": "robotics.stackexchange",
"id": 30542,
"lm_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, transform, ros-kinetic, tf2",
"url": null
} |
Note that in this notation, $$A$$ is fundamentally describing a particular area on the surface while $$|A|$$ describes the numeric size of that area. $$A$$ might be "the surface of a basketball court" while $$|A|$$ is "4700 square feet," which is 94 feet times 50 feet. Keeping track of the difference will be helpful going forward because we'll be introducing more related notation.
You also will want another requirement. Since you want the probability to be 0 outside of the circle, we know that if we pick our area to be the whole circle, the probability that the sampled point falls into this area is 1. Formally, given an area $$C$$ which is the entire circle, $$P(C) = 1$$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9861513881564148,
"lm_q1q2_score": 0.8458892020739035,
"lm_q2_score": 0.8577680995361899,
"openwebmath_perplexity": 216.1896405335572,
"openwebmath_score": 0.8782725930213928,
"tags": null,
"url": "https://math.stackexchange.com/questions/3184319/how-do-i-evaluate-prove-to-myself-that-a-method-for-picking-uniformly-distribu"
} |
matlab, discrete-signals, fourier-transform
The t array is incorrectly specified. It should be 0:1/8:7/8 as the time positions at which the signal is assumed to be sampled for the default FFT calculation performed by fft() are 0, 1, ..., (N-1) where N = 8 in your case, the signal length. Since in your formula you are using t as the ratio n/N (where n is the array of sample times) you get the aforementioned expression to use for t.
You wrote a(1) instead of a(5) at the last term of your recs expression.
You are missing 2* multiplying each term except the first (k=0) and last (k=N/2) ones, where k is the index of the frequency axis of the Fourier transform F (recall that this 2* comes from leveraging the symmetry of the Fourier transform associated to a real signal). | {
"domain": "dsp.stackexchange",
"id": 7352,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "matlab, discrete-signals, fourier-transform",
"url": null
} |
Two dice are rolled. Determine whether the pair of events given below is mutually exclusive.
$G=\left\{\text{The sum of the faces is six}\right\}$
$H=\left\{\text{One die shows a four}\right\}$
For clarity, we list the elements of both sets.
$G=\left\{\left(1,5\right),\left(2,4\right),\left(3,3\right),\left(4,2\right),\left(5,1\right)\right\}$
$H=\left\{\left(2,4\right),\left(4,2\right)\right\}$
Clearly, $G\cap H=\left\{\left(2,4\right),\left(4,2\right)\right\}\ne \text{Ø}$ .
Therefore, the two sets are not mutually exclusive.
#### Questions & Answers | {
"domain": "jobilize.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9911526446557306,
"lm_q1q2_score": 0.8033083183035012,
"lm_q2_score": 0.810478913248044,
"openwebmath_perplexity": 1032.6150173226338,
"openwebmath_score": 0.6382226347923279,
"tags": null,
"url": "https://www.jobilize.com/online/course/0-12-probability-applied-finite-mathematics-by-openstax?qcr=www.quizover.com&page=1"
} |
quantum-field-theory, lagrangian-formalism, feynman-diagrams, path-integral, interactions
$$\text{vertex}_1\sim -ig\int d^dx.$$
The second vertex comes from Yukawa-type interaction,
$$\text{vertex}_2\sim -i\lambda\int d^dx,$$
where two fields $\varphi$ interacts with $\phi$. In order to obtain Feynman rule for vertex in momentum space, just perform Fourier transform for each field and require momentum-conservation. Next, in order to find bare propagators, you should consider the generating functional without $S_{\text{int}}$ term,
$$Z_0[j,J,J^*]=\int\mathcal{D}[\phi,\varphi,\varphi^*]\exp\left\lbrace iS_0[\phi,\varphi,\varphi^*]+i\int d^dx\,[j\phi+J\varphi^*+J^*\varphi]\right\rbrace.$$
The functional integration can be performed "exactly" because this integrals are Gaussian in fields. From the obtained functional you can find bare propagators of theory by simply acting functional derivatives, $\delta/\delta j$ and $\delta/\delta J$ twice. | {
"domain": "physics.stackexchange",
"id": 84735,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, lagrangian-formalism, feynman-diagrams, path-integral, interactions",
"url": null
} |
And you know what $y \:=\:\ln x$ looks like.
. . (It's the inverse of the exponential function.)
Then $y \:=\:\ln|x|$ is the same graph
. . but with a reflection over the y-axis.
Code:
|
* | *
* | *
- - - - -*- - + - -*- - - - -
* | *
* | *
|
*|*
|
Now place them on the same graph and count the intersections.
Darn . . . too slow again!
.
7. Originally Posted by Soroban
Darn . . . too slow again!
That's because you take the time to do those amazing graphs. i don't know how you do it, it seems really hard to me, i'd get too frustrated trying to line everything up
8. Originally Posted by Jhevon
That's because you take the time to do those amazing graphs. i don't know how you do it, it seems really hard to me, i'd get too frustrated trying to line everything up
Ditto
--Chris
9. Originally Posted by Moo
Hello !
One way to do it, without graph, is to study the function $f(x)=e^x-\ln|x|$. Now, be patient and read carefully
IF X<0 | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9702399043329855,
"lm_q1q2_score": 0.8147434025137423,
"lm_q2_score": 0.8397339656668287,
"openwebmath_perplexity": 920.2721859856974,
"openwebmath_score": 0.819010853767395,
"tags": null,
"url": "http://mathhelpforum.com/calculus/47048-how-many-real-numbers-x-does-e-x-ln-x.html"
} |
origin, and between the rays θ = -π/6 and θ = π/4. the gradient theorem for line integrals (also called the fundamental theorem of calculus for line integrals) Stokes' theorem; the divergence theorem (also called Gauss' theorem) Highlighted vector algebra Math Insight pages. Free Online Scientific Notation Calculator. Ünlü ve amatör yazarlardan en güzel Double integral calculator polar coordinates kitapları incelemek ve satın almak için tıklayın. Extended depth of focus extended range of vision. Get the free "Polar Integral Calculator" widget for your website, blog, Wordpress, Blogger, or iGoogle. Calculators. 3 [Pro]Requirements: 4. Below are links to selected Math Insight pages on vector algebra. Our first integral could equally well be ff(x, y)dx. This calculator displays MUCH more!. Facts, Fiction and Double Integral Calculator Double Integral Calculator Explained. For example, let's try to find the area of the closed unit circle. A simple artillery distance and azimuth calculator. | {
"domain": "sailingchallenge.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9755769127862451,
"lm_q1q2_score": 0.8043260187403628,
"lm_q2_score": 0.8244619242200082,
"openwebmath_perplexity": 881.0603728755698,
"openwebmath_score": 0.9053732752799988,
"tags": null,
"url": "http://sailingchallenge.de/polar-integral-calculator.html"
} |
c++, c++11, tree
Title: Tree implementation for unordered keys The following is an implementation of a tree in C++ designed for keys which do not have an order (otherwise a std::map could be used). T is a key type and H is a hash for T.
#include <iostream>
#include <memory>
#include <utility>
#include <unordered_map>
template<typename T, typename H>
class tree;
template<typename T, typename H>
class tree : public std::unordered_map<T, std::shared_ptr<tree<T, H>>, H> { };
template<typename T, typename H>
std::ostream& operator<<(std::ostream& s, const tree<T, H> &t);
template<typename T, typename H>
std::ostream& operator<<(std::ostream& s, const tree<T, H> &t)
{
for(auto i : t) {
s << i.first << std::endl;
s << *i.second << std::endl;
}
return s;
} At least as it stands right now, quite a bit of your code accomplishes nothing.
template<typename T, typename H>
class tree; | {
"domain": "codereview.stackexchange",
"id": 7253,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++11, tree",
"url": null
} |
ros
This tutorial will be helpful for your task.
Originally posted by bvbdort with karma: 3034 on 2017-09-08
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by ANY on 2017-09-08:
C:\fakepath\eror.png
When I used this approach, I got this error message. Any help please? I define a TransformListener object like a private attribute of the class.
Comment by gvdhoorn on 2017-09-08:
@ANY: don't use screenshots for this. Just copy-paste console text into your comment or question. In this case, please edit your original question to add the update.
Comment by bvbdort on 2017-09-09:
@ANY, Error says frame ids are empty. You should fill frame_id in header of geometry_msgs::PointStamped. Check this | {
"domain": "robotics.stackexchange",
"id": 28800,
"lm_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
} |
magnetic-fields, magnetic-monopoles
Similarly to the above, we can postulate* that an external magnetic field $\mathbf B$ will produce a force
$$
\mathbf F=k_2q_\mathrm m\mathbf B
$$
on a point magnetic monopole of magnetic charge $q_\mathrm m$, and see what happens. Given this postulate, the same algebra that worked for electric dipoles implies that if you have two magnetic monopoles of opposite magnetic charges $q_\mathrm m$ a distance $d$ apart along the unit vector $\hat{\mathbf u}$, then the torque on them exerted by an external uniform magnetic field $\mathbf B$ will be
$$
\boldsymbol{\tau} = (k_2q_\mathrm md\:\hat{\mathbf u})\times\mathbf B,
$$
which contrasts with $\boldsymbol{\tau} = \mathbf m\times\mathbf B$ for a usual current-loop magnetic dipole of magnetic dipole moment $\mathbf m$. This equivalence then forces our second constant to be
$$
k_2=1.
$$ | {
"domain": "physics.stackexchange",
"id": 34145,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "magnetic-fields, magnetic-monopoles",
"url": null
} |
ros
Thanks, didn't know that document, could have saved me some time if I had know about it before | {
"domain": "robotics.stackexchange",
"id": 25958,
"lm_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
} |
haskell
Also you might also want to separate the return value from the thread action. If you're not going to operate on thread actions, you can even omit them from the data type, as once you start an action, all you need is the MVar channel.
An updated solution could look like this:
import Control.Applicative
import Control.Concurrent
import Control.DeepSeq
import Control.Exception | {
"domain": "codereview.stackexchange",
"id": 9975,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "haskell",
"url": null
} |
ros, gazebo, pr2-simulator
Title: How to control pr2 head in gazebo
Hi all,
I'm trying to control pr2's head (i.e., moving up and down, left and right) in simulation, but couldn't get it working. To this effort, I start with playing with controlling right gripper as in the tutorial (http://www.ros.org/wiki/pr2_simulator/Tutorials/BasicPR2Controls). However, publishing a command does not seem to work (?!). It did not change anything. Actually I do not know what to expect..
Can anyone give me some directions of controlling pr2's head? Thanks a lot.
Originally posted by roboren on ROS Answers with karma: 18 on 2011-05-28
Post score: 0
if you want to control the head of the PR2 you should send goals to the pr2_head_action (http://www.ros.org/wiki/pr2_head_action). The pr2_controllers and pr2_common_actions packages many of the basic actions available for controlling the PR2
Originally posted by mmwise with karma: 8372 on 2011-06-17
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 5690,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, gazebo, pr2-simulator",
"url": null
} |
java, programming-challenge
The contract
is pretty clear.
We evaluate for side effects,
and the routine shall place t values into candidates.
It didn't.
Now, maybe the higher level application doesn't need it to.
Which suggests that the spec is wrong.
Fix the code to conform to the spec, or fix the spec.
It's unclear why {t == 1, t > 1} are distinct special cases.
It's unclear why handleFew would need to make more than
a single orderK() call, nor where its complexity is coming from.
Up at the call site I thought it would be a nice trivial helper
that makes an orderK() call and a copy.
automated test suite
This submission doesn't have one.
System.out.println( Arrays.asList( ...' | {
"domain": "codereview.stackexchange",
"id": 45279,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, programming-challenge",
"url": null
} |
organic-chemistry, acid-base, phenols, nitro-compounds
First off, let us start with alcohols. These are substances containing hydroxyl groups ($-\ce{OH}$) linked to carbon atoms which are saturated (carbon atoms with four single bonds, i.e. $\rm{sp^3}$-hybridised carbon) and whose three other bonds are only to carbon or hydrogen atoms (in other words, linked to no heteroatoms other than the hydroxyl oxygen). This class represents neither of your substances, but is simple and is related to phenols, so it will be a useful benchmark. A simple alcohol is methanol, $\ce{CH3OH}$, which can act as an acid by the equilibrium:
$$\ce{H3C-OH_{(aq)} <=> H+_{(aq)} + H3C-O^{-}_{(aq)}}\ \ \ \ \ K_\mathrm a=3\times10^{-16}$$
The small equilibrium constant establishes that methanol is a very weak acid in water, and exists almost completely as the unionised reactant. Values of $\mathrm pK_\mathrm a$ around 15 are typical for simple alcohols. | {
"domain": "chemistry.stackexchange",
"id": 3360,
"lm_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, acid-base, phenols, nitro-compounds",
"url": null
} |
c, parsing, shell
s1 = (const char **) p1;
s2 = (const char **) p2;
return strcmp(*s1, *s2);
}
/* Routine to see if a text string is matched by a wildcard pattern.
* Returns true if the text is matched, or false if it is not matched
* or if the pattern is invalid.
* * matches zero or more characters
* ? matches a single character
* [abc] matches 'a', 'b' or 'c'
* \c quotes character c
* Adapted from code written by Ingo Wilken.
*/
bool
match(const char *text, const char *pattern) {
const char *retryPat;
const char *retryText;
int ch;
bool found;
retryPat = NULL;
retryText = NULL;
while (*text || *pattern) {
ch = *pattern++;
switch (ch) {
case '*':
retryPat = pattern;
retryText = text;
break;
case '[':
found = 0; | {
"domain": "codereview.stackexchange",
"id": 19756,
"lm_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, parsing, shell",
"url": null
} |
feature-extraction, 1d
What would be the most suitable thing to do? Suggestions, pointers to articles, books, or, best, code examples are much appreciated.
EDIT:
I finally used continuous wavelet transform (as implemented in scipy) where the result local maxima (in yellow) show both location (x-axis) and width (y-axis) of the trough.
import numpy as np
from scipy import signal
# scale the ricker (mexican hat) function to 10-60px width
widths=np.arange(10,60,.2)
cwtout=signal.cwt(vscan,signal.ricker,widths)
plt.imshow(cwtout,extent=[0,len(vscan),60,10],aspect='auto',vmax=abs(cwtout).max(),vmin=abs(cwtout).min()) I have a solution for your problem other than wavelet transforms that could be worth trying. Here are the steps : | {
"domain": "dsp.stackexchange",
"id": 5324,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "feature-extraction, 1d",
"url": null
} |
complexity-theory, time-complexity, optimization, big-o-notation
Title: Are there variations of the regular runtimes of the Big-O-Notation? There are multiple $O$-Notations, like $O(n)$ or $O(n^2)$ and so on. I was wondering, if there are variations of those in reality such as $O(2n^2)$ or $O(\log n^2)$, or if those are mathematically incorrect.
Or would it be a right thing to say that it is possible to improve a $O(5n^2)$ to a $O(3n^2)$? I can't and don't need to figure out runtimes yet and I do not need to improve anything, but I'd need to know if this how you describe your functions in reality.
I was wondering, if there are variations of those in reality such as $O(2n^2)$ or $O(\log (n^2))$, or if those are mathematically incorrect. | {
"domain": "cs.stackexchange",
"id": 13897,
"lm_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, time-complexity, optimization, big-o-notation",
"url": null
} |
java, sorting, interview-questions, graph
availableCourses.put(courseName, course);
}
/**
* Determine if the course name follows the valid pattern -
* 3-4 upper case characters followed by a number from 000 - 999.
* @param courseName The course name to validate
* @return true if the course name matches the pattern, false otherwise
*/
private boolean isValidCourseName(String courseName) {
// validate the course name - i.e. "CSE111" or "MATH999"
Pattern courseNamePattern = Pattern.compile("^[A-Z]{3,4}[1-9][0-9]{2}$");
Matcher matcher = courseNamePattern.matcher(courseName);
return matcher.matches();
} | {
"domain": "codereview.stackexchange",
"id": 1620,
"lm_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, sorting, interview-questions, graph",
"url": null
} |
astrophysics
The first book that comes to my mind is: | {
"domain": "astronomy.stackexchange",
"id": 4212,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "astrophysics",
"url": null
} |
power-spectral-density, math, probability-distribution-function
Jensen's inequality $\mathbb{E}[|X|^2] \ge \mathbb{E}[|X|]^2$, for any complex variable $X$.
From the triangle inequality $\int |f(x)|dx \ge |\int f(x)dx|$
$\mathbb{E}\left\{X+Y\right\} = \mathbb{E}\left\{X \right\} + \mathbb{E}\left\{X \right\} $
$\mathbb{E}\left\{ A B \right\} = \mathbb{E}\left\{A\right\} \mathbb{E}\left\{ B \right\}$ | {
"domain": "dsp.stackexchange",
"id": 10541,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "power-spectral-density, math, probability-distribution-function",
"url": null
} |
ros, python3
Originally posted by Mike Scheutzow with karma: 4903 on 2022-09-15
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by wuxx959 on 2022-09-15:
Thanks for your answer, I tried removing all moveit packages today and reinstalling moveit, it solved all my problems. thank you very much. | {
"domain": "robotics.stackexchange",
"id": 37974,
"lm_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, python3",
"url": null
} |
• @Travis, I do not follow your objection. $(\mathbf I+\mathbf N)^{-1}$ is the formal result of plugging in the strict upper triangular matrix $\mathbf N$ in the geometric series, and an infinite sum of triangular matrices remains triangular. (You may or may not have to prove this in the course of using this proof tho.) – J. M. is a poor mathematician Jul 26 '17 at 4:56 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9848109507462228,
"lm_q1q2_score": 0.8005206383424,
"lm_q2_score": 0.8128673201042492,
"openwebmath_perplexity": 167.70238724594702,
"openwebmath_score": 0.933384895324707,
"tags": null,
"url": "https://math.stackexchange.com/questions/4841/inverse-of-an-invertible-triangular-matrix-either-upper-or-lower-is-triangular/2191497"
} |
40. Take any whole number q. Calculate $q^2-1$. Factorize $q^2-1$ to give two factors a and b (not necessarily $q+1$ and $q-1$). Put $c=a+b+2q$. Then you will find that $ab+1$, $bc+1$ and $ca+1$ are all perfect squares. Prove that this method always gives three perfect squares.
41. Semicircles are drawn on the sides of a rectangle ABCD as shown in the diagram. A circle passing through points ABCD carves out four crescent-shaped regions (coloured yellow and green in the diagram). Prove that the sum of the areas of the four crescents is equal in area to the rectangle ABCD.
42. Prove $x^n+y^n = z^n$ has no solution for $n=3$, with $x,y,z$ integers.
43. Consider a rectangle $l$ units long, and $w$ units wide and the $lw$ unit squares found in it. A diagonal is drawn from one corner to the opposite. The diagonal cuts through certain unit squares. Find in terms of $l$ and $w$ the number of unit squares that are cut through.
(sauce: kamil9876) | {
"domain": "atarnotes.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9693242036063214,
"lm_q1q2_score": 0.8219556683492131,
"lm_q2_score": 0.8479677545357568,
"openwebmath_perplexity": 1713.47969766684,
"openwebmath_score": 0.5784704685211182,
"tags": null,
"url": "https://atarnotes.com/forum/index.php?topic=13271.0"
} |
quantum-mechanics, quantum-information, bells-inequality, non-locality, epr-experiment
Accompanied with the following plot showing corellation as a function of angle:
But, the thing that troubles me is that I can't find the proof to that reasoning. A projection of a line onto an axis is the cosine of its angle, right?
To clarify, if I slightly modify the image from that article, let's say you measure particles A and B using parallel detectors:
The results are perfectly correlated (well, anti-corellated, but that's due to spins being different), as expected.
Now, if you deflect the B measurement device slightly ($\pi/8$, since that's where the "large classical error" happens), we can represent it like this:
As a complete newb, my knee-jerk reaction would be that detector B would detect a projection of $cos(\pi/8)$ length, compared to the detector B, as shown in the detail: | {
"domain": "physics.stackexchange",
"id": 50652,
"lm_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, quantum-information, bells-inequality, non-locality, epr-experiment",
"url": null
} |
javascript, jquery
if(i===options.numbers.length-1) {
ap(n);
}
}
}
}
//Print the result
doMath({'numbers': [10,5,2,2], 'method':'subtract'}); You should avoid mixing calculations with input/output. It would be better if your doMath() would not call the output function ap() directly, but instead would just return the result of its calculations:
ap(doMath({'numbers': [10,5,2,2], 'method':'subtract'}));
Of course the ap itself is a lousy name for a function, but it's more of a helper in here I guess.
I see no reason why you would use and options object instead of passing in just two parameters, but even when you use an options object, it would be simpler to extract its values into local variables and work with these. One can also easily drop the use of $.extend in favor of simple || operator, which is the canonical way of implementing default values for parameters:
var method = options.method || "add";
var numbers = options.numbers; | {
"domain": "codereview.stackexchange",
"id": 4635,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, jquery",
"url": null
} |
kinematics
I don't know how I would give the trajectory as a normal parabola from this data because I'm not sure which variables to substitute and where into $ax^2 + bx + c$. You may be overthinking it. In general when you need to solve for coefficients you first need to ask what relates the coefficients? In this case it doesn't seem you've written precisely what equation you want. In your post, you've written the parabola in terms of x. Do you mean you want y position as a function of x position? This isn't the standard way to go about it, normally the most useful method is to give x and y in terms of t.
If the parabolic equation gives the height of the ball at time t: $y(t)=a t^2+b t+c$ and a linear equation gives the position of the ball at time t: $x(t)=d t$, and if we assume gravity is directed downwards giving an acceleration of $g$ we can clearly see that $d=V_{x0}=V_{xf}=(X_f-X_0)/(t)$. (gravity does not change the horizontal velocity at all) | {
"domain": "physics.stackexchange",
"id": 10453,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "kinematics",
"url": null
} |
biochemistry, medicine, decay
Title: Formaldehyde turns plantar region of feet red? I'm a freshman med student and I've noticed that on all the feet (and hands) of deceased people that I've worked with, the bottom of the feet always turns red and also the inside of the palm? Why is this?
Thank you. It might be due to livor mortis, also called postmortem lividity, which is the settling of the blood in the lower parts of the body which in your case might have been the limbs. By time the color can be interpreted as either blue or purple, but given, that not much time has passed it can very well be the reddish color you might have asked, as stated here on page 39:
The first manifestation of livor mortis can be expected 20-30 min following the irreversible cardiovascular arrest, initially as bright-red spots that subsequently become confluent and turn bluish-violet.
Which might better describe your case is the fact, that cold conditions can cause bright red color in livor mortis, as it can also be found on page 39: | {
"domain": "biology.stackexchange",
"id": 3720,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "biochemistry, medicine, decay",
"url": null
} |
ros
Title: How to get the line "source devel/setup.bash" to run after every time you catkin_make?
I have "source devel/setup.bash" added to my bashrc file, but sometimes, if I create a new package and then compile it for the first time with "catkin_make", then I find I need to open a new terminal in order to run the package because the terminal I already have open needs to source devel/setup.bash again.
Does anyone know how to get "source devel/setup.bash" to run every time I do catkin_make? Or otherwise how to solve this problem?
Originally posted by mysteriousmonkey29 on ROS Answers with karma: 170 on 2014-01-14
Post score: 4
Either you must run the above source command each time you open a new terminal window
or add it to your .bashrc file as follows.
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
I found the above instruction from this website:
https://github.com/MST-Robotics/MST_ROS_Catkin_Packages/wiki/New-Member-Tutorials | {
"domain": "robotics.stackexchange",
"id": 16647,
"lm_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
} |
c#, linq
Days31_45 = groupedLeadTime.Sum(item => ((item.CheckInDate.Date - item.BookingDate.Date).Days >= 31 && (item.CheckInDate.Date - item.BookingDate.Date).Days <= 45) ? 1 : 0),
Days46_60 = groupedLeadTime.Sum(item => ((item.CheckInDate.Date - item.BookingDate.Date).Days >= 46 && (item.CheckInDate.Date - item.BookingDate.Date).Days <= 60) ? 1 : 0),
Days60Plus = groupedLeadTime.Sum(item => ((item.CheckInDate.Date - item.BookingDate.Date).Days > 60) ? 1 : 0)
}).ToList(); | {
"domain": "codereview.stackexchange",
"id": 612,
"lm_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#, linq",
"url": null
} |
everyday-chemistry, biochemistry, food-chemistry, terminology
My teacher tells me, that the term "Complex" here is supposed to indicate the existence of a wide range of B-Vitamins (Like $\ce{B1, B2, B3,}$ etc.). But I didn't find that 'explanation' satisfying, since there are all sorts of other vitamin categories (such as D and K) that have quite a few subtypes ( $\ce{D1, D2, D3, K1, K1, K3,}$ etc) but I've never heard of a Vitamin D Complex or a Vitamin K Complex for that matter.
So my question stands:-
What does the term "Complex" mean, with regard to the Vitamin B Complex? Do Vitamin D Complexes and Vitamin K Complexes exist as well? I have been studying Vitamins for a while (Nutritional Biochemistry), and though I agree with the explanation of your teacher and with the answers already given,
Part of the reason has to do with their discovery:
The general definition of vitamins is described: | {
"domain": "chemistry.stackexchange",
"id": 8246,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "everyday-chemistry, biochemistry, food-chemistry, terminology",
"url": null
} |
Solution of Question 1:
This is an occupancy problem with $n=30$ boxes and $k=15$ balls.
Let's first consider the expected number of empty boxes. That is much easier to obtain. The exact answer is $30(1-1/30)^{15}=18.04.$ This is approximately $30/\sqrt e.$ See the answer by Mr.Spot to this question:
Making 400k random choices from 400k samples seems to always end up with 63% distinct choices, why?
The probability of exactly $j$ empty boxes is, for $n-k\le j\le n-1$:
$$P(j)={n \choose j}\sum_{m=0}^{n-j}(-1)^m {n-j \choose m}\left(1-\frac{j+m}n\right)^k$$
See this:
http://probabilityandstats.wordpress.com/2010/04/04/a-formula-for-the-occupancy-problem/
For $n=30$ and $k=15:$
$P(20)$ to $P(24)$ is $0.096,0.024,0.0036,0.00029,0.000013,....$
and the probability of at least $20$ empty cells = 0.124371
Solution of Question 2:
You throw 15 balls into 30 boxes. What is the probability of the following result:
2 triple, 1 double and 7 single occupancy boxes and the rest empty. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9814534354878828,
"lm_q1q2_score": 0.8509552150325912,
"lm_q2_score": 0.8670357494949105,
"openwebmath_perplexity": 588.1410203704329,
"openwebmath_score": 0.7497148513793945,
"tags": null,
"url": "https://math.stackexchange.com/questions/878115/in-30-boxes-are-15-balls-chance-all-balls-in-10-or-less-boxes"
} |
rviz
Originally posted by hersh with karma: 1351 on 2013-07-22
This answer was ACCEPTED on the original site
Post score: 2 | {
"domain": "robotics.stackexchange",
"id": 14981,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rviz",
"url": null
} |
matlab, audio
If you want the most absolutely low delay between input and output then you are going to have to move towards more complex to design filters.
Hope this helps.
EDIT:
To drive the motor with PWM and produce different levels of vibration for different levels of "bass" in the signal, you need to substitute the stages of "recitication --> integration" with a simple "quantisation" stage.
Quantisation is simply a linear transformation from the range of possible values of your "bass" signal (say 0-255) to the range of possible PWM levels (say 0-8).
The fact that the signal can have practically infinite dynamic range (AS COMPARED TO THE VIBRATION LEVELS) does not mean that the PWM stage can produce infinite vibration levels with the differences between them being discriminable. | {
"domain": "dsp.stackexchange",
"id": 4756,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "matlab, audio",
"url": null
} |
of the circle, which was bisected through center... That the height of an arc is a semicircle can be inscribed in a rectangle is inscribed in a is. Cm with 3 ( 3 12 ) ( cm d dd2 π=dd = π+ +... 7 Maths Chapter 7 perimeter and the base line is twice the radius 2r. X 2r x r = r^2 sq units the arc length is some of! = 1/2 x 2r x r = r^2 sq units be calculated using the formula... I calculate angle by two Mathematics CBSE, 18 Areas of circle r... Divide the 18π by π to give the diameter of a semicircle formula calculus a rectangle so that diameter... The half of the rectangle as the perimeter of the semi-circle DOES have the rectangle perimeter... C = πd c = πd c = 2πr focus to any point of a semicircle and diameter nothing half... Given different kinds of example problems + ++ c have a central angle the. And Segment a straight line from the center of a circle of radius r сm the of. 2 = 18π version 2.0 now from the Chrome web Store we will need download. The arc length of the circle and the | {
"domain": "fixxermedia.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9901401441145625,
"lm_q1q2_score": 0.8000997895696884,
"lm_q2_score": 0.8080672158638527,
"openwebmath_perplexity": 613.637405586268,
"openwebmath_score": 0.8171480298042297,
"tags": null,
"url": "http://fixxermedia.com/qqdylzy/5cfa69-perimeter-of-semicircle-of-radius-r"
} |
23947=7*11*311. Then $$3781^{23947} = (3781^7)^{11\times 311}$$ Then reduce $3781^7$ modulo 31847 and keep going. Since $3781^7$ is probably too big, you might have to compute it as $$3781\times 3781^6=3781\times (3781^2)^3$$ where again you reduce mod 31847 wherever possible.
-
And what would you do if you couldn't factor the exponent? – Gerry Myerson May 2 '11 at 0:11
Precisely what I did with the exponent 7? – dstt May 2 '11 at 0:16
OK. Then why bother factoring? Does it actually make anything better? – Gerry Myerson May 2 '11 at 0:24
If you have a small factor and your calculator can handle it, then it usually makes things faster. It might also happen, that $3781^7$ is small mod 31847, so that your calculator can still handle that to the power 11... I usually start by factoring for these reasons. – dstt May 2 '11 at 0:33 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9683812354689082,
"lm_q1q2_score": 0.8269130830858641,
"lm_q2_score": 0.8539127492339909,
"openwebmath_perplexity": 496.5196206743364,
"openwebmath_score": 0.8354834914207458,
"tags": null,
"url": "http://math.stackexchange.com/questions/36318/modulo-arithmetic-with-big-numbers"
} |
Generator. If you're interested, take a look. Op Amp Triangle-Wave Generator. Siemens Digital Industries Software. Find Simple Sine Wave Oscillator Circuit The video shows the very basics from a 1 transistor sine wave generator, consi#105: More. You can use either the AFG2021’s knob or keypad to set the voltage and frequency. The Sine Wave Generator is an excellent tool for generating waves with speakers or wave drivers. This is the very first time I've used d3 or drawn a SVG and I'm fairly new to JS as well, so I don't know if I've overcomplicated it/if there is a simpler way to achieve this. ToneGen Audio Tone Generator can be used as a sine wave generator, sound frequency maker, or signal generator that can be used to create test tones, sweeps, and more. An animated visual aid to help learning and teaching functions. Wave form The wave form: a sine wave, square wave, or sawtooth wave. Then the waveform shape produced by our simple single loop generator is commonly referred to as a | {
"domain": "keduku.fr",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9559813476288301,
"lm_q1q2_score": 0.8047696224185478,
"lm_q2_score": 0.8418256532040708,
"openwebmath_perplexity": 940.2265415389599,
"openwebmath_score": 0.6763566732406616,
"tags": null,
"url": "http://hzpj.keduku.fr/sine-wave-equation-generator.html"
} |
quantum-mechanics, wavefunction, probability
Title: Intuitive explanation of probability density and probability current I was given the wavefunction $\psi(x)= C e^{-x/a}e^{ibx}, 0< x < \infty$ and asked to compute $J$, the probability current and $d\rho/dt$, the change in the probability density with respect to time. That is fairly straightforward, using $d\rho/dt = -dJ/dx$, however I'm a bit confused as to why $d\rho/dt$ is nonzero. If $\Psi(x,t) = \psi(x) e^{i\omega t}$, shouldn't it follow that $\rho$ is time independent?
Also, it seems that if the wavefunction did not have the $e^{ibx}$ factor, then $d\rho/dt= 0$, so is there an intuitive explanation as to why this happens?
Additional details: I wasn't given the Hamiltonian or told anything about eigenstates. The question simply gave me the above wavefunction and asked to find the following:
the probability density $\rho(x)$,
The probability current $J(x)$ and
$\partial\rho/\partial t$.
Here are the values I found for the above: | {
"domain": "physics.stackexchange",
"id": 75625,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, wavefunction, probability",
"url": null
} |
javascript, performance, ecmascript-6, react.js
Solution 2
Apply same fixes as implementation 1
Concert to useReducer react hook
Suggestions
Create action types & creator, and a reducer function.
const ACTIONS_TYPE = {
INCREMENT: 'INCREMENT',
DECREMENT: 'DECREMENT',
};
const reducer = (state, action) => {
switch(action.type) {
case ACTIONS_TYPE.INCREMENT:
return state.map((el, i) => i === action.index ? {
...el,
quantity: el.quantity + 1,
} : el);
case ACTIONS_TYPE.DECREMENT:
return state.map((el, i) => i === action.index ? {
...el,
quantity: Math.max(0, el.quantity - 1),
} : el);
default:
return state;
};
};
const increment = index => ({
type: ACTIONS_TYPE.INCREMENT,
index,
});
const decrement = index => ({
type: ACTIONS_TYPE.DECREMENT,
index,
});
Use in component
const [state, dispatch] = useReducer(reducer, initialState); | {
"domain": "codereview.stackexchange",
"id": 39023,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, performance, ecmascript-6, react.js",
"url": null
} |
scheme in time, in the paper, the traditional Lax-Wendroff form is. 2 Example 2. ; % Maximum time c = 1. ⚉ Linear first order wave equation using linear methods (Lax-Fredrich and Lax-Wendroff 1-step) and nonlinear methods (flux limited Lax-Wendroff). 1 Modification 9. Ich zeichne mit MATLAB mehrere Graphen in derselben Figur mit Hilfe von polar. The CFL condition, hyperbolic systems. In fact, all stable explicit differencing schemes for solving the advection equation are subject to the CFL constraint, which determines the maximum allowable time-step. Related Data and Programs: FD1D_BURGERS_LAX, a MATLAB program which applies the finite difference method and the Lax-Wendroff method to solve the non-viscous time-dependent Burgers equation in one spatial dimension. Lax-Friedrich Leap-Frog Interpretation of Stability Condition for Lambda General Formulation of Difference Schemes More Schemes Lax-Wendroff MacCormack Runge-Kutta Crank-Nicholson Compact Difference Schemes Phase Errors from | {
"domain": "eccellent.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9693241991754918,
"lm_q1q2_score": 0.819992479357449,
"lm_q2_score": 0.8459424411924673,
"openwebmath_perplexity": 2782.480324868599,
"openwebmath_score": 0.496159166097641,
"tags": null,
"url": "http://goud.eccellent.it/lax-wendroff-matlab.html"
} |
rviz, transform
Title: How do I make the rviz camera display accurate given the transform at the image timestamp?
Currently, rviz shows a camera display with what appears to be the most recent transform available. Instead, I need it to use tf at the image message stamp time (which is far enough back in time to have a tf available). What do I need to change for that to happen?
Thanks!
Originally posted by kiwi on ROS Answers with karma: 1 on 2011-06-21
Post score: 0
When data arrives, rviz will always try to transform it to the fixed frame, given the latest available tf transform.
I understand you are looking at a camera image, with other features (e.g. laser scans) overlayed on the image, and you only want to show laser scans at the same time as the image timestamp. This behavior is not supported in rviz, and afaik it's not on the roadmap either.
Originally posted by Wim with karma: 2915 on 2011-08-29
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 5916,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rviz, transform",
"url": null
} |
2. Sep 18, 2013
### B4ssHunter
your answer would be right only if V was a force which its obviously isnt
also , if you had the force then the upward force would equal 2F * cos theta . where f is the force at each block and since they look the same then F1=F2
if you had acceleration or time you could apply on this equation F= MA but since you dont , i dont really know , maybe you should law of conservation of momentum but its just a wild guess
3. Sep 18, 2013
### barryj
I think you are correct and the answer of v/cos theta is wrong.
4. Sep 18, 2013
### haruspex
Quite so, but that means for W to stay connected to each string it must also have a velocity component v towards each pulley. If its speed is u then u cos θ = v.
5. Sep 18, 2013
### ehild | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9744347838494567,
"lm_q1q2_score": 0.8011696876835295,
"lm_q2_score": 0.8221891305219504,
"openwebmath_perplexity": 965.3404660903531,
"openwebmath_score": 0.7204271554946899,
"tags": null,
"url": "https://www.physicsforums.com/threads/problem-related-to-pulley-system-and-velocity.711126/"
} |
acoustics, biology, ultrasound
Source | {
"domain": "physics.stackexchange",
"id": 74294,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "acoustics, biology, ultrasound",
"url": null
} |
Equation (*) is a radical equation in two variables ($\,x\,$ and $\,y\,$).
A radical equation, by definition, has at least one variable ‘inside’ a radical.
A standard approach for working with radical equations is to ‘isolate and undo’.
To isolate an expression (like a radical) means to get it all by itself on one side of the equation.
Be on the lookout for this ‘isolate and undo’ sequence (used twice!) in the algebraically-intensive simplifying procedure below.
• ‘Undoing’ a square root:
For us, the radicals that appear in (*) are square roots; a square root is ‘undone’ by squaring.
That is: for all $\,t \ge 0\,$, $\,(\,\sqrt t\,)^2 = t\,$. By squaring a square root, the square root disapppears!
• The expressions under the square roots in (*) are nonnegative:
For all real numbers $\,x\,$, $\,y\,$ and $\,c\,$, both expressions under the square roots in (*) are nonnegative:
• $(x+c)^2 + y^2 \ge 0$
• $(x-c)^2 + y^2 \ge 0$
Why? | {
"domain": "onemathematicalcat.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9854964194566753,
"lm_q1q2_score": 0.8080019425421502,
"lm_q2_score": 0.8198933315126792,
"openwebmath_perplexity": 511.30550756231366,
"openwebmath_score": 0.9378538727760315,
"tags": null,
"url": "http://www.onemathematicalcat.org/Math/Precalculus_obj/derivationEquationEllipsex.htm"
} |
mobile-robot, sensors, raspberry-pi, uav
So as far as I understand I need the component which I highlighted. But I have no idea how that component is called (what do I search for?) and whether it is actually doable to read it out from a Raspberry Pi.
Question #2: does anybody know what the highlighted component is called, where I could possibly get it and if I can read it out from a Raspberry Pi?
In conclusion; can anybody point me in the right direction? The component you highlighted is called a tensile load cell. You could buy one from a supplier, but it probably would be cheaper to buy a cheap digital hanging scale and taking the sensor out of it - at least I couldn't find one less than $100, ten times the price of a 50kg digital hanging scale.
You will need to do some analog conversion and amplification of the signal and then convert to digital with an ADC; I haven't done so myself but Sparkfun's load cell tutorial seems a good start. | {
"domain": "robotics.stackexchange",
"id": 2658,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mobile-robot, sensors, raspberry-pi, uav",
"url": null
} |
algorithms, complexity-theory, knapsack-problems
You want to answer whether you can accumulate a total value $V$.
I have to show that the problem above is NP-complete. Skipping the proof that it is in NP, what's left is to show that we can reduce a known NP-hard problem to it. I believe the Knapsack problem is a good candidate if one uses the following reduction:
Each item in the Knapsack problem becomes a node in our graph. The weight of the item is the time to travel to this node from all other nodes, and the value of the item is the value of the good at this node. We are asked if we can reach a total value of V, the same as in the Knapsack problem.
This construction can be done in polynomial time. Therefore, our problem is NP-hard.
My questions:
Is there any better way to map the different expiration deadlines to the Knapsack problem? | {
"domain": "cs.stackexchange",
"id": 21193,
"lm_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, complexity-theory, knapsack-problems",
"url": null
} |
general-relativity, stress-energy-momentum-tensor, matter
Luciano Combi, "Spacetime is material", arXiv:2108.01712v1 The stress-energy tensor in Einstein field equations represents matter, not spacetime. More precisely, it models the effect of matter on the spacetime geometry [1]. However, if I understand it properly, the quantity $p$ in $T_{\mu}^{\nu}=diag~\{\varepsilon,-p,-p,-p\}$ is not a scalar quantity, as for example pressure in gas. As a component of normal stress, it can have 3 different values at the same point (fluid with anisotropic pressure for example). It is actually then a vector. Generally, I quote [2], "Its components are related to the matter in the spacetime by
\begin{equation}
T_{\mu}^{\nu} = \left(
\begin{array}{c | c}
\rho & S^{\nu} \\
\hline
S_{\mu} & \pi_{i}^{j}
\end{array}
\right),
\label{eq:Tab-compts}
\end{equation}
where $\rho$ is the energy density, $S_\mu$ is the energy-flux, and $ \pi_{i}^{j}$ is the stress ($i,j=$1,2,3). | {
"domain": "physics.stackexchange",
"id": 84622,
"lm_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, stress-energy-momentum-tensor, matter",
"url": null
} |
ros, gazebo-plugins
I added the intertia property to r_gripper_tool_frame which was originally defined in file "pr2_description/urdf/gripper.urdf.xacro" and it worked.
But i'm still wondering if there is detailed gazebo plugin XML reference.
Originally posted by vincent with karma: 311 on 2011-09-03
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 6584,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, gazebo-plugins",
"url": null
} |
c++, opengl
Title: C++ OpenGL Debug Utility Edit: A follow up post can be found here.
So I've started a c++ project, coming from Java / C# there are many obvious differences.
Below is an example of a class I've been working on:
.h
#pragma once
#include <vector>
#include <GL/glew.h>
#include <glm/glm.hpp>
class GLDebug {
private:
struct Line {
glm::vec3 p0, p1;
};
private:
std::vector<Line> m_lines;
public:
GLDebug();
~GLDebug();
public:
void drawLine(const glm::vec3& p0, const glm::vec3& p1);
void onRender(const glm::mat4& projMatrix, const glm::mat4& viewMatrix);
};
.cpp
#include "GLDebug.h"
#include <glm/gtc/type_ptr.hpp>
GLDebug::GLDebug() { }
GLDebug::~GLDebug() { }
void GLDebug::drawLine(const glm::vec3& p0, const glm::vec3& p1) {
m_lines.push_back({ p0, p1 });
}
void GLDebug::onRender(const glm::mat4& projMatrix, const glm::mat4& viewMatrix) {
glMatrixMode(GL_PROJECTION);
glLoadMatrixf(glm::value_ptr(projMatrix)); | {
"domain": "codereview.stackexchange",
"id": 30509,
"lm_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++, opengl",
"url": null
} |
logic, first-order-logic
check that $s>t_j$, $j=\overline{1,m}$
$s>_{\textsf{lpo}}t_1$ (LPO 1)
to prove that $s>_{\textsf{lpo}}t_2$ (LPO 2c) we prove that
$$s>_{\textsf{lpo}} y \;\;\text{(LPO 1)};\qquad s>_{\textsf{lpo}}z \;\;\text{(LPO 1)};\qquad \circ(x,y)>y\;\;\text{(LPO 1)}$$
find $i$ such that $s_i>_{\textsf{lpo}}t_i$ $i=1$
$$\circ(x,y)>_{\textsf{lpo}}x\;\;\text{(LPO 1)}$$ | {
"domain": "cs.stackexchange",
"id": 5216,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "logic, first-order-logic",
"url": null
} |
performance, .net, vb.net, symbolic-math
j = j - 1
If j = 0 Then Exit Do
Loop
before = Mid(Str, j + 1, i - j - 1)
End If | {
"domain": "codereview.stackexchange",
"id": 31302,
"lm_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, .net, vb.net, symbolic-math",
"url": null
} |
special-relativity, relativity
In $\mathbf S'$ the proper length of the rod hasn't changed at all | {
"domain": "physics.stackexchange",
"id": 98693,
"lm_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, relativity",
"url": null
} |
javascript, game, chat, websocket
</div>
<!-- ROW 2 - Only show when getting invite request -->
<div id="lobby_invite_request" style="display: none;" class="tableHeading lobbyInviteRequest">
<!-- td colspan 2 -->
<div id="lobby_invite_request_colspan" class="tableCell">
<div id="lobby_invite">
<!-- TODO this should be filled in dynamically -->
Game invite from NAME to play GAME_TYPE!
<input id="lobby_invite_accept" type="button" value="Accept" class="btn btn-success" />
<input id="lobby_invite_decline" type="button" value="Decline" class="btn btn-warning" />
<audio id="invite_ping">
<source src="../../sounds/ping_sound.mp3" />
</audio>
</div>
</div>
</div>
<!-- ROW 3 - Subheaders for Messages and Users -->
<div id="lobby_list_headers" class="tableRow lobbyListHeaders"> | {
"domain": "codereview.stackexchange",
"id": 30016,
"lm_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, game, chat, websocket",
"url": null
} |
python, mathematics, machine-learning, neural-network
def arctan(x, derivative=False):
if (derivative == True):
return (np.cos(x) ** 2)
return np.arctan(x)
def step(x, derivative=False):
if (derivative == True):
for i in range(0, len(x)):
for k in range(len(x[i])):
if x[i][k] > 0:
x[i][k] = 0
return x
for i in range(0, len(x)):
for k in range(0, len(x[i])):
if x[i][k] > 0:
x[i][k] = 1
else:
x[i][k] = 0
return x
def squash(x, derivative=False):
if (derivative == True):
for i in range(0, len(x)):
for k in range(0, len(x[i])):
if x[i][k] > 0:
x[i][k] = (x[i][k]) / (1 + x[i][k])
else:
x[i][k] = (x[i][k]) / (1 - x[i][k])
return x
for i in range(0, len(x)):
for k in range(0, len(x[i])):
x[i][k] = (x[i][k]) / (1 + abs(x[i][k]))
return x | {
"domain": "codereview.stackexchange",
"id": 20443,
"lm_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, mathematics, machine-learning, neural-network",
"url": null
} |
exoplanet
1 The eight planets are: Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune.
2 An IAU process will be established to assign borderline objects to the dwarf planet or to another category.
3 These currently include most of the Solar System asteroids, most Trans-Neptunian Objects (TNOs), comets, and other small bodies. | {
"domain": "astronomy.stackexchange",
"id": 2988,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "exoplanet",
"url": null
} |
electric-circuits, capacitance
In ideal circuit diagram land, if we close the circuit, we get a divide-by-zero error for current (finite potential difference divided by resistance 0), square it and multiply by zero for power dissipated across the wire (resistance 0), and get undefined. In reality, wires have finite resistance, so we have by Ohm's law:
$P = V^2/R$
a nontrivial number squared divided by a very small number is a very much bigger number than the thermal power a real wire can radiate at temperatures compatible with solidity, so a split second later our circuit looks like this:
With a little bit of residual + charge on the left and - charge on the right.
Since vaporized wires are an excellent insulator, we've opened the circuit again. | {
"domain": "physics.stackexchange",
"id": 93464,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electric-circuits, capacitance",
"url": null
} |
regular-languages, context-free, finite-automata, pushdown-automata, pumping-lemma
Exercise 1. (One minute or less) Verify that $L=P\cap (R_a\cap R_b)$.
Exercise 2. Show that $R_a$ is regular. | {
"domain": "cs.stackexchange",
"id": 13241,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "regular-languages, context-free, finite-automata, pushdown-automata, pumping-lemma",
"url": null
} |
quantum-field-theory, hamiltonian, ground-state
So, my question is, how can we sensibly get rid of these zero-point infinities without running into problems with the ground state? Or, can we prove the existence of the ground state for an unbounded Hamiltonian? $\Pi(x)$ and $\Phi(x)$ are not operators. They are operator valued distributions (distributions that when acting on the one-particle functions become operators). Therefore, it does not make sense to do their square since it is like doing the square of the $\delta$ function. The normal ordering is a prescription on how to cure this ill definition, and obtain an operator that is bounded from below. The boundedness from below can be easily proved, and in addition $\int\omega(k)a^*(k)a(k)dk$ is a well-defined self-adjoint operator. | {
"domain": "physics.stackexchange",
"id": 23172,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, hamiltonian, ground-state",
"url": null
} |
Perhaps what is counter-intuitive is the fact that whenever $A$ is false, then $A\Rightarrow B$ is true, based on how logical implication is defined: $$\begin{array}{|c|c|c|} \hline A & B & A\Rightarrow B \\ \hline {\bf F} & F & {\bf T}\\ {\bf F} & T & {\bf T}\\ T & F & F\\ T & T & T\\ \hline \end{array}$$
Applied to the example of the coin:
if the coin shows heads, then it shows tails
or
if the coin shows tails, then it shows heads
Let's say a coin is flipped, and it shows heads.
Then the following statement is false:
the coin shows tails
and thus the second half of the disjunction is true:
if the coin shows tails, then it shows heads
therefore the whole disjunction is true.
Similarly if tails were shown. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.974821157567904,
"lm_q1q2_score": 0.8246425859729003,
"lm_q2_score": 0.8459424373085146,
"openwebmath_perplexity": 540.6702023904975,
"openwebmath_score": 0.891832709312439,
"tags": null,
"url": "https://math.stackexchange.com/questions/2784528/is-the-disjunction-of-these-two-false-statements-true"
} |
java, java-8, javafx
<TabPane fx:id="tabPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="800.0" tabClosingPolicy="UNAVAILABLE" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="dpc2dashboard.DashboardController">
<tabs>
<Tab text="General">
<content>
<javafx.scene.layout.AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<BorderPane prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<center>
<ScrollPane fitToHeight="true" fitToWidth="true" prefHeight="200.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="200.0" prefWidth="200.0"> | {
"domain": "codereview.stackexchange",
"id": 8964,
"lm_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, java-8, javafx",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.