qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
2,116 | I want to make a rocket 'whooooooooooooooooooosh' sound that can go on FOREVER. I have the sound I like, I just need some protips on making it loop. I've been hacking away at it in Pro Tools, and when I loop it in there, it works, but when I implement it in the game I'm working on, there's a clear loop point. Any idea ... | 2010/07/20 | [
"https://sound.stackexchange.com/questions/2116",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/14/"
] | if you are into the game industry, check the spec of the audio engine. if you are more into the post production area, check AKAI sampler or Kontakt might be useful. I have successfully use a sound of a food processor to create a sustaining rocket-interior kind of sound using an Akai sampler (S-1000) | surely the way is to seperate construction of the events
the doppler effect is most noticeable when it passes the listener,
so from launch, to close passby, to close away use Michaels awesome rocket sound
then
1. make the constant rocket engine sound
(like you have a mic gaffer-taped to the side of the rocket)
2. a... |
2,116 | I want to make a rocket 'whooooooooooooooooooosh' sound that can go on FOREVER. I have the sound I like, I just need some protips on making it loop. I've been hacking away at it in Pro Tools, and when I loop it in there, it works, but when I implement it in the game I'm working on, there's a clear loop point. Any idea ... | 2010/07/20 | [
"https://sound.stackexchange.com/questions/2116",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/14/"
] | surely the way is to seperate construction of the events
the doppler effect is most noticeable when it passes the listener,
so from launch, to close passby, to close away use Michaels awesome rocket sound
then
1. make the constant rocket engine sound
(like you have a mic gaffer-taped to the side of the rocket)
2. a... | This may sound simplistic but I'll be glad to share what I've learned from a recent game project earlier this year. Make sure you have clean heads and tails. You may be able to loop well in Pro tools because of the region you selected. But when you play the wav file completely, you may still have some audio at the star... |
2,116 | I want to make a rocket 'whooooooooooooooooooosh' sound that can go on FOREVER. I have the sound I like, I just need some protips on making it loop. I've been hacking away at it in Pro Tools, and when I loop it in there, it works, but when I implement it in the game I'm working on, there's a clear loop point. Any idea ... | 2010/07/20 | [
"https://sound.stackexchange.com/questions/2116",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/14/"
] | if you are into the game industry, check the spec of the audio engine. if you are more into the post production area, check AKAI sampler or Kontakt might be useful. I have successfully use a sound of a food processor to create a sustaining rocket-interior kind of sound using an Akai sampler (S-1000) | This may sound simplistic but I'll be glad to share what I've learned from a recent game project earlier this year. Make sure you have clean heads and tails. You may be able to loop well in Pro tools because of the region you selected. But when you play the wav file completely, you may still have some audio at the star... |
13,651 | I have recently read [Ethiopian kids hack OLPCs in 5 months with zero instruction](https://web.archive.org/web/20121223013713/http://dvice.com/archives/2012/10/ethiopian-kids.php) which claims that children who never saw a book before and didn't know how to speak English learned how to use an Android phone and hacked i... | 2012/11/14 | [
"https://skeptics.stackexchange.com/questions/13651",
"https://skeptics.stackexchange.com",
"https://skeptics.stackexchange.com/users/8106/"
] | The source [MIT Technology Review article](https://www.technologyreview.com/2012/10/29/84908/given-tablets-but-no-teachers-ethiopian-children-teach-themselves/) seems to answer your questions
>
> Earlier this year, OLPC workers dropped off closed boxes containing the tablets, taped shut, with no instruction. “I thoug... | Others, including Negroponte's own associate, have disputed the factual accuracy of his explanation.
>
> At an OLPC summit [and] in conversations with Negroponte’s collaborator Maryanne Wolf ... I heard a quite different story about this experiment. ... Children did exhibit some preliteracy skills (recognizing letter... |
2,088,770 | I've tried many different ways to pass the selected items to the multiselect list with no luck. Finally, I tried this, which I think should display all the items as selected and still nothing in the list is selected.
```
public MultiSelectList Companies { get; private set; }
Companies = MulitSelectList(subcontractRep... | 2010/01/18 | [
"https://Stackoverflow.com/questions/2088770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/239793/"
] | Discovered the issue here. The MultiSelectList must have a different name from the ListBox. Made that change and now both versions of the code work. | MultiSelectList constructor has fourth parameter - selected items. Use it:
<http://msdn.microsoft.com/en-us/library/system.web.mvc.multiselectlist.multiselectlist.aspx>
Use this code:
```
public class SelectCompanyItem
{
public string Name { get; set; }
public Guid Id { get; set; }
}
public IEnumerable<Sele... |
3,627,144 | $z^{n}=1$
to prove that
$1+z+z^{2}+z^{3}+...+z^{n-1}=0$
i think I have to start with
$1+z^{2}+z^{3}+...+z^{N}=\frac{1-z^{N+1}}{1-z}$where $N=n-1$
I don't know where to go from there | 2020/04/15 | [
"https://math.stackexchange.com/questions/3627144",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/773319/"
] | If $z^n=1$ then $1-z^n=0$. Now if $z \ne 1$, then (as you wrote)
$$
1+z^{2}+z^{3}+...+z^{n-1}=\frac{1-z^{n}}{1-z}
$$
and the RHS is zero, so the LHS is zero. | If $Z^n = 1$
$Z$ is the nth root of unity, since $(1)^{any number}$ is always $1$, Therefore $z =1$ is one of the solution
Then $Z^n-1 = 0$ is always a multiple of $Z-1$
Use long division to divide them
$\frac{Z^n-1}{Z-1}$ this gives us a polynomial with all its coefficients equal to one $(1)$
$\frac{Z^n-1}{Z-1} =... |
46,108,790 | Is there a CAD format, which allows to describe mechanical bonds between objects (axes, joints, springs, etc.) and/or motion of objects ? | 2017/09/08 | [
"https://Stackoverflow.com/questions/46108790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4990139/"
] | Bear in mind that the KMeans function is stochastic (the results may vary even if you run the function with the same inputs' values). Hence, in order to make the results reproducible, you can specify a value for the `random_state` parameter. | random\_state : int, RandomState instance or None, optional, default: None
If int, random\_state is the seed used by the random number generator; If RandomState instance, random\_state is the random number generator; If None, the random number generator is the RandomState instance used by np.random.
See: <http://sciki... |
46,108,790 | Is there a CAD format, which allows to describe mechanical bonds between objects (axes, joints, springs, etc.) and/or motion of objects ? | 2017/09/08 | [
"https://Stackoverflow.com/questions/46108790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4990139/"
] | A gotcha with the k-means alogrithm is that it is not optimal. That means, it is not sure to find the best solution, as the problem is not convex (for the optimisation).
You may be stuck into local minima, and hence the result of your algorithm depends of your initialization (of your centroids). A good practice in ord... | random\_state : int, RandomState instance or None, optional, default: None
If int, random\_state is the seed used by the random number generator; If RandomState instance, random\_state is the random number generator; If None, the random number generator is the RandomState instance used by np.random.
See: <http://sciki... |
46,108,790 | Is there a CAD format, which allows to describe mechanical bonds between objects (axes, joints, springs, etc.) and/or motion of objects ? | 2017/09/08 | [
"https://Stackoverflow.com/questions/46108790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4990139/"
] | A gotcha with the k-means alogrithm is that it is not optimal. That means, it is not sure to find the best solution, as the problem is not convex (for the optimisation).
You may be stuck into local minima, and hence the result of your algorithm depends of your initialization (of your centroids). A good practice in ord... | Bear in mind that the KMeans function is stochastic (the results may vary even if you run the function with the same inputs' values). Hence, in order to make the results reproducible, you can specify a value for the `random_state` parameter. |
46,108,790 | Is there a CAD format, which allows to describe mechanical bonds between objects (axes, joints, springs, etc.) and/or motion of objects ? | 2017/09/08 | [
"https://Stackoverflow.com/questions/46108790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4990139/"
] | Bear in mind that the KMeans function is stochastic (the results may vary even if you run the function with the same inputs' values). Hence, in order to make the results reproducible, you can specify a value for the `random_state` parameter. | Random state in Kmeans function of sklearn mainly helps to
1. Start with same random data point as centroid if you use Kmeans++ for initializing centroids.
2. Start with same K random data points as centroid if you use random initialization.
This helps when one wants to reproduce results at some later point in time. |
46,108,790 | Is there a CAD format, which allows to describe mechanical bonds between objects (axes, joints, springs, etc.) and/or motion of objects ? | 2017/09/08 | [
"https://Stackoverflow.com/questions/46108790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4990139/"
] | A gotcha with the k-means alogrithm is that it is not optimal. That means, it is not sure to find the best solution, as the problem is not convex (for the optimisation).
You may be stuck into local minima, and hence the result of your algorithm depends of your initialization (of your centroids). A good practice in ord... | Random state in Kmeans function of sklearn mainly helps to
1. Start with same random data point as centroid if you use Kmeans++ for initializing centroids.
2. Start with same K random data points as centroid if you use random initialization.
This helps when one wants to reproduce results at some later point in time. |
14,508,001 | On the PHP documentation page for arrays, the example code given is the following:
```
<?php
$array = array(
"foo" => "bar",
"bar" => "foo",
);
// as of PHP 5.4
$array = [
"foo" => "bar",
"bar" => "foo",
];
?>
```
Does that mean that the first code is invalid in PHP 5.4, or is the second code just a... | 2013/01/24 | [
"https://Stackoverflow.com/questions/14508001",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1175276/"
] | The first code is still valid. The second notation is just a shorter and more convenient alternative. | As others noted the first one is valid. The second one is shorter version.
Here are the pros and cons for second version:
>
>
> ```
> Pro
>
> Good for framework development when dealing with long parameterlists
> Other web languages have similar syntax
> Readable
>
> Contra
>
> Yet another alias
> Woul... |
66,165 | Is there any visible progress? Is it now just an academic exercise? Do you believe Perl will continue to evolve with or without Perl 6 or will soon be forgotten? | 2008/09/15 | [
"https://Stackoverflow.com/questions/66165",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9411/"
] | Perl 6 is evolving slowly but steadily. Larry Wall wrote a Parser that can parse all Perl 6 that we know of (which is basically the test suite plus a bit of other code). Rakudo, which is Perl 6 on Parrot, also performs nicely. You can track its progress in the test suite with the charts on [rakudo.de](http://rakudo.de/... | I feel like some good things may come from Perl 6 (e.g. parrot), but I'm not counting on ever doing anything with the language.
In the bioinformatics development group where I work, we're encouraging use of Python for new development where Perl would have been the language of choice in the past. Python appears to prov... |
66,165 | Is there any visible progress? Is it now just an academic exercise? Do you believe Perl will continue to evolve with or without Perl 6 or will soon be forgotten? | 2008/09/15 | [
"https://Stackoverflow.com/questions/66165",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9411/"
] | Please see the Official Perl 6 Wiki to find the latest information:
<http://www.perlfoundation.org/perl6/index.cgi?perl_6>
The latest headlines from 2 leading Perl 6 blogs are shown at the bottom of the official Perl 6 wiki home page.
There's lots of other useful information and links there.
For example, recent Per... | Slow and late. It has a terminal case of second system disease. When I was a Perl hacker (back in the day), they had been working on Perl 6 for two years. That was 6 years ago. You could build a whole operating system in that time. |
66,165 | Is there any visible progress? Is it now just an academic exercise? Do you believe Perl will continue to evolve with or without Perl 6 or will soon be forgotten? | 2008/09/15 | [
"https://Stackoverflow.com/questions/66165",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9411/"
] | Please see the Official Perl 6 Wiki to find the latest information:
<http://www.perlfoundation.org/perl6/index.cgi?perl_6>
The latest headlines from 2 leading Perl 6 blogs are shown at the bottom of the official Perl 6 wiki home page.
There's lots of other useful information and links there.
For example, recent Per... | It'll be out by Christmas. ;-) I've heard on podcasts that there there will be some kind of alpha before this Christmas. They were explicit about that but it has been a while since I heard that. |
66,165 | Is there any visible progress? Is it now just an academic exercise? Do you believe Perl will continue to evolve with or without Perl 6 or will soon be forgotten? | 2008/09/15 | [
"https://Stackoverflow.com/questions/66165",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9411/"
] | You should not forget that Perl 5 is being developed in parallel. [5.10](http://perlbuzz.com/2007/12/perl-510-now-available.html) was out not so long ago with new features and additions to the language.
Progress on Perl 6 is slow but steady, PUGS (Perl 6 over Haskell ) has been stalled for a while but Audrey might res... | Perl 6 is moving along nicely. Perl 6 is a bit unlike previous Perl's in that Perl 6 is actually a language specification not an implementation of it. The reference implementation on top of Parrot that is the main thrust of the Perl 6 project has been renamed Rakudo and is moving along nicely. The best place I've found... |
66,165 | Is there any visible progress? Is it now just an academic exercise? Do you believe Perl will continue to evolve with or without Perl 6 or will soon be forgotten? | 2008/09/15 | [
"https://Stackoverflow.com/questions/66165",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9411/"
] | There is plenty of visible progess. chromatic posts the minutes from the weekly Parrot/Perl 6 conference call to [Use.perl](http://use.perl.org) and [rakudo.org](http://rakudo.org/) each week, you can read [Jonathan Worthington's journal](http://use.perl.org/~JonathanWorthington/journal/), or [Patrick Michaud's journal... | There is now a roadmap for [parrot](https://trac.parrot.org/parrot/roadmap) at least.
There is also a website that [tracks](http://rakudo.de/) the number of tests that the [Rakudo](http://rakudo.org/) implementation passes.
[](https://i.stack.imgur.... |
66,165 | Is there any visible progress? Is it now just an academic exercise? Do you believe Perl will continue to evolve with or without Perl 6 or will soon be forgotten? | 2008/09/15 | [
"https://Stackoverflow.com/questions/66165",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9411/"
] | You should not forget that Perl 5 is being developed in parallel. [5.10](http://perlbuzz.com/2007/12/perl-510-now-available.html) was out not so long ago with new features and additions to the language.
Progress on Perl 6 is slow but steady, PUGS (Perl 6 over Haskell ) has been stalled for a while but Audrey might res... | To the comment that it didn't start until 2005... I suppose it depends on if you count Parrot as Perl6. The original team did, but we didn't get buy in from the "Perl6 Language" folks for years.
We were doing real work on Parrot in 2000-2004 and much of the VM groundwork was there. By 2002 we had continuations, co-rou... |
66,165 | Is there any visible progress? Is it now just an academic exercise? Do you believe Perl will continue to evolve with or without Perl 6 or will soon be forgotten? | 2008/09/15 | [
"https://Stackoverflow.com/questions/66165",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9411/"
] | The ability to target other languages to the parrot vm, will make it trivial to make a product using what ever languages you are comfortable with.
List of languages with recent activity, or at least tested with latest parrot (as of 2008/09/22):
*taken from [languages/LANGUAGES\_STATUS.pod](http://svn.perl.org/parrot/... | Slow and late. It has a terminal case of second system disease. When I was a Perl hacker (back in the day), they had been working on Perl 6 for two years. That was 6 years ago. You could build a whole operating system in that time. |
66,165 | Is there any visible progress? Is it now just an academic exercise? Do you believe Perl will continue to evolve with or without Perl 6 or will soon be forgotten? | 2008/09/15 | [
"https://Stackoverflow.com/questions/66165",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9411/"
] | To the comment that it didn't start until 2005... I suppose it depends on if you count Parrot as Perl6. The original team did, but we didn't get buy in from the "Perl6 Language" folks for years.
We were doing real work on Parrot in 2000-2004 and much of the VM groundwork was there. By 2002 we had continuations, co-rou... | It'll be out by Christmas. ;-) I've heard on podcasts that there there will be some kind of alpha before this Christmas. They were explicit about that but it has been a while since I heard that. |
66,165 | Is there any visible progress? Is it now just an academic exercise? Do you believe Perl will continue to evolve with or without Perl 6 or will soon be forgotten? | 2008/09/15 | [
"https://Stackoverflow.com/questions/66165",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9411/"
] | Please see the Official Perl 6 Wiki to find the latest information:
<http://www.perlfoundation.org/perl6/index.cgi?perl_6>
The latest headlines from 2 leading Perl 6 blogs are shown at the bottom of the official Perl 6 wiki home page.
There's lots of other useful information and links there.
For example, recent Per... | Perl 5 will continue to be wonderful and available even if Six never comes to fruition. Six invigorated Perl 5, and Perl 5 continues to experience many wonderful new things, such as Moose.
I think Perl 6 will be completed some day and will be good, but for now, I'm a Fiver, and I'm happy like that. |
66,165 | Is there any visible progress? Is it now just an academic exercise? Do you believe Perl will continue to evolve with or without Perl 6 or will soon be forgotten? | 2008/09/15 | [
"https://Stackoverflow.com/questions/66165",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9411/"
] | There is plenty of visible progess. chromatic posts the minutes from the weekly Parrot/Perl 6 conference call to [Use.perl](http://use.perl.org) and [rakudo.org](http://rakudo.org/) each week, you can read [Jonathan Worthington's journal](http://use.perl.org/~JonathanWorthington/journal/), or [Patrick Michaud's journal... | The ability to target other languages to the parrot vm, will make it trivial to make a product using what ever languages you are comfortable with.
List of languages with recent activity, or at least tested with latest parrot (as of 2008/09/22):
*taken from [languages/LANGUAGES\_STATUS.pod](http://svn.perl.org/parrot/... |
24,407,796 | How can I get the percentage declaration to work (`#case-left, #case-right`)..?
My goal is to align these these two elements to the left and right of the image respectively, always 50% from the top of the image.
As shown in the image below:

As far as I can tell... | 2014/06/25 | [
"https://Stackoverflow.com/questions/24407796",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2573555/"
] | * `height` specified in `%` won't work if the parent element does not have a `height` set explicitly, So you need to set height for `html` and `body`
* `float` has no effect on `absolute` positioned elements
* the selector `#case-example-cover #case-right` can simply be `#case-right` since `id` is unique in a document
... | Move the image inside the container div. Also assign the top property like below.
**HTML**
```
<div id="case-example-cover">
<div id="nav-container">
<div id="case-left"></div>
<div id="case-right"></div>
<img src="http://s7.directupload.net/images/140625/yflekqdc.jpg"/>
</div>
``... |
68,476,888 | I just had to take over a Flutter project from some devs I have no contact with ... Flutter doctor all checks out ... The error are all in pub-cache. I tried flutter clean, flutter pub get ... Here is the start of the errors ...
"Note:
>
> C:\Users\justi\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\agora\_rtc\_en... | 2021/07/21 | [
"https://Stackoverflow.com/questions/68476888",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1044446/"
] | Python uses the 'environment variable' `PYTHONPATH` to look for sources to import code from. By default, the directory you execute a python program is automatically included, but you want to include something like this when you test:
```
PYTHONPATH=$PYTHONPATH,../src python test_main.py
```
This is if you're executi... | You can put your source files in the root directory and adjust the import paths as such:
[](https://i.stack.imgur.com/JbUHr.png)
**main.py**
```
# main.py
from stackoverflow.b import triplicate
def duplicate(x):
return x * 2
```
**b.py**
```
# b.py
def tri... |
70,844,131 | ```
copy Agent1
from 's3://my-bucket/Reports/Historical Metrics Report (1).csv'
iam_role 'arn:aws:iam::my-role:role/RedshiftRoleForS3'
csv
null as '\000'
IGNOREHEADER 1;
```
I am using this (above) to pull the data from s3 to redshift table. its working fine but there is one problem as when data is pulled/copied ver... | 2022/01/25 | [
"https://Stackoverflow.com/questions/70844131",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18014482/"
] | By definition TypeScript will assume that any key you use to access this type of object is valid because you basically said it would be.
You can use `noUncheckedIndexedAccess` to force typescript to assume that there is **always** a chance the result is undefined when using any arbitrary string to index the object.
Y... | The `ActiveOrders` type you've defined reads as follows:
```js
// An ActiveOrders is a map...
type ActiveOrders = {
// with arbitrary string keys in it that correspond to map values...
[orderId: string]: {
// that must contain a `name` key whose value is a string
name: string;
// and a ... |
31,500,202 | I have a function in a context, (in a Maybe / Option) and I want to pass it a value and get back the return value, directly out of the context.
Let's take an example in Scala :
```
scala> Some((x:Int) => x * x)
res0: Some[Int => Int] = Some(<function1>)
```
Of course, I can do
```
res0.map(_(5))
```
to execute t... | 2015/07/19 | [
"https://Stackoverflow.com/questions/31500202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/921177/"
] | You could write something like `applyOrElse` using `Option.fold`.
>
> fold[B](ifEmpty: ⇒ B)(f: (A) ⇒ B): B
>
>
>
```
val squared = Some((x:Int) => x * x)
squared.fold {
// or else = ifEmpty
math.pow(5, 2).toInt
}{
// execute function
_(5)
}
```
---
Using Travis Browns recent [answer](https://stackove... | The getOrElse is most logical way to do it. In regards to copy/pasting it all over the place - you might not be dividing your logic up on the best way. Generally, you want to defer resolving your Options (or Futures/etc) in your code until the point you need to have it unwrapped. In this case, it seems more sensible th... |
31,500,202 | I have a function in a context, (in a Maybe / Option) and I want to pass it a value and get back the return value, directly out of the context.
Let's take an example in Scala :
```
scala> Some((x:Int) => x * x)
res0: Some[Int => Int] = Some(<function1>)
```
Of course, I can do
```
res0.map(_(5))
```
to execute t... | 2015/07/19 | [
"https://Stackoverflow.com/questions/31500202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/921177/"
] | You can use `andThen` to move the default from the place where you call the function to the place where you define it:
```
val foo: String => Option[Int] = s => Some(s.size)
val bar: String => Int = foo.andThen(_.getOrElse(100))
```
This only works for `Function1`, but if you want a more generic version, Scalaz prov... | The getOrElse is most logical way to do it. In regards to copy/pasting it all over the place - you might not be dividing your logic up on the best way. Generally, you want to defer resolving your Options (or Futures/etc) in your code until the point you need to have it unwrapped. In this case, it seems more sensible th... |
31,500,202 | I have a function in a context, (in a Maybe / Option) and I want to pass it a value and get back the return value, directly out of the context.
Let's take an example in Scala :
```
scala> Some((x:Int) => x * x)
res0: Some[Int => Int] = Some(<function1>)
```
Of course, I can do
```
res0.map(_(5))
```
to execute t... | 2015/07/19 | [
"https://Stackoverflow.com/questions/31500202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/921177/"
] | You can use `andThen` to move the default from the place where you call the function to the place where you define it:
```
val foo: String => Option[Int] = s => Some(s.size)
val bar: String => Int = foo.andThen(_.getOrElse(100))
```
This only works for `Function1`, but if you want a more generic version, Scalaz prov... | You could write something like `applyOrElse` using `Option.fold`.
>
> fold[B](ifEmpty: ⇒ B)(f: (A) ⇒ B): B
>
>
>
```
val squared = Some((x:Int) => x * x)
squared.fold {
// or else = ifEmpty
math.pow(5, 2).toInt
}{
// execute function
_(5)
}
```
---
Using Travis Browns recent [answer](https://stackove... |
58,208,368 | I'm finishing up my Angular application and trying to deploy it. In the past, I've always used 'ng serve' to run the app. It has, and continues, to work perfectly fine. When I use ng build --prod, my dist folder is filled with what appears to be an extremely outdated version of the application. It is missing all of the... | 2019/10/02 | [
"https://Stackoverflow.com/questions/58208368",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8267829/"
] | You can use `Object.keys` and `filter`
```js
const obj = { 'fr': '10','es': '15','us': '10','uk': '7'}
let final = Object.keys(obj).filter(key => +obj[key] === 10)
console.log(final)
```
Here `+` is used for implicit conversion to number, because in strict equality `'10'` and 10 are not same | `Object.keys(<object>)` will do the trick
BTW: Your object is invalid. You're missing some commas.
```js
const EXISTING_CONSTANT_OBJECT = {
'fr': '10',
'es': '15',
'us': '10',
'uk': '7'
//and so on for many other iso country codes and UNPREDICTABLE key names
};
const keys = Object.keys(EXISTING_CONST... |
58,208,368 | I'm finishing up my Angular application and trying to deploy it. In the past, I've always used 'ng serve' to run the app. It has, and continues, to work perfectly fine. When I use ng build --prod, my dist folder is filled with what appears to be an extremely outdated version of the application. It is missing all of the... | 2019/10/02 | [
"https://Stackoverflow.com/questions/58208368",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8267829/"
] | You can use `Object.keys` and `filter`
```js
const obj = { 'fr': '10','es': '15','us': '10','uk': '7'}
let final = Object.keys(obj).filter(key => +obj[key] === 10)
console.log(final)
```
Here `+` is used for implicit conversion to number, because in strict equality `'10'` and 10 are not same | You're on the right track with `reduce`. As mentioned with other answers, you can also use `filter` (which might actually be better).
Here is a solution using `reduce`
```js
const obj = {
'fr': '10',
'es': '15',
'us': '10',
'uk': '7'
}
let result = Object.keys(obj).reduce((acc, curr) => {
if (parse... |
58,208,368 | I'm finishing up my Angular application and trying to deploy it. In the past, I've always used 'ng serve' to run the app. It has, and continues, to work perfectly fine. When I use ng build --prod, my dist folder is filled with what appears to be an extremely outdated version of the application. It is missing all of the... | 2019/10/02 | [
"https://Stackoverflow.com/questions/58208368",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8267829/"
] | You can use `Object.keys` and `filter`
```js
const obj = { 'fr': '10','es': '15','us': '10','uk': '7'}
let final = Object.keys(obj).filter(key => +obj[key] === 10)
console.log(final)
```
Here `+` is used for implicit conversion to number, because in strict equality `'10'` and 10 are not same | Try this
```
function createArr(obj){
let arr = [];
for (let key in obj) if (obj.hasOwnProperty(key) && String(obj[key]) === '10') arr.push(key);
return arr;
}
``` |
58,208,368 | I'm finishing up my Angular application and trying to deploy it. In the past, I've always used 'ng serve' to run the app. It has, and continues, to work perfectly fine. When I use ng build --prod, my dist folder is filled with what appears to be an extremely outdated version of the application. It is missing all of the... | 2019/10/02 | [
"https://Stackoverflow.com/questions/58208368",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8267829/"
] | You can use `Object.keys` and `filter`
```js
const obj = { 'fr': '10','es': '15','us': '10','uk': '7'}
let final = Object.keys(obj).filter(key => +obj[key] === 10)
console.log(final)
```
Here `+` is used for implicit conversion to number, because in strict equality `'10'` and 10 are not same | `Object.keys()` function returns the array of values corresponding to the keys of object you feed to this function. For example:
```
let yourObject = { key1: value1, key2: value2, key3:value3}
let arr = Object.keys(yourObject)
console.log(arr) // Output: [ 'key1', 'key2', 'key3']
```
Hope this helps!! |
255,371 | In the few textbooks I'm reading on CMOS analog design, they all seem to have reference currents of \$10 \mu A\$ or similar that get mirrored, and there doesn't seem to be any discussion on how this reference value was arrived at.
Is there any science to choosing these bias current numbers? Why is it not \$1\mu A\$, o... | 2016/08/31 | [
"https://electronics.stackexchange.com/questions/255371",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/814/"
] | These are probably chipscale packages. So you're looking at the top of the actual silicon die. The bottom is processed so that there are solder balls for connection to the PCB.
If you've ever seen a silicon wafer you know that it's polished to a mirror like silvery-gray finish.
One issue you can sometimes have with C... | >
> What is on the surface of these chips and why?
>
>
>
You are seeing the silicon die of the chip itself. This isn't a new phenomena.
[](https://i.stack.imgur.com/FWasd.jpg)
*Figure 1. An Intel 1702A EPROM, one of the earliest (1971) EPROM typ... |
13,519 | My basic question is: "Do longer tautologies take longer to prove?" But obviously this is underdetermined. If you are allowed an inference rule "Tautological Implication" then any tautology has a 1 line proof.
But let's say we're working in natural deduction, is it true that longer tautologies (tautologies with more ... | 2010/12/08 | [
"https://math.stackexchange.com/questions/13519",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/172/"
] | The size of proofs is almost totally unrelated to the size of the statements they prove (in the worst case).
**Lower Bound: constant size**
The size of the smallest proof for statements of size N is constant. Just make your statements of the form "True or S". (Unless you count the input statement as part of the size,... | >
> does a shorter tautology always admit a shorter proof?
>
>
>
it seems like there should be a tautology whose statement is longer than fermats last theorem but whose shortest proof is shorter |
13,519 | My basic question is: "Do longer tautologies take longer to prove?" But obviously this is underdetermined. If you are allowed an inference rule "Tautological Implication" then any tautology has a 1 line proof.
But let's say we're working in natural deduction, is it true that longer tautologies (tautologies with more ... | 2010/12/08 | [
"https://math.stackexchange.com/questions/13519",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/172/"
] | This question is one of the main topics studied in [proof complexity](http://en.wikipedia.org/wiki/Proof_complexity). The measure you are talking about is called the number of *steps* in the proof or proof-length.
The size of a tautology is related to the number of steps of its shortest proof, but this does not mean t... | >
> does a shorter tautology always admit a shorter proof?
>
>
>
it seems like there should be a tautology whose statement is longer than fermats last theorem but whose shortest proof is shorter |
13,519 | My basic question is: "Do longer tautologies take longer to prove?" But obviously this is underdetermined. If you are allowed an inference rule "Tautological Implication" then any tautology has a 1 line proof.
But let's say we're working in natural deduction, is it true that longer tautologies (tautologies with more ... | 2010/12/08 | [
"https://math.stackexchange.com/questions/13519",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/172/"
] | The size of proofs is almost totally unrelated to the size of the statements they prove (in the worst case).
**Lower Bound: constant size**
The size of the smallest proof for statements of size N is constant. Just make your statements of the form "True or S". (Unless you count the input statement as part of the size,... | Suppose that $\phi$ is any sentence of the form $\lnot (\psi \land \lnot \psi)$. Then there is a pattern for a very short proof of $\phi$ that works for any formula $\psi$. I can't format it here, but the idea is to obtain $\bot$ from $\psi \land \lnot \psi$ in a fixed number of steps, and then apply the rule for proof... |
13,519 | My basic question is: "Do longer tautologies take longer to prove?" But obviously this is underdetermined. If you are allowed an inference rule "Tautological Implication" then any tautology has a 1 line proof.
But let's say we're working in natural deduction, is it true that longer tautologies (tautologies with more ... | 2010/12/08 | [
"https://math.stackexchange.com/questions/13519",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/172/"
] | This question is one of the main topics studied in [proof complexity](http://en.wikipedia.org/wiki/Proof_complexity). The measure you are talking about is called the number of *steps* in the proof or proof-length.
The size of a tautology is related to the number of steps of its shortest proof, but this does not mean t... | Suppose that $\phi$ is any sentence of the form $\lnot (\psi \land \lnot \psi)$. Then there is a pattern for a very short proof of $\phi$ that works for any formula $\psi$. I can't format it here, but the idea is to obtain $\bot$ from $\psi \land \lnot \psi$ in a fixed number of steps, and then apply the rule for proof... |
13,519 | My basic question is: "Do longer tautologies take longer to prove?" But obviously this is underdetermined. If you are allowed an inference rule "Tautological Implication" then any tautology has a 1 line proof.
But let's say we're working in natural deduction, is it true that longer tautologies (tautologies with more ... | 2010/12/08 | [
"https://math.stackexchange.com/questions/13519",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/172/"
] | This question is one of the main topics studied in [proof complexity](http://en.wikipedia.org/wiki/Proof_complexity). The measure you are talking about is called the number of *steps* in the proof or proof-length.
The size of a tautology is related to the number of steps of its shortest proof, but this does not mean t... | The size of proofs is almost totally unrelated to the size of the statements they prove (in the worst case).
**Lower Bound: constant size**
The size of the smallest proof for statements of size N is constant. Just make your statements of the form "True or S". (Unless you count the input statement as part of the size,... |
2,100,537 | 
I cannot understand how the n term tends to
1/3((x1)+2(x2)) | 2017/01/16 | [
"https://math.stackexchange.com/questions/2100537",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/405903/"
] | How is $x\_3$ defined? It is defined as the arithmetic mean between $x\_1$ and $x\_2$. And what is $x\_4$? $x\_4$ is the arithmetic mean of $x\_3$ and $x\_2$.
My suggestion: draw a line segment and call $x\_1$ to the left ending, $x\_2$ to the right one. $x\_3$ is right in the middle of the segment. $x\_4$ in the midd... | You may have proved that somewhere. It comes from the usual technique to solving homogeneous linear recurrence relations. You assume $x\_n=ar^n$, plug that into the recurrence, get the characteristic polynomial, here $r^2=\frac 12(r+1)$ and solve for $r$. You get two roots, here $r=1, -\frac 12$ The general solution is... |
2,100,537 | 
I cannot understand how the n term tends to
1/3((x1)+2(x2)) | 2017/01/16 | [
"https://math.stackexchange.com/questions/2100537",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/405903/"
] | How is $x\_3$ defined? It is defined as the arithmetic mean between $x\_1$ and $x\_2$. And what is $x\_4$? $x\_4$ is the arithmetic mean of $x\_3$ and $x\_2$.
My suggestion: draw a line segment and call $x\_1$ to the left ending, $x\_2$ to the right one. $x\_3$ is right in the middle of the segment. $x\_4$ in the midd... | We have $x\_1=2$ , $x\_2=5$ and $$x\_n=\frac12\left(x\_{n-1}+x\_{n-2}\right)$$
$$x\_n-x\_{n-1}=\left(\frac{-1}2\right)\left(x\_{n-1}-x\_{n-2}\right)$$
\begin{align}
x\_2-x\_1 &=\left(\frac{-1}{2}\right)^03 \\
x\_3-x\_2&=\left(\frac{-1}{2}\right)^13 \\
x\_4-x\_3&=\left(\frac{-1}{2}\right)^23\\
x\_5-x\_4&=\left(\frac{... |
2,100,537 | 
I cannot understand how the n term tends to
1/3((x1)+2(x2)) | 2017/01/16 | [
"https://math.stackexchange.com/questions/2100537",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/405903/"
] | We have $x\_1=2$ , $x\_2=5$ and $$x\_n=\frac12\left(x\_{n-1}+x\_{n-2}\right)$$
$$x\_n-x\_{n-1}=\left(\frac{-1}2\right)\left(x\_{n-1}-x\_{n-2}\right)$$
\begin{align}
x\_2-x\_1 &=\left(\frac{-1}{2}\right)^03 \\
x\_3-x\_2&=\left(\frac{-1}{2}\right)^13 \\
x\_4-x\_3&=\left(\frac{-1}{2}\right)^23\\
x\_5-x\_4&=\left(\frac{... | You may have proved that somewhere. It comes from the usual technique to solving homogeneous linear recurrence relations. You assume $x\_n=ar^n$, plug that into the recurrence, get the characteristic polynomial, here $r^2=\frac 12(r+1)$ and solve for $r$. You get two roots, here $r=1, -\frac 12$ The general solution is... |
48,579,573 | I need to install the scala interpreter (aka repl). The official website <https://scala-lang.org/download/> gives me instructions on how to install sbt. I have installed sbt, but still do not have the interpreter. What am I missing here? I am supposed to type scala followed by the Enter key.
[Edit] Someone suggested ... | 2018/02/02 | [
"https://Stackoverflow.com/questions/48579573",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/815653/"
] | I ran into the same "RFC822 payload message string or uploading message via /upload/\* URL required". The [quickstart/nodejs](https://developers.google.com/gmail/api/quickstart/nodejs) sample specifies a version of google-auth-library that caused this error. The quickstart specifies:
```
npm install google-auth-librar... | Adding to [@grabbag's](https://stackoverflow.com/a/48933804/7311767) answer, which excluded the definition for `store_token`. As the [Drive quickstart](https://developers.google.com/drive/v3/web/quickstart/nodejs) notes, that function can be defined as follows:
```js
/**
* Store token to disk be used in later program... |
346,308 | I'm going to buy AMD Radeon 6870 to replace my old nVidia 8800 GT. Which steps should I follow while replacing the graphics card? Do I need to reinstall Windows?
Computer specifications:
* ASUS M2N32-SLi Deluxe
* AMD Athlon 64 X2 6400+ @ 3.2 GHz
* 2 GB RAM
* nVidia GeForce 8800 GT
* Windows 7 32-bit
I know my proces... | 2011/10/13 | [
"https://superuser.com/questions/346308",
"https://superuser.com",
"https://superuser.com/users/92777/"
] | Well, I haven't gotten it to work... But <http://code.google.com/p/corelocationcli/>
might solve your issue....
This also seems to be a more stable package? <http://iharder.sourceforge.net/current/macosx/locateme/>
(The issue I am having with both, might be because I am trying these on Mountain Lion.... )
While not... | here you go
```
lynx -dump http://www.ip-adress.com/ip_tracer/?QRY=$1|sed -nr s/'^.*My IP address city: (.+)$/\1/p'
```
require lynx
[source](http://www.commandlinefu.com/commands/view/1205/find-geographical-location-of-an-ip-address) |
346,308 | I'm going to buy AMD Radeon 6870 to replace my old nVidia 8800 GT. Which steps should I follow while replacing the graphics card? Do I need to reinstall Windows?
Computer specifications:
* ASUS M2N32-SLi Deluxe
* AMD Athlon 64 X2 6400+ @ 3.2 GHz
* 2 GB RAM
* nVidia GeForce 8800 GT
* Windows 7 32-bit
I know my proces... | 2011/10/13 | [
"https://superuser.com/questions/346308",
"https://superuser.com",
"https://superuser.com/users/92777/"
] | I was looking for this, too, and failed to find one... So, I wrote one!
It's pretty simple at the moment, but it seems to basically work. I called it [get-location](https://github.com/lindes/get-location), and you can get it from github (follow the link, above).
For the moment, I just print out the ***second*** locat... | here you go
```
lynx -dump http://www.ip-adress.com/ip_tracer/?QRY=$1|sed -nr s/'^.*My IP address city: (.+)$/\1/p'
```
require lynx
[source](http://www.commandlinefu.com/commands/view/1205/find-geographical-location-of-an-ip-address) |
21,481,772 | I have class Request with list of Comments. Each Request can have zero, one or many Comments.
```
public class Request
{
public virtual string Id
{ get; protected set; }
public virtual DateTime Date
{ get; set; }
public virtual byte RequestStatusId
{ get; set; }
public virtual Payment Pa... | 2014/01/31 | [
"https://Stackoverflow.com/questions/21481772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3257436/"
] | How about this :
```
.OrderBy(x => x.RequestComments
.OrderByDescending(y => y.Date)
.Select(x => x.CommentText)
.FirstOrDefault()
)
```
**UPDATE :**
It seems that linq above translated to query with subquery having order by clause which is not allowed. Try th... | You could try:
```
.OrderBy(x => x.RequestComments.Select(y => y.Date).DefaultIfEmpty().Max())
``` |
91,230 | >
> Find the length of the longest substring without repeating characters
>
>
>
Any comments on my code?
```
public class LongestSubstring {
/**
* First version. O(n^2) runtime
* For each character, find the longest substring starting
* with this character and update max
* @param s
* ... | 2015/05/20 | [
"https://codereview.stackexchange.com/questions/91230",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/73254/"
] | ### Time complexity
The time complexity is not \$O(N^2)\$ as you estimated, but actually \$O(N M)\$, where n is the length of the input string and m is the number of unique characters in the input string. This makes a big difference, because in practice m is typically bounded by a constant, the size of the alphabet, w... | Naming :
--------
While it's so easy to give short naming to variable, it's just bad practice.
* String s
* char c
* int n
These are examples of what it shouldn't be. It should be replaced so you know just by reading it what the var is coming from.
Example:
`String s` could be `String inputString`.
Clear javad... |
55,643,947 | ```
imgTest.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final AlertDialog.Builder mBuilder = new AlertDialog.Builder(getApplicationContext());
... | 2019/04/12 | [
"https://Stackoverflow.com/questions/55643947",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11309810/"
] | Assuming that you know the number of lines your file has, you can use this code. Also note that it more efficient to read it as a BufferedReader and pass it to the scanner.
I have tried to keep it as simple as possible, but if you have any doubts feel free to ask.
```
public int[] readFile(String filePath)throws Exce... | try this
```
public Integer[] ReadFromFile(String fileName) {
List listInt = new LinkedList<Integer>();
try {
Scanner input = new Scanner(new File(fileName));
while (input.hasNextLine()) {
String value = input.nextLine();
listInt.add(Integer.par... |
388,218 | I'm having troubles with a for loop, similar to below:
```
for VARIABLE in alpha bravo charlie; do
$VARIABLE=`sed -n '/$VARIABLE/s///gp;' $FILE`
done
```
$FILE might contain something like
```
alpha sandy
bravo cathy
charlie barbara
```
Expected results should be...
```
echo $alpha # sandy
echo $bravo ... | 2012/02/10 | [
"https://superuser.com/questions/388218",
"https://superuser.com",
"https://superuser.com/users/14455/"
] | Solution from How-to Geek
Remove Old Drivers After Upgrading to New Hardware
<http://www.howtogeek.com/howto/windows-vista/remove-old-drivers-after-upgrading-to-new-hardware/>
Hope this help. Let us know. :) | I don't really think that is a problem to have extra drivers on your system.
I would check the event viewer to make sure that when you boot the OS is not looking for devices that do not exist (causing it to wait) if it is taking a while for your OS to boot, but other than that, there is nothing to worry about. |
19,212,126 | Can anybody tell me what is the problem in following program? I want to fit `JScrollPane` on `JtextArea` but when I add it then `JTextArea` is not visible.
```
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Area extends JFrame
{
private JTextArea ta;
private JTextField tf;
JScroll... | 2013/10/06 | [
"https://Stackoverflow.com/questions/19212126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2819964/"
] | I see several problems:
* Don't use a `null` layout; do use a real [layout](http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html).
* The default layout of `JFrame` is `BorderLayout`; the default position is `CENTER`; only one component can occupy a position at a time; the example below uses `NORTH` & `CEN... | Try this:
```
public Area()
{
super("Text Area");
tf=new JTextField();
tf.setBounds(100,350,300,30);
add(tf);
ta=new JTextArea();
jp= new JScrollPane(ta);
jp.setBounds(5, 5, 100, 100);
add(jp);
setLayout(null);
setSize(500,500);
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT... |
19,212,126 | Can anybody tell me what is the problem in following program? I want to fit `JScrollPane` on `JtextArea` but when I add it then `JTextArea` is not visible.
```
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Area extends JFrame
{
private JTextArea ta;
private JTextField tf;
JScroll... | 2013/10/06 | [
"https://Stackoverflow.com/questions/19212126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2819964/"
] | I see several problems:
* Don't use a `null` layout; do use a real [layout](http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html).
* The default layout of `JFrame` is `BorderLayout`; the default position is `CENTER`; only one component can occupy a position at a time; the example below uses `NORTH` & `CEN... | sounds like its added but its not shown because of the policy try this:
```
jp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
jp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
``` |
1,859,792 | is it at all possible to 'pre-proccess' in XSLT?
with preprocessing i mean updating the (in memory representation) of the source tree.
is this possible, or do i need to do multiple transforms for it.
use case:
we have Docbook reference manuals for out clients but for certain clients these need different 'skins' (dif... | 2009/12/07 | [
"https://Stackoverflow.com/questions/1859792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15355/"
] | Expanding on Eamon's answer...
In the case of either XSLT 1.0 or 2.0, you'd start by putting the intermediate (pre-processed) result in an <xsl:variable> element, declared either globally (top-level) or locally (inside a template).
```
<xsl:variable name="intermediate-result">
<!-- code to create pre-processed resu... | This is not possible with standards compliant XSLT 1.0. It is possible in every actual implementation I've used, however. The extensions with which to do that differ by engine, however. It is also possible in standard XSLT 2.0 (which is in any case much easier to work with - so if you can, just use that).
If your xslt... |
1,859,792 | is it at all possible to 'pre-proccess' in XSLT?
with preprocessing i mean updating the (in memory representation) of the source tree.
is this possible, or do i need to do multiple transforms for it.
use case:
we have Docbook reference manuals for out clients but for certain clients these need different 'skins' (dif... | 2009/12/07 | [
"https://Stackoverflow.com/questions/1859792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15355/"
] | This is not possible with standards compliant XSLT 1.0. It is possible in every actual implementation I've used, however. The extensions with which to do that differ by engine, however. It is also possible in standard XSLT 2.0 (which is in any case much easier to work with - so if you can, just use that).
If your xslt... | Maybe you should use XSLT "OOP" methods here. Put all the common templates to all clients in a stylesheet, and create an stylesheet for each client with specific templates overriding common ones. Import the common stylesheet within the specific ones with xsl:import, and you'll do only one processing by calling the styl... |
1,859,792 | is it at all possible to 'pre-proccess' in XSLT?
with preprocessing i mean updating the (in memory representation) of the source tree.
is this possible, or do i need to do multiple transforms for it.
use case:
we have Docbook reference manuals for out clients but for certain clients these need different 'skins' (dif... | 2009/12/07 | [
"https://Stackoverflow.com/questions/1859792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15355/"
] | Expanding on Eamon's answer...
In the case of either XSLT 1.0 or 2.0, you'd start by putting the intermediate (pre-processed) result in an <xsl:variable> element, declared either globally (top-level) or locally (inside a template).
```
<xsl:variable name="intermediate-result">
<!-- code to create pre-processed resu... | Since you are trying to generate slightly different output from the same DocBook XML source, you might want to look into the "profiling" (conditional markup) support in DocBook XSL stylesheets. See [Chapter 26](http://www.sagehill.net/docbookxsl/Profiling.html) in [*DocBook XSL: The Complete Guide*](http://www.sagehill... |
1,859,792 | is it at all possible to 'pre-proccess' in XSLT?
with preprocessing i mean updating the (in memory representation) of the source tree.
is this possible, or do i need to do multiple transforms for it.
use case:
we have Docbook reference manuals for out clients but for certain clients these need different 'skins' (dif... | 2009/12/07 | [
"https://Stackoverflow.com/questions/1859792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15355/"
] | Expanding on Eamon's answer...
In the case of either XSLT 1.0 or 2.0, you'd start by putting the intermediate (pre-processed) result in an <xsl:variable> element, declared either globally (top-level) or locally (inside a template).
```
<xsl:variable name="intermediate-result">
<!-- code to create pre-processed resu... | Maybe you should use XSLT "OOP" methods here. Put all the common templates to all clients in a stylesheet, and create an stylesheet for each client with specific templates overriding common ones. Import the common stylesheet within the specific ones with xsl:import, and you'll do only one processing by calling the styl... |
1,859,792 | is it at all possible to 'pre-proccess' in XSLT?
with preprocessing i mean updating the (in memory representation) of the source tree.
is this possible, or do i need to do multiple transforms for it.
use case:
we have Docbook reference manuals for out clients but for certain clients these need different 'skins' (dif... | 2009/12/07 | [
"https://Stackoverflow.com/questions/1859792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15355/"
] | Since you are trying to generate slightly different output from the same DocBook XML source, you might want to look into the "profiling" (conditional markup) support in DocBook XSL stylesheets. See [Chapter 26](http://www.sagehill.net/docbookxsl/Profiling.html) in [*DocBook XSL: The Complete Guide*](http://www.sagehill... | Maybe you should use XSLT "OOP" methods here. Put all the common templates to all clients in a stylesheet, and create an stylesheet for each client with specific templates overriding common ones. Import the common stylesheet within the specific ones with xsl:import, and you'll do only one processing by calling the styl... |
540,399 | The Stern-Gerlach experiment used a source of silver atoms. Can you explain what moved the silver atoms from the oven to the screen where their impact was visualised? I am not asking for the deviation in trajectory caused by the magnet but simply why the atoms moved toward the screen. | 2020/03/30 | [
"https://physics.stackexchange.com/questions/540399",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/26275/"
] | You place silver in a closed oven and heat it until the silver evaporates. You now have a box of silver atoms going around in all directions. You open a small hole in the oven and point it towards your experiment. Now only silver atoms going in that direction can escape the oven, thus giving you a stream of atoms in th... | The experimental setup of Stern and Gerlach [1-3] consisted of a furnace in which silver evaporated at a temperature of about 1300C, and an electromagnet with a south pole in the form of a blade 3.5 cm long, in the field of which a beam of silver atoms was deflected - Fig. 1. A beam of atoms was formed during the outfl... |
3,769,578 | I have an equation:
$$\mathbf a = \mathbf b × \mathbf c,$$
where $\mathbf a$ $\mathbf b$ and $\mathbf c$ are 3-vectors.
How could I derive $b$ from the equation and express it in terms of $\mathbf a$ and $\mathbf c$? | 2020/07/26 | [
"https://math.stackexchange.com/questions/3769578",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/696467/"
] | You can't. Given $c$ and a vector $a$ perpendicular perpendicular to $c$ choose $b$ in the plane perpendicular to $a$. Then $b\times c$ lies in the direction of $a$ and you want $|a|=|b||c|\sin \theta$ where $\theta$ is the angle between $b$ and $c$ taken in the correct direction.
So then all you need is $|b|\sin \the... | Note that
1. if $\mathbf{c}\cdot\mathbf{a}\neq 0$ then there are no solutions.
2. if $\mathbf{c}=\mathbf{0}$, then there are no solutions unless $\mathbf{a}=\mathbf0$, in which case every $\mathbf{b}$ works.
3. if $\mathbf{c}\neq\mathbf{0}$, then $\mathbf{p}\times\mathbf{c}=\mathbf{0}$ if and only if $\mathbf{p}$ is a... |
52,316,683 | How can I get the right return type for np.nditer? I need to iterate through `ax` object here:
```
fig, ax = plt.subplots(figsize=(16,9), ncols=3, nrows=2)
for col, elem in zip(df.columns[:-1], np.nditer(ax, flags = ['refs_ok'])):
sns.countplot(x="CLASS", hue=col, data=df, ax=elem)
```
I know I could have iterat... | 2018/09/13 | [
"https://Stackoverflow.com/questions/52316683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7281684/"
] | Possibly you want to iterate like
```
fig, ax = plt.subplots(figsize=(16,9), ncols=3, nrows=2)
for col, elem in zip(df.columns[:-1], ax.flat):
sns.countplot(x="CLASS", hue=col, data=df, ax=elem)
```
which is shorter and always makes `elem` an `matplotlib.axes._subplots.AxesSubplot` object. | The problem with using a `numpy` function like this is that it will convert the iterable to an `np.ndarray` object straight away.
Therefore, your return value will be a slice of this `np.ndarray` object have a look at the following example
```
In [472]: list(np.nditer([[None, None], [None, None]], flags = ['refs_ok']... |
443,191 | Скажите(?) вашей вере усиление не нужно?
Какой знак тут правильней поставить? | 2018/08/01 | [
"https://rus.stackexchange.com/questions/443191",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/190059/"
] | Думаю, что:
* во-первых, выбор знака действительно может быть сделан на усмотрение автора,
* и, во-вторых, с двоеточием получается более акцентированная интонационная пауза (ну или назовите это логическим ударением, не знаю) после слова «*скажите*».
То есть «правильность» определяется контекстом, замыслом автора и т.... | Данное предложение можно охарактеризовать как БСП с изъяснительными отношениями между частями и поставить двоеточие, или СПП с пропуском союза-частицы "ли" ( в разговорном стиле речи) и поставить запятую. Поскольку данное предложение носит разговорный характер, предпочтительно поставить запятую. Двоеточие более книжный... |
443,191 | Скажите(?) вашей вере усиление не нужно?
Какой знак тут правильней поставить? | 2018/08/01 | [
"https://rus.stackexchange.com/questions/443191",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/190059/"
] | Думаю, что:
* во-первых, выбор знака действительно может быть сделан на усмотрение автора,
* и, во-вторых, с двоеточием получается более акцентированная интонационная пауза (ну или назовите это логическим ударением, не знаю) после слова «*скажите*».
То есть «правильность» определяется контекстом, замыслом автора и т.... | Вариант 1. **Скажите, вашей вере усиление не нужно?**
Это вариант, который обычно используется. ***Скажите*** — **вводное предложение**, логическим центром высказывания является вторая часть.
Вряд ли это СПП (союз ЛИ пропущен, вопросительный знак стоит в конце предложения, а он по правилам ставится в особом случае).
... |
443,191 | Скажите(?) вашей вере усиление не нужно?
Какой знак тут правильней поставить? | 2018/08/01 | [
"https://rus.stackexchange.com/questions/443191",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/190059/"
] | Данное предложение можно охарактеризовать как БСП с изъяснительными отношениями между частями и поставить двоеточие, или СПП с пропуском союза-частицы "ли" ( в разговорном стиле речи) и поставить запятую. Поскольку данное предложение носит разговорный характер, предпочтительно поставить запятую. Двоеточие более книжный... | Вариант 1. **Скажите, вашей вере усиление не нужно?**
Это вариант, который обычно используется. ***Скажите*** — **вводное предложение**, логическим центром высказывания является вторая часть.
Вряд ли это СПП (союз ЛИ пропущен, вопросительный знак стоит в конце предложения, а он по правилам ставится в особом случае).
... |
8,365,653 | I have an array of strings of the format "Year-Month\_ID". I'd like to split each item in two at the '\_'. Then, for the items that have the same prefix (year & month), join the IDs with '\_' after the prefix ("Year-Month\_ID\_ID..."). For example, if I have the data:
```
array(
'2010-December_9',
'2010-Decemb... | 2011/12/03 | [
"https://Stackoverflow.com/questions/8365653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/817365/"
] | ```
$arr = array();
foreach ($dates as $val)
{
$tmp = explode("_", $val);
if ( ! isset($arr[$tmp[0]]))
{
$arr[$tmp[0]] = array();
}
$arr[$tmp[0]][] = $tmp[1];
}
$final = array();
foreach ($arr as $key=>$val)
{
$final[] = $key."_".implode("_", $val);
}
``` | `explode('_',$str)`
<http://php.net/manual/en/function.explode.php>
I will put down a simple logic .. implement it with code.
```
create array2
for loop till all elem in array1
loop2 for array1
if index1!=index2 && explode('_',array[index1])[0]== explode('_',array[index2])[0]
array2.push( explode('_'... |
8,365,653 | I have an array of strings of the format "Year-Month\_ID". I'd like to split each item in two at the '\_'. Then, for the items that have the same prefix (year & month), join the IDs with '\_' after the prefix ("Year-Month\_ID\_ID..."). For example, if I have the data:
```
array(
'2010-December_9',
'2010-Decemb... | 2011/12/03 | [
"https://Stackoverflow.com/questions/8365653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/817365/"
] | This might help:
```
$arr = Array('2010-December_9', '2010-December_19', '2011-June_4', '2011-September_38', '2011-November_29', '2011-November_9'); // input array
$arrTemp = $arrOutput = Array();
foreach ($arr as $val) {
if (preg_match('/([0-9]{4})-([a-z]+)_([0-9]{1,2})/i', $val, $arrMatches)) {
$arrTemp[... | `explode('_',$str)`
<http://php.net/manual/en/function.explode.php>
I will put down a simple logic .. implement it with code.
```
create array2
for loop till all elem in array1
loop2 for array1
if index1!=index2 && explode('_',array[index1])[0]== explode('_',array[index2])[0]
array2.push( explode('_'... |
8,365,653 | I have an array of strings of the format "Year-Month\_ID". I'd like to split each item in two at the '\_'. Then, for the items that have the same prefix (year & month), join the IDs with '\_' after the prefix ("Year-Month\_ID\_ID..."). For example, if I have the data:
```
array(
'2010-December_9',
'2010-Decemb... | 2011/12/03 | [
"https://Stackoverflow.com/questions/8365653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/817365/"
] | ```
$arr = array();
foreach ($dates as $val)
{
$tmp = explode("_", $val);
if ( ! isset($arr[$tmp[0]]))
{
$arr[$tmp[0]] = array();
}
$arr[$tmp[0]][] = $tmp[1];
}
$final = array();
foreach ($arr as $key=>$val)
{
$final[] = $key."_".implode("_", $val);
}
``` | This might help:
```
$arr = Array('2010-December_9', '2010-December_19', '2011-June_4', '2011-September_38', '2011-November_29', '2011-November_9'); // input array
$arrTemp = $arrOutput = Array();
foreach ($arr as $val) {
if (preg_match('/([0-9]{4})-([a-z]+)_([0-9]{1,2})/i', $val, $arrMatches)) {
$arrTemp[... |
41,171,863 | So far I have this code, I have been told that I am reading the switches on porth rather than reading the array ( scanner ) as I should be.
The initial problem is this: [](https://i.stack.imgur.com/4O7k6.jpg)
The code:
```
#include <stdio.h>
int main(void) {
... | 2016/12/15 | [
"https://Stackoverflow.com/questions/41171863",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6198860/"
] | Although the question wasn't clear, I think I've got it...
**Notes**:
* I assume that `scanner` contains dummy data and is used to mock the device.
* I am using *VStudio 10* (on 64bit *Win10*), so certain things in your code won't work:
+ The binary formatted numbers (e.g. *0b00000001*), so I had to convert them (t... | While almost all of what CristiFati wrote is right, there's a small error in:
>
> The last change is: replace `if (index < threshold) {` by `if (index < read) {` …
>
>
>
Since the previous loop runs `while (((index <= read) …` and `scanner[*read*]` is a valid data point, it's
```
if (index <= read)
{
``... |
3,939,149 | Given the linear transformation $T(at^2+bt+c)=(2a − c)t^2 + (2a + b − 2c)t + (−a + 2c)$, how can I find the eigenvectors and eigenvalues? I know that general idea is to solve $T(v)=\lambda v$. From there, I get:
$$\lambda at^2+ \lambda bt+ \lambda c = (2a − c)t^2 + (2a + b − 2c)t + (−a + 2c)$$
This implies,
$$2a - c ... | 2020/12/07 | [
"https://math.stackexchange.com/questions/3939149",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Note that $\log n + \log \log n \le 2 \log n \le (\log n)^2$ provided that $n \ge 4$ in which case $$n \log n = 2^{\log n + \log \log n} \le 2^{(\log n)^2}.$$ | Actually, $n\log n=o(2^{\log^2 n})$ (little oh), which is a stronger statement.
To see the, consider the functions $f(x)=x\log x$ and $g(x)=2^{\log^2 x}$.
Clearly both functions tend to infinity as $x\to\infty$. Using L'hopital's rule,
$$\lim\_{x\to\infty}\frac{f(x)}{g(x)}=\lim\_{x\to\infty}\frac{f'(x)}{g'(x)}=\frac{
... |
26,649,641 | On a website I am building I have a vimeo video embedded. The client needs to keep the sound on the video obviously for people that find it on vimeo. However for her website the sound is just plain annoying. So I need to find a way to mute the audio within the code for the embed. I have googled it but can't seem to fin... | 2014/10/30 | [
"https://Stackoverflow.com/questions/26649641",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3050204/"
] | you will be using `setVolume` api in your vimeo.. `player.api('setVolume', 0);`
it will be like this...
```
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//f.vimeocdn.com/js/froogaloop2.min.js"></script>
<iframe id="vimeo_player" src="http://player... | @Gadss answer works great but I found that you need update the iframe src to include the activation of the Vimeo api. Just include api=1 after the vimeo id.
I've also found that this sometimes doens't work on Safari for some reason.
```
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></s... |
26,649,641 | On a website I am building I have a vimeo video embedded. The client needs to keep the sound on the video obviously for people that find it on vimeo. However for her website the sound is just plain annoying. So I need to find a way to mute the audio within the code for the embed. I have googled it but can't seem to fin... | 2014/10/30 | [
"https://Stackoverflow.com/questions/26649641",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3050204/"
] | In case it helps anyone, [Vimeo have added a 'background' parameter](https://vimeo.com/forums/feature_requests/topic:278001) for embedding videos, that autoplays videos silently. In some cases that will be useful where people want to mute videos - this is their example:
```
<iframe src="https://player.vimeo.com/video/... | \*\*Here is my solution:
<http://jsfiddle.net/jakeoblivion/phytdt9L/5/>
(You will need your own play/pause mute/unmute icons)
```
//load video muted
var video = $("#myvideo");
video.vimeo("play");
video.vimeo("setVolume", 0);
//toggle play/pause
$('#play-pause').click(function() {
$(this).toggleC... |
26,649,641 | On a website I am building I have a vimeo video embedded. The client needs to keep the sound on the video obviously for people that find it on vimeo. However for her website the sound is just plain annoying. So I need to find a way to mute the audio within the code for the embed. I have googled it but can't seem to fin... | 2014/10/30 | [
"https://Stackoverflow.com/questions/26649641",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3050204/"
] | Seems like Vimeo is providing an updated library, and the API syntax is a bit different from the old one (Froogaloop). Here's how to mute an embedded video with JS:
```
<!--Add the id attr to the iframe tag to use as a selector-->
<iframe id="embeddedVideo" src="http://player.vimeo.com/video/4415083? title=0&bylin... | @Gadss answer works great but I found that you need update the iframe src to include the activation of the Vimeo api. Just include api=1 after the vimeo id.
I've also found that this sometimes doens't work on Safari for some reason.
```
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></s... |
26,649,641 | On a website I am building I have a vimeo video embedded. The client needs to keep the sound on the video obviously for people that find it on vimeo. However for her website the sound is just plain annoying. So I need to find a way to mute the audio within the code for the embed. I have googled it but can't seem to fin... | 2014/10/30 | [
"https://Stackoverflow.com/questions/26649641",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3050204/"
] | \*\*Here is my solution:
<http://jsfiddle.net/jakeoblivion/phytdt9L/5/>
(You will need your own play/pause mute/unmute icons)
```
//load video muted
var video = $("#myvideo");
video.vimeo("play");
video.vimeo("setVolume", 0);
//toggle play/pause
$('#play-pause').click(function() {
$(this).toggleC... | ```
<iframe src="http://player.vimeo.com/video/4415083?muted=1; title=0;byline=0;portrait=0;color=d01e2f;autoplay=1" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
```
you can just give "muted=1" so the video will be muted...
chrome allow the videos autop... |
26,649,641 | On a website I am building I have a vimeo video embedded. The client needs to keep the sound on the video obviously for people that find it on vimeo. However for her website the sound is just plain annoying. So I need to find a way to mute the audio within the code for the embed. I have googled it but can't seem to fin... | 2014/10/30 | [
"https://Stackoverflow.com/questions/26649641",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3050204/"
] | I've found a way to do it. You start the video muted so it autoplays, then on the first *timeupdate* you set the volume to 1.
```
var options = {
id: 'video_id_here',
width: 640,
loop: false,
muted: true,
autoplay: true
};
var player = new Vimeo.Player('vimeo', options);
player.setVolume(0);
pla... | ```
<iframe src="http://player.vimeo.com/video/4415083?muted=1; title=0;byline=0;portrait=0;color=d01e2f;autoplay=1" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
```
you can just give "muted=1" so the video will be muted...
chrome allow the videos autop... |
26,649,641 | On a website I am building I have a vimeo video embedded. The client needs to keep the sound on the video obviously for people that find it on vimeo. However for her website the sound is just plain annoying. So I need to find a way to mute the audio within the code for the embed. I have googled it but can't seem to fin... | 2014/10/30 | [
"https://Stackoverflow.com/questions/26649641",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3050204/"
] | You try insert `?muted=1` after link in `attribute src`
For example
```
<iframe id="vimeo_player" src="https://player.vimeo.com/video/257992348?muted=1">
``` | This is the only way it worked for me: <http://jsfiddle.net/87dsjL8q/108/>
```
var iframe = document.getElementsByTagName('iframe')[0];
var player = $f( iframe );
player.addEvent('ready', function() {
player.api('setVolume', 20);
});
``` |
26,649,641 | On a website I am building I have a vimeo video embedded. The client needs to keep the sound on the video obviously for people that find it on vimeo. However for her website the sound is just plain annoying. So I need to find a way to mute the audio within the code for the embed. I have googled it but can't seem to fin... | 2014/10/30 | [
"https://Stackoverflow.com/questions/26649641",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3050204/"
] | you will be using `setVolume` api in your vimeo.. `player.api('setVolume', 0);`
it will be like this...
```
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//f.vimeocdn.com/js/froogaloop2.min.js"></script>
<iframe id="vimeo_player" src="http://player... | I've found a way to do it. You start the video muted so it autoplays, then on the first *timeupdate* you set the volume to 1.
```
var options = {
id: 'video_id_here',
width: 640,
loop: false,
muted: true,
autoplay: true
};
var player = new Vimeo.Player('vimeo', options);
player.setVolume(0);
pla... |
26,649,641 | On a website I am building I have a vimeo video embedded. The client needs to keep the sound on the video obviously for people that find it on vimeo. However for her website the sound is just plain annoying. So I need to find a way to mute the audio within the code for the embed. I have googled it but can't seem to fin... | 2014/10/30 | [
"https://Stackoverflow.com/questions/26649641",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3050204/"
] | Seems like Vimeo is providing an updated library, and the API syntax is a bit different from the old one (Froogaloop). Here's how to mute an embedded video with JS:
```
<!--Add the id attr to the iframe tag to use as a selector-->
<iframe id="embeddedVideo" src="http://player.vimeo.com/video/4415083? title=0&bylin... | ```
<iframe src="http://player.vimeo.com/video/4415083?muted=1; title=0;byline=0;portrait=0;color=d01e2f;autoplay=1" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
```
you can just give "muted=1" so the video will be muted...
chrome allow the videos autop... |
26,649,641 | On a website I am building I have a vimeo video embedded. The client needs to keep the sound on the video obviously for people that find it on vimeo. However for her website the sound is just plain annoying. So I need to find a way to mute the audio within the code for the embed. I have googled it but can't seem to fin... | 2014/10/30 | [
"https://Stackoverflow.com/questions/26649641",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3050204/"
] | In case it helps anyone, [Vimeo have added a 'background' parameter](https://vimeo.com/forums/feature_requests/topic:278001) for embedding videos, that autoplays videos silently. In some cases that will be useful where people want to mute videos - this is their example:
```
<iframe src="https://player.vimeo.com/video/... | @Gadss answer works great but I found that you need update the iframe src to include the activation of the Vimeo api. Just include api=1 after the vimeo id.
I've also found that this sometimes doens't work on Safari for some reason.
```
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></s... |
26,649,641 | On a website I am building I have a vimeo video embedded. The client needs to keep the sound on the video obviously for people that find it on vimeo. However for her website the sound is just plain annoying. So I need to find a way to mute the audio within the code for the embed. I have googled it but can't seem to fin... | 2014/10/30 | [
"https://Stackoverflow.com/questions/26649641",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3050204/"
] | In case it helps anyone, [Vimeo have added a 'background' parameter](https://vimeo.com/forums/feature_requests/topic:278001) for embedding videos, that autoplays videos silently. In some cases that will be useful where people want to mute videos - this is their example:
```
<iframe src="https://player.vimeo.com/video/... | ```
<iframe src="http://player.vimeo.com/video/4415083?muted=1; title=0;byline=0;portrait=0;color=d01e2f;autoplay=1" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
```
you can just give "muted=1" so the video will be muted...
chrome allow the videos autop... |
343,287 | In recent product announcements, I have noticed a trend that is disturbing to me. Stack Exchange employees are making claims and arguing with users without providing data to back up assumptions. This is leading to both users getting frustrated because it looks like they are being ignored and employees getting frustrate... | 2017/02/08 | [
"https://meta.stackoverflow.com/questions/343287",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/189134/"
] | When people give something their best, and all of it, they tend to stretch pretty thin as what they've built comes under scrutiny and critique. This is because the best they've got creatively and emotionally is still completely invested in that thing they just built.
There's also a rather palpable wave of dissonance t... | I think that there is a problem here that isn't actually solvable, unfortunately; there is a fundamentally paradox.
People (us) want developers to interact with us and want them to listen to us and consider our thoughts, while not appearing condescending and not dismissing us
*but*
The only way for developers to bot... |
343,287 | In recent product announcements, I have noticed a trend that is disturbing to me. Stack Exchange employees are making claims and arguing with users without providing data to back up assumptions. This is leading to both users getting frustrated because it looks like they are being ignored and employees getting frustrate... | 2017/02/08 | [
"https://meta.stackoverflow.com/questions/343287",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/189134/"
] | [Tim has written an excellent answer to this](https://meta.stackoverflow.com/questions/343287/concerns-about-recent-stack-exchange-responses-to-users-suggestions/343304#343304) - go read it, please. We *can* do better here, and we're gonna try.
But something sticks in my craw reading this post: this is mostly about de... | I think that there is a problem here that isn't actually solvable, unfortunately; there is a fundamentally paradox.
People (us) want developers to interact with us and want them to listen to us and consider our thoughts, while not appearing condescending and not dismissing us
*but*
The only way for developers to bot... |
343,287 | In recent product announcements, I have noticed a trend that is disturbing to me. Stack Exchange employees are making claims and arguing with users without providing data to back up assumptions. This is leading to both users getting frustrated because it looks like they are being ignored and employees getting frustrate... | 2017/02/08 | [
"https://meta.stackoverflow.com/questions/343287",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/189134/"
] | While I don't believe that it's ever how the responses are *intended* to sound, this is how I *feel* reading some feedback on posts. It's not limited to the post that is the focus of the op.
One trend that stands out to me is the expectation that users will provide rigorous statistics to back up every claim they make.... | I think that there is a problem here that isn't actually solvable, unfortunately; there is a fundamentally paradox.
People (us) want developers to interact with us and want them to listen to us and consider our thoughts, while not appearing condescending and not dismissing us
*but*
The only way for developers to bot... |
343,287 | In recent product announcements, I have noticed a trend that is disturbing to me. Stack Exchange employees are making claims and arguing with users without providing data to back up assumptions. This is leading to both users getting frustrated because it looks like they are being ignored and employees getting frustrate... | 2017/02/08 | [
"https://meta.stackoverflow.com/questions/343287",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/189134/"
] | TLDR:
I agree there's an issue here, though I'm not sure it's entirely on the team *or* even remotely intended. Some of this feels like users provoking the team, and some of it feels like poor word choice or other language related issues. While there's definitely some things here that need fixed, there are also some... | I think that there is a problem here that isn't actually solvable, unfortunately; there is a fundamentally paradox.
People (us) want developers to interact with us and want them to listen to us and consider our thoughts, while not appearing condescending and not dismissing us
*but*
The only way for developers to bot... |
343,287 | In recent product announcements, I have noticed a trend that is disturbing to me. Stack Exchange employees are making claims and arguing with users without providing data to back up assumptions. This is leading to both users getting frustrated because it looks like they are being ignored and employees getting frustrate... | 2017/02/08 | [
"https://meta.stackoverflow.com/questions/343287",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/189134/"
] | When people give something their best, and all of it, they tend to stretch pretty thin as what they've built comes under scrutiny and critique. This is because the best they've got creatively and emotionally is still completely invested in that thing they just built.
There's also a rather palpable wave of dissonance t... | While I don't believe that it's ever how the responses are *intended* to sound, this is how I *feel* reading some feedback on posts. It's not limited to the post that is the focus of the op.
One trend that stands out to me is the expectation that users will provide rigorous statistics to back up every claim they make.... |
343,287 | In recent product announcements, I have noticed a trend that is disturbing to me. Stack Exchange employees are making claims and arguing with users without providing data to back up assumptions. This is leading to both users getting frustrated because it looks like they are being ignored and employees getting frustrate... | 2017/02/08 | [
"https://meta.stackoverflow.com/questions/343287",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/189134/"
] | [Tim has written an excellent answer to this](https://meta.stackoverflow.com/questions/343287/concerns-about-recent-stack-exchange-responses-to-users-suggestions/343304#343304) - go read it, please. We *can* do better here, and we're gonna try.
But something sticks in my craw reading this post: this is mostly about de... | I've just sort of accepted that the things that would make my life easier and better, both as a regular user and a moderator (on Workplace) are lower priority than the things that Stack Exchange wants to pursue.
We also have different interests. I want a website that easily enables me to see, answer, and interact with... |
343,287 | In recent product announcements, I have noticed a trend that is disturbing to me. Stack Exchange employees are making claims and arguing with users without providing data to back up assumptions. This is leading to both users getting frustrated because it looks like they are being ignored and employees getting frustrate... | 2017/02/08 | [
"https://meta.stackoverflow.com/questions/343287",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/189134/"
] | When people give something their best, and all of it, they tend to stretch pretty thin as what they've built comes under scrutiny and critique. This is because the best they've got creatively and emotionally is still completely invested in that thing they just built.
There's also a rather palpable wave of dissonance t... | [Tim has written an excellent answer to this](https://meta.stackoverflow.com/questions/343287/concerns-about-recent-stack-exchange-responses-to-users-suggestions/343304#343304) - go read it, please. We *can* do better here, and we're gonna try.
But something sticks in my craw reading this post: this is mostly about de... |
343,287 | In recent product announcements, I have noticed a trend that is disturbing to me. Stack Exchange employees are making claims and arguing with users without providing data to back up assumptions. This is leading to both users getting frustrated because it looks like they are being ignored and employees getting frustrate... | 2017/02/08 | [
"https://meta.stackoverflow.com/questions/343287",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/189134/"
] | While I don't believe that it's ever how the responses are *intended* to sound, this is how I *feel* reading some feedback on posts. It's not limited to the post that is the focus of the op.
One trend that stands out to me is the expectation that users will provide rigorous statistics to back up every claim they make.... | I've just sort of accepted that the things that would make my life easier and better, both as a regular user and a moderator (on Workplace) are lower priority than the things that Stack Exchange wants to pursue.
We also have different interests. I want a website that easily enables me to see, answer, and interact with... |
343,287 | In recent product announcements, I have noticed a trend that is disturbing to me. Stack Exchange employees are making claims and arguing with users without providing data to back up assumptions. This is leading to both users getting frustrated because it looks like they are being ignored and employees getting frustrate... | 2017/02/08 | [
"https://meta.stackoverflow.com/questions/343287",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/189134/"
] | When people give something their best, and all of it, they tend to stretch pretty thin as what they've built comes under scrutiny and critique. This is because the best they've got creatively and emotionally is still completely invested in that thing they just built.
There's also a rather palpable wave of dissonance t... | TLDR:
I agree there's an issue here, though I'm not sure it's entirely on the team *or* even remotely intended. Some of this feels like users provoking the team, and some of it feels like poor word choice or other language related issues. While there's definitely some things here that need fixed, there are also some... |
343,287 | In recent product announcements, I have noticed a trend that is disturbing to me. Stack Exchange employees are making claims and arguing with users without providing data to back up assumptions. This is leading to both users getting frustrated because it looks like they are being ignored and employees getting frustrate... | 2017/02/08 | [
"https://meta.stackoverflow.com/questions/343287",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/189134/"
] | TLDR:
I agree there's an issue here, though I'm not sure it's entirely on the team *or* even remotely intended. Some of this feels like users provoking the team, and some of it feels like poor word choice or other language related issues. While there's definitely some things here that need fixed, there are also some... | I've just sort of accepted that the things that would make my life easier and better, both as a regular user and a moderator (on Workplace) are lower priority than the things that Stack Exchange wants to pursue.
We also have different interests. I want a website that easily enables me to see, answer, and interact with... |
58,604,787 | My goal is the following: I have two Flask apps in two separate Docker containers and I want to access them via different paths on the same IP address, like this: 127.0.0.1/app1, 127.0.0.1/app2 (but with a real IP address).
I want to do this with Kubernetes.
I have a Kubernetes cluster running (Azure Kubernetes Servi... | 2019/10/29 | [
"https://Stackoverflow.com/questions/58604787",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12290469/"
] | Reading the [*tox* documentation on "Dependency changes and tracking"](https://tox.readthedocs.io/en/latest/example/general.html#dependency-changes-and-tracking), it seems changes in a `requirements.txt` file do not trigger the rebuild of the virtual environment. So it looks like you should indeed delete the `.tox` dir... | There is a plugin for Tox named `detox` which enables parallel processing of `tox` pipelines. Recent versions of `tox` (I have Python 3.7.3 and tox 3.14.0) directly supply this feature.
Using `tox --parallel auto` in the Jenkins file drops the time needed from 90 seconds to 20. For my needs this is good enough and I c... |
59,465,301 | I was trying to make this work:
```
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Add React in One Minute</title>
</head>
<body>
<h2>Add React in One Minute</h2>
<p>This page demonstrates using React with no build tooling.</p>
<p>React is loaded as a script tag.</p>
<!--... | 2019/12/24 | [
"https://Stackoverflow.com/questions/59465301",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12586951/"
] | The problem here is that you're running your page as a file directly from your hard drive, [which is preventing external scripts](https://stackoverflow.com/questions/20138001/reading-files-from-hard-drive-with-javascript) (like react, react-dom) from downloading. This means that `React` is never downloaded and not defi... | ```
import React from "react";
```
your complete code which is working properly.
```
"use strict";
import React from "react";
import ReactDOM from "react-dom";
const e = React.createElement;
class LikeButton extends React.Component {
constructor(props) {
super(props);
this.state = { liked: false };
}
... |
52,264,354 | I have the following dataframe:
```
Sentence
0 Cat is a big lion
1 Dogs are descendants of wolf
2 Elephants are pachyderm
3 Pachyderm animals include rhino, Elephants and hippopotamus
```
I need to create a python code which looks at the words in sentence above and calculates the sum of scores for each b... | 2018/09/10 | [
"https://Stackoverflow.com/questions/52264354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9244542/"
] | As a first effort, you can try a `split` and `map`-based approach, and then compute the score using `groupby`.
```
v = df1['Sentence'].str.split(r'[\s.!?,]+', expand=True).stack().str.lower()
df1['Value'] = (
v.map(df2.set_index('Name')['Score'])
.sum(level=0)
.fillna(0, downcast='infer'))
```
```
df1
... | ### `nltk`
You may need to download stuff
```
import nltk
nltk.download('punkt')
```
Then set up stemming and tokenizing
```
from nltk.stem import PorterStemmer
from nltk.tokenize import word_tokenize
ps = PorterStemmer()
```
Create a handy dictionary
```
m = dict(zip(map(ps.stem, scores.Name), scores.Score))... |
52,264,354 | I have the following dataframe:
```
Sentence
0 Cat is a big lion
1 Dogs are descendants of wolf
2 Elephants are pachyderm
3 Pachyderm animals include rhino, Elephants and hippopotamus
```
I need to create a python code which looks at the words in sentence above and calculates the sum of scores for each b... | 2018/09/10 | [
"https://Stackoverflow.com/questions/52264354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9244542/"
] | As a first effort, you can try a `split` and `map`-based approach, and then compute the score using `groupby`.
```
v = df1['Sentence'].str.split(r'[\s.!?,]+', expand=True).stack().str.lower()
df1['Value'] = (
v.map(df2.set_index('Name')['Score'])
.sum(level=0)
.fillna(0, downcast='infer'))
```
```
df1
... | Trying to using `findall` with `re` `re.I`
```
df.Sentence.str.findall(df1.Name.str.cat(sep='|'),flags=re.I).\
map(lambda x : sum([df1.loc[df1.Name==str.lower(y),'Score' ].values for y in x])[0])
Out[49]:
0 4
1 4
2 5
3 14
Name: Sentence, dtype: int64
``` |
4,109,617 | We're having a compatibility problem between Mercurial and another synchronization product (MS Office Groove, now Sharepoint Workspace 2010). Basically, the ".hg" folder and ".hgignore" files are being blocked (I've [summarized the issue](http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010general/thread/250186... | 2010/11/05 | [
"https://Stackoverflow.com/questions/4109617",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22528/"
] | You can use a different file name for .hgignore (or more accurately have no .hgignore and then use an `ignore=` line in your `hg/hgrc` file to reference an additional ignore file with whatever name you want). However you can't use an alternative name for `.hg` itself.
As Lasse suggests you shouldn't be synchronizing `... | The names are hard-coded in the Mercurial source, search for occurrences of `".hg"` and `".hgignore"` (for added safety, also using single quotes). However, since a typical Mercurial installation provides the Mercurial source code, it's easy to change this to anything you prefer. |
34,726,690 | I wanted to display two `<div>` elements that have width and height side-by-side. I applied `inline-block` to the `<div>`s, but the position of the left element is strange:

HTML:
```
<body>
<div id="myDivTag">content</div>
<div id="map-canvas">for... | 2016/01/11 | [
"https://Stackoverflow.com/questions/34726690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5399781/"
] | By default inline boxes in a line are vertically aligned by their baselines (since the default value of the `vertical-align` property is `baseline`) and the baseline of inline-blocks depends on the value of the `overflow` property. If the value of the `overflow` property on an inline-block is `visible`, then the baseli... | Add vertical-align to your css and it should work:
```
#myDivTag, #map-canvas {
display: inline-block;
vertical-align:top;
height: 95%;
width: 49%;
z-index: 0;
}
``` |
3,699,910 | Find convergence area and absolute convergence area of the following series:
$$\sum\_{k=0}^{\infty}\frac{(2x)^{k}}{(1+x^{2})^{k}}$$
I wrote it as
$$\sum\_{k=0}^{\infty}\frac{(2x)^{k}}{(1+x^{2})^{k}}=\sum\_{k=0}^{\infty}\left(\frac{2x}{1+x^{2}}\right)^{k}$$
and now this is geometric series, where $q=\frac{2x}{1+x^{2}}$... | 2020/05/31 | [
"https://math.stackexchange.com/questions/3699910",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/760556/"
] | Yes, this is correct. I would include additional reasoning as to how you solved the inequality to get the area of absolute convergence; e.g., $2|x|/(1+x^2) < 1$ implies $$0 < x^2 - 2|x| + 1 = (|x| - 1)^2,$$ and since such a square is only $0$ when $|x| = 1$ or $x \in \{-1,1\}$, the result follows. | You need to solve the inequality
$$
x^2 + 1 - 2 x >0
$$
which is true for all $x$. Now add the boundary inequalities that come from the equliaty
$$
\frac{2x}{x^2+1}=0
$$
for $x=1$ or $x=-1$ |
11,878 | I've searched online for this, to no avail. In a dispute where attorneys are involved on one or both sides, what is an attorney signalling, in terms of legal strategy (i.e. beyond the literal meaning of "unsubstantiated"), in using the phrase "no reason to believe", particularly in the face of overwhelming substantiati... | 2016/07/22 | [
"https://law.stackexchange.com/questions/11878",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/3341/"
] | Caveat: I am not a lawyer. It seems to me that the attorney using the phrase, "We have no reason to believe that the allegations presented here are true," is not only saying that the allegations are not true, but that all the evidence supporting the allegations are not true. Of course one has to allow for the possibili... | If you use the phrase "I have no reason to believe ..." In the face of *any* evidence that should give you a reason to believe this is known in law, as in general life, as a "lie".
However, what is compelling evidence to you may not be compelling to someone else with whom you have a dispute (or indeed, an arbitrator).... |
11,878 | I've searched online for this, to no avail. In a dispute where attorneys are involved on one or both sides, what is an attorney signalling, in terms of legal strategy (i.e. beyond the literal meaning of "unsubstantiated"), in using the phrase "no reason to believe", particularly in the face of overwhelming substantiati... | 2016/07/22 | [
"https://law.stackexchange.com/questions/11878",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/3341/"
] | That phrase does not signal anything strategic beyond the obvious: an intent to dispute the allegations.
Although the existence of the suggests that there is probably *some* reason to believe the allegations, the phrase is being used nearly literally. | If you use the phrase "I have no reason to believe ..." In the face of *any* evidence that should give you a reason to believe this is known in law, as in general life, as a "lie".
However, what is compelling evidence to you may not be compelling to someone else with whom you have a dispute (or indeed, an arbitrator).... |
11,878 | I've searched online for this, to no avail. In a dispute where attorneys are involved on one or both sides, what is an attorney signalling, in terms of legal strategy (i.e. beyond the literal meaning of "unsubstantiated"), in using the phrase "no reason to believe", particularly in the face of overwhelming substantiati... | 2016/07/22 | [
"https://law.stackexchange.com/questions/11878",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/3341/"
] | Caveat: I am not a lawyer. It seems to me that the attorney using the phrase, "We have no reason to believe that the allegations presented here are true," is not only saying that the allegations are not true, but that all the evidence supporting the allegations are not true. Of course one has to allow for the possibili... | That phrase does not signal anything strategic beyond the obvious: an intent to dispute the allegations.
Although the existence of the suggests that there is probably *some* reason to believe the allegations, the phrase is being used nearly literally. |
10,397 | When I consider my own existence with respect to time I can imagine three possibilities:
(1) **Time extends infinitely into the past.** In this case, how can the present, with me in it, exist, since there would be an infinite period of time that existed before the present. That seems illogical.
(2) **Time had a sta... | 2014/03/24 | [
"https://philosophy.stackexchange.com/questions/10397",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/5538/"
] | I will attempt to present the stance of physicist [Julian Barbour](https://en.wikipedia.org/wiki/Julian_Barbour), who presented a compelling answer to this question in a lecture I saw him give in Oxford ([this lecture](https://www.youtube.com/watch?v=I5rExaKLEoU)).
He is firmly *not* in the camp of the latter viewpoi... | Summations in math are completely true irregardless of "time" so the question itself has no meaning. Yes there is "time" but like gravity "it exists but doesn't mean all that much" until you start talking vast distances (say between Planets.) Yes, "time mattered" when your average speed of travel was at best 4mph acros... |
10,397 | When I consider my own existence with respect to time I can imagine three possibilities:
(1) **Time extends infinitely into the past.** In this case, how can the present, with me in it, exist, since there would be an infinite period of time that existed before the present. That seems illogical.
(2) **Time had a sta... | 2014/03/24 | [
"https://philosophy.stackexchange.com/questions/10397",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/5538/"
] | You've presented a false dichotomy: just because something is a "mental construct" doesn't mean that it can't also be a real property of the physical universe.
Take length as an example. "Length," as such, doesn't exist physically. It's not something you can see or touch. Nevertheless, it is a real quality of physical... | 3 is correct. Time is a abstraction, a filing system used to arrange events and memories into a logical system of cause and effect.
Per relativity, space and time are not discrete entities, but a single construct called spacetime. Saying something is X km long is equal to saying it is Y seconds long. All units of time... |
10,397 | When I consider my own existence with respect to time I can imagine three possibilities:
(1) **Time extends infinitely into the past.** In this case, how can the present, with me in it, exist, since there would be an infinite period of time that existed before the present. That seems illogical.
(2) **Time had a sta... | 2014/03/24 | [
"https://philosophy.stackexchange.com/questions/10397",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/5538/"
] | Time as you perceive it is naturally a mental construct, but it seems to correspond to an element of reality.
"In a complete theory there is an element corresponding to each element of reality. A sufficient condition for the reality of a physical quantity is the possibility of predicting it with certainty, without dis... | (1) is a little too loaded or existential of a question. If we shoot a classical arrow through the air, we can slice up each moment of its flight time into infinitely many infantecimal moments. In a sense, time extends infinitely into the present moment. What is "continuous" motion but the mathematical model of the rat... |
10,397 | When I consider my own existence with respect to time I can imagine three possibilities:
(1) **Time extends infinitely into the past.** In this case, how can the present, with me in it, exist, since there would be an infinite period of time that existed before the present. That seems illogical.
(2) **Time had a sta... | 2014/03/24 | [
"https://philosophy.stackexchange.com/questions/10397",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/5538/"
] | I think there may be a 4th option which is closely related to your option (2). That is, time started at the big bang and has existed independently of our minds since then forming our Einstein-Minkowski 'time-cone'.
Of course, what came before the big bang, or if this is even a question that makes sense, is up for deba... | 3 is correct. Time is a abstraction, a filing system used to arrange events and memories into a logical system of cause and effect.
Per relativity, space and time are not discrete entities, but a single construct called spacetime. Saying something is X km long is equal to saying it is Y seconds long. All units of time... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.