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 |
|---|---|---|---|---|---|
314,576 | I've started with thinking that if X and Y are perfectly correlated, then it is the same as looking at the correlation of Y and -Y (since the X provides no new information) and thus the correlation is -1.
Is this correct? | 2017/11/19 | [
"https://stats.stackexchange.com/questions/314576",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/165916/"
] | I'll treat this as [self-study](/questions/tagged/self-study "show questions tagged 'self-study'"), and I'd encourage you to read [its wiki](https://stats.stackexchange.com/tags/self-study/info) and add the tag.
Your argument is already very good. Here are a few pointers. Feel free to write a comment so we can discuss... | If $X$ is a linear function of $Y$ (definition of perfect correlation), then both $X-Y$ and $X+Y$ will be linear functions of $Y$, and therefore are linear functions of each other.
So, $X-Y$ and $X+Y$ are perfectly correlated. |
314,576 | I've started with thinking that if X and Y are perfectly correlated, then it is the same as looking at the correlation of Y and -Y (since the X provides no new information) and thus the correlation is -1.
Is this correct? | 2017/11/19 | [
"https://stats.stackexchange.com/questions/314576",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/165916/"
] | Hint: *In general*, \begin{align}
\rho\_{A,B} &= \frac{\operatorname{cov}(A,B)}{\sqrt{\operatorname{var}(A)\operatorname{var}(B)}},\\
\operatorname{var}(X\pm Y)&= \operatorname{var}(X)+\operatorname{var}(Y)
\pm 2\operatorname{cov}(X,Y),\\
\text{and}\qquad\operatorname{cov}(X+Y,X-Y)&=\operatorname{var}(X)-\operatorname{... | I see this already has an accepted answer, but I've always liked simulations more than equations, and this seemed like a fun question. I generated a variable $x$ from a distribution $N(0, 1)$ whose sample size $n$ was drawn from $U(100, 10000)$. To make $y$, I simply added a constant—drawn from $U(1, 100)$—to $x$. I th... |
314,576 | I've started with thinking that if X and Y are perfectly correlated, then it is the same as looking at the correlation of Y and -Y (since the X provides no new information) and thus the correlation is -1.
Is this correct? | 2017/11/19 | [
"https://stats.stackexchange.com/questions/314576",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/165916/"
] | Hint: *In general*, \begin{align}
\rho\_{A,B} &= \frac{\operatorname{cov}(A,B)}{\sqrt{\operatorname{var}(A)\operatorname{var}(B)}},\\
\operatorname{var}(X\pm Y)&= \operatorname{var}(X)+\operatorname{var}(Y)
\pm 2\operatorname{cov}(X,Y),\\
\text{and}\qquad\operatorname{cov}(X+Y,X-Y)&=\operatorname{var}(X)-\operatorname{... | $X,Y$ perfectly correlate $\implies Cov(X,Y)=\sqrt{Var(X)Var(Y)}$
$Cov(X+Y,X-Y)=Cov(X,X)-Cov(X,Y)+Cov(Y,X)-Cov(Y,Y)=Var(X)-Var(Y)$
$Var(X+Y)Var(X-Y)=[Var(X)+Var(Y)+2Cov(X,Y)][Var(X)+Var(Y)-2Cov(X,Y)]=[Var(X)+Var(Y)]^2-4Cov(X,Y)Cov(X,Y)=\_{\rho\_{X,Y}=1}=[Var(X)+Var(Y)]^2-4Var(X)Var(Y)=[Var(X)-Var(Y)]^2$
Hence, $\rho... |
314,576 | I've started with thinking that if X and Y are perfectly correlated, then it is the same as looking at the correlation of Y and -Y (since the X provides no new information) and thus the correlation is -1.
Is this correct? | 2017/11/19 | [
"https://stats.stackexchange.com/questions/314576",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/165916/"
] | Hint: *In general*, \begin{align}
\rho\_{A,B} &= \frac{\operatorname{cov}(A,B)}{\sqrt{\operatorname{var}(A)\operatorname{var}(B)}},\\
\operatorname{var}(X\pm Y)&= \operatorname{var}(X)+\operatorname{var}(Y)
\pm 2\operatorname{cov}(X,Y),\\
\text{and}\qquad\operatorname{cov}(X+Y,X-Y)&=\operatorname{var}(X)-\operatorname{... | If $X$ is a linear function of $Y$ (definition of perfect correlation), then both $X-Y$ and $X+Y$ will be linear functions of $Y$, and therefore are linear functions of each other.
So, $X-Y$ and $X+Y$ are perfectly correlated. |
60,400,325 | **i am working on a table(csv file) where it has the following data:**
```
roll_no,student_name,grade,email_id
1,Aarav Gosalia,Grade 11,aarav.gosalia@flag.org.in
2,Aarav Rawal,Grade 11,aarav.rawal@flag.org.in
3,Abizar Chitalwala,Grade 11,abizar.chitalwala@flag.org.in
4,Ahad Motorwala,Grade 11,ahad.motorwala@fl... | 2020/02/25 | [
"https://Stackoverflow.com/questions/60400325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11681315/"
] | On Android 10 file paths outside of your App's private directories are worthless by default, you can temporarily enable requestLegacyExternalStorage until Android 11 (which is now out in preview)
See <https://developer.android.com/training/data-storage>
Going forward it is probably best just to use Media Store or Sto... | Add `android:requestLegacyExternalStorage="true"` in manifest application tag.
```
<manifest ... >
<!-- This attribute is "false" by default on apps targeting
Android 10 or higher. -->
<application android:requestLegacyExternalStorage="true" ... >
...
</application>
</manifest>
``` |
182,593 | This came up an a training piece for the Putnam Competition and also in Ireland and Rosen.
The question posed was basically:
Let $p(x)$ be a polynomial with integer coefficients satisfying that $p(0)$ and $p(1)$ are odd. Show that $p$ has no integer zeros.
I&R give an example:
$p(x) = x^2 - 117x + 31$ and show (no ... | 2012/08/14 | [
"https://math.stackexchange.com/questions/182593",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | **Hint** $\ $ If an integer coefficient polynomial has an integer root $\rm\,n,\,$ i.e.$\rm\ p(n) = 0,\ $ then $\rm\,n\,$ remains a root modulo $2$, i.e. $\rm\ p(n)\equiv 0\,\ (mod\ 2).\:$ So, contrapositively, if a polynomial has no roots modulo $2$ then it has no integer roots. This leads to the following simple
**... | The mod $2$ thing is easiest. Here is another idea.
Note that the polynomial expression $f(x)-f(y)$ is divisible by $x-y$ because $x^r-y^r=(x-y)(x^{r-1}+x^{r-2}y+\dots + xy^{r-2}+y^{r-1})$ and the polynomial is built up from such expressions.
So $f(n)-f(0)$ is divisible by $n$, and $f(n)-f(1)$ is divisible by $n-1$. ... |
182,593 | This came up an a training piece for the Putnam Competition and also in Ireland and Rosen.
The question posed was basically:
Let $p(x)$ be a polynomial with integer coefficients satisfying that $p(0)$ and $p(1)$ are odd. Show that $p$ has no integer zeros.
I&R give an example:
$p(x) = x^2 - 117x + 31$ and show (no ... | 2012/08/14 | [
"https://math.stackexchange.com/questions/182593",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | We know
$$f(0) \equiv 1 \pmod{2}$$
This means that the constant term of $f$ is an odd integer.
---
We also know
$$f(1) \equiv 1 \pmod{2}$$
This means that the sum of the coefficients of $f$ is odd.
---
Consider $f(x)$ for a general $x \in \mathbb{Z}$.
**Case 1**: $x$ is even.
If $x$ is even, all of the powe... | If there is an integer solution to $f(x)=0$, say $a$, then, if $a$ is even, $f(a)\equiv f(0)\equiv 1\mod 2$ and if $a$ is odd, $f(a)\equiv f(1)\equiv 1\mod 2$. So, no integer solution is possible. |
182,593 | This came up an a training piece for the Putnam Competition and also in Ireland and Rosen.
The question posed was basically:
Let $p(x)$ be a polynomial with integer coefficients satisfying that $p(0)$ and $p(1)$ are odd. Show that $p$ has no integer zeros.
I&R give an example:
$p(x) = x^2 - 117x + 31$ and show (no ... | 2012/08/14 | [
"https://math.stackexchange.com/questions/182593",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Hint: What can you say about $f(x) \pmod{2}$? | The mod $2$ thing is easiest. Here is another idea.
Note that the polynomial expression $f(x)-f(y)$ is divisible by $x-y$ because $x^r-y^r=(x-y)(x^{r-1}+x^{r-2}y+\dots + xy^{r-2}+y^{r-1})$ and the polynomial is built up from such expressions.
So $f(n)-f(0)$ is divisible by $n$, and $f(n)-f(1)$ is divisible by $n-1$. ... |
182,593 | This came up an a training piece for the Putnam Competition and also in Ireland and Rosen.
The question posed was basically:
Let $p(x)$ be a polynomial with integer coefficients satisfying that $p(0)$ and $p(1)$ are odd. Show that $p$ has no integer zeros.
I&R give an example:
$p(x) = x^2 - 117x + 31$ and show (no ... | 2012/08/14 | [
"https://math.stackexchange.com/questions/182593",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | **Hint** $\ $ If an integer coefficient polynomial has an integer root $\rm\,n,\,$ i.e.$\rm\ p(n) = 0,\ $ then $\rm\,n\,$ remains a root modulo $2$, i.e. $\rm\ p(n)\equiv 0\,\ (mod\ 2).\:$ So, contrapositively, if a polynomial has no roots modulo $2$ then it has no integer roots. This leads to the following simple
**... | If you plug an integer into a polynomial and this equals zero, then you can look at the entire computation mod your favorite $n$. In this case, try two. What does the equation look like then? |
182,593 | This came up an a training piece for the Putnam Competition and also in Ireland and Rosen.
The question posed was basically:
Let $p(x)$ be a polynomial with integer coefficients satisfying that $p(0)$ and $p(1)$ are odd. Show that $p$ has no integer zeros.
I&R give an example:
$p(x) = x^2 - 117x + 31$ and show (no ... | 2012/08/14 | [
"https://math.stackexchange.com/questions/182593",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | We know
$$f(0) \equiv 1 \pmod{2}$$
This means that the constant term of $f$ is an odd integer.
---
We also know
$$f(1) \equiv 1 \pmod{2}$$
This means that the sum of the coefficients of $f$ is odd.
---
Consider $f(x)$ for a general $x \in \mathbb{Z}$.
**Case 1**: $x$ is even.
If $x$ is even, all of the powe... | If $p(0)$ and $p(1)$ are both odd, then $p(x)$ cannot have any integer roots. If it did, then there would be a solution to $p(x)\equiv0$ mod $2$. But $p(0)\equiv p(1)\equiv1\not\equiv0$ mod $2$.
If you're not comfortable with modular arithmetic here, suppose $p(x)=(x-r)q(x)$ with an integer root $r$. Then $-rq(0)=p(0)... |
182,593 | This came up an a training piece for the Putnam Competition and also in Ireland and Rosen.
The question posed was basically:
Let $p(x)$ be a polynomial with integer coefficients satisfying that $p(0)$ and $p(1)$ are odd. Show that $p$ has no integer zeros.
I&R give an example:
$p(x) = x^2 - 117x + 31$ and show (no ... | 2012/08/14 | [
"https://math.stackexchange.com/questions/182593",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Hint: What can you say about $f(x) \pmod{2}$? | If $p(0)$ and $p(1)$ are both odd, then $p(x)$ cannot have any integer roots. If it did, then there would be a solution to $p(x)\equiv0$ mod $2$. But $p(0)\equiv p(1)\equiv1\not\equiv0$ mod $2$.
If you're not comfortable with modular arithmetic here, suppose $p(x)=(x-r)q(x)$ with an integer root $r$. Then $-rq(0)=p(0)... |
182,593 | This came up an a training piece for the Putnam Competition and also in Ireland and Rosen.
The question posed was basically:
Let $p(x)$ be a polynomial with integer coefficients satisfying that $p(0)$ and $p(1)$ are odd. Show that $p$ has no integer zeros.
I&R give an example:
$p(x) = x^2 - 117x + 31$ and show (no ... | 2012/08/14 | [
"https://math.stackexchange.com/questions/182593",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Hint: What can you say about $f(x) \pmod{2}$? | If you plug an integer into a polynomial and this equals zero, then you can look at the entire computation mod your favorite $n$. In this case, try two. What does the equation look like then? |
182,593 | This came up an a training piece for the Putnam Competition and also in Ireland and Rosen.
The question posed was basically:
Let $p(x)$ be a polynomial with integer coefficients satisfying that $p(0)$ and $p(1)$ are odd. Show that $p$ has no integer zeros.
I&R give an example:
$p(x) = x^2 - 117x + 31$ and show (no ... | 2012/08/14 | [
"https://math.stackexchange.com/questions/182593",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | We know
$$f(0) \equiv 1 \pmod{2}$$
This means that the constant term of $f$ is an odd integer.
---
We also know
$$f(1) \equiv 1 \pmod{2}$$
This means that the sum of the coefficients of $f$ is odd.
---
Consider $f(x)$ for a general $x \in \mathbb{Z}$.
**Case 1**: $x$ is even.
If $x$ is even, all of the powe... | The mod $2$ thing is easiest. Here is another idea.
Note that the polynomial expression $f(x)-f(y)$ is divisible by $x-y$ because $x^r-y^r=(x-y)(x^{r-1}+x^{r-2}y+\dots + xy^{r-2}+y^{r-1})$ and the polynomial is built up from such expressions.
So $f(n)-f(0)$ is divisible by $n$, and $f(n)-f(1)$ is divisible by $n-1$. ... |
182,593 | This came up an a training piece for the Putnam Competition and also in Ireland and Rosen.
The question posed was basically:
Let $p(x)$ be a polynomial with integer coefficients satisfying that $p(0)$ and $p(1)$ are odd. Show that $p$ has no integer zeros.
I&R give an example:
$p(x) = x^2 - 117x + 31$ and show (no ... | 2012/08/14 | [
"https://math.stackexchange.com/questions/182593",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Hint: What can you say about $f(x) \pmod{2}$? | If there is an integer solution to $f(x)=0$, say $a$, then, if $a$ is even, $f(a)\equiv f(0)\equiv 1\mod 2$ and if $a$ is odd, $f(a)\equiv f(1)\equiv 1\mod 2$. So, no integer solution is possible. |
182,593 | This came up an a training piece for the Putnam Competition and also in Ireland and Rosen.
The question posed was basically:
Let $p(x)$ be a polynomial with integer coefficients satisfying that $p(0)$ and $p(1)$ are odd. Show that $p$ has no integer zeros.
I&R give an example:
$p(x) = x^2 - 117x + 31$ and show (no ... | 2012/08/14 | [
"https://math.stackexchange.com/questions/182593",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | We know
$$f(0) \equiv 1 \pmod{2}$$
This means that the constant term of $f$ is an odd integer.
---
We also know
$$f(1) \equiv 1 \pmod{2}$$
This means that the sum of the coefficients of $f$ is odd.
---
Consider $f(x)$ for a general $x \in \mathbb{Z}$.
**Case 1**: $x$ is even.
If $x$ is even, all of the powe... | If you plug an integer into a polynomial and this equals zero, then you can look at the entire computation mod your favorite $n$. In this case, try two. What does the equation look like then? |
4,923,369 | I have been having a nagging problem for a few days, here's what I'm trying to do:
I am writing a program that manipulates various set of numbers in multiple ways and so far so good- now I control one of such computations using a loop, so that each time it goes round it outputs an int value x and an int value y.
Now ... | 2011/02/07 | [
"https://Stackoverflow.com/questions/4923369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/606717/"
] | If the y values are unique, then maybe:
```
var list = new SortedList<YType, XType>();
... Loop ...
list.Add(yValue, xValue);
```
This is then both keyed and sorted by the y values, but the keys must be unique.
To make things more complicated, `SortedDictionary<,>` is *also* keyed and sorted; some minor differ... | Make a class to represent your data pair and store all the pairs in a list of some kind. Implement `IComparable` to sort on the second value, and sort it in the usual manner (example in Java, but should be easily translatable to C#):
```
class DataPair implements Comparable {
int x;
int y;
public int ... |
4,923,369 | I have been having a nagging problem for a few days, here's what I'm trying to do:
I am writing a program that manipulates various set of numbers in multiple ways and so far so good- now I control one of such computations using a loop, so that each time it goes round it outputs an int value x and an int value y.
Now ... | 2011/02/07 | [
"https://Stackoverflow.com/questions/4923369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/606717/"
] | If the y values are unique, then maybe:
```
var list = new SortedList<YType, XType>();
... Loop ...
list.Add(yValue, xValue);
```
This is then both keyed and sorted by the y values, but the keys must be unique.
To make things more complicated, `SortedDictionary<,>` is *also* keyed and sorted; some minor differ... | I would use LINQ to do this type of manipulation, not using map-type data structures at all:
```
var list = from dr in dTable.Rows
let x = ComputeX(dr)
let y = ComputeY(dr)
orderby y
select new { x, y };
``` |
4,923,369 | I have been having a nagging problem for a few days, here's what I'm trying to do:
I am writing a program that manipulates various set of numbers in multiple ways and so far so good- now I control one of such computations using a loop, so that each time it goes round it outputs an int value x and an int value y.
Now ... | 2011/02/07 | [
"https://Stackoverflow.com/questions/4923369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/606717/"
] | Make a class to represent your data pair and store all the pairs in a list of some kind. Implement `IComparable` to sort on the second value, and sort it in the usual manner (example in Java, but should be easily translatable to C#):
```
class DataPair implements Comparable {
int x;
int y;
public int ... | I would use LINQ to do this type of manipulation, not using map-type data structures at all:
```
var list = from dr in dTable.Rows
let x = ComputeX(dr)
let y = ComputeY(dr)
orderby y
select new { x, y };
``` |
13,997,793 | >
> **Possible Duplicate:**
>
> [Generating random numbers in Javascript in a specific range?](https://stackoverflow.com/questions/1527803/generating-random-numbers-in-javascript-in-a-specific-range)
>
>
>
Say I wanted to generate a random number from 50 to 100.
I know there's:
```
Math.random()
```
but I ... | 2012/12/21 | [
"https://Stackoverflow.com/questions/13997793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1416380/"
] | From [MDN on `Math.random()`](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/random):
```
// Returns a random integer between min and max
// Using Math.round() will give you a non-uniform distribution!
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min +... | I believe this would also work:
```
function randomInt(min,range) {
return Math.floor((Math.random()*(range+1))+min)
}
```
In your case min would be 50 and range would be 50 |
43,809,720 | I'm receiving the error:
>
> Class AppDelegate has no initializers
>
>
>
and cannot seem to understand why. I am following [this tutorial](https://www.youtube.com/watch?v=c-Uwa5v_3sc). I am a beginner so any help would be VERY appreciated!
My code:
```
import UIKit
@UIApplicationMain
class AppDelegate: UIResp... | 2017/05/05 | [
"https://Stackoverflow.com/questions/43809720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7969879/"
] | Try changing your `centerContainer` property to an *optional* like this:
```
var centerContainer: MMDrawerController!
```
as such, it will be initialized with `nil`, which should be enough to remove the error you are having. (By the way, you shouldn't need to change the rest of your code as a result.)
From [The Swi... | Since `centerContainer` isn't an optional and isn't given a default value, Swift expects an initializer function to give it one. There are a few possible solutions here:
1. Give it a default value. Probably not practical in this context.
2. Make it optional. Would work, but depending on how it's used might add a lot o... |
43,809,720 | I'm receiving the error:
>
> Class AppDelegate has no initializers
>
>
>
and cannot seem to understand why. I am following [this tutorial](https://www.youtube.com/watch?v=c-Uwa5v_3sc). I am a beginner so any help would be VERY appreciated!
My code:
```
import UIKit
@UIApplicationMain
class AppDelegate: UIResp... | 2017/05/05 | [
"https://Stackoverflow.com/questions/43809720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7969879/"
] | Try changing your `centerContainer` property to an *optional* like this:
```
var centerContainer: MMDrawerController!
```
as such, it will be initialized with `nil`, which should be enough to remove the error you are having. (By the way, you shouldn't need to change the rest of your code as a result.)
From [The Swi... | Make your `centerContainer` var optional like `window`. In swift, all of the properties must be initialized. When you make your var optional, you are initializing it as `nil`.
```
var centerContainer: MMDrawerController?
``` |
43,809,720 | I'm receiving the error:
>
> Class AppDelegate has no initializers
>
>
>
and cannot seem to understand why. I am following [this tutorial](https://www.youtube.com/watch?v=c-Uwa5v_3sc). I am a beginner so any help would be VERY appreciated!
My code:
```
import UIKit
@UIApplicationMain
class AppDelegate: UIResp... | 2017/05/05 | [
"https://Stackoverflow.com/questions/43809720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7969879/"
] | Since `centerContainer` isn't an optional and isn't given a default value, Swift expects an initializer function to give it one. There are a few possible solutions here:
1. Give it a default value. Probably not practical in this context.
2. Make it optional. Would work, but depending on how it's used might add a lot o... | Make your `centerContainer` var optional like `window`. In swift, all of the properties must be initialized. When you make your var optional, you are initializing it as `nil`.
```
var centerContainer: MMDrawerController?
``` |
167,840 | I recently switched from Win 7 to Ubuntu 12.04...Best day of my life :)
I have a question relating to my Vodafone K3772-Z USB modem. When I plug it in, the lights start flashing on the device, meaning that it is functional. In the network menu I get a "Wired network Vodafone K3772-Z disconnected". I have set up the a ... | 2012/07/25 | [
"https://askubuntu.com/questions/167840",
"https://askubuntu.com",
"https://askubuntu.com/users/79131/"
] | Okay so I have kind of an answer. This might help some of the other South Africans out there that are struggling with 3G connections on Ubuntu 12.04. If I go to the terminal and type `gksudo gnome-ppp` (of course gnome-ppp must be installed, but you can also use wvdial) and click on Setup and then on Detect, it detects... | Just bought a Vodafone K3772-Z USB modem. Could not get it to work at all in 12.04 but, I have dual boot Windows 7 and 12.04.
Boot into Windows 7 and allow the Vodafone K3772-Z USB modem to register, install and check that its working. Then reboot back into Ubuntu.
Click on **Network Manager** indicator → **Edit Con... |
167,840 | I recently switched from Win 7 to Ubuntu 12.04...Best day of my life :)
I have a question relating to my Vodafone K3772-Z USB modem. When I plug it in, the lights start flashing on the device, meaning that it is functional. In the network menu I get a "Wired network Vodafone K3772-Z disconnected". I have set up the a ... | 2012/07/25 | [
"https://askubuntu.com/questions/167840",
"https://askubuntu.com",
"https://askubuntu.com/users/79131/"
] | Okay so I have kind of an answer. This might help some of the other South Africans out there that are struggling with 3G connections on Ubuntu 12.04. If I go to the terminal and type `gksudo gnome-ppp` (of course gnome-ppp must be installed, but you can also use wvdial) and click on Setup and then on Detect, it detects... | You can use [SAKIS3G](http://www.sakis3g.org/) to form a connection without unlocking it. I never unlocked the device and it worked fine.
NOTE: I could also use another network's sim on a network locked device using SAKIS3G. |
167,840 | I recently switched from Win 7 to Ubuntu 12.04...Best day of my life :)
I have a question relating to my Vodafone K3772-Z USB modem. When I plug it in, the lights start flashing on the device, meaning that it is functional. In the network menu I get a "Wired network Vodafone K3772-Z disconnected". I have set up the a ... | 2012/07/25 | [
"https://askubuntu.com/questions/167840",
"https://askubuntu.com",
"https://askubuntu.com/users/79131/"
] | You can use [SAKIS3G](http://www.sakis3g.org/) to form a connection without unlocking it. I never unlocked the device and it worked fine.
NOTE: I could also use another network's sim on a network locked device using SAKIS3G. | Just bought a Vodafone K3772-Z USB modem. Could not get it to work at all in 12.04 but, I have dual boot Windows 7 and 12.04.
Boot into Windows 7 and allow the Vodafone K3772-Z USB modem to register, install and check that its working. Then reboot back into Ubuntu.
Click on **Network Manager** indicator → **Edit Con... |
167,840 | I recently switched from Win 7 to Ubuntu 12.04...Best day of my life :)
I have a question relating to my Vodafone K3772-Z USB modem. When I plug it in, the lights start flashing on the device, meaning that it is functional. In the network menu I get a "Wired network Vodafone K3772-Z disconnected". I have set up the a ... | 2012/07/25 | [
"https://askubuntu.com/questions/167840",
"https://askubuntu.com",
"https://askubuntu.com/users/79131/"
] | Okay so I have kind of an answer. This might help some of the other South Africans out there that are struggling with 3G connections on Ubuntu 12.04. If I go to the terminal and type `gksudo gnome-ppp` (of course gnome-ppp must be installed, but you can also use wvdial) and click on Setup and then on Detect, it detects... | The best way is to unlock the card is from Windows:
1. Connect to your vendor from Windows (unlock the stick)
2. Reboot and boot from Ubuntu (do not unplug the usb stick)
3. Connect from Ubuntu
This procedure must be repeated every time you need to use the stick from Ubuntu.
Hope an easier solution will be occur soo... |
167,840 | I recently switched from Win 7 to Ubuntu 12.04...Best day of my life :)
I have a question relating to my Vodafone K3772-Z USB modem. When I plug it in, the lights start flashing on the device, meaning that it is functional. In the network menu I get a "Wired network Vodafone K3772-Z disconnected". I have set up the a ... | 2012/07/25 | [
"https://askubuntu.com/questions/167840",
"https://askubuntu.com",
"https://askubuntu.com/users/79131/"
] | This worked for me.
This is for new vodafone data card, model K3772. I had the problem of getting detected, Follow these steps, it really worked for me (not tested with model no:k3772-Z as my model is K3772):
Create a file named 12d1:1526 in the folder `/etc/usb_modeswitch.d`.
Edit it and fill it with this text:
Co... | You can use [SAKIS3G](http://www.sakis3g.org/) to form a connection without unlocking it. I never unlocked the device and it worked fine.
NOTE: I could also use another network's sim on a network locked device using SAKIS3G. |
167,840 | I recently switched from Win 7 to Ubuntu 12.04...Best day of my life :)
I have a question relating to my Vodafone K3772-Z USB modem. When I plug it in, the lights start flashing on the device, meaning that it is functional. In the network menu I get a "Wired network Vodafone K3772-Z disconnected". I have set up the a ... | 2012/07/25 | [
"https://askubuntu.com/questions/167840",
"https://askubuntu.com",
"https://askubuntu.com/users/79131/"
] | This worked for me.
This is for new vodafone data card, model K3772. I had the problem of getting detected, Follow these steps, it really worked for me (not tested with model no:k3772-Z as my model is K3772):
Create a file named 12d1:1526 in the folder `/etc/usb_modeswitch.d`.
Edit it and fill it with this text:
Co... | Just bought a Vodafone K3772-Z USB modem. Could not get it to work at all in 12.04 but, I have dual boot Windows 7 and 12.04.
Boot into Windows 7 and allow the Vodafone K3772-Z USB modem to register, install and check that its working. Then reboot back into Ubuntu.
Click on **Network Manager** indicator → **Edit Con... |
167,840 | I recently switched from Win 7 to Ubuntu 12.04...Best day of my life :)
I have a question relating to my Vodafone K3772-Z USB modem. When I plug it in, the lights start flashing on the device, meaning that it is functional. In the network menu I get a "Wired network Vodafone K3772-Z disconnected". I have set up the a ... | 2012/07/25 | [
"https://askubuntu.com/questions/167840",
"https://askubuntu.com",
"https://askubuntu.com/users/79131/"
] | You can use [SAKIS3G](http://www.sakis3g.org/) to form a connection without unlocking it. I never unlocked the device and it worked fine.
NOTE: I could also use another network's sim on a network locked device using SAKIS3G. | This is for new vodafone data card, model K3772. I had the problem of getting detected, Follow these steps, it really worked for me (not tested with model no:k3772-Z as my model is K3772):
Create a file named `12d1:1526` in the folder `/etc/usb_modeswitch.d`.
Edit it and fill it with this text:
```
Code:
TargetVe... |
167,840 | I recently switched from Win 7 to Ubuntu 12.04...Best day of my life :)
I have a question relating to my Vodafone K3772-Z USB modem. When I plug it in, the lights start flashing on the device, meaning that it is functional. In the network menu I get a "Wired network Vodafone K3772-Z disconnected". I have set up the a ... | 2012/07/25 | [
"https://askubuntu.com/questions/167840",
"https://askubuntu.com",
"https://askubuntu.com/users/79131/"
] | This worked for me.
This is for new vodafone data card, model K3772. I had the problem of getting detected, Follow these steps, it really worked for me (not tested with model no:k3772-Z as my model is K3772):
Create a file named 12d1:1526 in the folder `/etc/usb_modeswitch.d`.
Edit it and fill it with this text:
Co... | This is for new vodafone data card, model K3772. I had the problem of getting detected, Follow these steps, it really worked for me (not tested with model no:k3772-Z as my model is K3772):
Create a file named `12d1:1526` in the folder `/etc/usb_modeswitch.d`.
Edit it and fill it with this text:
```
Code:
TargetVe... |
167,840 | I recently switched from Win 7 to Ubuntu 12.04...Best day of my life :)
I have a question relating to my Vodafone K3772-Z USB modem. When I plug it in, the lights start flashing on the device, meaning that it is functional. In the network menu I get a "Wired network Vodafone K3772-Z disconnected". I have set up the a ... | 2012/07/25 | [
"https://askubuntu.com/questions/167840",
"https://askubuntu.com",
"https://askubuntu.com/users/79131/"
] | TO detail the above for vodafone data card K3372, Create a file name by using terminal (or CRTL+ALT+T) and type `sudo gedit /etc/usb_modeswitch.d/12d1:1526` now add the following code:
```
TargetVendor= 0x12d1
TargetProduct= 0x14bc
MessageContent="55534243123456780002000080000a11062000000000000100000000000000"
```
a... | Just bought a Vodafone K3772-Z USB modem. Could not get it to work at all in 12.04 but, I have dual boot Windows 7 and 12.04.
Boot into Windows 7 and allow the Vodafone K3772-Z USB modem to register, install and check that its working. Then reboot back into Ubuntu.
Click on **Network Manager** indicator → **Edit Con... |
167,840 | I recently switched from Win 7 to Ubuntu 12.04...Best day of my life :)
I have a question relating to my Vodafone K3772-Z USB modem. When I plug it in, the lights start flashing on the device, meaning that it is functional. In the network menu I get a "Wired network Vodafone K3772-Z disconnected". I have set up the a ... | 2012/07/25 | [
"https://askubuntu.com/questions/167840",
"https://askubuntu.com",
"https://askubuntu.com/users/79131/"
] | TO detail the above for vodafone data card K3372, Create a file name by using terminal (or CRTL+ALT+T) and type `sudo gedit /etc/usb_modeswitch.d/12d1:1526` now add the following code:
```
TargetVendor= 0x12d1
TargetProduct= 0x14bc
MessageContent="55534243123456780002000080000a11062000000000000100000000000000"
```
a... | You can use [SAKIS3G](http://www.sakis3g.org/) to form a connection without unlocking it. I never unlocked the device and it worked fine.
NOTE: I could also use another network's sim on a network locked device using SAKIS3G. |
16,376 | I've currently got a Fedora 21 system that's set up *exactly* the way I like it. I've had to mess with SELinux a fair bit, and its a pain to get all that redone, so my usual method of cp and reinstall will not quite work.
I'd like to be able to back up my system essentially the same way I back up my Windows systems - ... | 2015/01/18 | [
"https://softwarerecs.stackexchange.com/questions/16376",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/125/"
] | SELinux uses extended attributes, right?
So I think you're right that `cp -a / /backup` wouldn't work.
`nice ionice -c3 rsync --dry-run --one-file-system -aAHX --stats -h /src /dest/`
should copy everything you need. (Trailing `/` or not on the src matters, so make sure your files are going where you want, after sta... | [fsarchiver](http://www.fsarchiver.org/) looks pretty nice. I'm not sure how much incremental-backup support it has, as it looks like it aims to be more of a dumpfs / restorefs. It can do mulithreaded [compression](http://www.fsarchiver.org/Compression); it maps 1-9 to a choice of lzo/gzip/bzip2/lzma with different set... |
16,376 | I've currently got a Fedora 21 system that's set up *exactly* the way I like it. I've had to mess with SELinux a fair bit, and its a pain to get all that redone, so my usual method of cp and reinstall will not quite work.
I'd like to be able to back up my system essentially the same way I back up my Windows systems - ... | 2015/01/18 | [
"https://softwarerecs.stackexchange.com/questions/16376",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/125/"
] | I've not tried this myself, but yesterday stumbled upon **[Systemback](http://sourceforge.net/projects/systemback/ "Systemback at Sourceforge")**, which claims to do exactly that:
>
> Systemback makes it easy to create backups of system and users configuration files. In case of problems you can easily restore the pre... | [fsarchiver](http://www.fsarchiver.org/) looks pretty nice. I'm not sure how much incremental-backup support it has, as it looks like it aims to be more of a dumpfs / restorefs. It can do mulithreaded [compression](http://www.fsarchiver.org/Compression); it maps 1-9 to a choice of lzo/gzip/bzip2/lzma with different set... |
56,943,008 | I am looking for a way that I can develop an app cheaply for a very specific use.
Specifically, I would like to create an game that can be played online between different phones.
I have some coding and development experience, and I would like to make the app iOS compatible (initially... open to Android integration l... | 2019/07/08 | [
"https://Stackoverflow.com/questions/56943008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11756696/"
] | One thing to consider is what are the game performance requirements?
If it is a simple game, using a [Javascript game engine](https://github.com/bebraw/jswiki/wiki/Game-Engines) may be a better option as it can be hosted on a server (and viewed in a browser) to start with, and later bundled in a progressive web app w... | I'm not an expert but I think this question should be moved to a different Stack Exchange website.
Anyway, if you want to distribute your app to iOS real devices through the App Store, you will have to pay the $99 yearly membership.
There is also a [free Apple Developer Program](https://developer.apple.com/support/... |
56,943,008 | I am looking for a way that I can develop an app cheaply for a very specific use.
Specifically, I would like to create an game that can be played online between different phones.
I have some coding and development experience, and I would like to make the app iOS compatible (initially... open to Android integration l... | 2019/07/08 | [
"https://Stackoverflow.com/questions/56943008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11756696/"
] | One thing to consider is what are the game performance requirements?
If it is a simple game, using a [Javascript game engine](https://github.com/bebraw/jswiki/wiki/Game-Engines) may be a better option as it can be hosted on a server (and viewed in a browser) to start with, and later bundled in a progressive web app w... | To developp on Android, it's free, you just pay if you want to publish the app on store.
For ios, you can't do anything without creating a developper account, so pay $99.
You're always able to use a cross-platform langage (react native, flutter for ex.) but as soon as you want to deploy on real apple device, you'll n... |
27,667,069 | In a subclass of `UIView` I declared a property. This property is an instance of `UIPanGestureRecognizer` and is not optional or implicitly unwrapped. Here is the code:
```
class DraggableView: UIView {
let panGestureRecognizer: UIPanGestureRecognizer
override init() {
panGestureRecognizer = UIPanGe... | 2014/12/27 | [
"https://Stackoverflow.com/questions/27667069",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3068061/"
] | The problem is that `self` doesn't exist before `super.init()` has happened.
You can create it in two steps - initialise at declaration time:
```
let panGestureRecognizer = UIPanGestureRecognizer()
```
Then after `super.init()`, add the target:
```
panGestureRecognizer.addTarget(self, action: "dragged:")
```
Al... | You can declare the property as `lazy`, but at the cost of turning it into a mutable:
```
lazy var panGestureRecognizer: UIPanGestureRecognizer = UIPanGestureRecognizer(target: self, action: "dragged:")
```
However I recommend making it an implicitly unwrapped optional - that's the pattern commonly used in view cont... |
19,924,520 | ```
import threading
shared_balance = 0
class Deposit(threading.Thread):
def run(self):
for i in xrange(1000000):
global shared_balance
balance = shared_balance
balance += 100
shared_balance = balance
class Withdraw(threading.Thread):
def run(self):
... | 2013/11/12 | [
"https://Stackoverflow.com/questions/19924520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2006347/"
] | You need to use [threading.Lock](http://docs.python.org/2/library/threading.html#lock-objects) to access you variables safely :
```
from threading import Thread, Lock
shared_balance = 0
class Deposit(Thread):
def __init__(self, lock):
super(Deposit, self).__init__()
self.lock = lock
def run(... | from here <http://effbot.org/zone/thread-synchronization.htm>
The reason for this is that the increment/decrement operation is actually executed in three steps; first, the interpreter fetches the current value of the counter, then it calculates the new value, and finally, it writes the new value back to the variable.
... |
19,924,520 | ```
import threading
shared_balance = 0
class Deposit(threading.Thread):
def run(self):
for i in xrange(1000000):
global shared_balance
balance = shared_balance
balance += 100
shared_balance = balance
class Withdraw(threading.Thread):
def run(self):
... | 2013/11/12 | [
"https://Stackoverflow.com/questions/19924520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2006347/"
] | You need to use [threading.Lock](http://docs.python.org/2/library/threading.html#lock-objects) to access you variables safely :
```
from threading import Thread, Lock
shared_balance = 0
class Deposit(Thread):
def __init__(self, lock):
super(Deposit, self).__init__()
self.lock = lock
def run(... | I think it's kind of the [reader writer problem](http://en.wikipedia.org/wiki/Readers%E2%80%93writers_problem)
Your problem seems to be here:
```
balance = shared_balance
balance += 100
```
Think about what happens, when you have the following execution order:
```
[...]
deposit thread: balance = shared_balance
... |
19,924,520 | ```
import threading
shared_balance = 0
class Deposit(threading.Thread):
def run(self):
for i in xrange(1000000):
global shared_balance
balance = shared_balance
balance += 100
shared_balance = balance
class Withdraw(threading.Thread):
def run(self):
... | 2013/11/12 | [
"https://Stackoverflow.com/questions/19924520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2006347/"
] | You need to use [threading.Lock](http://docs.python.org/2/library/threading.html#lock-objects) to access you variables safely :
```
from threading import Thread, Lock
shared_balance = 0
class Deposit(Thread):
def __init__(self, lock):
super(Deposit, self).__init__()
self.lock = lock
def run(... | Try `lock.acquire()` and `lock.release()` to fix your problem:
sorry for duplicating some code. I have marked the changes:
```
lock = threading.Lock()
class Deposit(threading.Thread):
def run(self):
for i in xrange(1000000):
lock.acquire() <==============================
global shared... |
19,924,520 | ```
import threading
shared_balance = 0
class Deposit(threading.Thread):
def run(self):
for i in xrange(1000000):
global shared_balance
balance = shared_balance
balance += 100
shared_balance = balance
class Withdraw(threading.Thread):
def run(self):
... | 2013/11/12 | [
"https://Stackoverflow.com/questions/19924520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2006347/"
] | You need to use [threading.Lock](http://docs.python.org/2/library/threading.html#lock-objects) to access you variables safely :
```
from threading import Thread, Lock
shared_balance = 0
class Deposit(Thread):
def __init__(self, lock):
super(Deposit, self).__init__()
self.lock = lock
def run(... | You use two thread to operator one shared\_balance, the result is unforeseen.
For example,
now shared\_balance = 0
if thread1 do:
```
balance = shared_balance
balance += 100
```
now thread1 balance =100 shared\_balance=0
then it turns to thread2:
```
balance = shared_balance
balance -= 100
... |
351,218 | I just posted to our blog about our [Third Quarter Community Roadmap for 2020](https://stackoverflow.blog/2020/07/23/the-loop-our-community-roadmap-for-q3-2020/).
[![Q3 2020 Community Roadmap. For July: "Community at our Center": Training Launch and New Moderator Agreement. "Community Builders": Review Queue: Reviewer... | 2020/07/23 | [
"https://meta.stackexchange.com/questions/351218",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/139284/"
] | A question after the `alt` stuff (and how Mith ended up doing it in the end) - you speak of inclusivity training. What areas in particular?
(The `alt` stuff, or rather, non-descriptive `alt` or info only available in low-qual pictures, hurts anybody with vision impairment. That's why it's important. If you're interest... | Since I'm in the middle of trying to get some moderation in place on the *moderator* end of things, and rustling up some missing functionality - does this involve retrofitting moderation tools into the "legacy" [TL](https://meta.stackexchange.com/tags/teachers-lounge/info), or enhancing the temp-permanent one on the MS... |
351,218 | I just posted to our blog about our [Third Quarter Community Roadmap for 2020](https://stackoverflow.blog/2020/07/23/the-loop-our-community-roadmap-for-q3-2020/).
[![Q3 2020 Community Roadmap. For July: "Community at our Center": Training Launch and New Moderator Agreement. "Community Builders": Review Queue: Reviewer... | 2020/07/23 | [
"https://meta.stackexchange.com/questions/351218",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/139284/"
] | Some sites have asked to have their vote to close threshold lowered, from 5 to 3.
It's something that would be really nice, and while some CMs had access to do it in the past, now they do not. As it requires a dev to help our CM, could this be on the roadmap? It's maybe not a big item, but some sites are waiting for s... | Your efforts are very much appreciated!
I find it extremely encouraging that you managed to get onto a path that seems to combine very different interests: On the one hand, the legitimate business need to attract users and paying customers. On the other hand, such core elements like improving moderation culture and to... |
351,218 | I just posted to our blog about our [Third Quarter Community Roadmap for 2020](https://stackoverflow.blog/2020/07/23/the-loop-our-community-roadmap-for-q3-2020/).
[![Q3 2020 Community Roadmap. For July: "Community at our Center": Training Launch and New Moderator Agreement. "Community Builders": Review Queue: Reviewer... | 2020/07/23 | [
"https://meta.stackexchange.com/questions/351218",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/139284/"
] | **Update:** Y'all should *really* be looking at how GitHub does this: <https://github.com/github/roadmap>
Just a *brilliant* bit of information design. Each task follows a consistent format:
1. **Summary** - a succinct, clear description of the task.
2. **Intended Outcome** - the expected result of the task's success... | A question after the `alt` stuff (and how Mith ended up doing it in the end) - you speak of inclusivity training. What areas in particular?
(The `alt` stuff, or rather, non-descriptive `alt` or info only available in low-qual pictures, hurts anybody with vision impairment. That's why it's important. If you're interest... |
351,218 | I just posted to our blog about our [Third Quarter Community Roadmap for 2020](https://stackoverflow.blog/2020/07/23/the-loop-our-community-roadmap-for-q3-2020/).
[![Q3 2020 Community Roadmap. For July: "Community at our Center": Training Launch and New Moderator Agreement. "Community Builders": Review Queue: Reviewer... | 2020/07/23 | [
"https://meta.stackexchange.com/questions/351218",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/139284/"
] | A question after the `alt` stuff (and how Mith ended up doing it in the end) - you speak of inclusivity training. What areas in particular?
(The `alt` stuff, or rather, non-descriptive `alt` or info only available in low-qual pictures, hurts anybody with vision impairment. That's why it's important. If you're interest... | Regarding the "**Iterating on educational emails** (September)" item, isn't it *generally* too late to tell a new user how the site works after they've signed up and asked their first question?
Hopefully, the new user has read the site's tour page, but that lacks some essential knowledge, such as emphasising that down... |
351,218 | I just posted to our blog about our [Third Quarter Community Roadmap for 2020](https://stackoverflow.blog/2020/07/23/the-loop-our-community-roadmap-for-q3-2020/).
[![Q3 2020 Community Roadmap. For July: "Community at our Center": Training Launch and New Moderator Agreement. "Community Builders": Review Queue: Reviewer... | 2020/07/23 | [
"https://meta.stackexchange.com/questions/351218",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/139284/"
] | Since I'm in the middle of trying to get some moderation in place on the *moderator* end of things, and rustling up some missing functionality - does this involve retrofitting moderation tools into the "legacy" [TL](https://meta.stackexchange.com/tags/teachers-lounge/info), or enhancing the temp-permanent one on the MS... | >
> Downvotes research (July)
>
>
> Receiving downvotes on Stack Overflow can be a frustrating and
> confusing experience. We currently ask users to downvote posts that
> are not useful or are unclear, but this can be subjective and
> interpreted in different ways. We will run a short targeted onsite
> survey to bet... |
351,218 | I just posted to our blog about our [Third Quarter Community Roadmap for 2020](https://stackoverflow.blog/2020/07/23/the-loop-our-community-roadmap-for-q3-2020/).
[![Q3 2020 Community Roadmap. For July: "Community at our Center": Training Launch and New Moderator Agreement. "Community Builders": Review Queue: Reviewer... | 2020/07/23 | [
"https://meta.stackexchange.com/questions/351218",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/139284/"
] | The blog post implies that "Downvotes Research" is going to be limited to Stack Overflow here. I suspect you'll find very different results if you also start looking at the more subjective sites instead of just the technically oriented ones, and especially the sites which deal with more controversial topics (e.g. [IPS]... | Some sites have asked to have their vote to close threshold lowered, from 5 to 3.
It's something that would be really nice, and while some CMs had access to do it in the past, now they do not. As it requires a dev to help our CM, could this be on the roadmap? It's maybe not a big item, but some sites are waiting for s... |
351,218 | I just posted to our blog about our [Third Quarter Community Roadmap for 2020](https://stackoverflow.blog/2020/07/23/the-loop-our-community-roadmap-for-q3-2020/).
[![Q3 2020 Community Roadmap. For July: "Community at our Center": Training Launch and New Moderator Agreement. "Community Builders": Review Queue: Reviewer... | 2020/07/23 | [
"https://meta.stackexchange.com/questions/351218",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/139284/"
] | Since I'm in the middle of trying to get some moderation in place on the *moderator* end of things, and rustling up some missing functionality - does this involve retrofitting moderation tools into the "legacy" [TL](https://meta.stackexchange.com/tags/teachers-lounge/info), or enhancing the temp-permanent one on the MS... | Your efforts are very much appreciated!
I find it extremely encouraging that you managed to get onto a path that seems to combine very different interests: On the one hand, the legitimate business need to attract users and paying customers. On the other hand, such core elements like improving moderation culture and to... |
351,218 | I just posted to our blog about our [Third Quarter Community Roadmap for 2020](https://stackoverflow.blog/2020/07/23/the-loop-our-community-roadmap-for-q3-2020/).
[![Q3 2020 Community Roadmap. For July: "Community at our Center": Training Launch and New Moderator Agreement. "Community Builders": Review Queue: Reviewer... | 2020/07/23 | [
"https://meta.stackexchange.com/questions/351218",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/139284/"
] | **Update:** Y'all should *really* be looking at how GitHub does this: <https://github.com/github/roadmap>
Just a *brilliant* bit of information design. Each task follows a consistent format:
1. **Summary** - a succinct, clear description of the task.
2. **Intended Outcome** - the expected result of the task's success... | Since I'm in the middle of trying to get some moderation in place on the *moderator* end of things, and rustling up some missing functionality - does this involve retrofitting moderation tools into the "legacy" [TL](https://meta.stackexchange.com/tags/teachers-lounge/info), or enhancing the temp-permanent one on the MS... |
351,218 | I just posted to our blog about our [Third Quarter Community Roadmap for 2020](https://stackoverflow.blog/2020/07/23/the-loop-our-community-roadmap-for-q3-2020/).
[![Q3 2020 Community Roadmap. For July: "Community at our Center": Training Launch and New Moderator Agreement. "Community Builders": Review Queue: Reviewer... | 2020/07/23 | [
"https://meta.stackexchange.com/questions/351218",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/139284/"
] | The blog post implies that "Downvotes Research" is going to be limited to Stack Overflow here. I suspect you'll find very different results if you also start looking at the more subjective sites instead of just the technically oriented ones, and especially the sites which deal with more controversial topics (e.g. [IPS]... | >
> Downvotes research (July)
>
>
> Receiving downvotes on Stack Overflow can be a frustrating and
> confusing experience. We currently ask users to downvote posts that
> are not useful or are unclear, but this can be subjective and
> interpreted in different ways. We will run a short targeted onsite
> survey to bet... |
351,218 | I just posted to our blog about our [Third Quarter Community Roadmap for 2020](https://stackoverflow.blog/2020/07/23/the-loop-our-community-roadmap-for-q3-2020/).
[![Q3 2020 Community Roadmap. For July: "Community at our Center": Training Launch and New Moderator Agreement. "Community Builders": Review Queue: Reviewer... | 2020/07/23 | [
"https://meta.stackexchange.com/questions/351218",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/139284/"
] | I'd just like to take the time to give a quick thank you to Yaakov and the team for a quick response to some of the concerns raised about this blog post.
In [Discord](https://discord.gg/XkuSNvq), a concern was raised about how D&I training was mentioned for *moderators*, but there was no mention of that same training ... | Your efforts are very much appreciated!
I find it extremely encouraging that you managed to get onto a path that seems to combine very different interests: On the one hand, the legitimate business need to attract users and paying customers. On the other hand, such core elements like improving moderation culture and to... |
4,386,383 | In most texts I have seen applying function $f$ to an element $x$ is denoted by $f(x)$, as opposed to $xf$ or $(x)f$ or $x(f)$. This makes function composition inconvenient. Given a diagram $A \xrightarrow{f} B \xrightarrow{g} C$ I need to write $f$ and $g$ in the opposite order of how I read them off from the diagram:... | 2022/02/19 | [
"https://math.stackexchange.com/questions/4386383",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/647541/"
] | It is perfectly possible to write functions on the right, like $xf$ or $x^f$, and this is commonly done in some areas, for example, with permutations in group theory. A consequence is that a product of cycles multiplies from left to right, exactly as you mention above, rather than right to left which can seem "backward... | To add to @Ted's answer.
I think it has its origin in our usage (in Europe & the US) of language. We say "a function applied to", which suggest to write $f(x)$. However, for the same reason, we tend to read functional composition (as you pointed out) from left to right. So, it is a matter of what you want to put your ... |
13,621,176 | this is my code :
```
public class Test {
public static void main(String[] args) throws Exception {
String logPath = "D:\\mywork\\OMS\\Tymon\\testlog\\testlog.log";
File file = new File(logPath);
SchedulerFactory schedFact = new StdSchedulerFactory();
Scheduler sched = schedFact.getScheduler();
sched.start... | 2012/11/29 | [
"https://Stackoverflow.com/questions/13621176",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1384569/"
] | That is because `B` defines a different `f`, which *hides* the `f` inherited from `A`. If you want both available in `B` (which is likely), you must bring it into scope with a *using-declaration:*
```
class B : public A
{
void f() {}
using A::f;
};
```
This behaviour is specified in [class.member.loopkup], espec... | When you declare `void f()` in `B`, this *hides* the `void f(int)` inherited from `A`. You can bring it back into scope with `using`:
```
class B: public A
{
public:
void f() {}
using A::f;
};
``` |
13,621,176 | this is my code :
```
public class Test {
public static void main(String[] args) throws Exception {
String logPath = "D:\\mywork\\OMS\\Tymon\\testlog\\testlog.log";
File file = new File(logPath);
SchedulerFactory schedFact = new StdSchedulerFactory();
Scheduler sched = schedFact.getScheduler();
sched.start... | 2012/11/29 | [
"https://Stackoverflow.com/questions/13621176",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1384569/"
] | That is because `B` defines a different `f`, which *hides* the `f` inherited from `A`. If you want both available in `B` (which is likely), you must bring it into scope with a *using-declaration:*
```
class B : public A
{
void f() {}
using A::f;
};
```
This behaviour is specified in [class.member.loopkup], espec... | This is called Hiding - you can check the [C++ FAQ Entry](http://www.parashift.com/c++-faq/hiding-rule.html). It describes the problem and the solution. |
13,621,176 | this is my code :
```
public class Test {
public static void main(String[] args) throws Exception {
String logPath = "D:\\mywork\\OMS\\Tymon\\testlog\\testlog.log";
File file = new File(logPath);
SchedulerFactory schedFact = new StdSchedulerFactory();
Scheduler sched = schedFact.getScheduler();
sched.start... | 2012/11/29 | [
"https://Stackoverflow.com/questions/13621176",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1384569/"
] | When you declare `void f()` in `B`, this *hides* the `void f(int)` inherited from `A`. You can bring it back into scope with `using`:
```
class B: public A
{
public:
void f() {}
using A::f;
};
``` | This is called Hiding - you can check the [C++ FAQ Entry](http://www.parashift.com/c++-faq/hiding-rule.html). It describes the problem and the solution. |
6,743,605 | I have an asp page that contains a lot of data, images and objects -- and I want to know the size and the weight of those images and objects.
Is there any tool that can give me these kinds of details? | 2011/07/19 | [
"https://Stackoverflow.com/questions/6743605",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/851458/"
] | You can use [YSlow](http://developer.yahoo.com/yslow/) in Firefox (and maybe other browsers); it will give you the info you need, separated by type. It also gives lots of information regarding cache usage and good practices | You might also try [Fiddler](http://www.fiddler2.com/fiddler2/). It tell you the size (in bytes) of each script, image, css, html, etc loaded during a particular page load. |
16,865,918 | I decided to learn Haskell and also learn to think in a more functional way, so I'm trying to solve very simple exercises trying to use a good approach in this paradigm.
I'm trying to achieve this simple exercise in Haskell:
```
Input: [2, 4, 1, 1, 2]
Output: [True, True, False, False, False, False, True, False, True... | 2013/05/31 | [
"https://Stackoverflow.com/questions/16865918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2415602/"
] | Another solution
```
row :: [Integer] -> [Bool]
row ns = r' True ns
where
r' :: Bool -> [Integer] -> [Bool]
r' b (n:ns) = replicate b n : r' (not b) ns
r' b [] = []
```
(Not tested) | Here is how i would do this.
```
row [] = []
row xs = row' xs 0
where row' xs i
| i >= length xs = []
| otherwise = (take (xs !! i) (repeat (isOdd i))) ++ (row' xs (i+1))
isOdd n = n `rem` 2 == 1
```
But I don't have ghc on this computer to test it. |
16,865,918 | I decided to learn Haskell and also learn to think in a more functional way, so I'm trying to solve very simple exercises trying to use a good approach in this paradigm.
I'm trying to achieve this simple exercise in Haskell:
```
Input: [2, 4, 1, 1, 2]
Output: [True, True, False, False, False, False, True, False, True... | 2013/05/31 | [
"https://Stackoverflow.com/questions/16865918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2415602/"
] | You want to transform each element in the input list into a sequence of as many equal `Bool`s as the element says, and you want the `Bool` be `True` if the index of the number in the input list is even, and `False` if the index is odd.
For that, you don't need the index, and it is better avoided - that gives simpler a... | ```
row :: [Integer] -> [Bool]
row xs = row' xs True
row' [] _ = []
row' (x:xs) b = (replicate x b) ++ (row' xs (not b))
``` |
16,865,918 | I decided to learn Haskell and also learn to think in a more functional way, so I'm trying to solve very simple exercises trying to use a good approach in this paradigm.
I'm trying to achieve this simple exercise in Haskell:
```
Input: [2, 4, 1, 1, 2]
Output: [True, True, False, False, False, False, True, False, True... | 2013/05/31 | [
"https://Stackoverflow.com/questions/16865918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2415602/"
] | It seems you already figured out that you can use `zip` to pair the elements with their indices. For each index `i` and the corresponding element `n`, you want to produce `n` copies of a boolean value (with `replicate`) and this boolean value depends on whether `i` is odd or even. This means `map`ping each tuple `(i, n... | I interepret
>
> Traverse the Input list, if the i ᵗʰ item is in a pair position,
> append to output True i times to Output; if the i ᵗʰ item is in an odd
> position, append False i times to the Output list.
>
>
>
I see two ways to interpret this. "For all elements, if the i-th element is even, return True i t... |
16,865,918 | I decided to learn Haskell and also learn to think in a more functional way, so I'm trying to solve very simple exercises trying to use a good approach in this paradigm.
I'm trying to achieve this simple exercise in Haskell:
```
Input: [2, 4, 1, 1, 2]
Output: [True, True, False, False, False, False, True, False, True... | 2013/05/31 | [
"https://Stackoverflow.com/questions/16865918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2415602/"
] | ```
row :: [Integer] -> [Bool]
row xs = row' xs True
row' [] _ = []
row' (x:xs) b = (replicate x b) ++ (row' xs (not b))
``` | I interepret
>
> Traverse the Input list, if the i ᵗʰ item is in a pair position,
> append to output True i times to Output; if the i ᵗʰ item is in an odd
> position, append False i times to the Output list.
>
>
>
I see two ways to interpret this. "For all elements, if the i-th element is even, return True i t... |
16,865,918 | I decided to learn Haskell and also learn to think in a more functional way, so I'm trying to solve very simple exercises trying to use a good approach in this paradigm.
I'm trying to achieve this simple exercise in Haskell:
```
Input: [2, 4, 1, 1, 2]
Output: [True, True, False, False, False, False, True, False, True... | 2013/05/31 | [
"https://Stackoverflow.com/questions/16865918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2415602/"
] | You want to transform each element in the input list into a sequence of as many equal `Bool`s as the element says, and you want the `Bool` be `True` if the index of the number in the input list is even, and `False` if the index is odd.
For that, you don't need the index, and it is better avoided - that gives simpler a... | It seems you already figured out that you can use `zip` to pair the elements with their indices. For each index `i` and the corresponding element `n`, you want to produce `n` copies of a boolean value (with `replicate`) and this boolean value depends on whether `i` is odd or even. This means `map`ping each tuple `(i, n... |
16,865,918 | I decided to learn Haskell and also learn to think in a more functional way, so I'm trying to solve very simple exercises trying to use a good approach in this paradigm.
I'm trying to achieve this simple exercise in Haskell:
```
Input: [2, 4, 1, 1, 2]
Output: [True, True, False, False, False, False, True, False, True... | 2013/05/31 | [
"https://Stackoverflow.com/questions/16865918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2415602/"
] | It seems you already figured out that you can use `zip` to pair the elements with their indices. For each index `i` and the corresponding element `n`, you want to produce `n` copies of a boolean value (with `replicate`) and this boolean value depends on whether `i` is odd or even. This means `map`ping each tuple `(i, n... | Another solution
```
row :: [Integer] -> [Bool]
row ns = r' True ns
where
r' :: Bool -> [Integer] -> [Bool]
r' b (n:ns) = replicate b n : r' (not b) ns
r' b [] = []
```
(Not tested) |
16,865,918 | I decided to learn Haskell and also learn to think in a more functional way, so I'm trying to solve very simple exercises trying to use a good approach in this paradigm.
I'm trying to achieve this simple exercise in Haskell:
```
Input: [2, 4, 1, 1, 2]
Output: [True, True, False, False, False, False, True, False, True... | 2013/05/31 | [
"https://Stackoverflow.com/questions/16865918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2415602/"
] | You want to transform each element in the input list into a sequence of as many equal `Bool`s as the element says, and you want the `Bool` be `True` if the index of the number in the input list is even, and `False` if the index is odd.
For that, you don't need the index, and it is better avoided - that gives simpler a... | Another solution
```
row :: [Integer] -> [Bool]
row ns = r' True ns
where
r' :: Bool -> [Integer] -> [Bool]
r' b (n:ns) = replicate b n : r' (not b) ns
r' b [] = []
```
(Not tested) |
16,865,918 | I decided to learn Haskell and also learn to think in a more functional way, so I'm trying to solve very simple exercises trying to use a good approach in this paradigm.
I'm trying to achieve this simple exercise in Haskell:
```
Input: [2, 4, 1, 1, 2]
Output: [True, True, False, False, False, False, True, False, True... | 2013/05/31 | [
"https://Stackoverflow.com/questions/16865918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2415602/"
] | Another solution
```
row :: [Integer] -> [Bool]
row ns = r' True ns
where
r' :: Bool -> [Integer] -> [Bool]
r' b (n:ns) = replicate b n : r' (not b) ns
r' b [] = []
```
(Not tested) | I interepret
>
> Traverse the Input list, if the i ᵗʰ item is in a pair position,
> append to output True i times to Output; if the i ᵗʰ item is in an odd
> position, append False i times to the Output list.
>
>
>
I see two ways to interpret this. "For all elements, if the i-th element is even, return True i t... |
16,865,918 | I decided to learn Haskell and also learn to think in a more functional way, so I'm trying to solve very simple exercises trying to use a good approach in this paradigm.
I'm trying to achieve this simple exercise in Haskell:
```
Input: [2, 4, 1, 1, 2]
Output: [True, True, False, False, False, False, True, False, True... | 2013/05/31 | [
"https://Stackoverflow.com/questions/16865918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2415602/"
] | It seems you already figured out that you can use `zip` to pair the elements with their indices. For each index `i` and the corresponding element `n`, you want to produce `n` copies of a boolean value (with `replicate`) and this boolean value depends on whether `i` is odd or even. This means `map`ping each tuple `(i, n... | ```
row :: [Integer] -> [Bool]
row xs = row' xs True
row' [] _ = []
row' (x:xs) b = (replicate x b) ++ (row' xs (not b))
``` |
16,865,918 | I decided to learn Haskell and also learn to think in a more functional way, so I'm trying to solve very simple exercises trying to use a good approach in this paradigm.
I'm trying to achieve this simple exercise in Haskell:
```
Input: [2, 4, 1, 1, 2]
Output: [True, True, False, False, False, False, True, False, True... | 2013/05/31 | [
"https://Stackoverflow.com/questions/16865918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2415602/"
] | It seems you already figured out that you can use `zip` to pair the elements with their indices. For each index `i` and the corresponding element `n`, you want to produce `n` copies of a boolean value (with `replicate`) and this boolean value depends on whether `i` is odd or even. This means `map`ping each tuple `(i, n... | Here is how i would do this.
```
row [] = []
row xs = row' xs 0
where row' xs i
| i >= length xs = []
| otherwise = (take (xs !! i) (repeat (isOdd i))) ++ (row' xs (i+1))
isOdd n = n `rem` 2 == 1
```
But I don't have ghc on this computer to test it. |
591,526 | If $f: R \rightarrow S$ is a homomorphism of rings with kernel $K$, and $I$ is an ideal in $R$ such that $I \subset K$.
The hypothesis is that the map $\overline{f}: R/I \rightarrow S$ given by $\overline{f}(r+I)=f(r)$ is a well-defined homomorphism.
For the well-defined part, I know that I need to somehow show that ... | 2013/12/03 | [
"https://math.stackexchange.com/questions/591526",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/75343/"
] | Let's write out what it means for $r+I=s+I$, and then show that finally $f(r)=f(s)$.
We know that means $r-s\in I$. Since $r-s\in I\subseteq ker(f)$, this would imply that $f(r-s)=0$, and hence that $f(r)=f(s)$. Thus $r+I=s+I$ implies $f(r)=f(s)$, and thus the map is well defined.
As for the other computation:
$\ove... | If , $a=b$ then its clear that $a+I=b+I \implies \bar f(a)= \bar f(b)$ .
Sorry , after @rshweib made a important remark , the implication follows because
$a+I=b+I$ means $a-b \in I$ ie . $f(a-b)=0$ hence $f(a)=f(b)$
For the second part $$\bar f (ab) = f(ab+I) = f((a+I)(b+I))= f(a+I)\cdot f(b+I) = \bar f(a)\bar f(b)$$... |
65,785,269 | I'm just wondering is there any way to made this script (<https://www.cirriustech.co.uk/blog/how-to-auto-tidy-files-in-google-drive/>) working on specific folder in my drive.
I have a project made using google forms and sheets, in google forms there is an upload form which the files saved to specific folder. My master... | 2021/01/19 | [
"https://Stackoverflow.com/questions/65785269",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15034182/"
] | `POINTER(*ctypes-type*)` declares a pointer *type* and its parameter must be a `ctypes` type, so below was incorrect:
```
mylong = c_long(8888) # Creates a ctypes instance, not a type.
p_mylong = POINTER(mylong) # error
```
When you create a ctype to hold the output parameter, simply create an instance of th... | I modified your code a little to Change the definitions to match. Following the ideas in the answer to [Passing pointers to DLL function in Python](https://stackoverflow.com/questions/51289410/passing-pointers-to-dll-function-in-python) , this may help
```
from ctypes import *
import os
adr = os.getcwd()
dll = CDLL(a... |
37,996,809 | I have dowloaded the Bootstrap `bootstrap-3.3.6-dist` and placed the 3 direcories `css, Fonts, and js` as well as the index.html file inside the same direcotry as in the Screen shoot but when placing the code of this template
<http://getbootstrap.com/examples/starter-template/>
and run the code in the browser I am n... | 2016/06/23 | [
"https://Stackoverflow.com/questions/37996809",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4761252/"
] | The Problem is that the paths you specified in the HTML file (`../../dist/css/bootstrap.min.css`) are not existing.
You either need to update all your paths in the HTML file e.g. to:
```
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/bootstrap.min.js"></script>
```
Or you move your files accor... | your css and js folders are in the same folder that contain index.html file. and you give some different path for calling css and js files so please replace
```
<link href="../../dist/css/bootstrap.min.css" rel="stylesheet">
```
to
```
<link href="css/bootstrap.min.css" rel="stylesheet">
```
and
```
<script src... |
37,996,809 | I have dowloaded the Bootstrap `bootstrap-3.3.6-dist` and placed the 3 direcories `css, Fonts, and js` as well as the index.html file inside the same direcotry as in the Screen shoot but when placing the code of this template
<http://getbootstrap.com/examples/starter-template/>
and run the code in the browser I am n... | 2016/06/23 | [
"https://Stackoverflow.com/questions/37996809",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4761252/"
] | The Problem is that the paths you specified in the HTML file (`../../dist/css/bootstrap.min.css`) are not existing.
You either need to update all your paths in the HTML file e.g. to:
```
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/bootstrap.min.js"></script>
```
Or you move your files accor... | Here you go
Please download the all the scripts or use cdn
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the... |
5,891,763 | I am new on stackoverflow.com and also in .htaccess.
I just ask one thing:
```
RewriteCond %{QUERY_STRING} ^event_id=156$
RewriteRule ^test1.php?$ /htaccess_test/test.php
RewriteCond %{QUERY_STRING} ^event_id=154$
RewriteRule ^test1.php?$ /htaccess_test/test2.php
```
I just want to merge these two rewrite rules be... | 2011/05/05 | [
"https://Stackoverflow.com/questions/5891763",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/647504/"
] | As I see, you want to redirect test1.php to test.php or test2.php due to different event\_id.
I don't think you can merge these two rules because the destination is not the same due to different conditions. But you can merge the different event\_id to the same condition, like you want event\_id 156 157 158 to redirect ... | Try this combined code in your .htaccess file:
```
Options +FollowSymlinks -MultiViews
RewriteEngine on
RewriteCond %{QUERY_STRING} ^event_id=(156|154)$ [NC]
RewriteRule ^test1\.php/?$ /htaccess_test/test.php [NC,L]
``` |
14,871,991 | how can i get the following output using perl or awk or is it possible in linux command?
file1:
```
1
2
2
4
```
file2:
```
5
6
7
8
```
Desired output:
```
1 5
2 6
2 7
4 8
``` | 2013/02/14 | [
"https://Stackoverflow.com/questions/14871991",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2071468/"
] | with command `paste`
```
paste file1 file2
``` | A more flexible solution for when the lines in the file aren't fixed width would be with `pr`:
```
$ pr -mtw 10 file1 file2
1 5
2 6
3 7
4 8
```
Changing `file1` to containing variable width lines:
```
$ cat file1
The number 1
two
3
The last number is the number four
# With pr two columns are output ... |
14,871,991 | how can i get the following output using perl or awk or is it possible in linux command?
file1:
```
1
2
2
4
```
file2:
```
5
6
7
8
```
Desired output:
```
1 5
2 6
2 7
4 8
``` | 2013/02/14 | [
"https://Stackoverflow.com/questions/14871991",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2071468/"
] | with command `paste`
```
paste file1 file2
``` | To be more precise:
`paste` command just prints it out. To save it to a new file the command should be:
```
paste file1 file2 > outputFile
```
`outputFile` now contains both columns. |
14,871,991 | how can i get the following output using perl or awk or is it possible in linux command?
file1:
```
1
2
2
4
```
file2:
```
5
6
7
8
```
Desired output:
```
1 5
2 6
2 7
4 8
``` | 2013/02/14 | [
"https://Stackoverflow.com/questions/14871991",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2071468/"
] | with command `paste`
```
paste file1 file2
``` | You can also do this with GNU parallel:
```
parallel --xapply echo '{1}' '{2}' :::: file1 :::: file2
``` |
14,871,991 | how can i get the following output using perl or awk or is it possible in linux command?
file1:
```
1
2
2
4
```
file2:
```
5
6
7
8
```
Desired output:
```
1 5
2 6
2 7
4 8
``` | 2013/02/14 | [
"https://Stackoverflow.com/questions/14871991",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2071468/"
] | A more flexible solution for when the lines in the file aren't fixed width would be with `pr`:
```
$ pr -mtw 10 file1 file2
1 5
2 6
3 7
4 8
```
Changing `file1` to containing variable width lines:
```
$ cat file1
The number 1
two
3
The last number is the number four
# With pr two columns are output ... | You can also do this with GNU parallel:
```
parallel --xapply echo '{1}' '{2}' :::: file1 :::: file2
``` |
14,871,991 | how can i get the following output using perl or awk or is it possible in linux command?
file1:
```
1
2
2
4
```
file2:
```
5
6
7
8
```
Desired output:
```
1 5
2 6
2 7
4 8
``` | 2013/02/14 | [
"https://Stackoverflow.com/questions/14871991",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2071468/"
] | To be more precise:
`paste` command just prints it out. To save it to a new file the command should be:
```
paste file1 file2 > outputFile
```
`outputFile` now contains both columns. | You can also do this with GNU parallel:
```
parallel --xapply echo '{1}' '{2}' :::: file1 :::: file2
``` |
92,510 | I have an instrumental here (not particularly a fan of, but great reference for this question.)
This instrumental starts off with and contains a synth pluck with a simple melody. My interest in this synth pluck is how a single sound can fill out the sound spectrum all by itself.
What is the process behind achieving ... | 2019/11/30 | [
"https://music.stackexchange.com/questions/92510",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/60432/"
] | From my answer to [your stereo reverb question](https://music.stackexchange.com/questions/92393/what-is-the-difference-in-using-mono-reverb-vs-stereo-reverb)
>
> It's worth noting that (mono-in stereo-out) stereo reverb is one way
> to artificially create a stereo field from a mono input. Other
> stereoization meth... | From the comments you seem to be asking not about the frequency spectrum, but about the stereo field.
Yes, this is probably done by adding pseudo-stereo information using a 'stereo reverb' plugin.
It conceivably COULD have been achieved by recording the (marimba?) sound in a very reverberant room with stereo micropho... |
377,121 | This is directly related to my [previous question](https://electronics.stackexchange.com/questions/376848/how-can-i-modify-this-opamp-circuits-logic), so it requires to first have a look at that. And the below LTspice implementation is based on Andy Aka's answer. The following circuit works in LTspice. But I have some ... | 2018/05/29 | [
"https://electronics.stackexchange.com/questions/377121",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/16307/"
] | High or low charges on a stored lithium battery stress it, even with the battery otherwise idle. The best way to store lithium-ion or lipo is at about half charge and close to 0C (32F) without actually freezing it. Note that there's a lot of superstition about batteries, and you'll get different answers from different ... | All lithium ion cells will have a data sheet from the manufacturer almost always available online.
The full data sheets will define the manufacturer's recommended parameters for a "standard charge" and for a "standard discharge", and often for rapid charge and maximum continuous discharge as well. They will also list ... |
23,944,456 | **How do I insert a div into a random location inside a container of divs?** Similar to [Insert a div in a random location in a list of divs](https://stackoverflow.com/questions/17238255/insert-a-div-in-a-random-location-in-a-list-of-divs) except I'm not using a list.
Right now it appears inside a random container div... | 2014/05/29 | [
"https://Stackoverflow.com/questions/23944456",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1037526/"
] | You're almost there. You just need to change `append` to `after`; change:
```
insertionTargetChildren.eq(random).append(insertionTemplate);
```
To:
```
insertionTargetChildren.eq(random).after(insertionTemplate);
```
Your current code inserts the new div into another div as follows:
```
<div class="image" style... | This will put it in random position:
```
random = Math.floor(Math.random() * (targetChildren.length+1));
if(random > targetChildren.length){
target.append(template);
}else{
targetChildren.eq(random).before(template);
}
```
The `targetChildren.length+1` is to add the possibility of appending in the last place ... |
23,944,456 | **How do I insert a div into a random location inside a container of divs?** Similar to [Insert a div in a random location in a list of divs](https://stackoverflow.com/questions/17238255/insert-a-div-in-a-random-location-in-a-list-of-divs) except I'm not using a list.
Right now it appears inside a random container div... | 2014/05/29 | [
"https://Stackoverflow.com/questions/23944456",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1037526/"
] | You were very close!
Instead of `.clone()`, try using `.html()` like my example below.
Also, I slightly changed your loop along with the random number generator.
Works very well now. Refresh the page to see three random kitty photos added somewhere within the other images.
[**WORKING EXAMPLE**](http://jsfiddle.net/... | This will put it in random position:
```
random = Math.floor(Math.random() * (targetChildren.length+1));
if(random > targetChildren.length){
target.append(template);
}else{
targetChildren.eq(random).before(template);
}
```
The `targetChildren.length+1` is to add the possibility of appending in the last place ... |
2,396,260 | First, I define a radical tower as I have it in front of me (in case our definitions differ):
By a radical tower over a field F we mean a sequence of finite extensions $F=F\_0{\subset}F\_1{\subset}..{\subset}F\_r$ having the property that there exist positive integers $d\_i$, elements $a\_i$ in $F\_i$ and $\alpha\_i$ ... | 2017/08/17 | [
"https://math.stackexchange.com/questions/2396260",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/330745/"
] | So, we have a radical tower $F=F\_0\subset F\_1\subset\cdots\subset F\_r$ with $F\_{i+1}=F\_i(\alpha\_i)$, $\alpha\_i^{d\_i}=a\_i$, $a\_i$ in $F\_i$, and $E\subset F\_r$. Let $n$ be the least common multiple of $d\_1,\dots,d\_r$. Now consider the tower $F\subset E\_0\subset E\_1\subset\cdots\subset E\_m$ given by $E\_0... | Say $A$ is an algebraic closure of $F$. Any finite extensions of $F$ are regarded as subfields of $A$. We fix the radical tower of $F$ as specified in your statement.
We first observe the following observations. (1) Let $\phi:F\_r\to A$ be an embedding. Then we have a corresponding radical tower, where we start from $... |
919,528 | it's a bit long since I've done some research and loged my "findings"
but the question is only 2 lines and bolded...
I have searched anywhere and I'm stacked between C# and SQL\_SERVER:
I need to run a very big stored procedure which takes over 30 minutes
it got steps and I want to notify the dot.net on which step t... | 2009/05/28 | [
"https://Stackoverflow.com/questions/919528",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Create a table that stores the current step number of your process, and have your process write this table at each step. Then you can either poll the 'current step' or set a SQLCacheDependency. | All you need is to catch **SqlException** then you can have
1. LineNumber (on which error occured in your SP)
2. Number (Error number [10 in your case])
3. Procedure (Name of Stored Procedure that caused the error)
4. State
5. SqlErrorCollection object
and many other goodies!!
EDIT:- OOPS this will not help you dire... |
45,113,598 | I'm very new to using lisp, so I'm sorry if this is a trivial question. I haven't been able to find solutions after a while googling, though I'm sure that this is fault on my part.
So. I'm trying to write a command which will revert all open buffers. Simple. I just do
```
(setq revert-without-query (buffer-list))
(m... | 2017/07/15 | [
"https://Stackoverflow.com/questions/45113598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1543167/"
] | One possibility would be checking `buffer-file-name` which will return nil if the buffer isn't visiting a file, eg.
```
(cl-loop for buf in (buffer-list)
if (buffer-file-name buf)
collect buf)
```
or
```
(cl-remove-if-not 'buffer-file-name (buffer-list))
``` | You probably want to revert dired directories also. Any type of buffer can have its own specialized revert (see `revert-buffer-function`). So you probably want to check for both `buffer-file-name` and `dired-directory` being non-nil.
```
(dolist (b (buffer-list))
(when (buffer-live-p b)
(with-current-buffer b
... |
3,352,529 | I'm currently developing a touch screen application using C# (.NET 4.0) and WPF for Windows 7.
My problem is that the driver of the touch screen I have available at the moment only generates mouse events. (The manufacturer unfortunately does not provide a genuine Windows 7 driver)
So, currently I'm not able to do tests... | 2010/07/28 | [
"https://Stackoverflow.com/questions/3352529",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/335478/"
] | Check this.
<http://blakenui.codeplex.com/>.
There is a MouseTouchDevice.cs file that looks like this. It converts normal mouse events to Manipulation events.
```
/// <summary>
/// Used to translate mouse events into touch events, enabling a unified
/// input processing pipeline.
/// </summary>
/// <remarks>This cla... | You would need to rewrite the mouse driver to act like a touch device to do this. A simpler workaround would be to get a device like the Wacom Bamboo Touch? It's a real touch device (not a touch screen). |
615,221 | How can we solve $\displaystyle\int\frac{1}{(x^2+1)^2}dx$ for Riemanian integration and Lebesgue integration mode? | 2013/12/21 | [
"https://math.stackexchange.com/questions/615221",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/108128/"
] | **Hint:** Use the change of variables $x=\tan t$ to get
>
> $$ \int \cos^2 t\, dt .$$
>
>
>
I think you can finish it.
**Note:** The following identity is useful
>
> $$ \cos(2x)=2\cos^2 x - 1 .$$
>
>
> | A method worth looking at (now I do not know its ramifications for Riemannian Integration or Lebesgue Integration, someone else will need to explore that) is good old partial fractions from Calc 2:
$$(1 + x^2) = (1 + ix) (1 - ix)$$
$$ \int{\frac{1}{(1 + x^2)^2}} = \int{\frac{a\_1}{1 + ix}} + \int{\frac{a\_2}{1 + ix}}... |
615,221 | How can we solve $\displaystyle\int\frac{1}{(x^2+1)^2}dx$ for Riemanian integration and Lebesgue integration mode? | 2013/12/21 | [
"https://math.stackexchange.com/questions/615221",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/108128/"
] | **Hint:** Use the change of variables $x=\tan t$ to get
>
> $$ \int \cos^2 t\, dt .$$
>
>
>
I think you can finish it.
**Note:** The following identity is useful
>
> $$ \cos(2x)=2\cos^2 x - 1 .$$
>
>
> | Here is a partial fraction expansion that may be useful
$$\frac{1}{(1+x^2)^2} = \frac{1}{2} \frac{1}{1+x^2} - \frac{1}{2} \frac{x^2-1}{(1+x^2)^2}$$
Riemannian integral is easily obtained as
$$\frac{1}{2} atan(x) + \frac{1}{2} \frac{x}{1+x^2}$$
Hope this helps
BTW: I followed the usual approach to partial fractions ... |
50,985 | I would like to have a link that runs a Babel source-code block. Does Org-mode support running something from the library of babel in a link, or a source block via a file+blockname reference? A Hyperbole button would also be acceptable. | 2019/06/12 | [
"https://emacs.stackexchange.com/questions/50985",
"https://emacs.stackexchange.com",
"https://emacs.stackexchange.com/users/594/"
] | You can easily define your own link type that runs source blocks:
```el
(org-link-set-parameters
"run"
:follow #'org-babel-ref-resolve)
```
Afterwards a click on `run:hello` executes the source block in the following Orgmode file.
```
#+name: hello
#+begin_src emacs-lisp :var n=1
(message "Hello. n=%s" n)
#+end_s... | The usual way to do this is like this:
```
#+name: mysum
#+BEGIN_SRC emacs-lisp
(+ 5 5)
#+END_SRC
#+call: mysum()
#+RESULTS:
: 10
```
I am not sure what the point of doing this in a link would be, where would the results go for example?
You can make a link like this:
[[elisp:(progn (org-babel-goto-named-src-bloc... |
24,279,336 | What are the differences between the Mongoengine, flask-MongoEngine and Django-MongoEngine projects?
I am using Mongoengine in my Django project. Will I get any benefits if I use Django-MongoEngine instead? | 2014/06/18 | [
"https://Stackoverflow.com/questions/24279336",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2710873/"
] | Django MongoEngine aim is to provide better integration with Django - however currently (June 2014) its not stable and the readme says
>
> DO NOT CLONE UNTIL STABLE
>
>
>
So beware! | `flask-mongoengine` adds a few helpers to integrate MongoEngine into a Flask application.
* Connection definition in Flask parameters
* `get_or_404` / `first_or_404` shortcuts (abort 404 if document not found)
* paginator added to QuerySet object
* automatic form generation using WTForms
`django` support was pulled o... |
24,279,336 | What are the differences between the Mongoengine, flask-MongoEngine and Django-MongoEngine projects?
I am using Mongoengine in my Django project. Will I get any benefits if I use Django-MongoEngine instead? | 2014/06/18 | [
"https://Stackoverflow.com/questions/24279336",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2710873/"
] | Django MongoEngine aim is to provide better integration with Django - however currently (June 2014) its not stable and the readme says
>
> DO NOT CLONE UNTIL STABLE
>
>
>
So beware! | `Django` framework provides a unified unified interface to connect to a Database backend which is usually an SQL based database such as `SQLite` or `Postgresql`. That means that the developer does not have to worry about writing code specific to the database technology used, but defines Models and perform transactions ... |
44,793,164 | I'm running a web app with address 127.0.0.1:5000 and am using the python client library for Prometheus. I use `start_http_server(8000)` from the example in their [docs](https://github.com/prometheus/client_python) to expose the metrics on that port. The application runs, but I get `[Errno 48] Address already in use` a... | 2017/06/28 | [
"https://Stackoverflow.com/questions/44793164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3079130/"
] | This is mainly because you are restarting the server again on the port 8000.
To resolve this I created a function which will create the server after assuring the previous server or the port can be used.
You can look at <https://github.com/prometheus/client_python/issues/155>, here the same case is addressed | Maybe your 8000 port is occupied. You can change it to another port, such as 8001 |
44,793,164 | I'm running a web app with address 127.0.0.1:5000 and am using the python client library for Prometheus. I use `start_http_server(8000)` from the example in their [docs](https://github.com/prometheus/client_python) to expose the metrics on that port. The application runs, but I get `[Errno 48] Address already in use` a... | 2017/06/28 | [
"https://Stackoverflow.com/questions/44793164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3079130/"
] | When flask's `debug` mode is set to `True`, the code reloads after the flask server is up, and a bind to the prometheus server is been called a second time
Set flask app `debug` argument to `False` to solve it | Maybe your 8000 port is occupied. You can change it to another port, such as 8001 |
44,793,164 | I'm running a web app with address 127.0.0.1:5000 and am using the python client library for Prometheus. I use `start_http_server(8000)` from the example in their [docs](https://github.com/prometheus/client_python) to expose the metrics on that port. The application runs, but I get `[Errno 48] Address already in use` a... | 2017/06/28 | [
"https://Stackoverflow.com/questions/44793164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3079130/"
] | This is mainly because you are restarting the server again on the port 8000.
To resolve this I created a function which will create the server after assuring the previous server or the port can be used.
You can look at <https://github.com/prometheus/client_python/issues/155>, here the same case is addressed | you cannot run two http servers on the same thread.
I don't know why but the implementation of the prometheus\_client doesn't runs the server on a separate thread.
my solution is
```
import logging.config
import os
import connexion
from multiprocessing.pool import ThreadPool
from prometheus_client import start_http_s... |
44,793,164 | I'm running a web app with address 127.0.0.1:5000 and am using the python client library for Prometheus. I use `start_http_server(8000)` from the example in their [docs](https://github.com/prometheus/client_python) to expose the metrics on that port. The application runs, but I get `[Errno 48] Address already in use` a... | 2017/06/28 | [
"https://Stackoverflow.com/questions/44793164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3079130/"
] | When flask's `debug` mode is set to `True`, the code reloads after the flask server is up, and a bind to the prometheus server is been called a second time
Set flask app `debug` argument to `False` to solve it | Port 8000 does not need to have a web server running on it for it to be already in use. Use your OS command line to find the process that is using up the port then kill it. If a service is also running that causes it to get spawned again, disable that process.
A simpler solution would be to use another port instead of... |
44,793,164 | I'm running a web app with address 127.0.0.1:5000 and am using the python client library for Prometheus. I use `start_http_server(8000)` from the example in their [docs](https://github.com/prometheus/client_python) to expose the metrics on that port. The application runs, but I get `[Errno 48] Address already in use` a... | 2017/06/28 | [
"https://Stackoverflow.com/questions/44793164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3079130/"
] | Some other process is utilizing the port (8000). To kill the process that is running on the port (8000), simply find the process\_id [pid] of the process.
```
lsof -i :8000
```
This will show you the processes running on the port 8000 like this:
```
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
pytho... | Maybe your 8000 port is occupied. You can change it to another port, such as 8001 |
44,793,164 | I'm running a web app with address 127.0.0.1:5000 and am using the python client library for Prometheus. I use `start_http_server(8000)` from the example in their [docs](https://github.com/prometheus/client_python) to expose the metrics on that port. The application runs, but I get `[Errno 48] Address already in use` a... | 2017/06/28 | [
"https://Stackoverflow.com/questions/44793164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3079130/"
] | When flask's `debug` mode is set to `True`, the code reloads after the flask server is up, and a bind to the prometheus server is been called a second time
Set flask app `debug` argument to `False` to solve it | you cannot run two http servers on the same thread.
I don't know why but the implementation of the prometheus\_client doesn't runs the server on a separate thread.
my solution is
```
import logging.config
import os
import connexion
from multiprocessing.pool import ThreadPool
from prometheus_client import start_http_s... |
44,793,164 | I'm running a web app with address 127.0.0.1:5000 and am using the python client library for Prometheus. I use `start_http_server(8000)` from the example in their [docs](https://github.com/prometheus/client_python) to expose the metrics on that port. The application runs, but I get `[Errno 48] Address already in use` a... | 2017/06/28 | [
"https://Stackoverflow.com/questions/44793164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3079130/"
] | Some other process is utilizing the port (8000). To kill the process that is running on the port (8000), simply find the process\_id [pid] of the process.
```
lsof -i :8000
```
This will show you the processes running on the port 8000 like this:
```
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
pytho... | you cannot run two http servers on the same thread.
I don't know why but the implementation of the prometheus\_client doesn't runs the server on a separate thread.
my solution is
```
import logging.config
import os
import connexion
from multiprocessing.pool import ThreadPool
from prometheus_client import start_http_s... |
44,793,164 | I'm running a web app with address 127.0.0.1:5000 and am using the python client library for Prometheus. I use `start_http_server(8000)` from the example in their [docs](https://github.com/prometheus/client_python) to expose the metrics on that port. The application runs, but I get `[Errno 48] Address already in use` a... | 2017/06/28 | [
"https://Stackoverflow.com/questions/44793164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3079130/"
] | Some other process is utilizing the port (8000). To kill the process that is running on the port (8000), simply find the process\_id [pid] of the process.
```
lsof -i :8000
```
This will show you the processes running on the port 8000 like this:
```
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
pytho... | Port 8000 does not need to have a web server running on it for it to be already in use. Use your OS command line to find the process that is using up the port then kill it. If a service is also running that causes it to get spawned again, disable that process.
A simpler solution would be to use another port instead of... |
44,793,164 | I'm running a web app with address 127.0.0.1:5000 and am using the python client library for Prometheus. I use `start_http_server(8000)` from the example in their [docs](https://github.com/prometheus/client_python) to expose the metrics on that port. The application runs, but I get `[Errno 48] Address already in use` a... | 2017/06/28 | [
"https://Stackoverflow.com/questions/44793164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3079130/"
] | Some other process is utilizing the port (8000). To kill the process that is running on the port (8000), simply find the process\_id [pid] of the process.
```
lsof -i :8000
```
This will show you the processes running on the port 8000 like this:
```
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
pytho... | This is mainly because you are restarting the server again on the port 8000.
To resolve this I created a function which will create the server after assuring the previous server or the port can be used.
You can look at <https://github.com/prometheus/client_python/issues/155>, here the same case is addressed |
44,793,164 | I'm running a web app with address 127.0.0.1:5000 and am using the python client library for Prometheus. I use `start_http_server(8000)` from the example in their [docs](https://github.com/prometheus/client_python) to expose the metrics on that port. The application runs, but I get `[Errno 48] Address already in use` a... | 2017/06/28 | [
"https://Stackoverflow.com/questions/44793164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3079130/"
] | When flask's `debug` mode is set to `True`, the code reloads after the flask server is up, and a bind to the prometheus server is been called a second time
Set flask app `debug` argument to `False` to solve it | This is mainly because you are restarting the server again on the port 8000.
To resolve this I created a function which will create the server after assuring the previous server or the port can be used.
You can look at <https://github.com/prometheus/client_python/issues/155>, here the same case is addressed |
22,225,207 | I have created a UIRefreshcontrol in my tableviewcontroller as follows in the viewdidload method :
```
refresh = [UIRefreshControl.alloc init];
refresh.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to Refresh"];
[refresh addTarget:self action:@selector(refreshChatsTableView) forContro... | 2014/03/06 | [
"https://Stackoverflow.com/questions/22225207",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3388233/"
] | try changing
```
self.refreshControl = refresh;
```
for
```
[self.tableView addSubview:refresh];
[self.tableView sendSubviewToBack:refresh];
```
+++++++++
if u have problem with attributedString layout with first refreshControl triggered - add this after adding refreshControl as subview
```
dispatch_async(dispat... | Just add `tableView.alwaysBounceVertical = YES` after your `[refresh endRefreshing]` so table will bounce to top after the refresh control ended its animation. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.