text stringlengths 1 1.11k | source dict |
|---|---|
java, multithreading, web-scraping
private WebCrawler[] crawlers;
private Thread[] threads;
private JTextArea textArea;
private final int buttonWidth = 70;
private final int buttonHeight = 30;
private Consumer callback;
public CrawlerGUI(Thread[] threads, WebCrawler[] crawlers) {
this.crawlers = crawlers;
this.threads = threads;
this.callback = new TextUpdater();
for (WebCrawler crawler: this.crawlers){
crawler.registerCallback(callback);
}
initialize();
}
private void initialize() {
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
JButton button = new JButton("Quit");
button.setPreferredSize(new Dimension(buttonWidth, buttonHeight));
button.setBorder(new LineBorder(Color.BLACK));
button.setOpaque(true);
textArea = new JTextArea();
textArea.setColumns(20);
textArea.setLineWrap(true);
textArea.setRows(5);
textArea.setWrapStyleWord(true);
textArea.setEditable(false); | {
"domain": "codereview.stackexchange",
"id": 16831,
"lm_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, multithreading, web-scraping",
"url": null
} |
## Tags make it easy to find interesting questions
All questions are tagged with their subject areas. Each can have up to 5 tags, since a question might be related to several subjects.
Click any tag to see a list of questions with that tag, or go to the tag list to browse for topics that interest you.
# When the numerator of a fraction is increased by 4, the fraction increases by 2/3....
When the numerator of a fraction is increased by $4$, the fraction increases by $2/3$. What is the denominator of the fraction?
I tried,
Let the numerator of the fraction be $x$ and the denominator be $y$.
Accordingly, $$\frac{x+4}y=\frac xy+\frac 23$$
I am not able to find the second equation.
## You earn reputation when people vote on your posts
+5 question voted up
+2 edit approved
As you earn reputation, you'll unlock new privileges like the ability to vote, comment, and even edit other people's posts.
Reputation Privilege
15 Vote up
125 Vote down (costs 1 rep on answers) | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9579122684798184,
"lm_q1q2_score": 0.8322598313958524,
"lm_q2_score": 0.8688267796346599,
"openwebmath_perplexity": 1035.1089680750451,
"openwebmath_score": 0.37631988525390625,
"tags": null,
"url": "http://math.stackexchange.com/tour"
} |
12.16 Definition (Critical point, critical set.) Let be a real valued function such that . A point is called a critical point for if . The set of critical points for is the critical set for . The points in the critical set for correspond to points where the graph of has a horizontal tangent.
12.17 Theorem (Critical point theorem I.) Let be a real valued function with . Let . If has a maximum (or a minimum) at , and is differentiable at , then .
Proof: We will consider only the case where has a maximum. Suppose has a maximum at and is differentiable at . Then is an interior point of so we can find sequences and in such that , , for all , and for all .
Since has a maximum at , we have and for all . Hence
Hence by the inequality theorem for limits,
It follows that .
12.18 Definition (Local maximum and minimum.) Let be a real valued function whose domain is a subset of . Let . We say that has a local maximum at if there is a positive number such that | {
"domain": "reed.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9918120886461792,
"lm_q1q2_score": 0.8199427511856646,
"lm_q2_score": 0.8267117940706734,
"openwebmath_perplexity": 444.7776102608047,
"openwebmath_score": 0.8818175792694092,
"tags": null,
"url": "http://people.reed.edu/~mayer/math111.html/header/node64.html"
} |
forces, gauge-theory
The electroweak theory is based on the $SU(2)\times U(1)$ group which has two factors, but these two factors are not in one-to-one correspondence with the electromagnetism and the weak force, respectively.
The strong force with its $SU(3)$ group is another seemingly independent factors, except that there is evidence that all three non-gravitational forces get unified into a grand unified force of a GUT theory at high energies.
String theory unifies the non-gravitational forces with gravity, too.
Every vacuum of string theory predicts gravity described by GR plus extra non-gravitational forces. The number of factors and their Higgs-like breaking patterns are essentially random properties of the string vacua. According to the anthropic picture of the world, the number of low-energy forces is an accidental property of our world that could be different in different parts of the multiverse. | {
"domain": "physics.stackexchange",
"id": 766,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "forces, gauge-theory",
"url": null
} |
ros, resolution, pgm, sbpl, planner
Title: how to double the resolution of the map?
Hello,
i did the SLAM Map Building with TurtleBot,got a map( width :576,height:512) and a yaml file that goes with my pgm map. Its resolution is 0.05,but the SBPL Lattice planner has a map resolution 0.025, i want to change my map's resolution is 0.025.There has been a similar problem .
Question: what should i do to my pgm map with the gimp software to change my pgm map's resolution?
Thanks for your help !!
my_map.png
my_map_yaml.png
Originally posted by jxl on ROS Answers with karma: 252 on 2015-03-08
Post score: 1
In Gimp, use the Image -> Scale Image tool, and double the X and Y size of the image.
In your map.yaml, set the resolution to 0.025:
resolution: 0.025
Originally posted by ahendrix with karma: 47576 on 2015-03-10
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 21078,
"lm_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, resolution, pgm, sbpl, planner",
"url": null
} |
ros, python, camera
Title: Converting Pixel Coordinates to spatial coordinates: Python, Ros
Hi,
So currently, i am reading an image from my robot's camera, located on its hand. I want to obtain the set of coordinates of a certain object, from both the camera's perspective and the robot's base perspective, given a certain pixel coordinate from the camera i.e. 340x200 (location of my object on the camera image)
I have been using the equation on the second line from this link
But i haven't obtained any good results.(I have inverted the equation,, since i want a set of 3d coordinates from a pair of pixel coordinates and not the opposite as the original equation would give)
So because i didnt get any good result, i tried breaking down the equation. The matrix [R|T] converts the [x,y,z,1] coordinates to the base frame right?? (assuming [R|T] is with respect to the base frame) | {
"domain": "robotics.stackexchange",
"id": 24971,
"lm_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, camera",
"url": null
} |
electromagnetism, magnetic-fields, electric-fields, electromagnetic-induction
I got $$j=-\sigma vb$$
Accounting for the directions, $$j=\sigma(-\vec{v}\times\vec{B})$$
So I got $$\vec{E}=-\vec{v}\times\vec{B}$$
But to my surprise, answer is given zero. Their explanation is that since railings are purely conducting, $\delta V=0$, but it seems very wrong to me, because we are dealing with rod only here, not the railings. So, please help here, and tell if I did some mistake on my part. I think your problem comes from the writing of Ohm's law within a moving conductor: $$\vec{j} = \sigma(\vec{E}+\vec{v} \times \vec{B})$$ and not $\vec{j} = \sigma(\vec{E})$
Indeed, you must take into account the magnetic force that acts on the charge carriers.
On the other hand, I have the impression that there is a sign error in your calculation because you do not show your axes: you should find $\vec{j} =+ \sigma(\vec{v} \times \vec{B})$
You see that this leads to $ \vec{E}=\vec{0}$ | {
"domain": "physics.stackexchange",
"id": 94907,
"lm_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, magnetic-fields, electric-fields, electromagnetic-induction",
"url": null
} |
comments and questions about this site or page. The point is called the This is the currently selected item. Tangent Function The tangent function is a periodic function which is very important in trigonometry. The fact that it is perpendicular will come in useful in our calculations as we can then make use the Pythagorean theorem. A straight line that cuts the circle at two distinct points is called a secant. Tangent is a straight line drawn from an external point that touches a circle at exactly one point on the circumference of the circle. View this video to understand an interesting example based on Tangents to a Circle. • That means they're the same length. $x = \frac 1 2 \cdot \text{ m } \overparen{ABC}$ Note: Like inscribed angles, when the vertex is on the circle itself, the angle formed is half the measure of the intercepted arc. Tangent to a Circle Theorem: A tangent to a circle Tangent To A Circle And The Point Of Tangency. It touches the circle at point B and is | {
"domain": "danimgroup.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9796676448764484,
"lm_q1q2_score": 0.80095125507192,
"lm_q2_score": 0.8175744695262775,
"openwebmath_perplexity": 297.09597804931275,
"openwebmath_score": 0.4291576147079468,
"tags": null,
"url": "http://travel.danimgroup.com/1vg9y34/b38cbb-tangent-of-a-circle"
} |
meteorology, clouds, orography
Title: What is this spaceship-shaped cloud? This tweet from the European Space Agency (ESA)'s Spanish account show a striking photo of a round, flat, "space-ship-shaped" cloud in an otherwise completely clear sky. The stars are out so I assume this is at night, possibly with a Moon.
Could this be real? If so, what kind of cloud is it? and how can it appear out in the open? The image shown is a lenticular cloud, a type of cloud often observed around significant topographical features such as the mountain peaks shown in the photo. Depending on the local atmospheric moisture, they can occur on their own (as in this case), apart from other cloud features. | {
"domain": "earthscience.stackexchange",
"id": 1646,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "meteorology, clouds, orography",
"url": null
} |
python, beginner, adventure-game
elif answer == "B":
print_pause([
("Prison, like Vladimir said, is your new home.", 2),
("But the USSR collapses in 1991; so you are free to go after 3 years!", 3),
("Unfortunately the KGB wants you to keep quiet about what you went\nthrough so a splinter faction kills you to make sure you don't leak\nany info.", 3)
])
game_over()
elif answer == "B":
print_pause([
("You are tortured for days on by Vladimir.", 2),
("Just when you think you lost all hope, you find an opportunity: his pistol left on the table.", 2),
("Do you:\n A: Grab the pistol \n B: Leave it on the table", 2.5)
])
answer = input("A or B?")
print_sep()
if answer == "A":
if r > 5:
print_pause([
("You pick up the pistol. It's a Makarov; standard issue for KGB. You fire!\nThe bullet whizzes through the air... and hits it's mark!", 3), | {
"domain": "codereview.stackexchange",
"id": 34137,
"lm_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, adventure-game",
"url": null
} |
c#, c++, performance, algorithm
for (int x = 0; x < WIDTH; x++) {
mpfr_mul_si(coordinateRealTemp1, realFactor, x, MPFR_RNDN);
mpfr_add_d(coordinateRealTemp2, coordinateRealTemp1, viewportMinRealX, MPFR_RNDN);
mpfr_div_d(coordinateRealTemp3, coordinateRealTemp2, pow(ZOOM_RATE, frame), MPFR_RNDN);
mpfr_add(coordinateReal, coordinateRealTemp3, xZoomPoint, MPFR_RNDN);
//Allows us to keep track of Z independent of starting point.
mpfr_set(ZCoordinateReal, coordinateReal, MPFR_RNDN);
mpfr_set(ZCoordinateImaginary, coordinateImaginary, MPFR_RNDN);
//This is done so that you don't have to square multiple times (optimization).
mpfr_mul(ZCoordinateRealSquared, ZCoordinateReal, ZCoordinateReal, MPFR_RNDN);
mpfr_mul(ZCoordinateImaginarySquared, ZCoordinateImaginary, ZCoordinateImaginary, MPFR_RNDN);
iteration = 0; | {
"domain": "codereview.stackexchange",
"id": 27884,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, c++, performance, algorithm",
"url": null
} |
python, numpy, computational-geometry, clustering
blobs = np.array([
[ [0,0], [0,0], [0,0] ],
[ [12,2], [9,0], [0,0] ],
[ [-1,1], [0,0], [0,3] ]
])
start = timer()
r = 2
ans = returnBlobVertexIndicesOfRelevantBlobs(r, blobs, 0, 0)
elapsed_time = (timer() - start)
print "Found {0} in {1} s.".format(len(ans), elapsed_time) | {
"domain": "codereview.stackexchange",
"id": 8056,
"lm_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, numpy, computational-geometry, clustering",
"url": null
} |
asteroids, naming
Title: Why was this asteroid (4864 Nimoy) chosen to be named after Leonard Nimoy? The asteroid 4864 Nimoy was recently named after Leonard Nimoy. It was discovered on September 2, 1988 so it went nearly 27 years without a name. Why was this asteroid chosen to be named after him? Were they trying to think of a name for it and chose to name it for Leonard Nimoy, or were they looking for an asteroid to name after him and chose that one? I'm not entirely sure, but I would guess that it's simply because the discoverer suggested it. After a few steps in the process of characterizing an asteroid's orbit, the discoverer gets to suggest a name (within reason) to a committee. The full guidelines are available at the relevant IAU webpage. (It's longer than is worth reproducing here.) | {
"domain": "astronomy.stackexchange",
"id": 927,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "asteroids, naming",
"url": null
} |
java, strings
if (!(count > 0))
finalValue = finalValue + currentChar;
}
System.out.println(finalValue);
}
If we look at the count, it is just a boolean, so we end up with:
public static void removeMultipleOccurrence(final String input) {
final StringBuilder result = new StringBuilder();
for (int i = 0; i < input.length(); i++) {
boolean alreadySeen = false;
final char currentChar = input.charAt(i);
for (int j = 0; j < i; j++) {
if (currentChar == input.charAt(j)) {
alreadySeen = true;
break;
}
}
if (!alreadySeen)
result.append(currentChar);
}
System.out.println(result);
} | {
"domain": "codereview.stackexchange",
"id": 3528,
"lm_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, strings",
"url": null
} |
```syms x y z f = sin(x) + cos(y) + exp(z); T = taylor(f, [x, y, z])```
```T = x^5/120 - x^3/6 + x + y^4/24 - y^2/2 + z^5/120 + z^4/24 + z^3/6 + z^2/2 + z + 2```
You can use the `sympref` function to modify the output order of a symbolic polynomial. Redisplay the polynomial in ascending order.
```sympref('PolynomialDisplayStyle','ascend'); T```
```T = 2 + z + z^2/2 + z^3/6 + z^4/24 + z^5/120 - y^2/2 + y^4/24 + x - x^3/6 + x^5/120```
The display format you set using `sympref` persists through your current and future MATLAB sessions. Restore the default value by specifying the `'default'` option.
`sympref('default');`
Find the multivariate Taylor expansion by specifying both the vector of variables and the vector of values defining the expansion point:
```syms x y f = y*exp(x - 1) - x*log(y); T = taylor(f, [x, y], [1, 1], 'Order', 3)```
```T = x + (x - 1)^2/2 + (y - 1)^2/2``` | {
"domain": "mathworks.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9702399026119353,
"lm_q1q2_score": 0.822732157170427,
"lm_q2_score": 0.8479677602988602,
"openwebmath_perplexity": 831.5980959383763,
"openwebmath_score": 0.9268520474433899,
"tags": null,
"url": "https://se.mathworks.com/help/symbolic/sym.taylor.html"
} |
observational-astronomy, the-sun, twilight
Title: Significance of astronomical twilight What is the significance of astronomical twilight? Astronomical twilight is when "the geometric center of the Sun's disk is between 12 and 18 degrees below the horizon" , but what, if any, is the significance of that event?
Here's a description of what astronomical twilight is, but I fail to see any mention of the event's significance. After the sun sets the sky remains light for a while. The significance is that observations during astronomical twilight may be impaired by the continuing glow of the sky. After astronomical twilight, the sky is as dark as it can be, and you can start your long exposures of faint objects. | {
"domain": "astronomy.stackexchange",
"id": 5181,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "observational-astronomy, the-sun, twilight",
"url": null
} |
lisp, scheme, sicp
(define (remove x seq)
(filter (if (pair? x)
(lambda (y) (not (member y x)))
(lambda (y) (not (= x y)))) seq))
(define (unique-triples-less-than n)
(let ((the-number-list (enumerate-integers 1 (- n 1))))
(flatmap (lambda (i)
(flatmap (lambda (j)
(map (lambda (k) (list i j k))
(remove (list i j) the-number-list)))
(remove i the-number-list)))
(enumerate-integers 1 (- n 1)))))
(define (flatmap f seq)
(accumulate append null (map f seq)))
(define (accumulate op initial seq)
(if (null? seq)
initial
(op (car seq)
(accumulate op initial (cdr seq)))))
(define (s-sum-triples-below-n n s)
(filter (lambda (y) (= (accumulate + 0 y) s))
(unique-triples-less-than n))) | {
"domain": "codereview.stackexchange",
"id": 1759,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lisp, scheme, sicp",
"url": null
} |
algorithms, arrays, enumeration
(two subsets for the array which when combined must have all the elements non repeated in the array). Problem is to find all possible pairs and print them. How to do this?
PS: I am not posting my homework stuff and i am learning algorithms. I couldnt find any approach to solve this. I'm going to take HEKTO's suggestion that you mean that we're decomposing the set into a partition. We start with the observation that in any such decomposition, if the two subsets have the same arithmetic mean, then they must each have the same mean as the original set. To see this, suppose we have decomposed the set into the subsets $|\left\{x_i\right\}| = a$ and $|\left\{y_j\right\}| = b$ where $a + b = n$. If the two subsets have the same average then:
$$\frac{\sum_{i=1}^a x_i}{a} = \frac{\sum_{j=1}^b y_j}{b}$$
$$\sum_{i=1}^a x_i = \frac{a}{b}\sum_{j=1}^b y_j$$
Also, observe that:
$$\frac{\sum_{i=1}^a x_i}{a} = \frac{(1+a/b)\sum_{j=1}^b y_j}{n}$$ | {
"domain": "cs.stackexchange",
"id": 6521,
"lm_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, arrays, enumeration",
"url": null
} |
nuclear-physics, nuclear-engineering, explosions
In the case of an extremely high altitude detonation, damage to structures is minimal, however, an EMP (electromagnetic pulse) is created, which may damage unprotected electronic equipment. The strength of the pulse depends on the earth's magnetic field in the area. | {
"domain": "physics.stackexchange",
"id": 30785,
"lm_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, nuclear-engineering, explosions",
"url": null
} |
c++, object-oriented, console
main.cpp
/*ASCII Walk Simulator
P: Player
.: Walkable Path
Enter w,a,s,d to walk
*/
#include "Game.hpp"
int main(){
Game game;
}
In terminal:
g++ *.cpp -o out Here are some things that may help you improve your code.
Don't use system("cls")
There are two reasons not to use system("cls") or system("pause"). The first is that it is not portable to other operating systems which you have attempted to address. The second is that it's a security hole. Specifically, if some program is defined and named cls or pause, your program will execute that program instead of what you intend, and that other program could be anything. First, isolate these into a seperate functions cls() and pause() and then modify your code to call those functions instead of system. Then rewrite the contents of those functions to do what you want using C++. For example, if your terminal supports ANSI Escape sequences, you could use this:
void cls()
{
std::cout << "\x1b[2J";
} | {
"domain": "codereview.stackexchange",
"id": 42552,
"lm_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++, object-oriented, console",
"url": null
} |
slam, navigation, erratic-gazebo, slam-gmapping, gmapping
Originally posted by Zee-Q on ROS Answers with karma: 235 on 2012-02-21
Post score: 1
Original comments
Comment by Eric Perko on 2012-02-21:
What type of laser scanner are you using? Specifically, what is its max range?
Comment by Zee-Q on 2012-02-21:
it is sick lms 200 with max range 32 m practically.
The gray areas you see in the middle are "unknown" which can mean they are unexplored, or you only got a few scans in those areas and gmapping didn't clear them out. This is perfectly normal, and if you know those areas are clear, you can open your map up in an image editor and mark them as such. The map format is described in more detail in the map_server wiki page.
Originally posted by Dan Lazewatsky with karma: 9115 on 2012-02-21
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 8317,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "slam, navigation, erratic-gazebo, slam-gmapping, gmapping",
"url": null
} |
## Statistics: computing quantiles with Python
Nov. 30, 2009 Visit the link Quantile function in R for more information. It is said that the quantile function we implemented cannot do the type #2. We will investigate this when we have the time.
I used to open R just to compute summary statistics on data. R is big and so is Python. But I find it strange when people finds Python lacking on some statistical features, other people say just use R. You can interface to R using Rpy. But for a few calculations, it is just much more efficient when you have Python code handy for doing statistics. Scipy comes with a stats module but there is no function for computing quantiles from an array of data.
Inspired by R, and helped by the clear documentation from the Mathematica page, I am able to replicate the quantile function in Python. Here it is (Again, I find it crazy that my Python indents are not being shown! [Sep. 29, 2009, fixed by using CodeBox] | {
"domain": "adorio-research.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9591542805873231,
"lm_q1q2_score": 0.8227319461651046,
"lm_q2_score": 0.8577681013541613,
"openwebmath_perplexity": 2567.52494165766,
"openwebmath_score": 0.28190913796424866,
"tags": null,
"url": "http://adorio-research.org/wordpress/?p=125"
} |
ros, bullet, pcl
[rosmake-0] Starting >>> rospy [ make ]
[rosmake-0] Finished <<< rospy No Makefile in package rospy
[rosmake-0] Starting >>> bond [ make ]
[rosmake-0] Finished <<< bond ROS_NOBUILD in package bond | {
"domain": "robotics.stackexchange",
"id": 10559,
"lm_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, bullet, pcl",
"url": null
} |
signal-analysis, periodic
Title: How does this periodic signal look like? I'm very new to DSP, and I'm unsure about finding how a signal $y[n]$ would look like. The following is given:
Assume we have a finite support signal $x[n]$ which has the values $1, 2, 3$ for $n = 1, 2, 3$ and $0$ otherwise.
Now we have the periodic repetition of this signal, call it $y[n] = \sum_{k=-\infty}^\infty x[n+5k]$.
To understand how the periodic signal would look like, I'd like to write down a few samples and plot them.
First, I wrote down the values of $x[n]$ like so:
n
x[n]
...
...
0
0
1
1
2
2
3
3
4
0
...
...
Now for $y[n]$, I tried the same:
n
y[n]
...
...
0
$\sum_{k=-\infty}^\infty x[0+5k] = 0$
1
$\sum_{k=-\infty}^\infty x[1+5k] = 1$
2
$\sum_{k=-\infty}^\infty x[2+5k] = 2$
3
$\sum_{k=-\infty}^\infty x[3+5k] = 3$
4
$\sum_{k=-\infty}^\infty x[4+5k] = 0$
5
$\sum_{k=-\infty}^\infty x[5+5k] = 0$
6
$\sum_{k=-\infty}^\infty x[6+5k] = 1$
7
$\sum_{k=-\infty}^\infty x[7+5k] = 2$ | {
"domain": "dsp.stackexchange",
"id": 10404,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "signal-analysis, periodic",
"url": null
} |
optics, lenses
Title: Does adding a supplemental lens attachment to a phone increase the megapixels it can resolve? I am reading: https://en.wikipedia.org/wiki/Optical_resolution
But am confused if adding a supplemental lens to an imaging system (in this case my phone) would change the amount of information resolved.
The second part of this is question is, does adding a lens change the amount of information you are able to resolve regardless of the physical size of the image you are capturing if the image is filling the entire FOV/corner-to-corner?
-Examples below.
Thanks! The minimum feature size that a camera can sense is -- more or less -- the larger of the blur spot diameter (do a web search on "Airy ring") and the pixel size. When the blur spot is around the same size as a pixel things get complicated -- just ignore that.
You cannot change the number of pixels by changing the lens. | {
"domain": "physics.stackexchange",
"id": 71271,
"lm_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, lenses",
"url": null
} |
-
$a_n=1/n$ is a counterexample for all $\epsilon$. – anon Aug 4 '11 at 21:56
@anon: It must not be a counterexample considering it is true for $\epsilon = 1$. – guy Aug 4 '11 at 22:06
Hmm, I guess you're right. – anon Aug 4 '11 at 22:10
@anon: it is a counterexample for $\epsilon=0$ since $\sum\frac{1}{n\log(n)}$ diverges. – robjohn Aug 4 '11 at 23:13
@robjohn: In fact, every divergent series provides a counterexample for $\epsilon = 0$. Apparently whether a series of the form above converges or diverges is completely independent of what divergent series you start with. – guy Aug 5 '11 at 0:18
I proved something like this a while ago where I showed that if $0<a_{n-1}\le a_n$ and if $\epsilon>0$, then $$\sum_{n=0}^\infty\frac{a_n-a_{n-1}}{a_n^{1+\epsilon}}$$ converges. I believe this is the same stiuation, where my $a_n$ is the $S_n$ in this problem. However, there is no requirement that $S_n$ (my $a_n$) diverges. Here is the proof I gave with my $a_n$ replaced by $S_n$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9770226294209298,
"lm_q1q2_score": 0.8055179549518614,
"lm_q2_score": 0.8244619220634457,
"openwebmath_perplexity": 215.5783209690183,
"openwebmath_score": 0.9835930466651917,
"tags": null,
"url": "http://math.stackexchange.com/questions/55670/convergence-of-sum-fraca-ns-n-1-epsilon-where-s-n-sum-i-1"
} |
c#, entity-framework
/// <summary>
/// Defines a scope wherein only one DbContext instance is created, and shared by all of those who use it.
/// </summary>
/// <remarks>Instances of this class are supposed to be used in a using() statement.</remarks>
public class DbContextScope : IDisposable
{
/// <summary>
/// List of current DbContexts (supports multiple contexts).
/// </summary>
private readonly List<DbContext> contextList;
/// <summary>
/// DbContext scope definitiion.
/// </summary>
[ThreadStatic]
private static DbContextScope currentScope;
/// <summary>
/// Holds a value indicating whether the context is disposed or not.
/// </summary>
private bool isDisposed; | {
"domain": "codereview.stackexchange",
"id": 3692,
"lm_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#, entity-framework",
"url": null
} |
the! convergence in probability of a sequence that converges almost surely but not conversely be as... With Borel Cantelli complete convergence implies convergence in probability ⦠2 convergence Results Proposition Pointwise convergence = almost... Will list three key types of convergence based on taking limits: )... Key types of convergence is called the weak '' law because it refers to convergence probability... Shows page 7 - 10 out of 39 pages not be proven with Cantelli. Borel Cantelli 's lemma is straight forward to prove that complete convergence implies almost sure convergence can be... Convergence from MTH 664 at Oregon State University, X a probability space a... Is a weak law of large numbers here is a result that is sometimes useful when we would like prove. State University Borel Cantelli 's lemma is straight forward to prove that complete convergence implies in... Textbook Solutions Expert Q & a Study Pack convergence almost surely implies convergence in probability | {
"domain": "gianpaologonzalez.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9615338057771058,
"lm_q1q2_score": 0.8354063281477462,
"lm_q2_score": 0.8688267881258485,
"openwebmath_perplexity": 601.656100288283,
"openwebmath_score": 0.9190282225608826,
"tags": null,
"url": "http://gianpaologonzalez.com/vlt5j98m/47c220-convergence-almost-surely-implies-convergence-in-probability"
} |
ros, vslam, eigen
Title: vslam eigen and compile_error
Hello,
I am trying to compile vslam as instructed but halting at some error mentioned below:
Is there anything that i am suppose to make link to eigen3 externally? | {
"domain": "robotics.stackexchange",
"id": 4761,
"lm_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, vslam, eigen",
"url": null
} |
ros-kinetic
Originally posted by billy with karma: 1850 on 2019-06-09
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by Jojo on 2019-06-10:
Thank you for your reply. I have updated my question.
Yes that line is not the same because i am subscribing to a different topic.
And this topic(gazebo/modelstates) has a different structure. I unfortunately cannot attach a snapshot of what is being published to this topic but it has at least two positions and orientations, depending on the robot and other objects in the model | {
"domain": "robotics.stackexchange",
"id": 33143,
"lm_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-kinetic",
"url": null
} |
electricity
How much lower? Hard to say. You'd need to know more about the particular bulb. But I will note that if you apply a very low voltage, like 1V, you won't heat up the filament much at all. At this low voltage, the filament will act like... well.. a wire. It's resistance will be very low indeed, approaching 0 ohms. | {
"domain": "physics.stackexchange",
"id": 53781,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electricity",
"url": null
} |
c, io, formatting
should almost always be recast as
for (foo(i); bar(i); baz(i)) {
something;
}
Examples from your code:
char *linep = line;
while (...) {
while (*linep) {
// body
linep++;
}
printf("%s", line);
linep = line;
}
should be
while (...) {
for (char *linep = line; *linep != '\0'; ++linep) {
// body
}
printf("%s", line);
} | {
"domain": "codereview.stackexchange",
"id": 23648,
"lm_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, io, formatting",
"url": null
} |
One of the major themes of precalculus is what I call “connecting geometry to algebra”. Being able to translate between an algebraic statement like $f(x)= f(-x)$, and the geometric statement that the graph of $f$ is symmetric about the vertical axis is a great instance of this. This is just one more way to practice reinforcing function concepts, and the connection with graphs.
• Even a triple connection geometry - algebra - calculus!
– Basj
Sep 13 '17 at 20:09
Here you can see that knowing if the function is even or odd can help you when you are integrating over the interval $[-a, a]$.
You can reduce really-hard-to-look-at integrals to zero just by knowing this. As an example, to calculate $E(Z)$ where $Z \sim N(0, 1)$, the standard normal distribution, you have:
$\displaystyle E(z) = \frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}ze^{-z^2/2}dz$
Which is immediately reduced to zero as the inner function in the integral is odd, and you are integrating over $(-\infty, \infty)$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9883127430370156,
"lm_q1q2_score": 0.8533009251573335,
"lm_q2_score": 0.8633916047011594,
"openwebmath_perplexity": 445.10571085558473,
"openwebmath_score": 0.6738500595092773,
"tags": null,
"url": "https://matheducators.stackexchange.com/questions/12845/why-do-we-teach-even-and-odd-functions"
} |
c++, thread-safety
That will make Chunk a thread-safe type that will allow you to share chunk data across multiple threads.
If, on the other hand, there’s more to your code than you’ve let on, and you need to allow concurrent read AND WRITE access, then maybe the best solution is a shared_mutex. Unless you’re not expecting much contention, in which case you might be able to get away with just an atomic flag.
One thing you need to be cautious about are designs that allow locks to leach out of an interface, or that allow the execution of arbitrary code while a lock is being held. That is the key problem with your current design: a lock is still being held when the LockedData constructor returns, which you may say, “yeah, duh, that’s the point”… but which I say, yeah, that’s the problem. Anything may happen between that constructor and the destructor (which releases the lock), which is why you have a deadlock problem. | {
"domain": "codereview.stackexchange",
"id": 40313,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, thread-safety",
"url": null
} |
# Integral solution for $|x | + | y | + | z | = 10$
How can I find the number of integral solution to the equation
$|x | + | y | + | z | = 10.$
I am using the formula,
Number of integral solutions for $|x| +|y| +|z| = p$ is $(4P^2) +2$, So the answer is 402.
But, I want to know, How we can find it without using formula.
any suggestion !!!
-
Or rather,how do we derive the formula? – user43081 Oct 28 '12 at 12:30
yes !!! sir... any help will be appreciate... – ram Oct 28 '12 at 12:36 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.989347490102537,
"lm_q1q2_score": 0.8156793460801214,
"lm_q2_score": 0.8244619350028204,
"openwebmath_perplexity": 264.5797625932413,
"openwebmath_score": 0.9375693798065186,
"tags": null,
"url": "http://math.stackexchange.com/questions/222690/integral-solution-for-x-y-z-10/222719"
} |
c, macros, bitset
return NULL;
}
static char* bflags_not()
{
{
BFLAGS_DECLARE_ZERO(bflags_a, 64);
BFLAGS_DECLARE_ZERO(bflags_b, 64);
for (size_t i = 0; i != 64; ++i)
if (i % 2 == 0)
BFLAGS_SET(bflags_a, i);
BFLAGS_NOT(bflags_b, bflags_a, 64);
for (size_t i = 0; i != 64; ++i)
if (i % 2 == 0)
mu_assert(!BFLAGS_TEST(bflags_b, i));
else
mu_assert(BFLAGS_TEST(bflags_b, i));
}
{
BFLAGS_DECLARE_ZERO(bflags_a, 64);
for (size_t i = 0; i != 64; ++i)
if (i % 2 == 0)
BFLAGS_SET(bflags_a, i);
BFLAGS_NOT(bflags_a, bflags_a, 64);
for (size_t i = 0; i != 64; ++i)
if (i % 2 == 0)
mu_assert(!BFLAGS_TEST(bflags_a, i));
else
mu_assert(BFLAGS_TEST(bflags_a, i));
}
return NULL;
} | {
"domain": "codereview.stackexchange",
"id": 33765,
"lm_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, macros, bitset",
"url": null
} |
c++, sudoku
The 9x9 is supposedly the "hardest 9x9 Sudoku puzzle". Takes no time. The 16x16 is another hard one and takes about 20 minutes on my machine lol. Freebies
Looking at the performance profile for the 16x16 puzzle (there is a profiler built into Visual Studio 2017, which you said you are using, and I used that, so you can reproduce this), I see that deleted_from.push_back(ptr2); is hotter than it deserves. That indicates the vector is growing too often.
So change this:
vector<int*> deleted_from;
To this:
vector<int*> deleted_from(8);
Before: 6 seconds. After: 5.5 seconds. That's significant, but a trivial change to the code.
Reading between the lines of the profile, it turns out that isLower is taking a substantial amount of time. It is not directly implicated by the profile, but the places where it is called are redder than they ought to be. It really should be trivial, but it's not.
Here is an other way to write it:
#include <intrin.h>
... | {
"domain": "codereview.stackexchange",
"id": 38913,
"lm_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++, sudoku",
"url": null
} |
logic, security
Title: Which "ID" extraction is correct? This question related to attack on the LMAP++ the result of extracting ID from the messages.
In Passive Attack on RFID LMAP++ Authentication Protocolm, page 188
ID = C ⊕ IDS ⊕ A ⊕ B
While in this paper Security Analysis of LMAP++, an RFID Authentication Protocol
ID = C ⊕ IDS ⊕ A ⊕ B ⊕ IDs ⊕ IDs ⊕ IDs
where(IDs = PID)
Which one is correct? You didn't copy the second equation correctly from the second paper. The equation in the second paper is
In your notation, this is
ID = A ⊕ B ⊕ C ⊕ IDs ⊕ IDs ⊕ IDs
Note: the paper has 3 occurrences of IDs, not 4 occurrences; your post has 4 occurrences. This makes all the difference in the world.
Of course, IDs ⊕ IDs ⊕ IDs = IDs (follows since X ⊕ X = 0 holds for all X). Therefore, the second equation is equivalent to
ID = A ⊕ B ⊕ C ⊕ IDs | {
"domain": "cs.stackexchange",
"id": 5592,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "logic, security",
"url": null
} |
quantum-field-theory, symmetry, feynman-diagrams, perturbation-theory, interactions
Title: "Mirrored" diagrams of $n$-point functions Suppose we are calculating the two-point function $\langle\phi(x_1)\phi(x_2) \rangle$ and we've obtained a loop diagram of the kind on the left. Will there necessarily also be a diagram as on the right? Or is this part of the symmetry of the one on the left? I know in correlation function calculations that the external lines of the diagrams are fixed, so we don't take them into account in calculating the symmetry factor.
I hope this is the last question I have on this matter :) The 2 external legs on the two-point function $\langle\phi(x_1)\phi(x_2) \rangle$ carry distinguishable labels $x_1$ and $x_2$, so there is no symmetry between the 2 external legs. And hence OP's 2 above diagrams are different. | {
"domain": "physics.stackexchange",
"id": 94157,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, symmetry, feynman-diagrams, perturbation-theory, interactions",
"url": null
} |
Now define $\hat f\colon A_A \to B_A$ by $\hat f(a) = f(a)$ (i.e., $\hat f(a)$ is $f$ restricted to $A_A$, and with a different codomain.).
Remark 4.9.3 {Claim 2} $\hat f$ is a bijection. Since $f$ is an injection, it follows easily that $\hat f$ is an injection. To show $\hat f$ is surjective, suppose $b\in B_A$. Since the lineage of $b$ ends in $A$, $b$ must be in the image of $f$. So there is an $a\in A$ such that $f(a)=b$. Since $b\in B_A$, by claim 1, $a\in A_A$. Therefore, $\hat f(a)=b$ for some $a$ in $A_A$, and $\hat f$ is surjective.
We outline a parallel construction and leave the details for the exercises. ${A_A}^c$ (the complement of $A_A$ in $A$) and ${B_A}^c$ consist of those elements whose lineage does not end in $A$.
Remark 4.9.4 {Claim $1'$} If $g(b)=a$, then $b\in {B_A}^c$ iff $a\in {A_A}^c$ (exercise 4).
Claim $1'$ allows us to define $\hat g\colon {B_A}^c \to {A_A}^c$, where $\hat g(b)=g(b)$ for any $b\in {B_A}^c$. | {
"domain": "whitman.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.987568350610359,
"lm_q1q2_score": 0.8004033099984081,
"lm_q2_score": 0.8104788995148792,
"openwebmath_perplexity": 225.5243727094122,
"openwebmath_score": 0.9371841549873352,
"tags": null,
"url": "https://www.whitman.edu/mathematics/higher_math_online/section04.09.html"
} |
php, security, pdo, authentication, session
if (!Isset($_SESSION['crecketgaming_usergroup'])){
$_SESSION['crecketgaming_usergroup'] = "Guest";
}
if (Isset($_SESSION['crecketgaming_username'])){
$usernametest = $_SESSION['crecketgaming_username'];
$sql2 = "SELECT Usergroup, user_ID FROM users WHERE Username = :username";
$sth = $conn->prepare($sql2);
$sth->bindParam(':username', $usernametest, PDO::PARAM_STR);
$sth->execute();
$rowcount = $sth->rowCount();
$row = $sth->fetch(); | {
"domain": "codereview.stackexchange",
"id": 12846,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, security, pdo, authentication, session",
"url": null
} |
beginner, ruby, iteration
Title: Yet another vowel counting program Several months ago, I asked Program to count vowels, which was asking for a code review of a vowel counting function in implemented in Python.
Since I've been trying to learn Ruby, I decided to reimplement the entire program in it. I'm mainly looking for critiques on:
Naming conventions
Best practices for string iteration
do/end vs {}
Coding standards and best practices
Of course there are some slight changes in how I implemented this in ruby vs Python. The biggest being simply using a Hash since I couldn't find a suitable replacement for Python's tuples. On a unrelated side note, is there a replacement for Python's tuples in ruby? | {
"domain": "codereview.stackexchange",
"id": 24034,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, ruby, iteration",
"url": null
} |
javascript, framework
};
// extend this class with the base class
constructor.prototype = Object.create(CMBase.prototype);
constructor.prototype.constructor = constructor;
// the render method is the only place where the UI for the component is generated. no other portion
// of the component is allowed to modify the display or make any manual DOM manipulations. this gives
// non-author devs a single place to inspect when they want to understand the display logic and figure
// out why a component looks the way it does
constructor.prototype._render = function() {
var self = this;
var tplData = {
"have_name":(this.data.user_name.length > 0 ? true : false)
,"user_name":this.data.user_name
,"patient_name":this.data.patient_name
,"birth_date":this.data.birth_date
,"admit_date":this.data.admit_date
}; | {
"domain": "codereview.stackexchange",
"id": 28969,
"lm_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, framework",
"url": null
} |
electromagnetism
(from Introduction to Electrodynamics 4th Ed by Griffiths) A good explanation may be found at: http://solar.physics.montana.edu/qiuj/phys317/sol7.pdf
In more depth, what you're basically asking about is what's the substitution used to do the integration. This requires a little bit of art, but the answer is in the linked PDF and is explained sufficiently well that I won't repeat most of it here. Simply, you perform a substitution where u is equal to the argument of your square root. From here, the integration process is just turning a crank using a standard result. | {
"domain": "physics.stackexchange",
"id": 67849,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism",
"url": null
} |
4 The Divide-and-Conquer Strategy 4 -* * * * * * * * * * * * * * * * * * * * * * * * * * 4 -* Fast Fourier transform (FFT) Fourier transform Inverse Fourier transform Discrete Fourier transform(DFT) Given a0, a1, …, an-1 , compute 4 -* DFT and waveform(1) Any periodic waveform can be decomposed into the linear sum of sinusoid functions (sine or cosine). Given an array of integers find the maximum and minimum elements by using minimum comparisons. The input array is sorted. A binary search divides a range of values into halves, and continues to narrow down the field of search until the unknown value is found. Divide and conquer is where you divide a large problem up into many smaller, much easier to solve problems. length <=> b. Here, we develop C and Java code to find the maximum element in an array using recursion. Divide and conquer is an algorithm design technique. com - id: 7fbfb4-ZTViN. To find maximum value from complete 2D numpy array we will not pass axis in numpy. We use the | {
"domain": "rakumanu.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.976310525254243,
"lm_q1q2_score": 0.8071274238188559,
"lm_q2_score": 0.8267117919359419,
"openwebmath_perplexity": 678.0343336001376,
"openwebmath_score": 0.3174936771392822,
"tags": null,
"url": "http://nnwh.rakumanu.it/find-min-and-max-in-array-using-divide-and-conquer.html"
} |
navigation, ros-kinetic, robot-localization
Your IMU data has a frame_id of imu_link, and your GPS has a frame_id of GPS_link. You need to define static transforms from imu_link -> base_link and from gps_link to base_link.
Keep in mind that, once navsat_transform_node gets a single usable IMU message, it unsubscribes from the IMU data. It only needs a single earth-referenced heading measurement.
Originally posted by Tom Moore with karma: 13689 on 2018-04-09
This answer was ACCEPTED on the original site
Post score: 8 | {
"domain": "robotics.stackexchange",
"id": 30494,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "navigation, ros-kinetic, robot-localization",
"url": null
} |
quantum-chemistry, orbitals
As I understand things, in these molecules, hybridisation of the orbitals occur and $\mathrm{sp^2}$ orbitals form, taking up three electrons from each carbon atom and leaving one electron left over in the third p orbital. This p orbital is the one I assume is portrayed in the below images.
Could someone please give me a hint towards the following: | {
"domain": "chemistry.stackexchange",
"id": 3927,
"lm_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-chemistry, orbitals",
"url": null
} |
gazebo-plugin
Originally posted by Javi V on Gazebo Answers with karma: 57 on 2015-10-09
Post score: 2
Original comments
Comment by asdfjkl on 2016-05-26:
Any ideas anyone?
You will need to implement your own plugin to add depth noise.
Originally posted by nkoenig with karma: 7676 on 2016-05-27
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 3822,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gazebo-plugin",
"url": null
} |
immunology, antibody, antigen
Is it true to say that the same substance could bind with (and, therefore, be recognised by) more than one antibody, or not?
Also, if the answer is no, does that mean that antibodies with different binding affinities are classed as the same antibody or not? Let's clarify the terms. An antigen is a molecule that can be associated with a particular substance (virus, pollen, dander.) When an immunoglobulin or antibody recognizes an antigen it binds to a specific epitope. An antibody recognizes an epitope using its paratope.
Some antigens have multiple epitopes; this means that different antibodies can simultaneously bind to them (if the epitopes are far-enough apart from each other so that binding to one doesn't preclude binding to the others.) | {
"domain": "biology.stackexchange",
"id": 1689,
"lm_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, antibody, antigen",
"url": null
} |
java, integer, reflection, shuffle
Another issue with your code is it puts the burden of specifying the index of the nested class on the caller. As all nested classes of Number type X are named XCache, we may use this pattern in doEvilStuff to automatically find the correct nested class.
My version:
public static void doEvilStuff(Cfinal lass<? extends Number> victim,String cacheID) {
try {
final Class cache = Class.forName(victim.getName() + "$" + victim.getSimpleName() + "Cache");
final java.lang.reflect.Field c = cache.getDeclaredField(cacheID);
c.setAccessible(true);
shuffle((Number[])c.get(cache));
} catch (final Exception e) {
throw new IllegalArgumentException("can't corrupt class " + victim, e);
}
} | {
"domain": "codereview.stackexchange",
"id": 19050,
"lm_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, integer, reflection, shuffle",
"url": null
} |
cosmology, black-holes, space-expansion, big-bang, singularities
Secondly, gravity and other fundamental forces didn't act the way we are used to them acting. All four fundamental forces were combined in one basic force. Therefore there was no such thing as gravity to actually act on the mass as it existed. And then there is the problem that there was no actual mass. It was energy, which was creating the density of the universe. I know it's kind of counter-intuitive to how we are used to understanding these terms. Actually, Brian Greene has a good explanation of all this in his book Elegant Universe. Suffice it to say, at the start of the universe, the fundamental forces really acted very differently from how we see them now. As gravity was separating itself from the other forces, it actually had a repulsive effect as opposed to attraction. | {
"domain": "physics.stackexchange",
"id": 47910,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cosmology, black-holes, space-expansion, big-bang, singularities",
"url": null
} |
quantum-mechanics, condensed-matter, solid-state-physics, born-oppenheimer-approximation
Title: About Born-Oppenheimer approximation I was just going through random lecture notes on Born-Oppenheimer approximation where I came across the following statement:
We first invoke the Born-Oppenheimer approximation by recognizing that, in a dynamical sense, there is a strong separation of time scales between the electronic and nuclear motion, since the electrons are lighter than the nuclei by three orders of magnitude.
My confusion is: what does separation of time scales actually mean ? Separation of time scales means that the characteristic times of movement (oscillation period, damping time, etc.) of the two systems are very different; this is also known as adiabatic approximation. If we take for simplicity that both nuclei and electrons perform oscillatory motion with periods $T_n$ and $T_e$, then $$T_e \ll T_n,$$ so that we can think of nuclei as static when solving the equations-of-motion for the electrons. | {
"domain": "physics.stackexchange",
"id": 65818,
"lm_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, condensed-matter, solid-state-physics, born-oppenheimer-approximation",
"url": null
} |
were.) 4 The variable$X$is the sample mean and the variable$Y$is the sample variance times$(n-1)$. So Basu's theorem implies that they are independent. The distribution of$Y$is$\chi^2_{n-1}$as the sum of the squares of the$n$iid normal random variables$X_i-X$, (where$X$is used and so there are$n-1$degrees of freedom instead of$n). 4 Since \begin{align*} \left\| \sum_{k=1}^n (X_k-\mathbb{E}(X_k)) - \sum_{k=1}^m (X_k-\mathbb{E}(X_k)) \right\|_{L^2}^2 &= \left\| \sum_{k=m+1}^n (X_k-\mathbb{E}(X_k)) \right\|_{L^2}^2 \\ &= \sum_{k=m+1}^n \sum_{\ell=m+1}^n \text{cov}(X_k,X_{\ell}) \end{align*} for alln \geq m, we find by the Cauchy Schwarz inequality \begin{align*} \left\| ... 3 Write f(X) = f(X)^+ - f(X)^-. Then, observe that the bound f \geq -c implies f(X)^- \leq c a.s., so that \mathbb{E}[f(X)] = \mathbb{E}[f(X)^+ - f(X)^-] = \mathbb{E}[f(X)^+] - \mathbb{E}[f(X)^-] \geq \mathbb{E}[f(X)^+] - c $$and reorganizing the terms give what you want: \mathbb{E}[f(X)^+] \leq \mathbb{E}[f(X)] + c. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9566342012360933,
"lm_q1q2_score": 0.8241769236153367,
"lm_q2_score": 0.8615382165412809,
"openwebmath_perplexity": 4219.453420303375,
"openwebmath_score": 1.0000053644180298,
"tags": null,
"url": "http://math.stackexchange.com/tags/probability-theory/hot?filter=month"
} |
java, algorithm, heap
private static void maxHeapify(int[] array, int nodeIndex, int length) {
if(nodeIndex < length) {
correctNode(array, nodeIndex, length);
maxHeapify(array, 2 * nodeIndex, length);
maxHeapify(array, (2 * nodeIndex)+1, length);
correctNode(array, nodeIndex, length);
}
}
private static void correctNode(int[] array, int index, int length) {
int rootIndex = index - 1;
int leftIndex = (2 * index) - 1;
int rightIndex = ((2 * index) + 1) - 1;
if(leftIndex < length && array[rootIndex] < array[leftIndex]) {
swap(array, rootIndex, leftIndex);
}
if(rightIndex < length && array[rootIndex] < array[rightIndex]) {
swap(array, rootIndex, rightIndex);
}
} | {
"domain": "codereview.stackexchange",
"id": 19634,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, algorithm, heap",
"url": null
} |
quantum-chromodynamics, quarks, neutrons, magnetic-moment, gluons
color neutral region that would then separate from the previous region in which the gluon, together with all the other particles created by the separation energy, would be confined. These separated confined regions manifest as jets in high energy collider experiments. (Anna v may be able to say more about this.) | {
"domain": "physics.stackexchange",
"id": 69143,
"lm_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-chromodynamics, quarks, neutrons, magnetic-moment, gluons",
"url": null
} |
php, database, wordpress
Here's another place where type hinting would be useful. (I also personally prefer the shorter isset to array_key_exists but beware of the differences.)
public function get_template_id( $template ) {
if ( is_array( $template ) )
$template_id = $template[ECBS_TEMPLATE_ID];
else
$template_id = $template;
return $template_id;
}
This method should be a getter method in a template class.
public function add_template_to_options( &$template ) {
if ( !is_object( $template ) )
wp_die( __( 'That is not a template!' ) );
return $this->do_option_add( $template );
} | {
"domain": "codereview.stackexchange",
"id": 8002,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, database, wordpress",
"url": null
} |
waves, interference
This video, MIT Physics Demo Tuning Forks Resonance & Beat Frequency 720 at about the $1:30$ mark, shows the result of adding two sound waves of almost the same frequency. The rider on the tine of one of the two tuning forks detunes it slightly. The two resulting waves can interferes constructively, then destructively, and then back again.
I've done this demonstration with a group of students around the apparatus. By asking the students to individually raise their hand when they heard the loudest sound, it becomes clear that the moment when the two waves arrive in step for any student depends on their position around the apparatus.
In the general case, with no assumptions about the frequency, shape, phase or amplitude of the two waves, the Superposition Principle applies. | {
"domain": "physics.stackexchange",
"id": 18480,
"lm_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, interference",
"url": null
} |
quantum-optics
In other words,
$$\mathrm{Var}(n)-\langle n\rangle=\langle n\rangle^2[g^{(2)}(0)+1].$$ Even when the second-order degree of coherence $g^{(2)}(0)$ remains unchanged by photon loss $0<\eta<1$, the amount of bunchedness or antibunchedness, given by the difference between the variance and the mean $\mathrm{Var}(n)-\langle n\rangle$, will still shrink to zero due to the $\langle n\rangle^2$ factor. Different normalizations, different tendencies with loss. | {
"domain": "physics.stackexchange",
"id": 99404,
"lm_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-optics",
"url": null
} |
resource-recommendations, ads-cft, holographic-principle
Anti de Sitter Space and Holography, by Edward Witten
The canonical, detailed review is the following paper which currently has nearly 4000 citations (pretty weak...I know).
Large N Field Theories, String Theory and Gravity, by MAGOO
Everyone I know who works in AdS/CFT has read Witten's paper above more than once, and at least once with pen and paper in hand to redo his computations. The paper by MAGOO is the go-to reference in the field. | {
"domain": "physics.stackexchange",
"id": 9561,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "resource-recommendations, ads-cft, holographic-principle",
"url": null
} |
c, array, comparative-review
int sum(const int *arr, size_t size) {
int sum = 0;
while (size-- > 0) {
sum += *arr++;
}
return sum;
} | {
"domain": "codereview.stackexchange",
"id": 14125,
"lm_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, array, comparative-review",
"url": null
} |
organic-chemistry, notation
This answer describes a little bit but my question is a little different. It is depend on the reaction. For example, the given two reactions you have sighted are related to each other. It is a example of alkene to alcohol conversion using oxymercuration followed by demercuration with $\ce{NaBH4}$. The overall reaction is electrophilic addition of water to the alkene following Markovnikov's rule (when the nucleophile is water). The first reaction gives an organomercury intermediate, which is not important here for authors to mention. Yet, it is necessary to have a second reaction to convert carbon-mercury bond of the intermediate to carbon-hydrogen bond to get the product of interest. However, it is important to know (and is a common knowledge) that this intermediate should be isolated before treating it with $\ce{NaBH4}$ for following reasons: | {
"domain": "chemistry.stackexchange",
"id": 13540,
"lm_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, notation",
"url": null
} |
javascript, css, html5
The toggle process itself.
Since it was your starting point, I'm surprised you didn't use the toggleClass() method in the final working part of your code:
element.className.indexOf(classItem) === -1
? element.classList.add(classItem)
: element.classList.remove(classItem);
It can be replaced by:
element.classList.toggleClass(classItem);
Finally here is my proposed version, following all the above remarks:
/**
* Adds / removes CSS-class(es) from an HTML-element.
*
* @param selector: a CSS selector for the involved element (string)
*
* @param classes: list of classes to be toggled, either:
* - (string) comma- or space(s)-separated list of classes
* - (array) of classes
*
* @return:
* - true if could work
* - undefined if any error occurred (bad, empty, or unsuccessfull
* selector; bad or empty classes)
*/ | {
"domain": "codereview.stackexchange",
"id": 19509,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, css, html5",
"url": null
} |
lo.logic, lambda-calculus
This notation, used as a data representation, makes many algorithms on lambda-terms simpler to implement and prove correct. That is, given a lambda term $f\; e_1\; e_2\; \ldots\; e_n$, you want to view it as a head $f$, together with a list of arguments $[e_1, e_2, \ldots, e_n]$.
For example, suppose you want to compare two terms $f\;e_1\;\ldots\; e_n$ with $g\;t_1\;\ldots\;t_n$. It is often most natural to compare the heads $f$ and $g$ first, and not even look at the $(e_i, t_i)$ pairs unless that comparison succeeds. (This often comes up in implementations of higher-order unification.)
See Cervesato and Pfenning's paper A Linear Spine Calculus for a formalization of this idea. | {
"domain": "cstheory.stackexchange",
"id": 4612,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lo.logic, lambda-calculus",
"url": null
} |
php, html5, classes, php7
And so on. This isn't complete, but I hope you get the idea? Short, easy to understand, methods, each responsible for a very small part of what the class needs to accomplish. Notice how I can reuse the getDivHtml() method.
Help and length of script
Your script contains a long comment at the start, and a help function that basically contains the same information. This makes the script for this class very long, and difficult to read and use. There is such a thing as too much help.
In principle, the class should be self-explanatory, without any comments or help. In practice some extra information can be useful, but this should be kept to a minimum. If you need to explain too much you didn't write a very good class.
Code flexibility | {
"domain": "codereview.stackexchange",
"id": 44654,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, html5, classes, php7",
"url": null
} |
philosophy, agi, history, self-awareness
Title: Why is awareness of itself such a point when speaking about AI? Why is awareness of itself such a point when speaking about AI? Does it always mean a starting point for apocalyptic nightmares to occur when such a level is reached or is it just a classical example about what could be a really abstract thing that machine cannot easily posses?
I would sleep my nights far more calmfully if the situation was the latter, and I understand the first does not automatically happen. The main thing I would like to discover is the starting point - which approach came first historically? Or is there another view point in the historical first occurrence of self awareness term? Neil Slater has it right, there most probably is no fear of AI self awareness as some starting point of evil series of things to happen. | {
"domain": "ai.stackexchange",
"id": 1416,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "philosophy, agi, history, self-awareness",
"url": null
} |
acid-base, molecular-structure, lewis-structure
Could someone please explain why this is? Thanks.
Here is a little sketch I made to show what I mean: Thanks to help from orthocresol & Jan, I was able to figure out my mistake. In the question, I was not given the charge nor the proper notation, and I was very confused. So anyways, the correct notation would have been $\ce{H3O+}$. Thus, there would actually only be two electrons remaining on the oxygen, and not three as I had thought.
Also, they had given me the octet rule (all electrons must add up to 8) which will definitely help me not run into this mistake again!
Thanks. | {
"domain": "chemistry.stackexchange",
"id": 6252,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "acid-base, molecular-structure, lewis-structure",
"url": null
} |
c, library, bloom-filter
uint32_t k1 = 0;
const uint8_t *tail = (const uint8_t *)(data + nblocks*4);
switch(len & 3) {
case 3: k1 ^= tail[2] << 16;
case 2: k1 ^= tail[1] << 8;
case 1: k1 ^= tail[0];
k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1;
};
h1 ^= len;
h1 = fmix32(h1);
*(uint32_t *)out = h1;
}
uint32_t FNV1A_Hash_WHIZ(void *str, size_t wrdlen)
{
char *p = (char *)str;
uint32_t hash32 = 2166136261;
const uint32_t prime = 1607;
for(; wrdlen >= sizeof(uint32_t); wrdlen -= sizeof(uint32_t), p += sizeof(uint32_t)) {
hash32 = (hash32 ^ *(uint32_t *)p) * prime;
}
if (wrdlen & sizeof(uint16_t)) {
hash32 = (hash32 ^ *(uint16_t *)p) * prime;
p += sizeof(uint16_t);
}
if (wrdlen & 1) hash32 = (hash32 ^ *p) * prime;
return hash32 ^ (hash32 >> 16);
} | {
"domain": "codereview.stackexchange",
"id": 21673,
"lm_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, library, bloom-filter",
"url": null
} |
collision, reflection
Now we go on to the normal component of velocities: We know the velocities prior to collision, and we know the masses throughout the collision. We also know that kinetic energy and momentum are conserved (since this is an elastic collision). Furthermore, we also know that the tangential components of velocities have remained unchanged. We are left with a boat load of equations and only two unknowns: Normal velocities of the masses (m1 and m2) after the collision (v1an and V2an, respectively).
Velocities before collision: v1b = SQRT((v1bn^2)+(v1bt^2)) and v2b = SQRT((v2bn^2)+(v2bt^2)).
Velocities after collision: v1a = SQRT((v1an^2)+(v1at^2)) and v2a = SQRT((v2an^2)+(v2at^2)).
Since momentum is conserved --> (m1)(v1bn) + (m2)(v2bn) = (m1)(v1an) + (m2)(v2an) ... and the normal velocities must remain normal, it is a short step of reasoning to deduce, for m1=m2, that |v1an| = |v1bn|, but are in the opposite direction, and likewise for |v2an| = |v2bn|. | {
"domain": "physics.stackexchange",
"id": 1121,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "collision, reflection",
"url": null
} |
charge, standard-model, symmetry-breaking, electroweak, leptons
The electromagnetic and weak interactions are two different mixtures of two more-fundamental gauge fields that are often denoted $SU(2)_L$ and $U(1)_Y$. | {
"domain": "physics.stackexchange",
"id": 54631,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "charge, standard-model, symmetry-breaking, electroweak, leptons",
"url": null
} |
resource-request, clifford-group, magic-states
Title: Universal quantum computation by Clifford gates plus magic state In the paper Universal quantum computation with ideal Clifford gates and noisy ancillas, it is claimed that a circuit composed by Clifford gates, plus a so-called "magic state", can perform any quantum computation.
This paper is based on the formalism developed for fault tolerance. However, the claim
above does not have to do with fault tolerance, nor with "noise".
Indeed, the section III, which discusses the universal quantum computation, does not even mention the "noise" and the magic state is simply a well-defined pure state. It looks like it is possible to build any circuit using Clifford gates and simulating the T gate by using the so-called magic state, which is simply $\alpha\left|0\right>+\beta\left|1\right>$ with well defined $\alpha$ and $\beta$ (together with a particular procedure and additional Clifford gates). | {
"domain": "quantumcomputing.stackexchange",
"id": 3447,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "resource-request, clifford-group, magic-states",
"url": null
} |
c++, beginner, c++11
A system that allows one to enter the items that they are
selling, the quantity sold, the price of each of the items. They would
like the program to be able to create suggestions based on the data
provided.
Input:
Item name
Sale price
Quantity sold
Output:
Quantity of items sold
Total price of items sold
Most sold item
Least sold item
The difference in sales between the most and least sold items
Estimated operational cost (50% of sales)
Tax paid (20% of sales)
Profit (Total after tax and operational costs)
If any number of products constitutes less than 5% of sales
individually, a warning should be displayed
Your program will also need to work within the following constraint:
There must be at least 5 products that can be entered
Sales System.cpp : This file contains the 'main' function. Program execution begins and ends there.
#include <iostream>
#include <vector>
#include <string>
#include <iomanip>
#include "Item.hpp"
#include "Items.hpp" | {
"domain": "codereview.stackexchange",
"id": 37184,
"lm_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, c++11",
"url": null
} |
ros, android-core, rosjava-core, gradle, android
Everything compiles and builds without failing. When I look in my rosjava_maven_repo I see the updated packages for rosjava_core and rosjava_bootstrap with the 0.2.2 bump. Keep in mind I HAVE NOT PUSHED to my remote repository.
In my android_core project, if I gradle sync, I do not get the latest 0.2.2 rosjava code. I would think it could find my local rosjava_core:0.2.2.
If I push my packages to my remote rosjava_maven_repo and do a gradle sync in my android_core project I see the new rosjava_core:0.2.2 package.
Is this really how I have to go about testing rosjava_core in android_core? Do i have to bump my package number, push to my maven repository? Is there a way I can do my testing locally and use my local rosjava_core built files in my local rosjava_mvn_repo?
Sorry this might sound confusing, I am not a gradle master and think I just got lucky getting this to semi-work :)
Thanks for all the advice and help! | {
"domain": "robotics.stackexchange",
"id": 27173,
"lm_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, android-core, rosjava-core, gradle, android",
"url": null
} |
algorithms, divide-and-conquer
\hline
1 & 2 & 3 & - & 4 & 5 & 6\\
2 & 1 & - & 3 & 5 & 6 & 4 \\
3 & - & 1 & 2 & 6 & 4 & 5 \\
4 & 5 & 6 & - &1 &2 &3 \\
5 & 4 & - & 6 &2 & 3& 1\\
6 & - & 4 & 5 & 3 & 1 & 2\\
\end{array}
but it's not best answer and we can reschedule rest matches such that tournament end in 5 days for $n = 6$. how can I modify conquer step? I think this method will fix conquer step.
for example for 6 teams we have this table when we divide it to 2 piece
\begin{array}{c|cccccc}
& \text{Day 1} & \text{Day 2} & \text{Day 3} & \text{Day 4} & \text{Day 5} & \text{Day 6}\\
\hline
1 & 2 & 3 & - & & & \\
2 & 1 & - & 3 & & & \\
3 & - & 1 & 2 & & & \\
4 & 5 & 6 & - & & & \\
5 & 4 & - & 6 & & & \\
6 & - & 4 & 5\\
\end{array}
first we should replace rested games with new matches, we now that the only answer for Day 3 of team 1 is 4 so we put 4 in table and so on then we have
\begin{array}{c|cccccc}
& \text{Day 1} & \text{Day 2} & \text{Day 3} & \text{Day 4} & \text{Day 5} & \text{Day 6}\\
\hline | {
"domain": "cs.stackexchange",
"id": 8726,
"lm_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, divide-and-conquer",
"url": null
} |
machine-learning, scikit-learn, loss-function, terminology, gbm
I was looking at the scikit-Learn documentation for GradientBoostingRegressor.
Here it says that we can use 'ls' as a loss function which is least squares regression. But I am confused since least squares regression is a method to minimize the SSE loss function.
So shouldn't they mention SSE here? It would seem that you are over-interpreting what is essentially just convenience shorthand names for the model arguments, and not formal terminology; here, "‘ls’ refers to least squares regression" should be interpreted as "'ls' is the loss function used in least-squares regression".
Formally you do have a point of course - sse would be a more appropriate naming convention here; discussions about such naming conventions are not uncommon among the community, see for example the thread loss function name consistency in gradient boosting (which BTW was resolved here). And you would be most welcome opening a relevant issue for the convention used here. | {
"domain": "datascience.stackexchange",
"id": 8484,
"lm_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, scikit-learn, loss-function, terminology, gbm",
"url": null
} |
c#, unity3d
public static IEnumerable<Line> CreateParallelLines(this Line line, params int[] offsets)
{
return offsets.Select(o => CreateParallelLine(line, o));
}
public static IEnumerable<Line> CreateParallelLines(this Line line, int count, int spacing)
{
for (var i = 1; i <= count; i++)
yield return CreateParallelLine(line, i*spacing);
}
}
Your foreach then becomes
foreach (var parallel in referenceLine.CreateParallelLines(50, -50, 100, -100))
...
Or in the case of generating 300 parallel lines
var positives = referenceLine.CreateParallelLines(150, 50);
var negatives = referenceLine.CreateParallelLines(150, -50);
foreach (var parallel in positives.Concat(negatives))
... | {
"domain": "codereview.stackexchange",
"id": 13695,
"lm_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#, unity3d",
"url": null
} |
ros, ros-melodic, cv-bridge, python3
def cleanup(self):
print "Shutting down vision node."
cv2.destroyAllWindows()
def main(args):
try:
cvBridgeDemo()
rospy.spin()
except KeyboardInterrupt:
print "Shutting down vision node."
cv.DestroyAllWindows()
if __name__ == '__main__':
main(sys.argv)
And this is my roughly adjusted one:
#!/usr/bin/env python
import rospy
import sys
import cv2
from sensor_msgs.msg import Image, CameraInfo
from cv_bridge import CvBridge, CvBridgeError
import numpy as np
class cvBridgeDemo():
def __init__(self):
self.node_name = "cv_bridge_node"
#Initialize the ros node
rospy.init_node(self.node_name,anonymous=True)
# What we do during shutdown
rospy.on_shutdown(self.cleanup) | {
"domain": "robotics.stackexchange",
"id": 36075,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-melodic, cv-bridge, python3",
"url": null
} |
4
The post Reasons to believe from Scott Aaronson's blog states... ...ten arguments for believing P!=NP: arguments that are pretty much obvious to those who have thought seriously about the question, but that (with few exceptions) seem never to be laid out explicitly for those who haven’t. You’re welcome to believe P=NP if you choose. My job is to make you ...
0
Note that $(a \mid b)^{*}$ means $\{\varepsilon, a, b, aa, bb, ab, ba, \dots \}$, so $(bb \mid b)^{*} = \{\varepsilon, b, bb, bbb, \dots \} = b^{*}$. That leads to $$R = (a \mid b) (bb \mid b)^{*} = (a \mid b) b^{*}$$ So the language created by $R$ is $L(R) = \{ a^lb^k \mid k \in \mathbb{N}_0, 0 \leq l \leq 1\}$. Converting your NFA to an equivalent DFA ...
0 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.957277806109987,
"lm_q1q2_score": 0.8211223662154404,
"lm_q2_score": 0.8577681013541613,
"openwebmath_perplexity": 205.5223664604271,
"openwebmath_score": 0.8570438027381897,
"tags": null,
"url": "http://math.stackexchange.com/tags/computational-complexity/new"
} |
proteins, genbank, bash
181 gcacagtact ctgtctgaag tagctttgca gtctggaagg ggagcagtgt ctgtccccac
241 aaaggctgcc cagcgcatta tgggtcgttg gctcttggtc tgcagcggaa cagtagcagg
301 agcggtgatt cttggtggag tgactaggtt gacagagtct gggctctcca tggtagattg
361 gcacttgata aaaggaatga aaccacccac aagccaagaa gaatgggaag cagagttcca
421 aaaataccag cagtttccag aatttaaaat cttgaaccat aacatgacat tagcagaatt
481 caagtttatc tggtacatgg aatactcaca cagaatgtgg ggtcggattg tgggcctagc
541 atatgtcctt cccactgtct acttttggag aaagggctgg ctcacccatg gcatgaaagg
601 tcgtgttctt gccctctgtg gtttagtctg tttccaggga ctgttggggt ggtatatggt
661 gaagagtgga ttagaagaaa agccagattc ttatgacatc cctcgggtga gccagtatcg
721 tctggccgct cacttgggct ctgcccttgt cctctactgt gccagcttgt ggactggact
781 ctccctcttg cttcctcgag acaagttgcc agaaacccga aagctcttgc agctgaggcg
841 atttgctcat gggacagcag gcctggtttt ccttacagct ctttcaggag cctttgtggc
901 aggcctggat gctggacttg tatacaactc ctttcctaag atgggagacc actggatccc | {
"domain": "bioinformatics.stackexchange",
"id": 706,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "proteins, genbank, bash",
"url": null
} |
and defined $$V=\spn{R}\text{.}$$ Our goal in that problem was to find a relation of linear dependence on the vectors in $$R\text{,}$$ solve the resulting equation for one of the vectors, and re-express $$V$$ as the span of a set of three vectors.
Here is another way to accomplish something similar. The row space of the matrix
\begin{equation*} A=\begin{bmatrix} 1 & 2 & -1 & 3 & 2\\ 2 & 1 & 3 & 1 & 2\\ 0 & -7 & 6 & -11 & -2\\ 4 & 1 & 2 & 1 & 6 \end{bmatrix} \end{equation*}
is equal to $$\spn{R}\text{.}$$ By Theorem BRS we can row-reduce this matrix, ignore any zero rows, and use the nonzero rows as column vectors that are a basis for the row space of $$A\text{.}$$ Row-reducing $$A$$ creates the matrix
\begin{equation*} \begin{bmatrix} 1 & 0 & 0 & -\frac{1}{17} & \frac{30}{17}\\ 0 & 1 & 0 & \frac{25}{17} & -\frac{2}{17}\\ 0 & 0 & 1 & -\frac{2}{17} & -\frac{8}{17}\\ 0 & 0 & 0 & 0 & 0 \end{bmatrix}\text{.} \end{equation*}
So | {
"domain": "runestone.academy",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9908743631497862,
"lm_q1q2_score": 0.8006930924813145,
"lm_q2_score": 0.8080672204860316,
"openwebmath_perplexity": 365.6440636151513,
"openwebmath_score": 0.9681013226509094,
"tags": null,
"url": "https://runestone.academy/ns/books/published/fcla/section-B.html"
} |
If $O$ is the center of the given circle of radius $r$ and $\widehat{QPR}=\theta\leq\frac{\pi}{2}$, $\widehat{QOR}=2\theta$ and $\widehat{QOP}=\widehat{ROP}=\pi-\theta$, hence: $$[QPR]=[QOR]+[QOP]+[ROP]=\frac{r^2}{2}\left(\sin(2\theta)+2\sin(\theta)\right)$$ and the $RHS$ achieves its maximum at $\theta=\frac{\pi}{3}$ by differentiation. On the other hand, $\theta\geq\frac{\pi}{2}$ implies $[QPR]\leq r^2$, hence the maximum area is achieved by the equilateral triangle. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9830850832642353,
"lm_q1q2_score": 0.8082818655548922,
"lm_q2_score": 0.8221891261650248,
"openwebmath_perplexity": 217.0101949414372,
"openwebmath_score": 0.9092912673950195,
"tags": null,
"url": "https://math.stackexchange.com/questions/1457892/the-chord-qr-is-parallel-to-the-tangent-at-p-find-the-maximum-area-of-trian"
} |
javascript, strings, programming-challenge, array, ecmascript-6
Title: Codewars "Consecutive strings" kata The challenge description is as follows:
You are given an array strarr of strings and an integer k. Your task is to return the first longest string consisting of k consecutive strings taken in the array.
Example:
longest_consec(["zone", "abigail", "theta", "form", "libe", "zas", "theta", "abigail"], 2)
--> "abigailtheta"
n being the length of the string array, if n = 0 or k > n or k <= 0
return "".
I solved the challenge with as a side goal to follow and use ECMAScript 6 as much as possible. All suggestions on improving the code are welcome!
Note: I did not like using k and n in code, so I used numStr and arrLen respectively.
const longestConsec = (strArr, numStr) => {
const arrLen = strArr.length
if (arrLen === 0 || numStr > arrLen || numStr <= 0) {
return ""
}
const consecStrings = getAllConsecutiveStrings(strArr, numStr, arrLen)
return getFirstLongestString(consecStrings)
} | {
"domain": "codereview.stackexchange",
"id": 24257,
"lm_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, strings, programming-challenge, array, ecmascript-6",
"url": null
} |
.htaccess
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/javascript
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(.*)/(.*) "https://google.com/release/theme/5.0.1/$1/$2" [R=302,L]
How can I make it only change v5 with my version number (syntax) ? The line you are using is telling the engine, redirect everything to the following URI. The reason for this is that you are using the pattern matching wildcard (.*).
The parenthesis is used for creating groups, the dot is telling the engine that every character is accepted and the star symbol is telling the engine that it can be of unlimited length. By using the forward slash followed by another wildcard group, you are redirecting every URI request to the following URI "https://google.com/release/theme/5.0.1/$1/$2".
Instead of using
RewriteRule ^(.*)/(.*) "https://google.com/release/theme/5.0.1/$1/$2" [R=302,L] | {
"domain": "codereview.stackexchange",
"id": 32014,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": ".htaccess",
"url": null
} |
php, library
Config::set('view', strtolower($model_name));
if(!$this->session->get(strtolower($model_name))){
$this->session->set(strtolower($model_name), array());
}
}
private function getPublicMethods(){
$methods = array();
$r = new ReflectionObject($this);
$r_methods = $r->getMethods(ReflectionMethod::IS_PUBLIC);
foreach($r_methods as $method){
if($method->class !== 'AppController'){ //get only public methods from extended class
$methods[] = $method->name;
}
}
return $methods;
}
/**
*
* @param Template $TEMPLATE
*/
public function setTemplate(Template $TEMPLATE){
$this->template = $TEMPLATE;
$model_name = $this->name;
$this->setHelpers();
}
/**
* Function to run before the constructor's view function
*/
public function init(){} //function to run right after constructor | {
"domain": "codereview.stackexchange",
"id": 1154,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, library",
"url": null
} |
quantum-field-theory, hilbert-space, many-body
and we can write it as
$$\mathcal{F}_s(\mathcal{H})=H_0\oplus H_1 \oplus H_2 \oplus \dots,$$
where $H_i$ means the Hilbert space of $i$ particles.
I understand the spaces with nonzero number of particles. But what is the Hilbert space of zero number of particles, $H_0$? It seems like the only state should be $\vert 0 \rangle$. Is that still a legitimate Hilbert space (that follows the axioms)? The complex numbers $\mathbb{C}$ form a one-dimensional Hilbert space. The axioms of a Hilbert space are that it be a complete metric space with a metric $d(x,y)=\sqrt{\langle x-y,x-y\rangle}$ that is defined in terms of an inner product $\langle x,y\rangle$. The complex numbers are endowed with a sesquilinear inner product $\langle x,y\rangle=x^{*}y$, which generates the usual distance measure $d(x,y)=|x-y|^{2}$, under which $\mathbb{C}$ is, of course, complete. | {
"domain": "physics.stackexchange",
"id": 83270,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, hilbert-space, many-body",
"url": null
} |
machine-learning, regression, feature-engineering, features
Title: Create features for each row or only for a specific value I have a problem. I want to predict when the customer will place another order in how many days if an order comes in.
I have already created my target variable next_day_in_days. This specifies in how many days the customer will place an order again. And I would like to predict this.
Since I have too few features, I want to do feature engineering. I would like to specify how many orders the customer has placed in the last 90 days. For example, I have calculated back from today's date how many orders the customer has placed in the last 90 days.
Is it better to say per row how many orders the customer has placed? Please see below for the example.
So does it make more sense to calculate this from today's date and include it as a feature or should it be recalculated for each row?
customerId fromDate next_day_in_days
0 1 2021-02-22 24
1 1 2021-03-18 4 | {
"domain": "datascience.stackexchange",
"id": 10856,
"lm_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, regression, feature-engineering, features",
"url": null
} |
# Transforming two normal random variables
I'm reviewing for a test, and I am not sure if I am getting the right solution.
Let $X$ and $Y$ be iid $\mathcal{N}(0, \sigma^2)$ random variables.
a. Find the distribution of $U = X^2 + Y^2$, $V = \frac{X}{\sqrt{X^2 + Y^2}}$,
b. are $U,V$ independent?
c. Suppose $\sin(\theta) = V$. Find distribution of $\theta$ when $0 \le \theta \le \pi/2$.
I get
1. $f_{U,V}(u,v) = \frac{1}{4\pi} \sigma^{-2} \exp \left[ -u/(2\sigma^2) \right]| (1-v^2)^{1/2} + (1-v^2)v^2|$,
2. yes (density factors and supports dont rely on each other)and
3. $g(\theta) = \left[\cos^2(\theta) + \cos^3(\theta)\sin^2(\theta)\right]\frac{1}{8 \pi \sigma^4}$.
Anybody recognize any of these distributions? | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9740426382811476,
"lm_q1q2_score": 0.8259567581611964,
"lm_q2_score": 0.847967764140929,
"openwebmath_perplexity": 376.77507809312215,
"openwebmath_score": 0.994449257850647,
"tags": null,
"url": "https://stats.stackexchange.com/questions/47616/transforming-two-normal-random-variables"
} |
CSET English IV: Elements of Dramatic Performance, Quiz & Worksheet - The British Royal Family, Quiz & Worksheet - Maximums, Minimums & Outliers in a Data Set, Quiz & Worksheet - Filial Piety & Ancestor Veneration, Quiz & Worksheet - Preparing for Careers in the Engineering Field, Quiz & Worksheet - Developing a Thesis Statement from Your Speech Topic, How Congress Represents the American Public: Demographic Makeup, Michigan Associations for Speech & Speech Education, International Baccalaureate vs. Advanced Placement Tests, Tech and Engineering - Questions & Answers, Health and Medicine - Questions & Answers. What did you find out about the trig ratios for small right triangles compared to similar large triangles? Any of the following properties: If a < b and b < c, then a < c. If a ≤ b and b ≤ c, then a ≤ c. If a > b and b > c, then a > c. If a ≥ b and b ≥ c, then a ≥ c.. Already registered? Transitive property represents logic statements between variables where conditions are put | {
"domain": "com.pl",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9799765633889135,
"lm_q1q2_score": 0.8057260807194623,
"lm_q2_score": 0.8221891327004132,
"openwebmath_perplexity": 1268.6576577415447,
"openwebmath_score": 0.3646334409713745,
"tags": null,
"url": "http://zswielen.com.pl/international-company-awx/f5c2ed-transitive-property-geometry"
} |
python, python-2.x, django
def get_context_data(self, form, **kwargs):
context = super(SurveyWizardOne, self).get_context_data(form, **kwargs)
if self.steps.current == '5':
display_image = random.choice(path_one_images)
context.update({'display_image': display_image})
path_one_images.remove(display_image)
elif self.steps.current == '6':
display_image = random.choice(path_one_images)
context.update({'display_image': display_image})
path_one_images.remove(display_image)
elif self.steps.current == '7':
display_image = random.choice(path_one_images)
context.update({'display_image': display_image})
path_one_images.remove(display_image) | {
"domain": "codereview.stackexchange",
"id": 9457,
"lm_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, django",
"url": null
} |
Suggestion: consider the multinomial coefficients in multi-index notation. I hope what I am doing below is correct!
a) $$\sum_{j\geq 1} {8\choose j}26^j 36^{8-j}=\underset{\alpha_1\geq 1\\|\alpha|=8}{\sum} {8\choose \alpha}26^{\alpha_1} 26^{\alpha_2}10^{\alpha_3},$$ where $\alpha\in\mathbb N_0^3$ ranges over multiindices $\alpha=(\alpha_1,\alpha_2,\alpha_3)$ with $\alpha_1\geq 1$ and $|\alpha|=\alpha_1+\alpha_2+\alpha_3=8$ by definition. Here, the counting goes as follows: there are ${8\choose \alpha}$ ways to pick $\alpha_1$ slots in which to put lowercase letters, $\alpha_2$ slots in which to put upper case letters and $\alpha_3$ slots in which to put numbers. For any single such choice, there is $26^{\alpha_1} 26^{\alpha_2}10^{\alpha_3}$ ways to put $j$ lowercase letters in the $\alpha_1$ chosen lower case slots, $\alpha_2$ upper case case letters in the chosen upper case slots and $\alpha_3$ numbers in the chosen number slots. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9740426450627305,
"lm_q1q2_score": 0.8179366872070672,
"lm_q2_score": 0.8397339596505965,
"openwebmath_perplexity": 430.26428195005224,
"openwebmath_score": 0.7084344625473022,
"tags": null,
"url": "https://math.stackexchange.com/questions/1057606/possibilities-for-passwords-with-at-least-one-lowercase-and-one-uppercase-letter"
} |
knowrob
% rdf_cache compiled into rdf_cache 0.00 sec, 28,104 bytes
% library(semweb/rdf_db) compiled into rdf_db 0.03 sec, 606,000 bytes
% library(broadcast) compiled into broadcast 0.00 sec, 7,520 bytes
% library(semweb/rdf_edit) compiled into rdf_edit 0.01 sec, 87,320 bytes
% library(semweb/rdfs) compiled into rdfs 0.00 sec, 28,328 bytes
% library(semweb/rdf_portray) compiled into rdf_portray 0.00 sec, 15,192 bytes
% library(owl) compiled into t20_owl 0.01 sec, 68,712 bytes
% library(utf8) compiled into utf8 0.00 sec, 13,824 bytes
% library(url.pl) compiled into url 0.01 sec, 113,720 bytes
% library(socket) compiled into socket 0.00 sec, 11,352 bytes
% library(base64) compiled into base64 0.00 sec, 17,704 bytes
% library(http/http_open.pl) compiled into http_open 0.00 sec, 92,944 bytes
% library(owl_parser) compiled into owl_parser 0.01 sec, 221,864 bytes
% library(rdfs_computable) compiled into rdfs_computable 0.01 sec, 48,384 bytes | {
"domain": "robotics.stackexchange",
"id": 19716,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "knowrob",
"url": null
} |
thermodynamics, water, phase-transition, phase-diagram, freezing
It seems there is not much of a region on the diagram at which you can be in the liquid phase, for temperatures lower than $0^\circ \text{C}$. I am asking if the motion of the water has any effect on the temperature at which it changes phase. This is because I have heard of several stories where running water was found to be at very low temperatures ($-20^\circ \text{C}$). Is this fake or does a running lake have a lower freezing point? It is highly unlikely that the stories about water flowing at -20C are true- unless the water was not actually at -20C, but just the surroundings.
It is possible to hold water at temperatures a few degrees below 0C if the water is extremely pure, held in an extremely clean and smooth-walled container, and isolated from stirring or shock. This metastable state is called supercooling and relies on there being no seed nuclei present to trigger the phase change from liquid to solid. | {
"domain": "physics.stackexchange",
"id": 63233,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, water, phase-transition, phase-diagram, freezing",
"url": null
} |
python, ifft
btw - The note on "filaria" was only for context, so you could see the problem you are helping to solve, but it is not really important for this discussion. But since someone asked, it's an investigation of parasitic worm one acquires through being bitten by an infected insect, for which there is no diagnostic test in humans for the disease, no disease-specific symptoms, and no known cure for the disease. I'm trying to research a total enigma and these very minute vibrations are just one general property of the disease being investigated. Very interesting problem.
Your pulse locations can be found by using a sliding window RMS measurement. Once found, I would recommend centering a DFT frame on the pulse and applying a VonHann window (broadens narrow peaks and narrows broad peaks), then take the FFT. Looking at the data, you should get a pretty distinct and clear profile. | {
"domain": "dsp.stackexchange",
"id": 8406,
"lm_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, ifft",
"url": null
} |
c#, parsing, language-design
int lineNumber = tokenizer.Peek().LineNumber;
int position = tokenizer.Peek().Position;
List<Expression> conditions = new List<Expression>();
List<Block> bodies = new List<Block>();
Block elseBody = null;
do
{
int currentLineNumber = tokenizer.Peek().LineNumber;
int currentPosition = tokenizer.Peek().Position;
tokenizer.Get();
Expression condition = IsExpression();
if (condition == null)
{
Reporter.Report(ErrorType.Error, "Expected condition", currentLineNumber, currentPosition);
}
if (tokenizer.Peek() == null || tokenizer.Peek().Kind != TokenKind.Colon)
{
Reporter.Report(ErrorType.Error, "Expected block", currentLineNumber, currentPosition);
}
tokenizer.Get(); | {
"domain": "codereview.stackexchange",
"id": 28728,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, parsing, language-design",
"url": null
} |
ros, catkin, motoman, ros-kinetic, joystick
Comment by gvdhoorn on 2020-05-27:
It's really just a build tool, but glad to hear you got things sorted out.
Don't forget to take a look at how you start the driver.
Refer to wiki/Working with ROS-Industrial Robot Support Packages for an intro on how to use robot support packages correctly.
Comment by bdelspi on 2020-05-27:
Absolutely, will do gvdhoorn and will post back here. Thank you for all your help and patience with me as I learn through this! Super powerful, super cool, and I am looking forward to learning more! Thank you again gvdhoorn!
Comment by bdelspi on 2020-07-09: | {
"domain": "robotics.stackexchange",
"id": 35006,
"lm_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, motoman, ros-kinetic, joystick",
"url": null
} |
database-theory, normal-forms, relational-algebra, relational-calculus
Title: Normal form of relation R It is given that for a relation R all the attributes of the relation appear in some of the candidate keys. It is also given that there is only one compound candidate key which exists for a relation, all the other candidate keys are simple candidate keys. What can be said about the normal form of R?
In my opinion, since all the attributes are part of some candidate attribute, it is surely in 3NF. But I am not sure if we can extend our reasoning to claim that R in also in BCNF(as claimed by the solution).
Can anyone please help me out why R can be said to be in BCNF normal form?
Thanks in advance! If you bring the functional dependencies of R in a canonical form, you can have only dependencies in which the right part is constituted only by a single attribute, which is prime, so we are sure that the relation is in 3NF. More, we can divide those dependencies into three sets: | {
"domain": "cs.stackexchange",
"id": 12806,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "database-theory, normal-forms, relational-algebra, relational-calculus",
"url": null
} |
-
Perhaps the text is intended to be "A chord $AB$ of one of two concentric circles intersects the other at $C$ and $D$." Briefly: "A chord of one circle intersects the other circle." So, your reading seems to be correct. (I haven't checked your proof, though.) – Blue Aug 26 '13 at 3:47
@Blue,so I was correct all along? – rah4927 Aug 26 '13 at 5:30
I just ran through your proof again (I mean ... for the first time ;). It looks good to me ... except for a minor-minor quibble: you mean "$\triangle ACO$ and $\triangle BDO$ by SAS" in your first paragraph. (The triangles should be named in the same order.) – Blue Aug 26 '13 at 5:36
The only thing I really notice that that you worked slightly too hard: once you have the two angle congruences, you can say that the triangles are congruent by SAA (or AAS); going the extra step for SAS is unnecessary. (Then again, the whole reason SAA works is because that extra step makes it equivalent to SAS.) – Blue Aug 26 '13 at 5:38 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9763105335255604,
"lm_q1q2_score": 0.8093016964010787,
"lm_q2_score": 0.8289388146603365,
"openwebmath_perplexity": 626.6044676304738,
"openwebmath_score": 0.8417598605155945,
"tags": null,
"url": "http://math.stackexchange.com/questions/476244/chord-passing-through-concentric-circles"
} |
java, design-patterns, database, jdbc
Title: Classical model for database connection provider Let's forget about Spring Singleton Beans and about other frameworks in Java. We have one or more simple HttpServlets. And we should make database connection. (doesn't matter what is it, hibernate session factory or JDBC connection). Always I write the following pattern:
class DatabaseService {
private static DatabaseService instance;
public static void init() {
instance = new DatabaseService();
}
public static void destroy() {
//.. destroy
}
public static DatabaseService getInstance() {
return instance;
}
private Connection conn;
private DatabaseService() {
conn = DriverManager.getConnection(DB_URL, USER, PASSWORD);
}
public Connection getConnection() {
return conn;
}
} | {
"domain": "codereview.stackexchange",
"id": 22819,
"lm_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, design-patterns, database, jdbc",
"url": null
} |
$2^{x-1}=8$ ...
Hello,
Since $8 = 2^3$ your equation becomes:
$2^{x-1}=2^3$
Two powers with equal bases are equal if the exponents are equal too:
Therefore: $x-1 = 3~\iff~x = 4$
8. Originally Posted by Rocher
$2^x-1=8$ >_< Latex doesn't work... It's 2 to the exponent x-1 = 8. x-1 is the exponent, the base is 2.
When you are coding the LaTeX, put what you want in the exponent inside a pair of { }:
2^{x - 1} generates $2^{x - 1}$
-Dan | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9828232889752297,
"lm_q1q2_score": 0.8353714663939206,
"lm_q2_score": 0.849971175657575,
"openwebmath_perplexity": 1281.973635345832,
"openwebmath_score": 0.8393873572349548,
"tags": null,
"url": "http://mathhelpforum.com/algebra/22379-stuff-again.html"
} |
computational-chemistry, theoretical-chemistry, density-functional-theory
Test
0 1
H
H 1 0.9
O 2 1.2 1 120.
and the used values of n were 2 (On the left) and 20 (On the right). The respective Energy and RMS profile of both simulations are:
Also, in Gamess, you can use these keywords: Statpt, Force and its related keywords like Zmt. More info, Please see this link at page 2-121 and 2-131. | {
"domain": "chemistry.stackexchange",
"id": 3239,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "computational-chemistry, theoretical-chemistry, density-functional-theory",
"url": null
} |
c#, security, cryptography, compression
using(var fileStream = outFile.Create()) {
byte[] salt = keyGenerator.Salt;
byte[] fileExtension = Encoding.ASCII.GetBytes(Convert.ToBase64String(Encoding.ASCII.GetBytes(inFile.Extension)));
byte[] paddedExtension = new byte[EXTENSIONSIZE];
if(fileExtension.Length > EXTENSIONSIZE) {
throw new Exception("File extension is too long for allocated memory. " +
"Consider compressing the file to a zip archive prior to encryption.");
}
Array.Copy(fileExtension, paddedExtension, fileExtension.Length);
// write random salt, hash and file extension to output file
fileStream.Write(salt, 0, SALTSIZE);
fileStream.Write(Hash(salt, password), 0, HASHSIZE);
fileStream.Write(paddedExtension, 0, EXTENSIONSIZE); | {
"domain": "codereview.stackexchange",
"id": 24844,
"lm_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#, security, cryptography, compression",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.