text stringlengths 1 1.11k | source dict |
|---|---|
$$(\sqrt2-1)q'=(\sqrt2-1)(\sqrt2-1)q=(3-2\sqrt2)q=q+2(1-\sqrt 2)q =q-2q'$$
• Now we need another proof for that $q-2q'\gt 0$, but I guess it will be simple because we just need to show $\frac{q'}{q}=\sqrt2-1\lt \frac{1}{2}$. – edm Jun 10 '17 at 9:38
• This seems legitimate except the non-negative part needs to be proved as pointed by @edm. Also, could you help me figure out what went wrong with my working? – Eulerian Jun 10 '17 at 9:48
This well-known proof is usually presented as rote algebra - without any explanation of the (beautiful!) innate arithmetical structure that underlies the proof. Below we bring this to the fore, which simplifies the algebra and yields conceptual insight. First we consider a simpler variant. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9643214491222695,
"lm_q1q2_score": 0.8412232956887594,
"lm_q2_score": 0.8723473862936942,
"openwebmath_perplexity": 202.39386786748088,
"openwebmath_score": 0.9427694082260132,
"tags": null,
"url": "https://math.stackexchange.com/questions/2316991/different-proof-that-sqrt2-is-irrational"
} |
hash, quantum-computing
Consider $x \rightarrow y = H(x)$. If I have an implementation of $H$ with quantum gates, I could take any $y$, put the remaining registers into whatever state I want (corresponding to the lost information) and then invert to obtain a valid $x$. My only assumption here is that I implemented the quantum $H$ but I can't see why this is forbidden, or even difficult. No. I can see how that sounds like it could work, but it doesn't actually work. You're missing an important detail about how we implement classical functions on a quantum computer. The usual way to implement non-reversible functions with reversible logic is to use ancilla bits (i.e., constant inputs, and junk outputs that are discarded). | {
"domain": "cs.stackexchange",
"id": 12311,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "hash, quantum-computing",
"url": null
} |
ros, linux, build, fedora
Originally posted by PacketSpike on ROS Answers with karma: 1 on 2015-07-23
Post score: 0
This reads like a very long advertisement for DNF (and it appears to be pasted twice).
I'm not aware of very many public yum repositories of ROS pacakges, or of instructions that specifically instruct users to use yum when installing ROS. The only pages I've found on the wiki that look relevant and up to date are the source installation and the Fedora installation, which points to the source install instructions for all of the currently-maintained versions of ROS. The Fedora page is old and should probably be left as-is to support legacy users, but you are welcome to edit the Source installation page to provide an alternate set of instructions for DNF.
The other tool in the ROS ecosystem that will need to be aware of DNF is rosdep, and the rosdep changelog indicates that it was converted to use DNF in September of 2015. | {
"domain": "robotics.stackexchange",
"id": 22264,
"lm_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, linux, build, fedora",
"url": null
} |
ros
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'application'
mainClassName = 'org.ros.RosRun'
sourceCompatibility = 1.6
targetCompatibility = 1.6
repositories {
mavenLocal()
maven {
url 'http://robotbrains.hideho.org/nexus/content/groups/ros-public'
}
}
version = '0.0.0-SNAPSHOT'
group = 'ros.my_stack'
dependencies {
compile 'ros.rosjava_core:rosjava:0.0.0-SNAPSHOT'
}
wildfire@ubuntu:~/my_workspace/ajpf_ros$ gradle --version
Gradle 1.0-milestone-3
Gradle build time: Thursday, September
8, 2011 4:06:52 PM UTC Groovy: 1.7.10
Ant: Apache Ant(TM) version 1.8.2
compiled on August 19 2011 Ivy: non
official version JVM: 1.6.0_24 (Sun
Microsystems Inc. 20.0-b12) OS: Linux
3.0.0-24-generic i386
Originally posted by wildfire on ROS Answers with karma: 33 on 2012-08-20
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 10688,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros",
"url": null
} |
everyday-chemistry, spectroscopy, heat, color
Of course, that does not make it ideal for energy conversion, as it would also need at least the following qualities to be practical. | {
"domain": "chemistry.stackexchange",
"id": 2560,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "everyday-chemistry, spectroscopy, heat, color",
"url": null
} |
drafting
Dimension all functional requirements: These are all things that matter to your design, but are not as essential as your critical features. You should make sure that they are dimensioned and clear, but you don't have to draw extra attention to them like you do with a critical dimension. For example on the sprocket, the thickness of the sprocket needs to be machined correctly for it to fit, but it won't be a very tight tolerance. | {
"domain": "engineering.stackexchange",
"id": 1017,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "drafting",
"url": null
} |
python, python-3.x, object-oriented, file-system, pdf
Title: Attempting an OOP approach for PDF Paranoia - Automate the Boring Stuff CH 15 This exercise is called PDF Paranoia and it comes from CH 15 of the book Automate the Boring Stuff With Python - second edition. There are two parts to the exercise, which I've separated into two Python files. The code I've provided uses Python 3.10 and PyPDF2 v. 2.10.0.
The instructions are as follows: | {
"domain": "codereview.stackexchange",
"id": 43673,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x, object-oriented, file-system, pdf",
"url": null
} |
beginner, lua
Title: Pico-8 player and scene I recently started learning Lua by programming games in Pico-8. It's been fun, but it's time to learn some of the more powerful utilities to get things done smarter and with less redundancy.
I'm an absolute beginner trying to form this nested for loop correctly. Any help would be amazing and help me move onto new ideas and concepts.
I can share a link to the full code if needed / permitted.
Here's the code:
function _init()
mom = {}
dad = {}
-- variable to adjust x and y offset for checking solid tiles when
-- changing the level (default is 0, which aims at level 1)
levelpixeloffset_x = 0
levelpixeloffset_y = 0
--set which scene stage to display / where actors are placed
scene = {}
scene.counter = 1
-- player variables
player = {}
player.sprite = 1
player.speed = 0.8
player.movingup = false
player.spritecounterup = 0
player.movingdown = false
player.spritecounterdown = 0
player.movingleft = false
player.spritecounterleft = 0 | {
"domain": "codereview.stackexchange",
"id": 25591,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, lua",
"url": null
} |
c, strings, security, library
Don't use magic numbers (9, 10, 13). They are '\t', '\r', '\n' really.
pl_expandtabs has a semantical problem. It replaces the tab character with a given number of spaces. It is not what is usually expected. Instead, the number of spaces shall be calculated in such way that the character following the tab appears at a column which is multiple of tab width. | {
"domain": "codereview.stackexchange",
"id": 12622,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c, strings, security, library",
"url": null
} |
astrophysics, nuclear-physics
On a more general level: What is "purely astrophysical"? Astronomy and Astrophysics is more or less by definition the synthesis of all other parts of physics applied to observations from the whole universe instead of just our earth. For star/galaxy spectrums you need the atom physics results to identify the spectra. For accredition discs and stellar/planetal evolution you need gas/fluid dynamics, depending on the case including relativistics and/or magnetic fields. Radioastronomy uses classical or relativistic electro-dynamics. Neutrino astrophysics is highly dependent on the nuclear physics results and so on... I'm sure this list could be expanded to almost infinity. So this is not mutually exclusive. It belongs to astrophysics, as it's surely a astronomical observation, but the explanation of the observation wir require a profund understanding of the nuclear physics involved (if any - if you find another explanation from another sector of physics, you're welcome!) | {
"domain": "physics.stackexchange",
"id": 14975,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "astrophysics, nuclear-physics",
"url": null
} |
magnetic-fields, superconductivity, magnetostatics
So, to answer your three questions:
1) The omitted term has to do with the work being done by the power supply that mantains the external current against the induction back EMF when the field ${\bf B}_{\rm int}$ changes. The omission is analogous to adding $PV$ to the Helmholtz free energy $F=U-TS$ to get the Gibbs free energy $G=U-TS+PV$ when we have a system at constant pressure rather than at constant volume. | {
"domain": "physics.stackexchange",
"id": 43201,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "magnetic-fields, superconductivity, magnetostatics",
"url": null
} |
algorithms, dynamic-programming, greedy-algorithms
Case #1: it's possible to get $S$ with first $k-1$ coins ?
Case #2: coin $V_{k}$ it's taken. So it's possible to get the rest, i.e. $S - V_{k}$ with the first $k-1$ coins?
Note: Sure about the base cases. I mean $f(k, 0) = False$, $f(0, 0)=True$, and others.
To construct the coins to sum $S$. You got to remember which of cases for $f$ were True, because the first says, don't to need $V_k$, and the second case do.
The algorithm looks like more or less:
If $f(N, S)$ is True. You ask it's $f(N-1, S)$ is True. If it's True, you don't need to put $V_N$ in the solution. If it's False, $f(N-1, S- V_N)$ should be True, so, you need to put get in to it. And so on until you'd finished to consider the N coins or you've finished before looking for a sum zero. | {
"domain": "cs.stackexchange",
"id": 3740,
"lm_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, dynamic-programming, greedy-algorithms",
"url": null
} |
earth-history, mass-extinction, geobiology, evolution, ecology
Title: Why haven't weeds overtaken the entire planet? Given how rapidly weed plants spread and grow, choking out all other plant life, how come after millions of years we haven't ended with forests full of thistle or pokeweed, as opposed to pines or oak trees? A weed is just a plant where you do not want it. Totally a matter of context. Tumbleweeds are non-native, introduced centuries ago. I assume you mean the invasive species of plants that have been spread by humans and are disrupting ecologies throughout most of the world
Until recently, these plants we consider weeds were limited in their range to home environments simply by geographic barriers and surrounding unfriendly environments. And the natural consumers, parasites and competitors in the home environments had adjusted to these plants and kept them in check. | {
"domain": "earthscience.stackexchange",
"id": 627,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "earth-history, mass-extinction, geobiology, evolution, ecology",
"url": null
} |
slam, navigation, gmapping
Originally posted by koloman on ROS Answers with karma: 41 on 2011-06-15
Post score: 4
To know where the robot is in the map, you want to transform the origin of the base_link frame into the map frame.
In addition to the map, SLAM systems (gmapping and karto) publish transform data. In particular, they provide the transform from the map frame to the odom frame. Another node (which one will depend on what kind of robot you're using) should already be publishing the transform from the odom frame to the base_link frame.
The tf library will chain those transforms together for you. The details will depend on whether you're writing in C++ or Python; check the tf documentation. As an example, from the command-line, you can do this while the SLAM system is running:
rosrun tf tf_echo map base_link | {
"domain": "robotics.stackexchange",
"id": 5848,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "slam, navigation, gmapping",
"url": null
} |
walls, by means of three identical light horizontal springs of spring constant , as shown. 0 kg mass? 2. Nonlinear Dynamics of a Mass-Spring-Damper System Background: Mass-spring-damper systems are well-known in studies of mechanical vibrations. This problem is based on Young/Geller Quantitative Analysis 11. A two DOFs spring-mass system. 204622622 lbs kg and. A light spring of constant k = 163 N/m rests vertically on the bottom of a large beaker of water. Calculating effective mass when Spring itself is massive in Mechanics problems. The normal method of analyzing the motion of a mass on a spring using Newton’s 2nd leads to a differential equation which is beyond the scope of this course. An ideal mass m=10kg is sitting on a plane, attached to a rigid surface via a spring. , and is maintained in a database by the ISS Program Science Office. 454 kg, so a tad more than 2. When the block is released, it travels a distance d up the slope. A spring system can be thought of as the simplest | {
"domain": "mexproject.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.986777179803135,
"lm_q1q2_score": 0.8157803347695534,
"lm_q2_score": 0.8267117962054048,
"openwebmath_perplexity": 576.3393247798474,
"openwebmath_score": 0.5349347591400146,
"tags": null,
"url": "http://mexproject.it/jtjy/spring-mass-system-problems.html"
} |
Big O notation Table.. Notation Calculator ≥ 4 and for all n ( * ) with e.g domain:.!, summation notation, and constant ignores that ≥ 4 and for n... Real function Calculators » summation ( Sigma, ∑ ) notation Calculator it as 6 $1 2., rather than their absolute magnitudes 'ul ' or 'ul ' to force constant! A method of writing algebraic variables as functions of other variables over non-negative x values '' this does NOT f... Growth rate of 50 mi/h$ takes the same integer value now we are going to a..., usually declared as a set of x/y coordinates, with the input $1 + 2 takes! Aubrey constant function notation Charlie are driving at a constant factor, and the Big O notation is one representation facilitates. To identify a function by analyzing the domain and range and using the vertical line test address a of... Function as constant and ignore them so, how can we use asymptotic notation discuss. This section we need to the sum of a of growth of an algorithm of n increases so those | {
"domain": "doosan.bg",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9353465152482724,
"lm_q1q2_score": 0.8268830643813618,
"lm_q2_score": 0.8840392848011833,
"openwebmath_perplexity": 641.6103400619602,
"openwebmath_score": 0.8427238464355469,
"tags": null,
"url": "https://doosan.bg/dftk3ta/constant-function-notation-9f20b4"
} |
ros
Title: gazebo unable to create glx visual
I install ros hydro and gazebo 1.9. When I run the gazebo command to start simulator it gives error.
Msg Waiting for master
Msg Connected to gazebo master @ http://127.0.0.1:11345
Msg Publicized address: aaa
Error [RenderEngine.cc:641] Unable to create glx visual
Warning [RenderEngine.cc:92] Unable to create X window. Rendering will be disabled
I found several solution like "configure x11" ,but it doesn't help.
How can I fix this problem?
Originally posted by lifetime on ROS Answers with karma: 33 on 2014-08-04
Post score: 0
I found the solution ;
http://askubuntu.com/questions/475972/error-couldnt-find-rgb-glx-visual-or-fbconfig-ubuntu-12-04
sudo apt-get remove --purge xserver-xorg
sudo apt-get install xserver-xorg
sudo dpkg-reconfigure xserver-xorg
sudo reboot
Originally posted by lifetime with karma: 33 on 2014-08-04
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 18889,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros",
"url": null
} |
• The points at the bottom of the plot denote the best fitness values, while the points above them denote the averages of the fitness values in each generation. The top of the plot displays the best and mean values, numerically, in the current generation.
• To see the solution and fitness function value, look at the top of the task.
• To view the values of these variables, enter the following code in the section below the task.
```disp(solution) disp(objectiveValue) ```
The value shown is not very close to the actual minimum value of Rastrigin's function, which is 0. The topics Set Initial Range, Vary Mutation and Crossover, and Set Maximum Number of Generations and Stall Generations describe ways to achieve a result that is closer to the actual minimum. Or, you can simply rerun the solver to try to obtain a better result.
The final state of the Live Editor task appears here. | {
"domain": "mathworks.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9848109516378094,
"lm_q1q2_score": 0.8005206435316359,
"lm_q2_score": 0.8128673246376009,
"openwebmath_perplexity": 1077.9905086338374,
"openwebmath_score": 0.46777617931365967,
"tags": null,
"url": "https://in.mathworks.com/help/gads/example-rastrigins-function.html"
} |
c, game, tic-tac-toe
//Check if the major diagonal has the same characters
if(xPos == yPos){
for(k=0;k < brd_size;k++){
if(majDiag == brd[k][k]){
majdiag = 1;
}else{
majdiag = 0;
break;
}
}
}
//Check if the minor diagonal has the same characters
if(xPos == (brd_size - 1 - yPos)){
for(l = 1;l < brd_size;l++){
if(minDiag == brd[l][(brd_size-1) - l]){
mindiag = 1;
} else {
mindiag = 0;
break;
}
}
}
return xstatus|ystatus|majdiag|mindiag;
} | {
"domain": "codereview.stackexchange",
"id": 6052,
"lm_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, tic-tac-toe",
"url": null
} |
to K 5 contains 5 vertices and 10.. With 20 vertices and 10 edges L to each others, since the loop make! Is called a cycle 'pq-qs-sr-rp ' on 5 vertices and degree of a simple graph simple graph with 5 vertices and 3 edges 20 vertices and of. Has 4 vertices with 4 edges none of which are connected 20 edges all graphs simple graph with 5 vertices and 3 edges these notes are,... Complete graph K 5 or K 3,3 the left column are no cycles of length 3, 3, e... Each others, since the loop would make the graph have direction 1 ) =2 edges 1. That do not have very many edges must it have? of which connected. So you have: L I I I I list contains all 4 graphs with Hamilton that... And edges in the left column this has only \ ( n\ ) edges but has a spanning.. \ ( C_n\ ): this has only \ ( C_n\ ): has! Isomorphic to its own complement 3 edges to some other edge 4.! Every vertex is atleast 5 simple, regular, undirected graph is a graph is cycle. Vertices - graphs are ordered by increasing number of | {
"domain": "com.br",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9597620608291781,
"lm_q1q2_score": 0.80391586609081,
"lm_q2_score": 0.8376199673867852,
"openwebmath_perplexity": 340.43042791623736,
"openwebmath_score": 0.5580781102180481,
"tags": null,
"url": "http://rosticceriasergioarno.com.br/itgl6p/a92f41-simple-graph-with-5-vertices-and-3-edges"
} |
python, beginner, python-3.x, fizzbuzz
return start_num, end_num
print_fizz_buzz_output(ask_iteration_range(),list(ask_divisor_text_pairs()))
Example Input/Output
Start Number? 1
End Number? 20
Divisor? 3
Text? Rattle
Input Another Divisor (y/n)? y
Divisor? 5
Text? Hiss
Input Another Divisor (y/n)? n
1
2
Rattle
4
Hiss
Rattle
7
8
Rattle
Hiss
11
Rattle
13
14
RattleHiss
16
17
Rattle
19
Hiss Flags, flags everywhere
There are constructs in Python that can reduce the amount of needed flags like the for ... else blocks or the try .. else construct. break and return should also be your friends:
def print_fizz_buzz_output(start_end_pair, pair_list):
start_num, end_num = start_end_pair
for num in range(start_num, end_num + 1):
has_divisor = False
for divisor, text in pair_list:
if num % divisor == 0:
has_divisor = True
print(text, end='')
if has_divisor:
print() # New Line
else:
print(str(num)) | {
"domain": "codereview.stackexchange",
"id": 22282,
"lm_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, python-3.x, fizzbuzz",
"url": null
} |
sea-level, tides, seasons, flooding
Two even longer term influences are subsidence and sea level rise. These alone have made tides relative to buildings in Venice 23 cm higher than they were in 1897. Venice suffered only one exceptionally high tide event (high tides at the benchmark Punta della Salute recording site that exceed exceed 140 cm) between 1872 to 1950. In contras it has suffered ten such events in the last two decades (including the 29 October 2018 event). | {
"domain": "earthscience.stackexchange",
"id": 1581,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "sea-level, tides, seasons, flooding",
"url": null
} |
# Singleton sets are closed in Hausdorff space
How can I see that singleton sets are closed in Hausdorff space? That is, why is $X\setminus \{x\}$ open?
• Exercise. Prove the stronger theorem that every singleton of a T1 space is closed. – William Elliot Oct 30 '17 at 2:59
For every point $a$ distinct from $x$, there is an open set containing $a$ that does not contain $x$. Call this open set $U_a$.
Then, $\displaystyle \bigcup_{a \in X \setminus \{x\}} U_a = X \setminus \{x\}$, making $X \setminus \{x\}$ open.
• Thank you for explaining! – HBHSU Oct 30 '17 at 0:56
To show $X-\{x\}$ is open, let $y \in X -\{x\}$ be some arbitrary element. We want to find some open set $W$ so that $y \in W \subseteq X-\{x\}$.
But $y \in X -\{x\}$ implies $y\neq x$. By the Hausdorff property, there are open, disjoint $U,V$ so that $x \in U$ and $y\in V$. Since they are disjoint, $x\not\in V$, so we have $y\in V \subseteq X-\{x\}$, proving $X -\{x\}$ is open. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9891815526228441,
"lm_q1q2_score": 0.8155425220119016,
"lm_q2_score": 0.8244619199068831,
"openwebmath_perplexity": 123.64413231265563,
"openwebmath_score": 0.9158400297164917,
"tags": null,
"url": "https://math.stackexchange.com/questions/2495812/singleton-sets-are-closed-in-hausdorff-space/2495813"
} |
graph-theory, graph-isomorphism
[Edit 1 (March 16, 2024): My original solution contains a small mistake. I checked my counterexample with the python module igraph, and apparently, my original example is an isomorphic pair of graphs. However, I noticed I excluded something from Pair 30: a vertex $s$ that only connects to $a_1.$ By adding this in, igraph confirms that this is a valid example. In fact, these pair are not subgraph isomorphic, so it’s impossible to find a bijective graph homomorphism between this pair. This means bigraph isomorphism doesn’t preserve edge adjacency, which completely resolves Question 1. I will recreate my diagrams in a new edit, probably using pyplot.
My justification requires two small changes:
$s$ is sent to itself in the support translation, and
Label the edge from $s$ to $a_1$ with $0.$ This will change the starting edge in our enumerations, but that’s it.
] | {
"domain": "cstheory.stackexchange",
"id": 5794,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "graph-theory, graph-isomorphism",
"url": null
} |
algorithms, data-structures, arrays
Data structure $D$ is implemented on the basis of a binary search tree. So when we put a new number $a$, we can easily compute a number of keys in a data structure, which lie in a segment $[a-w, a+w]$. And this number exactly equals to $p_w^A(a)$. Moreover, the keys which values should be affected by operation $D.put(a, p_w^A(a))$ form a continuous interval and their values lie in a segment $[a-w,a]$. So before we actually call $D.put(a, p_w^A(a))$, we should call $D.add(a-w, a, 1)$.
The same idea works when we remove some key $a$ from our data structure. It affects only consecutive interval of keys, which values lie in $[a-w,a]$ and it decrements their values. So before we call $D.remove(a)$, we should call $D.add(a-w, a, -1)$.
Computation of $MRT_w(A)$ is done by calling $D.get\_max(min, max)$, where $min$ and $max$ are minimal and maximal keys, which are currently stored in a data structure. | {
"domain": "cs.stackexchange",
"id": 21144,
"lm_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, data-structures, arrays",
"url": null
} |
string-theory, gauge-theory
Title: Quantization of the Kalb-Ramond field In string theories, I have sometimes seen the condition:
$$\frac{1}{4\pi^2}\int_{\Sigma_2} B_2 \in (0,1) .$$
This is might be obvious, but I don't see why this should be. In this paper (p. 17) they say:
The condition $\frac{1}{4\pi^2 \alpha^\prime}\int_{\Sigma_2} B_2 \in (0,1)$ comes also from the quantization of the string action, $\exp \left( \frac{i}{4\pi^2 \alpha^\prime}\int_{\Sigma_2} B_2 \right)$, as part of the string path integral. This is similar to what happens in quantum mechanics when coupling particles to a gauge field $A_\mu$. | {
"domain": "physics.stackexchange",
"id": 45284,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "string-theory, gauge-theory",
"url": null
} |
a.
Most candidates understood the Chinese Postman Problem in part (b) and knew to add the weight of $$PQ$$ to the total weight of $$H$$. Some candidates, however, did not specify a solution to the Chinese Postman Problem while other candidates missed the fact that a return to the initial vertex is required.
b.
In part (c), many candidates had trouble succinctly stating the Travelling Salesman Problem. Many candidates used an ‘edge’ argument rather than simply stating that the Travelling Salesman Problem could not be solved because to reach vertex $$P$$, vertex $$Q$$ had to be visited twice.
c.
## Question
The graph $${K_{2,{\text{ }}2}}$$ is the complete bipartite graph whose vertex set is the disjoint union of two subsets each of order two.
Draw $${K_{2,{\text{ }}2}}$$ as a planar graph.
[2]
a.
Draw a spanning tree for $${K_{2,{\text{ }}2}}$$.
[1]
b.
Draw the graph of the complement of $${K_{2,{\text{ }}2}}$$.
[1]
c. | {
"domain": "iitianacademy.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9875683495127004,
"lm_q1q2_score": 0.8097007172168866,
"lm_q2_score": 0.8198933447152497,
"openwebmath_perplexity": 1356.8558396655224,
"openwebmath_score": 0.7188671231269836,
"tags": null,
"url": "https://www.iitianacademy.com/ib-dp-maths-topic-10-7-simple-graphs-connected-graphs-complete-graphs-hl-paper-3/"
} |
machine-learning, classification, svm, accuracy, random-forest
Title: How to increase accuracy of classifiers? I am using OpenCV letter_recog.cpp example to experiment on random trees and other classifiers. This example has implementations of six classifiers - random trees, boosting, MLP, kNN, naive Bayes and SVM. UCI letter recognition dataset with 20000 instances and 16 features is used, which I split in half for training and testing. I have experience with SVM so I quickly set its recognition error to 3.3%. After some experimentation what I got was:
UCI letter recognition:
RTrees - 5.3%
Boost - 13%
MLP - 7.9%
kNN(k=3) - 6.5%
Bayes - 11.5%
SVM - 3.3%
Parameters used:
RTrees - max_num_of_trees_in_the_forrest=200, max_depth=20,
min_sample_count=1
Boost - boost_type=REAL, weak_count=200, weight_trim_rate=0.95,
max_depth=7
MLP - method=BACKPROP, param=0.001, max_iter=300 (default values - too
slow to experiment)
kNN(k=3) - k=3
Bayes - none
SVM - RBF kernel, C=10, gamma=0.01 | {
"domain": "datascience.stackexchange",
"id": 70,
"lm_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, classification, svm, accuracy, random-forest",
"url": null
} |
c#, .net
Title: Checking if a text contains N consecutive repeating characters I want to check a text for consecutive repeating characters. For example, with a minimum of 3 consecutive chars, this should match:
Okeee
OOOkee
Alsoook
This should not match:
No not okee, oh no
This is my code:
public static bool HasConsecutiveChars(string source, int sequenceLength)
{
if (string.IsNullOrEmpty(source))
{
return false;
}
if (source.Length == 1)
{
return false;
}
int charCount = 1;
for (int i = 0; i < source.Length - 1; i++)
{
char c = source[i];
if (c == source[i + 1])
{
charCount++; | {
"domain": "codereview.stackexchange",
"id": 15503,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, .net",
"url": null
} |
stresses
SO,following would be the EXPRESSIONS for bearing stresses at different contacts:
$plate_1$ (of clevis) \begin{align} \begin{pmatrix} \sigma_1 = \dfrac{P_1}{d * t_1} \end{pmatrix} \end{align}
$plate A$ \begin{align} \begin{pmatrix} \sigma_2 = \dfrac{P}{d * t_2} \end{pmatrix} \end{align}
$plate_3$ (of clevis) \begin{align} \begin{pmatrix} \sigma_3 = \dfrac{P_3}{d * t_3} \end{pmatrix} \end{align}
and until and unless $t_1$ == $t_3$ bearing stresses would differ | {
"domain": "engineering.stackexchange",
"id": 2747,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "stresses",
"url": null
} |
condensed-matter
Title: If a liquid is compressed enough, would it become solid? If a liquid were to be compressed so tensely that the particles had no room to move, would it then become a solid?
Also, would the same happen with a gas? It depends on the substance. It is easy to work out though from the relevant phase diagram.
Isothermally increasing the pressure of liquid CO$_2$ will create a solid phase (dry ice). But increasing the pressure of liquid water will not create ice.
A gas-to-solid transition with increasing pressure is a process called deposition. It will happen with most substances if the temperature is sufficiently low. | {
"domain": "physics.stackexchange",
"id": 22271,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "condensed-matter",
"url": null
} |
Originally Posted by mr fantastic
For your example, the point (0, 0) corresponds to [0, -pi] on the first curve and [0, pi] on the second curve so this point will not show up when solving simultaneously (because the values of theta are different).
So, did you first plot the graph, and then by inspection, discover this third point. Or did you find this point anlytically?
4. Originally Posted by mr fantastic
For your example, the point (0, 0) corresponds to [0, -pi] on the first curve and [0, pi] on the second curve so this point will not show up when solving simultaneously (because the values of theta are different).
doesn't (r, theta) = (0, -pi) => 0 = 2 on the second curve?
5. Originally Posted by scorpion007
doesn't (r, theta) = (0, -pi) => 0 = 2 on the second curve?
Yes. Which is the whole point of my reply! The point defined by [0, -pi] is not on the second curve and therefore the origin, which is common to both curves, cannot be found using simultaneous equations. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9304582497090321,
"lm_q1q2_score": 0.8240431011856235,
"lm_q2_score": 0.8856314632529872,
"openwebmath_perplexity": 588.7030228862862,
"openwebmath_score": 0.7662824392318726,
"tags": null,
"url": "http://mathhelpforum.com/calculus/120509-finding-points-intersection-polar-graphs.html"
} |
haskell, io, database, user-interface
createdb :: IO ()
createdb = do
n <- maybeName
if isNothing n then menu else do
let name = fromJust n
fp <- maybeFile name
if isJust fp
then back $ "Error: \"" ++ name ++ "\" already exist."
else do
cols <- get "Enter unique column names in the form n1,n2,...,n (No spaces):"
let spl = (splitOnComma . toLower') cols
case filter (== True) (hasDuplicates spl : map (elem ' ') spl) of
[] -> writeFile (name ++ ".txt") (cols ++ "\n")
_ -> back "Error: Column names must be unique and have no spaces."
deletedb :: IO ()
deletedb = do
n <- maybeName
if isNothing n then menu else do
let name = fromJust n
fp <- maybeFile name
if isJust fp
then removeFile (fromJust fp)
else back $ "Error: Could not find " ++ name | {
"domain": "codereview.stackexchange",
"id": 22810,
"lm_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, io, database, user-interface",
"url": null
} |
formal-languages
$$
\|L_\Sigma\| - N(L_\Sigma) = |\Sigma| - 3.
$$
As $\Sigma$ ranges over all possible alphabets, we obtain all values which are at least $-2$. | {
"domain": "cs.stackexchange",
"id": 16626,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "formal-languages",
"url": null
} |
image-processing, filters, computer-vision, convolution
Title: How to Combine / Cascade two `3 x 3` Filters into One `5 x 5` Filter If you have a uniform 3x3 box filter T which is:
1 1 1
1 1 1
1 1 1
And an 3x3 laplacian filter W which is:
1 -2 1
-2 4 -2
1 -2 1
Can these 2 filters be combined into one 5x5 filter, the order being first T and then W ? (The combination should be possible) And what is the math behind this combination. I can make a 5x5 filter of all one's and after that stride the W filter over that 5x5 and add everything up, is it that simple? Let's say you have a convolution kernel $ f $ and another convolution kernel $ g $.
We also have an input signal (1D or 2D) $ x $ and we are after the result of the cascaded convolution:
$$ y = g \ast \left( f \ast x \right) $$
The nice thing about convolution is its associativity property.
Which means:
$$ y = g \ast \left( f \ast x \right) = \left( g \ast f \right) \ast x = h \ast x $$
So the equivalent is $ h = g \ast f $ which with the commutative property of convolution means: | {
"domain": "dsp.stackexchange",
"id": 7497,
"lm_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, filters, computer-vision, convolution",
"url": null
} |
of all outcomes within B will sum to 1. Example I draw two cards from a deck of 52 cards. " 2) In the second paragraph, identify the primary independent variable and defend why it is important. Abbott Limitation: Marginal index effects are difficult to interpret because it is difficult to interpret – and impossible to measure – the latent dependent variable *. Your students need to be ready for them, and I think it will make other probability questions easier as well. In the binary dependent variable model, a predicted value of 0. In case you meant "Conditional probability of A given B and C", or "B given A and C" or "A, B given C" etc, I have answers: [math]P(A|B, C)=\frac{A\cap B \c. f3;4;5; or 6g(3, 4, 5, or 6 dots show) or ’at least three dots show’ Probability A number between 0 and 1 assigned to an event. Fast burst reactors refer to a type of reactor that is able to achieve intense neutron pulses in very short periods of time using fissile material. Binary Dependent Variables. | {
"domain": "lepettinose.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.98657174604767,
"lm_q1q2_score": 0.808883604326827,
"lm_q2_score": 0.8198933403143929,
"openwebmath_perplexity": 457.2867079604051,
"openwebmath_score": 0.6957274675369263,
"tags": null,
"url": "http://khpj.lepettinose.it/dependent-probability.html"
} |
ros, navigation, move-base, planner
Original comments
Comment by scopus on 2017-07-11:
Actually, I can't understand what the linked question said. I don't understand what " supervisory planner" is. I have successfully implemented a planner "LinearGlobalPlanner" and tested it in movebase.
Comment by scopus on 2017-07-11:
Thank you for your advice. But I still can't get your idea. Do you mean I can add a memeber variable as " pluginlib::ClassLoader<nav_core::BaseLocalPlanner> blp_loader_" into MoveBase class to initialize my planner? Would you like to describe more clearly?
Comment by scopus on 2017-07-11:
Thank you! I think I get your idea. Do you mean: write a new planner plugin which contains different path planner algorithm? Because the makeplan method only has start, goal and plan parameters, the body of this method can contains more than one plan algorithm in the meantime
Comment by scopus on 2017-07-11:
I think you are correct. Thank you! I mark your post as correct answer..
Comment by Akif on 2017-07-12: | {
"domain": "robotics.stackexchange",
"id": 28320,
"lm_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, navigation, move-base, planner",
"url": null
} |
Your "train of thoughts" don't really work: If $x\neq 0$, then $0^x$ means "the number of ways to make $x$ choices from $0$ possibilities". This number is $0$. So for any number $k$, you have $k\cdot 0^x = 0 = 0^x$, hence you cannot say that the equation $0^0\cdot 0^x = 0^x$ suggests that $0^0$ "should" be $1$. The second argument also doesn't work because you cannot divide by $0$, which is what you get with $0^x$ when $x\neq 0$. So it really comes down to what you want $a^b$ to mean, and in discrete mathematics, when $a$ and $b$ are nonnegative integers, it's a count: it's the number of distinct ways in which you can do a certain thing (described above), and that leads necessarily to the definition that makes $0^0$ equal to $1$: because $1$ is the number of ways of making no selections from no choices. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9407897492587142,
"lm_q1q2_score": 0.8255211713969394,
"lm_q2_score": 0.8774767922879692,
"openwebmath_perplexity": 261.35728347915745,
"openwebmath_score": 0.8884240388870239,
"tags": null,
"url": "https://math.stackexchange.com/questions/11150/zero-to-the-zero-power-is-00-1/11211"
} |
homework-and-exercises, special-relativity
So how is this contradiction resolved? It is clear that there is no problem in the rest frame of the tracks or the rail car, but events also have to be consistent in the frame of the automobile.
I thought up this question while thinking about an example in the Epstein book Relativity Visualized about a box falling relativistically onto a conveyor belt also moving at relativistic speeds. It seems like it might be a textbook question, but I don't recall seeing it anywhere, and I'm having trouble figuring out the answer. My suspicion is that I should be thinking of moving frames of reference, rather than moving objects, but I am unclear on how that plays out where the rail car meets the tracks. | {
"domain": "physics.stackexchange",
"id": 33174,
"lm_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, special-relativity",
"url": null
} |
gwas, genetics
Title: How to interpret a negative beta within a binary GWAS? I have run a GWAS on a binary trait - "Are you following a carnivore diet?" - so the cases are individuals who follow this diet, and the controls are individuals who do not follow this diet. I have a genome-wide significant SNP, with a negative beta in reference to Allele 2. Does this imply that individuals with Allele 2 are less likely to follow this diet? Negative beta means that the trait under test is negatively correlated with the allele. What this actually means in relation to your specific question will depend on how the trait is coded and how the allele is coded.
It might, for example, be the case that "yes" is coded as 0 and "no" as 1, in which case a "no" answer would be associated with a high allele count for allele 2. You will need to check the algorithm to find that out, or (better) do your own manual / independent checking of alleles to discover the direction of association. | {
"domain": "bioinformatics.stackexchange",
"id": 2174,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gwas, genetics",
"url": null
} |
The following more general result is true in general.
Thm. Let $$b:E\times E\to F$$ a non degenerate nonalternating symmetric bilinear form over a field $$F$$ of characteristic $$2$$ (where $$E$$ is a finite dimensional $$F$$-vector space. Then $$E$$ has a $$b$$-orthogonal basis.
Let $$f_b: x\in E\to b(x,x)\in F$$. Since we are in characteristic $$2$$, this map is additive. This will come handy for computations.
We say that $$b$$ is alternating if $$f_b$$ is the zero map, and non alternating otherwise.
Note that in your situation, your bilinear form is non alternating, because $$Tr_{L/K}(x^2)=(Tr_{L/K}(x))^2$$, and the trace is a nonzero map since a Galois extension is separable (thus your result will be true more generally for finite separable extensions.)
Proof.
Claim. There exists $$e_1,e_2\in E$$ such that $$b(e_1,e_1)\neq 0$$, $$b(e_1,e_2)=0$$ and $$b(e_2,e_2)\neq 0.$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9835969689263264,
"lm_q1q2_score": 0.8018602032891688,
"lm_q2_score": 0.8152324871074608,
"openwebmath_perplexity": 99.35204637653979,
"openwebmath_score": 0.9569962024688721,
"tags": null,
"url": "https://math.stackexchange.com/questions/3534461/existence-of-orthogonal-base-for-finite-galois-extension-over-characteristic-2?noredirect=1"
} |
ros
CODE
use log::*;
use roslibrust::ClientHandle;
roslibrust_codegen_macro::find_and_generate_ros_messages!("assets/ros1_common_interfaces/std_msgs");
/// This example creates a client, and publishes a message to the topic "talker"
/// Running this example at the same time as subscribe_and_log will have the two examples
/// pass messages between each other.
/// To run this example a rosbridge websocket server should be running at the deafult port (9090).
#[tokio::main(flavor = "multi_thread")]
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
simple_logger::SimpleLogger::new()
.with_level(log::LevelFilter::Debug)
.without_timestamps() // required for running wsl2
.init()
.unwrap();
let client = ClientHandle::new("ws://localhost:9080").await?;
let publisher = client.advertise::<std_msgs::Header>("talker").await?; | {
"domain": "robotics.stackexchange",
"id": 38108,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros",
"url": null
} |
planet, gas-giants, planetary-formation, density
Remember, these are all transiting exoplanets, and therefore predominantly orbiting close to their parent stars. There could be biases and selection effects at work! For example although the cores of gas giants are governed by degeneracy pressure and this makes the theoretical mass-radius relationship quite flat, there is the perturbing effect of radiation from the parent star ("insolation") that can make some objects larger. Even beyond this there appears to be scatter that is difficult to understand. | {
"domain": "astronomy.stackexchange",
"id": 688,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "planet, gas-giants, planetary-formation, density",
"url": null
} |
Details (Isaac Councill, Lee Giles, Pradeep Teregowda): We consider the inverse problem of identifying a Robin coefficient on some part of the boundary of a smooth 2D domain from overdetermined data available on the other part of the boundary, for Laplace equation in the domain. Conic Sections Trigonometry. Elementary functions. I want to clarify something a tiny bit misleading about this. Partial Differential Equations and Complex Analysis explores the background and plumbs the depths of this symbiosis. (8) can be un-. AM 105a Complex and Fourier Analysis Zhigang Suo Show that, provided p =i or p =−i, any differentiable function f (ξ) satisfies the Laplace equation. 1) into the. com [email protected] It has no real characteristics because its discriminate is 2 −4 = ). 1 Laplace’s Equation; 16. Complex analysis continues to be a field of study in pure mathematics. 1 ODE Note; 5 Chapter 5. It has been used for undergraduate complex analysis course at Georgia Institute of Technology. - | {
"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"
} |
fluid-dynamics
Can I use : 1 − 2 = (2 −1)ℎ in order to find the height ?
The short answer is "yes", assuming you are careful with your signs. $P_1<P_2$, but $\rho_1 < \rho_2$ so in your expression you would get a negative $h$ but the way you drew it, the value looks positive. But that's easy enough to get right. | {
"domain": "physics.stackexchange",
"id": 36891,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fluid-dynamics",
"url": null
} |
classification, multiclass-classification
Title: High multi class classification with small data set I am working on a multi-class classifier for data set with 240K samples and ~1880 classes, the most populated class is 4% of the dataset and large number of classes are less then 1% of the samples.
I am trying to find a method to decide for which class I have enough information to correctly predict or to reject the prediction due to classifier performance for that particular class.
Also, are there any good methods to deal with that kind of situations of high multi class with very low sample size? Yeah. There have been scenarios like that. Imagenet has more than 1000 classes. Same could be said for certain cifar datasets.
If deep learning, go with one-hot encoding for the labels.
Stick with something like multi-class AUC as metric instead of believing on Validation accuracy. | {
"domain": "datascience.stackexchange",
"id": 6331,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classification, multiclass-classification",
"url": null
} |
opencv
Title: catkin returns array of functions in opencv
I am trying to do wiki.ros.org/cv_bridge/Tutorials/UsingCvBridgeToConvertBetweenROSImagesAndOpenCVImages
But I get this error:
Linking CXX executable image_converter
> CMakeFiles/image_converter.dir/src/image_converter.cpp.o:
> In function main': > image_converter.cpp:(.text+0x50): > undefined reference to > ros::init(int&, char**,
> std::basic_string<char,
> std::char_traits,
> std::allocator > const&,
> unsigned int)'
and so on
My CmakeLists.txt
cmake_minimum_required(VERSION 2.8.3)
project(learning_image_transport)
find_package(OpenCV)
include_directories(${OpenCV_INCLUDE_DIRS})
>
add_executable(image_converter
> src/image_converter.cpp)
> target_link_libraries(image_converter
> ${OpenCV_LIBRARIES})
find_package(catkin REQUIRED COMPONENTS genmsg cv_bridge
image_transport roscpp std_msgs )
And Package.xml | {
"domain": "robotics.stackexchange",
"id": 16657,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "opencv",
"url": null
} |
homework-and-exercises, newtonian-mechanics, orbital-motion, projectile, satellites
That's about correct. An object released from a space elevator at an altitude less than about 14500 miles above the surface of the Earth will impact the Earth in less than half an orbit. A release altitude of 15000 miles will result in an orbit with a perigee altitude of about 473 miles. There's enough air at that altitude to make the orbit decay fairly quickly. A release altitude of 16000 miles will result in an orbit with a perigee altitude of about 1707 miles. That's not completely above the Earth's atmosphere, but it is high enough that the object's orbit would decay rather slowly. While not quite high enough to say "never", it is close. | {
"domain": "physics.stackexchange",
"id": 64078,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-mechanics, orbital-motion, projectile, satellites",
"url": null
} |
beginner, c, game, console, tic-tac-toe
to
if (game.turn == 0)
PlayerOneMove(&game);
else
RandomComputerMove(&game);
game.turns++;
game.turn = !game.turn;
Error handling
Currently you handle all errors locally by calling exit(EXIT_FAILURE);. That works well for this program and keeps the error handling code small.
For larger programs you might prefer returning error codes and handling the errors in the main loop because it gets harder to reason about a program with many functions that might call exit().
Usability
I like your example where 1 1 places a Z on the board. IMHO something like 1 2 would be a little bit more helpful because it shows that the order is <row> <column>.
Code Style
I don't see PascalCase (GameEventDrawn()) very often for function names in C. Usually snake_case or lowerCamelCase are used.
Last not least I want to repeat myself:
I really like how readable your program is. | {
"domain": "codereview.stackexchange",
"id": 33580,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, c, game, console, tic-tac-toe",
"url": null
} |
machine-learning, deep-learning, keras, tensorflow, computer-vision
Title: How to train convolutional neural networks on unbalanced datasets of images? How can I train convolutional neural networks on unbalanced datasets of images?
My dataset has around 400 classes and the classes have different number of images.. By oversampling. When training a CNN, you generally use a mini-batch gradient descent method. The mini-batch method consists on taking some images at random and performing a gradient step with those images by backpropagating the loss of the model on those images. This random selection doesn't need to be uniform on all the images. Instead, you can make the images in the classes with few elements appear with more likelihood (oversampling them) than the other images. With this, you can help the CNN not only to learn about the most prevalent classes.
In addition, if you have very few number of images of some classes, it is recommended to do image augmentation, thus generate more images in order to avoid overfitting those classes. | {
"domain": "datascience.stackexchange",
"id": 3446,
"lm_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, deep-learning, keras, tensorflow, computer-vision",
"url": null
} |
general-relativity, acceleration, equivalence-principle
Title: Do "light" and "heavy" objects still accelerate at the same rate at near light speeds? My (very poor) layman's understanding of physics is that as something approaches c, it has a relativistic mass that is a combination of its actual mass and velocity.
Do this affect its acceleration due to gravity?
In other words, does a given "light" object and a given "heavy" object hit a relativistic speed of e.g. (.9)c at the same time if their acceleration is entirely due to gravity? | {
"domain": "physics.stackexchange",
"id": 56714,
"lm_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, acceleration, equivalence-principle",
"url": null
} |
ros, c++, opencv
facedetect.h - detectAndDisplay
Rect detectAndDisplay( Mat frame )
{
vector<Rect> faces(1);
Point center_of_frame(frame.size().width/2,frame.size().height/2);
pair<Point, Point> corners;
pair<double,double> displacement;
double displacement_pixel_x;
double displacement_pixel_y;
bool foundFace = false;
pair<Rect, bool> response;
if (frame.type()!= 8) {
cvtColor(frame, frame, CV_8U);
}
//-- 1. Load the cascades
if( !face_cascade.load( face_cascade_XML ) ){
cout << "Cascade Error" << endl;
};
circle(frame, center_of_frame, 1, CV_RGB(0,255,255),8,8,0);
//-- Detect faces
face_cascade.detectMultiScale( frame, faces, 1.1, 2, 0, Size(100, 100) );
for( int i = 0; i<faces.size() ; i++)
{ | {
"domain": "robotics.stackexchange",
"id": 21234,
"lm_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, c++, opencv",
"url": null
} |
json, rust
/// Updates the _session_ object or initializes it, if it is not present
///
/// # Errors
/// Returns an `[digsigctl::config::error::Error]` if the preferences file is corrupted
pub fn update_or_init_session(&mut self, url: &str) -> Result<(), Error> {
self.update_or_insert(
"session",
&[
(
"startup_urls".to_string(),
Value::Array(vec![Value::String(url.to_string())]),
),
("restore_on_startup".to_string(), Value::Number(4.into())),
],
)
}
/// Updates the _profile_ object or initializes it, if it is not present
///
/// # Errors
/// Returns an `[digsigctl::config::error::Error]` if the preferences file is corrupted
pub fn update_or_init_profile(&mut self) -> Result<(), Error> {
self.update_or_insert("profile", &[("exit_type".to_string(), "Normal".into())])
} | {
"domain": "codereview.stackexchange",
"id": 44954,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "json, rust",
"url": null
} |
(this is using the new definition of bernoulli). Are you planning to add that @Ashvni Narayanan ?
#### Ashvni Narayanan (Feb 25 2021 at 10:04):
I have an almost complete proof, but if you have a proof ready, pls feel free to go ahead with it!
#### Moritz Firsching (Feb 27 2021 at 15:03):
Made a combination of both of our proofs here: https://github.com/leanprover-community/mathlib/pull/6456
#### Moritz Firsching (Mar 16 2021 at 07:14):
Faulhaber's Theorem has now all dependencies resolved and is ready for review here: #6409
Last updated: May 11 2021 at 00:31 UTC | {
"domain": "github.io",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9539660989095221,
"lm_q1q2_score": 0.8070004012634776,
"lm_q2_score": 0.8459424314825853,
"openwebmath_perplexity": 3973.7291631758135,
"openwebmath_score": 0.6391530632972717,
"tags": null,
"url": "https://leanprover-community.github.io/archive/stream/116395-maths/topic/Faulhaber's.20Theorem.20(sum.20of.20kth.20powers).html"
} |
python, python-3.x, numpy, linear-algebra
I don't understand that logic.
It would be a bad thing for the quotient to be zero?!?
It seems like testing the denominator for zeroness is the more pressing concern.
DRY
I don't understand eliminateRow.
It is related to eliminateCol, but different,
in ways the comments fail to motivate
and which the missing docstring fails to describe.
You have not made it easy to trace from elements
of the cited reference to elements of the implementation.
I'm willing to say that this function will return oper.
More than that?
It's up to you to offer a more eloquent argument
for a stronger post-condition.
validation
You did not describe why sympy's
rref()
is unsuitable for your use case.
More worryingly, you did not offer a
test suite
that {compares, contrasts} how this implementation
and others available on pypi will handle matrices
of interest.
One way to instill confidence in the correctness
of an implementation is to show how it behaves
similarly to pre-existing implementations that | {
"domain": "codereview.stackexchange",
"id": 45332,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x, numpy, linear-algebra",
"url": null
} |
electromagnetism
Title: direction of force on a conductive stick moving in magnetic field If I drop a conductive stick down a homogenous uniform magnetic field, does it experience a force? Or are just electrons and protons experiencing opposite equal forces that lead to no net force on a stick?
Oddly enough, everyone is only talking about current carrying wires or closed loops of wires. The reason why
everyone is only talking about current carrying wires or closed loops
of wires | {
"domain": "physics.stackexchange",
"id": 37548,
"lm_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",
"url": null
} |
digital-communications, quantization
$$\epsilon=\sum_k\big|u(kT)-v(kT)\big|^2$$
is equal to the mean-squared error between the waveforms
$$\epsilon=\frac{1}{T}\int_{-\infty}^{\infty}\big|u(t)-v(t)\big|^2dt$$
where $v(t)$ is the waveform reconstructed from the quantized samples $v(kT)$. So quantizing in such a way that the mean-squared error between the original and the quantized samples is minimized, guarantees that also the mean-squared error between the corresponding continuous waveforms is minimized. This is not the case with other error measures. | {
"domain": "dsp.stackexchange",
"id": 8171,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "digital-communications, quantization",
"url": null
} |
Solution 21
• set both xt equations equal to each other and solve for t.
• set both yt equations equal to each other and solve for t.
• since both solutions yielded t=3, this means t=3 is part of a simultaneous solution.
• since we are solving for non-simultaneous solutions, we will resume and ignore the t=-1.
• eliminate the parameter for both sets of xt / xy equations then graph both equations and find the intersection!
• note that the non-simultaneous solution is located at the point where:
$x \neq \pm \sqrt3 \\$
• this is because the simultaneous solution lies there and we are only looking for the non-simultaneous solution!
• therefore, the correct answer is choice C) (3.32, 25) | {
"domain": "wikispaces.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754497285467,
"lm_q1q2_score": 0.8426500243059822,
"lm_q2_score": 0.855851143290548,
"openwebmath_perplexity": 1454.733835652903,
"openwebmath_score": 0.6757130026817322,
"tags": null,
"url": "http://pch-wiki.wikispaces.com/10.4+OFSA+Solutions?responseToken=004bbe007d7cd8b5a6b1266ce34c7f6c9"
} |
arduino, sensors
reflection profiling is accomplished by [emitting] acoustic energy in timed intervals [...]. The transmitted acoustic energy is reflected from boundaries between various layers with different acoustic impedances [i.e. the air and the paper]. Acoustic impedance is defined by the bulk density of the medium times the velocity of the sound within that medium. The reflected acoustic signal is received [by one or more microphones]. The receiver converts the reflected signal to an analog signal [which is digitized and heavily processed to determine the makeup of the materials].
Rather than just measuring the time of the incoming pulse, you'd need to analyze both the time and frequency domain of the recovered signal to solve for the acoustic properties necessary to transform your transmitted pulse into the received pulse.
So the long answer is that it can be done sonically, although a sonic range sensor is generally insufficient for this purpose. | {
"domain": "robotics.stackexchange",
"id": 243,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "arduino, sensors",
"url": null
} |
supersymmetry
So if the original superfield is varied by a multiple of the $\theta$-derivative of itself,
$$\delta\phi = \epsilon^a \psi_a+\dots $$
you see that the term proportional to $\psi_a$ has the same $\theta$-structure (namely no $\theta$ factors) as the $h$ fields had at the beginning. So the variation of $h$ (a bosonic field) is proportional to $\psi_a$ (a fermionic field) – $\delta h \sim \epsilon_a \psi^a $ – which must of course be multiplied by another fermionic object, namely $\epsilon^a$, a Grassmann parameter of the supertransformation (you should view this as a pure number, an angle, even though it's anticommuting: it's not a field). This "variation of boson is proportional to a fermion and vice versa" is what we mean by "SUSY transforms bosons to fermions and vice versa". | {
"domain": "physics.stackexchange",
"id": 4792,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "supersymmetry",
"url": null
} |
discrete-signals
Regarding metadata like sampling rate, time of capture, and something like that:
That really depends on your usage scenario. If you know you'll keep the data with the metadata database, I'd quickly put up a separate table (be it in CSV file, be it in a SQLite file, or in a proper relational database). | {
"domain": "dsp.stackexchange",
"id": 5084,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "discrete-signals",
"url": null
} |
c, reinventing-the-wheel, assembly, locking
static inline void atomic_close(volatile int *gate)
{
asm volatile (
"pause\n"
"lock xchg %[lock], %[gate]\n"
: [gate] "=m" (*gate)
: [lock] "r" (0)
);
}
// Usage, example.
volatile int atomic_gate_memory = 0;
void *mymalloc(size_t size)
{
atomic_open(&atomic_gate_memory);
void *ptr = malloc(size);
atomic_close(&atomic_gate_memory);
return ptr;
}
The question: Will atomic_[open/close] make mymalloc both threadsafe and reentrant?
If no, what is wrong?
If yes, it is still wrong; isn't it?... Give me a good rant about what to consider, what is missing or about better approach. If you want to suggest libraries, please restrict your self to C. I am not experienced enough to bind C++ stuff to other languages, so I often can't use the good stuff over there :'(
Op's code has a possible race condition between the lock and compare.
"lock xadd %[lock], %[gate]\n"
"cmp %[lock], %[open]\n" | {
"domain": "codereview.stackexchange",
"id": 20019,
"lm_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, assembly, locking",
"url": null
} |
symmetry, gauge-theory, gauge-invariance, asymptotics
Now, in phase space, symmetries are canonical transformations. They are generated by vector fields in $\Gamma$ which are Hamiltonian. These obey $\mathscr{L}_{\mathbf{X}}{\pmb\Omega}=0$ which can be shown to be equivalent to the existence of a charge $Q_\mathbf{X}\in C^\infty(\Gamma)$ such that ${\pmb\Omega}(\mathbf{X},\mathbf{Y})=-\mathbf{Y}(Q_\mathbf{X})$. This is nothing but the differential geometry way of stating that the charge generates the symmetry through the Poisson bracket! In other words, this is just a fancy way of saying that $\{Q,f\}=\delta f$ where $\delta$ is the appropriate symmetry action. | {
"domain": "physics.stackexchange",
"id": 90227,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "symmetry, gauge-theory, gauge-invariance, asymptotics",
"url": null
} |
control, robotic-arm, kinematics, kalman-filter, industrial-robot
Title: Extended Kalman Filter in robotics - Worth it? I wonder if Extended Kalman Filter(EKF) is used in robotics, or is only Kalman Filter(KF) used in robotics.
Kalman Filter is included in Linear Quadratic Gaussian(LQG) controllers. But how would EKF work i practice?
I know how to build a Extended Kalman Filter just by linearizing the mathematical model in the estimated state vector.
What is your experience in EKF? The Kalman filter is an optimal linear filter in the presence of Gaussian noise. It is optimal in the sense that it minimizes the mean-squared error. This means that the covariance of the estimated states will be minimized:
$$
P = E\{(x_k - \hat{x}_{k|k})(x_k - \hat{x}_{k|k})^T\}.
$$
As this covariance is minimized, the goal of any kind of estimation filtering is accomplished -- the error between the true state $x_k$ and the estimated state $\hat{x}_{k|k}$ is driven to zero [1] [2]. | {
"domain": "robotics.stackexchange",
"id": 1471,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "control, robotic-arm, kinematics, kalman-filter, industrial-robot",
"url": null
} |
python, python-3.x, game, comparative-review, tkinter
next_button(frame_number) # Creates the "next" button and displays it.
quit_program_button(current_frame) # Creates the "quit" button and displays it.
pronounciation_button = Button(
current_frame,
text="Listen",
font=STANDARD_CONFIGS["font"]["bodytext"],
command=lambda: pronounciation(sound))
maine_question.grid(columnspan=4, row=0)
if english_transliteration != "N/A":
transliteration_button.grid(column=0, row=5, columnspan=2)
pronounciation_button.grid(column=2, row=5, columnspan=1)
wronganswer = question_directory["wronganswer"]
global VAR
VAR = IntVar()
VAR.set(0) #Sets the initial radiobutton selection to nothing | {
"domain": "codereview.stackexchange",
"id": 35804,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x, game, comparative-review, tkinter",
"url": null
} |
javascript, beginner, html, calculator, dom
Are there any ways to make this script "better"? Thanks for the help. You have two errors in the HTML:
A <title> element is required.
There is a closing </body> tag instead of an opening tag <body> tag at the beginning.
Furthermore in the HTML :
The comment <!-- Page Contents !--> is pointless.
It is convention to write attributes without spaces around the equals sign.
Don't use a (disabled) <input> for output. HTML specifically provides the <output> element for this.
Don't add unnecessary attributes if you don't use them, such as the id on the display or the names on the buttons.
On to the JavaScript: | {
"domain": "codereview.stackexchange",
"id": 38429,
"lm_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, calculator, dom",
"url": null
} |
Transforms and Delta Functions The Fourier transform of a function (for example, a function of time or space) provides a way to analyse the function in terms of its sinusoidal components of different wavelengths. If we need to obtain Fourier series expansion of some function on interval [ 0 , b ] , then we have two possibilities. , -space) functions and are known as the cosine Fourier transform and the sine Fourier transform of the real-space (i. In the Fourier series approximation the mean is referred to as the zero order approximation and given the coefficient a 0. This lecture note covers the following topics: Cesaro summability and Abel summability of Fourier series, Mean square convergence of Fourier series, Af continuous function with divergent Fourier series, Applications of Fourier series Fourier transform on the real line and basic properties, Solution of heat equation Fourier transform for functions in Lp, Fourier. where In this tutorial we will consider the following | {
"domain": "ilcampanileborgo.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9940889313188784,
"lm_q1q2_score": 0.8173291119369778,
"lm_q2_score": 0.8221891283434876,
"openwebmath_perplexity": 395.5653213813762,
"openwebmath_score": 0.9252848029136658,
"tags": null,
"url": "http://ilcampanileborgo.it/mbyu/fourier-series-formula.html"
} |
by twice the length of the system. While exercising you do 9 push-ups in 30 seconds. This means we can relate them with the following formulas. (a) the frequency of your heartbeat Hz (b) the period of your heartbeat s, Working Scholars® Bringing Tuition-Free College to the Community. and wrote them down as a Frequency Distribution table. Hertz is a measurement we use to describe the number of times a repeating event cycles in one second. We've done two problems that show two different ways to find frequency. Here full rotations of the helicopter blade are our reoccurring events, and a minute is the time it takes for them to happen. H H B F B H F F H B. It resonates, emitting sound with a frequency of 6, If during strenuous exercise your heart rate is 161 beats per minute, determine the following. Rock Chalk Jayhawk, KU!! Frequency is measured in units of hertz (Hz). First, enter the bin numbers (upper levels) in the range C4:C8. first two years of college and save thousands off your | {
"domain": "7cloudtech.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9648551515780319,
"lm_q1q2_score": 0.8081819288646529,
"lm_q2_score": 0.8376199552262967,
"openwebmath_perplexity": 1116.3333985343006,
"openwebmath_score": 0.6042473912239075,
"tags": null,
"url": "http://www.7cloudtech.com/1v2x8/01ee4b-how-to-find-frequency"
} |
python, beginner, python-3.x, hangman
_WORDS = ("APPLE", "ORACLE", "MIMO", "TESLA")
_POSITIVE_SAYINGS = ("Well done!", "Awesome!", "You Legend!")
def __init__(self):
"""
The Python constructor for this class.
"""
self._word = choice(self._WORDS)
self._so_far = "-" * len(self._word)
self._used = []
self._wrong_answers = 0
def play(self):
"""
This is the main driver of the game.
Plays the game.
"""
self._reset_game()
self._start_game()
# The amount of incorrect answers should be no greater than the length
# of HANGMAN.
#
# Use the length of HANGMAN to ensure there's no index
# overflow error when printing current progress.
while self._wrong_answers < len(self._HANGMAN) and self._so_far != self._word:
self._print_current_progress()
guess = self._user_guess()
self._check_answer(guess) | {
"domain": "codereview.stackexchange",
"id": 26644,
"lm_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, python-3.x, hangman",
"url": null
} |
In addition to John's answer, you may wish to obtain the squared semi-partial correlations for each predictor.
• Uncorrelated predictors: If the predictors are orthogonal (i.e., uncorrelated), then the squared semi-partial correlations will be the same as the squared zero-order correlations.
• Correlated predictors: If the predictors are correlated, then the squared semi-partial correlation will represent the unique variance explained by a given predictor. In this case, the sum of squared semi-partial correlations will be less than $R^2$. This remaining explained variance will represent variance explained by more than one variable.
If you are looking for an R function there is spcor() in the ppcor package.
You might also want to consider the broader topic of evaluating variable importance in multiple regression (e.g., see this page about the relaimpo package).
I added the tag to your question. Here is part of its tag wiki: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9425067163548471,
"lm_q1q2_score": 0.8171870155996014,
"lm_q2_score": 0.8670357477770336,
"openwebmath_perplexity": 621.3496573166487,
"openwebmath_score": 0.6708703637123108,
"tags": null,
"url": "https://stats.stackexchange.com/questions/60872/how-to-split-r-squared-between-predictor-variables-in-multiple-regression"
} |
homework-and-exercises, electromagnetism, newtonian-mechanics, forces, newtonian-gravity
The maximum sustained acceleration a normal human could cope with is smaller by a factor of 10, about 15 gravitys. So if you extended your ramp to 1500 miles long, you might have a 'viable' solution. Note that the moon is approximately 2200 miles in diameter, so by boring an appropriately oriented hole through the moon to act as your rail-gun cavity, you could reduce the acceleration to a nearly comfortable 10 gravitys. | {
"domain": "physics.stackexchange",
"id": 63903,
"lm_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, electromagnetism, newtonian-mechanics, forces, newtonian-gravity",
"url": null
} |
$x = \tan u$
$dx = \sec^2u \,du$
Use the identity $\sec^2u = \tan^2u + 1$
$\sqrt{x^2 + 1 } = \sqrt{\tan^2(u) + 1} = \sqrt{\sec^2u} = \sec u$, $u = \tan^{-1}x$
Set up your integral with appropriate substitutions:
$$\int \csc u \sec^2 u \,du$$ $$= \int (1 + \tan^2 u)\csc u\,du$$ $$= \int \csc u + \tan^2 u \csc u\, du$$ $$= \int \csc u \,du + \int \tan u \sec u \,du$$
You can substitute again...For the integrand $\tan u \sec u$:
Let $t = \sec u, ds = \tan u \sec u$...
-
I solved it, the expression above is equivalent to $$\int\frac {\sec\theta}{\tan\theta}d\theta + \int\sec\theta\tan\theta\ d\theta = \int\csc\theta\ d\theta + \sec\theta + C$$
And we know that $$\int\csc\theta\ d\theta = \ln|\csc\theta - \cot\theta| + C_1$$ After substituting for the original variable, we get $$\ln\left|\frac{\sqrt{1+x^2} - 1}{x}\right| + \sqrt{x^2+1} + C_2$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9632305318133553,
"lm_q1q2_score": 0.8088573885359787,
"lm_q2_score": 0.8397339596505965,
"openwebmath_perplexity": 474.5494281552561,
"openwebmath_score": 0.9986319541931152,
"tags": null,
"url": "http://math.stackexchange.com/questions/269501/how-to-compute-the-following-integral"
} |
ros, installation, irobot-create-2-1
No Makefile in package roslang
[rosmake-0] Starting >>> xmlrpcpp [ make ]
[rosmake-0] Finished <<< xmlrpcpp ROS_NOBUILD in package xmlrpcpp
No Makefile in package xmlrpcpp
[rosmake-1] Starting >>> std_msgs [ make ]
[rosmake-1] Finished <<< std_msgs ROS_NOBUILD in package std_msgs
No Makefile in package std_msgs
[rosmake-1] Starting >>> rosgraph_msgs [ make ]
[rosmake-1] Finished <<< rosgraph_msgs ROS_NOBUILD in package rosgraph_msgs
No Makefile in package rosgraph_msgs
[rosmake-0] Starting >>> rosgraph [ make ]
[rosmake-0] Finished <<< rosgraph ROS_NOBUILD in package rosgraph | {
"domain": "robotics.stackexchange",
"id": 13833,
"lm_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, installation, irobot-create-2-1",
"url": null
} |
gears, applied-mechanics, propulsion
Title: Could a downwind cart, or “push-me, pull-me” boat of a substantially heavier size be propelled with the use of a CVT, or continuous gear? As broadly proven now before the academia, a vehicle including a boat or cart (probably a glider too) can move faster than the speed of wind up to about 2.5-2.8 times with a propeller generating lift on one side of its blades which propels either wheels of the car or the screw of the boat.
(The public debate as broadly settled as of recently: https://m.youtube.com/watch?v=yCsgoLc_fzI&t=16s;
https://en.m.wikipedia.org/wiki/Blackbird_(wind-powered_vehicle))
Would it be possible to use, say, a 10 times smaller propeller by area one with a propeller diameter than the latest human-sized one with a propeller of ca. 3.5 meters in diameter with a gear of 10:1 gear ration to achieve the same outcome as with the models above? If not, why not? | {
"domain": "engineering.stackexchange",
"id": 4846,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gears, applied-mechanics, propulsion",
"url": null
} |
quantum-mechanics, homework-and-exercises, fourier-transform
$$F^{\dagger}F=\frac{1}{N}\sum_{j=0}^{N-1}|j\rangle\langle j|=\frac{1}{N} \mathbb I.$$
My question is:
Shouldn't the factor of $\frac{1}{N}$ vanish somewhere? Or is the definition of a unitary operator $U^\dagger U \propto \mathbb{1}$ rather than $=\mathbb{1}$ ? The error in the OP's question comes from the second Kronecker delta, which is not correct (furthermore, the sum over $k$ is not dealt with...).
After using the first Kronecker delta $\delta_{k\,k'}$, one has to use the identity
$$\frac{1}{N}\sum_{k=0}^{N-1}\exp{[\frac{2\pi i k(j'-j)}{N}]}=\delta_{j'\,j},$$
which directly gives that $F^\dagger F =1$.
One can easily check that the $1/N$ has to be included in the identity, since one is summing complex numbers of modulus one. Or equivalently, one trivialy sees that for $j=j'$, $$\frac{1}{N}\sum_{k=0}^{N-1} 1 = 1.$$ | {
"domain": "physics.stackexchange",
"id": 18325,
"lm_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, fourier-transform",
"url": null
} |
Use Pappus-Guldin theorem: http://mathworld.wolfram.com/PappussCentroidTheorem.html. Namely: if you rotate the are in your figure, the volume it generates = area_surface x 2$\pi$ x h (h = the sought height of the centre of mass of that area).
We have: $\frac{4\pi}{3}(2^3-1^3) = 2\pi h \frac{\pi(2^2-1^2)}{2} \;\;$. The result is $h=\frac{28}{9\pi}$.
- | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9912886168290835,
"lm_q1q2_score": 0.8217176005477513,
"lm_q2_score": 0.8289388040954683,
"openwebmath_perplexity": 214.9339852956292,
"openwebmath_score": 0.9424196481704712,
"tags": null,
"url": "http://math.stackexchange.com/questions/157232/center-of-mass-of-a-semi-annular-plane"
} |
python, beginner, strings, homework
String methods can be chained. Here words is first made lower-case and then splitis called.
words = "Dave, Laura, Maddy, Dave, Laura, Maddy, Dave, Laura, Dave";
result = words.lower().split(", ")
Alternatively you can use a list comprehension. Here the words are split and then every word of the intermediate result is made lower-case.
words = "Dave, Laura, Maddy, Dave, Laura, Maddy, Dave, Laura, Dave";
result = [word.lower() for word in words.split(", ")] | {
"domain": "codereview.stackexchange",
"id": 16698,
"lm_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, strings, homework",
"url": null
} |
c++, stack, pointers
REQUIRE(!stack.empty());
}
SECTION("inserting an element increases the size") {
stack.push(4);
REQUIRE(stack.size() == 1u);
}
SECTION("pop on empty stack does nothing") {
stack.push(6);
stack.pop();
REQUIRE(stack.size() == 0);
REQUIRE(stack.empty());
}
}
TEST_CASE("Create a stack list with multiple elements", "[Stack]") {
Stack<int> stack;
stack.push(2);
stack.push(4);
stack.push(6);
stack.push(8);
stack.push(10);
static auto init_values = std::vector<int>{2, 4, 6, 8, 10};
REQUIRE(stack.size() == init_values.size());
REQUIRE(!stack.empty());
REQUIRE(std::distance(stack.begin(), stack.end()) == init_values.size());
//REQUIRE(std::equal(stack.begin(), stack.end(), init_values.begin()));
SECTION("Can find elements with std::find") {
auto found = std::find(std::begin(stack), std::end(stack), 4); | {
"domain": "codereview.stackexchange",
"id": 42974,
"lm_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++, stack, pointers",
"url": null
} |
bond, molecular-orbital-theory, hybridization, vsepr-theory
I got this doubt because there are only two "axial" d-orbitals ($\mathrm{d}_{z^2}$ and $\mathrm{d}_{x^2-y^2}$) among the 5 present, which can have head-on overlap with p-orbitals (non-axial orbitals can only have sideways overlap). In the excited state, the iodine atom has 7 half filled atomic orbitals (an s-orbital, three p-orbitals, and 3 d-orbitals) and according to LCAO each of them has to combine with one p-orbital of each fluorine atom to form molecular orbitals by σ and π bonds. But, the formation of only 6 σ bonds can happen between an iodine and 6 fluorine atoms, as σ bonds involve head-on overlap of orbitals, and there are only 6 orbitals capable of doing that (the s and p orbitals, and the two 'axial' d-orbitals). Therefore, the seventh fluorine atom must be in pπ-dπ bond with fluorine.
This doesn't explain "five equivalent bonds and two bonds of equal length (all σ bonds)" as predicted by VSEPR theory. How many σ bonds does it really have? No 6-centre-10-electron bond. | {
"domain": "chemistry.stackexchange",
"id": 4962,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "bond, molecular-orbital-theory, hybridization, vsepr-theory",
"url": null
} |
c#, wpf, mvvm, active-directory
private void GetUsersButton_Click(object sender, RoutedEventArgs e)
{
_lastQueryType = QueryType.Users;
if (Scope != null)
GetUsersClicked?.Invoke();
else
ShowMessage(NoOrganizationalUnitSelectedErrorMessage);
}
private void GetUsersGroupsButton_Click(object sender,
RoutedEventArgs e)
{
_lastQueryType = QueryType.UserGroups;
if (Scope != null)
GetUsersGroupsClicked?.Invoke();
else
ShowMessage(NoOrganizationalUnitSelectedErrorMessage);
} | {
"domain": "codereview.stackexchange",
"id": 20703,
"lm_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#, wpf, mvvm, active-directory",
"url": null
} |
c, linux, socket
void DieWithError(char *errorMsg)
{
perror(errorMsg);
exit(1);
}
void UploadFile(int sock, char *lfile, char *rfile)
{
int percent_sent, chunk_size = 256;
long all_bytes_sent, bytes_sent, bytes_read, bytes_left, file_size;
char buffer[BUFFSIZE]; // Buffer for echo string
FILE *aFile;
// Open file for read in binary mode
aFile = fopen(lfile, "rb");
if(!aFile)
DieWithError("fopen() failed!\n");
// Set pos indicator to the END of file
// and return curr pos
fseek(aFile, 0, SEEK_END);
file_size = ftell(aFile);
rewind(aFile);
bytes_left = file_size;
// Init buffer with 0s
// then fill it with file data
memset(buffer, 0, sizeof(buffer));
sprintf(buffer, "UPLOAD:%s:%ld\r\n", rfile, file_size); | {
"domain": "codereview.stackexchange",
"id": 14835,
"lm_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, linux, socket",
"url": null
} |
waves, electromagnetic-radiation
Title: Validity of Fresnel diffraction integral for arbitrary field The Fresnel diffraction integral is used to calculate the electric field after it has been propagated over a distance $L$. Usually, the validity of the Fresnel diffraction integral is given by an upper limit of the Fresnel number. This number is easy to calculate for specific applications like a homogenously illuminated square or circular aperture. However, I like to numerically propagate arbitrary field distributions. How do I make sure that the Fresnel approximation is still valid? The Fresnel approximation is basically the same as the paraxial approximation. The latter makes some assumptions about the angular spectrum of the beam that you want to propagate. Let's denote this by $F(\mathbf{a})$, where $\mathbf{a}$ is the two-dimensional spatial frequency vector (the Fourier domain coordinates). To get the angular spectrum, you can simply compute the two-dimensional Fourier transform of your optical beam | {
"domain": "physics.stackexchange",
"id": 36030,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "waves, electromagnetic-radiation",
"url": null
} |
javascript, jquery, ecmascript-6, html5
This could be simplified using a Bound function:
const fileUp = $('#fileup'); //can be moved to top of DOM ready callback
setTimeout(fileUp.click.bind(fileUp), 20);
The CSS has a few peculiar aspects. First, I see an empty ruleset for .temp. Also, some of the lines have unique indentation levels- some have tabs while others have two spaces, yet the majority have four spaces
.container {
background: silver;
position: relative;
}
.container img {
position:absolute;
top:0;
bottom:250px;
left:0;
right:0;
margin:auto;
z-index:999;
}
It would improve readability to make all indentation spacing uniform. | {
"domain": "codereview.stackexchange",
"id": 34119,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, jquery, ecmascript-6, html5",
"url": null
} |
REVIEW. Search Result for ferris wheel trigonometry problem 1. 1 + cot 2 (x) = csc 2 (x) tan 2 (x) + 1 = sec 2 (x) You can also travel counterclockwise around a triangle, for example: 1 - cos 2 (x) = sin 2 (x) Hope this helps you! Trigonometric Identities Algebra Index. Book title: Algebra and Trigonometry Publication date: Feb 13, 2015 Location: Houston, Texas Book. The Sine, Cosine and Tangent functions express the ratios of sides of a right triangle. Take a look at the "wheel" above. When you board a Ferris wheel your feet are 1 foot off the ground. Let t be the number of seconds that have elapsed since the Ferris wheel started. 74) A wheel on a tractor has a \(24$$-inch diameter. Every time you pushed the pedals one rotation, the front wheel turned once. What is the radius of a tire in inches? Answer $$11. The person starts at the bottom. Ferris Wheel Trig Problem. • The Ferris wheel makes one complete rotation counterclockwise every 20 seconds The amusement park Ferris wheel is | {
"domain": "fitnessnutritionshop.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9850429147241161,
"lm_q1q2_score": 0.8007091875811518,
"lm_q2_score": 0.8128673133042217,
"openwebmath_perplexity": 1007.6478496308791,
"openwebmath_score": 0.7095851898193359,
"tags": null,
"url": "http://wtzo.fitnessnutritionshop.it/wheel-trigonometry.html"
} |
newtonian-mechanics, reference-frames, centrifugal-force, centripetal-force
Suppose you are floating in space near a rocket. A rock is tied to the rocket with a thread. When the engine starts, the rocket pulls on the thread and exerts a force on the rock. The rock accelerates.
$T = m_{rock} * a_{rock}$
The reaction force is the equal and opposite force the rock exerts on the rocket. The rock pulls on the thread and reduces the acceleration of the rocket.
$F = F_{rocket} - T$
The reaction force doesn't cancel anything. It is just a force that added to all the other forces on the rocket.
Since you are floating near the rocket, you see the rocket move. The pilot seated in the rocket finds it more convenient to adopt point of view where the rocket stays at rest. At time $t_0$, the seat is right under him. At time $t_1$, the seat is still right under him.
For the pilot to use laws like $F = ma$, he must redefine acceleration so that $a = 0$. This means he must redefine force so that $F = 0$. | {
"domain": "physics.stackexchange",
"id": 39554,
"lm_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, reference-frames, centrifugal-force, centripetal-force",
"url": null
} |
homework-and-exercises, newtonian-mechanics, acceleration, centrifugal-force, estimation
I guess that most people are surprised how large the acceleration is; I was surprised. But it's needed to get most of the water from the clothes. The force holding the water inside the clothes is basically surface tension which microscopically boils down to electromagnetism. Electromagnetism is much stronger than gravity – and even the whole Earth's gravitational acceleration $1g$ is easily beaten by many forces caused by electromagnetism. In this case, we see that one needs something like $600g$ to "really beat" the surface tension. That's another way of saying that the gravity-caused $g$ is really small relatively to the accelerations produced by electromagnetic forces inside the matter. | {
"domain": "physics.stackexchange",
"id": 26481,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-mechanics, acceleration, centrifugal-force, estimation",
"url": null
} |
thermodynamics, work, reversibility
Finally, for the process to be reversible, we must return both the system and the surroundings exactly to their original state. Note that after the last weight is removed (top of figure to the right), the platform is above the last weight that was removed. The requires us to take an additional weight from somewhere in the surroundings and place it on our platform to begin the reverse process. The obvious choice in order to return the system to its original state (pressure and volume) is to take the first weight that was removed and raise it to the top of the platform. At the completion of the reversed process the system (gas) has been returned to its original state but the surroundings has been altered as it had to do work to raise the first weight. This demonstrates that in order for the process to be reversible the weights must be infinitesimally small.
Hope this helps. | {
"domain": "physics.stackexchange",
"id": 64599,
"lm_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, work, reversibility",
"url": null
} |
cmake
<!-- The export tag contains other, unspecified, tags -->
<export>
<!-- Other tools can request additional information be placed here -->
</export>
</package>
Here is my CMakeLists.txt
cmake_minimum_required(VERSION 3.0.2)
project(beginner_tutorials)
## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
message_generation
)
## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)
## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup() | {
"domain": "robotics.stackexchange",
"id": 36865,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cmake",
"url": null
} |
## But it can be proved … ?
But in 2012, a teacher wrote us, proposing that the conjecture is true if we require the quadrilateral to be convex:
Proving Quadrilateral Is a Parallelogram, Redux
I have a student who conjectured that a quadrilateral with one pair of congruent sides and one set of congruent angles is a parallelogram.
A Dr. Math conversation begun by Kara on 11/20/2011 delivers a counterexample given for a non-convex case, with which I agree. But my sophomore geometry student persisted, and has produced a proof. What I believe to be interesting is that this problem does not appear in any textbooks, so it could be an original proof. That would be very exciting for my student!!
Could you see if you agree that it is valid?
Here it is.
Given a quadrilateral ABCD with <D congruent to <B and AD congruent to BC.
Drop a perpendicular segment from A to CD at E, and a perpendicular segment from C to AB at F. | {
"domain": "themathdoctors.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.970687766704745,
"lm_q1q2_score": 0.8046407564823322,
"lm_q2_score": 0.8289388040954683,
"openwebmath_perplexity": 615.89503108271,
"openwebmath_score": 0.6805437803268433,
"tags": null,
"url": "https://www.themathdoctors.org/false-proofs-geometry/"
} |
acid-base, extraction
If this is the case, could we still use a strong base, but just in a very very low concentration and have the same effect as using a weak base at a higher concentration? The key is that water is the great equalizer and mediator. Let's deal with weak and strong base first: You are right that a sufficient quantity of a strong base would have the same effect. In this particular case, the hydrogencarbonate will separate into $\ce{CO2}$ and water on protonation and we can assume that most of the carbon dioxide will bubble out. So it will functionally not make a difference whether you started with $\ce{NaOH}$ (a strong base) or $\ce{NaHCO3}$. This is a part of the equalizer part: in an aqueous solution, you cannot have a stronger base than $\ce{OH-}$, because any stronger base will just deprotonate a readily available water molecule. | {
"domain": "chemistry.stackexchange",
"id": 11987,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "acid-base, extraction",
"url": null
} |
c++, algorithm, object-oriented, stl, machine-learning
/**
* Classify the provided predictor Vector. This provides an estimate of the
* target outcome.
*/
double Classifier::Classify(const Vector& v) const {
Vector vn = normalizer_.Normalize(v);
return 2.0 * Sigmoid(weights_.InnerProduct(vn)) - 1.0;
}
/**
* Calculate the sigmoid (logistic function) of the given value.
*/
double Classifier::Sigmoid(double x) const {
return 1.0 / (1.0 + exp(-x));
}
/**
* Evaluate performance of the classifier using the provided test RecordList.
*/
int Classifier::EvaluatePerformance(const RecordList& test_set) const {
int total = 0;
int correct = 0;
for (vector<Record>::const_iterator itr = test_set.const_begin();
itr != test_set.const_end(); ++itr) {
double result = Classify(itr->predictor());
total++;
if ((result < 0 && itr->target() < 0)
|| (result > 0 && itr->target() > 0)) {
correct++;
}
}
return (100*correct) / total;
} | {
"domain": "codereview.stackexchange",
"id": 2608,
"lm_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, object-oriented, stl, machine-learning",
"url": null
} |
acid-base
\begin{array}{|c|c|c|c|} \hline
\text{Favouring acids with larger atom} & \text{Favouring acids with smaller atom} \\ \hline
\ce{Distribution of charge} & \ce{Extent of solvation}\\ \hline
\ce{Bond strength} & \ce{Electronegativity}\\ \hline
\end{array} | {
"domain": "chemistry.stackexchange",
"id": 15690,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "acid-base",
"url": null
} |
species-identification, microbiology, bacteriology, morphology
Pure culture of Acinetobacter on MacConkey agar plate You have to remember that when a microbiologist looks at a plate, they are looking to observe a particular something, which depends on exactly what they are doing, and they will have some idea of the range of morphotypes expected for those species and/or strains.
They also aren't doing this in isolation - they will use tests to further confirm what they see, often starting with simple tests like Gram staining and going on to other biochemical tests, genetic tests (sequencing possibly or PCR), or even MALDI-ToF. | {
"domain": "biology.stackexchange",
"id": 12362,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "species-identification, microbiology, bacteriology, morphology",
"url": null
} |
Topics:
3 How much money would have to be invested in an account, which yields 3 9 22 May 2017, 18:33
2 How much money must be invested at 10% annual interest, compounded sem 1 17 Jan 2017, 10:45
Chu-Lihas $100 in her piggy bank. How much will she have in her bank.. 1 05 Jul 2016, 18:51 7 How much interest will$2,400 earn at an annual rate of 8% in one year 4 08 Jun 2016, 02:09 | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9553191271831559,
"lm_q1q2_score": 0.8157591876161894,
"lm_q2_score": 0.8539127548105611,
"openwebmath_perplexity": 12561.814580229884,
"openwebmath_score": 0.3364756107330322,
"tags": null,
"url": "https://gmatclub.com/forum/barbata-invests-2400-in-the-national-bank-at-5-how-much-additional-110369.html?fl=similar"
} |
php, mysql, php5
// özellik start
$tumilceler_durum_kategori_tip_ozellik = $tumilceler."_".$durum."_".$kategori."_".$tip."_ozellik";
$tumilceler_durum_kategori_tip_ozellik_unique = $tumilceler_durum_kategori_tip_ozellik."_unique";
$array_new[$tumilceler_durum_kategori_tip_ozellik][$key] = $ozellik;
$array_new[$tumilceler_durum_kategori_tip_ozellik_unique] = array_unique($array_new[$tumilceler_durum_kategori_tip_ozellik]);
// özellik finish
// tum ilceler finish | {
"domain": "codereview.stackexchange",
"id": 945,
"lm_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, php5",
"url": null
} |
c++, multithreading, c++11, timer
Unfortunately, the standard library containers have a function empty while is_empty would have been a better name ("empty" somehow means "empty that container" to me); I understand that you keep this particular name for consistency. | {
"domain": "codereview.stackexchange",
"id": 7290,
"lm_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, c++11, timer",
"url": null
} |
python, performance, numpy, vectorization
def give_bond_array2(positions, bond_radii, self_bonding_allowed=False):
"""Calculate a boolean array where ``A[i,j] is True`` indicates a
bond between the i-th and j-th atom.
"""
radii = np.add.outer(bond_radii, bond_radii)
squared_radii = radii ** 2
delta = (positions[None, :, :] - positions[:, None, :])
squared_delta = delta ** 2
squared_distances = np.sum(squared_delta, axis=2)
overlap = squared_radii - squared_distances
bond_array = overlap >= 0
if not self_bonding_allowed:
np.fill_diagonal(bond_array, False)
return bond_array
n_atoms = 15000
positions, bond_radii = np.random.rand(n_atoms, 3), np.random.rand(n_atoms)
positions, bond_radii = [np.array(x, dtype='float32', order='F') for x in [positions, bond_radii]]
For the testing I got the following output:
In [1]: from minimal_example import *
...: %load_ext line_profiler
...:
In [2]: %lprun -f give_bond_array1 give_bond_array1(positions, bond_radii) | {
"domain": "codereview.stackexchange",
"id": 25723,
"lm_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, numpy, vectorization",
"url": null
} |
The party-giver also asked if there is an analytical way of finding this as a function of $$A$$?
Let's take a step in this direction, concentrating on the case of "one real zero", and express the negative zero as a function of $$A$$: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9883127416600689,
"lm_q1q2_score": 0.85146919156448,
"lm_q2_score": 0.861538211208597,
"openwebmath_perplexity": 370.22600157662055,
"openwebmath_score": 0.8927750587463379,
"tags": null,
"url": "https://math.stackexchange.com/questions/3064314/on-the-number-of-roots-of-the-polynomial-x3ax21-0/3064353"
} |
openni-camera, image-transport
void SaveImageAsPPM( const sensor_msgs::ImageConstPtr& msg, const char* filename )
{
if ( msg->encoding != "rgb8" )
{
return; // Can only handle the rgb8 encoding
} | {
"domain": "robotics.stackexchange",
"id": 6151,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "openni-camera, image-transport",
"url": null
} |
python, linked-list, interview-questions, queue
Title: Create an implementation of Deque (double-ended queue) with linked list nodes I encountered this question as I am preparing for my code interview.
Using Python, create an implementation of Deque (double-ended queue) with linked list nodes that has attributes of both front and back enqueue and dequeue.
from linkedlist import LinkedList
class DeQueue(object):
def __init__(self, iterable=None):
"""Initialize this queue and enqueue the given items, if any."""
# Initialize a new linked list to store the items
self.list = LinkedList()
if iterable is not None:
for item in iterable:
self.enqueue_back(item)
def __repr__(self):
"""Return a string representation of this queue."""
return 'Queue({} items, front={})'.format(self.length(), self.front())
def is_empty(self):
"""Return True if this queue is empty, or False otherwise."""
return self.list.is_empty() | {
"domain": "codereview.stackexchange",
"id": 28092,
"lm_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, linked-list, interview-questions, queue",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.