text stringlengths 49 10.4k | source dict |
|---|---|
java, algorithm, homework, hash-map
String printSuggestions(String input) {
StringBuilder sb = new StringBuilder();
ArrayList<String> print = makeSuggestions(input);
if (print.size() == 0) {
return "and I have no idea what word you could mean.\n";
}
sb.append("perhap... | {
"domain": "codereview.stackexchange",
"id": 24238,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, algorithm, homework, hash-map",
"url": null
} |
complexity-theory, context-free, formal-grammars
If a nonterminal has an in-arc with a capacity $k$, add an arc from the nonterminal to each of its productions with capacity $k$. If a production has an in-arc with capacity $k$ and it has an out-arc to $n$ nonterminals, add an arc with capacity $\frac k n$ from the pro... | {
"domain": "cs.stackexchange",
"id": 3078,
"lm_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, context-free, formal-grammars",
"url": null
} |
linear-regression, numpy
Title: Linear regression compute theta I'm trying to compute the theta for a regression linear exercice.
x = x * 1.0
y = y * 1.0
# add ones
X = np.ones((201, 2))
X[:, 1] = x
# convert to matrix
Y = y[:,np.newaxis]
# compute teta
p1 = (X.dot(X.T))**-1
p2 = (X.T).dot(Y)
theta = p1.dot(p2)
T... | {
"domain": "datascience.stackexchange",
"id": 6169,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "linear-regression, numpy",
"url": null
} |
python, object-oriented
root.config(bg = py_frame_color)
root.columnconfigure(0, weight = 0)
root.columnconfigure(1, weight = 1)
root.rowconfigure(0, weight = 0)
root.rowconfigure(1, weight = 1)
#root.rowconfigure(2, weight = 1)
#~~~~~~~~~~~~~~~~~~~< Windows stuff >~~~~~~~~~~~~~~~~~~~~~~~~~~~~
row0label = Label(root)
... | {
"domain": "codereview.stackexchange",
"id": 25983,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, object-oriented",
"url": null
} |
created a “Geometric Sequence”, a sequence of numbers in which the ratio of every two successive terms is the same. Concept 16 Arithmetic & Geometric Sequences Concept 16: Arithmetic & Geometric Sequences Assessment (Level 4 Example Question Level 3 Example Question Level 2 Example Question Write an equation for this g... | {
"domain": "givelife.ph",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9865717468373085,
"lm_q1q2_score": 0.8443585556551937,
"lm_q2_score": 0.8558511414521922,
"openwebmath_perplexity": 333.5769276148712,
"openwebmath_score": 0.7515195608139038,
"tags": nu... |
c, virtual-machine
/* write a core dump of memory and registers into stdout */
void simpletron_dump(struct Simpletron *s) {
fprintf(stderr, "\nREGISTERS:\n"
"accumulator %+05d\n"
"instruction pointer +%04lu\n",
s->acc, s->pc);
fprintf(stderr, "\nMEMORY:\n ");
con... | {
"domain": "codereview.stackexchange",
"id": 37734,
"lm_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, virtual-machine",
"url": null
} |
python, beginner, classes
"""Search the wiki for titles"""
def search(self, searchString):
results = []
if (searchString != u""):
encoded_searchString = searchString
if isinstance(encoded_searchString, unicode):
encoded_searchString = searchString.encode('utf... | {
"domain": "codereview.stackexchange",
"id": 2590,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, beginner, classes",
"url": null
} |
html, css, html5
17:42:43.970 ReferenceError: reference to undefined property o.resize snippet-javascript.en.js:1:4720
17:42:52.120 ReferenceError: reference to undefined property a[h] jquery.min.js:2:21903
17:43:09.049 The connection to wss://qa.sockets.stackexchange.com/ was interrupted while the page was loading. f... | {
"domain": "codereview.stackexchange",
"id": 12714,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "html, css, html5",
"url": null
} |
general-relativity, gravity, visible-light, stress-energy-momentum-tensor
Title: Converging light Imagine that we emit a light pulse. As is the nature of light, it will expand. However, light is affected by gravitational fields and light has its own. Therefore, will the light converge given infinite time and infinite ... | {
"domain": "physics.stackexchange",
"id": 21752,
"lm_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, stress-energy-momentum-tensor",
"url... |
quantum-field-theory, conventions, time-evolution, s-matrix-theory
in which there is a $+$ sign in the exponential. What have I done wrong? The 'in' and 'out' states are the (asymptotically free) initial and final states of particals interacting at $t=t_0$:
$$|k_1k_2...\rangle_{in/out}=|k_1k_2...(t=\pm\infty)\rangle_{... | {
"domain": "physics.stackexchange",
"id": 74370,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, conventions, time-evolution, s-matrix-theory",
"url": null... |
optics, laser, geometric-optics
Title: Frequency "changed" on changing the medium I have been taught in my school (and read on many internet sites too) that frequency of light doesn't change by changing the medium.
Also I read that the colour we see depends on the energy of the photons (which depends on the frequency ... | {
"domain": "physics.stackexchange",
"id": 79667,
"lm_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, laser, geometric-optics",
"url": null
} |
python, units, astropy
or
angular_momentum(1*u.Msun, 3*u.Mearth, 0.1*u.au).decompose() #why?
$$3.0900743 \times 10^{43} \mathrm{\frac{kg^2 \,m^{1/2}}{A^{1/2}\,s}} \qquad \mathrm{(output)}$$
this looks like * u.au is not working as expected. Anyways, passing units, e.g., in u.m does not fix the issue.
Question: anyone... | {
"domain": "astronomy.stackexchange",
"id": 5915,
"lm_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, units, astropy",
"url": null
} |
speech-recognition, feature-extraction
Title: Fast Vocal Tract Length Normalization(VTLN) implementation? My team is building a speech recognition model. As far as I know, Vocal Tract Length Normalization (VTLN) is an effective warping method that may help improve the model performance by diminishing spectral variance... | {
"domain": "dsp.stackexchange",
"id": 7581,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "speech-recognition, feature-extraction",
"url": null
} |
ros, opencv, images
image_converter.cpp:(.text._ZN14ImageConverterC2Ev[_ZN14ImageConverterC5Ev]+0x841): undefined reference to `cv::String::allocate(unsigned long)'
image_converter.cpp:(.text._ZN14ImageConverterC2Ev[_ZN14ImageConverterC5Ev]+0xab3): undefined reference to `ros::NodeHandle::~NodeHandle()'
image_converte... | {
"domain": "robotics.stackexchange",
"id": 26503,
"lm_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, opencv, images",
"url": null
} |
genetics, molecular-biology, dna, methods, restriction-enzymes
Of course this is not Sherlock Holmes’ “all that remains”, as I am mindful of Shakespeare’s:
“There are more things in heaven and earth, Horatio,
than are dreamt of in your philosophy.”
[Hamlet]
Concluding suggestion
I would respectfully suggest that quest... | {
"domain": "biology.stackexchange",
"id": 12442,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "genetics, molecular-biology, dna, methods, restriction-enzymes",
"url": null
} |
error-correction, resource-request, surface-code
Then:
$\partial R = \partial E \rightarrow$ The syndromes are now "fixed".
$|R+E| \leq d-1$: the net operation cannot be a logical operation.
1+2 imply that the net effect is then a product of stabilizer: the data is preserved.
Where I struggle: we assume that the syn... | {
"domain": "quantumcomputing.stackexchange",
"id": 3491,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "error-correction, resource-request, surface-code",
"url": null
} |
python, python-2.x, web-services, mongodb, bottle
return bottle.template('files_test/home', files=list(result))
@bottle.route('/add')
def add_page():
return bottle.template('files_test/add')
@bottle.route('/upload', method='POST')
def do_upload():
data = request.files.data
if data:
raw = data.fil... | {
"domain": "codereview.stackexchange",
"id": 6193,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-2.x, web-services, mongodb, bottle",
"url": null
} |
As an alternative we can change variable by $$y=-x\to \infty$$ to obtain
$$\lim_{x\to -\infty} \frac{\sqrt{4x^2+3}}{3x+2}= \lim_{y\to \infty} \frac{\sqrt{4y^2+3}}{-3y+2}$$
which leads to the same result.
Edit
For the method proposed “dividing by x” the full steps should be as follow
$$\frac{\sqrt{4x^2+3}}{3x+2}= \... | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9449947117065458,
"lm_q1q2_score": 0.829210919273822,
"lm_q2_score": 0.8774767826757122,
"openwebmath_perplexity": 191.69753832755134,
"openwebmath_score": 0.9017255306243896,
"tag... |
A high kurtosis distribution has a sharper peak and longer fatter tails, while a low kurtosis distribution has a more rounded pean and shorter thinner tails. The first thing you usually notice about a distribution’s shape is whether it has one mode (peak) or more than one. This is surely going to modify the shape of th... | {
"domain": "co.uk",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9755769071055402,
"lm_q1q2_score": 0.8458600598699413,
"lm_q2_score": 0.8670357546485407,
"openwebmath_perplexity": 1588.102579416934,
"openwebmath_score": 0.6825377941131592,
"tags": null,
... |
c++, ros-melodic
^~~~~~~~~~~~~~~~
/opt/ros/melodic/include/ros/node_handle.h:970:17: note: template argument deduction/substitution failed:
/home/alex/Code/ovis_ws/src/jog_control/jog_controller/src/twist_to_jog_frame.cpp:176:158: note: candidate expects 3 arguments, 2 provided
ros::ServiceServer srv = nh.adver... | {
"domain": "robotics.stackexchange",
"id": 34566,
"lm_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++, ros-melodic",
"url": null
} |
rosjava, android
Installed necessary ros-indigo dependencies
sudo apt-get install ros-indigo-ros-java-build-tools
sudo apt-get install ros-indigo-warehouse-ros
Build android_core library source with modified code
mkdir -p ~/android
wstool init -j4 ~/android/src https://raw.githubusercontent.com/stratomda/rosjava/indi... | {
"domain": "robotics.stackexchange",
"id": 23879,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rosjava, android",
"url": null
} |
design, quadcopter
Title: Most material efficient quadcopter frame I haven't made or flown any quadcopter, but I am fascinated by them.
But when looking at the frame of a lot of designs, after whachting this video I wondered why a lot the frames are in an X shape. Since the most efficient shape would according to the ... | {
"domain": "robotics.stackexchange",
"id": 185,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "design, quadcopter",
"url": null
} |
image-processing, anisotropic-diffusion
Title: Why is anisotropic diffusion useful in image processing? I am working on anisotropic diffusion and the two coefficients proposed by Perona & Malik.
I wanted to know what is the use of diffusion in image processing? Why is anisotropic diffusion important and in which field... | {
"domain": "dsp.stackexchange",
"id": 122,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "image-processing, anisotropic-diffusion",
"url": null
} |
# Laplace equation with mixed boundary conditions
I try to solve Laplace equation in 2D on square [2,3]x[2,3], with mixed boundary conditions, I did:
ClearAll[y, x1, x2];
pde = Laplacian[y[x1, x2], {x1, x2}];
bc = {y[x1, 2] == 2 + x1, y[x1, 3] == 3 + x1};
sol = NDSolve[{pde ==
NeumannValue[-1, x1 == 2] + NeumannValue... | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9615338101862455,
"lm_q1q2_score": 0.8603703179118266,
"lm_q2_score": 0.8947894590884704,
"openwebmath_perplexity": 2496.7887469288025,
"openwebmath_score": 0.4856671988964081,
"ta... |
ros, ros-groovy, dependencies
The following packages have unmet dependencies:
ros-groovy-desktop-full : Depends: ros-groovy-ros-tutorials (= 0.3.9-0quantal-20121230-1232-+0000) but it is not going to be installed
Depends: ros-groovy-nodelet-core (= 1.7.13-0quantal-20121230-1911-+0000) but i... | {
"domain": "robotics.stackexchange",
"id": 12239,
"lm_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-groovy, dependencies",
"url": null
} |
electrical-engineering, standards, specifications
Title: Industry standard for AC wall electrical box space Are there any industry standards (Engineering Specifications) for the minimum / maximum space required for the electrical box that holds a regular AC wall plug?
The problem I am trying to solve is quite simple ... | {
"domain": "engineering.stackexchange",
"id": 155,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrical-engineering, standards, specifications",
"url": null
} |
complexity-theory, np-hard, permutations
Title: How hard is this constrained $n$-rooks problem? I asked this over on math.stackexchange.com, then I found out about this forum.
Suppose you have an $(n\times n)$-chessboard, together with a constraining function $C : n \times n \to 2$ where $C(i,j) = 1$ iff you're allowe... | {
"domain": "cs.stackexchange",
"id": 3090,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "complexity-theory, np-hard, permutations",
"url": null
} |
kinect, openni, openni-kinect
NODES
/camera/depth/
rectify_depth (nodelet/nodelet)
metric_rect (nodelet/nodelet)
metric (nodelet/nodelet)
disparity (nodelet/nodelet)
points (nodelet/nodelet)
/camera/rgb/
rectify_mono (nodelet/nodelet)
rectify_color (nodelet/nodelet)
/
camera_nodel... | {
"domain": "robotics.stackexchange",
"id": 7144,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "kinect, openni, openni-kinect",
"url": null
} |
ros, roslaunch, yaml, rosparam
Title: Is there a way to read from a text or yaml file and pass its data to tag?
Just like rosparam that take yaml file as a parameter, I want to know if there is a way to read text or yaml file that contains parameters and pass the parameters to any attributes of the <arg> tag (e.g. v... | {
"domain": "robotics.stackexchange",
"id": 29236,
"lm_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, roslaunch, yaml, rosparam",
"url": null
} |
meteorology, climate-change, gas, pollution
Title: Regarding various types of atmospheric pollution Does all the car pollution (from about 150 million cars at least in the U.S. and a lot more in all of North America and the rest of the world) all the smoke-stack pollution of various factories and all the Airline pollu... | {
"domain": "earthscience.stackexchange",
"id": 346,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "meteorology, climate-change, gas, pollution",
"url": null
} |
java, performance, hash-map
assertTrue(val.equals("hi"));
}
@Test
void testGetNormalNull() {
assertNull(setAllMap.get(1));
}
@Test
void testGetNormalValue() {
setAllMap.put(1, "hi");
assertTrue(setAllMap.get(1).equals("hi"));
}
@Test
void testGetValAfte... | {
"domain": "codereview.stackexchange",
"id": 32522,
"lm_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, hash-map",
"url": null
} |
javascript, node.js, async-await
ServerCommunicator:
async sendDataToDolibarrAsync(leadToBeAdded){
let result = "";
let dataToBeWritten = '{' +
'"name_alias": "' + leadToBeAdded.name + '",' +
'"address": "' + leadToBeAdded.address + '",' +
'"zip": "' + leadToBeAdded.zip + '",' +
... | {
"domain": "codereview.stackexchange",
"id": 30556,
"lm_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, async-await",
"url": null
} |
php, object-oriented, mvc, url-routing
public static function beforeViewing(){
}
}
These are some important files, but if you want me to show some more files, let me know.
Anything that could help / guide me to improve the code would help me a lot. I'm still rather new to this whole code separation trough OOP / ... | {
"domain": "codereview.stackexchange",
"id": 16465,
"lm_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, object-oriented, mvc, url-routing",
"url": null
} |
python, game, rock-paper-scissors
round_repeat = True #This variable keeps the code asking what move the player wants to play if they enter the wrong thing.
total_rounds = 0 #holds the # of rounds the user wants to play.
round_num = 0 #round_num stores what number the current round is, as well as dictating how many t... | {
"domain": "codereview.stackexchange",
"id": 36255,
"lm_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, game, rock-paper-scissors",
"url": null
} |
electricity, electric-circuits, electrons, electric-current
Title: How are free electrons produced in a gas? I'm aware about ionisation but even to ionise a gas you need an electron. So how in a discharge tube, which has a low pressure gas and a high voltage, does current flow? How is the first electron initially obta... | {
"domain": "physics.stackexchange",
"id": 55009,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electricity, electric-circuits, electrons, electric-current",
"url": null
} |
ros2, ros-bouncy
Create empty ws/src
Inside src, $ ros2 pkg create --build-type cmake fail
Copy my sample msg/srv to ~/ws/src/fail/
Created trivial ~/ws/src/fail/src/main.c
Filled CMakeLists.txt with minimal info.
Verify it builds with bouncy installed from srcs
Verify it fails with bouncy debs
Comment by amosteo on ... | {
"domain": "robotics.stackexchange",
"id": 31199,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros2, ros-bouncy",
"url": null
} |
autocorrelation, interpolation, peak-detection, fundamental-frequency
Take your signal, as is
DFT it (using the FFT of signal length)
add plenty of zeros to the DFT's end (e.g. to pad it to the next larger power of 2, which increases the length by some factor $\alpha$ of your choie)
take the inverse DFT (using the IFF... | {
"domain": "dsp.stackexchange",
"id": 9770,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "autocorrelation, interpolation, peak-detection, fundamental-frequency",
"url": null
} |
c#, winforms
For the reminder too:
public int Reminder
{
get
{
return PaidCash - TotalInv - Discount;
}
}
Then when the text changes you can update the text box with only one line:
private void TB_PAID_CASH_TextChanged(object sender, EventArgs e)
{
if(PaidCash < TotalInv)
{
// tod... | {
"domain": "codereview.stackexchange",
"id": 21111,
"lm_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#, winforms",
"url": null
} |
particle-physics, astrophysics, neutrinos, sun
How do we exactly use neutrinos to probe the core of the Sun (if they can only interact weakly)? The neutrinos are produced by nuclear reactions in the core of the Sun. About 2% of the mass lost in the conversion of hydrogen to helium ends up in neutrinos (almost entirel... | {
"domain": "physics.stackexchange",
"id": 65757,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "particle-physics, astrophysics, neutrinos, sun",
"url": null
} |
ros, integration, windows, callbacks
Originally posted by gvdhoorn with karma: 86574 on 2015-02-05
This answer was ACCEPTED on the original site
Post score: 3
Original comments
Comment by altella on 2015-02-09:
Hello all;
Thanks for the tips. The thing is that I cannot explicitily call the data acquistion function in... | {
"domain": "robotics.stackexchange",
"id": 20795,
"lm_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, integration, windows, callbacks",
"url": null
} |
performance, vba, excel
Declare your
variables! Not only
does it help prevent a slew of bugs from cropping up, it makes it a
lot easier to read and understand what your code is doing. Looking
at only the code that was posted, I have no idea if they are local
or global scope or what data type they are. These are import... | {
"domain": "codereview.stackexchange",
"id": 19285,
"lm_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, vba, excel",
"url": null
} |
Using the fact that $$\frac{4^n}{\binom{2n}{n}} =\frac{n}{n-\frac12}\frac{4^{n-1}}{\binom{2n-2}{n-1}}\tag{1}$$ we can compute the generating function for the reciprocals of the central binomial coefficients: \begin{align} \frac{4^n}{\binom{2n}{n}} &=\prod_{k=1}^n\frac{k}{k-\frac12}\\ &=\frac{\Gamma(n+1)}{\Gamma(1)}\fra... | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9898303422461274,
"lm_q1q2_score": 0.8092600257823064,
"lm_q2_score": 0.817574478416099,
"openwebmath_perplexity": 355.25142937593023,
"openwebmath_score": 0.9466996192932129,
"tag... |
neuroscience, action-potential
Title: Fastest and slowest action potential When our instructor asked us about the speed of action potentials in cells, I told him that action potentials and two-wheelers travels at similar speeds. He thought that this is an 'interesting' way of looking at it.
Needless to say after the c... | {
"domain": "biology.stackexchange",
"id": 2236,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neuroscience, action-potential",
"url": null
} |
objective-c, ios, singleton
Title: Optimizing UITableViewCell with singleton property In UITableViewCell class, I have two properties:
UINavigationController
@interface TableViewCell
@property (nonatomic, strong) UINavigationController * targetNaviCtrl;
@implementation TableViewCell
- (UINavigationController *)targe... | {
"domain": "codereview.stackexchange",
"id": 30761,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "objective-c, ios, singleton",
"url": null
} |
c#, multithreading, .net, thread-safety, collections
With the more simple lock variant, it's obvious where and how long a lock is being held. With the above code, it's not so easy. And let's say Marvin needs to add another lock, which - if both locks are needed - must only be obtained after items:
var syncedItems = it... | {
"domain": "codereview.stackexchange",
"id": 32630,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, multithreading, .net, thread-safety, collections",
"url": null
} |
homework-and-exercises, lagrangian-formalism, variational-calculus, coupled-oscillators
\\ &= -K(q_k-q_{k-1})+K(q_{k+1}-q_k)=K(q_{k+1}+q_{k-1}-2q_k)\end{align} $$
So, the eom for the $k$-th particle is
$$ m\ddot{q}_k = K(q_{k+1}+q_{k-1}-2q_k) $$
(obviously for $1<k<N$).
Some comments
Notice that I have intentionally ... | {
"domain": "physics.stackexchange",
"id": 34315,
"lm_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, lagrangian-formalism, variational-calculus, coupled-oscill... |
spectrogram, speech, voice
Title: Raw speech data into spectrogram I am using Delphi trying to make a very simple speech recognition system. The system collects raw data well, but I have a hard time turning the data into a spectrogram:
The system collects an array with $1024$ integer values for each $100$ ms.
I try to... | {
"domain": "dsp.stackexchange",
"id": 4647,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "spectrogram, speech, voice",
"url": null
} |
Am I wrong? Is area to the right of the y-axis positive and to the left negative? Or is it something else about the symmetry? How can I tell?
6. Originally Posted by pflo
I agree the symmetry is easier to see if we shift to the origin, that's why I thought the u-substitution method was better to look at in this case. ... | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9664104982195785,
"lm_q1q2_score": 0.8010951728694425,
"lm_q2_score": 0.8289388146603365,
"openwebmath_perplexity": 254.10569367467707,
"openwebmath_score": 0.9377415776252747,
... |
java, parsing, swing
Title: Comparing reports in different file formats EDIT:
Found an issue myself - the SwingWorkers were not printing the tasks in the same order. I fixed it feeding just one SwingWorker a list of reports and looping over it inside the doInBackground() method. I am not sure about it's performance th... | {
"domain": "codereview.stackexchange",
"id": 26886,
"lm_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, parsing, swing",
"url": null
} |
What is the proper way to represent the solution to a system of two equations
I had a bit of a disagreement with some of my colleagues over the correct way to represent the solution to a system of two linear equations, e.g.:
\begin{align} x + y = 1\\ 3x + 2y = -1 \end{align}
We should find that the solution is $x = ... | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9653811641488383,
"lm_q1q2_score": 0.8224591823208119,
"lm_q2_score": 0.8519527963298947,
"openwebmath_perplexity": 329.80318101683173,
"openwebmath_score": 0.7561151385307312,
"ta... |
of (e. Expect variations in books and online:. Learn the LaTeX commands to display the greek alphabet. In a similar manner to the summation symbol, the product symbol can easily be added to a LaTeX document using the \prod notation. Samarbeta i realtid, utan installation, med versionshantering, hundratals LaTeX-mallar,... | {
"domain": "sicituradastra.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9637799430946808,
"lm_q1q2_score": 0.8191851676446298,
"lm_q2_score": 0.8499711718571775,
"openwebmath_perplexity": 1037.5371453168518,
"openwebmath_score": 0.8853237628936768,
"ta... |
quantum-mechanics, special-relativity, reference-frames, schroedinger-equation
As matter we observe is mainly composed of fermions the Dirac equations is the most relevant.
Any solution to the Dirac equation is automatically a solution to the Klein–Gordon equation, but the converse is not true.
With the formalism of... | {
"domain": "physics.stackexchange",
"id": 54939,
"lm_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, special-relativity, reference-frames, schroedinger-equation",
... |
python, physics
fig.tight_layout()
Functions and type hints are your friend - use them
Vectorise your separate alpha values and calculations to a single calculation for each of perpendicular and parallel arrays
np.linspace(0, 180, int(round(180/1 + 1))) is a slightly bizarre way of writing np.arange(181)
Do not pow(x... | {
"domain": "codereview.stackexchange",
"id": 42328,
"lm_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, physics",
"url": null
} |
Example 5: Find the period, amplitude and frequency of and sketch a graph from 0 to . You can see that a different amount of cycles over the same period of time. Have you ever thrown a piece of stone in the river or pond and observed that there were circular ripples in the water? Many scientific disciplines incorporate... | {
"domain": "casinos-mit-paypal.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9585377249197138,
"lm_q1q2_score": 0.8868678106877188,
"lm_q2_score": 0.9252299493606285,
"openwebmath_perplexity": 617.9520816993594,
"openwebmath_score": 0.6891902685165405,
... |
homework-and-exercises, general-relativity, gravity, orbital-motion, projectile
Below is a plot of the equation of motion $u(\phi)$ for the asymptotic speed
$\beta = 0.5$ and impact parameter $b_i = b_i^\text{critical} + \delta$, where $b_i^\text{critical}\approx 4.4\,r_s$ and $\delta = 12\times10^{-6}r_s$. The parti... | {
"domain": "physics.stackexchange",
"id": 96297,
"lm_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, general-relativity, gravity, orbital-motion, projectile",
... |
Monochrome, Contains straight lines, Has no crossing lines operator. That denotes an inequality between two values for example, x ≥ -3 is the solution of certain! Of time, and some characters like emoji usually ca n't be found -3... Represented by the symbol ≥ ≥ Asymmetric, Open shape, Monochrome Contains... Lines, Has... | {
"domain": "apedigital.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9353465062370313,
"lm_q1q2_score": 0.8369382081533575,
"lm_q2_score": 0.894789473818021,
"openwebmath_perplexity": 1402.7063237755121,
"openwebmath_score": 0.5936866998672485,
"tags":... |
dft
Title: Discrete Fourier Transform of PMF and PDF I got this explenation:
"It is well-known that an image’s histogram is essentially
the probability mass function (pmf) of the image (only
differing by a scalar). Multiplying each component of the
pmf by a correspondingly shifted unit impulse results in the probabili... | {
"domain": "dsp.stackexchange",
"id": 2431,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "dft",
"url": null
} |
quantum-mechanics, electromagnetism, momentum, gauge-theory, gauge-invariance
Title: Canonical Momenta and gauge invariance Suppose there is a charged particle moving in an Electromagnetic field for which the vector potential is A.
Now we change A by gradient of some scalar(which is time independent) Hence, the scala... | {
"domain": "physics.stackexchange",
"id": 40981,
"lm_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, electromagnetism, momentum, gauge-theory, gauge-invariance",
... |
quantum-mechanics, wavefunction, fourier-transform
How does this correspond to a collapse to a long sinusoidal wave, with a well-defined wavelength as is quoted from the literature?
Thanks a lot for any assistance. I think you are getting something wrong in the 2nd and 3rd point, but i am going to try and give you... | {
"domain": "physics.stackexchange",
"id": 29841,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, wavefunction, fourier-transform",
"url": null
} |
ros, rate, frequency, publisher
Title: How to change publishing rate of a node to a topic?
hello,here are the publishing rate on the following topics:--
/odom--->Caverage rate: 5.002 min: 0.193s max: 0.210s std dev: 0.00788s window: 39
/scan--->Caverage rate: 4.997 min: 0.193s max: 0.210s std dev: 0.00782s window... | {
"domain": "robotics.stackexchange",
"id": 20347,
"lm_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, rate, frequency, publisher",
"url": null
} |
java, optimization, recursion, chess
Is there a way to make this more efficient with smaller boards?
Can someone explain why the time required to solve are so close?
Any other general comments welcome. Analysis
You've implemented a greedy algorithm using Warnsdorff's Rule. One consequence of using a greedy algorithm... | {
"domain": "codereview.stackexchange",
"id": 11483,
"lm_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, optimization, recursion, chess",
"url": null
} |
fft, bitdepth
how can we explain it theoretically?
Let's start with the energy conserving definition of the FFT
$$X[k] = \frac{1}{\sqrt{N}}\sum_{n=0}^{N-1}x[n] \cdot e^{-j2\pi\frac{kn}{N}}$$
This preserves the energy in both domains, i.e. $\sum x^2[n] = \sum |X[k]|^2$.
If you apply this to "noise like" signals, the o... | {
"domain": "dsp.stackexchange",
"id": 10663,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fft, bitdepth",
"url": null
} |
python, functional-programming, cryptography
def decrypt(text,key): ...
I don't know if you see it, but things look less clear at this level:
It's hard to guess what cycle_get(lst,index) and cycle_increment_index(index,lst) would do. Also, curiously, although both seem to take a list and a number parameter, the orde... | {
"domain": "codereview.stackexchange",
"id": 10041,
"lm_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, functional-programming, cryptography",
"url": null
} |
lagrangian-formalism, path-integral, action, constrained-dynamics, partition-function
D.J. Toms, Faddeev-Jackiw quantization and the path integral, arXiv:1508.07432. | {
"domain": "physics.stackexchange",
"id": 79678,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lagrangian-formalism, path-integral, action, constrained-dynamics, partition-funct... |
CSV or Excel data. Access SeqAPASS by opening https://seqapass.epa.gov/seqapass/ using Mozilla Firefox web browser 2. I want to plot a box plot over another box plot but it should look like a grouped bar graph. What I am looking to do, is generate 2 side by side boxplots that are separated by value. How does this p-val... | {
"domain": "wpbackendfilesearch.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9241418241572634,
"lm_q1q2_score": 0.8154885010498641,
"lm_q2_score": 0.8824278695464501,
"openwebmath_perplexity": 1669.6370617639493,
"openwebmath_score": 0.2904391884803772,... |
asymptotics, runtime-analysis
$$
Sometimes the regime is not deemed interesting, but that's a more subjective matter.
Note also that the problem already manifests itself for one-variable functions. Consider
$$
f(n) = n^2, \qquad g(n) = \begin{cases} 2^n &\text{if } n = 2^m, \\ n & \text{otherwise}. \end{cases}
$$
Is $... | {
"domain": "cs.stackexchange",
"id": 16556,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "asymptotics, runtime-analysis",
"url": null
} |
c++, boost
Title: Using Boost.Spirit to transform expression to AST Is there a better way to transform some expression to AST using Boost.Spirit?
I have built it, but I think it's messy and can be simplified a lot.
Code is also available on Godbolt.
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include... | {
"domain": "codereview.stackexchange",
"id": 38663,
"lm_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++, boost",
"url": null
} |
html, css
.button:hover {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #000000), color-stop(1, #000000) );
background:-moz-linear-gradient( center top, #000000 5%, #000000 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColor... | {
"domain": "codereview.stackexchange",
"id": 8132,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "html, css",
"url": null
} |
java, xml, finance, javafx
public String getTotalValue() {
return String.format("%.2f", this.totalValue.get());
}
}
com.HassanAlthaf.StockControlSystem.Stocks.StockRepository.java
/*
* Program developed by Hassan Althaf.
* Copyright © 2015, Hassan Althaf.
* Website: http://hassanalthaf.com
*/
package ... | {
"domain": "codereview.stackexchange",
"id": 16450,
"lm_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, xml, finance, javafx",
"url": null
} |
c++, reinventing-the-wheel, json
template <class T>
T* getIf(std::vector<std::string> const& keys)
{
JSONObject* temp = this;
// Go to JSONObject where last keys attribute resides.
for (int i = 0; i < (keys.size() - 1); ++i)
{
temp = &std::get<JSONObject>(temp->attr... | {
"domain": "codereview.stackexchange",
"id": 38488,
"lm_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++, reinventing-the-wheel, json",
"url": null
} |
AND POISSON'S EQUATION In this section, we state and prove the mean value property of harmonic functions, and use it to prove the maximum principle, leading to a uniqueness result for boundary value problems for Poisson's equation. or its inhomogeneous version Poisson's equation ∇2u(x) = ρ(x). solvers for Poisson equat... | {
"domain": "nomen.pw",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9912886165717258,
"lm_q1q2_score": 0.8365436029051838,
"lm_q2_score": 0.8438950966654772,
"openwebmath_perplexity": 551.5128570846641,
"openwebmath_score": 0.8519819974899292,
"tags": null,... |
javascript, interview-questions
document.write(expectedOutput.toString());
In the interview, I communicated that using .hasOwnProperty() provides \$O(1)\$ lookup for keys (but not for values) from array b, and unfortunately, I wasn't able to fully implement this as my mind wandered across other possibilities there mi... | {
"domain": "codereview.stackexchange",
"id": 25520,
"lm_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, interview-questions",
"url": null
} |
python, performance, python-3.x, primes
for prime in filter_cache(m, list):
# The rest
This should be faster than both methods.
However your first 'naive' approach will be faster at small numbers.
There is an improved version of the naive program, where you count in steps of 6.
And check either side of that numb... | {
"domain": "codereview.stackexchange",
"id": 15672,
"lm_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-3.x, primes",
"url": null
} |
B_2(x_1)= \pm\frac1{2|a_1|}\sqrt{\frac1{4a^2_1{\left(\pm\frac1{2|a_1|}\sqrt{\frac1{4a^2_1x_1^2}\left(2a_1x_0\sqrt{4a_0^2x_0^2+1}+\frac{a_1}{a_0}sinh^{-1}\left(2a_0x_0\right)-sinh^{-1}\left(2a_1x_1\right)\right)^2-1}\right)}^2}\left(2a_1x_0\sqrt{4a_0^2x_0^2+1}+\frac{a_1}{a_0}sinh^{-1}\left(2a_0x_0\right)-sinh^{-1}\left(... | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9891815507092832,
"lm_q1q2_score": 0.8446747392964531,
"lm_q2_score": 0.8539127510928476,
"openwebmath_perplexity": 382.87353351995375,
"openwebmath_score": 0.9760925769805908,
"ta... |
quantum-mechanics, homework-and-exercises, hilbert-space, schroedinger-equation, time-evolution
Is this correct? I am finding other solutions online which have a different answer, although I can't see how this could possibly be wrong, unless my representation for $|2>$ is wrong.
Assuming this is the correct way of d... | {
"domain": "physics.stackexchange",
"id": 38420,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, homework-and-exercises, hilbert-space, schroedinger-equation, t... |
c, linked-list, api, library
typedef struct dlist_s dlist;
list *dlist_create(void);
void dlist_destroy(dlist *list);
int dlist_add_node(dlist *list, int32_t index);
int dlist_rm_node(dlist *list, int32_t index);
int dlist_bind_node(dlist *list, uint16_t index, void *data, size_t len, bool hands_off);
void *dlist_acc... | {
"domain": "codereview.stackexchange",
"id": 38351,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c, linked-list, api, library",
"url": null
} |
java, algorithm, tree, data-mining
net.coderodde.datamining.lottery.MissingLotteryRowsGenerator
package net.coderodde.datamining.lottery;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.SortedMap;
import java.util.TreeMap;
/**
* This class implements a tree data structu... | {
"domain": "codereview.stackexchange",
"id": 38068,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, algorithm, tree, data-mining",
"url": null
} |
compilers, recursion, program-optimization, tail-recursion
Title: What property of cons allows elimination of tail recursion modulo cons? I'm familiar with the idea of basic tail recursion elimination, where functions that return the direct result of a call to themselves can be rewritten as iterative loops.
foo(...):
... | {
"domain": "cs.stackexchange",
"id": 10443,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "compilers, recursion, program-optimization, tail-recursion",
"url": null
} |
electromagnetism, solid-state-physics, dispersion
Title: How to obtain the high frequency dispersion relation for transverse waves in the Drude model? Context
I am studying electrodynamics using Zangwill [1]. I have a narrow question regarding a proposition found there in. In the section on the Drude model of conduc... | {
"domain": "physics.stackexchange",
"id": 96858,
"lm_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, solid-state-physics, dispersion",
"url": null
} |
c++, recursion, template, c++20, constrained-templates
test with std::priority_queue container:
6
Godbolt link
All suggestions are welcome.
The summary information:
Which question it is a follow-up to?
A recursive_transform_view Template Function which returns a view in C++
What changes has been made in the code s... | {
"domain": "codereview.stackexchange",
"id": 44496,
"lm_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++, recursion, template, c++20, constrained-templates",
"url": null
} |
php
Title: Can this PHP code to settle up payments be improved? I've made a function that takes an array of amounts owed by each user_id and works out the best way to square everyone up. The input array would look something like this, but may consist of 1 or more "users" who all owe (or are owed) money between each ot... | {
"domain": "codereview.stackexchange",
"id": 6527,
"lm_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",
"url": null
} |
c#, thread-safety, collections
Title: Add/Remove items thread-safely in List Recently I had to lock collections (of type List<T>) when items were added or removed. Because several collections were used in given code instead of creating helper methods for each collection, I made an extension methods:
public static clas... | {
"domain": "codereview.stackexchange",
"id": 2669,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, thread-safety, collections",
"url": null
} |
c++, c++11, game, tetris
if (init)
return;
/* put keyboard (stdin, actually) in raw, unbuffered mode */
tcgetattr(0, &g_old_kbd_mode);
memcpy(&new_kbd_mode, &g_old_kbd_mode, sizeof(struct termios));
new_kbd_mode.c_lflag &= ~(ICANON | ECHO);
new_kbd_mode.c_cc[VTIME] = 0;
new_kbd_mode.c_c... | {
"domain": "codereview.stackexchange",
"id": 11269,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++11, game, tetris",
"url": null
} |
acceleration, voltage
Title: Accelerating potential Will an accelerating potential accelerate a neutral atom? For example, consider an atom of hydrogen subjected to an accelerating potential of $V$. As the kinetic energy of a particle accelerated by a voltage is given by $qV$, where $q$ is the charge on the particle, ... | {
"domain": "physics.stackexchange",
"id": 28553,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "acceleration, voltage",
"url": null
} |
astronomy, temperature, spectroscopy, stars
As the temperature increases, the energy available to excite the atoms increases as well. As you move up from M class stars you get to spectral types K, G, F, and then A, each one increasing in strength of the lines. The A stars, at about 10,000 K, are just the right tempe... | {
"domain": "physics.stackexchange",
"id": 3101,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "astronomy, temperature, spectroscopy, stars",
"url": null
} |
parsing, actionscript-3
} else {
//we fucked
attributeValue2 += attributeString;
attributeString = "";
var variableReference:VariableReference = new VariableReference(attributeName2, attribut... | {
"domain": "codereview.stackexchange",
"id": 12175,
"lm_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, actionscript-3",
"url": null
} |
quantum-mechanics, thermodynamics, statistical-mechanics, quantum-information, temperature
Then, $e^{-\beta E_i}$ in the limit $\lim_{β\rightarrow 0}e^{-\beta E_i}=1$ and the Boltzmann factor is given by
$$
p(E_i, \beta =0)= \frac{g_i}{\sum_i g_i}.
$$
Thus in the thermodynamic limit, the state with the largest multipl... | {
"domain": "physics.stackexchange",
"id": 73763,
"lm_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, thermodynamics, statistical-mechanics, quantum-information, tem... |
Language. Such series appear in many areas of modern mathematics. This formula shows that a constant factor in the summands can be taken out of the sum. Free Summation Calculator. However, when the series has an infinite number of terms the summation is more complicated and the series may or may not have a finite. Let ... | {
"domain": "audio-upgrade.pl",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9830850906978876,
"lm_q1q2_score": 0.8575916963243044,
"lm_q2_score": 0.8723473730188543,
"openwebmath_perplexity": 412.81979783464897,
"openwebmath_score": 0.7158166170120239,
... |
c++, c++11, multithreading, asynchronous, synchronization
Clear()
You use a std::unique_lock<> to Clear() where a std::lock_guard<> is sufficient. You use the correct one in SetFinish(). | {
"domain": "codereview.stackexchange",
"id": 16679,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++11, multithreading, asynchronous, synchronization",
"url": null
} |
with me:⚡️Facebook - https://www.facebook.com/freemathvideos⚡️Instagram - https://www.instagram.com/brianmclogan/⚡️Twitter - https://twitter.com/mrbrianmclogan⚡️Linkedin - https://www.linkedin.com/in/brian-mclogan-16b43623/ Current Courses on Udemy: https://www.udemy.com/user/brianmclogan2/ About Me: I make short, ... | {
"domain": "kozmolighting.com",
"id": null,
"lm_label": "1. Yes\n2. Yes\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.96741025335478,
"lm_q1q2_score": 0.8123672426561962,
"lm_q2_score": 0.8397339596505965,
"openwebmath_perplexity": 469.2313955256771,
"openwebmath_score": 0.5885716080665588,
"t... |
ngs, assembly
Title: Quast duplication ratio and mismatches percent When analyzing Quast results it seems that it doesn't calculate mismatches and indels in a useful way if the "Duplication ratio" is over 1.
For example, that's what I get for an assembly with two contigs covering almost the full genome
And that's wha... | {
"domain": "bioinformatics.stackexchange",
"id": 1708,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ngs, assembly",
"url": null
} |
java
Objects.requireNonNull(value);
if (value.length() < 2) {
throw new IllegalArgumentException("Invalid duration (\"" + value + "\").");
}
//period
int period = Integer.parseInt(value.substring(0, value.length() - 1));
if (period <= 0) {
throw new Ille... | {
"domain": "codereview.stackexchange",
"id": 6562,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java",
"url": null
} |
c++, game, event-handling
#include <SFML\System\Vector2.hpp>
namespace Pathfinding::Events
{
struct MouseData
{
MouseData(sf::Vector2i cursorPosition_) : cursorPosition(cursorPosition_) {}
MouseData(sf::Vector2i cursorPosition_, int32_t wheelDelta_)
: cursorPosition(... | {
"domain": "codereview.stackexchange",
"id": 43075,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, game, event-handling",
"url": null
} |
python, python-2.x, numpy
if __name__ == '__main__':
main(argv)
Some example runs:
$ python linearsolver.py "2 5 -9 3; 5 6 -4 2; 3 -4 2 7; 11 7 4 -8" "151 103 16 -32"
a = 3
c = -11
b = 5
d = 7
$ python linearsolver.py "5 -11 9; 13 7 -10; -6 5 -8" "gkm" "-125 2 60"
k = 12
m = 3
... | {
"domain": "codereview.stackexchange",
"id": 23638,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-2.x, numpy",
"url": null
} |
navigation, ros-hydro, costmap-2d
// Now you can use the costmap.
[...]
}
Originally posted by Sebastian Kasperski with karma: 1658 on 2014-03-04
This answer was ACCEPTED on the original site
Post score: 4
Original comments
Comment by BlitherPants on 2014-03-05:
I think I might be having a problem similar to you... | {
"domain": "robotics.stackexchange",
"id": 17106,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "navigation, ros-hydro, costmap-2d",
"url": null
} |
java
public void save(String file, String[] array) throws FileNotFoundException,
IOException {
File aFile = new File(file);
Writer output = null;
try {
output = new BufferedWriter(new FileWriter(aFile));
for (int i = 0; i < array.length; i++) {
... | {
"domain": "codereview.stackexchange",
"id": 10733,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java",
"url": null
} |
electromagnetism, electromagnetic-radiation, charge, acceleration, atoms
Title: Why doesn't a charged particle radiate energy in circular motion in a uniform magnetic field? I have studied in my Physics course that one of the drawbacks of Rutherford's atomic model was that when an electron will revolve around the nucl... | {
"domain": "physics.stackexchange",
"id": 23486,
"lm_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, electromagnetic-radiation, charge, acceleration, atoms",
"url"... |
All HP calcs use the same algo.
First, reduce the angle to 0/45°
Then transform to radian (inputs in degree mode are tested for special values such as 0, 360, 180, 90).
Use CORDIC
return results
Cyrille
Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
... | {
"domain": "hpmuseum.org",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9603611574955211,
"lm_q1q2_score": 0.8255876675908576,
"lm_q2_score": 0.8596637433190939,
"openwebmath_perplexity": 2229.863182343363,
"openwebmath_score": 0.766549289226532,
"tags"... |
java, graph, breadth-first-search, depth-first-search
Unvisited,Visiting,Visited;
} Data Structure
Your terminology is a bit off. Trees have roots and children. Arbitrary graphs, on the other hand… I think "origin" and "neighbors" would be more appropriate.
Visited flag: Storing the visited/unvisited flag in the N... | {
"domain": "codereview.stackexchange",
"id": 7333,
"lm_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, graph, breadth-first-search, depth-first-search",
"url": null
} |
thermodynamics, fluid-dynamics, bubbles
Title: Why do steam bubbles increase in size as they rise? In the following video (a customer's review of a glass kettle), we can observe water boiling: http://youtu.be/jByY5I7Xk7w?t=2m55s
As the kettle starts to boil at around 2:55, we can see large steam bubbles being formed a... | {
"domain": "physics.stackexchange",
"id": 2532,
"lm_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, fluid-dynamics, bubbles",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.