text stringlengths 1 1.11k | source dict |
|---|---|
waves, acoustics, frequency, string, wavelength
On the other hand, consider a loudspeaker to which an electrical sine wave voltage is applied. The speaker will push and pull at the frequency of the voltage, causing pressure compressions and rarefactions in the air, independent of the size and material of the speaker.
When striking a table (or drum), each strike will be similar to the pluck of the string: the table or drum will filter the frequency content of the strike (actually a continuum of frequencies, initially) to the basic resonant frequencies. BUT as the rate of striking increases, two things could happen: 1) the rate of striking could reach the audible range, and 2) on a drum, the strike rate may be fast enough to change the average tension in the drum head causing a general rise in the resonant frequencies. This often happens in tympani and tabla. | {
"domain": "physics.stackexchange",
"id": 63563,
"lm_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, acoustics, frequency, string, wavelength",
"url": null
} |
propositional-logic, model-checking, software-verification
So my question is basically, how you define atomic propositions in Symbolic Model Checking. What goes into them. How you are allowed to make such statements that seemingly aren't verified. I don't see how I can say anything about the state of the program without something else "checking" that yes $\mathtt{the\ request\ was\ actually\ sent}$. I understand that after we define this model, we have our specification formulas and check them against the model. But we never checked the model itself for accuracy, is what I'm trying to get at.
I feel like, after writing down, in a specific state, an atomic proposition, I would then need to write a unit test to verify that it was true for some input. Not sure what I'm missing. Formal verification often involves at least three steps: | {
"domain": "cs.stackexchange",
"id": 11623,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "propositional-logic, model-checking, software-verification",
"url": null
} |
Question 4
Without using a calculator, find the positive root of the equation
$(5-2 \sqrt{2}) x^{2}-(4+2 \sqrt{2}) x-2=0$
giving your answer in the form $$a+b \sqrt{2},$$ where $$a$$ and $$b$$ are integers.
[6]
\begin{aligned}
x &=\frac{-b+\sqrt{b^{2}-4 a c}}{2 a} \\
&=\frac{4+2 \sqrt{2}+\sqrt{[-(4+2 \sqrt{2})]^{2}-4(5-2 \sqrt{2})(-2)}}{2(5-2 \sqrt{2})} \\
&=\frac{4+2 \sqrt{2}+\sqrt{16+16 \sqrt{2}+8+40-16 \sqrt{2}}}{2(5-2 \sqrt{2})} \\
&=\frac{4+2 \sqrt{2}+\sqrt{64}}{10-4 \sqrt{2}} \\
&=\frac{4+2 \sqrt{2}+8}{10-4 \sqrt{2}} \cdot \frac{10+4 \sqrt{2}}{10+4 \sqrt{2}} \\
&=\frac{120+48 \sqrt{2}+20 \sqrt{2}+16}{68} \\
&=\frac{136+68 \sqrt{2}}{68} \\
&=2+\sqrt{2}
\end{aligned}
Question 5
A school council of 6 people is to be chosen from a group of 8 students and 6 teachers. Calculate the number of different ways that the council can be selected if
(i) there are no restrictions,
\begin{array}{l}
14 \text { choose } 6 \\
=14 C _{6} \\
=3003
\end{array} | {
"domain": "igcseguru.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9935117315560086,
"lm_q1q2_score": 0.8004050380266784,
"lm_q2_score": 0.8056321959813275,
"openwebmath_perplexity": 7176.66170055732,
"openwebmath_score": 1.0000090599060059,
"tags": null,
"url": "http://igcseguru.com/cambridge-additional-mathematics-2011-past-paper-oct-nov-paper-23/"
} |
neuroscience, neurophysiology, vision, human-eye
So the path of visual stimulus would then be RN -> [...] -> XN -> OEN.
Now, if my eyes were to be completely popped-out I'm assuming that relative to OENs that would have the same effect as XNs not passing along any excitatory/inhibitory information at all. Also, since what I'd perceive would be pure black, that seems to imply that XNs also don't get activated at all when we actually see black (e.g. close our eyes in a very dark room).
So, when we perceive black => RNs get depolarized => they release glutamate continuously => XNs don't excite/inhibit OENs at all (seems to also imply that RNs don't intersect XNs). It is this inversion that intrigues me - why is it that for XNs to transmit NO information RNs have to continuously be excited? By that sense, this makes me think of the eye as if it was a big NOT gate. Short answer
The reason for the depolarized state of photoreceptors in the dark is unknown as far as I know. It probably has its roots deep in the evolution of the eye. | {
"domain": "biology.stackexchange",
"id": 8156,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neuroscience, neurophysiology, vision, human-eye",
"url": null
} |
general-relativity, cosmology, reference-frames, universe, machs-principle
In your example, you can in fact determine easily whether you are rotating or the universe is rotating around you. In the first case there is artificial gravity on the ship, and in the second case there is not.
So yes, rotation works differently from velocity. There is not one "universal stationary frame of reference" though, there are many: The class of reference frames that are neither rotated nor accelerated in any other way are the inertial frames. | {
"domain": "physics.stackexchange",
"id": 87403,
"lm_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, cosmology, reference-frames, universe, machs-principle",
"url": null
} |
python, pandas
3 3 Almond Almond NaN
4 4 Almond Drink, Sweetened, Alrpo Almond Drink Sweetened
5 5 Almond Drink, Unsweetened, Alrpo Almond Drink Unsweetened
6 6 Amaranth Flakes Amaranth Flakes NaN
7 7 Anchovy Anchovy NaN
8 8 Apple, Average, With Skin Apple Average
9 9 Apple, Domestic, Without Skin Apple Domestic | {
"domain": "datascience.stackexchange",
"id": 5050,
"lm_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, pandas",
"url": null
} |
organic-chemistry, reaction-mechanism, phenols
Title: What is the mechanism of oxidation of phenol to benzoquinone? I looked up the mechanism in a lot of organic chemistry books, including Clayden, Klein, Solomons, McMurry but I couldn't find the mechanism of oxidation of a phenol. I also looked it up in pharmacognosy books, but with no luck. All I could find in these books is the following scheme, with no mechanism:
It seems like other oxidizing agents can be used, such as hydrogen peroxide and silver oxide.
Unlike primary and secondary alcohols, phenol doesn't have an hydrogen atom attached to the carbon directly bound to oxygen. My guess is that the double bond of phenol will react with the oxidizing agent, but not sure of how this will work. The reaction is used industrially to make hydroquinone (source: wikipedia), but often using hydrogen peroxide as the oxidation agent in the presence of a catalyst.
A study on catalytic hydroxylation of benzene comes to the following conclusion: | {
"domain": "chemistry.stackexchange",
"id": 12477,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, reaction-mechanism, phenols",
"url": null
} |
for a parallel plate capacitor, as shown in Figure 2. 8 pFb)45 pFc. It is worth remembering. Charge separation in a parallel-plate capacitor causes an internal electric field. For a parallel plate capacitor made up of two plates of area A and separated by a distance d, with no dielectric material, the capacitance is given by :. This calculator computes the capacitance between two parallel plates. 54 × 10 −12 F/m. Fig(a) shows that the plate area of a parallel plate capacitor is the area of one of the plates. Illustrative Example. 0006 κ glass ≈ 7 Note that the dielectric constant is a unitless variable. The capacitance of the parallel plate capacitor is given by C= C 0 = Q V 0 = 0A d (1) 1-+-+-+-+-+-+. The space between the plates of a parallel plate capacitor of capacitance C is filled with three dielectric slabs of identical sizes as shown in Fig. A larger plate area produces a larger capacitance and a smaller capacitance. 4 Capacitance 3. The objective is to find the capacitance of | {
"domain": "agenzialenarduzzi.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9481545304202039,
"lm_q1q2_score": 0.8040044772205128,
"lm_q2_score": 0.847967764140929,
"openwebmath_perplexity": 531.7615776063614,
"openwebmath_score": 0.6449436545372009,
"tags": null,
"url": "http://mqeo.agenzialenarduzzi.it/capacitance-of-a-parallel-plate-capacitor-with-3-dielectrics.html"
} |
ros, python, ros-kinetic
class Detector:
def __init__(self):
self.pubtracking = rospy.Publisher('control', Float32MultiArray, queue_size=1)
rospy.Timer(rospy.Duration(1 / 50), self.control)
self._bridge = CvBridge()
# rospy.Subscriber("/camera/rgb/image_color", Image, self.image_callback)
# rospy.Subscriber("/camera/rgb/image_raw", Image, self.image_callback)
rospy.Subscriber("/usb_cam/image_raw", Image, self.image_callback)
# rospy.Subscriber('/camera/depth/points', PointCloud2, self.pc_callback)
# rospy.Subscriber('stopback', Bool, self.shutdownlistener)
self._current_image = None
self._current_pc = None
# self.array = 0
self.error_v = 0
self.error_w = 0 | {
"domain": "robotics.stackexchange",
"id": 36097,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, python, ros-kinetic",
"url": null
} |
Let me address merely the suggestion the OP makes in the comment: whether this ordinal can be specified from the cofinality of the field.
The answer is no, because any ordered field $F$ can be elementarily extended to a field with cofinality $\omega$, or indeed, to a field with any given regular cofinality. To have cofinality $\delta$, simply extend $\delta$ many times, making sure to put a new element on top each time, taking unions at limit stages.
$$F\prec F_1\prec F_2\prec\dots\prec F_\alpha\prec\dots\prec F_\delta$$
The resulting field will have the same cofinality as $\delta$, because the sequence of those points newly added on top at each stage will be cofinal in $F_\delta$. Since the initial field $F$ could have had very large embedded ordinals, which will still embed into the resulting field $F_\delta$, this shows that there are fields with very large embedded ordinals, as large as desired, which nevertheless have cofinality $\omega$, or any desired cofinality. | {
"domain": "mathoverflow.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.982823294509472,
"lm_q1q2_score": 0.8485613865662682,
"lm_q2_score": 0.8633916099737806,
"openwebmath_perplexity": 211.77768083560613,
"openwebmath_score": 0.9205182194709778,
"tags": null,
"url": "https://mathoverflow.net/questions/232777/which-ordinals-can-be-embedded-into-an-ordered-field"
} |
java
try{
sel = keyboardInput.nextInt();
} catch (InputMismatchException e){
keyboardInput.next();
System.out.println("Invalid option. Try again.");
getSelection();
}
if (sel == 1) {
subStringProblem();
getSelection();
}
else if (sel == 2) {
pointsProblem();
getSelection();
}
else if (sel == 3) {
System.out.println("Good Bye!");
System.exit(0);
}
else {
System.out.println("Invalid option. Try again.");
getSelection();
}
}
private static void subStringProblem() {
System.out.println("Substring problem.");
System.out.println("Enter a Substring:");
} | {
"domain": "codereview.stackexchange",
"id": 39569,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java",
"url": null
} |
## anonymous one year ago help please!
1. anonymous
@Vocaloid
2. anonymous
Look at the following numbers: −2, −1, 0, 2 Which pair of numbers has a sum of 0? −1, 2 −2, 0 −2, 2 −1, 0
3. anonymous
Which of the following describes a situation in which the total distance a soccer player travels is zero meters from his starting point? The player runs 9 meters forward, and then runs 0 meters in the opposite direction. The player runs 5 meters forward, and then runs 6 meters in the opposite direction. The player runs 10 meters forward, and then runs 10 meters in the opposite direction. The player runs 6 meters forward, and then runs 5 meters in the opposite direction.
4. anonymous
@Vocaloid
5. Vocaloid
well, look at each of your answer choices... −1, 2 −2, 0 −2, 2 −1, 0 which answer choice adds up to 0?
6. anonymous
i already got that one. its c
7. Vocaloid
great
8. anonymous
and the other one?
9. Vocaloid
well, any thoughts?
10. Vocaloid | {
"domain": "openstudy.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9755769106559808,
"lm_q1q2_score": 0.8043260190879334,
"lm_q2_score": 0.8244619263765706,
"openwebmath_perplexity": 4580.093371141357,
"openwebmath_score": 0.6768940687179565,
"tags": null,
"url": "http://openstudy.com/updates/55df6ac9e4b0819646d74908"
} |
fft, audio, window
Asymmetric Windows and their Application in Frequency Estimation
Malvar wavelets with asymmetrically overlapped windows
On the use of asymmetric windows for reducing the time delay in real-time spectral analysis
Window optimization in linear prediction analysis
Application examples in real-time simulation: CHOPtrey: contextual online polynomial extrapolation for enhanced multi-core co-simulation of complex systems
Matlab code:
% Laurent Duval
% 2019/08/06
% SeDsp59829
close all;clear all
nSample = 65;
timeUniform = linspace(-1,1,nSample);
powerExp = 0.5;
timeWarpPower = 2*((timeUniform+1).^powerExp)/2^powerExp-1;
hannWindow = @(time) 1/2*(1+cos(pi*time));
hannWindowUniform = hannWindow(timeUniform);
hannWarpPower = hannWindow(timeWarpPower);
figure(1);clf;hold on
plot(timeUniform,hannWindowUniform, 'ob')
plot(timeUniform,hannWarpPower, 'gx')
grid on | {
"domain": "dsp.stackexchange",
"id": 7740,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fft, audio, window",
"url": null
} |
optics, refraction, geometric-optics, lenses, telescopes
Note that all light rays, real and virtual, travel left to right. If you move the (virtual) object leftwards towards $F$ the (virtual) image move leftwards towards negative infinity. | {
"domain": "physics.stackexchange",
"id": 63659,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics, refraction, geometric-optics, lenses, telescopes",
"url": null
} |
c, tree, binary-search
find_node_data is unnecessarily recursive. The compiler may understand that it is a tail recursion, and optimize it out, but it always better to be explicit:
while (root) {
if (root->node_id == node_id) {
break;
}
root = root->node_id > node_id? root->left: root->right;
}
return root;
Note the insertion may also be made iterative, although much less elegant.
The line
printf("node data %d %s", find_node_data(root, T)->data, find_node_data(root, T)->name);
looks really strange. Why do you call find_node_data twice, and why don't you call print, which you are already defined? | {
"domain": "codereview.stackexchange",
"id": 28245,
"lm_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, tree, binary-search",
"url": null
} |
c++, performance, algorithm
struct Tile {
int x {0};
int y {0};
std::vector<Tile> get_adjacent_fTiles(const std::vector<Tile>& fTiles) const
{
std::vector<Tile> adjacentTiles {};
for(const auto& tile : fTiles) {
if((x == tile.x && y == tile.y - 1) || (x == tile.x + 1 && y == tile.y) || (x == tile.x && y == tile.y + 1) || (x == tile.x - 1 && y == tile.y)) {
adjacentTiles.push_back(tile);
}
}
return adjacentTiles;
}
void print() const
{
std::cout << "\"" << x << "," << y << "\"";
}
};
bool operator==(const Tile& tile1, const Tile& tile2) {
return (tile1.x == tile2.x && tile1.y == tile2.y);
}
bool operator!=(const Tile& tile1, const Tile& tile2) {
return (tile1.x != tile2.x || tile1.y != tile2.y);
}
Tile operator+(const Tile& tile1, const Tile& tile2) {
return Tile{tile1.x + tile2.x, tile1.y + tile2.y};
} | {
"domain": "codereview.stackexchange",
"id": 44623,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, performance, algorithm",
"url": null
} |
python, algorithm, python-2.x, graph
def DFS(self, visited):
global visitTimeCounter
if self.name in visited:
return
visited.append(self.name)
for node in self.connections:
if node.name in visited:
pass
else:
node.DFS(visited)
visitTimeCounter += 1
self.visitTime = visitTimeCounter
if __name__ == "__main__":
nodeA = GraphNode('A')
nodeB = GraphNode('B')
nodeC = GraphNode('C')
nodeD = GraphNode('D')
allNodes = [nodeA, nodeB, nodeC, nodeD]
nodeA.connections.append(nodeB)
nodeA.connections.append(nodeC)
nodeB.connections.append(nodeA)
nodeC.connections.append(nodeD)
nodeD.connections.append(nodeC)
visited = []
for node in allNodes:
if node.name not in visited:
node.DFS(visited)
for node in allNodes:
print node.name, node.visitTime | {
"domain": "codereview.stackexchange",
"id": 22301,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, algorithm, python-2.x, graph",
"url": null
} |
fl.formal-languages, automata-theory, nfa, prefix-free-code, omega-language
Then simply test whether the language of $N''$ is empty (which can be done in polynomial time with a simple graph search). $L(N'') = \emptyset$ if and only if $L(S) \cap L(N') = \emptyset$, or in other words every string in $L(N')$ is not in $L(S)$. In other words, the language of $N''$ is empty if and only if $N'$ accepts only strings that are prefixes of $s^n$ for some $n$. This can be rephrased as exactly the statement we were trying to evaluate: "every path in $N$ from state $q$ to an accept state corresponds to a string that is a prefix of string $s^n$ for some $n$."
Main algorithm
Consider the set of states in the NFA that are in some loop. For each such state, $q$, do the following: | {
"domain": "cstheory.stackexchange",
"id": 4553,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fl.formal-languages, automata-theory, nfa, prefix-free-code, omega-language",
"url": null
} |
stars, neutrons, strong-force, fermi-liquids
What will certainly prevent a collapse is the "hard core" of the neutron, i.e. the strongly repulsive nuclear force for distances below 1 fm, as dicussed in question "Why is the central density of the nucleus constant". The density of the nuclei is not too far away from tightly packed spheres with 1 fm radius. However, this is totally different physics, and the textbooks would wrongly explain the neutron star as a Fermi-Gas.
I suspect that the constant density may have something to do with the Fock-term (exchange potential) in the Hartree-Fock equation, which in fact is another representation of Pauli-exlusion principle, compensating the increase in the Hartree-Term.
What is the nature of a neutron star? You are quite correct that a neutron star is not supported by ideal neutron degeneracy pressure. Any book or web source that claims so should be given a wide berth. | {
"domain": "physics.stackexchange",
"id": 35356,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "stars, neutrons, strong-force, fermi-liquids",
"url": null
} |
ros, python2.7, python3, ros-kinetic, pythonpath
Originally posted by Jägermeister with karma: 81 on 2018-12-20
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 32190,
"lm_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, python2.7, python3, ros-kinetic, pythonpath",
"url": null
} |
javascript, beginner
for(i = 0; i < promptInput; i++) {
square[i] += `${i}`;
}
return square;
}
could be
const createArray = n => [...Array(n)].map((_, i) => `${i}`); | {
"domain": "codereview.stackexchange",
"id": 43782,
"lm_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",
"url": null
} |
ros2
[INFO] [spawner-7]: process started with pid [11871]
[static_transform_publisher-1] [INFO] [1685549021.419656555] [static_transform_publisher0]: Spinning until stopped - publishing transform
[static_transform_publisher-1] translation: ('0.000000', '0.000000', '0.000000')
[static_transform_publisher-1] rotation: ('0.000000', '0.000000', '0.000000', '1.000000')
[static_transform_publisher-1] from 'world' to 'base_link'
[ros2_control_node-5] [INFO] [1685549021.428105055] [resource_manager]: Loading hardware 'GazeboSystem'
[ros2_control_node-5] terminate called after throwing an instance of 'pluginlib::LibraryLoadException' | {
"domain": "robotics.stackexchange",
"id": 38410,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros2",
"url": null
} |
lengths is not equally distributed. After a cut, rod gets divided into two smaller sub-rods. Given price list (in array price) Give a dynamic-programming algorithm to solve this modified problem. The recursive formula for the cutting a rod problem is cuttingRod (n) = max (cost [i] + cuttingRod (n-i-1)) where i is in range from 0 to n-1 So, if we take a brief moment to see how the algorithm is working. 15.1-4. There View 11_DP1.pptx from COMP 3711 at The Hong Kong University of Science and Technology. Assume a company buys long steel rods and cuts them into shorter rods for sale to its customers. So we should make two cuts of 1 and leave the remaining 3 uncut. Now let’s observe the solution in the implementation below− Example. Ask Question Asked 3 years, 2 months ago. Problem statement: You are given a rod of length n and you need to cut the cod in such a way that you need to sell It for maximum profit. In this tutorial we shall learn about rod cutting problem. The same sub problems | {
"domain": "com.br",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9780517475646369,
"lm_q1q2_score": 0.8085669149231183,
"lm_q2_score": 0.8267117940706734,
"openwebmath_perplexity": 799.8505112065792,
"openwebmath_score": 0.5053479075431824,
"tags": null,
"url": "http://autoconfig.jnet3.com.br/white-sideboard-flz/viewtopic.php?page=kawai-kdp-110-review-b41546"
} |
## Negating ‘and’ and ‘or’ Sentences:De Morgan's Laws
How can a sentence ‘$A \text{ and } B\,$’ be false? The only time an ‘and’ sentence is true is when both subsentences are true. So, an ‘and’ sentence is false when at least one of the subsentences is false.
Precisely, the truth table below shows that:
$\text{not}(A \text{ and } B)$
is equivalent to
$(\text{not } A) \text{ or } (\text{not } B)$
Here's the intuition you should have when looking at this sentence. Start with (1) and work your way to (6):
(2) ... is false ... (1) an ‘and’ sentence ... $\overbrace{\text{not}}$ $\overbrace{(A\text{ and }B)}$
(3) ... when ... $\overbrace{\text{is equivalent to}}$
(4) ... $\,A\,$ is false ... (5) ... or ... (6) ... $\,B\,$ is false $\overbrace{(\text{not }A)}$ $\overbrace{\text{ or }}$ $\overbrace{(\text{not }B)}$
In particular, note that you say ‘is false’ when you see the word ‘not’. | {
"domain": "onemathematicalcat.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9883127409715956,
"lm_q1q2_score": 0.8033671314186506,
"lm_q2_score": 0.8128673223709251,
"openwebmath_perplexity": 352.3564396652763,
"openwebmath_score": 0.6346675753593445,
"tags": null,
"url": "https://onemathematicalcat.org/Math/Geometry_obj/logical_equivalences.htm"
} |
complexity-theory, closure-properties
"Let $C$ be a class of functions from nonnegative integers to nonnegative integers. We say that $C$ is closed under left polynomial composition if $f(n) \in C$ implies $p(f(n)) = O(g(n))$
for some $g(n) \in C$, for all polynomials $p(n)$. We say that $C$ is closed under right polynomial composition if $f(n) \in C$ implies $f(p(n)) = O(g(n))$ for some $g(n) \in C$, for all polynomials $p(n)$.
Intuitively, the first closure property implies that the corresponding complexity class is "computational model-independent", that is, it is robust under reasonable changes in the underlying model of computation (from RAM's to Turing machines, to multistring Turing machines, etc.) while closure under right polynomial composition suggests closure under reductions (see the next chapter). | {
"domain": "cs.stackexchange",
"id": 18152,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "complexity-theory, closure-properties",
"url": null
} |
c++, beginner, snake-game, sdl
Avoid std::endl
I'd advise avoiding std::endl in general. Along with writing a new-line to the stream, it flushes the stream. You want the new-line, but almost never want to flush the stream, so it's generally better to just write a \n. On the rare occasion that you actually want the flush, do it explicitly: std::cout << '\n' << std::flush;.
Avoid the C random number generation routines
C's srand()/rand() have quite a few problems. I'd generally advise using the new routines in <random> instead. This is kind of a pain (seeding the new generators well is particularly painful) but they generally produce much higher quality randomness, are much more friendly to multi-threading, and using them well will keep the cool C++ programmers (now there's an oxymoron) from calling you names.
avoid exit()
When writing C++, it's generally better to avoid using exit. Calling it generally prevents destructors for objects on the stack from running, so you can't get a clean shutdown. | {
"domain": "codereview.stackexchange",
"id": 33315,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, beginner, snake-game, sdl",
"url": null
} |
homework-and-exercises, newtonian-mechanics, friction, harmonic-oscillator, spring
Title: The amplitude of a damped spring with a weight during the 4 first oscillations | {
"domain": "physics.stackexchange",
"id": 45220,
"lm_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, friction, harmonic-oscillator, spring",
"url": null
} |
data-structures, union-find
Title: Union-Find link-by-rank preserve a root Suppose I have two union-find trees with roots $x$ and $y$ respectively. I want to join them in constant time (this is normally possible since I already "hold" the roots) but I need $x$ to be the root of the merged tree. I don't know what rank $x$ or $y$ have (or more precisely formulated I need this to work always - for any $x$ and $y$ I want the final tree to have $x$ as its root). Is that possible? I couldn't find a solution to this, but it's really not my day today :) Unfortunately, that's not possible with the standard data structure for union-find (namely, with the union by rank method).
The data structure has invariants that in some cases require making $y$ be the root (namely, when $x$'s rank is smaller than $y$'s rank, you are required to make $y$ the root). If you force $x$ to be the root in such a situation, then you destroy the invariants, which might make subsequent Find/Union operations slow. | {
"domain": "cs.stackexchange",
"id": 10999,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "data-structures, union-find",
"url": null
} |
c++, arduino
//Serial Print DHT
Serial.println();
Serial.println();
Serial.print("Humid: ");
Serial.print(h);
Serial.print("%");
Serial.println();
Serial.print("Temp: ");
Serial.print(t);
Serial.print("C ");
Serial.println();
Serial.print("Apparent Temperature: ");
Serial.print(hi);
Serial.println();
Serial.println();
//Serial Print UV
Serial.print("UV Level =");
Serial.print(UVLevel);
Serial.println();
//Publish Data To Particle Cloud
Particle.publish("Humidity", String(h));
Particle.publish("Temperature", String(t));
Particle.publish("Apparent Temperature", String(hi));
Particle.publish("UV Index",String(UVLevel));
delay(5000);
} | {
"domain": "codereview.stackexchange",
"id": 30573,
"lm_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++, arduino",
"url": null
} |
python, python-3.x, simulation, physics
return -1
def make_particle_jump(self, newPos: Tuple, x_dir: int, y_dir: int):
surrounding_boundary_idx = self.get_surrounding_boundary_of_particle(newPos)
while (self.is_particle_on_specific_boudnary(newPos, surrounding_boundary_idx)):
newPos = Util.increment_tuple_by_val(
newPos, tuple((Util.sign(x_dir), Util.sign(y_dir)))
)
newPos = Util.increment_tuple_by_val(
newPos, tuple(
(Util.sign(x_dir) * BOUNDARY_JUMP,
Util.sign(y_dir) * BOUNDARY_JUMP)
)
)
# Special case: In some instances the jump may land the particle
# on a subsequent boundary so we repeat the function. We decrement
# the particle's coordinates until it is out.
new_surrounding_boundary_idx = self.get_surrounding_boundary_of_particle(newPos)
while (self.is_particle_on_boundary(newPos)): | {
"domain": "codereview.stackexchange",
"id": 43882,
"lm_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, simulation, physics",
"url": null
} |
quaternion
Or do you think that the data size wouldn't be problematic if i have to save up to 1000 cylinder datasets containing two 3Dvectors and quaternion?
cheers
Alex
Edit: To sum it up: Is it possible to calculate the center point with just the bottom point and the quaternion? | {
"domain": "robotics.stackexchange",
"id": 19339,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quaternion",
"url": null
} |
# Prime Spiral #2
Today's post was inspired by a YouTube video, Why do prime numbers make these spirals?, on the channel 3Blue1Brown, created by Grant Sanderson. In my opinion this is the best math channel on YouTube. He has beautiful graphics and superb exposition. I recommend you take a look, if you haven't already.
My 2015 post Prime Spiral was about a completely different prime spiral discovered by Stan Ulam.
### Contents
#### Spiral Polar Plots
The following figure shows the plotting scheme. We are using polar coordinates, $r, \theta$, with $\theta$ measured in radians. | {
"domain": "mathworks.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9759464499040092,
"lm_q1q2_score": 0.8024125673346876,
"lm_q2_score": 0.8221891348788759,
"openwebmath_perplexity": 727.2861985539555,
"openwebmath_score": 0.717467188835144,
"tags": null,
"url": "https://blogs.mathworks.com/cleve/2019/10/14/prime-spiral-2/"
} |
c++, collision
int pacmanPosX = 32;
int pacmanPosY = 32;
int indexX;
int indexY;
bool colR;
bool colL;
bool colU;
bool colD;
Sprite pacman (new Surface( "assets/pacmanLeft.png"), 1);
Surface* tileSet[3];
int levelMap[8][8] =
{{1,1,1,1,1,1,1,1},
{1,0,0,0,0,0,0,1},
{1,0,0,0,0,1,0,1},
{1,0,0,1,0,0,0,1},
{1,0,0,0,1,0,0,1},
{1,1,0,0,1,1,1,1},
{1,0,0,0,0,0,1,1},
{1,1,1,1,1,1,1,1}};
void Game::Init()
{
// put your initialization code here; will be executed once
tileSet[0] = new Surface( "assets/pacmanFloor.png" ); // Sets up data for tileSet
tileSet[1] = new Surface( "assets/pacmanWall.bmp" );
tileSet[2] = new Surface( "assets/pacmanCookie.png" );
}
void Game::Tick( float a_DT )
{
m_Screen->Clear( 0 ); | {
"domain": "codereview.stackexchange",
"id": 767,
"lm_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++, collision",
"url": null
} |
ros, c++, ros-kinetic, services
static bool pointsCallback(image_transform::TransformPoints::Request &req,
image_transform::TransformPoints::Response &res) {
std::cout << "service called" << std::endl;
return true;
}
};
int main(int argc, char **argv) {
// ROS NODE INIT
ros::init(argc, argv, "image_tranform");
ImageTransform image_transform;
ros::spin();
return 0;
}
Originally posted by LukeAI on ROS Answers with karma: 131 on 2020-08-05
Post score: 0
Your service object is a local variable in the constructor. When the constructor ends it will be destroyed and the service will no longer be provided by the node. It should instead be a member variable of the ImageTransform class.
Originally posted by jdlangs with karma: 971 on 2020-08-05
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by LukeAI on 2020-08-06:
ah yeah, school boy error. thankyou. | {
"domain": "robotics.stackexchange",
"id": 35373,
"lm_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++, ros-kinetic, services",
"url": null
} |
python, python-2.x, validation, email
valid_local(strip_comments(local))
valid_domain(strip_comments(domain))
if __name__ == "__main__":
import doctest
doctest.testmod()
raw_input('>DONE<') "@"@example.com and "\ "@example.com both fail, but they are valid.
" "@example.com passes, but it is, in fact, invalid.*
You probably missed the idea to confirm your knowledge with the relevant RFCs, as a conforming implementation should abide by the rules described therein. While Wikipedia is quite reliable nowadays, it is by no means a normative source.
*RFC 5322 describes quoted-string as follows:
quoted-string = [CFWS]
DQUOTE *([FWS] qcontent) [FWS] DQUOTE
[CFWS] | {
"domain": "codereview.stackexchange",
"id": 18103,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-2.x, validation, email",
"url": null
} |
image-processing, convolution
Title: Given a downscaled image, produce Gaussian blur of the original image Let's say I a perform convolution of an image with a Gaussian kernel of some size.
Is it possible to produce the exact same result from a downscaled version of the image? If so, what's its minimal size?
I'm not looking for an exact answer, some directions where I should start looking are enough. (I have some basic DSP and image processing knowledge but not much beyond that.)
Edit: A closely related question is - does Gaussian blur lose information, i.e. is it impossible to reconstruct the original from the blurred image? I don't think you can do that.
You can probably get a similar result, in that you won't be able to tell by eye that they are different.
The reason I don't think you can do what you have in mind is this: | {
"domain": "dsp.stackexchange",
"id": 3122,
"lm_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, convolution",
"url": null
} |
mountains, rivers
Minimal braiding in the Rockies
Mountainous braided rivers seem rare/mild elsewhere, like here in the Rockies in Missoula. Braiding will occur in any river where two conditions are met: 1) a very high sediment load must be available, as is usually the case in a peri-glacial or post-glacial environment, and 2) there is an abrupt change from high energy rivers (steep hydraulic gradient) to low energy deposition with flat space on either side of the river. Go for a hike in any glacial or post-glacial mountains and you will see that rock hardness has little to do with sediment availability - there is always more sediment than the river can mobilize at any one time, even in extreme floods. The classic example is the Canterbury Plains on the east side of South Island New Zealand. Braiding is an inherently unstable and transient river configuration. | {
"domain": "earthscience.stackexchange",
"id": 588,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mountains, rivers",
"url": null
} |
c#, beginner
In any case this code appears to work. I know that it doesn't hold a candle to much of the stuff you guys put up but on the bright side its short and kind of readable (both aims of mine).
Could some much brighter spark than me kindly shine a light on the stuff that could have been done better (or simply provide some advice or suggested direction)? :c)
using System;
namespace CapsChecker
{
class Program
{
static void Main(string[] args)
{
//Set up an infinite loop for program to run within
while (true)
{
//Collection of user input
Console.Write("Press a key: ");
char input = (Console.ReadKey().KeyChar);
//Check if Capslock is on when key entered. Combined with
//the shift button this can result in CapsCheck returning
//true even if key entered is lower case.
if (CapsCheck() == true) | {
"domain": "codereview.stackexchange",
"id": 20016,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, beginner",
"url": null
} |
genetics, virology, symbiosis
Title: Example of a virus becoming symbiotic with an organism The human gut has an indispensably beneficial ecosystem of bacteria. What are the examples of a virus that becomes symbiotic with an organism, or even incorporates beneficially into the genome of the organism? In humans, endogenous retroviruses (HERVs) comprise a substantial fraction of the genome, as much as 8%.1 While many historical viral incorporation events into the primate genome were likely neutral or detrimental (and therefore selected against), some were co-opted and are now functional elements in humans. An example: human syncytin is the envelope gene of a defective HERV, and the protein has been co-opted for fusion during human placentation.2 A good primer on the genetics and functions of HERVs can be found in The Pharmaceutical Journal.3 The Feschotte Lab at Cornell studies the evolution of HERVs and other mobile elements in mammalian genomes, and their lab site provides more resources. | {
"domain": "biology.stackexchange",
"id": 10205,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "genetics, virology, symbiosis",
"url": null
} |
imu, navigation, gps, navsat-transform, robot-localization
Title: map frame from robot_localization
I am trying to create the standard tf frames specified in REP 105 (map, odom, and base_link) using the robot_localization package. I only have GPS and IMU sensors available. So far I have been able to create the odom and base_link frames, but I am having trouble creating the map frame.
This is my launch file:
<launch>
<node pkg="robot_localization" type="ukf_localization_node"
name="ukf_localization" clear_params="true" ns="ackermann_vehicle">
<param name="frequency" value="30"/>
<param name="sensor_timeout" value="0.1"/>
<param name="two_d_mode" value="false"/>
<param name="map_frame" value="map"/>
<param name="odom_frame" value="odom"/>
<param name="base_link_frame" value="base_link"/>
<param name="world_frame" value="map"/> | {
"domain": "robotics.stackexchange",
"id": 21019,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "imu, navigation, gps, navsat-transform, robot-localization",
"url": null
} |
javascript, jquery, performance, plugin
// Reset the position to take into account the removed slides
offsetFirstSlide();
// After sliding happens, if set pass in the 'onAfterSlide' function as a callback function
// to setUlHeight()
if( slider.settings.onAfterSlide && typeof(slider.settings.onAfterSlide) === "function" ) {
setUlHeight( slider.settings.onAfterSlide );
} else {
// Otherwise just call setUlHeight
setUlHeight();
}
});
}
};
slider.startAuto = function(allowHoverStop) {
/**
* Begin the automatic scrolling
*/
if( allowHoverStop && allowHoverStop === true ) {
slider.vars.hoverPrevent = 0;
} | {
"domain": "codereview.stackexchange",
"id": 10054,
"lm_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, performance, plugin",
"url": null
} |
image-processing, convolution, frequency-domain, linear-algebra, numerical-algorithms
$$ \arg \min_{\boldsymbol{x}} {\left( {H}^{T} H + \lambda {G}^{T} G \right)} \boldsymbol{x} = {H}^{T} \boldsymbol{y} $$
Where $ H $ and $ G $ are the matrix form of the convolutions.
Since in the frequency domain all we can apply is a circular / cyclic / periodic convolution we need to create a form of the convolutions using a circulant matrix.
We can do as following:
$$ H = E {C}_{\boldsymbol{h}} P $$
Where: | {
"domain": "dsp.stackexchange",
"id": 11965,
"lm_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, convolution, frequency-domain, linear-algebra, numerical-algorithms",
"url": null
} |
ros, catkin-make, catkin, aria, rosaria
Title: ROSARIA Tutorial Groovy catkin_make issue
I've been running through this tutorial for a few days, i'm now seeing a few mistakes I made [not installing the Aria-2.7.2 file and Mobilesim-0.5.0 (as I'm not attached to a robot at the moment)] but I've done all that now(the ROSARIA tutorial should probably point out that you should do that ahead of time but I suppose I just skipped that step). Now when I've made my workspace and I use the catkin_make command in the ~/catkin_ws directory everything runs fine until I get to
[ 83%] Built target ROSARIA_gencfg
Linking CXX executable /home/****/catkin_ws/devel/lib/ROSARIA/RosAria
/usr/bin/ld: skipping incompatible /usr/local/Aria/lib/libAria.so when searching for -lAria
/usr/bin/ld: cannot find -lAria
collect2: error: ld returned 1 exit status
make[2]: *** [/home/****/catkin_ws/devel/lib/ROSARIA/RosAria] Error 1
make[1]: *** [amor-ros-pkg/ROSARIA/CMakeFiles/RosAria.dir/all] Error 2
make: *** [all] Error 2
Invoking "make" failed | {
"domain": "robotics.stackexchange",
"id": 13603,
"lm_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, catkin-make, catkin, aria, rosaria",
"url": null
} |
digital-filters
$$y_1[n] = (x[n]+x[n-1])/2 ~~~,~~~ \text{sum filter}$$ and
$$y_2[n] = (x[n]-x[n-1])/2 ~~~,~~~ \text{difference filter}$$
Lets make a qualitative analysis of these two filters by setting their input frequency $\omega_0$ to low (close to $0$), and high (close to $\pi$) values, and then observing the corresponding outputs respectively;
First, assume that $\omega_0$ is set to low frequencies: Then the consecutive input samples $x[n]$ and $x[n-1]$ will have highly similar values, as a low frequency sine wave will not change much from one sample to the other. When this is the case, their sum will add up, whereas their difference will cancel.
Therefore, $y_1[n]$ will be approximately equal to the input's value $x[n]$, while the output $y_2[n]$ will be close to zero, due to cancelling of $x[n]$ by $x[n-1]$ when subtracted. Then we conclude that the sum filter passes the low frequencies while the difference filter attenuates (blocks) them. | {
"domain": "dsp.stackexchange",
"id": 3893,
"lm_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-filters",
"url": null
} |
python, image
def remove_border(image: Image) -> Image:
bg = PIL.Image.new(mode="RGB", size=image.size, color=image.getpixel((0, 0)))
diff = ImageChops.difference(image, bg)
diff = ImageChops.add(image1=diff, image2=diff, scale=2, offset=-30)
bbox = diff.getbbox()
return image.crop(bbox)
def resize_blur(blur_img: Image, sizers: tuple[int, int]) -> Image:
return (
blur_img
.resize(sizers, resample=Resampling.LANCZOS)
.filter(ImageFilter.GaussianBlur(10))
)
def resize_width_main(border_img: Image, size_width: int) -> Image:
width, height = border_img.size[:2]
w_percent = size_width / width
h_size = round(height * w_percent)
return border_img.resize((size_width, h_size), Resampling.LANCZOS)
def center_overlay(overlay_img: Image, blur_img: Image) -> None:
box = [
round((xb - xo)/2)
for xb, xo in zip(blur_img.size, overlay_img.size)
][:2]
blur_img.paste(im=overlay_img, box=box) | {
"domain": "codereview.stackexchange",
"id": 43461,
"lm_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, image",
"url": null
} |
# Why does the intersection of two parametric curves have different t results for each curve?
I'm slightly confused after reading the problem posed here: Points of intersection of two parametric curves
Why is it that the "t" result at the intersection point of the two curves is not the same? I.e. the solution involves the answer "t1" for the first curve and "t2" for the second curve, but if the two curves are being made equal, why is t1 != t2?
Also, is there any way we can "manufacture" two different curves (say two parametric straight lines) that, at a specific t value for BOTH curves, yield the SAME point in space? How would you go about doing that? (given, for example, 3 points in space)
• An intersection only requires the $x$ and $y$ values to be equal, which may occur at different $t$ values. – Tavish Jan 21 at 11:27 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.972830769252026,
"lm_q1q2_score": 0.8042506684987634,
"lm_q2_score": 0.826711791935942,
"openwebmath_perplexity": 201.3286929195652,
"openwebmath_score": 0.7014357447624207,
"tags": null,
"url": "https://math.stackexchange.com/questions/3994005/why-does-the-intersection-of-two-parametric-curves-have-different-t-results-for"
} |
as data structures, using these operators or functions to construct the difference of sets a and b: SQL SELECT * FROM A MINUS SELECT * FROM B Mathematica Complement[1] MATLAB setdiff[2] MathML <apply xmlns="http://www.w3.org/1998/Math/MathML"> <setdiff/> <ci type="set">A</ci> <ci type="set">B</ci></apply> Pascal SetDifference := a - b; Python diff = a.difference(b)[3] diff = a - b[3] Java diff = a.clone(); diff.removeAll(b);[4] Scala diff = a -- b[5] C++ set_difference(a.begin(), a.end(), b.begin(), b.end(), result.begin()); .NET Framework a.Except(b); Haskell a \\ b [6] Common Lisp set-difference, nset-difference[7] OCaml Set.S.diff[8] Unix shell comm -23 a b[9] grep -vf b a # less efficient, but works with small unsorted sets PHP array_diff($a, $b);[10] R setdiff[11] Ruby diff = a - b[12] Perl #for perl version >= 5.10 @a = grep {not$_ ~~ @b} @a; | {
"domain": "formulasearchengine.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9877587243478403,
"lm_q1q2_score": 0.8143694606710845,
"lm_q2_score": 0.8244619263765707,
"openwebmath_perplexity": 225.0167380669358,
"openwebmath_score": 0.7979258298873901,
"tags": null,
"url": "https://formulasearchengine.com/index.php?title=Complement_(set_theory)&oldid=222936"
} |
c#, delegates
What if it's being called on the UI thread, and it wouldn't make sense to call Thread.Sleep between retries?
The problem with this method is that it tries to be too general. Retry logic will often have very specific requirements that can't be abstracted away into one function. For instance, say I'm getting exceptions that contain HTTP status codes. If I'm getting 503 Service Unavailable, I may want to try again with exponential back-off. But if it's a 400 Bad Request, there is something wrong with my code and I should log it without retrying. | {
"domain": "codereview.stackexchange",
"id": 7943,
"lm_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#, delegates",
"url": null
} |
electromagnetism, torque, moment-of-inertia, dipole-moment
My question: is there a sensible way to introduce a point electric dipole with well defined electrical and mechanical properties? If no, can we conclude that point electric dipoles are not consistent constructs in physics? (Luckily, no one has observed one yet!)
is there a sensible way to introduce a point electric dipole with well defined electrical and mechanical properties? | {
"domain": "physics.stackexchange",
"id": 71770,
"lm_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, torque, moment-of-inertia, dipole-moment",
"url": null
} |
fourier-transform, crystals
$2\pi\frac{\vec{b}\times\vec{c}}{\vec{a}.(\vec{b}\times\vec{c})}$
$2\pi\frac{\vec{c}\times\vec{a}}{\vec{a}.(\vec{b}\times\vec{c})}$
$2\pi\frac{\vec{a}\times\vec{b}}{\vec{a}.(\vec{b}\times\vec{c})}$
I see these reciprocal lattice vectors still in real space. Many courses commonly teach that the reciprocal lattice vectors are perpendicular to the crystal planes and this makes sense, when you look at the cross product. However, the "k-space" is also taught to have dimensions of momentum and this is something I'm unable to grasp. | {
"domain": "physics.stackexchange",
"id": 31979,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fourier-transform, crystals",
"url": null
} |
reaction-mechanism, proteins, cheminformatics, enzymes, structural-biology
-12.6850 17.2510 -29.7500 C 0 0 0 0 0 0
-11.8880 18.4020 -29.6340 C 0 0 0 0 0 0
15.0870 13.3451 24.9864 H 0 0 0 0 0 0
15.1652 16.2083 -24.6594 H 0 0 0 0 0 0
13.3020 14.3813 26.3365 H 0 0 0 0 0 0
-13.0187 14.7620 24.7144 H 0 0 0 0 0 0
-11.9216 17.1391 24.1357 H 0 0 0 0 0 0
10.8758 18.9852 25.6005 H 0 0 0 0 0 0
-13.6529 15.5996 -28.7207 H 0 0 0 0 0 0
10.7900 19.7280 -28.3250 H 0 0 0 0 0 0
13.0445 16.9378 30.7412 H 0 0 0 0 0 0
-11.6365 18.9759 30.5380 H 0 0 0 0 0 0
-1.6230 26.2960 -21.6210 N 0 0 0 0 0 0
-2.3730 25.1550 -21.1470 C 0 0 2 0 0 0
1.3599 24.1150 -20.7020 C 0 0 0 0 0 0
-0.4800 23.7390 -21.4780 O 0 0 0 0 0 0
-3.2400 24.5350 -22.2340 C 0 0 2 0 0 0
-4.0820 23.4020 -21.6640 C 0 0 2 0 0 0
-4.8680 22.3140 -22.8510 S 0 0 0 0 0 0 | {
"domain": "chemistry.stackexchange",
"id": 16077,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reaction-mechanism, proteins, cheminformatics, enzymes, structural-biology",
"url": null
} |
matlab
I might be wrong on any of the above points, as I'm not most familiar with other languages. Any comments? I beg to differ. I've seen a multitude of researchers using MatLab in their respective research initiatives. MatLab, as many will soon point out, is closed source. In addition to its code proprietary legalities, it has a hefty price tag. Almost all educational institutions, in the US for example, that are ranked as "Highest Research Activity" and "Higher Research Activity" universities by Carnegie Classification of Institutions of Higher Education will typically have bulk licensing. This means that their professors, masters(thesis), and doctoral students will have MatLab availability(at their request) from their local office of information technology (OIT) in their respective universities(typically the College of Engineering at a university) | {
"domain": "datascience.stackexchange",
"id": 4073,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "matlab",
"url": null
} |
astronomy, galaxies, spectroscopy
Title: Galaxy Spectra: Emission and Absorption Lines Spectra from galaxies include both absorption and emission lines. I do understand how both types of spectral lines are produced but I am not quite sure where each type is coming from when we observe a galaxy. Few month ago I was told that emission lines are coming from the gas of the galaxy and absorption lines are coming from the stars of the galaxy. Is that correct? If it is, why the opposite doesn't happen? Why can't we have absorption lines coming from the gas of the galaxy? I am mostly (but not exclusively) interested in the Hydrogen lines. | {
"domain": "physics.stackexchange",
"id": 9386,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "astronomy, galaxies, spectroscopy",
"url": null
} |
Take $$\mathbb{Q}\cup[0,1]$$, for instance.
• Yes, it works. Now I need a dense more complicated. I want a dense not ''composed'' by countable denses, nor nullsets. – guchihe Jan 9 at 21:07
• I suggest that you post it as another answer. But explain better what you're after. – José Carlos Santos Jan 9 at 21:48 | {
"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.8014890764053457,
"lm_q2_score": 0.8311430562234878,
"openwebmath_perplexity": 559.9153538012157,
"openwebmath_score": 0.9580352902412415,
"tags": null,
"url": "https://math.stackexchange.com/questions/3067208/is-there-a-dense-set-in-mathbbr-with-outer-measure-1-and-what-about-with?noredirect=1"
} |
c, homework
Test for Possible Memory Allocation Errors
I addressed this in the first review, however, I will address it again because it is very important.
In modern high level languages such as C++, memory allocation errors throw an exception that the programmer can catch. This is not the case in the C programming language. As the code is now, if this code was used in software to control an airplane during flight I would not get on that airplane, there is inherent Unknown Behavior (UB) in how malloc() and calloc() are used in the code, this is especially true if the code is working in a limited memory application such as embedded control systems. The failure of memory allocation in C on regular computers is less of an issue since there is a lot of memory, but in limited environments this is still important.
Here is the code I am talking about:
In main.c:
int main() {
HASH_CONS_TABLE hc = malloc(sizeof(struct hash_cons_table));
hc->hashf = hash;
hc->equalf = equal;
hc->size = 0; | {
"domain": "codereview.stackexchange",
"id": 38718,
"lm_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, homework",
"url": null
} |
electrons, atomic-physics, atoms, orbitals
Title: How much space does an atom occupy? So my stupid question is: we know that in the classical model of a atom there is a nucleus at the middle and electron revolving around it in orbits numbered from 0 to infinity. So according to this an atom must have infinite space to accommodate infinite orbits. How is this possible and where am I going wrong? Even in the classical model, an infinite amount of levels doesn't necessarily mean that it occupies an infinite amount of space. You can divide any finite distance into infinitely many bits (for instance, $1 = \frac{1}{2} + \frac{1}{4} + \frac{1}{8} + \ldots$). EDIT: I'd forgotten about the $r\sim N^2$ relation that the OP mentions below, so yes, although the above is true, in the classical theory the size of the atom will go to infinity for $N\rightarrow\infty$. | {
"domain": "physics.stackexchange",
"id": 22594,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrons, atomic-physics, atoms, orbitals",
"url": null
} |
rotational-dynamics, reference-frames, moment-of-inertia, rigid-body-dynamics
You can define the moment of inertia about any axis, and not just the axis of rotation of the object, using the parallel axis theorem which states that if a body has a moment of inertia $I$, and if the object now rotates about another axis (parallel to the original axis) then $$I'=I+ml^2$$ where $l$ is the perpendicular distance between the two axes, and $I'$ is the moment of inertia about the new axis. | {
"domain": "physics.stackexchange",
"id": 85909,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rotational-dynamics, reference-frames, moment-of-inertia, rigid-body-dynamics",
"url": null
} |
python, beginner, python-3.x, adventure-game
print_on_a_timer([1, 1, 1], ["Opening...", "Opening...", "Opening..."])
random_events = [(FoundShield, [1,]),
(FoundShield, [2, ]),
(NegativeEvent, ["A dwarf jumps out and steals one of your shields!", -1]),
(NegativeEvent, ["An evil fairy steals two of your shields!", -2]),
(JustMessage, ["Sorry, the chest is empty"]),
(Encounter, ["A goblin is in the chest.", Goblin])
]
event, options = random.choice(random_events)
return event(*options)
class JustMessage(Event):
def __init__(self, msg):
super(JustMessage, self).__init__()
self._message = msg
class TrippedOverALog(Event):
_message = "You have tripped over a log!"
_result = -1 | {
"domain": "codereview.stackexchange",
"id": 7847,
"lm_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, adventure-game",
"url": null
} |
electromagnetism, general-relativity, black-holes
$\begin{align}
F_{r\phi}&=\frac{(a^{2}\cos^{2}\theta - r^{2})ea\sin^{2}\theta}{(r^{2}+a^{2}\cos^{2}\theta)^{2}}\\
F_{\theta\phi}&=\frac{(r^{2}+a^{2})era\sin(2\theta)}{(r^{2}+a^{2}\cos^{2}\theta)^{2}}
\end{align}$ | {
"domain": "physics.stackexchange",
"id": 4857,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, general-relativity, black-holes",
"url": null
} |
homework-and-exercises, newtonian-mechanics, string, continuum-mechanics
Title: What is the equation for a string fixed at both ends without simplifying assumptions? The book Mathematical Physics by Eugene Butkov has, on Chapter 8, the equation for a held string (by held I mean with endpoints fixed and both at the same height) as being
$$T\frac{\partial^2 u}{\partial x^2}+F(x)-\rho(x)g=\rho(x)\frac{\partial^2 u}{\partial t^2},$$
where $T$ is the tension, $F$ an external force, $\rho$ the density, $g$ gravity and $u$ transversal (vertical) displacement.
However, the book derives this equation assuming the string deforms little from the horizontal position and the tension is contant. Such assumptions are strong, I think.
Plus, for the stationary case $\frac{\partial u}{\partial t}=0$ it doesn't seem to differentiate between a string hanging by its own weight and a string being pulled by a constant force. And we know these two situations are different since the solution for them is a catenary and a parabola, respectively. | {
"domain": "physics.stackexchange",
"id": 48519,
"lm_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, string, continuum-mechanics",
"url": null
} |
electrochemistry, water, metal
Title: Water electrolysis - what is happening to an iron anode? So I made an experiment to find a good electrolyte for a water electrolysis.
I tried citric acid, which turned out to not produce any gases at the anode, I tried sodium hydroxide, which turned out to be the very best, and I tried sodium carbonate.
The $\ce{Na2CO3}$ solution was about 2 g/l.
As my electrodes I decided to try some nails, very likely made of iron or some iron alloy.
So I hooked up my power source, just two nine-volt-batteries in series, and started the electrolysis.
The kathode (negative terminal) bubbled vigorously, indicating the production of hydrogen gas.
The anode (positive terminal) however bubbled very little and started decomposing, gray-green flakes started falling off and sinking to the bottom. This decomposition started as soon as the power was supplied.
This struck me, because I was expecting oxygen to be liberated at the anode! | {
"domain": "chemistry.stackexchange",
"id": 10833,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrochemistry, water, metal",
"url": null
} |
classification
Suppose that in a still image, 2 different classes of objects look identical. However, in a video Class A glides smoothly across the screen while Class B meanders chaoticaly across the screen.
When given multiple videos of the same person walking, classify whether he's sober or drunk. Machine learning systems work based on input data. The form of that data is irrelevant. It may need some configuring on the technical side of things, but the general ability to learn from the dataset remains the same.
ML systems are built to learn how to interpret data, without you needing to predefine exactly what it should be looking for.
But even then, you can reason that videos are no different from images. A video is essentially nothing but a flipbook of images. If you were to paste every frame of the video in a long sequence, you would have one big picture. | {
"domain": "ai.stackexchange",
"id": 1242,
"lm_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",
"url": null
} |
pcl
Title: pcl surface reconstruction poisson
Hello
I was looking in pcl for surface reconstruction methods.
I found the poisson surface reconstruction which I would like to use.
However, I cannot find the include file #include <pcl/surface/poisson.h>
which is indicated here
Since I have pcl installed with ROS, not the standalone version,
I searched for it in ros packages pcl, pcl_ros, perception_pcl, perception_pcl_addons ...
Do you know where I can find this header? Are there any pcl functionalities not included in ros?
Thanks
Miguel
Originally posted by Miguel Riem de Oliveira on ROS Answers with karma: 254 on 2011-10-06
Post score: 1
I'm not quite sure, but the programmer of the Poisson Surface reconstruction mailed me there were some problems with his code. For that reason it's not available in the trunk of pcl-1.2. I also tried to get it running correct, but it seems it's not working fully.
Ok, I'm not using ROS, so maybe it's changed and now available. But I don't think so. | {
"domain": "robotics.stackexchange",
"id": 6880,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "pcl",
"url": null
} |
homework-and-exercises, rotational-dynamics, moment-of-inertia
\end{matrix} \right] $$
So as you can see, when $\theta=\pi/4$ you have $I_{x'x'} = I_{z'z'} = \frac{3}{4}MR^2$.
Simple rule
The trace of the inertial tensor is invariant under change of co-ordinates. In normal co-ordinates it is $2MR^2$ (just the sum of the three diagonal components). In our rotated co-ordinates, since when $\theta = \pi/4$ symmetries suggest $I_{x'x'}=I_{z'z'}$ and $I_{y'y'}=I_{yy}=MR^2/2$ (the $y$ axis is the rotation axis and so it doesn't change), you can impose trace invariance and get the result. | {
"domain": "physics.stackexchange",
"id": 43718,
"lm_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, rotational-dynamics, moment-of-inertia",
"url": null
} |
java, email
client.sendUrgentData(1);
}
}
public InetAddress getSocketAddress() {
return this.server.getInetAddress();
}
public int getPort() {
return this.server.getLocalPort();
}
public static void main(String[] args) throws Exception {
// set the server address (IP) and port number
//add your code here
String serverIP = "192.168.56.1"; // local IP address
int port = 7077;
if (args.length > 0) {
serverIP = args[0];
port = Integer.parseInt(args[1]);
}
// call the constructor and pass the IP and port
//add your code here
TCPServer server = new TCPServer(serverIP, port);
System.out.println("\r\nRunning Server: " +
"Host=" + server.getSocketAddress().getHostAddress() +
" Port=" + server.getPort());
System.out.println("220 " + serverIP);
server.listen();
}
} | {
"domain": "codereview.stackexchange",
"id": 40879,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, email",
"url": null
} |
special-relativity, reference-frames, inertial-frames
Is this interpretation correct?
My idea is that S sees the events happening simultaneously, but, from its point of view, S' won't see them being simultaneous. On the other hand, S' actually sees the events happening at the same time, but for him S doens't. Is this interpretation correct? | {
"domain": "physics.stackexchange",
"id": 96338,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "special-relativity, reference-frames, inertial-frames",
"url": null
} |
electromagnetism, electromagnetic-radiation, acceleration, maxwell-equations, dipole
Thus, the overall radiation field is
$$
\vec{E}(\vec{r}, t) = (\vec{p} \cdot \vec{\nabla}) \vec{E}_1 \\
\sim \frac{\mathcal{R}}{4 \pi \epsilon_0} \left\{ \frac{ \vec{\mathcal{R}} \times [ ((\vec{p} \cdot \vec{\nabla})\vec{u} ) \times \vec{a}]}{(\vec{\mathcal{R}} \cdot \vec{u})^3}
+ \frac{ \vec{\mathcal{R}} \times [ \vec{u} \times ((\vec{p} \cdot \vec{\nabla}) \vec{a})]}{(\vec{\mathcal{R}} \cdot \vec{u})^3} - 3 \frac{\vec{\mathcal{R}} \times [ \vec{u} \times \vec{a}]}{(\vec{\mathcal{R}} \cdot \vec{u})^4} \vec{\mathcal{R}} \cdot [ (\vec{p} \cdot \vec{\nabla}) \vec{u} ] \right\}
$$
The first term vanishes, since $(\vec{p} \cdot \vec{\nabla}) \vec{u}$ is parallel to $\vec{a}$; and the result is that
$$ | {
"domain": "physics.stackexchange",
"id": 49082,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, electromagnetic-radiation, acceleration, maxwell-equations, dipole",
"url": null
} |
by using the "+", "x", and "-" symbols along the way. Calculate at each step - order of operations is turned OFF for this puzzle. For example: N-N-N-N-N-N-E-E-E-E-N would earn 54 points. Post your maximum in the comments! You can cross your own path, but you can't take the same route twice, or return along a path you've already taken. Copyright(c) 2003 Ryosuke Ito ## Sunday, February 9, 2014 ### 23: Graphicacy and the Science Fair Wandered around Science Fair, found this ... Here's the data. Trial 1 Trial 2 Trial 3 Trial 4 Hot Water 30 25 25 25 Cold Water 600 720 720 540 Warm Water 350 360 420 360 The basic experiment was to have water of differing temperatures and see how long it takes for a bag of pop rocks to fully dissolve. Discuss this experiment. Graphicacy is the ability to create a visual (usually in graph form) that communicates well with the reader. Generally, if it takes the reader more than a few seconds to figure out what's going on, it's a bad diagram or graph. 1. Is this | {
"domain": "blogspot.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.967899295134923,
"lm_q1q2_score": 0.8338822204786018,
"lm_q2_score": 0.8615382040983515,
"openwebmath_perplexity": 4748.544662771787,
"openwebmath_score": 0.3922409415245056,
"tags": null,
"url": "https://matharguments180.blogspot.com/2014/02/"
} |
java, performance, algorithm, array, statistics
public static double getStandardDeviation(final double[] x){
if(x.length == 0){
throw new NoSuchElementException("Standard Deviation of an empty array cannot be found");
}
return sqrt(getVariance(x));
}
public static double getStandardDeviationUnOpt(final double[] x) {
if(x.length == 0){
throw new NoSuchElementException("Standard Deviation of an empty array cannot be found");
}
double sumDiffs = 0;
double avg = getArithmeticMean(x);
for (int i = 0; i < x.length; i++) {
sumDiffs += (x[i] - avg) * (x[i] - avg);
}
return sqrt(sumDiffs / (x.length - 1));
}
} | {
"domain": "codereview.stackexchange",
"id": 23402,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, performance, algorithm, array, statistics",
"url": null
} |
sequence-alignment, python
aligner = Align.PairwiseAligner()
aligner = Align.PairwiseAligner()
aligner.match_score = 5
aligner.mismatch_score = -9
aligner.mode = 'global'
aligner.target_internal_open_gap_score = -12
aligner.target_internal_extend_gap_score = -3
aligner.target_end_open_gap_score = -12
aligner.target_end_extend_gap_score = -3
aligner.query_internal_open_gap_score = -12
aligner.query_internal_extend_gap_score = -3
# Set the query_end penalties to zero to effectively implement a 'glocal' alignment as described in the question
# These are the default values, so you could skip the next two lines,
# but this is relevant to the question, so I'm including them in the example.
aligner.query_end_open_gap_score = 0
aligner.query_end_extend_gap_score = 0
alignments = aligner.align("GAACTCGCATCGATGATCCGTGCGCTGAGATCCGCTGACATGATC", "GATCCG")
for a in alignments:
print(a)
print()
print()
alignments = aligner.align("GAACTCGCATCGATGATCCGTGCGCTGAGATCCGCTGACATGATC", "GATACG") | {
"domain": "bioinformatics.stackexchange",
"id": 1818,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "sequence-alignment, python",
"url": null
} |
periodic-table, periodic-trends, elements
For example, ‘hydrogen’ sounds similar to ‘hydrant’, so when you visualize a hydrant sitting at your front door, you’ll be prompted to remember ‘hydrogen’. When you picture a large helium balloon tied to your front gate, you’ll remember helium. And when your bus begins talking with a ‘lithp’ (how people with a lisp pronounce ‘lisp’), you’ll be prompted to recall lithium.
These established memory techniques have been proven by over 50 years of academic research in fields like cognitive psychology. Google ‘memory palace’ or ‘world memory champion’ and you’ll discover they’re the fastest and most effective methods to memorize a deck of playing cards and a lot of other geeky things. | {
"domain": "chemistry.stackexchange",
"id": 6374,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "periodic-table, periodic-trends, elements",
"url": null
} |
Conclusion: By mathematical induction, the statement $S(n)$ is true for all $n\geq 1$. $\blacksquare$
Another approach: $2^1=2 >1$ and left hand side grows faster than R.H side after $x=1/2$, i.e., $\frac {d}{dx} 2^x = \frac {d}{dx} (e^{xln2})=ln2(2^x)> \frac {d}{dx}(x)=1$ for $n>1/2$
So $2^1>1$ , and $2^n$ grows faster than $n$ after $n=1$ ( after around $x=1/2$). | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9854964228644458,
"lm_q1q2_score": 0.835669196372075,
"lm_q2_score": 0.8479677622198946,
"openwebmath_perplexity": 185.50539920300642,
"openwebmath_score": 0.9197381138801575,
"tags": null,
"url": "https://math.stackexchange.com/questions/1360246/proving-n-lt-2n-for-n-geq-1-using-induction/1360251"
} |
homework-and-exercises, thermodynamics, statistical-mechanics
So I tried using this equation to see if I can find the correct answer. I took a system of $N=13$ particles
$$
\begin{array}{|c|c|c|c|c|c|}
\hline
k & 1 & 2 & 3 & 4 & 5 \\
n_k & 3 & 2 & 1 & 4 & 3 \\
\hline
\end{array}
$$
where $k$ are the individual microscopic states and $n_k$ is their occupation numbers respectively.
And when I applied the equation, I get
$$\frac{13!}{3!2!1!4!}=21621600$$ which is so far off from the number expected (2).
I must have understand the equation wrong. Can someone please explain to me how exactly does this equation work? Apart from the fact that you forgot another $3!$ factor from the denominator, the answer is correct. That is, the number of states in a $N=13$ particle system with the same set of $n_k$-s that you described is equal to:
$$
\frac{13!}{3!2!1!4!3!}=3603600.
$$ | {
"domain": "physics.stackexchange",
"id": 44142,
"lm_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, thermodynamics, statistical-mechanics",
"url": null
} |
ros, drone, tum-simulator, ros-kinetic
<!-- Downward facing camera -->
<xacro:include filename="$(find cvg_sim_gazebo)/urdf/sensors/generic_camera.urdf.xacro" />
<xacro:generic_camera name="bottom" sim_name="ardrone" parent="base_link" update_rate="60" res_x="640" res_y="360" image_format="R8G8B8" hfov="${81*M_PI/180}">
<origin xyz="0.15 0.0 0.0" rpy="0 ${M_PI/2} 0"/>
</xacro:generic_camera>
</robot>
Originally posted by patricia on ROS Answers with karma: 46 on 2017-08-30
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 28737,
"lm_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, drone, tum-simulator, ros-kinetic",
"url": null
} |
Discussion:
I showed this proof to my professor. He said it's wrong because in the limit
$$\lim_{n \rightarrow \infty, m \rightarrow \infty} x_n - x_m = 0$$
$$n$$ and $$m$$ cannot be related. I accepted his argument. Later, out of curiosity I looked up again the definition of Cauchy sequence and nowhere does it say that $$n$$ and $$m$$ cannot be related. Then I brought it up to my professor, and this time he said that I'm choosing a particular $$n$$ and $$m$$ and that I cannot do that in proving that $$X_n$$ is a Cauchy sequence.
I thought that I'm not fixing anything since $$2n$$ and $$2n - 1$$ are not fixed, and even then I could write
$$\lim (x_{2n} - x_{2m}) = a - a = 0$$
and what I wrote would still hold true.. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9441768557238083,
"lm_q1q2_score": 0.8169245669092609,
"lm_q2_score": 0.8652240964782011,
"openwebmath_perplexity": 96.84960081240206,
"openwebmath_score": 0.9187325239181519,
"tags": null,
"url": "https://math.stackexchange.com/questions/3421795/disagreement-with-professor-about-cauchy-sequence"
} |
fluid-dynamics, everyday-life, flow, bubbles
but water bubbles is not created at the top of the bottle if the water level is lower:
This question is very different from this one and this is how what my drawing look in reality.
Why are water bubbles created at the top of the bottle if the water level is higher? In order for water to leave the upper tank, air must enter it through the same opening as the water leaves. This creates the bubbling effect as the upper tank is emptied - it is like filling a bottle with water, then turning it upside down.
However, if the seal between the upper tank and the lower tank is not air tight then air can enter the lower tank around this seal. So as water leaves the lower tank through the lower drain, then air enters it around the drain from the upper tank. The flow of water from the drain does not have to be interrupted to allow air to enter through the drain, and so no bubbles appear in the lower tank. | {
"domain": "physics.stackexchange",
"id": 100154,
"lm_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, everyday-life, flow, bubbles",
"url": null
} |
classification, regression, prediction
And we can check the RMSE like so:
from sklearn.metrics import mean_squared_error
rmse = np.sqrt(mean_squared_error(y_test, preds))
print("RMSE: %f" % (rmse))
>>> RMSE: 1542.541395
Note that RMSE in the 2 methods is quite close (1571.88 vs 1542.54). This is like a sanity check for us that no matter which method we use, if we use it correctly, we should get similar results.
Stage 3 - testing and evaluation of the model - k-fold Cross Validation
Finally its time to see how our model performs on test data:
params = {"objective":"reg:linear",'colsample_bytree': 0.3,'learning_rate': 0.1,
'max_depth': 5, 'alpha': 10}
cv_results = xgboost.cv(dtrain=d_train, params=params, nfold=3,
num_boost_round=50,early_stopping_rounds=10,metrics="rmse", as_pandas=True) | {
"domain": "datascience.stackexchange",
"id": 4065,
"lm_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, regression, prediction",
"url": null
} |
c, playing-cards
int main(){
printf("Welcome to my BlackJack Simulator! Below are the basic rules:\n- Beat the dealer's hand without going over 21.\n- Face cards are worth 10, Aces are worth 1 or 11, whichever makes a better hand.\n- Each player starts with two cards, and one of the dealer's cards is hidden until the end.\n- Type 'hit' to ask for another card. Type 'stand' to hold your total and end your turn.\n- If you go over 21 you bust, and the dealer wins regardless of his hand.\n- If you are dealt 21 from the start (Ace & 10), you got a blackjack. If you get a blackjack, you win 1.5 times the amount of your bet automatically, unless the dealer also gets a blackjack, in which case it is a push.\n- Remember: Type 'hit' to get another card, and 'stand' to hold. At the beginning of the round, type 'bet' followed by the quantity you want to bet (i.e. 'bet 50').\nType 'play' to begin. At any time, you may type 'help' to get a list of valid commands.\n");
char input[6]; | {
"domain": "codereview.stackexchange",
"id": 36845,
"lm_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, playing-cards",
"url": null
} |
electromagnetic-induction
Much like in any regular wire, due to the E field from a battery.
The emf assuming there is a wire, vs isn't. Is the same, but the direction of E along the loop I choose is different. | {
"domain": "physics.stackexchange",
"id": 87354,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetic-induction",
"url": null
} |
While it’s not apparent that writing the Taylor Series for a polynomial is useful there are times where this needs to be done. The problem is that they are beyond the Check This Out Show Answer There are a variety of ways to download pdf versions of the material on the site. A sloppy but good and simple estimate on $\sin c$ is that $|\sin c|\le 1$, regardless of what $c$ is. The more terms I have, the higher degree of this polynomial, the better that it will fit this curve the further that I get away from a. Taylor Series Remainder Calculator
Close the Menu The equations overlap the text! Taylor's Inequality Now let's think about when we take a derivative beyond that. patrickJMT 130,005 views 2:22 Estimating error/remainder of a series - Duration: 12:03.
## What are they talking about if they're saying the error of this Nth degree polynomial centered at a when we are at x is equal to b. | {
"domain": "accessdtv.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9362850110816423,
"lm_q1q2_score": 0.811792590799822,
"lm_q2_score": 0.8670357649558007,
"openwebmath_perplexity": 494.5201961555152,
"openwebmath_score": 0.7316290736198425,
"tags": null,
"url": "http://accessdtv.com/taylor-series/taylor-series-polynomial-error.html"
} |
ros, moveit, ros-melodic, baxter
ROS_INFO_NAMED("tutorial", "Visualizing dab - right arm (pose goal) %s", success_R ? "" : "FAILED");
ROS_INFO_NAMED("tutorial", "Visualizing dab - left arm (pose goal) %s", success_L ? "" : "FAILED");
move_group_L.move();
move_group_R.move();
/*
DAB - RIGHT
pose:
position:
x: 0.357449700371
y: -0.0845383821871
z: 0.398438102254
orientation:
x: -0.347113539773
y: -0.354022093046
z: -0.548629443089
w: 0.673191118715
DAB - LEFT
frame_id: ''
pose:
position:
x: 0.265252415343
y: 1.18807756952
z: 1.08236724242
orientation:
x: -0.260426879784
y: 0.376068085189
z: 0.494750557147
w: 0.738899534301
*/
}
int main(int argc, char** argv)
{
ros::init(argc, argv, "move_group_interface_tutorial");
ros::NodeHandle node_handle;
ros::AsyncSpinner spinner(1);
spinner.start();
printf("Hi!\n"); | {
"domain": "robotics.stackexchange",
"id": 34836,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, moveit, ros-melodic, baxter",
"url": null
} |
immunology, virology, pathology, epidemiology, coronavirus
Why would an expert express this expectation?
Is it because we're heading toward summer (at least where most COVID-19 cases have been reported), or is it a standard pattern, perhaps either due to people's immune systems or due to the virus evolving and becoming weaker? While the data are much too sparse and noisy to give an answer about what is happening to COVID-19's virulence (the technical term for the "deadliness" of an infectious disease), or to forecast what will happen to its virulence in the future, there are indeed theoretical reasons that one might expect the virulence to decline in the future. | {
"domain": "biology.stackexchange",
"id": 12148,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "immunology, virology, pathology, epidemiology, coronavirus",
"url": null
} |
quantum-mechanics, schroedinger-equation, probability
I'm pretty sure I'm misunderstanding something. In particular, No.3 suggest that I could predict future probability distributions of the wave function and I know from talking to people on SE that's wrong.
My Question:
Can someone explain which (if any) of my assumptions above is wrong and explain why?
We cannot know where the particle is with certainty.
The particle, in general, does not have a definite location to know.
Under certain conditions, we can know and predict future probability
distributions.
The evolution of the state is determined by the Hamiltonian (in the Schrodinger picture). The problem is that we don't know the Hamiltonian for the measurement apparatus. Thus, the certain conditions are that the Hamiltonian is known. The "collapse of the wavefunction" is essentially a reflection or our ignorance of the Hamiltonian including the measurement apparatus. | {
"domain": "physics.stackexchange",
"id": 19861,
"lm_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, schroedinger-equation, probability",
"url": null
} |
ruby, ruby-on-rails, regex, markdown
html = MarkdownService.instance.render content
content_tag :div, html
end
private
def truncate_article_content
index_at = article.content.index(READ_MORE_REGEX)
if index_at
truncate_length index_at
else
first_characters
end
end
def truncate_length(length)
url = _h.article_url(article)
_h.truncate(article.content, length: length, omission: " [Show more](#{url})")
end
def first_characters(length= DEFAULT_LENGTH)
_h.truncate(article.content, length: length)
end | {
"domain": "codereview.stackexchange",
"id": 18275,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ruby, ruby-on-rails, regex, markdown",
"url": null
} |
type-theory, functional-programming, type-checking, language-design
So I'd like to be able to ditch the x in the original type to get Pair a b. So the question would be, when can a variable be safely ditched? I think this would be variables that are not bound to an outer type. In my definition of pair above, the type of \f.(f a b) is really $\forall x (a \rightarrow b \rightarrow x) \rightarrow x$ with $a$ and $b$ bound to the outer type, so if I want to encode this type, I only need to store the types of $a$ and $b$ to be able to recreate the original type.
I think what my type checker needs to do is basically (in the case of Pair), when it sees a $to keyword, first type check its term, then unify its type with (a -> b -> x) -> x (using a fresh copy of x) and finally make sure that no occurrence of x has been unified with any type that exists in the current type context. If that's all good, then return the type Pair a b with a and b taken from the resulting type. | {
"domain": "cs.stackexchange",
"id": 7170,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "type-theory, functional-programming, type-checking, language-design",
"url": null
} |
ros, laser, scan, base-link, transform
So ROS can do its magic.
Anyway, if what you want is to translate a laser scan into a point cloud, don't re-invent the wheel, just take a look at laser_geometry package.
Originally posted by Martin Peris with karma: 5625 on 2014-05-25
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by dreamcase on 2014-05-25:
It doesn't work for me.
I am trying to follow this one, http://wiki.ros.org/laser_pipeline/Tutorials/IntroductionToWorkingWithLaserScannerData
the purpose is to take in laser scan and use TF to do the transform to get point cloud.
btw, if I do "rostopic list", I am getting
/base_scan
/my_cloud
/rosout
/rosout_agg
/tf
/tf_static | {
"domain": "robotics.stackexchange",
"id": 18055,
"lm_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, laser, scan, base-link, transform",
"url": null
} |
complexity-theory, np-complete, partitions
Title: Partition problem with distinct integers The partition problem is a well-known NP-complete problem. In the definitions I have seen, the input is assumed to be a multiset of integers, and we want to decide the existence of a partition into two sets that have the same sum. My question is:
Is the partition problem still NP-complete if all input integers are distinct (i.e., no integer is repeated)? Here is an outline of a reduction from PARTITION to UNIQUE PARTITION. Suppose the original numbers are $x_1,\ldots,x_n$ and the target is $T$. I assume that all $x_i$ are positive integers. The new numbers are going to be $2^n x_i + i$, as well as $1,2,4,\ldots,2^{n/2}$, and the new target is $2^n T + 2^{n/2}$. (The numbers $2^n,2^{n/2}$ are quite arbitrary and could be made much smaller.) | {
"domain": "cs.stackexchange",
"id": 1556,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "complexity-theory, np-complete, partitions",
"url": null
} |
algorithms, matrix
We got sum 13, this is maximum sum for given matrix and for given K.
It looks similar weighted assignment problem or weighted bipartite matching, but I don't know how to reduce this task to them.
Thank you! There is trivial reduction from set cover. Consider 0-1 matrix where columns are subsets, rows are set elements and 1 means that subset contains element. Algorithm for your problem then can find K subsets to cover (sum max elements to n) set.
So your problem is NP-hard, no chances. | {
"domain": "cs.stackexchange",
"id": 14260,
"lm_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, matrix",
"url": null
} |
python, unit-testing, linked-list
if at_index.next is None:
self.append(data)
return
new_node = Node(data)
new_node.next = at_index.next
at_index.next = new_node
def insert_at_index(self, index, item):
"""Insert the given item at the given index in this linked list, or
raise ValueError if the given index is out of range of the list size.
"""
# Check if the given index is out of range and if so raise an error
if not (0 <= index <= self.size):
raise ValueError('List index out of range: {}'.format(index))
if index == 0:
self.prepend(item)
elif index == self.size:
self.append(item)
else:
new_node = Node(item)
node = self.head
previous = None
for i in range(index):
previous = node
node = node.next | {
"domain": "codereview.stackexchange",
"id": 28019,
"lm_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, unit-testing, linked-list",
"url": null
} |
neuroscience, pharmacology, neurotransmitter
Opioids are substances that act on opioid receptors to produce morphine-like effects. Medically they are primarily used for pain relief, including anesthesia. Other medical uses include suppression of diarrhea, treating addiction, reversing opioid overdose, suppressing cough, and suppressing opioid induced constipation. Extremely strong opioids are approved only for veterinary use such as immobilizing large mammals. Opioids are also frequently used non-medically for their euphoric effects or to prevent withdrawal. (emphasis added) First there was opium. Then the active components of opium (morphine etc.) were defined and called opiates. Then the receptors for opiates were discovered, along with their endogenous ligands (enkephalins etc.), and since those endogenous ligands were not derived from opium and indeed (being peptides) were not chemically related to opiates, a new term was needed. This term was opioid, and yes, the definition of an opioid is that it is something which binds to | {
"domain": "biology.stackexchange",
"id": 7594,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neuroscience, pharmacology, neurotransmitter",
"url": null
} |
(known as bins ), whereas the graph of a histogram is merely one. -Central Tendency + Variability = a more accurate picture of our data set. Solution of exercise 1. Grouped Data. • Calculate the different measures of variability of a given ungrouped data: range, standard deviation, and variance • Describe and interpret data using measures of central tendency and measures of variability 3 • Find the mean, median, and mode of grouped data • Describe and illustrate the mean, median, and mode of grouped data 4. Measures of Variability Measures of Variability Calculator Formula The formula you will almost always use to calculate the SD is the calculator formula. Many of these worksheets will not be assigned or graded, but if you want extra practice, there are options for you here. the standard. High schoolers log their computer usage hours. Calculating the Sample Mean for Grouped Data. Grouped Data. | {
"domain": "kdgshop.de",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9877587254288981,
"lm_q1q2_score": 0.8029167947657637,
"lm_q2_score": 0.8128673269042767,
"openwebmath_perplexity": 564.275361940718,
"openwebmath_score": 0.657807469367981,
"tags": null,
"url": "http://fijh.kdgshop.de/standard-deviation-for-grouped-data-worksheet.html"
} |
inorganic-chemistry, atomic-radius
So in the absence of electron-electron repulsion we would expect the size of atoms to shrink drastically as Z increases, going across the Periodic Table, and bumping up slightly at the beginning of each row with the addition of a new shell. Of course, real atoms do have electron-electron repulsion, lots of it, so the effect is considerably muted.
Nevertheless, the size of atoms does shrink considerably going from left to right in the Periodic Table, and it's worth remembering this is because all of the electron shells shrink, not just the valence shell. | {
"domain": "chemistry.stackexchange",
"id": 10326,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "inorganic-chemistry, atomic-radius",
"url": null
} |
series[1/2*(x^2 - 2 x + 5)/(x^2 - 6 x + 9), x, 1]
The goal would be to get something like this: Which would be the solution for the first one.
• Hi TimSch -- it would help if you could put your equations into Mathematica code and show exactly what you tried when taking the Fourier coefficients. Sometimes the problem can be with syntax, and sometimes with particular assumptions that need to be made -- for instance, you haven't specified what $\hat{u}$ is, is it real-valued, and does Mathematica know to make this assumption? – bill s Sep 6 '18 at 15:08
• û is a constant factor. I'm completely missing the approach. Neither I know how to say that all values are real nor how to say that f is this for some x and f is that for some other values. – TimSch Sep 6 '18 at 15:29
• Finally I may have found a solution. I updated my question and would appreciate your feedback for my solution. – TimSch Sep 6 '18 at 16:27
• Have a look at A more convenient Fourier series – rmw Sep 6 '18 at 18:26 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9458012671214071,
"lm_q1q2_score": 0.8112781554376497,
"lm_q2_score": 0.8577680995361899,
"openwebmath_perplexity": 1864.3531587262746,
"openwebmath_score": 0.44587889313697815,
"tags": null,
"url": "https://mathematica.stackexchange.com/questions/181348/find-fourier-series-coefficients-with-mathematica?noredirect=1"
} |
nuclear-physics, temperature, resource-recommendations, radioactivity, data
More recently, work has been done on the half-life decay rate of $^{97}{\rm Ru}$ without seeing a noticeable temperature dependence near 20K compared with RT. See the paper by Goodwin, Golovko, Iacob and Hardy entitled, "Half-life of the electron-capture decay of $^{97}\rm Ru$: Precision measurement shows no temperature dependence" in Physical Review C (2009), 80, 045501, arXiv:0910.4338.
It could be that there is a small dependence, but not even the Russian paper mentioned above by Martin agrees there is a measurable temperature dependence. | {
"domain": "physics.stackexchange",
"id": 72433,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "nuclear-physics, temperature, resource-recommendations, radioactivity, data",
"url": null
} |
java, beginner, programming-challenge, interview-questions, complexity
for (int i = ans.length - 1; i >= 0; i--) {
final int value = ans[i];
ans[i] = largest;
largest = Math.max(largest, value);
}
Obviously, comments can improve the code and there's some stylistic things that'll make most Java devs raise their eyebrows, but it's not a big deal. One thing, in particular, however, is to consistently use the following format for array types:
int[] arr = new int[size];
As opposed to int [] arr or int []arr | {
"domain": "codereview.stackexchange",
"id": 30967,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, beginner, programming-challenge, interview-questions, complexity",
"url": null
} |
audio, frequency-spectrum, stereo-signal
print fftLen
# The arrays to plot frequency and time
full_freq = np.linspace(0,fs,fftLen)
R = []
LSFM_bufSize = 10
LSFM_buf=[0]*LSFM_bufSize
threshold = -30
# check past 10 frames for fundamental frequency to check the variation in the measured fundamental
# if the fundamental varies a lot, another way to tell that it's noise
while(1):
data = stream.read(CHUNK)
shorts = struct.unpack('h'*(CHUNK),data)
input_wave = np.array(list(shorts),dtype = float)
# update the FFT buffer and give space for a new entry
LSFM_buf.pop(0)
# take FFT of newest frame and compute cepstrum
R = np.abs(dct(np.multiply(input_wave[0:fftLen], np.hamming(fftLen))))/np.sqrt(fftLen)
AM = np.mean(R)
GM = gmean(R)
LSFM_buf.append(100*np.log10(GM/float(AM)))
# Compute spectral flatness coefficient
max_LSFM = max(LSFM_buf)
min_LSFM = min(LSFM_buf) | {
"domain": "dsp.stackexchange",
"id": 4122,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "audio, frequency-spectrum, stereo-signal",
"url": null
} |
c++, casting
Title: Coding Practice - Float* -> Vector3* cast If you were given the following:
#include <cassert>
struct vec {
float x,y,z;
vec(float x, float y, float z) : x(x), y(y), z(z) {}
};
int main() {
float verts[] = {1,2,3,4,5,6,7,8,9}; // length guaranteed to be a multiple of 3
assert(sizeof(vec) == sizeof(float) * 3);
// Option 1
for (int i = 0; i < 3; ++i) {
auto a = reinterpret_cast<vec*>(verts)[i];
// ...
}
// Option 2
for (int i = 0; i < 9; i += 3) {
vec a(verts[i], verts[i+1], verts[i+2]); // -O3 averts the copy, so d/w
// ...
}
return 0;
} | {
"domain": "codereview.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": "c++, casting",
"url": null
} |
uf.union(v, w); // if not, merge them in the union-find data structure
mst.enqueue(e); // add the edge to result
}
}
## Shortest Paths
The shortest path from vertex $s$ to $t$ in an edge-weighted digraph is a directed path from $s$ to $t$ such that no other such path has a lower weight. A shortest-path tree (SPT) for a source vertex $s$ is a subgraph containing $s$ and all the vertices reachable from $s$ that forms a directed tree rooted at $s$ such that every path is a shortest path in the digraph.
Edge relaxation refers to replacing an existing edge that reaches $w$ with a new edge $v \rightarrow w$ if the new edge makes the path from the source vertex to $w$ be of lower cost than it was previously.
void relax(DirectedEdge e) {
int v = e.from();
int w = e.to();
if (distTo[w] > distTo[v] + e.weight()) {
distTo[w] = distTo[v] + e.weight();
edgeTo[w] = e;
}
}
Vertex relaxation is similar to edge relaxation except that it relaxes all of the edges pointing from a given vertex. | {
"domain": "jip.dev",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9867771759145342,
"lm_q1q2_score": 0.8113174618351043,
"lm_q2_score": 0.8221891239865619,
"openwebmath_perplexity": 1229.7954954713152,
"openwebmath_score": 0.49524566531181335,
"tags": null,
"url": "https://jip.dev/notes/algorithms/"
} |
machine-learning, apache-spark, ranking
Later on I would expand on this ranking algorithm by adding more criteria. I will be using Apache Spark MLIB library and I can already see that there are quite a few algorithms already in place.
http://spark.apache.org/docs/latest/mllib-guide.html | {
"domain": "datascience.stackexchange",
"id": 776,
"lm_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, apache-spark, ranking",
"url": null
} |
c++, beginner, programming-challenge, recursion
Use of headers
A header is used primarily to share declarations (especially of classes and functions) between files, so code in one file can use those classes and functions contained in the other.
In this case, you are't sharing anything between implementation files (because you only have one), so using a header doesn't make sense.
Use Meaningful Names
doCalc (for only one example) is pretty meaningless. Nearly every function you ever write will do some sort of calculation. I'd prefer to call it something like largestProduct, so somebody reading the code has at least some chance of deducing what sort of calculation it does.
Formatting
I'd avoid using as wide of lines as you have in you definition of numbs. For many people, this will flow off the right side of the screen, requiring horizontal scrolling to see everything. I realize there's nothing very interesting there, but until you look, you don't know that for sure.
Summary | {
"domain": "codereview.stackexchange",
"id": 26670,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, beginner, programming-challenge, recursion",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.