text stringlengths 1 1.11k | source dict |
|---|---|
proteins, research-tools
You can use the -p to specify the acc of the pattern you want.
I'm quite busy so I typed this one really fast, please let me know when something is not clear. | {
"domain": "biology.stackexchange",
"id": 8451,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "proteins, research-tools",
"url": null
} |
python, performance, json, postgresql
# 93668202 87.131 0.000 87.131 0.000 :0(isinstance)
# 46873314 72.450 0.000 976.665 0.000 pyTwitter.py:74(<genexpr>)
# 723 27.384 0.038 27.384 0.038 :0(listdir)
# 40099 25.166 0.001 25.166 0.001 :0(_isdir)
# 392 12.197 0.031 12.197 0.031 :0(commit) Improving throughput
If you want to get the best possible throughput, you need to decompose this into a few processes.
The decompression can be handled with bzcat, available for Windows as part of the GnuWin tools.
psycopg2's execute sends commands to the database synchronously and one-at-a-time. The executemany method also issues commands synchronously and one-at-a-time. Rather than attempt to get around this in Python, you could instead use PostgreSQL's console-based tool, psql. | {
"domain": "codereview.stackexchange",
"id": 11985,
"lm_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, json, postgresql",
"url": null
} |
java, unit-testing, reflection, junit
try {
Method m = LibraryCounter.class.getDeclaredMethod("median", args);
m.setAccessible(true);
try {
Object o = m.invoke(null, sample, 0, sample.length-1);
int result = (int)o;
assertEquals(8, result);
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
Logger.getLogger(LibraryCounterTest.class.getName()).log(Level.SEVERE, null, ex);
}
} catch (NoSuchMethodException | SecurityException ex) {
Logger.getLogger(LibraryCounterTest.class.getName()).log(Level.SEVERE, null, ex);
}
assertEquals(7, sample[0]);
assertEquals(8, sample[1]);
assertEquals(9, sample[2]);
}
} | {
"domain": "codereview.stackexchange",
"id": 21026,
"lm_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, unit-testing, reflection, junit",
"url": null
} |
python, rosdep, ros-kinetic, ubuntu, ubuntu-xenial
Title: "Permission denied" when importing tf
Hi All,
I am using ros kinetic on ubuntu 16.04 xenial.
while trying to import tf library in python code I get following error
Traceback (most recent call last):
File "pose_visualizer.py", line 13, in <module>
import tf
File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf/__init__.py", line 28, in <module>
from tf2_ros import TransformException as Exception, ConnectivityException, LookupException, ExtrapolationException
File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf2_ros/__init__.py", line 39, in <module>
from .buffer_interface import *
File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf2_ros/buffer_interface.py", line 32, in <module>
import roslib; roslib.load_manifest('tf2_ros')
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/launcher | {
"domain": "robotics.stackexchange",
"id": 34296,
"lm_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, rosdep, ros-kinetic, ubuntu, ubuntu-xenial",
"url": null
} |
navigation, mapping, ros-kinetic, 2dlidar, hector-mapping
PARAMETERS
* /hector_geotiff_node/draw_background_checkerboard: True
* /hector_geotiff_node/draw_free_space_grid: True
* /hector_geotiff_node/geotiff_save_period: 0.0
* /hector_geotiff_node/map_file_base_name: hector_slam_map
* /hector_geotiff_node/map_file_path: /home/arnold/ydli...
* /hector_geotiff_node/plugins: hector_geotiff_pl...
* /hector_mapping/advertise_map_service: True
* /hector_mapping/base_frame: base_link
* /hector_mapping/laser_z_max_value: 1.0
* /hector_mapping/laser_z_min_value: -1.0
* /hector_mapping/map_frame: map
* /hector_mapping/map_multi_res_levels: 2
* /hector_mapping/map_resolution: 0.05
* /hector_mapping/map_size: 2048
* /hector_mapping/map_start_x: 0.5
* /hector_mapping/map_start_y: 0.5
* /hector_mapping/map_update_angle_thresh: 0.9
* /hector_mapping/map_update_distance_thresh: 0.2
* /hector_mapping/odom_frame: base_link
* /hector_mapping/pub_map_odom_transform: True
* /hector_mapping/scan_subscriber_queue_size: 5 | {
"domain": "robotics.stackexchange",
"id": 31883,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "navigation, mapping, ros-kinetic, 2dlidar, hector-mapping",
"url": null
} |
forces, fluid-dynamics, dimensional-analysis
Your two dimensionless quantities $x^{*}$, $\eta^{*}$ are inverse of one another, so they are not independent. The five dimensionful quantities have dimensions in units of $M$, $L$ and $T$, so to construct the second independent dimensionless quantity (the first could be either of $x^{*}$, $\eta^{*}$) you must include $\dot\gamma_0$ ($5 = 3 + 2 $).
Even if you do not understand definition of $\dot\gamma_0$ you could find its dimension: it is a derivative of velocity component w.r.t coordinate so its dimension is
$$ [\dot\gamma_0]=\left[\frac{\partial u}{\partial z}\right]=\frac{[u]}{[z]}=\frac{L T^{-1}}{L} =T^{-1}.$$
Incidentally, the (b) part of your question gives a hint on how to construct that second quantity: rewrite the equation
$$ \dot{\gamma}_0 = \dfrac{U^2\rho}{\eta}f\bigg(\dfrac{Ux\rho}{\eta}\bigg) \tag{*}$$ | {
"domain": "physics.stackexchange",
"id": 47823,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "forces, fluid-dynamics, dimensional-analysis",
"url": null
} |
performance, c, mathematics, fractals
– still looks weird:
make roots a vector parameter? (Darn - C, not C++, and array/pointer & length sucks.)
In next(), I need to count "multiplicities" - I'd rather not:
static t_float2 next(t_float2 z) // const t_float2 *z?
{
const double
x2 = z.x * z.x, // x4 = x2 * x2, // x3 = x2 * z.x, x5 = x2 * x3,
y2 = z.y * z.y, // y4 = y2 * y2,
sum_of_squares = x2 + y2,
sum_of_squares2 = sum_of_squares * sum_of_squares, // x4 + 2*x2*y2 + y4
denominator = 3 * sum_of_squares,
// z.x * z.x * z.x * z.x * z.x + 2 * z.x * z.x * z.x * z.y * z.y
// - z.x * z.x + z.x * z.y * z.y * z.y * z.y + z.y * z.y
x = // ( x5 + 2 * x3 * y2 - x2 + z.x * y4 + y2) / denominator,
// (z.x * (x4 + 2 * x2 * y2 - z.x + y4) + y2) / denominator,
(z.x * (sum_of_squares2 - z.x) + y2) / denominator,
// z.y * (z.x * z.x * z.x * z.x + 2 * z.x * z.x | {
"domain": "codereview.stackexchange",
"id": 44828,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, c, mathematics, fractals",
"url": null
} |
$$\lim\limits_{n \to \infty} {\displaystyle \prod_{k=1}^{n} \dfrac{(k+1)^2}{k(k+2)}} = \lim\limits_{n \to \infty} {\displaystyle \prod_{k=1}^{n} \dfrac{k+1}{k}\dfrac{k+1}{k+2}} = \lim\limits_{n \to \infty} {\displaystyle \prod_{k=1}^{n} \frac{ \dfrac{k+1}{k}}{\dfrac{k+2}{k+1}}}$$ $$= \lim\limits_{n \to \infty} \left( \frac{\frac{1+1}{1}}{\frac{1+2}{1+1}} \frac{\frac{2+1}{2}}{\frac{2+2}{2+1}}\frac{\frac{3+1}{3}}{\frac{3+2}{3+1}}\cdots \frac{\frac{n+1}{n}}{\frac{n+2}{n+1}} \right) = \lim\limits_{n \to \infty} \left( \frac{\frac{1+1}{1}}{\frac{n+2}{n+1}} \right)$$ $$= \lim\limits_{n \to \infty} \left( 2 \frac{n+1}{n+2} \right) = 2$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9755769056853638,
"lm_q1q2_score": 0.8171626860372322,
"lm_q2_score": 0.8376199572530448,
"openwebmath_perplexity": 159.50921941445966,
"openwebmath_score": 0.9994235038757324,
"tags": null,
"url": "https://math.stackexchange.com/questions/3444112/find-lim-n-to-infty-prod-k-1n-frack12kk2"
} |
# How many times to run the experiment
iters = 10000
# Track where the intersections occur
interx = c()
intery = c()
for(i in 1:iters) {
can1 = get2pts()
can2 = get2pts()
# Optional plot of every cannon fire line. Not a good idea for "iters" more than 100
#points(c(can1[1],can1[3]),c(can1[2],can1[4]),pch=20,col="yellow")
#segments(can1[1],can1[2],can1[3],can1[4],pch=20,col="yellow",lwd=1.5)
#points(c(can2[1],can2[3]),c(can2[2],can2[4]),pch=20,col="blue")
#segments(can2[1],can2[2],can2[3],can2[4],pch=20,col="blue",lwd=1.5)
# See if there is a point of intersection, find it.
toSolve = matrix(c( can1[3]-can1[1], can2[3]-can2[1], can1[4]-can1[2], can2[4]-can2[2]),byrow=T,ncol=2)
paras = solve(toSolve, c( can2[1]-can1[1], can2[2]-can1[2]))
solution = c(can1[1] + paras[1]*(can1[3]-can1[1]), can1[2] + paras[1]*(can1[4]-can1[2])) | {
"domain": "statisticsblog.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9790357610169274,
"lm_q1q2_score": 0.8027049025417103,
"lm_q2_score": 0.8198933425148213,
"openwebmath_perplexity": 1634.2395882596413,
"openwebmath_score": 0.5785263180732727,
"tags": null,
"url": "https://statisticsblog.com/2010/07/"
} |
natural-language-processing, reference-request, natural-language-understanding, text-summarization
Title: How would you build an AI to output the primary concept of a paragraph? My thinking is you input a paragraph, or sentence, and the program can boil it down to the primary concept(s).
Example:
Input:
Sure, it would be nice if morality was simply a navigation toward greater states of conscious well-being, and diminishing states of suffering, but aren't there other things to value independent of well-being? Like truth, or beauty?
Output:
Questioning moral philosophy. | {
"domain": "ai.stackexchange",
"id": 1860,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "natural-language-processing, reference-request, natural-language-understanding, text-summarization",
"url": null
} |
thermodynamics, thermal-conductivity, heat-conduction
[comment] So, if I did the math right and used the correct
coefficients: m=0.218, cp=0.2196, h=43, A=0.01935,
Tfire=900,T0=16,T(t)=80; then delta time is 0.004319 minutes = 0.259
seconds
Firstly, if calculated in the correct $\text{S.I.}$ units, the result would be in seconds ($\mathrm{s}$), not minutes. This is because of the occurrence of the $\text{Watt}$ i.e. $\mathrm{J/s}$ unit in the formula.
Secondly, the value of $c_p=0.2196$ (unit not specified) is incorrect. For steel we find $c_p\approx 444 \mathrm{J/(kg.K)}$
Thirdly, for $h$ we find a value closer to $h\approx 10\mathrm{W/(m^2.K)}$
I have no choice but to assume the values for $\dot{m}$ and $\dot{A}$ are correct.
So for $\Delta t$ we find:
$$\Delta t=\frac{0.218 \times 444}{10 \times 0.01935}\ln\Big[\frac{900-16}{900-80}\Big]$$
$$\boxed{\Delta t \approx 38\mathrm{s}}$$
This value 'feels right'. I had, just eye-balling the problem, indeed expected a value of seconds rather than minutes or hours. | {
"domain": "physics.stackexchange",
"id": 68695,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, thermal-conductivity, heat-conduction",
"url": null
} |
quantum-mechanics, general-relativity, waves, electromagnetic-radiation
Title: Does frequency equal mass? If e equals mass and if frequency equals energy then is it correct to conclude that frequency equals mass? No, this is not true.
Many physicists use natural units and as such equations like $E=mc^2$ and $E=\hbar\omega$ where the physical constants $c=1$ and $\hbar=1$ implies that energy has units of mass and inverse time (frequency). So within this framework, you’d say that mass has units of inverse time.
Note that this is done for convenience and does not reflect the real physical dimensions of such quantities. | {
"domain": "physics.stackexchange",
"id": 85246,
"lm_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, general-relativity, waves, electromagnetic-radiation",
"url": null
} |
The equation of the ellipse can be written in parametric form, using the trigonometric functions sine and cosine: $\begin{split} x &= a \cdot cos(t)\\ y &= b \cdot sin(t) \end{split}$ where t is the parametric variable in the range 0 to 2π. Im trying to plot a parametric equation given by X= 3t/(1+t3) and Y= 3t2/(1+t3), on two intervals in the same window, the intervals are -30≤ t≤ -1.6 and -0.6≤ t≤ 40 I need to use the plot function to plot this My code for the first interval of t is We will graph several sets of parametric equations and discuss how to eliminate the parameter to get an algebraic equation which will often help with the graphing process. parametric equations that represent the same function, but with a slower speed 14) Write a set of parametric equations that represent y x . Then graph the rectangular form of the equation… It also outputs slope and intercept parameters and displays line on a graph. With Graphing Calculator 3D you can plot parametric surface or line in | {
"domain": "kenlauguico.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9770226341042414,
"lm_q1q2_score": 0.8361859491955482,
"lm_q2_score": 0.8558511543206819,
"openwebmath_perplexity": 926.7117702167582,
"openwebmath_score": 0.8039703369140625,
"tags": null,
"url": "http://finetune.kenlauguico.com/di8y2x/q1zcpe.php?a9ded0=parametric-equation-grapher"
} |
ros, 3d-object-recognition, roboearth, ar-kinect
Title: roboearth: record object, could not get camera pose
Hi,
I'm trying to run the roboearth object recording package on electric turtlebot.
I started the turtlebot by running minimal bring up, run the kinect by ar_kinect_turtlebot.launch.
Now I run the ar_bounding_box and re_object_recorder, there's no point cloud in the GUI.
in the terminal running ar_bounding_box, I got log messages:
1.02 seconds needed for normal estimation
estimating normals
0.98 seconds needed for normal estimation
estimating normals
0.97 seconds needed for normal estimation
estimating normals | {
"domain": "robotics.stackexchange",
"id": 8483,
"lm_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, 3d-object-recognition, roboearth, ar-kinect",
"url": null
} |
thermodynamics
Further, there is no inflow "contained" in the pond; any incremental amount of water that flowed in might have remained in the pond, or flowed out, or evaporated; we just don't know.
You may find the analogy well suited to this question because if you conceptually cover the pond to eliminate condensation/evaporation, you know that the water level change is due solely to liquid inflow/outflow. Similarly, if you block the inflow/outflow channels, then the water level change is due solely to condensation/evaporation. (Note that you still know only the net amounts for each mechanism.)
(A caution to avoid confusion: The original system is assumed to be closed; the pond in the analogy is not closed because we're using water transfer as a surrogate for heat and work.) | {
"domain": "physics.stackexchange",
"id": 94782,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics",
"url": null
} |
c#, beginner
public SqlConnection msconn { get; private set;}
public MySqlConnection myconn { get; private set;}
public void OpenDatabases()
{
string msConnectionString = "user id=user;" +
"password='password';server=vsc002sql;" +
"Trusted_Connection=yes;" +
"database=I3_IC; " +
"connection timeout=30";
string myConnectionString = ("SERVER=localhost; DATABASE=forecasts;"
+ "UID=root; PASSWORD=;");
try
{
msconn = new SqlConnection(msConnectionString);
myconn = new MySqlConnection(myConnectionString); | {
"domain": "codereview.stackexchange",
"id": 7357,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, beginner",
"url": null
} |
audio, fourier-transform, frequency-spectrum
I don't know for sure if this explains everything but look at the level between your peak signal and the high-frequency components. There is almost 60 dB of rejection there. I've always heard that a good rule of thumb is to get 60 dB of rejection from your filters. I know that's not the full 96 dB offered by 16-bit music, but I bet you'd be hard pressed to actually hear that. Of course, there's the silliness of having music at that sample rate. Humans just can't hear anything above around 20 kHz, give or take. This article gives a good summary of the issues. It also brings up a good point, that that sample rate has the potential to pick up harmonics and other high-frequency distortion caused by equipment and electronics, despite the fact that we can't hear it. Perhaps something like that is going on? | {
"domain": "dsp.stackexchange",
"id": 2923,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "audio, fourier-transform, frequency-spectrum",
"url": null
} |
avl-trees
Title: What does h indicate in this diagram of avl trees? Looking at the tree on the left it seems that the triangles represent leaves of the avl tree. To arrive at the balancing of -2 besides the node y the right subtree must have 2 nodes while the left subtree has a maximum of 4 nodes. Thus 2-4 = -2. However what does the h indicate? It is probably the height of the subtrees, i.e. the length of a longest path from the root to a leaf. Doing the balancing leaves us with a tree of height $h+2$ where we started with height $h+3$. | {
"domain": "cs.stackexchange",
"id": 20513,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "avl-trees",
"url": null
} |
javascript, beginner, html
You already know all the files that are playable, I would avoid that second loop if you tend to process a lot of files
You can just do 'prompt' instead of 'window.prompt', ideally you never use prompt ;)
Ideally you have 1 var declaration on top instead of all over the place
Ideally use one form of quotes, ' or ", I tend to prefer '
Handling 1 file is inconsistent with handling multiple files, seems wrong
Use JsHint.com | {
"domain": "codereview.stackexchange",
"id": 18676,
"lm_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, beginner, html",
"url": null
} |
newtonian-mechanics, momentum, conservation-laws, projectile, drag
Title: Law of conservation of momentum A meteorite burns up in the atmosphere before it reaches the Earth's surface. What happens to its momentum?
What force does the earth's atmosphere produce so the final momentum becomes 0?
What force does the earth's atmosphere produce so the final momentum
becomes 0? | {
"domain": "physics.stackexchange",
"id": 90889,
"lm_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, momentum, conservation-laws, projectile, drag",
"url": null
} |
human-influence, water-table, underground-water, watershed
Inspired by Mad Max, where there is a large mountain aquifer supplying a couple hundred people and I have no idea how long it would take to deplete.
Previous questions have covered this in vague terms but haven't given a general picture of what it's like for people in general, especially in more remote areas where they may not have access to the largest of aquifers, which apparently can last decades. I'm more curious what it's like for a random farmer. It depends on the size of the aquifer and the amount of precipitation falling on the exposed areas of the aquifer. These have been used to provide water form many major cities.
The Trafalgar square fountains were initially powered by artesian pressure (as London is below the altitude of the North downs / Chilterns). Eventully too much water was extracted leading to salt water incursions in places. This aquifer is still in use but backed up by a number of surface reservoirs surrounding the London area.
" | {
"domain": "earthscience.stackexchange",
"id": 1856,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "human-influence, water-table, underground-water, watershed",
"url": null
} |
material-science, technology
3. The best anchor point for a Mars Elevator, once material becomes sufficently strong for surface attachment would be on Olympus mons. That puts it above sand storms and other Mars weather.
Finally: I believe that Mars is destined to become the shipyard for the solar system. It is sufficiently friendly for construction sites and the lower gravity makes it much more amenable to lift things to space than Earth.
Hope this helps. Let me know if you have any more questions about the material strength.
Martin | {
"domain": "physics.stackexchange",
"id": 41062,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "material-science, technology",
"url": null
} |
c#, random
Lambda-bodied property : This could can also be used on methods as well.
public double FreeSpace => 1.0 - UsedSpace;
public double UsedSpace => _items.Sum(x => x.Value);
public bool IsValid => UsedSpace == 1.0; | {
"domain": "codereview.stackexchange",
"id": 21068,
"lm_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#, random",
"url": null
} |
python, performance, algorithm, python-3.x, combinatorics
def is_stable(triangle):
seen = set()
for row in triangle:
if not seen.isdisjoint(row) or len(row) != len(set(row)):
return False
seen.update(row)
return True
def stable_triangle_bases(base_length, limit):
if base_length < 0:
raise ValueError("Base length must be nonnegative")
if not base_length:
yield ()
return
for base in stable_triangle_bases(base_length - 1, limit):
for i in range(limit):
if is_stable(make_triangle(base + (i,))):
yield base + (i,)
if __name__ == "__main__":
for base_length in range(40):
print(list(next(stable_triangle_bases(base_length, limit=base_length * 2))))
This works really well - up to about length 300 or so, in fact. | {
"domain": "codereview.stackexchange",
"id": 14220,
"lm_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, algorithm, python-3.x, combinatorics",
"url": null
} |
microbiology
Title: Do Tardigrades preserve water or replace water? If you find something funny in my argument, then please pardon me, as I lack knowledge of biology. I was reading an article titled as "Water Bears Can Replace All The Fluid In their Bodies With A Glass Matrix"
Being extremely new to biology, I am a bit confused. Do Tardigrades preserve water through this protein or entirely change their biological structure to flush away all the water present in their body and rely on these proteins? Does this mean that their bodies no longer contain water?
Thanks. neither they are desiccating, some water remains but too little to sustain normal processes, the matrix just preventing all the normally destructive side effects of desiccation that would destroy the cellular machinery, the cellular processes are still essentially stopped. | {
"domain": "biology.stackexchange",
"id": 8100,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "microbiology",
"url": null
} |
• Deciding whether a group is a Galois group over $\mathbb Q$ is a hard problem, called the inverse Galois problem. – lhf Mar 27 '18 at 12:11
• @lhf Yeah I am aware of that and i know I am bordering to this open problem, but I think that if you know everything about the group's structure then you re still in a safe zone. At least in the trivial cases of groups of order 8 i suppose everything 's been solved. For $S_n$ and $A_n$ theese cases have also been trivially answered so I 'd like to think that in the cases that you know everything about the group, there would be some solution. – fhn Mar 27 '18 at 12:15
For groups of smaller order like $8$ it seems to be much easier just to classify the Galois groups of cubics and quartics, as Keith Conrad is doing in his note here. So for quartics, the only group of order $8$ which arises is $D_4$, realized by $x^4+4x^2-2$, see Example $3.10$. Similarly, we easily find a polynomial with Galois group $Q_8$, see for example here: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9752018376422666,
"lm_q1q2_score": 0.8209499123692285,
"lm_q2_score": 0.8418256412990658,
"openwebmath_perplexity": 94.2527629044901,
"openwebmath_score": 0.8190231919288635,
"tags": null,
"url": "https://math.stackexchange.com/questions/2710209/given-a-galois-group-find-the-polynomial"
} |
Since we are looking at such a short segment of the circle, $\Delta\theta$ looks a lot a segment of the tangent line to the circle at that point. By geometry, the tangent line to the circle is perpendicular to the radius, and so the small triangle in the picture is similar to the large one. This lets us show that $\sin(\theta)\Delta\theta$ is approximately the small horizontal change in the picture (this is in fact a small change in cosine(\theta)).
Thus we are really just accumulating small horizontal distances. The total horizontal distance that you move from $\theta = 0$ to $\theta =\frac{\pi}{2}$ is 1, and so that is the integral.
If you have a solid geometric understanding of the fundamental theorem of calculus, and a solid geometric understanding of why the derivative of $\sin$ is $\cos$, then you will recognize that the proof above is really just weaving those two narratives together. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9783846672373523,
"lm_q1q2_score": 0.8335375586556955,
"lm_q2_score": 0.8519528019683106,
"openwebmath_perplexity": 158.1203335442763,
"openwebmath_score": 0.9234367609024048,
"tags": null,
"url": "https://math.stackexchange.com/questions/21796/finding-int-0-pi-2-sin-x-dx"
} |
electrochemistry
Title: What are high throw solutions? I am trying to make a copper sulfate electroplating solution. I came across a document (Schlesinger and Paunovic 2011) which mentions the amount of copper sulfate that should be added to water to create such a solution. In Table 2.1 on the bottom of page 35, it has two columns: one for conventional solutions and one for high throw solutions.
I read another paper (Nikolova and Watkowski) which talks about high throw copper electroplating process. All I could glean from the paper was that high throw solutions enable higher aspect ratios for copper PCBs.
Please reply if anyone knows what high throw solutions are.
References:
Nikolova, Maria, and Jim Watkowski. “INNOVATIVE HIGH THROW COPPER ELECTROPLATING PROCESS FOR METALLIZATION OF PCB.” | {
"domain": "chemistry.stackexchange",
"id": 711,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrochemistry",
"url": null
} |
ros, rosbag, rqt-bag
Originally posted by M@t with karma: 2327 on 2016-05-03
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by Martin Günther on 2016-05-04:
Actually, I think it's /opt, not ~/opt. And you should never modify files in /opt. Instead, clone rqt_bag into your catkin workspace and make the modifications there.
Comment by M@t on 2016-05-04:
Sorry, you're quite right, thanks for the corrections! | {
"domain": "robotics.stackexchange",
"id": 24533,
"lm_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, rosbag, rqt-bag",
"url": null
} |
thermodynamics, water, heat-conduction
Secondly, not many people often interact with "real" steam in their everyday lives. And by "real", I mean steam that is transparent, hot, dense and highly saturates the air. The white mist most people perceive as steam is not steam, it is "wet steam". It is usually a mix of steam, air, water droplets and steam that has cooled down but remains in a gaseous state i.e. water vapour. Let me be clear, water vapour is not steam. This has to do with phases of water that vary with temperature and pressure. You can easily picture this mentally by observing the fact that clouds are not boiling hot fluffs of water. Unless you're working at a factory of sorts, you're not going to encounter pure, hot, compressed steam. | {
"domain": "physics.stackexchange",
"id": 93804,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, water, heat-conduction",
"url": null
} |
general-relativity, gravity, visible-light, electromagnetic-radiation, photons
I've just noticed that you've tagged your question "Newtonian Gravity". In Newtonian gravity, which takes place in flat spacetime, light is indeed bent. It's a little bit problematic defining exactly what one means by gravitational action on light in this model, but any small mass travelling at $c$ follows the same, Newtonian, bent path uniquely defined by any tangent to the path. This assertion in this theory depends on what light's composition is: if we solve Maxwell's equations in flat spacetime, we get Euclidean straight lines for the Eikonal approximation (ray theory) regardless of what gravitating mass is present, so there is no bending. Newton thought of light as a particle, therefore it is clear he would have predicted the bent, Newtonian path would he have known the speed of light $c$. All we can say in Newtonian theory is that if we assume there is some small coupling constant between light and the gravitational field that isn't present in the flat spacetime Maxwell's | {
"domain": "physics.stackexchange",
"id": 43727,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, gravity, visible-light, electromagnetic-radiation, photons",
"url": null
} |
x - 1 ) \bmod n ) + 1 $. – PJTraill Mar 8 '18 at 22:02 Well, there are many answers to this actually, for instance $$f(n) = n + 1 - 3\lfloor n/3\rfloor$$ (assuming$\mathbb Z^+$starts with$0$). How to come to this? The basic idea is that$s(x)=x-\lfloor x\rfloor$is the sawtooth function with range$[0,1)$. Then$ns(x/n)$is the same function scaled$n$times in both directions, i.e., it's the sawtooth function with range$[0,n)$. However, you need range$[1,n+1)$, so that's the “$+1$” part. • This is basically the definition of mod function.$a \mod b = a-b\lfloor{a\over b}\rfloor$:) except it's shifted by one horizontally and then verticall – KKZiomek Mar 8 '18 at 4:29 • @KKZiomek I don't say it is not :-) And I believe that this view is self-explanatory, that's why I consider it good for educational purposes. – yo' Mar 8 '18 at 8:49 • This does not give (or only indirectly gives) what the questioner asked for, namely a systematic approach to arriving at the formula they themself found, i.e.$ ( | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9653811621568289,
"lm_q1q2_score": 0.8146804348425606,
"lm_q2_score": 0.8438951025545426,
"openwebmath_perplexity": 411.7901158269149,
"openwebmath_score": 0.8114504814147949,
"tags": null,
"url": "https://math.stackexchange.com/questions/2678895/function-which-creates-the-sequence-1-2-3-1-2-3/2681763"
} |
ros, moveit, pcl, ros-kinetic, tf-broadcaster
part_transform.setRotation(q);
// Broadcast a transform
br.sendTransform(tf::StampedTransform(part_transform, ros::Time::now(), world_frame, "part"));
Am I mistaken at some point?
Have someone faced the same problem of "tf in the corner"?
Feel free to ask and clarify any moments!
Best Regards,
Artemii
Originally posted by artemiialessandrini on ROS Answers with karma: 69 on 2019-03-07
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 32604,
"lm_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, pcl, ros-kinetic, tf-broadcaster",
"url": null
} |
optics, photons, atomic-physics, spectroscopy
$ \Delta \lambda_{L} = \Delta\lambda_{Nat}+\Delta\lambda_{VDW}+\Delta\lambda_{Stark}+\Delta\lambda_{Res}+\Delta\lambda_{Inst}$
and for the Gaussian portion it is the square root of the sum of the squares:
$ \Delta \lambda_{G} = \sqrt[2]{ \Delta\lambda_{Inst}^{2} + \Delta\lambda_{Dopp}^{2} }$
and the sum of them is:
$\Delta \lambda_{V} = \frac{ \Delta \lambda_{L}}{2} + \sqrt[2]{ \frac{\Delta\lambda_{L}^{2}}{4} + \Delta\lambda_{G}^{2} }$ | {
"domain": "physics.stackexchange",
"id": 30015,
"lm_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, photons, atomic-physics, spectroscopy",
"url": null
} |
c#, meta-programming, rubberduck
This looks just a bit messy in places. Am I missing some ways to clean it up?
P.S. The owner of Rubberduck says to use var (and it is pretty obvious what things are once you know the project internals :P), so you needn't comment on that.
This condition a.BYREF() != null || (a.BYREF() == null && a.BYVAL() == null) can be simplified to a.BYREF() != null || a.BYVAL() == null since if BYREF is not unequal to null then it is equal to null.
Also this logic is repeated again in another class - this violates DRY. It should be a method on the ArgContext (if I got the type right).
In ProcedureShouldBeFunctionInspection some properties reference the InspectionUI - it seems odd that an engine style class has a reference to the UI but there might be perfectly good reasons for it. Just seems a bit suspicious so I mentioned it. | {
"domain": "codereview.stackexchange",
"id": 17685,
"lm_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#, meta-programming, rubberduck",
"url": null
} |
quantum-mechanics, quantum-field-theory
Title: Can one have $\mathcal{PT}$-symmetry in a QFT theory proportional to an imaginary field? There is a lot of fuss nowadays around $\mathcal{PT}$-symmetry in non-relativistic quantum mechanics. Recently I came across this paper where the authors generalize the non-relativictic Hamiltonian
$$
H = p^2 + x^2(ix)^\epsilon,
$$
with $\epsilon\geq0$ to the Lagrangian
$$
\mathcal{L} = \frac{1}{2}(\nabla \phi)^2 + \frac{1}{2}\phi^2(i\phi)^\epsilon.
$$
As a humble peasant, I have to questions:
As far as I understand, the time reversal operator, in a QFT, is no longer taken as a unitary operator but instead as a Lorentz transformation
$$
g_{\mu \nu} \Lambda^\mu_{\;\rho} \Lambda^\nu_{\;\sigma} = g_{\rho \sigma}
$$,
where, for instance (I use Schwartz book notation on QFT)
$\Lambda = \operatorname{diag}(-1,1,1,1)$. In this sense, there is no point in including the $i$ for time-reversal in a valid QFT theory, right? | {
"domain": "physics.stackexchange",
"id": 60379,
"lm_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-field-theory",
"url": null
} |
evolution, mammals, ichthyology, marine-biology
Marine mammals occupy different ecological niches. There is no question of whether one has an advantage over the other as the species do not compete for the same ressources.
A typically important reason for why marine mammals and most fishes occupy different ecological niches relate to their size differences. Simply put, mammals to be quite big! For example a orca eat fishes (and other things) that had few predators before. There is therefore not much competition involved.
Just to reiterate... in your comment you say so the main advantage was the size?. Size was one of the biggest reason why they would be able to occupy previously unoccupied ecological niches. But it is not an advantage toward competition with fishes as you seem to be thinking as there probably little competition. | {
"domain": "biology.stackexchange",
"id": 6299,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "evolution, mammals, ichthyology, marine-biology",
"url": null
} |
fourier-transform, time-frequency
Now, the idea that the Fourier transforms are losing time localization of the signals come from the observation that its bases are of infinite extent sinusoidals. And a sine wave of infinite extent and constant amplitude will not have a time localization. On the other hand it has a perfect frequency localization, being a pair of impulses at an exact frequency. The bases of wavelets, for example, are partly local in both domains.
This is the essence of time-frequency analysis. A base that's exactly local in frequency will loose all time localization and a base that's exactly local in time will loose any frequency localization. And those in between are the transforms that provide a compromise between exact localization and no localization at all. | {
"domain": "dsp.stackexchange",
"id": 5209,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fourier-transform, time-frequency",
"url": null
} |
integrals. The sample tests are just to give you an idea of the a general idea of the topics covered, the level of difficulty, how questions may be worded and, if solutions are provided, what is the acceptable level of detail required. Calculus II Practice Problems 1: Answers 1. How much to study: Calculus is a hard subject. Problems on the continuity of a function of one variable. solved calculus bc math problems on arc length, differential equations and the integral of the second derivative; Limit x sin(1/x) as x goes to infinity; solved math problems. If you need to make adjustments in your academic or work schedules, do so now. The following problems are specific slope field problems from the free response for the past 2 years. Is it necessary to learn about calculus and other things that. True or False, and give a short reason: (a) The Ratio Test will not give a conclusive result for P 2n+3 3n4+2n3+3n+5 TRUE. org Resources For The Calculus Student. Line of Rotation Below the | {
"domain": "luke-in-beijing.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.956634203708804,
"lm_q1q2_score": 0.8012959066339387,
"lm_q2_score": 0.8376199633332891,
"openwebmath_perplexity": 1052.7535688955415,
"openwebmath_score": 0.5279259085655212,
"tags": null,
"url": "http://luke-in-beijing.de/calculus-2-problems.html"
} |
ocean, oceanography, tides
There are two different mechanisms to consider: resonance and friction.
The fact that the age of the tide is analogous to the increase of the phase lag of a forced, linearly damped harmonic oscillator as the frequency increases was known since the XIX century. The damped oscillator analogy does not explain the phase magnitudes in the real ocean. | {
"domain": "earthscience.stackexchange",
"id": 921,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ocean, oceanography, tides",
"url": null
} |
programming-challenge, haskell
Why is it important to negate, and not simply unionWith (-)? Because the operation will only take effect if there are elements with the same key in both maps.
Put it all together
So, you've used Data.Map correctly, except for the intersectionWith, which didn't come up because the test cases were borked. Otherwise, everything was fine, except for the things mentioned above.
Here's the code that implements all the suggestions above. Note that type signatures on top-level functions are very recommended:
import Control.Applicative
import Data.Map (Map)
import qualified Data.Map as M
count :: Ord a => [a] -> Map a Int
count xs = M.fromListWith (+) (zip xs (repeat 1))
subtractMap :: (Ord k, Num a) => Map k a -> Map k a -> Map k a
subtractMap a b = unionWith (+) a (fmap negate b)
main :: IO ()
main = do
_ <- getLine -- ignore first line
mss <- (count . words) <$> getLine
lss <- (count . words) <$> getLine | {
"domain": "codereview.stackexchange",
"id": 22864,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "programming-challenge, haskell",
"url": null
} |
terminology, conventions
But that's just in standard Euclidean 3-space. The right-hand rule is an interesting special case, because you use two vectors, and their cross product gives you the correct direction in the only other possible dimension. But there's no cross product in four dimensions. It's true that you can define a cross product in 7 dimensions (see this paper for an awesome explanation of why 3 and 7 are the only dimensions in which this is possible). But in 7 dimensions, your right hand would have to have 7 fingers, and you'd have to have some standard way of pointing each of them, in order. And none of that would work in any other number of dimensions, because there's no such thing as a cross product. Basically, I think the cross product is a silly, redundant way to think about these things. | {
"domain": "physics.stackexchange",
"id": 22682,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "terminology, conventions",
"url": null
} |
c, database, circular-list, embedded
/*
*====================
* Debug Utils
*====================
*/
/****************************************************************
* Function Name : _DebugPrintRegistrationData
* Description :Prints all registered feeds and their details
* Returns : None.
* Params None.
****************************************************************/
void DebugPrintRegistrationData(void) {
int8_t slot; | {
"domain": "codereview.stackexchange",
"id": 40696,
"lm_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, database, circular-list, embedded",
"url": null
} |
differential equations into algebraic equations is the use of Laplace transformation. So the output signal shape is same to input waveform, 5(u(t)-u(t-2)). Khuri [20] used this method for. 2020 pages 1-140. There really isn't all that much to this section. But if we ignore this technicality and allow ourselves a complex change of. The analysis takes place in a Banach space of complex valued, analytic. Also, key properties of complex variable theory that are needed for understanding and inverting these transforms, and to deflne singular integrals that arise in plasma physics, are summarized here. 2 Harmonic functions 7. The s-domain variables, s, and X ( ), are complex. Complex Analysis TI89 App with Step by Step Solutions Solve Complex Analysis questions stepwise using the TI89 Calculator -- CALCULUS MADE EASY -- Step by Step Integration Step by Step Differentiation Step by Step Limits (L'Hopital Rule) Step by Step Differential Equations Step by Step Interval of Convergence Step by Step | {
"domain": "sicituradastra.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9911526446557307,
"lm_q1q2_score": 0.8103410954711836,
"lm_q2_score": 0.8175744673038222,
"openwebmath_perplexity": 895.9355510125647,
"openwebmath_score": 0.7458417415618896,
"tags": null,
"url": "http://sicituradastra.it/vsaj/laplace-equation-complex-analysis.html"
} |
The same rule also works even for the Programmer calculator layout on MS Windows 10 which looks like this:
A B 7 8 9
C D 4 5 6
E F 1 2 3
All valid rectangular shapes, for example, A85C, E25C, 39BF, and so on, being divided by 11 still give an integer result!
Initially I was thinking that it's just somehow tied to picking digits from the triplets and being just another peculiarity of the decimal base and number 11 and started looking this way, but discovering that it works for the hexidecimal base and even with the hex part of the keyboard layout not obeying exactly the pattern of the decimal part layout, I'm lost.
What law is this fun rule based on? | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9838471642306268,
"lm_q1q2_score": 0.8111445304034367,
"lm_q2_score": 0.8244619285331332,
"openwebmath_perplexity": 483.3908982244749,
"openwebmath_score": 0.6681293249130249,
"tags": null,
"url": "https://math.stackexchange.com/questions/2922749/any-rectangular-shape-on-a-calculator-numpad-when-divided-by-11-gives-an-integer/2922762"
} |
signal-analysis, frequency, frequency-response, time-frequency, bode
We see at $\omega =0.2$ the magnitude starts to drop -20 dB/decade, and the phase changes by 90° (going through -45° right at the pole and then approaching -90° as the frequency increases). Similarly once we reach the zero at $\omega = 50$ the magnitude increases +20 dB/decade, which cancels the prior decrease from the pole and the result is a flat magnitude. The phase similarly advances +90° bringing us back to zero phase.
The reason for the given rules for creating the asymptote lines becomes intuitive once the s-plane is well understood. Consider a single zero in the left half plane on the negative real axis at $s=-50$, consistent with the OP's case, and what the numerator for $H(s)$ would look like as a phasor, as we sweep $s$ along the $j\omega$ axis to create the frequency response plot. For this we are omitting any effect of the pole to understand the effect of the zero alone: | {
"domain": "dsp.stackexchange",
"id": 11701,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "signal-analysis, frequency, frequency-response, time-frequency, bode",
"url": null
} |
newtonian-mechanics, rotation
that is rotating with the rigid body. I point this out because in some descriptions of rigid body motion, axes that are attached to and rotating with the rigid body are used. This is not that case. In this case the angular acceleration has to include both the time derivative of the magnitude of the angular velocity, and the time derivative of $\boldsymbol{k}$. | {
"domain": "physics.stackexchange",
"id": 100215,
"lm_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, rotation",
"url": null
} |
orthologues, orthofinder, embl, eggnog, pangenome
eggNOG-mapper : http://eggnog-mapper.embl.de/ There is a known bug between eggNOG-mapper2 and eggNOG6. This is described here:
https://github.com/eggnogdb/eggnog-mapper/issues/428
In your case, I'm not sure on what strategy you are deploying after OrthoFinder, but there's a chance it's not solvable at present and the best place for information is the eggnog GitHub. | {
"domain": "bioinformatics.stackexchange",
"id": 2598,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "orthologues, orthofinder, embl, eggnog, pangenome",
"url": null
} |
quantum-mechanics, symmetry, group-theory
Title: What conserved quantities does a one-dimensional non-symmetric lattice have? When I asked what leads to degeneracy of eigenstates of free particle, the answer was parity. But it appears that even if we consider a lattice with non-symmetric cell, so the potential looks as shown below, we still have Bloch's theorem, with which $E(k)=E(-k)$.
The potential is clearly not invariant under parity inversion, but the two-fold degeneracy is still there. So, there must be something more than just quasimomentum and, in some cases, parity, which lead to degeneracy.
A similar case is when we consider the potential, which has broken symmetry group of $D_4$, which, as I understand, after breaking has symmetry group $C_4$, isomorphic to the symmetry of the above 1D potential: | {
"domain": "physics.stackexchange",
"id": 18863,
"lm_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, symmetry, group-theory",
"url": null
} |
complexity-theory, graphs, weighted-graphs, polynomial-time-reductions
Let's denote an edge $e \in E$ that connects vertex $u$ and $v$ and has weight $w_e$ as $e = (u, v, w_e)$. Let $M = max(|w_e|) + 1$. I was able to solve some of them by using the following reduction: given a graph $G = (V, E)$ construct the graph $G' = (V, E')$ where you construct the set $E'$ as follows: for each edge $e = (u, v, w_e) \in E$ add the edge $e' = (u, v, M - w_e)$ to $E'$. For some of the mentioned problems, the minimization version in graph $G$ is equivalent to the maximization version in graph $G'$.
I was able to solve itens (a), (d) and (e) using this trick. I am not sure if this trick applies to (c), and I think it does not work for (b). | {
"domain": "cs.stackexchange",
"id": 18271,
"lm_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, graphs, weighted-graphs, polynomial-time-reductions",
"url": null
} |
algorithms, binary-trees
C | C C | C
/ \ | / \ \ | /
A B | B A B | B
/ | \
A | A
Consider the following binary tree inversion algorithm (source: LeetCode):
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode() {}
* TreeNode(int val) { this.val = val; }
* TreeNode(int val, TreeNode left, TreeNode right) {
* this.val = val;
* this.left = left;
* this.right = right;
* }
* }
*/
public TreeNode invertTree(TreeNode root) {
if (root == null) return null;
TreeNode tmp = root.left;
root.left = invertTree(root.right);
root.right = invertTree(tmp);
return root;
} | {
"domain": "cs.stackexchange",
"id": 18194,
"lm_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, binary-trees",
"url": null
} |
python, web-scraping, selenium
minimum_requirements = f"[Minimum]\n{minimum}"
if recommended:
recommended_requirements = f"[Recommended]\n{recommended}"
pc_requirements = (
minimum_requirements + "\n\n" + recommended_requirements
)
else:
pc_requirements = minimum_requirements
return SteamGame(
app_id=game_data["steam_appid"],
name=game_data["name"],
platforms=[p for p in Platform if game_data["platforms"][str(p)]],
is_released=not game_data["release_date"]["coming_soon"],
is_free=game_data["is_free"],
price=price,
pc_requirements=pc_requirements,
)
def get_game(session: requests.Session, app_id: str) -> SteamGame:
params = {"appids": app_id}
response = session.get(APP_DETAILS_API, params=params)
response.raise_for_status()
return extract_game_information(response.json()[app_id]["data"]) | {
"domain": "codereview.stackexchange",
"id": 39199,
"lm_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, web-scraping, selenium",
"url": null
} |
Theorem 4
Let $A$ and $B$ be well-ordered sets. Then either $A$ is equivalent to $B$ or one of the sets is of greater power than the other, i.e., the powers of $A$ and $B$ are comparable.
Proof
A definite power corresponds to each ordinal. As ordinals are comparable, so are the corresponding powers.
Well-ordering theorem
Every set can be well-ordered.
Axiom of choice
Given any set $M$ , there is a “choice function” $f$ such that $f(A)$ is an element of $A$ for every nonempty subset $A\subseteq M$ .
Definition 3 Let $M$ be a partially ordered set, and let $A$ be any subset of $M$ such that $a$ and $b$ are comparable for every $a$ , $b\in A$ . Then $A$ is a chain (in $M$ ). A chain $C$ is maximal if there is no other chain $C^{\prime}$ in $M$ containing $C$ as a proper subset.
Definiton 4 An element $a$ of a partially ordered set $M$ is an upper bound of a subset $M^{\prime}\subseteq M$ if $a^{\prime}\leq a$ for every $a^{\prime}\in M^{\prime}$ . | {
"domain": "christianchristiansen.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.992422759404464,
"lm_q1q2_score": 0.8090552810939458,
"lm_q2_score": 0.8152324938410784,
"openwebmath_perplexity": 258.8866947701661,
"openwebmath_score": 0.9702284932136536,
"tags": null,
"url": "https://christianchristiansen.net/introductory-real-analysis/01-set-theory.html"
} |
php, mysql, pdo
/**
* Method for build a string for selected column
* @param array $column
* @return string
*/
private function buildColumn($column){
$length = count($column);
$selectedColumn = "";
foreach($column as $val){
if($length!=1) {
$selectedColumn .= $val.", ";
}
else{
$selectedColumn .= $val;
}
$length--;
}
return $selectedColumn;
} | {
"domain": "codereview.stackexchange",
"id": 743,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, mysql, pdo",
"url": null
} |
algorithms, hash, number-theory
Problem:Each sequence generated from double hash function regarded as 1 of $N^2$, so my question is why at most we can have $N^2$ probe sequences please? For example, in linear hashing where $h(k,i) = (h_1(k) + i) \bmod{N}$ , we can have N probe sequences at most because for each number $i=0,1, \cdots$ we can get a sequence. Similarly, why we get $N^2$ probe sequences in the double form please? Note that $(h_{1}(k))\mod N$ can take $N$ distinct values and $(h_{2}(k))\mod N$ can take $N$ distinct values. To show that the total number of sequences are $N^2$, we will need to show that for some different inputs $k_1$ and $k_2$, if $(h_{1}(k_{1}) \not\equiv h_{1}(k_2) \mod N)$ or $(h_{2}(k_1) \not\equiv h_2(k_2) \mod N)$, then the probing sequences would be different for $k_1$ and $k_2$. Let the sequence generated by $k_1$ is $P_1$ and the sequence generated by $k_2$ is $P_2$. | {
"domain": "cs.stackexchange",
"id": 18882,
"lm_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, hash, number-theory",
"url": null
} |
cr.crypto-security, relativization, advice-and-nonuniformity, search-problem, random-oracles
\right]
\\ \leq \\
\E_{\O}\left[
\Pr_{x\in \{0,1\}^n} [R(x,B^\O(x))]
\right]
\\ = \\
\Pr_{\O, x\in\{0,1\}^n} [R(x,B^\O(x))]
\\ = \\
\Pr_{x\in \{0,1\}^n, \O} [R(x,B^\O(x))]
\\ = \\
\E_{x\in \{0,1\}^n} \left[ \Pr_{\O}[R(x,B^\O(x))] \right]
\\ = \\
\E_{x\in \{0,1\}^n} \left[ \Pr[R(x,S(x))] \right]
\\ = \\
\Pr_{x\in \{0,1\}^n} [R(x,S(x))]
\end{matrix}$$
.
Since $\Pr_{\O} [\O\in \Good] \geq n^{-2}$ infinitely often,
$\Pr_x[R(x,S(x))]$ is not negligible.
Therefore the uniform version holds. The proof critically uses the fact that
there | {
"domain": "cstheory.stackexchange",
"id": 3714,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cr.crypto-security, relativization, advice-and-nonuniformity, search-problem, random-oracles",
"url": null
} |
javascript, css, html5, jquery-ui, to-do-list
// image deletion function
var recycle_icon = "";
function itemDroppedInTodo( $item ) {
var id = $item.attr("id");
moveTask(id, taskStateEnum.NEW_TASK);
updateTaskCounters();
}
function itemDroppedInProgress( $item ) {
$item.fadeOut(function() {
var $list = $( "ul", $inprogress ).length ?
$( "ul", $inprogress ) :
$( "<ul class='todo ui-helper-reset'/>" ).appendTo( $inprogress );
$item.find( "a.ui-icon-inprogress" ).remove();
$item.append( recycle_icon ).appendTo( $list ).fadeIn(function() {
$item
.animate({ width: "48px" })
.find( "img" )
.animate({ height: "36px" });
});
}); | {
"domain": "codereview.stackexchange",
"id": 2330,
"lm_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, css, html5, jquery-ui, to-do-list",
"url": null
} |
haskell, comparative-review, monads
go = for_ is $ \i -> do
p <- processInput i `ifFail` throwError (InvalidFormat i)
collides <- gets $ S.member p -- The variable name tells what this is checking
when collides $ throwError (DuplicateInput p)
modify $ S.insert p | {
"domain": "codereview.stackexchange",
"id": 29774,
"lm_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, comparative-review, monads",
"url": null
} |
ubuntu, ros-fuerte, ubuntu-precise, openni-launch, openni-camera
That is not a bug. It's conflict of boost header files.
The second rated answer by Nikko says
It happens when you compile with headers from a boost version and execute with another boost version. You should check which library of boost is installed for execution, and which you use for compilation.
I do remember having to reinstall some kind of boost package when I first installed fuerte, but I don't remember exactly what I did.
So how exactly would I check which version of the boost library ROS is actually using and which version of headers it's including?
The Makefile for openni_camera just includes some other file ( $(shell rospack find mk)/cmake.mk ) and the CMakeLists.txt just says rosbuild_add_boost_directories()
ORIGINAL POST:
I've recently upgraded to precise + fuerte. Back on natty + electric, my openni driver worked fine with my kinect, but now I'm getting errors when I try to launch it: | {
"domain": "robotics.stackexchange",
"id": 9316,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ubuntu, ros-fuerte, ubuntu-precise, openni-launch, openni-camera",
"url": null
} |
rotational-dynamics, vectors
So, the transformation matrices around axes $\;x_1,x_2,x_3\;$ through angles $\;\theta_1,\theta_2,\theta_3\;$ respectively are
\begin{align}
\mathbb{A}\left(x_1, \theta_1\right)& =
\begin{bmatrix}
\hphantom{-}1 & \hphantom{-}0 & 0 \vphantom{\dfrac12}\\
\hphantom{-}0 & \hphantom{-}\cos\theta_1 & \sin\theta_1\vphantom{\dfrac12}\\
\hphantom{-}0 & -\sin\theta_1 & \cos\theta_1\vphantom{\dfrac12}
\end{bmatrix}
\tag{02.1}\label{eq02.1}\\
\mathbb{A}\left(x_2, \theta_2\right)& =
\begin{bmatrix}
\cos\theta_2 & \hphantom{-}0 & -\sin\theta_2\vphantom{\dfrac12}\\
0 & \hphantom{-}1 & \hphantom{-}0 \vphantom{\dfrac12}\\
\sin\theta_2 & \hphantom{-}0 & \hphantom{-}\cos\theta_2\vphantom{\dfrac12}
\end{bmatrix}
\tag{02.2}\label{eq02.2}\\
\mathbb{A}\left(x_3, \theta_3\right)& =
\begin{bmatrix}
\hphantom{-}\cos\theta_3 & \sin\theta_3 & 0 \hphantom{-} \vphantom{\dfrac12}\\ | {
"domain": "physics.stackexchange",
"id": 50927,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rotational-dynamics, vectors",
"url": null
} |
ros-humble, gazebo-plugin, gazebo-11, 2dlaserscan
I think you could use the angle_min and angle_max with angle_increment in order to know the samples used.
In case you want to know the actual samples in each message (perhaps some laserscans are being skipped by inf values or whatever) I find interesting to use the flag --noarr. This flag omits the arrays and just shows the type of the data as well as the length of the arrays (in this case, check ranges). The use of it would be as simple as:
rostopic echo /<scan_topic> --noarr
Resulting in: | {
"domain": "robotics.stackexchange",
"id": 38988,
"lm_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-humble, gazebo-plugin, gazebo-11, 2dlaserscan",
"url": null
} |
Exercise: Think about how an isomorphism between two extensions gives a coboundary making the two cocycles cohomologous.
Note that one can cook up cocycles for arbitrary finite-dimensional representations; the block structure would just look a bit different. If we examine $\mathrm{Ext}(K,M)$, where $K$ is the trivial one-dimensional representation and $M$ has degree $m$, then an extension will be a representation of $G$ into $(m+1) \times (m+1)$ matrices, with a block of $m$ in the upper left corresponding to $M$. The "upper right" will be a column of length $m$. This makes sense - the target of the mapping out of $G$ should be into $M$. In fact, this is a cocycle for the first group cohomology of $M$. More generally, a cocycle for an element of $\mathrm{Ext}^1(N,M)$ is a map from $G$ into $\mathrm{Hom}_K(N,M)$. This makes sense, for if $N$ has degree $n$, then the upper-right entry should be an $m \times n$ matrix, which should represent an element of $\mathrm{Hom}_K(N,M)$.
- | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9728307661011976,
"lm_q1q2_score": 0.8268781173731811,
"lm_q2_score": 0.8499711832583696,
"openwebmath_perplexity": 184.37520312539903,
"openwebmath_score": 0.9604918360710144,
"tags": null,
"url": "http://math.stackexchange.com/questions/270228/geometric-intuitive-interpretation-of-ext"
} |
performance, php, object-oriented, security, logging
You might find that people would find this method more useful if it were accessible when the class was extended. I.e. if it were protected instead of private.
Efficiency
ob_start();
var_dump($var);
$string = ob_get_clean();
if (is_object($var)) {
$string = explode('{', $string);
return ['val' => '(object) ', 'desc' => rtrim($string[0]) . '.'];
}
unset($string);
This seems weird to me. If $var is not an object, you do an ob_start and ob_get_clean only to immediately throw away the result. Why not reorder to
if (is_object($var)) {
ob_start();
var_dump($var);
return ['val' => '(object) ', 'desc' => rtrim(explode('{', ob_get_clean(), 2)[0]) . '.'];
} | {
"domain": "codereview.stackexchange",
"id": 40732,
"lm_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, php, object-oriented, security, logging",
"url": null
} |
# When is the Frobenius norm of a matrix equal to the 2-norm of a matrix?
What conditions most be true for these two norms to be equal? Or are they always equal?
What conditions most be true for these two norms to be equal? Or are they always equal?
I'm far from being a specialist in this, but it seems to me that "Frobenius norm of a matrix" is just the name given to the 2-norm...
Don
Well, in the applied linear algebra course I'm taking currently, the Frobenius norm of a matrix A is defined as the square root of the trace of A'A and the 2-norm is defined as the square root of the largest eigenvalue of A'A. I'm just not sure if they're always the same.
The Frobenius and 2-norm of a matrix coincide if and only if the matrix has rank 1 (i.e. if and only if the matrix can be represented as A=c r, where r is a row and c is a column). | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9566342012360932,
"lm_q1q2_score": 0.8472253575456058,
"lm_q2_score": 0.8856314738181875,
"openwebmath_perplexity": 235.0284951136759,
"openwebmath_score": 0.9488903880119324,
"tags": null,
"url": "https://www.physicsforums.com/threads/when-is-the-frobenius-norm-of-a-matrix-equal-to-the-2-norm-of-a-matrix.599237/"
} |
Hurkyl
Staff Emeritus
Gold Member
In other words, the very applications that inspired us to bother defining the factorial function require us to set 0!=1 if we want to make the most use of it.
In school they taught us that 0! = 1 because there is only one way to choose nothing, I'm not sure that makes sense when translated to the mathematical idea but 0! = 1 does anyway.
Cyosis
Homework Helper
You could also use the gamma function to show that $\Gamma(1)=1$.
Let A be a set with $n \geq 0$ elements. Then, the number of permutations of elements of A (bijective functions from A to A) is n!; now, if A is the empty set (n = 0), then there is only one permutation, the empty one, so 0! = 1.
I always thought of 0! as being the product of nothing, i.e. the empty product, which is 1.
arildno
Homework Helper
Gold Member
Dearly Missed
If you define (n+1)!=(n+1)*n!, 1!=1, as a function over the integers, then it follows that, by choosing n=0, 1!=1*0!, or 0!=1 if existing. | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9425067179697695,
"lm_q1q2_score": 0.810238856661985,
"lm_q2_score": 0.8596637469145054,
"openwebmath_perplexity": 470.28331030242396,
"openwebmath_score": 0.9144198894500732,
"tags": null,
"url": "https://www.physicsforums.com/threads/factorial-of-0-1.408958/"
} |
context-free, formal-grammars, sets
If $U$ is the set of all grammars then the complement of ACFG is slightly more complicated: it consists of all non-context-free grammars together with all context-free grammars $G$ such that $L(G) \neq \Sigma^*$.
If $G$ is a context-free grammar and $L(G) = \emptyset$ then $G$ certainly belongs to the complement of ACFG1; but other context-free grammars also belong there.
1This actually depends on your definition of grammar and on the value of $\Sigma$. If $\Sigma$ is understood and non-empty then what I wrote is correct; if $\Sigma$ is part of the grammar and is always non-empty, again what I wrote is correct; but if $\Sigma$ could be empty, then $\Sigma^* = \emptyset$, so what I wrote is wrong. | {
"domain": "cs.stackexchange",
"id": 4307,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "context-free, formal-grammars, sets",
"url": null
} |
game, haskell, hangman
hang' state'
[Char] is not quite an appropriate datatype for rights and wrongs. Using [Char] here suggests to me that you care about the order of the Chars in the list and how many times they show up, but in fact you do not. I would recommend Data.Set instead. (This will give you better performance, too!)
getWord can be implemented more simply as clearScreen >> putStrLn "Give a secret word!" >> getLine
win -- sleek implementation of this function!
Unrelated, I would rename it. win sounds like an action, but really the function is a predicate. Perhaps isWin?
As a general rule of thumb, I would try to avoid unqualified imports like import Control.Monad. If you have more than one unqualified import, it can become difficult to know where a function or operator is being imported from.
getWord is missing its type signature, as is pictures. This is not a huge deal, but it's generally recommended to include type signatures on (at least) all top-level values. | {
"domain": "codereview.stackexchange",
"id": 43444,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "game, haskell, hangman",
"url": null
} |
javascript, ecmascript-6, event-handling, dom, animation
<img class="swiper__contents__component" src="../images/photo-joy5.jpg" alt="조이">
<img class="swiper__contents__component" src="../images/photo-joy6.jpg" alt="조이">
<img class="swiper__contents__component" src="../images/photo-joy7.jpg" alt="조이">
</div>
</div>
</div>
</div>
<div class="swiper__title">
<h2>JOY</h2>
</div>
</div>
</section>
</main>
<script src="../js/fullpage.min.js"></script>
<script src="../js/intersection-observer.js"></script>
<script src="../js/default.js"></script>
<script>
</script>
</body>
</html> Styling
Consider using -webkit-text-stroke to make the <h2> text legible even when superimposed on a white image.
Trivial errors
addHoverOnEventToTItle() has improper capitalization. | {
"domain": "codereview.stackexchange",
"id": 35537,
"lm_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, ecmascript-6, event-handling, dom, animation",
"url": null
} |
python, performance, python-2.x, image, multiprocessing
sys.stdout.write("\rCalculating real schedules: {:.2f}% ".format(float(pools.index(pooly))/(len(pools)-1) *100))
for prod in result:
yield tuple(prod)
OUTPUT:
ORIGIONAL:
-> python Schedule.py
Loading classes: Done
Time to create database of every section of every class offered: 4.80000782013
Want the best schedules? n
Are you feeling lucky??? (Do you want to only create one schedule) y
Commandeering your 4 cores...
Thanks for letting me borrow those
Time to calculate and store all possible true schedules: 340.109536171 ***
True Schedules: 1429
Possibilities: 2350080
Time taken to process Schedules: 340.096308947
Random number: 515
Estimated time to load 1 images: 0 minutes and 1.4 seconds
Loading schedules: 100.0%
Estimated time to load 1 images: 0 minutes and 1.4 seconds
Actual time to load 1 images: 0 minutes and 1.23541712761 seconds
Diff = 0.164559030533 seconds
Error in guess = 13.32%
Total run time: 359.528627157 | {
"domain": "codereview.stackexchange",
"id": 26996,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, python-2.x, image, multiprocessing",
"url": null
} |
python
def draw_icons(self, letter: str, loc: Optional[Coordinate]):
# draws start icon
if loc is not None:
text = self.in_square_font.render(letter, True, BLACK)
self.display.blit(text, ((loc.x * BLOCK_SIZE) + BLOCK_SIZE * 0.4,
(loc.y * BLOCK_SIZE) + BLOCK_SIZE * 0.25))
def show(self, grid: Grid):
self.display.fill(WHITE)
self.route_lines(grid)
self.draw_squares(grid)
self.draw_icons('s', grid.start)
self.draw_icons('e', grid.end)
pygame.display.update()
def session(display: Display):
grid = Grid()
display.show(grid) | {
"domain": "codereview.stackexchange",
"id": 41222,
"lm_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",
"url": null
} |
c++, algorithm, programming-challenge, c++14
std::size_t rooms(std::istream &in) {
std::size_t height;
std::size_t width;
std::size_t roomcount{0};
static constexpr char empty{'.'};
in >> height >> width;
if (!in)
return roomcount;
std::vector<std::size_t> tracker(width, 0);
for (auto i{height}; i; --i) {
std::string row;
in >> row;
if (row.size() != width) {
in.setstate(std::ios::failbit);
return roomcount;
}
for (std::size_t j{0}; j < width; ++j) {
if (row[j] == empty) {
// continuation from line above?
if (tracker[j]) {
// also from left?
if (j && tracker[j-1]) {
if (tracker[j-1] < tracker[j]) {
tracker[j] = tracker[j-1];
--roomcount;
} else if (tracker[j] < tracker[j-1]) { | {
"domain": "codereview.stackexchange",
"id": 31361,
"lm_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, programming-challenge, c++14",
"url": null
} |
python, algorithm, python-2.x
edit:
Observing that sum() is faster than elementwise summation I changed the algorithm a bit. Now the majority (here: 50%) of the elements are summed up in one call to sum() and then the exact target value is searched for step by step. Also, I have incorporated @kyrill's comments to remove the restriction for integer values. Still, the assumed property of only positive values is used (see code comments).
Execution time is down to approximately 20% vs. OP's code:
def find_index8(nums):
total = sum(nums) / 2.
n = int(len(nums) * .5) # arbitrary, well-guessed testing index
S = sum(nums[:n])
if S == total:
return True, n-1
elif S < total: # add elementwise
for i, v in enumerate(nums[n:], n):
S += v
if S >= total: # '>' shortcut only if only positive values in array
return S==total, i
return False, -1
else: # subtract elementwise | {
"domain": "codereview.stackexchange",
"id": 25319,
"lm_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, algorithm, python-2.x",
"url": null
} |
to review Algebra II. A y = 4x3 − 3x The leading ter m is 4x3. ... Use the degree of the function, as well as the sign of the leading coefficient to determine the behavior. The degree and the leading coefficient of a polynomial function determine the end behavior of the graph. Describe the end behavior of a polynomial function. The degree and the sign of the leading coefficient (positive or negative) of a polynomial determines the behavior of the ends for the graph. $h\left(x\right)$ cannot be written in this form and is therefore not a polynomial function. The leading term is the term containing that degree, $-4{x}^{3}$. The leading term is the term containing that degree, $-{p}^{3}$; the leading coefficient is the coefficient of that term, $–1$. The first two functions are examples of polynomial functions because they can be written in the form $f\left(x\right)={a}_{n}{x}^{n}+\dots+{a}_{2}{x}^{2}+{a}_{1}x+{a}_{0}$, where the powers are non-negative integers and the coefficients are | {
"domain": "sajonhussain.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9808759632491111,
"lm_q1q2_score": 0.8337162900655254,
"lm_q2_score": 0.8499711699569787,
"openwebmath_perplexity": 354.81365435966796,
"openwebmath_score": 0.5956211686134338,
"tags": null,
"url": "https://sajonhussain.com/chef-a-ulmk/dca021-what-is-the-end-behavior-of-the-polynomial-function%3F"
} |
machine-learning, nlp, recommender-system
An example:
Inputs
(1) Truck
(2) Assortment of lemons, limes, and oranges.
(3) Apples, pears, and oranges.
(4) A tool with broad blade, used for digging.
Outputs
(a) Citrus fruits
(b) Portable telephone that can make and receive calls over a radio frequency.
(c) Fruits traditionally grown in Germany.
(d) Vehicles used for cargo transportation.
(e) Shovel
(f) Motor vehicle used for transportation.
Desired result (numbers are arbitrary, for illustrative purposes)
1 - d (100%), f (75%)
2 - a (95%), c (60%)
3 - c (87%), a (45%)
4 - e (100%) | {
"domain": "datascience.stackexchange",
"id": 8765,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning, nlp, recommender-system",
"url": null
} |
homework-and-exercises, forces, pressure
Title: Is pressure on a dam calculated by F/A or depth×density×$g$? I had a question on a test where a dam was divided into two unequal parts and the question was about the pressure and force.
I supposed that the area of the water in the X section is higher hence the pressure must be lower, but the actual answer is A. Why is that? The greater volume of water that is directly against the section will cancel out with the greater area - hence the two pressures will be the same. | {
"domain": "physics.stackexchange",
"id": 47221,
"lm_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, forces, pressure",
"url": null
} |
python, selenium
try:
pinnacle_away = driver.find_element_by_xpath("//div[a[contains(text(), 'Pinnacle')]]/following::td[3]")
hov_pinnacle_away = ActionChains(driver).move_to_element(pinnacle_away)
hov_pinnacle_away.perform()
pinnacle_away_closing = driver.find_element_by_xpath("//*[@id='tooltiptext']/strong[1]").text
try:
pinnacle_away_opening = driver.find_element_by_xpath("//*[@id='tooltiptext']/strong[2]").text
except (NoSuchElementException, TimeoutException):
pinnacle_away_opening = pinnacle_away_closing
except (NoSuchElementException, TimeoutException):
pinnacle_away = "0000000000"
pinnacle_away_closing = 0.00
pinnacle_away_opening = 0.00
average = "Average" | {
"domain": "codereview.stackexchange",
"id": 39330,
"lm_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, selenium",
"url": null
} |
Well, working backwards, the last of these questions, about the Continuum Hypothesis, is a question in set theory. Hilbert's Tenth Problem is a question about whether there is an algorithm to solve a certain class of problems, so is a question in the theory of computation. The incompleteness theorems arise from a general question about a certain class of formalized theories though we use a result about from computability theory to solve answer the question.
So what you are interested in is (not philosophy) but various branches of mathematical logic. As @symplectomorphic kindly notes, I've put together an annotated Study Guide, recommending various book options in the core branches of mathematical logic. You can find the latest version (along with other book notes) at http://www.logicmatters.net/tyl/ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9546474207360066,
"lm_q1q2_score": 0.8095102352365953,
"lm_q2_score": 0.8479677602988602,
"openwebmath_perplexity": 697.4472118240425,
"openwebmath_score": 0.7635596394538879,
"tags": null,
"url": "http://math.stackexchange.com/questions/918490/where-can-i-learn-about-mathematical-philosophy"
} |
and incenter of a triangle in real world applications and math problems. The perpendicular bisectors of A XYZ intersect at point W, WT = 12, and a. always b. sometimes Circumcenter And Incenter - Displaying top 8 worksheets found for this concept.. is represented by 2c, and. Percent of a number word problems. Incenter of a triangle - formula A point where the internal angle bisectors of a triangle intersect is called the incenter of the triangle. all the angle bisector of traingle always lies inside the triangle, and their point of concurrency that is in center also lies inside the traingle hence option A is answer. Then, as , it follows that and consequently pentagon is cyclic. These three angle bisectors are always concurrent and always meet in the triangle's interior (unlike the orthocenter which may or may not intersect in the interior). The incenter of a triangle is the point a triangle ; meet at a point that is equally distant from the three side ; of the triangle. s. Expert ... | {
"domain": "borgholt.dk",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9653811601648193,
"lm_q1q2_score": 0.8002419044033211,
"lm_q2_score": 0.8289388040954683,
"openwebmath_perplexity": 802.1776328903862,
"openwebmath_score": 0.5100769400596619,
"tags": null,
"url": "https://www.borgholt.dk/bbc-salaries-ooi/9c035b-incenter-of-a-triangle-problems"
} |
java, hash-map
private void resize() throws Exception {
try {
if(this.size / (double)this.table.length > this.loadFactor) {
int newSize = this.table.length * this.resizeFactor;
while(newSize % 2 == 0 || newSize % 3 == 0) { // find > double current size prime number for new table size.
newSize++;
}
SinglyLinkedList<ListNode<Entry<K, V>>> oldEntries = new SinglyLinkedList(); // store current data to be rehashed later.
for(int i = 0; i < this.table.length; i++) {
if(this.table[i].getData() != null) {
oldEntries.insertEnd(this.table[i]);
}
}
this.table = new ListNode[newSize];
for(int i = 0; i < this.table.length; i++) {
this.table[i] = new ListNode();
} | {
"domain": "codereview.stackexchange",
"id": 29205,
"lm_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, hash-map",
"url": null
} |
neural-network, matlab, mnist
for dataSet = 1:N
% Get inputs of current data set
input = inputs(dataSet,:); % row vector
% Calculate activations of hidden nodes and the output
Z1 = trainedWeights1*input'; % column vector
hiddenActivation = ReLU(Z1); % column vector
Z2 = trainedWeights2*hiddenActivation; % column vector
output = sigmoid(Z2)'; % row vector
% Calculate the error/cost of the current weights
correctOutput = outputs(dataSet,:); % row vector
cost = sum((output - correctOutput).^2);
% Update Weights
trainedWeights2 = trainedWeights2 - alpha * 2*(output'-correctOutput') .* hiddenActivation' .* dsigmoid(Z2);
S = sum(2*(output'-correctOutput') .* trainedWeights2 .* dsigmoid(Z2),1);
trainedWeights1 = trainedWeights1 - alpha * S' .* input .* dReLU(Z1);
% Display status
if mod(dataSet, 1000) == 0
fprintf('Data set %.0fk/%.0fk complete!\n',dataSet/1000,N/1000);
end
end | {
"domain": "datascience.stackexchange",
"id": 8786,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neural-network, matlab, mnist",
"url": null
} |
# Find the least next N-digit number with the same sum of digits.
Given a number of N-digits A, I want to find the next least N-digit number B having the same sum of digits as A, if such a number exists. The original number A can start with a 0. For ex: A-> 111 then B-> 120, A->09999 B-> 18999, A->999 then B-> doesn't exist.
You get the required number by adding $9$, $90$, $900$ etc to $A$, depending on the digits of $A$.
First Case If $A$ does not end in a row of $9$s find the first (starting at the units end) non-zero digit. Write a $9$ under that digit and $0$s under all digits to the right of it. Add the two and you get $B$.
Example: $A=3450$. The first non-zero digit is the 5 so we write a $9$ under that and a $0$ to its right and add:
\begin{align} 3450\\ 90\\ \hline 3540 \end{align} | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9773708019443872,
"lm_q1q2_score": 0.8035836498481971,
"lm_q2_score": 0.8221891305219504,
"openwebmath_perplexity": 355.86713815877033,
"openwebmath_score": 0.6967836618423462,
"tags": null,
"url": "https://math.stackexchange.com/questions/424480/find-the-least-next-n-digit-number-with-the-same-sum-of-digits"
} |
javascript, node.js, rxjs
findInviteById(id) {
return Observable.defer(() => {
return Observable.fromPromise(this.models.Invite.findOne({
where: { inviteId: id }
}));
});
}
findUserById(email) {
return Observable.defer(() => {
return Observable.fromPromise(this.models.User.findOne({
where: { email: email }
}));
});
}
authenticateInvite(token) {
let payload = jwt.verify(token, appConfig.SESSION_SECRET);
return this.findInviteById(payload.inviteId)
.map(_invite => _invite ? _invite : Observable.of('Invalid Invite ID'))
.mergeMap(_invite => _invite._isScalar ? _invite : this.findUserById(payload.email));
}
}
module.exports = InviteService;
Are there any down sides to using RxJS on the backend
The way I see it, you get 2 benefits from RxJS
Reactivity
Streaming operations | {
"domain": "codereview.stackexchange",
"id": 29452,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, node.js, rxjs",
"url": null
} |
java, beginner, comparative-review
public void v12(){
Scanner usrinp12 = new Scanner(System.in);
System.out.print("Enter 12th Voters Name: ");
v12 = usrinp12.nextLine();
System.out.println("Choose your Vote: " + "1." + (a) + " 2." + (b) + " 3." + (c));
Scanner in12 = new Scanner(System.in);
String c12;
c12 = in12.next();
if (c12.equals("1")){
r34++;
va++;
v13();
}
else if (c12.equals("2")){
r35++;
vb++;
v13();
}
else if (c12.equals("3")){
r36++;
vc++;
v13();
}
else{
System.out.println("Please enter numbers 1, 2, & 3");
v12();
}
in12.close();
} | {
"domain": "codereview.stackexchange",
"id": 23680,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, beginner, comparative-review",
"url": null
} |
parsing, f#
Also, (fun x -> x) could be simply replaced by id.
let pheader = anyString 3 |>> id
On other matters, there is a potential bug in your code : in your pRepsOrField function, you're matching field.Length with 0 then extracting the first item, which will crash your code. Using the Length property to find out the length is .. unusual. You don't even need it. Pattern matching with lists based on length in F# is usually done this way:
match fields with
| [] -> // do something
| [ c ] -> SingleField { components = c; position = 0 }
| _ -> Repetitions(List.mapi (fun i c -> { components = c; position = i }) fields))
Now you don't have to use extra methods/properties to get the length and and the first item. It is all right there ... | {
"domain": "codereview.stackexchange",
"id": 22043,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "parsing, f#",
"url": null
} |
harmonic-oscillator, frequency, resonance, coupled-oscillators
In a typical driven damped oscillator, the resonance frequency fits the above definition as the frequency of the driving force that produces the maximum amplitude, but this definition does not quite apply to undamped oscillators. For a damped oscillator, the amplitude response is
$$
\alpha(\omega) \sim \left(\frac{\omega_0^2}{(\omega_0^2 - \omega^2)^2 + \gamma^2\omega^2}\right)^{1/2} \>.
$$
Here $\omega_0$ is the natural frequency of the system, $\omega$ is the driving frequency, $\gamma$ is the damping factor. This expression achieves maximum at $\omega = \sqrt{\omega_0^2 - \gamma^2/2}$. If we were to directly set $\gamma$ to zero, however we see that the amplitude response blows up to infinity at $\omega_0$, and indeed this is what we observed in the coupled system as well. What happens then? Well as it turns out, since there is no damping, the system does not dissipate energy, so at the resonant frequency the amplitude just keeps growing. This is confirmed by the above calculation. | {
"domain": "physics.stackexchange",
"id": 35615,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "harmonic-oscillator, frequency, resonance, coupled-oscillators",
"url": null
} |
1954 ) general ideas to a. Establishing the inductive step < m '', or during your interview:... Doubling it proof of P (. conclusion must be true if the premise is true, the... Proves something about that number 's predecessor 501 ( c ) ( 3 nonprofit... The special cases of the counting numbers is well-founded, which includes the set of cardinal numbers is well-founded which..., does not yield reliable conclusions, but can get your logical rolling. Would correspond to a log-n-step loop called inductive reasoning questions include matrices, shape. Patterns you observe.The conclusion you reach is called a conjecture idea and reaches a specific conclusion on reasoning. Of reasoning we have just described is calledinductive reasoning sweeping general conclusions )! N+1 is in S, thus being a minimal element in S, thus being minimal! | {
"domain": "lifemeup.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9449947086083138,
"lm_q1q2_score": 0.8176321715854626,
"lm_q2_score": 0.865224073888819,
"openwebmath_perplexity": 1371.74077097625,
"openwebmath_score": 0.7747422456741333,
"tags": null,
"url": "http://lifemeup.org/dixit-origins-azv/archive.php?a2b00e=inductive-reasoning-math-examples"
} |
neural-network, deep-learning, tensorflow, recommender-system
The wide component consists
of the cross-product transformation of user installed apps
and impression apps
Each example
corresponds to one impression
Let's say we have 5 apps, A through E. My understanding is that the cross-product transformation would represent that as 20 columns, representing each possible combination of installed and impressed app (making 25, but then presumably the 5 "matching" cross-products like and(installed=App_A, impressed=App_A) would be removed because presumably Google is smart enough not to impress Apps the user already has). Let's also say we have 3 Users, called X - Z. X has installed apps A and C, and is shown app B and D. Y has installed App B and is shown A and E. Z has installed apps A, C and D and is shown apps B and E. With that dataset, the cross-product transformation should look (I think) like this: | {
"domain": "datascience.stackexchange",
"id": 5993,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neural-network, deep-learning, tensorflow, recommender-system",
"url": null
} |
ros, ros-kinetic, roscpp, message-filters
In member function ‘void A::init(const message_filters::Synchronizer >, sensor_msgs::Image_ > > >&)’:
/home/mango/workspace/cyngn_ros/src/lev-ros/lev_localization/src/message_test.cpp:26:69: error: no matching function for call to ‘message_filters::Synchronizer >, sensor_msgs::Image_ > > >::registerCallback(boost::_bi::bind_t > >&, const boost::shared_ptr > >&>, boost::_bi::list3, boost::arg, boost::arg > >) const’
sync.registerCallback(boost::bind(&A::my_callback, this, _1, _2));
/opt/ros/kinetic/include/message_filters/synchronizer.h:302:14: note: candidate: message_filters::Connection message_filters::Synchronizer::registerCallback(C&) [with C = boost::_bi::bind_t > >&, const boost::shared_ptr > >&>, boost::_bi::list3, boost::arg, boost::arg > >; Policy = message_filters::sync_policies::ApproximateTime >, sensor_msgs::Image_ > >]
Connection registerCallback(C& callback) | {
"domain": "robotics.stackexchange",
"id": 30259,
"lm_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, roscpp, message-filters",
"url": null
} |
python, library, libgdx
if ARCHIVE == None:
print "checking latest nightly..."
mtime = get_remote_archive_mtime()
print "lastest nightly from server: %s" % mtime
if not FORCE:
answer = confirm("replace local libraries with files from latest nightly?(Y/n): ")
if answer not in YES:
fatal_error("USER QUIT")
libgdx = download_libgdx_zip()
else:
if not os.path.exists(ARCHIVE):
fatal_error("archive file not found: %s" % ARCHIVE)
if not FORCE:
answer = confirm("replace local libraries with files from '%s'?(Y/n): " % os.path.basename(ARCHIVE))
if answer not in YES:
fatal_error("USER QUIT")
libgdx = open(ARCHIVE, "r") | {
"domain": "codereview.stackexchange",
"id": 4022,
"lm_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, library, libgdx",
"url": null
} |
newtonian-mechanics, classical-mechanics, gravity, conservation-laws
$$ v_o = \sqrt\frac{GM(R+2h)}{R(R+h)} $$
$$ v_f = \sqrt\frac{GM}{R+h} $$
$$ \theta = \sin^{-1} \Biggl( \frac{1+\frac{h}{R}}{\sqrt{1+\frac{2h}{R}}} \Biggr) $$
However, it is observed that for $\theta$, the argument of $\sin^{-1}$ is always greater than or equal to one, being one only if $h$ is zero. The proof may be carried out by initially assuming that the argument of $\sin^{-1}$ is less than or equal to one for $h$ greater than or equal to $0$, and solving the inequality will yield that $h$ must be less than or equal to zero. So the only acceptable solution is for $h$ to be zero. This just winds up being the case of throwing the ball with sufficient speed tangentially on the surface of Earth so that it keeps orbiting on the Earth's surface itself. Thus, there is no possible way to just throw a ball so that it ends up in a circular orbit of certain desired radius. | {
"domain": "physics.stackexchange",
"id": 56728,
"lm_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, classical-mechanics, gravity, conservation-laws",
"url": null
} |
newtonian-gravity, astrophysics, galaxies, many-body, tidal-effect
To understand the development of tidal tails, one must recall how the water surface of the oceans get stretched radially by differential gravitational attraction exerted on it by our Moon. The differential forces between near and far side of the Earth depend on the third power of the Moon’s distance from Earth. That is why the oceans tides are rather mild. When two galaxies experience a close encounter with perigalactic distance is compared with galaxies’ sizes, the tidal field of one galaxy stretches its neighbour radially and then the galaxies’ rotation shears off stars and gaseous clouds from outskirts of their parent galaxies. As a result, stars on the far side of each disk is ejected into long and thin tails.
You wrote
Also, are tidal tails in the same plane as the spin of the disc galaxy? | {
"domain": "physics.stackexchange",
"id": 20761,
"lm_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-gravity, astrophysics, galaxies, many-body, tidal-effect",
"url": null
} |
ros, ur-driver
Title: "error: ‘__s_getServerMD5Sum’ is not a member of" when adding a service to an existing class
TL;DR
Trying to add two new services to a class definition but we are getting and error saying __s_getServerMD5Sum is not a member of each of them. Our new services are implemented exactly as all of the existing services.
Details
We are implementing a ur_modern_driver node from: github.com/ThomasTimm/ur_modern_driver
Our classes are being added to ur_ros_wrapper.cpp. With an unmodified installation of this node everything compiles and runs as expected. However, we need to add additional services to the RosWrapper class to provide control of the robots free drive mode.
The two new services are called enterFreeDriveMode and exitFreeDriveMode.
As far as we can tell we have implemented our new services correctly. In short our service implementation looks like this:
//create the service servers
ros::ServiceServer enterFreeDriveMode_srv_;
ros::ServiceServer exitFreeDriveMode_srv_; | {
"domain": "robotics.stackexchange",
"id": 29274,
"lm_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, ur-driver",
"url": null
} |
special-relativity, relativity, time-dilation
But the train is moving, and so the ground observer sees that the first beam reaches the person in the middle of the wagon before the second.
Now consider the train observer. Because we have already presupposed that the two flashes happen simultaneously at the ground reference frame, by the relativity of simultaneity they happen one by one in the train frame. So despite the fact that the light still approaches the observer with the same speed from both sides, the train observer does see them consequently simply because they do happen consequently, and the ground observer is not mistaken.
The same thing happens if we suppose that both flashes happen simultaneously in the train reference system, but in this case you have to exchange the two observers.
Thus Special Relativity triumphs once again to survive another day until another young enthusiast questions its self-consistency :) | {
"domain": "physics.stackexchange",
"id": 33773,
"lm_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, time-dilation",
"url": null
} |
electromagnetism, electricity, magnetic-fields, electric-circuits, electromagnetic-induction
Title: What is total magnetic flux through a coil? According to Gauss's law of magnetism, the total magnetic flux through a closed surface is zero. But during induction, we study that the magnetic field lines passing through a coil change, as does flux given by $\Phi = LI$. But even if they change, the net lines coming in= net lines going out. So, flux should be zero? According to Gauss' Law, the "net" magnetic flux is zero for a closed surface because magnetic monopoles don't exist but by writing $\Phi=LI$, we measure the outflux/influx produced by the single pole but though the "net" flux here also is zero. | {
"domain": "physics.stackexchange",
"id": 40917,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, electricity, magnetic-fields, electric-circuits, electromagnetic-induction",
"url": null
} |
electrostatics, electric-fields, capacitance, gauss-law
The usual way you'd show that the electric field outside an infinite parallel-plate capacitor is zero, is by using the fact (derived using Gauss's law) that the electric field above an infinite plate, lying in the $xy$-plane for example, is given by
$$
\vec{E}_1=\frac{\sigma}{2\epsilon_0}\hat{k}
$$
where $\sigma$ is the surface charge density of the plate. If you now put another plate with opposite charge, i.e. opposite $\sigma$, some distance below or above the first one, then that contributes its own electric field,
$$
\vec{E}_2=-\frac{\sigma}{2\epsilon_0}\hat{k}
$$
in the region above it. Since the electric field obeys the principle of superposition, the net electric field above both plates is zero. The same happens below both plates, while between the plates the electric field is constant and nonzero. | {
"domain": "physics.stackexchange",
"id": 50187,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrostatics, electric-fields, capacitance, gauss-law",
"url": null
} |
quantum-mechanics, waves, wavefunction, wavelength, semiclassical
The eigenvalues enter the game because one search for a solution $$u=u(t,x),\quad \psi =\psi(t,x)$$ which is a linear combination of eigenvectors of the Laplacian or its square root and the coefficients of the combination are function of time to be determined.
Let us consider the two cases with a simplified choice of the constants for the sake of simplicity: $m=0$, $v=1$ (D'Alemebert equation) and $V=0$, $\hbar =1$, $2m =1$ (in the Schroedinger equation) and assume that we have constructed a basis of (time independent) eigenfunctions, respectively, $$(\sqrt{-\Delta} u_n)(x) = \sqrt{-E_n} u_n(x)\tag{3}$$ or $$-(\Delta\psi_n)(x) = E_n \psi(x)\tag{4}\:,$$
where boundary conditions have been taken into account.
Observe that, since we used the same boundary conditions we can assume
$$u_n(x) = \psi_n(x)$$
but I use a different notation just to distinguish between the two equations.
The solution of the corresponding time dependent equation can be decomposed as a liner combination | {
"domain": "physics.stackexchange",
"id": 60063,
"lm_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, waves, wavefunction, wavelength, semiclassical",
"url": null
} |
# Near-integer solutions to $y=x(1+2\sqrt{2})$ given by sequence - why?
EDIT: I've asked the same basic question in its more progressed state. If that one gets answered, I'll probably accept the answer given below (although I'm uncertain of whether or not this is the community standard; if you know, please let me know).
I've found a sequence $x_{i+1}=\|x_i(2+k)\|$, where $k=1+2\sqrt{2}$ and where $||a||$ rounds $a$ to the nearest integer, that seems to minimize the distance $P_n$ to an integer solution (for $x$ and $y$) of the equation in the title. $P_n$ is more rigorously defined as the absolute value of $\|y_n\|-y_n$, where $y_n=nk$ for $n \in \mathbb{N}$.
Starting with $x_0=1$ the sequence becomes $x_1=\|2+k\|=\|5.83\ldots\|=6,x_2=\|6(2+k)\|=\|34.97\ldots\|=35,204,1189,6930,\ldots$ where $P_i$ very quickly becomes small. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9736446532718787,
"lm_q1q2_score": 0.8424208035750531,
"lm_q2_score": 0.865224084314688,
"openwebmath_perplexity": 303.45466866642863,
"openwebmath_score": 0.6093716621398926,
"tags": null,
"url": "https://math.stackexchange.com/questions/1598893/near-integer-solutions-to-y-x12-sqrt2-given-by-sequence-why"
} |
java, performance, array, vectors
/**
* Converts an index for this {@code IntArrayList} to the
* corresponding index for the internal array. This method
* assumes that the passed index is valid. If it is not,
* the returned index might not be valid as well.
*
* @param publicIndex A valid index for this {@code IntArrayList}
* @return the index pointing to the corresponding element in the internal array
*/
private int internalArrayIndex(int publicIndex) {
int internalArrayIndex = publicIndex + indexOfFirstElement;
if (internalArrayIndex < 0 || internalArrayIndex >= data.length) {
internalArrayIndex -= data.length;
}
return internalArrayIndex;
}
public void add(final int value) {
add(size, value);
}
public void add(final int index, final int value) {
if (index > size || index < 0) {
throw new IndexOutOfBoundsException(index);
} | {
"domain": "codereview.stackexchange",
"id": 30644,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, performance, array, vectors",
"url": null
} |
inorganic-chemistry
Maybe the best example for this is the mentioned $\ce{{}^{-}CN}$ and obviously the isoelectronic $\ce{CO}$. But there are many more molecules.
In the MO point of view the electron pair which can be donated to an acceptor orbital is of course the highest occupied molecular orbital (HOMO). Often this comes with the more trivial notation of "lone pair", based on the coefficients of a certain element in that orbital (percentage contribution). In the case of $\ce{CO}$ this becomes fairly obvious, but since this is not the question at hand I will only focus on the isoelectronic counterpart. | {
"domain": "chemistry.stackexchange",
"id": 2049,
"lm_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",
"url": null
} |
For the first part, the boundary $\partial C$ is covered by a countable collection of open rectangles $U_j$ that contain points both in $\text{int} \, C$ and $\text{ext} \, C$ (since every open rectangle containing a boundary point must have this property) such that $\sum_j v(U_j) < \epsilon$. Since $\partial C$ is compact, there is a finite subcover by closed rectangles $\{\bar{U}_\omega\}_{\omega \in \Omega}$, where each closed rectangle contains both points in $\text{int} \, C$ and $\text{ext} \, C$. Proceed from here.
• I don't understand this sentence. "If not x belongs to the interior of a union of rectangles in σ2 and there is a subrectangle containing x that contains no points in extC." didn't you just establish that $x$ lies on the boundary of a rectangle of the partition? could you please elaborate/clarify this point – peek-a-boo Jul 10 '18 at 0:45 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9835969636371976,
"lm_q1q2_score": 0.8259597887554944,
"lm_q2_score": 0.8397339756938818,
"openwebmath_perplexity": 80.32659053662711,
"openwebmath_score": 0.8793114423751831,
"tags": null,
"url": "https://math.stackexchange.com/questions/2843514/spivak-calculus-on-manifolds-problem-3-21-help-with-details-of-proof"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.