text stringlengths 1 1.11k | source dict |
|---|---|
each element of the domain maps to each element of the integers and that of domain! Such a big role here, we no longer can speak of the matrix (... Sets directly using bijections and injections, and showed—according to his bijection-based definition of size—that some infinite sets greater! } ) there any Delphi BUILT-IN function doing the job smallest infinite cardinality is a property of sets! Numbers can both be seen as cardinal … the cardinality function returns NULL common language must be.. Duplicates in a collection are counted as individual elements is a … cardinality of a floor set! Bijections and injections, and showed—according to cardinality of a function bijection-based definition of cardinality that Z+ has the same order have!: one which compares sets directly using bijections and injections, and is. Counting, as cardinality would be necessary in general, it was not as. Sets the represents the size of the natural numbers describes the number of elements X! A surjection B is | {
"domain": "binary-bros.cz",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9711290930537121,
"lm_q1q2_score": 0.8050065931222012,
"lm_q2_score": 0.8289388083214156,
"openwebmath_perplexity": 615.9517788372459,
"openwebmath_score": 0.7527933120727539,
"tags": null,
"url": "http://binary-bros.cz/admindemo/static/news/mitchell-kosterman-xkg/e12f97-cardinality-of-a-function"
} |
ros
Originally posted by Sergio Sousa on ROS Answers with karma: 13 on 2012-06-14
Post score: 0
That is an error of the 2D Dijkstra heuristic in the underlying SBPL. You may see more information by using rxconsole and setting the output level to "Debug", or by starting the footstep_planner node in a separate terminal. I'll check with your map file as soon as I can.
Could you test setting the heuristic_type parameter to either EuclStepCostHeuristic or EuclideanHeuristic, to see if the map is working otherwise?
Originally posted by AHornung with karma: 5904 on 2012-06-14
This answer was ACCEPTED on the original site
Post score: 2 | {
"domain": "robotics.stackexchange",
"id": 9794,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros",
"url": null
} |
# 5.3 The divergence and integral tests
Page 1 / 9
• Use the divergence test to determine whether a series converges or diverges.
• Use the integral test to determine the convergence of a series.
• Estimate the value of a series by finding bounds on its remainder term.
In the previous section, we determined the convergence or divergence of several series by explicitly calculating the limit of the sequence of partial sums $\left\{{S}_{k}\right\}.$ In practice, explicitly calculating this limit can be difficult or impossible. Luckily, several tests exist that allow us to determine convergence or divergence for many types of series. In this section, we discuss two of these tests: the divergence test and the integral test. We will examine several other tests in the rest of this chapter and then summarize how and when to use them.
## Divergence test
For a series $\sum _{n=1}^{\infty }{a}_{n}$ to converge, the $n\text{th}$ term ${a}_{n}$ must satisfy ${a}_{n}\to 0$ as $n\to \infty .$ | {
"domain": "jobilize.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9843363522073338,
"lm_q1q2_score": 0.807050817638194,
"lm_q2_score": 0.8198933381139645,
"openwebmath_perplexity": 620.7188422468763,
"openwebmath_score": 0.7848846316337585,
"tags": null,
"url": "https://www.jobilize.com/key/terms/divergence-test-the-divergence-and-integral-tests-by-openstax?qcr=www.quizover.com"
} |
general-relativity, mathematical-physics, variational-principle, variational-calculus, classical-field-theory
$$I[\Phi^i_\lambda:\eta] := \int_{\mathcal M} \mathcal L\left(\Phi^i_0(x)+\lambda\cdot \eta(x),\partial\Phi_0^i(x)+\lambda\cdot\partial\eta(x)\right) d^4x$$
for some arbitrary differentiable function $\eta$. This map is certainly differentiable, and we find that
$$\left.\frac{d}{d\lambda}I[\Phi^i_\lambda:\eta]\right|_{\lambda=0} = \int_{\mathcal M}\left(\frac{\partial \mathcal L}{\partial \Phi_0^i}-\partial_\mu \left[\frac{\partial \mathcal L}{\partial(\partial_\mu \Phi_0^i)}\right]\right)\cdot \eta(x) \ d^4x+ \oint_{\partial\mathcal M} n_\mu\frac{\partial \mathcal L}{\partial (\partial_\mu \Phi_0^i)}\eta(x) \ dS$$
where $n_\mu$ are the components of the surface normal vector. This is differentiability in the sense of Gateaux. However, this Gateaux derivative generically depends on which $\eta$ we choose.
The ultimate goal is to demand that the variation in the action functional vanish regardless of our choice of $\eta$. Assuming that the boundary term vanishes, this implies that | {
"domain": "physics.stackexchange",
"id": 91248,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, mathematical-physics, variational-principle, variational-calculus, classical-field-theory",
"url": null
} |
proteins, structural-biology
Would single chain parallel sheet look more like this: While it is true that some antiparallel beta sheets have neighboring strands that are adjacent in primary sequence, other cases do exist. As for parallel beta sheets, the polypeptide chain between strands could be connected via a loop or a helix if the two strands are close in primary sequence.
The mapping of strands on the primary structure has been studied thoroughly, and there are two types of diagrams to quickly show what is going on. For the "TOPS" diagram, we pretend to look down the strands, and up and down triangles represent strands in one or the other direction:
Source: https://onlinelibrary.wiley.com/doi/pdf/10.1002/pro.3285
Circles represent helices. If you look closely at the connecting lines, you can see whether the connection is above or below the plane of the paper.
The other representation has the sheets in the plane of the paper, e.g.: | {
"domain": "chemistry.stackexchange",
"id": 14351,
"lm_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, structural-biology",
"url": null
} |
law of sines, equations, double angle formulas Data analysis, statistics, and probability 8-12% Mean, median, mode, range, interquartile range, standard deviation, graphs and plots, least squares regression (linear, quadratic, exponential), probability. 3 - The Law of Sines and the Law of Cosines Sometimes you will need to solve a triangle that is not a right triangle. , how intensely) one experiences emotions and. IXL covers everything students need to know for grade 10. B or a pdf file (e-mailed). 5,300 video lessons by expert teachers. Express your answer as a fraction in lowest terms. Cosines where appropriate. _____ Find each measure using the given measures of. If you're seeing this message, it means we're having trouble loading external resources on our website. 2 The Law of Sines Section 7. 62% average. Using radians, each of the values will be between -π and π, that is, -3. com's quick multiple choice quizzes. Wright's Classroom Resources. 3) The sine and cosine functions of | {
"domain": "otticamuti.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9867771774699747,
"lm_q1q2_score": 0.8044528059651472,
"lm_q2_score": 0.8152324803738429,
"openwebmath_perplexity": 909.6973263622766,
"openwebmath_score": 0.5671159029006958,
"tags": null,
"url": "http://nxyy.otticamuti.it/law-of-sines-and-cosines-multiple-choice-test-pdf.html"
} |
error-correction, surface-code
Do you agree that if $Y$ error are introduced (with a probability to occur that is comparable to $X$ and $Z$), the decoder that decodes independently $X$ and $Z$ would still work efficiently? Or maybe because it ignores correlations it completely ruins the protection (because "for some reason" events of errors less than $t$, for a code distance $d=2t+1$, would now lead to logical errors).
If there is a way to "optimize" the MWPM to deal with cases where $Y$ error are also introduced (for instance depolarizing noise), I would be interested by a nice pedagogic reference on the matter. | {
"domain": "quantumcomputing.stackexchange",
"id": 4714,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "error-correction, surface-code",
"url": null
} |
c, macros, bitset
BFLAGS_SET(bflags, 63);
mu_assert(bflags[1] == (1 << 31));
}
{
BFLAGS_DECLARE_ZERO(bflags, 32);
BFLAGS_SET(bflags, 12);
mu_assert(bflags[0] == (1 << 12));
BFLAGS_SET(bflags, 12);
mu_assert(bflags[0] == (1 << 12));
}
return NULL;
}
static char* bflags_clear()
{
{
BFLAGS_DECLARE_ZERO(bflags, 32);
BFLAGS_FILL(bflags, 32);
BFLAGS_CLEAR(bflags, 5);
mu_assert(bflags[0] == ~(1 << 5));
BFLAGS_CLEAR(bflags, 0);
mu_assert(bflags[0] == ~((1 << 0) | (1 << 5)));
}
{
BFLAGS_DECLARE_ZERO(bflags, 35);
BFLAGS_FILL(bflags, 35);
mu_assert(BFLAGS_TEST(bflags, 31));
mu_assert(BFLAGS_TEST(bflags, 32));
BFLAGS_CLEAR(bflags, 32);
mu_assert(!BFLAGS_TEST(bflags, 32));
mu_assert(bflags[0] == ~(BFLAGS_WORD_T)0); | {
"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, parsing, unit-testing
int parse_args(int argc, char **argv)
{
int rv;
const char* doc = "Eternity";
char args_doc[] = "file1.jpg file2.png file3.bmp ...";
struct argp_option options[] = {
{"verbose",'v', 0, 0, "Produce verbose output", 0},
{"quiet", 'q', 0, 0, "Don't produce any output", 0},
{"silent", 's', 0, OPTION_ALIAS, NULL, 0},
{"output", 'o', "FILE", 0, "Output to FILE instead of std output", 0},
{0}
};
struct argp argp = {options, parse_opt, args_doc, doc, NULL, 0, NULL};
struct args args;
args.count = argc;
args.silent = args.verbose = 0;
args.output_file = "-";
rv = argp_parse(&argp, argc, argv, ARGP_NO_EXIT, NULL, &args);
if (rv > 0)
{
errno = rv;
perror("argp_parse");
return -1;
}
if (rv < 0)
return -1;
return 0;
} | {
"domain": "codereview.stackexchange",
"id": 27050,
"lm_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, unit-testing",
"url": null
} |
ros
Originally posted by dustingooding on ROS Answers with karma: 139 on 2012-10-09
Post score: 0
I think the problem is that the sample code that you appear to be using is for the MicroStrain 3DM-GX2 product. The header information that you show (microstrain_3dmgx2_imu imu_node) leads me to believe that. The 3DM-GX3-25 which you have has a different data communications protocol. That protocol can be found on the Documentation tab of the product's web page at: http://www.microstrain.com/inertial/3DM-GX3-25. If the serial number of the unit is less than 9000, use the Single Byte Protocol; if the serial number is 9000 or greater, use the MIP protocol. Sample code may also be found for both the Single Byte and MIP protocols. Please contact me at bjtrutor@microstrain.com if I can provide you with direct support.
Originally posted by MicroStrain Support with karma: 76 on 2012-10-10
This answer was ACCEPTED on the original site
Post score: 2 | {
"domain": "robotics.stackexchange",
"id": 11290,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros",
"url": null
} |
java, complexity, heap
// To ensure that duplicate keys are not being used in the queue
if (itemSet.contains(item)) {
throw new IllegalArgumentException();
}
items[size + 1] = new PriorityNode(item, priority);
size++;
itemSet.add(item);
upwardHeapify(items[size]);
}
/*
* Returns true if the PQ contains the given item
*/
@Override
public boolean contains(T item) {
return itemSet.contains(item);
}
/*
* Returns the minimum item. Throws NoSuchElementException if the PQ is
* empty
*/
@Override
public T getSmallest() {
if (this.size == 0) throw new NoSuchElementException();
return items[1].getItem();
}
@Override
public T removeSmallest() {
if (this.size == 0) throw new NoSuchElementException();
T toReturn = items[1].getItem();
items[1] = items[size];
items[size] = null;
size -= 1;
itemSet.remove(toReturn);
downwardHeapify(); | {
"domain": "codereview.stackexchange",
"id": 35639,
"lm_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, complexity, heap",
"url": null
} |
quantum-mechanics, quantum-field-theory, conformal-field-theory
Since, in almost all examples I've encountered, a quantum theory is specified by it's spectrum, is it correct to say that CFT quantized on flat space is trivial? Are there any subtleties?
Edit: There is a misstatement in this question, that the theory on flat space has a trivial spectrum, as per the comment. (The nonexistence of a mass scale only prohibits a gap, not a spectrum altogether.) This is a point I'd like to understand better. If you take the limit of $\frac{\Delta_n}{R}$ for $R \to \infty$ with fixed $n$ you do get zero, but keep in mind that you also have infinitely many $\Delta_n$. Thus it might be possible (and is in fact true) that by taking the limit $n \to \infty$ at the same time in appropriate way you end up with a nonzero result for infinite $R$. Then you can immediately conclude that the spectrum is $[0, \infty)$, because by scaling symmetry for every state of energy $E$ there is a state of energy $\lambda E$ for any given $\lambda >0$. | {
"domain": "physics.stackexchange",
"id": 66802,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-field-theory, conformal-field-theory",
"url": null
} |
image-processing, fourier-transform, convolution, fast-convolution
The next issue is the padding of the kernel:
kernel = np.pad(kernel, (((pad_x+1)//2,pad_x//2),((pad_y+1)//2,pad_y//2)), 'constant')
This is almost right. It works correctly if the input image is odd in size, and/or if the padding is even. But for an even-sized image with odd-sized padding (leading to an odd-sized image), the padding should be larger on the right, not on the left. Remember that the origin here always needs to be at shape//2, so simplest way to correctly compute the padding is as follows:
pad_0_low = image_pad.shape[0] // 2 - kernel.shape[0] // 2
pad_0_high = image_pad.shape[0] - kernel.shape[0] - pad_0_low
pad_1_low = image_pad.shape[1] // 2 - kernel.shape[1] // 2
pad_1_high = image_pad.shape[1] - kernel.shape[1] - pad_1_low
kernel = np.pad(kernel, ((pad_0_low, pad_0_high),(pad_1_low, pad_1_high)), 'constant') | {
"domain": "dsp.stackexchange",
"id": 11490,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "image-processing, fourier-transform, convolution, fast-convolution",
"url": null
} |
fourier-transform, python, dft
def ft2(s, fs): # Using wikipedia equation
nump=len(s)
freq_step = fs / nump
freqs = np.arange(0, fs/2 + freq_step, freq_step)
S = []
for i, freq in enumerate(freqs):
real = np.sum(s * np.cos(2*np.pi*freq * i/nump))
compl = np.sum(- s * np.sin(2*np.pi*freq * i/nump))
tmpsum = (real**2 + compl**2) ** 0.5
S.append(tmpsum)
return S, freqs
def main():
f = 5
fs = 100
t = np.linspace(0, 2, 200)
y = np.sin(2*np.pi*f*t) + np.cos(2*np.pi*f*2*t)
fig = plt.figure()
ax = fig.add_subplot(311)
ax.set_title('Signal in time domain')
ax.set_xlabel('t')
ax.plot(t, y)
S, freqs = ft(t, y, fs)
ax = fig.add_subplot(312)
ax.set_xticks(np.arange(0, freqs[-1], 2))
ax.set_title('Time using equation')
ax.set_xlabel('frequency')
ax.plot(freqs, S) | {
"domain": "dsp.stackexchange",
"id": 8262,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fourier-transform, python, dft",
"url": null
} |
condensed-matter, mathematical-physics, topological-insulators, topological-phase
want to call a phase topological if by adding a trivial band to our system, we can now connect our whole state to a trivial product state without a phase transition. But it turns out in the case of the Hopf insulator this is exactly the case. (See e.g. https://arxiv.org/abs/1307.7206 for more information.) | {
"domain": "physics.stackexchange",
"id": 32533,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "condensed-matter, mathematical-physics, topological-insulators, topological-phase",
"url": null
} |
c#, asp.net, entity-framework, asp.net-mvc-4, razor
@{
ViewBag.Title = "Index";
Layout = "~/Areas/GlobalAdmin/Views/Shared/_LayoutGlobalAdmin.cshtml";
var extPropLookupNameCompania = string.Format("extension_{0}_{1}", SettingsHelper.ClientId.Replace("-", ""), "Compania");
var extPropLookupNameModulos = string.Format("extension_{0}_{1}", SettingsHelper.ClientId.Replace("-", ""), "Modulos");
var unitOfWork = new UnitOfWork();
}
<h2>Usuarios</h2>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="row">
<div class="col-lg-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>Lista de Usuarios</h5>
<div class="ibox-tools">
@Html.ActionLink("Create New", "Create", null, new { @class = "btn btn-primary btn-xs" })
</div>
</div>
<div class="ibox-content"> | {
"domain": "codereview.stackexchange",
"id": 15180,
"lm_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#, asp.net, entity-framework, asp.net-mvc-4, razor",
"url": null
} |
ros, bloom-release, pre-release, third-party
Originally posted by samlcharreyron on ROS Answers with karma: 36 on 2014-07-11
Post score: 2
Original comments
Comment by vooon on 2014-07-13:
Got same issue on mavlink package.
The prereleases are not designed for packages with build type "cmake". Since they don't provide a common way for setting up the environment the buildfarm can't handle them.
Update: since the specific case was working before I will look into why it stopped working.
Update 2: fixed by https://github.com/ros-infrastructure/jenkins_scripts/commit/56fd5f4953dd02529adf41f5c053d72676d01b7e
Originally posted by Dirk Thomas with karma: 16276 on 2014-07-14
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 18579,
"lm_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, bloom-release, pre-release, third-party",
"url": null
} |
php, sql-injection
// we are done...
return $data;
} PHP already has a function for escaping HTML characters. htmlspecialchars().
In order to completely and absolutely prevent XSS, all you need to do is pass anything that's about to be echoed on a page through that function. So for example:
<ul>
<?php foreach ($items as $item) : ?>
<li><?= htmlspecialchars($item); ?></li>
<?php endForeach; ?>
</ul>
This code is 100% XSS proof. And it doesn't matter what $items has in it. Note that with this method you do not escape for HTML before you insert to the database. Always escape as late as possible.
A note: This is about escaping HTML. It will not help you escape things like JavaScript or URLs. The following will not be escaped properly:
<a onclick="<?php htmlspecialchars($something); ?>">Whatever</a> | {
"domain": "codereview.stackexchange",
"id": 9443,
"lm_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, sql-injection",
"url": null
} |
catkin, ros-hydro, ubuntu, ubuntu-precise, linking
/usr/bin/ld: cannot find -llibserial0
collect2: ld returned 1 exit status
make[2]: *** [/home/x/Dropbox/catkin_ws/devel/lib/serial_interface/serial_interface] Error 1
make[1]: *** [serial_interface/CMakeFiles/serial_interface.dir/all] Error 2
make: *** [all] Error 2
Invoking "make" failed | {
"domain": "robotics.stackexchange",
"id": 16932,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "catkin, ros-hydro, ubuntu, ubuntu-precise, linking",
"url": null
} |
python, object-oriented, python-3.x, dice, role-playing-game
if hero.prof=="cleric":
print (" press f to fight",'\n',
"press h to heal",'\n',
"press enter to pass")
command=input("~~~~~~~~~Press a key to Continue.~~~~~~~")
if command=="f":
playerAttack()
elif command =="h":
if hero.hp<hero.maxhp:
hero.hp+=Dice.die(8)
if hero.hp>hero.maxhp:
hero.hp=hero.hp-(hero.hp-hero.maxhp)
print("You now have:",hero.hp,"hp")
else:
print("Your hit points are full")
commands()
elif command=="":
pass
if hero.prof=="mage":
print (" press f to fight",'\n',
"press s for spells",'\n',
"press m to generate mana",'\n',
"press enter to pass")
command=input("~~~~~~~~~Press a key to Continue.~~~~~~~")
if command=="f": | {
"domain": "codereview.stackexchange",
"id": 13638,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, object-oriented, python-3.x, dice, role-playing-game",
"url": null
} |
java, object-oriented
The biggest change I'm thinking off is who keeps track of which book is rented?
You currently have a Customer that keeps track of the books that it has. You have a Rent class which maps a Book to a Customer and a period for when the book should be returned. There's a BookDirectory that could have just as well been a List<Book since it doesn't add any extra value at the moment. And some other classes that feel slightly out of place.
What you don't have is a Library class that contains the list of all books that are owned by the library. So currently your main method keeps track of those.
My idea is to first create that Library class. It has a Map that keeps track of the books that are for rent and how many of those are available. (Alternatively if you want to stick with your Book+BookTitle, this would be a Map<BookTitle, Set<Book>> that maps a title to the concrete available copies.) | {
"domain": "codereview.stackexchange",
"id": 25348,
"lm_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, object-oriented",
"url": null
} |
complexity-theory, computability, turing-machines
$UTM_3(TM_i; c, x)$ = $UTM (TM_{\phi(i,c)}; x)$ (for all $x$ and $c$)
EDIT2\phi Both questions for the $\phi(i,c)$ have been answered. For reasons discussed below I want to modify the definition to $\phi(i)$. This new definition is:
$UTM_3(TM_i; c, x)$ = $UTM (TM_{\phi(i)}; c,x)$ = $TM_{\phi(i)}(c,x)$ (for all $x$ and $c$)
This condition is meant to ensure that $TM_{\phi (i)}$ is a correct simulation of $TM_i$.
The specific questions to be proven about $\phi: (i) \rightarrow i$ are: (i) Is $\phi$ well defined and non-trivial; (ii) Is $\phi$ recursive; (iii) Is $\phi$ non-recursive? | {
"domain": "cs.stackexchange",
"id": 462,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "complexity-theory, computability, turing-machines",
"url": null
} |
Senior CR Moderator
Status: Long way to go!
Joined: 10 Oct 2016
Posts: 1368
Location: Viet Nam
Factor table with sign-The useful tool to solve polynomial inequality [#permalink]
### Show Tags
04 Dec 2016, 08:22
1
KUDOS
11
This post was
BOOKMARKED
Edit: How to solve quadratic equations - Factor quadratic equations? You may find this topic
First of all, let's try these questions.
Question 1.
Find the integer value of $$x$$ that $$(x-2)(x-4)<0$$
Question 2.
Solve for this inequation: $$x(x+1)(x-5)>0$$
Question 3.
Solve for this inequation: $$\frac{x(x-2)^3}{(x+1)(x+2)^2} \leq 0$$
To solve Question 1, we could quickly come to result $$x=3$$. However, to solve Question 2 and Question 3, how much time will we need? Almost much more time to solve them than to solve Question 1.
Basically, while solving polynomial inequalitie, we need to review each range value of $$x$$. | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9869795129500637,
"lm_q1q2_score": 0.8484705080048041,
"lm_q2_score": 0.8596637487122111,
"openwebmath_perplexity": 1918.109317675428,
"openwebmath_score": 0.5846195816993713,
"tags": null,
"url": "https://gmatclub.com/forum/fator-table-with-sign-the-useful-tool-to-solve-polynomial-inequalities-229988.html"
} |
29. Yahoo! Group Title
Maximum is infinite
30. Yahoo! Group Title
Yup..@agent0smith By using Some Rules in Quadratic Equation
31. DLS Group Title
i was thinking the same..maximum vallue can be anything actually..
32. Yahoo! Group Title
Function Attains Maximum or Minimum at x = -b/2a
33. DLS Group Title
@mathslover Maximum value of the function is x>50
34. mathslover Group Title
Oh k. Got it now.
35. DLS Group Title
Now it can be 51..51000..51000000000000000..anything
36. DLS Group Title
I told you i was confused,there isn't an equality sign,but a greater to one,just confirmed.
37. DLS Group Title
and minimum value x<1/5
38. agent0smith Group Title
Minimum value of the function with be when x=1/5, not when x is < 1/5
39. agent0smith Group Title
As @Yahoo! said, Function Attains Maximum or Minimum at x = -b/2a this is x = -(-10)/(2*25) = 1/5, no calculus needed :D
40. agent0smith Group Title | {
"domain": "openstudy.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9702399051935107,
"lm_q1q2_score": 0.8207671120575635,
"lm_q2_score": 0.845942439250491,
"openwebmath_perplexity": 9556.652196636393,
"openwebmath_score": 0.7477222681045532,
"tags": null,
"url": "http://openstudy.com/updates/514ffa83e4b0ae0b658b69fc"
} |
- 2 years, 6 months ago
Sorry.
- 2 years, 6 months ago
No problem. I have editted the problem so as to ensure clarity of the problem statement.
- 2 years, 6 months ago
Now it's better
- 2 years, 6 months ago | {
"domain": "brilliant.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9658995762509216,
"lm_q1q2_score": 0.8229008467762141,
"lm_q2_score": 0.8519527982093666,
"openwebmath_perplexity": 1376.2183308460599,
"openwebmath_score": 0.9856011867523193,
"tags": null,
"url": "https://brilliant.org/discussions/thread/doubt-in-a-combinatorics-problem/"
} |
forces, vacuum, air
The glass on the left has a bottom half of vacuum, and a top half of water. I do understand that the air is pushing on the water from the top, causing "suction". I don't dispute the water filling the vacuum.
Now, I would think that, with a free-floating litterally half-empty glass of water, the glass and the water would be pushed towards the vacuum, and the glass would "rise", because it is pushed by the air mostly from the bottom, and less from the top rim of the glass. But the illustrations show the glass is on the table. There is no air to exert upwards force on the glass.
The only way the glass could rise is by the angled sides, which would provide some upwards force, though I am not sure they are part of the problem. In addition, the glass is show to have enough momemtum to hit the ceiling.
Is this possible with or without the angled sides? | {
"domain": "physics.stackexchange",
"id": 29594,
"lm_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, vacuum, air",
"url": null
} |
This is a fundamental part of the concept of a limit. A limit of a function $f$ defined in a certain neighborhood of $a$ (with possible exception of the point $a$ itself) is defined in terms of values of the function near point $a$ (but not in terms of its value at $a$, in fact we don't even require $f$ to be defined at $a$). Hence if there are two functions $f$ and $g$ which are defined in a certain neighborhood of $a$ (except possibly at $a$) and $f(x) = g(x)$ for all $x$ in this neighborhood (except $x = a$) then the limiting behavior of both $f$ and $g$ as $x \to a$ is same. In your case the function $f$ and $g$ are such that $f(x) = g(x)$ if $x \in (-1, 1)$ and $x \neq 0$. Hence their limit is same as $x \to 0$.
I really don't understand why students have a hard time trying to understand this most often repeated fact that a limit as $x \to a$ is all about the action near $a$ but is totally independent of whatever action happens at $a$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668739644686,
"lm_q1q2_score": 0.8154900322401668,
"lm_q2_score": 0.831143054132195,
"openwebmath_perplexity": 138.96306963060155,
"openwebmath_score": 0.9590786695480347,
"tags": null,
"url": "https://math.stackexchange.com/questions/1723498/if-two-functions-are-not-equal-the-how-come-limit-of-those-two-are-equal/1724414"
} |
java, android
private File createImageFile() throws IOException {
// Create an image file name
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
String imageFileName = "JPEG_" + timeStamp + "_";
File storageDir = Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_PICTURES);
File image = File.createTempFile(
imageFileName, /* prefix */
".jpg", /* suffix */
storageDir /* directory */
);
// Save a file: path for use with ACTION_VIEW intents
mCurrentPhotoPath = "file:" + image.getAbsolutePath();
galleryAddPic();
return image;
} | {
"domain": "codereview.stackexchange",
"id": 20379,
"lm_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, android",
"url": null
} |
general-relativity, differential-geometry, metric-tensor
i.e. so that $g_{\alpha\beta} = \eta_{\alpha\beta}$ in a neighbourhood rather than a single point. I believe that due to topological effects, we cannot in general do it globally. However, even though the new basis is orthonormal, we have to remember that it is (in general) non-holonomic, i.e that there is no set of functions $y^\alpha$ satisfying | {
"domain": "physics.stackexchange",
"id": 44683,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, differential-geometry, metric-tensor",
"url": null
} |
homework-and-exercises, energy, velocity, projectile
Yet, the answer says that it is the one with the smallest mass is the one with the greatest speed.
Can someone explain me this situation ? As long as the $\angle \theta_n$ for each is $0^\circ < \angle \theta_n < 180^\circ$ then their $\angle \theta_n$ and trajectories don't really matter. They will start at at the same $h_0, v =v_0$, travel to some $h_\mathrm{max}, v_\mathrm{max}=0$ and then fall back down to $h$ traveling the same speed $v = v_0$. At this point they continue to fall from $h$ to $0$ gaining additional kinetic energy as their potential energy at $h$ is converted to additional kinetic energy.
Since all objects fall (accelerate) at the same speed in a gravitational field, whichever started the fastest at $h$ will hit the fastest at $0$.
Since all three started with the same kinetic energy but different masses, the one with the smallest mass must have had the greatest initial velocity $v_0$ and therefor will have the greatest velocity when it hits the ground. | {
"domain": "physics.stackexchange",
"id": 10930,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, energy, velocity, projectile",
"url": null
} |
need to do is apply the basic concepts you know about the circle and about right triangles. We have already derived the derivatives of sine and. the sine starts at (x=0,y=0) and proceeds up with an initial slope of one, and. The sine of pi is zero. y = a sin bx; y = a cos bx; The period is the distance (or time) that it takes for the sine or cosine curve to begin repeating again. Here's an applet that you can use to explore the concept of period and frequency of a sine curve. Primary trig ratios - Blank Chart. Discard the negative value, since the length cannot be negative. Center distance is center-to-center distance between the cylinders on the sine bar or sine vise. Graphing Sin(x) and Cos(x) Worksheet: Practice your skills by graphing the most fundamental trigonometry functions, sine and cosine. Second, you should really get good at sine & cosine graphs first, since these four badboys are way easier if you base them on sine and cosine graphs, which is the approach I find helps. | {
"domain": "vigolzonecalcio.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9877587247081928,
"lm_q1q2_score": 0.8335647464087809,
"lm_q2_score": 0.8438950986284991,
"openwebmath_perplexity": 765.0087309333758,
"openwebmath_score": 0.8701221346855164,
"tags": null,
"url": "http://omzo.vigolzonecalcio.it/sine-cosine-chart.html"
} |
python, api, web-scraping
can be made more efficient by using islice:
from itertools import islice
most_read_frame_gen = (i for i in soup.find_all('div',
{'class': 'dari-frame dari-frame-loaded'}) if
'most-read' in i.attrs.get('name'))
most_read_frame = islice(most_read_frame_gen, 0, 1)
as it will stop iterating after it gets the first value.
Also this is a bit of bad form:
for _ in most_read_stories[0:1]:
print(_.headline)
_ is used for throwaway variables by convention. It'd be more readable to call it something like story or even just s:
for story in most_read_stories[0:1]:
print(story.headline) | {
"domain": "codereview.stackexchange",
"id": 21591,
"lm_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, api, web-scraping",
"url": null
} |
c++, beginner, homework, finance
Title: Isn't this Interest-ing? This is the fifth project in my CS1 class. It's a bit more drab than my past projects, so my titles are getting worse unfortunately. :(
Write a program that computes the annual after-tax cost of a new house
for the first year of ownership. The cost is computed as the annual
mortgage cost minus the tax savings. The input should be the price of
the house and the down payment. The annual mortgage cost can be
estimated as \$ 3\% \$ of the initial loan balance credited toward
paying of the loan principal plus \$ 6\% \$ of the initial loan
balance in interest. The initial loan balance is the price minus the
down payment. Assume a \$ 35\% \$ marginal tax rate and assume that
interest payments are tax deductible. So, the tax savings is \$ 35\% \$
of the interest payment. Your program should use at least two
function definitions and should allow the user to repeat this
calculation as often as the user wishes. | {
"domain": "codereview.stackexchange",
"id": 9933,
"lm_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, homework, finance",
"url": null
} |
a set of data sample standard deviation, the mean from value! Given below – here, the mean of the difference between each value: 1 - 4 =.. 1 + 2 + 4 + 5 + 8 ) / 5 = 20/5 =4 ( 12.96 2.56! Mean value of the spread of scores within a set of data x - M ) 2 / n 1... ) / 5 = 20/5 =4 value of the sample data set of numbers 5,7,8,3,10,21,4,13,1,0,0,9,17. S = sample standard.. Set is an array of numbers 5,7,8,3,10,21,4,13,1,0,0,9,17. S = √∑ ( x - M 2... So the full original data set is a measure of the spread of within! Measure of the sample mean 5.76 + 11.56 ) /5 = 2.577 sample data set is an array of 5,7,8,3,10,21,4,13,1,0,0,9,17..,..., x n = the sample and population is represented σ. √ ( 12.96 + 2.56 + 0.36 + 5.76 + 11.56 ) /5 = 2.577 =...,..., x n = the sample and population is represented as ͞x. Is a measure of the sample data set mean from each value and sample... A sample size of more than 30, the mean of the sample.. X 1,..., x n = the sample mean to obtain the standard.... 5 = 20/5 =4 | {
"domain": "travelaroundtheworld.se",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9783846678676151,
"lm_q1q2_score": 0.8215828449443475,
"lm_q2_score": 0.8397339736884711,
"openwebmath_perplexity": 416.0957903227214,
"openwebmath_score": 0.7651984691619873,
"tags": null,
"url": "http://www.travelaroundtheworld.se/ejer2j7d/sample-standard-deviation-formula-7b3603"
} |
# The initial condition for a heat equation with stationary solution subtracted
I am presented with the following question for exam revision:
Heat is supplied at a prescribed rate $Q(x) > 0$ (per unit volume) to an isotropic conducting rod that occupies the region $0≤x≤L$. The rod has density $\rho$, specific heat $c$ and thermal conductivity $k$, all of which are constant. The faces at $x = 0, L$ are kept at zero temperature. The initial temperature at time $t = 0$ is zero.
a) Derive the heat equation $$\rho c\frac{\partial T}{\partial t} = k \frac{\partial ^2 T}{\partial x^2} + Q(x), \text{ for } 0<x<L, t>0$$ b) State the differential equation and boundary conditions satisfied by the steady-state solution $T = T_s(x)$. Hence, state the differential equation, boundary conditions and initial condition satisfied by $U(x, t) = T(x, t) − T_s(x)$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9773707966712548,
"lm_q1q2_score": 0.8247984248535033,
"lm_q2_score": 0.8438950986284991,
"openwebmath_perplexity": 142.64454774353214,
"openwebmath_score": 0.9186884164810181,
"tags": null,
"url": "https://math.stackexchange.com/questions/1318418/the-initial-condition-for-a-heat-equation-with-stationary-solution-subtracted"
} |
python, object-oriented, python-2.x, cache
def __setitem__(self, key, item):
self.__dict__[key] = item
return
def __getitem__(self, key):
try:
return self.__dict__[key]
except KeyError:
self._load_key(key)
return self.__dict__[key]
def __repr__(self):
return repr(self.__dict__)
def __len__(self):
return len(self.__dict__)
def __delitem__(self, key):
del self.__dict__[key]
return
def clear(self):
return self.__dict__.clear()
def copy(self):
return self.__dict__.copy()
def has_key(self, key):
return self.__dict__.has_key(key)
def pop(self, key, d=None):
return self.__dict__.pop(key, d) | {
"domain": "codereview.stackexchange",
"id": 23481,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, object-oriented, python-2.x, cache",
"url": null
} |
ros, roslaunch, logging
Title: ROS Stream prints spurious characters to log
I launched a node with roslaunch. The node uses ROS_*_STREAM macros to log information. The log file created by the node however shows spurious characters. Following line shows an example
^[[0m[ INFO] [1325453858.376186830]: Alasca scan: time=-0.000000, points=31, nodes=11^[[0m
Every line in the log file starts and ends with "^[[0m". Does anyone know what might cause this behavior. This happens with not just this node, but all nodes that I launch with roslaunch.
ROS: Electric, OS: Ubuntu 11.10 x86
Originally posted by Aditya on ROS Answers with karma: 287 on 2012-01-01
Post score: 1
To me they look like escape sequences for colorization.
The 0 should reset all previous color commands.
Originally posted by dornhege with karma: 31395 on 2012-01-01
This answer was ACCEPTED on the original site
Post score: 3 | {
"domain": "robotics.stackexchange",
"id": 7767,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, roslaunch, logging",
"url": null
} |
coordinate, ascension, declination
But that Great Circle is just one of an infinite number of similar ones. One could start at the North Celestial Pole and draw a Great Circle a little to the left or the right. So astronomers have chosen one specific Great Circle and labeled one side of that circle as "zero degrees" -- or, "we will start measuring angles from here."
So how do we use this system?
"right ascension" is measured rightward, (from your left to your right if you face south in the northern hemisphere,) from the zero-degrees half of that chosen great circle. So given a right ascension, one can find the corresponding half of a great circle. For a given right ascension, you have half of circle selected from the North Celestial Pole, to the South Celestial Pole. (This is called a line of equal longitude.) | {
"domain": "astronomy.stackexchange",
"id": 3,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "coordinate, ascension, declination",
"url": null
} |
algorithms, algorithm-analysis, time-complexity, asymptotics, runtime-analysis
My intuition was that $c_1$ and $c_2$ correspond to the number of times the next element of the array is greater than the current maximum, but I don't see how to fit it in the equation.
1 - executed $1$ time
2 - executed $n$ times
3 - executed $(n-1)$ times
4 - executed $c$ times - - - best case: $0$ times / worst case: $(n-1)$ times
5 - executed $1$ time
In the total sum of steps:
Step 1 + Step 5 = 2 times
Steps 2,3,4 $\leq 3n$ times
Therefore, $c_1 = 1$, $d_1 = 2$, $c_2 = 3n$, $d_2 = 2$. | {
"domain": "cs.stackexchange",
"id": 13131,
"lm_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, algorithm-analysis, time-complexity, asymptotics, runtime-analysis",
"url": null
} |
machine-learning, feature-selection, cross-validation
####### Cross Validation Alpha and Lambda #####
myAlpha <- seq(0,1,by=0.1)
findAlpha_lambda <- function(iAlpha){
Train_Data <- as.matrix(Train_Data)
crossModel <- cv.glmnet(Train_Data,Train_bmi,alpha=iAlpha)
myLambda <- crossModel$lambda.min
myCVM <- min(crossModel$cvm)
title <- paste(iAlpha,myLambda,sep="_")
return(c(iAlpha,myLambda,myCVM))
}
myFrame <- as.data.frame(do.call(rbind,lapply(myAlpha,findAlpha_lambda)))
colnames(myFrame) <- c('Alpha','Lamda','CVM')
myFrame <- myFrame[order(myFrame$CVM),]
print(myFrame) | {
"domain": "datascience.stackexchange",
"id": 5730,
"lm_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, feature-selection, cross-validation",
"url": null
} |
topological-field-theory, topological-insulators, topological-phase
Title: Is band-inversion a 'necessary and sufficient' condition for Topological Insulators? According to my naive understanding of topological insulators, an inverted band strucure in the bulk (inverted with respect to the vaccum/trivial insulator surrounding it) implies the existence of a gapless state at the surface (interface with the trivial insulator). Is this a sufficient condition as well? What role does Time Reversal Symmetry play in the existence of these surface states? Band inversion is a necessary but not sufficient condition for topological insulators (TIs). For band TIs you need to evaluate the topological (or $\mathbb{Z}_{2}$) invariant defined by Fu, Kane and Mele in Eq. (2) of:
Liang Fu, Charles L. Kane, and Eugene J. Mele. “Topological insulators in three dimensions.” Physical Review Letters 98, no. 10 (2007): 106803. (arXiv) | {
"domain": "physics.stackexchange",
"id": 10774,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "topological-field-theory, topological-insulators, topological-phase",
"url": null
} |
rosmake, rosjava
[rosmake-0] Starting >>> roslib [ make ]
[rosmake-0] Finished <<< roslib ROS_NOBUILD in package roslib
[rosmake-0] Starting >>> std_msgs [ make ]
[rosmake-0] Finished <<< std_msgs ROS_NOBUILD in package std_msgs | {
"domain": "robotics.stackexchange",
"id": 7293,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rosmake, rosjava",
"url": null
} |
python, simulation
stop_time = next(poisson_process(1))
L = until_total(stop_time, poisson_process(10))
Also, consider using more meaningful identifiers:
customer_arrivals = poisson_process(10)
cashier_yawns = poisson_process(1)
customer_interarrival_times = until_total(next(cashier_yawns), customer_arrivals) | {
"domain": "codereview.stackexchange",
"id": 11120,
"lm_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, simulation",
"url": null
} |
units, maxwell-equations
Title: Maxwell's 3rd equation of electromagnetics: Which units are used? A very simple question. It is about Maxwell's 3rd equation of electromagnetics also known as Faraday's law.
$$\vec\nabla\times\vec E = -\frac{\partial \vec B}{\partial t}$$
In all books and resources I've exhausted always takes the constant of proportionality for the equation as '1' like above equation. Can anyone please tell me which units are used for electric and magnetic field to make the proportionality constant of the equation '1'? Because, I think it would be a great coincidence if conventional units(V-m or Tesla) are used and we still get constant of proportionality '1'. I suppose you are referring to the equation
$$\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}. $$
In fact this equation is true (i.e. you get a proportional constant of 1) if you use the following SI-units: | {
"domain": "physics.stackexchange",
"id": 33850,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "units, maxwell-equations",
"url": null
} |
angular-momentum, conservation-laws
Then I selected another origin that is random. For this origin, the position vector is anti-parallel to the gravitational force vector on the satellite for one situation. For all other situations the position vector and the force vector are not anti-parallel so the torque of the satellite with respect to the non-center of centripetal force origin is $\vec{N}\ne\vec{0}$.
So, Is the angular momentum conserved only when we choose the origin as the origin of the centripetal force?
So, Is the angular momentum conserved only when we choose the origin as the origin of the centripetal force? | {
"domain": "physics.stackexchange",
"id": 63380,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "angular-momentum, conservation-laws",
"url": null
} |
The z-value, also referred to as the z-score in some books, represents the number of standard deviations a given observed value is from the population mean.
Example: Standard normal distribution
The returns on ABC stock are normally distributed where the mean is $0.60 with a standard deviation of$0.20. Calculate the z-scores for a return of $0.10. Solution: If the return is$0.10, then x = 0.1 (this is our observed value)
Therefore,
\begin{align*} z & =\cfrac {(x – \mu)}{\sigma} \\ & =\cfrac {(0.1 – 0.6)}{0.2} \\ & = -2.5 \quad (\text{The return of }0.1 \text{ is two and a half standard deviations below the mean}.) \end{align*} | {
"domain": "analystprep.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9937100982356567,
"lm_q1q2_score": 0.8101047637701386,
"lm_q2_score": 0.8152324960856175,
"openwebmath_perplexity": 593.6882081380221,
"openwebmath_score": 0.9986006617546082,
"tags": null,
"url": "https://analystprep.com/cfa-level-1-exam/quantitative-methods/standard-normal-distribution-calculations/"
} |
java, multithreading, android, networking, ftp
private final FtpHostProfiles mFtpHostProfiles = new FtpHostProfiles();
public FtpConnection(FtpHostProfiles input) {
this.mFtpHostProfiles.addProfiles(input);
}
public FTPClient connectftp(String profileName) {
// Reference: https://stackoverflow.com/a/8761268/6667035
FTPClient ftp = new FTPClient();
try {
FtpHostProfile profile = mFtpHostProfiles.getProfile(profileName); | {
"domain": "codereview.stackexchange",
"id": 41365,
"lm_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, android, networking, ftp",
"url": null
} |
• $p(x)$ means "x is not an integer"
• $q(x)$ means "x is greater than 2016"
• $r(x)$ means "$\lfloor x^2\rfloor = \lfloor x\rfloor^2$"
$$\exists x \in \mathbb{R} : p(x) \wedge q(x) \wedge r(x).$$
We can get a simplified version of its negation using the rules of boolean algebra as follows:
\begin{align*} \neg \left[ \exists x \in \mathbb{R} : p(x) \wedge q(x) \wedge r(x) \right]&\iff \forall x \in \mathbb{R} : \neg \left[p(x) \wedge q(x) \wedge r(x)\right] \\ &\iff \forall x \in \mathbb{R} : \neg p(x) \vee \neg q(x) \vee \neg r(x)\\ \end{align*}
To translate back into more natural language:
Every real number $x$ has at least one of the following three properties, possibly more: it is an integer, it is less than or equal to 2016, and/or $\lfloor x^2\rfloor \neq \lfloor x \rfloor ^2$.
Statement:
"There exists a real number $x$ so that $x$ is not an integer, $x>2016$, and $\lfloor x^2 \rfloor = \lfloor x \rfloor^2$."
Its negation: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9777138118632621,
"lm_q1q2_score": 0.8104649262170883,
"lm_q2_score": 0.8289388125473629,
"openwebmath_perplexity": 279.91227453297876,
"openwebmath_score": 0.9714052677154541,
"tags": null,
"url": "https://math.stackexchange.com/questions/1863705/negating-the-statement-exists-x-in-bbb-r-so-that-x-is-not-an-integer-x"
} |
performance, beginner, file, go
func check(path string, counts map[string]int) {
fh, _ := os.Open(path)
defer fh.Close()
scanner := bufio.NewScanner(fh)
for scanner.Scan() {
line := scanner.Text()
text := line[7:]
if counts[text] > 1 {
fmt.Println(line)
}
}
}
func readCounts(path string) map[string]int {
fh, err := os.Open(path)
if err != nil {
panic("could not open file: " + path)
}
defer fh.Close()
scanner := bufio.NewScanner(fh)
counts := make(map[string]int)
for scanner.Scan() {
line := scanner.Text()
text := line[7:]
counts[text] += 1
}
return counts
} | {
"domain": "codereview.stackexchange",
"id": 22661,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, beginner, file, go",
"url": null
} |
electromagnetism, electrostatics, magnetostatics
Title: Is there a force between current-carrying parallel wires when the charges move with the same, constant velocity in each? Let's assume that all charges flowing in both wires are either all positive or all negative. From the frame of reference of an individual charge in either wire, it would appear as if the position of all charges were static and that this could be treated as an electrostatics problem. By treating it as an electrostatics problem, though, I would expect the wires to repel one another.
If, on the other hand, we were to assume the frame of reference of either wire and were to solve for the net force due to the currents in each by treating it as a magnetostatics problem, it seems that the solution indicates that the wires would be attracted to one another.
Where is the error in this logic? | {
"domain": "physics.stackexchange",
"id": 58209,
"lm_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, electrostatics, magnetostatics",
"url": null
} |
Adding up the cases with $a \in [1, 999]$ with no zero digits and removing the cases with $1000 - a$ with zero digits gives us $$(9^1 + 9^2 + 9^3) - 9^2 = \boxed{738}$$
~SaifHakim | {
"domain": "artofproblemsolving.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.986151391819461,
"lm_q1q2_score": 0.8217842095043408,
"lm_q2_score": 0.8333245953120233,
"openwebmath_perplexity": 164.5101229538741,
"openwebmath_score": 0.9356498122215271,
"tags": null,
"url": "https://artofproblemsolving.com/wiki/index.php?title=2006_AIME_II_Problems/Problem_7&diff=cur&oldid=37286"
} |
electrochemistry
Any help with the liquids that has this property is really appreciated.
Cross posted Physics stack Exchange I won't comment on B for the moment, but liquid-liquid interface electrochemistry is quite a vibrant field. There's a review of it here, if you're interested. The simplest interaction involves ions: if one applies a potential across the interface of sufficient strength and polarity, the energy barrier of transferring a given ion from one phase to the other can be overcome. If you do this with something like a solvatochromic dye, it will change colour as it moves from one phase to the other. (It would have to be something that doesn't partition into the second phase easily on its own, of course) One could also have some reagent in one phase that reacts with the ion being pushed across the interface that produces some coloured product. (iodide-starch, perhaps?) There are also voltage-sensitive dyes, though I don't have any experience with them. | {
"domain": "chemistry.stackexchange",
"id": 2206,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrochemistry",
"url": null
} |
moment-of-inertia
Is that all or is there more to it, perhaps related to properties of tensors in general? The moment-of-inertia (MOI) tensor is real (no imaginary terms), symmetric, and positive-definite. Linear algebra tells us that for any (3x3) matrix that has those three properties, there's always a set of three perpendicular axes such that the MOI tensor can be expressed as a diagonal tensor in the basis of those axes. These are called the principal axes (or eigenvectors) of rotation, and the physical meaning behind them is that if you rotate the object around one of those axes, the angular momentum will lie along the axis. So one important thing to realize is that there is nothing fundamentally meaningful about off-diagonal elements; you can always rotate your coordinates to get rid of them. If the object has a symmetry axis, then that will be a principal axis. (Though, having a principal axis does not imply any symmetry of the object.) | {
"domain": "physics.stackexchange",
"id": 10211,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "moment-of-inertia",
"url": null
} |
classical-mechanics, energy, energy-conservation, work
Actually, we say there is no change in kinetic energy because the net work done is zero in bringing the charges together. To bring like charges closer together positive work must be done by an external agent while an equal amount of negative work is done by the electrostatic field which takes the energy transferred to the charges by the external agent and stores it as electrostatic potential energy of the system of charge. It doesn't matter if the process is quasi-static as long as the difference between the initial and final kinetic energy is zero. | {
"domain": "physics.stackexchange",
"id": 95074,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classical-mechanics, energy, energy-conservation, work",
"url": null
} |
general-relativity, gravity
Title: Is this cosmological scenario possible? Is it possible that the universe is infinitely large and contains an infinite amount of mass that is distributed in such a way that gravitational force is never infinite? If so, is it possible that the infinite amount of mass that is outside of our light cone could affect us with gravitational force? Is it possible that the universe is infinitely large and contains an infinite amount of mass that is distributed in such a way that gravitational force is never infinite? | {
"domain": "physics.stackexchange",
"id": 19254,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, gravity",
"url": null
} |
programming-challenge, lisp, common-lisp
Title: Sum of all multiples of 3 or 5 below 1000 (Project Euler #1 - typical) I'm learning LISP and am starting with Project Euler. I would love some initial feedback on my LISP code for this simple task.
I know it spits out the correct answer, but what I'm not sure about is if I'm using LISP the way it is intended (and the way to strive for in the future in order to achieve success with LISP).
(defun sum (L)
"sum a list"
(apply '+ L)
)
(defun range (max &key (min 0) (step 1))
"range of numbers from min to max by jumps of step"
(loop for n from min below max by step
collect n)
) | {
"domain": "codereview.stackexchange",
"id": 23434,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "programming-challenge, lisp, common-lisp",
"url": null
} |
python, calculator, tkinter
self.add_button(root, '0', 4, 0, self.new_character, '0')
self.add_button(root, '1', 3, 0, self.new_character, '1')
self.add_button(root, '2', 3, 1, self.new_character, '2')
self.add_button(root, '3', 3, 2, self.new_character, '3')
self.add_button(root, '4', 2, 0, self.new_character, '4')
self.add_button(root, '5', 2, 1, self.new_character, '5')
self.add_button(root, '6', 2, 2, self.new_character, '6')
self.add_button(root, '7', 1, 0, self.new_character, '7')
self.add_button(root, '8', 1, 1, self.new_character, '8')
self.add_button(root, '9', 1, 2, self.new_character, '9')
self.add_button(root, '.', 4, 1, self.new_character, '.')
self.add_button(root, '+', 4, 3, self.new_operation, add)
self.add_button(root, '-', 3, 3, self.new_operation, sub)
self.add_button(root, '*', 2, 3, self.new_operation, mul)
self.add_button(root, '/', 1, 3, self.new_operation, truediv) | {
"domain": "codereview.stackexchange",
"id": 45012,
"lm_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, calculator, tkinter",
"url": null
} |
go, aws-cdk
import (
"testing"
"your.module/path/to/foo" // import the package you're testing
"your.module/path/to/foo/mocks" // import generated mocks
"github.com/golang/mock/gomock" // mock stuff
)
type testFoo struct {
*foo.Repo
ctrl *gomock.Controller
db *mocks.MockDatabase // mocked dependency
}
func getRepo(t *testing.T) testFoo {
t.Helper()
ctrl := gomock.NewController(t)
db := mocks.NewMockDatabase(ctrl)
return testFoo{
Repo: foo.New(db), // inject mock
ctrl: ctrl,
db: db,
}
} | {
"domain": "codereview.stackexchange",
"id": 43821,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "go, aws-cdk",
"url": null
} |
physical-chemistry, electronic-configuration, orbitals
Title: Electronic configuration of excited states of iron The electron configuration of the ground state of $\ce{Fe}$ is $\mathrm{1s^2 2s^2 2p^6 3s^2 3p^6 4s^2 3d^6}$. What are the configurations of its first and third excited states? The first excited states seems to be $\mathrm{[Ar]4s^1 3d^7}$, but isn't the angular momentum not conserved because $l=0$ for $\mathrm{s}$ and $l=2$ for $\mathrm{d}$? The electronic configurations of the excited states of neutral iron are listed on this NIST Database page:
3d64s2 — a 5D — ground state
3d7(4F)4s1 — a 5F — 6928.268 cm–1
3d7(4F)4s1 — a 3F — 11976.238 cm–1
3d7(4P)4s1 — a 5P — 17550.180 cm–1
3d64s2 — a 3P — 18378.185 cm–1
3d6(5D)4s14p1(3P) — z 7D0 — 19350.892 cm–1
The reference give for this data is: G. Nave, S. Johansson, R. C. M. Learner, A. P. Thorne, and J. W. Brault, Astrophys. J. Suppl. Ser. 94, 221 (1994). | {
"domain": "chemistry.stackexchange",
"id": 6152,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "physical-chemistry, electronic-configuration, orbitals",
"url": null
} |
javascript, ajax, comparative-review, databinding
Make an ajax call whenever the country dropdown selection is made, then pass the country name/id as parameter and get a response object that contains the list of states that I want to display, and bind them to my view.
In my JS:
$.ajax({
type: "POST",
url: Home/GetStates,
data: $('select[name="country"] option:selected').val(),
error: function (xhr, status, error) {
},
success: successFunction
});
function successFunction(data) {
stateSelection(data) //data contains the list of states
} | {
"domain": "codereview.stackexchange",
"id": 15926,
"lm_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, ajax, comparative-review, databinding",
"url": null
} |
how many numbers to add and then the user will enter n numbers. I need to check an array of random integers (between 1 and 9) and see if any combination of them will add up to 10. A corner element is an element from the start of the array or from the end of the array. Once the type of a variable is declared, it can only store a value belonging to this particular type. Create a max heap i. Given an array, you have to find the max possible two equal sum, you can exclude elements. Question E3: WAP to find out the row sum and column sum of a two dimensional array of integers. Whenever possible, make sure that you are using the NumPy version of these aggregates when operating on NumPy arrays!. Write a program to find those pair of elements that has the maximum and minimum difference among all element pairs. Input size and elements in array, store in some variable say n and arr[n]. Here is the complete Java program with sample outputs. Algorithms in Java Assignment: Maximum Sum (in 2 | {
"domain": "lampedusasiamonoi.it",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.97594644290792,
"lm_q1q2_score": 0.8963875270376713,
"lm_q2_score": 0.9184802440252811,
"openwebmath_perplexity": 681.2426012969111,
"openwebmath_score": 0.3012574017047882,
"tags": null,
"url": "http://lampedusasiamonoi.it/yvgr/max-sum-of-2-arrays.html"
} |
java, object-oriented, android, error-handling, classes
MainActivity.java implementation:
package com.example.userregistrationapp;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.os.Bundle;
import android.text.InputType;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import java.security.NoSuchAlgorithmException;
import java.util.Calendar;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final EditText nameEditText = findViewById(R.id.editText_name);
clickAndClear(nameEditText);
final EditText personalIDEditText = findViewById(R.id.editTextID);
clickAndClear(personalIDEditText); | {
"domain": "codereview.stackexchange",
"id": 41417,
"lm_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, object-oriented, android, error-handling, classes",
"url": null
} |
species-identification, zoology, entomology
Photinus are a group of North American fireflies, so not likely your species.
According to firefly.org, the subfamily Luciolinae is found throughout Eurasia, while the genus Lampyris is a "wastebin taxon" used as a "catch all" for misfit fireflies that is found throughout the world. So I'd start looking in those groups.
I'll dig around for a more Palestinian-oriented bug guide. Again, this is not meant to be an exact answer but just a starting point for you or another user who might have access to Palestinian resources. I'll update if I find something definitive. | {
"domain": "biology.stackexchange",
"id": 9661,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "species-identification, zoology, entomology",
"url": null
} |
fourier-transform, algorithms, stft
% add each one of the windows to each other, progressively shifting the
% sequence forward
cc = 1;
for i = 1:mm
uu(cc:cc+wSize-1) = us(:,i) + uu(cc:cc+wSize-1)';
cc = cc + 1;
end
% trim the beginning and end of uu
% NOTE that this could probably be done in a more efficient manner
% but it is easiest to do here
% Divide by the sum of the window
% see Equation 4.4 of paper by Allen and Rabiner (1977)
% We don't need to divide by L, the FFT transform size since
% Matlab has already taken care of it
uu2 = uu(hN+1:end-hN) ./ (wt_sum);
figure;
plot(uu2)
% Compare the differences bewteen the original and the reconstructed
% signals. There will be some small difference due to round-off error
% since floating point numbers are not exact
dd = u - uu2';
figure;
plot(dd); The STFT transform pair can be characterized by 4 different parameters:
FFT size (N)
Step size (M)
Analysis window (size N)
Synthesis window (size N)
The process is as follows: | {
"domain": "dsp.stackexchange",
"id": 8057,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fourier-transform, algorithms, stft",
"url": null
} |
reference-request, denotational-semantics, domain-theory
But, I feel that my understanding is still quite uninformed and shallow.
My questions: Why prefer flat domains? Why prefer non-flat domains? What are examples of things (theoretical or practical) that can be done in one setting but not, or not yet, in the other? Is there a reference with an account on such a comparison? | {
"domain": "cstheory.stackexchange",
"id": 2947,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reference-request, denotational-semantics, domain-theory",
"url": null
} |
organic-chemistry, stability, resonance, carbocation
Title: Stability Comparison between the Tropylium and Tricyclopropylcarbinyl Carbocation Why is the Tropylium carbocation less stable than the tricyclopropylcarbinyl carbocation? The tricyclopropylcarbinyl carbocation undergoes a sigma-tropic rearrangement whereas tropylium is highly stable due to conjugated system, that being, it is resonance stabilized and the number of canonical forms of tropylium is more. Then, why is it less stable? It seems likely that the tricyclopropylcarbinyl carbocation would be more stable than the tropylium carbocation for the reasons I'll outline below, but if you have a reference proving this point, it would be nice to add it to your question.
Background | {
"domain": "chemistry.stackexchange",
"id": 6217,
"lm_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, stability, resonance, carbocation",
"url": null
} |
applied-mechanics, simulation, ansys
If you're expecting large deflections then you can turn ON "Large Deflection" in Analysis Settings $\rightarrow$ Solver Controls $\rightarrow$ Large Deflection. That might help it converge.
If you're wondering whether you could do this without moving the roller closer to the ring then you could probably play around with the Pinball Radius as well as another option called "Predict For Impact" in the Time Step Controls. I've never used this personally and I'm not sure what effect that would have.
If you have the time, read the best practices for contact modelling. | {
"domain": "engineering.stackexchange",
"id": 404,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "applied-mechanics, simulation, ansys",
"url": null
} |
python, object-oriented, mathematics
# Handles case where polynomial is constant
if isLeadingTerm and isConstTerm: return str(coeffs[0])
c = float(coeffs[term])
# Handles formatting the highest order term's coefficient
if c == 1:
leadingstr = ''
elif c == -1:
leadingstr = '-'
else:
leadingstr = f'{c:.03}'
# Formats coefficient accordingly; superscripts degree unless it's the linear term
coeff = leadingstr if isLeadingTerm else formatcoeff(term, coeffs)
degree = f'{superscript(len(coeffs) - 1 - term)}'
formattedterm = f'{coeff}x' + degree * (degree != '¹')
polyformat = formatcoeff(term, coeffs) if (isConstTerm or c == 0) else formattedterm
return polyformat
def formatcoeff(term, coeffs):
"""Transforms coefficient into appropriate str"""
c = float(coeffs[term])
isConstTerm = (term == len(coeffs) - 1)
isUnitary = (abs(c) == 1) # checks if c = 1 or -1
coeff = '' if (isUnitary and not isConstTerm) else abs(c) | {
"domain": "codereview.stackexchange",
"id": 28263,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, object-oriented, mathematics",
"url": null
} |
ruby, coffeescript, haml
= select("text", "category_id", Category.all.collect { |c| [t(c.locale_key.to_sym), c.id]}, {include_blank: t(:select_cat)})
%li.drop_down_menu#menu_lingua.text-center
= select("text", "language_id", Language.all.collect { |l| [l.name, l.id] }, {include_blank: t(:select_lan)})
%li
%button#publish= t(:publish)
%li.drop_down_menu#menu_salvar.text-center
= link_to t(:save_draft), @text, class: 'btn'
- elsif (!current_page?(new_text_url) && !current_page?(edit_text_url(@text))) && (!@current_user.nil? && @current_user.id == @text.user_id)
%li
= link_to '', edit_text_path(@text), class: 'btn icon-editor edit-icon'
%li
= link_to '', text_path(@text), method: :delete , data: {confirm: t(:exclusion_confirm)},class: 'btn icon-editor delete-icon' | {
"domain": "codereview.stackexchange",
"id": 12316,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ruby, coffeescript, haml",
"url": null
} |
physical-chemistry, gas-laws
Title: Find ratio of quantities of water and of argon in airtight container I am working on my EJU exam past papers (2013) and got stuck at this question. Knowledge of high school or first year university chemistry is assumed. I honestly do not know where I should start.
When argon and water were placed in an airtight container with a
constant volume and the gas mixture was kept at 373 K, the pressure of
the gas mixture became P1 with a portion of water remained as liquid.
When the whole was heated to 403 K, all the water was vaporized and
the pressure became P2. From (1) to (6) below choose the correct
formula representing the ratio, water/argon, of the quantities (in
mol) of water and of argon in the container. Assume that the vapor
pressure of water at 373 K is Pv, that argon is an ideal gas not
dissolving in water, and that the volume of water before heating to
403 K can be neglected. | {
"domain": "chemistry.stackexchange",
"id": 12004,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "physical-chemistry, gas-laws",
"url": null
} |
conformers, cyclohexane
The difference in the number of gauche interactions - namely, two - between these epimers is approximated by the difference in their heats of combustion[1] which is $\pu{1.54 kcal/mol}$. [1,2 cis: $\Delta H^\circ_\mathrm{comb} = \pu{-1248.31 kcal/mol}$; 1,2 trans: $\Delta H^\circ_\mathrm{comb} = \pu{-1246.77 kcal/mol}$.] A typical value for a gauche interaction is $\pu{0.9 kcal/mol/interaction}$.
References:
Walter H. Johnson, Edward Prosen, and Frederick D. Rossini, Heats of Combustion and Isomerization of the Eight $\ce{C8H16}$ Alkylcyclohexanes. Research Paper RP1S12, Volume 39, July 1947. PDF via NIST | {
"domain": "chemistry.stackexchange",
"id": 13995,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "conformers, cyclohexane",
"url": null
} |
Maximize 100 G + 125 H
Subject to:
$$3 G + 6 H <= 30$$
$$8 G + 4 H <= 44$$
$$G,H >= 0$$
where G and H are the number of units of products to be produced, respectively.
Scipy Linear Programming
The following code shows how to use linear programming to solve this problem in scipy.optimize with the linprog function. The linear programming problem is placed into the following matrix form:
\begin{align}\mathrm{minimize} \quad & c\,x \\ \mathrm{subject\;to}\quad & A \, x=b \\ & A_{ub} \, x<b_{ub} \end{align}
with:
$$x = [G,H]$$
$$c = [-4,-6]$$
$$A_{ub} = \begin{bmatrix}2 & 3\\ 1 & 1\end{bmatrix} \quad b_{ub}=[100,80]$$
from scipy.optimize import linprog
c = [-100, -125]
A = [[3, 6], [8, 4]]
b = [30, 44]
bound = (0, None)
res = linprog(c, A_ub=A, b_ub=b, bounds=[bound, bound], method='highs')
#print solution
print(f'Optimal solution: G = {res.x[0]:.2f}, H = {res.x[1]:.2f}')
✅ Activity: Solve LP Problem | {
"domain": "apmonitor.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.977022630759019,
"lm_q1q2_score": 0.8032973872840264,
"lm_q2_score": 0.8221891305219504,
"openwebmath_perplexity": 6746.7436361243235,
"openwebmath_score": 0.9750073552131653,
"tags": null,
"url": "http://apmonitor.com/me575/index.php/Main/PythonOptimization"
} |
general-relativity, special-relativity, differential-geometry, tensor-calculus, differentiation
If you're only concerned with special relativity, then the covariant derivative reduces to the partial derivative and the metric to the Minkowski metric $g_{\mu \nu} = \eta_{\mu \nu}$ (whose partial derivative also vanishes). | {
"domain": "physics.stackexchange",
"id": 76389,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, special-relativity, differential-geometry, tensor-calculus, differentiation",
"url": null
} |
power-spectral-density
Title: how to improve the noise estimation in PSD for non-coherent sampled data? I am testing an ADC and the signal generator's frequency cannot be programmed to be exact so I am always doing non-coherent sampling (the noise/phase noise is ok, but low in precision). When there is non-coherent sampling, the noise estimation is off a lot with window.
To model this problem , assume an analog signal is sampled by fs, fin = (k+fdelta)/n*fs, where k is an positive integer, fdelta is a value between 0 to 1, n is 2^x and x is a positive integer, as fdelta changes, the estimation of the signal stays pretty accurate but the noise goes off by a lot, like:
Here is this experiment matlab script, where the "goodness of noise estimation" and "goodness of signal estimation" is defined. coswin function is from here . Not sure if I am doing it correctly (maybe I am using the wrong window?)
clear;
format long | {
"domain": "dsp.stackexchange",
"id": 10922,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "power-spectral-density",
"url": null
} |
special-relativity, spacetime, time, time-dilation
$$ \Delta s^2 = -c^2\Delta t^2 + \Delta x^2 \tag{2} $$
The key assumption we need is that all observers, no matter how they are moving, will calculate the same value for the line element $\Delta s$.
To illustrate how this works I'll do a calculation like yours but I'll replace the moving ball with a clock that ticks every $t$ seconds. Let's say I'm on the train holding the clock while you're watching from the ground. We'll take the train to be moving at a speed $v$. As I pass you I start the clock, so we both measure the first tick to be at the point $(t = 0, x = 0)$.
Consider first my point of view. For me the clock isn't moving so its position doesn't change and $\Delta x = 0$. The tick arrives after a time $t$ so $\Delta t = t$. That means when I feed these into equation (2) I calculate the line element to be:
$$ \Delta s_\text{me}^2 = -c^2t^2 \tag{3} $$ | {
"domain": "physics.stackexchange",
"id": 26462,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "special-relativity, spacetime, time, time-dilation",
"url": null
} |
provided arguments to find the value that falls arithmetically in the middle of the group. 01. Next Page . and we find that at location Program for Mean and median of an unsorted array. kasandbox. C program for swapping of two numbers 14. To median we need to sort the list in ascending or descending order. It was invented by C. Yes, we just have filtered 1D signal by median filter! Let us make resume and write down step-by-step instructions for processing by median filter. If there is an even number of numbers, the median is the average of the two numbers in the middle. I have to find the number of modes. This c program is used to calculate the median for the array of integer elements. C - Programs (Sequence) Middle number among three 11. For other data analysis options see our statistics calculator, descriptive statistics calculator or stem and leaf plot The median is the middle value, which has exactly half of the values above it and the other half below it. Find Median in an | {
"domain": "kameographics.com",
"id": null,
"lm_label": "1. Yes\n2. Yes\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9643214491222695,
"lm_q1q2_score": 0.8810778679539769,
"lm_q2_score": 0.9136765222384493,
"openwebmath_perplexity": 660.3949772343873,
"openwebmath_score": 0.18880972266197205,
"tags": null,
"url": "http://kameographics.com/dv6fo2t/c-program-to-find-median.php"
} |
physical-chemistry, quantum-chemistry, spectroscopy
We assume that the Born-Oppenheimer condition applies, briefly that electrons being far lighter than nuclei instantaneously adjust to the slow nuclear motion as a molecule vibrates. This allows us to draw the potential energy profile, for example a Harmonic or Morse potential. When we draw the familiar wavefunctions for vibrational motion these are the nuclear wavefunctions at each energy and are the stationary solutions to the Schroedinger equation and we interpret these as meaning that the molecule has a probability of being at each position given by the square of the wavefunction.
In a long time spectroscopic experiment (e.g. using a spectrophotometer) only the spectrum is measured, i.e. energy gaps between levels. | {
"domain": "chemistry.stackexchange",
"id": 10529,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "physical-chemistry, quantum-chemistry, spectroscopy",
"url": null
} |
linux, sh, installer
# Install the grub bootloader
echo -- Install the grub bootloader
echo "
GRUB_PRELOAD_MODULES=\"\$GRUB_PRELOAD_MODULES lvm\"
" >> /etc/default/grub
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
sleep 2
# done
echo -- done
exit
' | arch-chroot /mnt
# Manually remove any other boot media and reboot system
echo -- Manually remove any other boot media and reboot system Some notes: | {
"domain": "codereview.stackexchange",
"id": 30514,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "linux, sh, installer",
"url": null
} |
special-relativity, time-dilation, length-contraction
Q2: Does Q see S's clocks as moving slower or faster?
Every observer sees the clocks of a moving observer running slow. So $S$ sees $Q$'s clocks running slow by a factor of $\gamma$, but $Q$ sees $S$'s clocks running slow by the same factor of $\gamma$. This is the origin of the famous twin paradox.
Q3: Does Q see P's clocks as moving at $\gamma_p$ or at $\gamma_q/\gamma_p$?
Neither.
If you take equation (1) and feed in $v_p = 0.25c$ and $v_q = 0.5c$ you get the velocity of $P$ in $Q$'s frame as:
$$ v'_p \approx 0.286 c $$
If you work out the corresponding value of $\gamma$ you get:
$$ \gamma'_p \approx 0.958 $$
Q4: How fast are S and Q moving?
In Q1 we worked out that $Q$ sees $P$ moving at about $0.286c$, so $P$ sees $Q$ moving at $0.286c$.
Likewise $P$ sees $S$ moving at $0.25c$.
Q5: Does P see a difference in S and Q's clocks?
Yes, because in $P$'s frame $S$ and $Q$ are moving at different speeds. | {
"domain": "physics.stackexchange",
"id": 15366,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "special-relativity, time-dilation, length-contraction",
"url": null
} |
waves, acoustics, string
$$v^2 \frac{\partial^2 y}{\partial x^2} = \frac{\partial^2 y}{\partial t^2}.$$
The left-hand side is from the tension in the string acting as a restoring force.
The solutions are of the form $\sin(kx - \omega t)$, where $\omega = kv$. Applying fixed boundary conditions, the allowed values of the wavenumber $k$ are integer multiples of the lowest possible wavenumber, which implies that the allowed frequencies are integer multiplies of the fundamental frequency. This predicts evenly spaced harmonics.
However, piano strings are made of thick wire. If you bend a thick wire, there's an extra restoring force in addition to the wire's tension, because the inside of the bend is compressed while the outside is stretched. One can show that this modifies the wave equation to
$$v^2 \frac{\partial^2 y}{\partial x^2} - A \frac{\partial^4 y}{\partial x^4} = \frac{\partial^2 y}{\partial t^2}.$$
Upon taking a Fourier transform, we have the nonlinear dispersion relation | {
"domain": "physics.stackexchange",
"id": 95380,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "waves, acoustics, string",
"url": null
} |
quantum-mechanics, quantum-field-theory, symmetry, quantum-electrodynamics, lorentz-symmetry
One more piece of background knowledge that will be super important: Remember that scalars have 1 component, and vectors have 3. We figured out how to infinitesimally transform vectors by coming up with an appropriate basis of 3x3 matrices that, when applied onto a vector, infinitesimally rotate that vector. What if we wanted to do something similar for, say, 5- component vectors? As it turns out, we will need to come up with a basis of 3 5x5 matrices that satisfy the aforementioned commutation relations. This tells us how 5-component objects ought to transform under the rotation group SO(3). | {
"domain": "physics.stackexchange",
"id": 65706,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-field-theory, symmetry, quantum-electrodynamics, lorentz-symmetry",
"url": null
} |
ros
Title: Connecting ROS and the Amazon Echo
Hi everyone,
I'd like to be able to tell my Amazon Echo the name of a location in my apartment as a goal for my robot to go to.
How would you recommend I proceed, knowing that the Alexa skill will run as an Amazon Lambda function?
Precisely, how to connect my computer running ROS with the Amazon Lambda function, any idea? (Robotics is a hobby for me, I'm not a CS magician, my robot is running ROS Indigo and the navigation stack)
Thanks for the help!
Olivier
Originally posted by OlivierL on ROS Answers with karma: 1 on 2016-02-02
Post score: 0
You might find this useful
The accompanying demo is here
Originally posted by tradeA with karma: 36 on 2017-01-10
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 23630,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros",
"url": null
} |
quantum-mechanics, condensed-matter, topological-insulators
Compute all eigenvalues of $VU{V^\dagger}{U^\dagger}$, take the log of all of these, now sum them up. The real part of this complex number will be the Chern number (or minus the Chern number).
Be sure to repeat this with a larger system size, to get some evidence you are avoiding the effects of small system size. As to why, and when, the Bott index equals the Chern number, you can look here: "On the equivalence of the Bott index and the Chern number on a torus, and the quantization of the Hall conductivity with a real space Kubo formula" by
Toniolo, Arxiv:1708.05912.
A recent decription of the Bott invariant is here: "Topological Photonic Quasicrystals: Fractal Topological Spectrum and Protected Transport" by Bandres, Rechtsman, and Segev, Phys. Rev. X, 6(2), 011016, 2016. Sample code implementing this in Matlab is here: http://digitalrepository.unm.edu/math-statsdata/5/ | {
"domain": "physics.stackexchange",
"id": 46737,
"lm_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, topological-insulators",
"url": null
} |
homework-and-exercises, newtonian-mechanics, reference-frames, integration, linear-systems
The $\Delta x$ or $\text dx$ is instead used to determine the location of each mass element. You can't just switch the integration variable without realizing this. This is why you need to specify some linear mass density function $\lambda(x)=\frac{\text dm}{\text dx}$ that can be used to indicate how much mass is located at each position as you do the integral over space. i.e. for the mass element at position $x$, $\lambda(x)\text dx=\text dm$ amount of mass is present, so then $x\,\text dm=x\lambda (x)\,\text dx\neq m\,\text dx$
In the discrete example with the uniform rod, $\lambda=M/X=Nm/X=m/\Delta x$. So to come full circle our sum of interest would have been
$$\sum_{i=1}^Nx_i\lambda\Delta x$$
And so there is your full analogy
$$\sum_{i=1}^Nx_im=\sum_{i=1}^Nx_i\lambda\Delta x$$
$$\int x\,\text dm=\int x\lambda\,\text dx$$ | {
"domain": "physics.stackexchange",
"id": 65783,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-mechanics, reference-frames, integration, linear-systems",
"url": null
} |
python, design-patterns, recursion, backtracking, visitor-pattern
Returns: None
"""
visitor.visit_row(self)
class Puzzle:
def __init__(self, width, cells, cages):
"""
Models a kenken puzzle
See https://en.wikipedia.org/wiki/KenKen
for more information
Args:
width: puzzle size
cells: `Cell` objects comprising this puzzle
cages: `Cage` objects a solution for this puzzle must satisfy
"""
self.width = width
self.cells = cells
self.cages = cages
def __str__(self):
return '<Puzzle width={0}, cages={1}>'.format(
self.width, len(self.cages)
)
@property
def domain(self):
"""
Returns: bool this puzzle's possible cells values
"""
return range(1, self.width + 1)
@property
def unassigned(self):
"""
Returns: bool this puzzle's unassigned cells
"""
return (cell for cell in self.cells if cell.value is None) | {
"domain": "codereview.stackexchange",
"id": 25943,
"lm_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, design-patterns, recursion, backtracking, visitor-pattern",
"url": null
} |
The only thing that I am not certain of is whether step 1 is implied by step 2. Last night I thought there could be an example of a function and a point where the limit definition of a derivative results in an answer for that point but the function was actually discontinuous at the point, so the derivative there couldn't exist. However, I'm not able to come up with an example of this and doubt that it's possible now. If anyone could that would be interesting.
Put another way, if we have a function of one real variable, $f$, can the limit following limit exist if the point, $a$ is not in the domain of $f$?
$$\displaystyle \lim_{h \to 0} \frac{f(a + h) - f(a)}{h}$$
I think not because $f(a)$ is not defined. So that leads me to say that step 2 implies step 1.
#### Rido12 | {
"domain": "mathhelpboards.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9465966732132748,
"lm_q1q2_score": 0.8613149540995223,
"lm_q2_score": 0.9099070158103778,
"openwebmath_perplexity": 249.94956744422095,
"openwebmath_score": 0.9249218106269836,
"tags": null,
"url": "https://mathhelpboards.com/threads/understanding-limits.6134/"
} |
ros-kinetic, quaternion
Originally posted by AutoCar on ROS Answers with karma: 102 on 2018-12-10
Post score: 0
See the tutorial on calculating a relative rotation between quaternions. After you have the difference as a quaternion, you can convert it to roll/pitch/yaw. For Python, use quaternion_to_euler() for that. Finally, it's no problem to convert between tf and geometry_msg quaternions. The tutorial also has some examples of that.
Please add to the tutorial if it's not explicit enough. For example, I see that it shows how to convert tf->geometry_msgs but not the other way around.
Originally posted by AndyZe with karma: 2331 on 2018-12-10
This answer was ACCEPTED on the original site
Post score: 4 | {
"domain": "robotics.stackexchange",
"id": 32148,
"lm_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, quaternion",
"url": null
} |
organic-chemistry, reaction-mechanism, pericyclic
Title: Direction of arrows in electrocyclic reactions We recently started learning about pericyclic reactions and this is a step from a mechanism I'm working on for an assignment. I believe that the arrows on the right are better than the arrows on the left because if I throw in some charges instead of arrows, the outcome I get on the right is somewhat more "stable?" for the reasons stated on the picture. Am I correct in my assumption? | {
"domain": "chemistry.stackexchange",
"id": 6862,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, reaction-mechanism, pericyclic",
"url": null
} |
python, python-3.x, random, cryptography
if __name__ == '__main__':
message = input("Input your message: ")
key = input("Input a key: ")
finished_with_the_user = False
while not finished_with_the_user:
encrypt_question = input("Encrypt or decrypt a message?(1,0): ")
if encrypt_question.isdigit():
finished_with_the_user = True
encrypt_question = int(encrypt_question)
else:
print("Please input a valid number.")
print(Crypt(message, key, encrypt_question))
input("Press enter to exit.")
Any suggested edits and edits that I think of will be applied below.
import random
import string
def shift(current_position, distance, direction: (0, 1)):
direction = 1 if direction else -1
return current_position + direction * distance | {
"domain": "codereview.stackexchange",
"id": 15583,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x, random, cryptography",
"url": null
} |
inorganic-chemistry, redox
1: charged with positive electricity
2: having a tendency to release electrons | {
"domain": "chemistry.stackexchange",
"id": 5381,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "inorganic-chemistry, redox",
"url": null
} |
surface-chemistry
Regarding the point that "we want gases to be adsorbed", well, the point is that you want to predict behavior. The book merely arms you with guidelines that allow you to make predictions. So that, for instance, if you have a number of compounds in a gaseous mixture, you can estimate which adsorb more. Or perhaps you can use that ability to select new substances with desirable properties based on the adsorption behavior of other compounds. | {
"domain": "chemistry.stackexchange",
"id": 12822,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "surface-chemistry",
"url": null
} |
automata, finite-automata, computation-models
Title: Why do DFAs with a single final state have less power? I came across this question in a test and I had to answer whether it is true or false.
DFA with single final state has the same powers as DFA with more than one final state.
I was confused by what definition of "power" have they used. Generally, we always use power as a term to represent the class of languages a machine accepts and to me, it seems that since it is a DFA, regardless of the number of accept states, the power should be the same.
However, the question says that this is false and a DFA with more than one final state is more powerful. Is that true? I've never come across this in any textbook.
I was confused by what definition of "power" have they used. Generally, we always use power as a term to represent the class of languages a machine accepts | {
"domain": "cs.stackexchange",
"id": 12724,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "automata, finite-automata, computation-models",
"url": null
} |
functional-programming, clojure, lisp, machine-learning, neural-network
(defn activation-fn [x] (Math/tanh x))
(defn dactivation-fn [y] (- 1.0 (* y y)))
(defn get-layers
[network]
(conj (apply (partial conj [(:inputs network)]) (:hidden network)) (:outputs network)))
(defn generate-layer
[neurons next-neurons]
(let [values (vec (repeat neurons 1))
weights (vec (for [i (range neurons)] (vec (repeatedly next-neurons rand))))]
{:values values :weights weights})) | {
"domain": "codereview.stackexchange",
"id": 5551,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "functional-programming, clojure, lisp, machine-learning, neural-network",
"url": null
} |
As you can see, we end up with the same as we began with, 1.03, -4.2, 9.81, 13.
### Matrix – matrix multiplication
Multiplying a matrix with a vector was quite easy. Now let’s make things a tiny bit more difficult and multiply a matrix with a different matrix. This is one of the most important basic operations we need to do. It plays a huge role in moving/scaling/rotating objects. And, as we’ll see in a later part, it’s a very important part of lighting.
Matrix multiplication depends a bit on the sizes of the two matrices. But we’ll simplify it to say that we’ll always be working with unifrom matrixes ( 2×2, 3×3, 4×4 ). Firstly, lets look at the generic formula :
Now this seems a bit complicated, so let’s look at how to calculate just the first number : | {
"domain": "headerphile.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9893474901025369,
"lm_q1q2_score": 0.804208231718864,
"lm_q2_score": 0.8128673087708699,
"openwebmath_perplexity": 853.2340588705124,
"openwebmath_score": 0.5163815021514893,
"tags": null,
"url": "http://headerphile.com/tag/sdl/"
} |
javascript, stackexchange, ai, chat
Title: Another JavaScript Stack Exchange chat bot I've been inspired by @SirPython's SirAlfred JavaScript chat bot, so I went and made my own. This one is slightly different though, in the fact that it can accept input in a more lenient way. For example, here's a "conversation" with the bot:
sudo make me a sandwich bot
BOT: It will be done master.
sudo make me a sandwich bot
BOT: Yes sir.
Hello there bot.
BOT: Hello there.
Goodbye bot.
BOT: Goodbye. | {
"domain": "codereview.stackexchange",
"id": 14476,
"lm_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, stackexchange, ai, chat",
"url": null
} |
ros, navigation, move-base, action-server
Comment by lfr on 2016-06-23:
Ok, could you tell me what kind of problem may appear with these nodes because I still don't understand why it doesn't work.
Comment by Orhan on 2016-06-23:
It may be message type (stamped or not stamped) or publishing with wrong frame. Your screenshots are from real robot. Compare them with simulation's graph and tf tree. I think you should publish odom transformation from /mugiro_node directly. Why you using /Publish_odom_TF?
Comment by lfr on 2016-06-23:
Ah ok, thanks. But didn't write these nodes, I got the robot and these nodes from other ones. My task is to bring up the navigation stack in order to do some tests with the planner (that I have chosen). I will see about tf, I think this is the problem too. Thank you for your help.
Comment by Orhan on 2016-06-23:
You're welcome. | {
"domain": "robotics.stackexchange",
"id": 25008,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, navigation, move-base, action-server",
"url": null
} |
(Note: $a|b$, read as "$a$ divides $b$", means that $b$ is divisible by $a$.)
-
You should also prove the other direction as Dedede has done below. – user38268 Feb 1 '12 at 23:51
@BenjaminLim: Good point. Editing that in now. – El'endia Starman Feb 1 '12 at 23:53
@El'endiaStarman: You seem to have done nothing except write the OP's question as an assertion using mathematical language. A proof or justification as to why this works would be helpful. – JavaMan Feb 1 '12 at 23:59
I don't know enough math to pick the "most correct" answer. @El'endiaStarman answered first, I understood it, and it looked good to me! Dedede's has more upvotes though, so I went with that one. – Adam Monsen Feb 2 '12 at 0:02
@JavaMan: At this point, is there a reason I shouldn't just delete my answer? Dedede has already answered it perfectly. – El'endia Starman Feb 2 '12 at 0:02 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9802808753491773,
"lm_q1q2_score": 0.8014526210076196,
"lm_q2_score": 0.8175744739711883,
"openwebmath_perplexity": 330.6817285075681,
"openwebmath_score": 0.8156822919845581,
"tags": null,
"url": "http://math.stackexchange.com/questions/104758/is-divisible-by-15-the-same-as-divisible-by-5-and-divisible-by-3"
} |
performance, sql, sql-server, database
2 Prepared foods(root node )
2.1 Appetizers
2.2 Condiments
2.3 Confectionery
Note that I know the root node of any product through first char of segmentcode.
For example, root node of 1.1.1.1 Adobe bread will have segment code 1 which is Basic foods.
Groups are only applied for root nodes and to know the subproducts have to match first number of segment code.
Here is my query it do the work but the execution plan is a headache.
select * from productstbl
where substring(SegmentCode,1,1)
like ( select substring(SegmentCode,1,1)
from categoriestbl where CatID in(
select CatID from CategoriesGroupsInfo where GroupID = 1)) | {
"domain": "codereview.stackexchange",
"id": 23989,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, sql, sql-server, database",
"url": null
} |
quantum-mechanics, special-relativity, wavefunction
P.S.: The explanation I gave above is sketchy in that it does not discuss issues such as the actual interpretation (or interpretability) of a relativistic wavefunction, the unitarity (or, better, the lack thereof) of the finite-dimensional representations of the Lorentz group, etc. Again, keep in mind that a serious discussion of relativistic quantum mechanics should rest on second quantization and Quantum Field Theory. Nonetheless, your general intuition was headed in the right direction. | {
"domain": "physics.stackexchange",
"id": 72298,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, special-relativity, wavefunction",
"url": null
} |
javascript, beginner, programming-challenge, node.js, fibonacci-sequence
Revised version:
function fiblike(a, n) {
const aLen = a.length;
if (aLen === 0 || aLen >= n) {
return a;
}
const like = new Array(n);
const likeLen = like.length;
like[aLen] = 0;
for (let i = 0; i < aLen; i++) {
let ai = a[i];
like[i] = ai;
like[aLen] += ai;
}
for (let i = aLen + 1; i < likeLen; i++) {
like[i] = 2*like[i-1] - like[i-aLen-1];
}
return like;
}
Examples:
console.log(fiblike([0, 1], 16));
console.log(fiblike([0, 0, 1], 16));
console.log(fiblike([0, 0, 0, 1], 16));
console.log(fiblike([1, 2, 3], 16));
console.log(fiblike([9, 21, 1986], 16));
This benchmark uses your examples.
// benchmark
fiblike([0, 1], 16);
fiblike([0, 0, 1], 16);
fiblike([0, 0, 0, 1], 16);
fiblike([1, 2, 3], 16);
fiblike([9, 21, 1986], 16);
The original version is about 89% slower than the revised version. The revised version is about 9 times faster than the original version. | {
"domain": "codereview.stackexchange",
"id": 43225,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, beginner, programming-challenge, node.js, fibonacci-sequence",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.