qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
30,558,516 | I'm applying a CIFilter to a portrait image. For some reason, it gets rotated 90 clockwise. How can I fix this? My code is below
```
var imgOrientation = oImage.imageOrientation
var imgScale = oImage.scale
let originalImage = CIImage(image: oImage)
var filter = CIFilter(name: "CIPhotoEffect"+arr[sender.tag-1000])
fi... | 2015/05/31 | [
"https://Stackoverflow.com/questions/30558516",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3330259/"
] | I'm going to guess that the problem is this line:
```
var newImage = UIImage(CIImage:outputImage, scale:imgScale, orientation:imgOrientation)
```
That is not how you render a filter into a UIImage. What you want to do is call `CIContext(options: nil)` to get a CIContext, and then send that CIContext the message `cre... | You can try this :
```
let cgImage = self.context.createCGImage(filterOutputImage,
from: cameraImage.extent)!
let orientation: UIImage.Orientation =
currentCameraType == AVCaptureDevice.Position.front ?
UIImage.Orientation.leftMirrored:
UIImage.Orie... |
1,793 | Suppose you have a room full of people. You have access to all their biometrics: the mass of their arms, their body, and so on. You can also make them punch in open air and measure their punching speed or whatever else.
Without making them actually punch a board, how do you determine who has the most breaking power? ... | 2013/02/19 | [
"https://martialarts.stackexchange.com/questions/1793",
"https://martialarts.stackexchange.com",
"https://martialarts.stackexchange.com/users/968/"
] | Answer to the altered question
------------------------------
Still *"Neither"*. Breaking occurs when the localized strain exceeds the elastic limit of the material. That depends on the geometry of the board, it's supports and the location of the impact and on the **peak pressure** applied.
The geometric dependence i... | I believe dmckee is right when it comes to the physics of board breaking. I might not have his physics credentials, but I've still studied a bit of it myself and would have made the same argument. Whatever technique you are using to break that board, if the strain is greater than the local resistance of the board, it w... |
1,793 | Suppose you have a room full of people. You have access to all their biometrics: the mass of their arms, their body, and so on. You can also make them punch in open air and measure their punching speed or whatever else.
Without making them actually punch a board, how do you determine who has the most breaking power? ... | 2013/02/19 | [
"https://martialarts.stackexchange.com/questions/1793",
"https://martialarts.stackexchange.com",
"https://martialarts.stackexchange.com/users/968/"
] | Answer to the altered question
------------------------------
Still *"Neither"*. Breaking occurs when the localized strain exceeds the elastic limit of the material. That depends on the geometry of the board, it's supports and the location of the impact and on the **peak pressure** applied.
The geometric dependence i... | I guess this does not really answer your question: I wanted to add as a comment, but I reckon that because I have just joined this particular forum, I might not have enough privileges to add a comment.
But here is my view; two-fold approach.
**1 - Power Generation**
From my experience, the Karate guys are the best i... |
1,793 | Suppose you have a room full of people. You have access to all their biometrics: the mass of their arms, their body, and so on. You can also make them punch in open air and measure their punching speed or whatever else.
Without making them actually punch a board, how do you determine who has the most breaking power? ... | 2013/02/19 | [
"https://martialarts.stackexchange.com/questions/1793",
"https://martialarts.stackexchange.com",
"https://martialarts.stackexchange.com/users/968/"
] | Answer to the altered question
------------------------------
Still *"Neither"*. Breaking occurs when the localized strain exceeds the elastic limit of the material. That depends on the geometry of the board, it's supports and the location of the impact and on the **peak pressure** applied.
The geometric dependence i... | >
> Without making them actually punch a board, how do you determine who has the most breaking power? Is it momentum, kinetic energy, or some other simple physical amount?
>
>
>
No - it's nothing so simple, but neither is it so mysterious that it's beyond exploring. If I were a PhD sport science student, this woul... |
1,793 | Suppose you have a room full of people. You have access to all their biometrics: the mass of their arms, their body, and so on. You can also make them punch in open air and measure their punching speed or whatever else.
Without making them actually punch a board, how do you determine who has the most breaking power? ... | 2013/02/19 | [
"https://martialarts.stackexchange.com/questions/1793",
"https://martialarts.stackexchange.com",
"https://martialarts.stackexchange.com/users/968/"
] | I believe dmckee is right when it comes to the physics of board breaking. I might not have his physics credentials, but I've still studied a bit of it myself and would have made the same argument. Whatever technique you are using to break that board, if the strain is greater than the local resistance of the board, it w... | I guess this does not really answer your question: I wanted to add as a comment, but I reckon that because I have just joined this particular forum, I might not have enough privileges to add a comment.
But here is my view; two-fold approach.
**1 - Power Generation**
From my experience, the Karate guys are the best i... |
1,793 | Suppose you have a room full of people. You have access to all their biometrics: the mass of their arms, their body, and so on. You can also make them punch in open air and measure their punching speed or whatever else.
Without making them actually punch a board, how do you determine who has the most breaking power? ... | 2013/02/19 | [
"https://martialarts.stackexchange.com/questions/1793",
"https://martialarts.stackexchange.com",
"https://martialarts.stackexchange.com/users/968/"
] | I believe dmckee is right when it comes to the physics of board breaking. I might not have his physics credentials, but I've still studied a bit of it myself and would have made the same argument. Whatever technique you are using to break that board, if the strain is greater than the local resistance of the board, it w... | >
> Without making them actually punch a board, how do you determine who has the most breaking power? Is it momentum, kinetic energy, or some other simple physical amount?
>
>
>
No - it's nothing so simple, but neither is it so mysterious that it's beyond exploring. If I were a PhD sport science student, this woul... |
1,793 | Suppose you have a room full of people. You have access to all their biometrics: the mass of their arms, their body, and so on. You can also make them punch in open air and measure their punching speed or whatever else.
Without making them actually punch a board, how do you determine who has the most breaking power? ... | 2013/02/19 | [
"https://martialarts.stackexchange.com/questions/1793",
"https://martialarts.stackexchange.com",
"https://martialarts.stackexchange.com/users/968/"
] | >
> Without making them actually punch a board, how do you determine who has the most breaking power? Is it momentum, kinetic energy, or some other simple physical amount?
>
>
>
No - it's nothing so simple, but neither is it so mysterious that it's beyond exploring. If I were a PhD sport science student, this woul... | I guess this does not really answer your question: I wanted to add as a comment, but I reckon that because I have just joined this particular forum, I might not have enough privileges to add a comment.
But here is my view; two-fold approach.
**1 - Power Generation**
From my experience, the Karate guys are the best i... |
18,252,824 | I am trying to get the following code to run:
```
$browser = get_browser(null, true);
print_r($browser);
```
The error that I get is as follows:
>
> Warning: get\_browser() [function.get-browser]: browscap ini directive not set in /Applications/XAMPP/xamppfiles/htdocs/series/firstfile/index.php on line 3
>
>
>
... | 2013/08/15 | [
"https://Stackoverflow.com/questions/18252824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2685830/"
] | You could use a media query, f.e.
```
@media (max-width: 800px) { /* this has to be the same width as the div */
div {
margin-left:0;
left:0;
}
}
```
<http://jsfiddle.net/y3zpm/> | I found this page with good example: <http://codepen.io/shshaw/full/gEiDt#Fixed>. Work for me! |
18,252,824 | I am trying to get the following code to run:
```
$browser = get_browser(null, true);
print_r($browser);
```
The error that I get is as follows:
>
> Warning: get\_browser() [function.get-browser]: browscap ini directive not set in /Applications/XAMPP/xamppfiles/htdocs/series/firstfile/index.php on line 3
>
>
>
... | 2013/08/15 | [
"https://Stackoverflow.com/questions/18252824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2685830/"
] | You could use a media query, f.e.
```
@media (max-width: 800px) { /* this has to be the same width as the div */
div {
margin-left:0;
left:0;
}
}
```
<http://jsfiddle.net/y3zpm/> | ```
<div style="margin:auto; width:800px; top:0px;">
content
</div>
``` |
18,252,824 | I am trying to get the following code to run:
```
$browser = get_browser(null, true);
print_r($browser);
```
The error that I get is as follows:
>
> Warning: get\_browser() [function.get-browser]: browscap ini directive not set in /Applications/XAMPP/xamppfiles/htdocs/series/firstfile/index.php on line 3
>
>
>
... | 2013/08/15 | [
"https://Stackoverflow.com/questions/18252824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2685830/"
] | I found this page with good example: <http://codepen.io/shshaw/full/gEiDt#Fixed>. Work for me! | ```
<div style="margin:auto; width:800px; top:0px;">
content
</div>
``` |
3,532,881 | If imaginary numbers bisect real numbers at zero, am I correct in thinking $0i = 0$?
And if so, does that mean $i = 0/0$?
**EDIT:**
I’ve just realised my careless error in my thought process.
I immediately just “removed” the $0$ from both sides without thinking about the fact that I was actually simplifying $\frac{... | 2020/02/03 | [
"https://math.stackexchange.com/questions/3532881",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/747410/"
] | An interesting way of looking at this question is to ask the following (to expand on Lulu's answer:
If we have $0\cdot 1 = 0$, why is $1\neq \frac{0}{0}$?
The answer is, of course, that $\mathbb{R}$ is a field, and the zero element has no inverse. Therefore, from a pure algebraic perspective, $\frac00$ makes no sense.
... | Yes, $0i=0$, but the prohibition on dividing by zero remains valid in the complex plane, and one does not conclude $i=0/0$. |
3,532,881 | If imaginary numbers bisect real numbers at zero, am I correct in thinking $0i = 0$?
And if so, does that mean $i = 0/0$?
**EDIT:**
I’ve just realised my careless error in my thought process.
I immediately just “removed” the $0$ from both sides without thinking about the fact that I was actually simplifying $\frac{... | 2020/02/03 | [
"https://math.stackexchange.com/questions/3532881",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/747410/"
] | An interesting way of looking at this question is to ask the following (to expand on Lulu's answer:
If we have $0\cdot 1 = 0$, why is $1\neq \frac{0}{0}$?
The answer is, of course, that $\mathbb{R}$ is a field, and the zero element has no inverse. Therefore, from a pure algebraic perspective, $\frac00$ makes no sense.
... | It's also true that $0\cdot 1 = 0$. Does that mean $1=\frac00$?
It's also true that $0\cdot 2 = 0$. Does that mean $2=\frac00$? |
25,631,868 | I'm attempting to style my navigation menu design to reflect the one on timeanddate.com, as seen in this image:

To create the colors, they're using a simple bottom and left border in CSS.
I'm attempting to add a border to my `<li>` tags on my web... | 2014/09/02 | [
"https://Stackoverflow.com/questions/25631868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4001770/"
] | Although you set the width and color, you can not leave out the style parameter with borders.
**To get the desired effect as you presented in the image** - [jsFiddle demo](http://jsfiddle.net/hsnrw1aj/2/)
* dark background color for the `<ul>`
* a wide border-left on the `<li>`
* a `margin-bottom: 2px` as bottom bor... | ahhh... Brian you beat me to it.
I inserted border-style, and then there is "BORDER"
```
border: 5px solid white;
``` |
25,631,868 | I'm attempting to style my navigation menu design to reflect the one on timeanddate.com, as seen in this image:

To create the colors, they're using a simple bottom and left border in CSS.
I'm attempting to add a border to my `<li>` tags on my web... | 2014/09/02 | [
"https://Stackoverflow.com/questions/25631868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4001770/"
] | Although you set the width and color, you can not leave out the style parameter with borders.
**To get the desired effect as you presented in the image** - [jsFiddle demo](http://jsfiddle.net/hsnrw1aj/2/)
* dark background color for the `<ul>`
* a wide border-left on the `<li>`
* a `margin-bottom: 2px` as bottom bor... | Actually the trick in his case is that border is applied to the anchor tags not the lists! Cheers! :) And yes if you apply border-color as a property you should also apply border-style and border-width :) |
25,631,868 | I'm attempting to style my navigation menu design to reflect the one on timeanddate.com, as seen in this image:

To create the colors, they're using a simple bottom and left border in CSS.
I'm attempting to add a border to my `<li>` tags on my web... | 2014/09/02 | [
"https://Stackoverflow.com/questions/25631868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4001770/"
] | ahhh... Brian you beat me to it.
I inserted border-style, and then there is "BORDER"
```
border: 5px solid white;
``` | Actually the trick in his case is that border is applied to the anchor tags not the lists! Cheers! :) And yes if you apply border-color as a property you should also apply border-style and border-width :) |
11,102,829 | I have to isolate parts of strings in a html file. I thought I could succeed, but the data structure is really chaotic. I am a very beginner, so regular expressions were perhaps a bad idea. I can add that commas or semicolons were not consistent and could not be chosen as delimiters. Here in any case what I did and let... | 2012/06/19 | [
"https://Stackoverflow.com/questions/11102829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1466622/"
] | In Java, enterprise transactions management is ruled by the [JTA spec](http://www.oracle.com/technetwork/java/javaee/jta/index.html) wich is used in Java EE.
JTA allows to create several TransactionManager with differents implementations (one for database, one for file) and make them work together to define a cross-tr... | The file system isn't directly supported by Java EE, but you could implement/ search for a ***resource adapter*** for the file system.
<http://docs.oracle.com/javaee/6/tutorial/doc/gipgl.html>
<http://docs.oracle.com/javaee/6/tutorial/doc/giqjk.html> |
11,102,829 | I have to isolate parts of strings in a html file. I thought I could succeed, but the data structure is really chaotic. I am a very beginner, so regular expressions were perhaps a bad idea. I can add that commas or semicolons were not consistent and could not be chosen as delimiters. Here in any case what I did and let... | 2012/06/19 | [
"https://Stackoverflow.com/questions/11102829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1466622/"
] | There's [XADisk](http://xadisk.java.net/) which provides transactional access to file systems. From their web site:
>
> XADisk (pronounced 'x-a-disk') enables transactional access to
> existing file systems by providing APIs to perform file/directory
> operations. With simple steps, it can be deployed over any JVM ... | The file system isn't directly supported by Java EE, but you could implement/ search for a ***resource adapter*** for the file system.
<http://docs.oracle.com/javaee/6/tutorial/doc/gipgl.html>
<http://docs.oracle.com/javaee/6/tutorial/doc/giqjk.html> |
11,102,829 | I have to isolate parts of strings in a html file. I thought I could succeed, but the data structure is really chaotic. I am a very beginner, so regular expressions were perhaps a bad idea. I can add that commas or semicolons were not consistent and could not be chosen as delimiters. Here in any case what I did and let... | 2012/06/19 | [
"https://Stackoverflow.com/questions/11102829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1466622/"
] | There's [XADisk](http://xadisk.java.net/) which provides transactional access to file systems. From their web site:
>
> XADisk (pronounced 'x-a-disk') enables transactional access to
> existing file systems by providing APIs to perform file/directory
> operations. With simple steps, it can be deployed over any JVM ... | In Java, enterprise transactions management is ruled by the [JTA spec](http://www.oracle.com/technetwork/java/javaee/jta/index.html) wich is used in Java EE.
JTA allows to create several TransactionManager with differents implementations (one for database, one for file) and make them work together to define a cross-tr... |
443,458 | Ежемесячная выплата в связи с рождением (усыновлением) первого ребенка осуществляется женщине, родившей (усыновившей) первого ребенка, или отцу (усыновителю) либо опекуну ребенка в случае смерти женщины, отца (усыновителя), объявления их умершими, лишения их родительских прав или в случае отмены усыновления ребенка.
... | 2018/08/12 | [
"https://rus.stackexchange.com/questions/443458",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/190126/"
] | Предложение, как мне кажется, составлено некорректно (со всех точек зрения — и юридической, и попросту смысловой). Однозначный вывод из этого "информативного набора" сделать невозможно.
Если родители (усыновители) имеют одинаковые права на получение пособия, то обычно пишут так: пособие выплачивается одному из родите... | Ежемесячная выплата в связи с рождением (усыновлением) первого ребенка осуществляется **(1)** женщине, родившей (усыновившей) первого ребенка, или отцу (усыновителю)
либо **(2)** опекуну ребенка в случае смерти женщины, отца (усыновителя), объявления их умершими, лишения их родительских прав или в случае отмены усыно... |
25,161 | Background: When I first took measure theory/integration, I was bothered by the idea that the integral of a real-valued function w.r.t. a measure was defined first for nonnegative functions and only then for real-valued functions using the crutch of positive and negative parts (and only then for complex-valued function... | 2010/05/18 | [
"https://mathoverflow.net/questions/25161",
"https://mathoverflow.net",
"https://mathoverflow.net/users/3272/"
] | In standard textbooks, the Lebesgue integral is first defined for f with values in $[0,\infty]$. Note that the value $\infty$ is allowed, and it is important that it can be taken even on a set of positive measure.
You can see why for example in the one-line proof of the Borel-Cantelli lemma:
let $\mu$ be finite, and... | The question has been exhaustively answered, I'd like to add a remark. The way I view the Lebesgue integral is: to every positive measurable function you can associate a meaningful integral (i.e. stable by all natural operations and limit procedures), which might be infinite. Now if you have a sign-changing measurable ... |
25,161 | Background: When I first took measure theory/integration, I was bothered by the idea that the integral of a real-valued function w.r.t. a measure was defined first for nonnegative functions and only then for real-valued functions using the crutch of positive and negative parts (and only then for complex-valued function... | 2010/05/18 | [
"https://mathoverflow.net/questions/25161",
"https://mathoverflow.net",
"https://mathoverflow.net/users/3272/"
] | In standard textbooks, the Lebesgue integral is first defined for f with values in $[0,\infty]$. Note that the value $\infty$ is allowed, and it is important that it can be taken even on a set of positive measure.
You can see why for example in the one-line proof of the Borel-Cantelli lemma:
let $\mu$ be finite, and... | You want $\int f d\mu$ to make sense for every non negative measurable function and employ the monotone convergence theorem when the limit is not integrable.
But sometimes I have developed the Lebesgue integral for bounded measurable functions supported on sets of finite measure and introduced $L\_1$ as the completio... |
25,161 | Background: When I first took measure theory/integration, I was bothered by the idea that the integral of a real-valued function w.r.t. a measure was defined first for nonnegative functions and only then for real-valued functions using the crutch of positive and negative parts (and only then for complex-valued function... | 2010/05/18 | [
"https://mathoverflow.net/questions/25161",
"https://mathoverflow.net",
"https://mathoverflow.net/users/3272/"
] | It's really the difference between two kinds of completions:
1. An order-theoretic completion. For this, it's easiest to start with non-negative functions, and have infinite values dealt with pretty naturally.
2. A metric completion. For this, it's more natural to start with finite-valued signed simple functions.
It'... | The integration of nonnegative functions deserves its own chapter, just like nonnegative measures. It has more features than the general case and there are cases when you need exactly these features and do not need negative numbers.
And it is so elegant: every measurable function has an integral, and the integration i... |
25,161 | Background: When I first took measure theory/integration, I was bothered by the idea that the integral of a real-valued function w.r.t. a measure was defined first for nonnegative functions and only then for real-valued functions using the crutch of positive and negative parts (and only then for complex-valued function... | 2010/05/18 | [
"https://mathoverflow.net/questions/25161",
"https://mathoverflow.net",
"https://mathoverflow.net/users/3272/"
] | It's really the difference between two kinds of completions:
1. An order-theoretic completion. For this, it's easiest to start with non-negative functions, and have infinite values dealt with pretty naturally.
2. A metric completion. For this, it's more natural to start with finite-valued signed simple functions.
It'... | It comes down to this: which do you want to be simpler to deal with?
1) Functions which have integrals of infinite magnitude.
2) Integration of vector valued functions.
Traditionally, infinite integrals are seen as a more immediate obstacle (${\mathbb R}$ is an infinite measure space so this difficulty shows up quite... |
25,161 | Background: When I first took measure theory/integration, I was bothered by the idea that the integral of a real-valued function w.r.t. a measure was defined first for nonnegative functions and only then for real-valued functions using the crutch of positive and negative parts (and only then for complex-valued function... | 2010/05/18 | [
"https://mathoverflow.net/questions/25161",
"https://mathoverflow.net",
"https://mathoverflow.net/users/3272/"
] | It comes down to this: which do you want to be simpler to deal with?
1) Functions which have integrals of infinite magnitude.
2) Integration of vector valued functions.
Traditionally, infinite integrals are seen as a more immediate obstacle (${\mathbb R}$ is an infinite measure space so this difficulty shows up quite... | The question has been exhaustively answered, I'd like to add a remark. The way I view the Lebesgue integral is: to every positive measurable function you can associate a meaningful integral (i.e. stable by all natural operations and limit procedures), which might be infinite. Now if you have a sign-changing measurable ... |
25,161 | Background: When I first took measure theory/integration, I was bothered by the idea that the integral of a real-valued function w.r.t. a measure was defined first for nonnegative functions and only then for real-valued functions using the crutch of positive and negative parts (and only then for complex-valued function... | 2010/05/18 | [
"https://mathoverflow.net/questions/25161",
"https://mathoverflow.net",
"https://mathoverflow.net/users/3272/"
] | It comes down to this: which do you want to be simpler to deal with?
1) Functions which have integrals of infinite magnitude.
2) Integration of vector valued functions.
Traditionally, infinite integrals are seen as a more immediate obstacle (${\mathbb R}$ is an infinite measure space so this difficulty shows up quite... | I haven't looked at Lang's book before, but after a quick skim on Google Books, I see that his approach is to define the integral of simple functions, then use a completion with respect to the $L^1$ seminorm. One reason to avoid this approach is that it requires more functional analytic sophistication than we usually w... |
25,161 | Background: When I first took measure theory/integration, I was bothered by the idea that the integral of a real-valued function w.r.t. a measure was defined first for nonnegative functions and only then for real-valued functions using the crutch of positive and negative parts (and only then for complex-valued function... | 2010/05/18 | [
"https://mathoverflow.net/questions/25161",
"https://mathoverflow.net",
"https://mathoverflow.net/users/3272/"
] | Well, it is not true that Riemann integral and series avoid the distinction altogether.
If you want to define improper Riemann integrals, you can follow two ways. Say you want to define $\int\_a^b f(x) dx$, where $a, b$ are not necessarily finite and $f$ need not be bounded.
Either you split $f$ into the positive and... | I haven't looked at Lang's book before, but after a quick skim on Google Books, I see that his approach is to define the integral of simple functions, then use a completion with respect to the $L^1$ seminorm. One reason to avoid this approach is that it requires more functional analytic sophistication than we usually w... |
25,161 | Background: When I first took measure theory/integration, I was bothered by the idea that the integral of a real-valued function w.r.t. a measure was defined first for nonnegative functions and only then for real-valued functions using the crutch of positive and negative parts (and only then for complex-valued function... | 2010/05/18 | [
"https://mathoverflow.net/questions/25161",
"https://mathoverflow.net",
"https://mathoverflow.net/users/3272/"
] | It's really the difference between two kinds of completions:
1. An order-theoretic completion. For this, it's easiest to start with non-negative functions, and have infinite values dealt with pretty naturally.
2. A metric completion. For this, it's more natural to start with finite-valued signed simple functions.
It'... | The question has been exhaustively answered, I'd like to add a remark. The way I view the Lebesgue integral is: to every positive measurable function you can associate a meaningful integral (i.e. stable by all natural operations and limit procedures), which might be infinite. Now if you have a sign-changing measurable ... |
25,161 | Background: When I first took measure theory/integration, I was bothered by the idea that the integral of a real-valued function w.r.t. a measure was defined first for nonnegative functions and only then for real-valued functions using the crutch of positive and negative parts (and only then for complex-valued function... | 2010/05/18 | [
"https://mathoverflow.net/questions/25161",
"https://mathoverflow.net",
"https://mathoverflow.net/users/3272/"
] | The integration of nonnegative functions deserves its own chapter, just like nonnegative measures. It has more features than the general case and there are cases when you need exactly these features and do not need negative numbers.
And it is so elegant: every measurable function has an integral, and the integration i... | It comes down to this: which do you want to be simpler to deal with?
1) Functions which have integrals of infinite magnitude.
2) Integration of vector valued functions.
Traditionally, infinite integrals are seen as a more immediate obstacle (${\mathbb R}$ is an infinite measure space so this difficulty shows up quite... |
25,161 | Background: When I first took measure theory/integration, I was bothered by the idea that the integral of a real-valued function w.r.t. a measure was defined first for nonnegative functions and only then for real-valued functions using the crutch of positive and negative parts (and only then for complex-valued function... | 2010/05/18 | [
"https://mathoverflow.net/questions/25161",
"https://mathoverflow.net",
"https://mathoverflow.net/users/3272/"
] | The integration of nonnegative functions deserves its own chapter, just like nonnegative measures. It has more features than the general case and there are cases when you need exactly these features and do not need negative numbers.
And it is so elegant: every measurable function has an integral, and the integration i... | I haven't looked at Lang's book before, but after a quick skim on Google Books, I see that his approach is to define the integral of simple functions, then use a completion with respect to the $L^1$ seminorm. One reason to avoid this approach is that it requires more functional analytic sophistication than we usually w... |
43,201,413 | Compiling and executing the following snippet:
```
#include <stdlib.h>
typedef struct {
int count;
struct lval **cell;
} lval;
lval *lval_new(void) {
lval *v = malloc(sizeof(lval));
v->cell = NULL;
return v;
}
lval *lval_add(lval *x, lval *y) {
x->count++;
x->cell = realloc(x->cell, sizeo... | 2017/04/04 | [
"https://Stackoverflow.com/questions/43201413",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/335247/"
] | The `BEGIN` block will be processed before awk reading lines, if your script has only `BEGIN` block, no line will be loaded, only `BEGIN` blocked was executed by awk.
Thus, your max length calculation was not done.
E.g.
```
kent$ awk 'BEGIN{print length($0)}'<<<"foo"
0 #here we get 0 instead of 3, because default v... | You can read your file line by line by means of `getline`. If you use it in your `BEGIN` block and repeat as long as it returns 1, you can process the whole input stream.
Add this line before your `if` statement:
```
while ( getline > 0 )
```
The whole script looks as follows:
```
BEGIN {max =0
while ( getline... |
12,551,912 | I'm creating a simple timer class which returns me e.g. the current time in millis. On linux I'm using gettimeofday. I'm wondering what return type this function should have. i.e.
`double getMillis()` or `uint64_t getMillis()` etc... I would say `uint64_t` can hold bigger values and therefore recommended, though while ... | 2012/09/23 | [
"https://Stackoverflow.com/questions/12551912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/356918/"
] | My recommended data type to hold absolute time stamps in milliseconds is int64\_t, mainly because time\_t is signed. | I would go with the unsigned integer type since the number of milliseconds is a count. Makes adding and subtracting dependable without float as well. Most implementations I have used has unsigned integer types. |
17,304,233 | Using Google API .NET Client v1.3.0-beta.
I created a console application to test the basics of Google Admin Directory from the sample code for [Service Accounts](https://code.google.com/p/google-api-dotnet-client/wiki/OAuth2#Service_Accounts). This should give me a count of all email addresses in the domain.
```
us... | 2013/06/25 | [
"https://Stackoverflow.com/questions/17304233",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2520677/"
] | I got some help sorting this out.
To list users you have to pass domain or customer as an argument for your list-request.
Use EITHER CUSTOMER or DOMAIN.
@peleyal helped me findig how to do that:
```
var listReq = service.Users.List();
listReq.Customer = "CUSTOMER_HERE";
listReq.Domain = "DOMAIN_HERE";
Users results ... | I am also facing the same error [Bad Request] while loading users from domain using new Directory APIs.
To remove errors with the included libraries use the steps mentioned in <https://code.google.com/p/google-api-dotnet-client/wiki/Build>
Also verify that you are using proper version of .Net and not client Profile. |
71,869,577 | I have an account service, which keeps track of the current user, after she logs in:
```
export class AccountService {
private currentUserSource = new ReplaySubject<User>(1);
currentUser$ = this.currentUserSource.asObservable();
...
login(model: any) {
return this.http.post(this.baseUrl + 'accoun... | 2022/04/14 | [
"https://Stackoverflow.com/questions/71869577",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/424952/"
] | the reason for this problem is that you have not written codes in the primary component (app-component) to retrieve data from the localstorage , when pages are being refresh , app components needs data !
use these sample codes in in app-component :
```
ngOnInit() {
this.setCurrentUser();
}
setCurrentUser() {
const ... | I feel that you forgot in your nav component in **ngOnInit** check is isLogged
Create a new function in your service
```
isLogged()
{
const user=localStorage.getItem('user');
if (user)
this.currentUserSource.next(JSON.parse(user))
else
this.currentUserSource.next(null)
return user;
}
`... |
23,635,632 | I have:
```
function makeAjaxRequest() {
var url = '/queryjob/dbname/ip';
$.ajax(url,
{
success: alert(response)
});
}
```
When I do a normal browser request on this url I get a response of 43(just a test response right now)
When I click the button I have to run this function, nothing happens. I don't see a get... | 2014/05/13 | [
"https://Stackoverflow.com/questions/23635632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2152623/"
] | You are not calling [**$.ajax**](https://api.jquery.com/jquery.ajax/) correctly. Assuming you wanted to make a GET request, this is the correct syntax:
```
$.ajax({
type: 'GET',
url: url,
success: function(response) {
alert(response);
}
});
```
You could also use [**$.get**](https://api.jquer... | ```
$.ajax({
type: "GET",
url: "/queryjob/dbname/ip",
success: function (data) {
alert(data);
}
});
```
Yes, it was a syntax error ;) |
62,456 | I made an exchange on Changelly to exchange my Bitcoins to Bitcoin Cash. These Bitcoin Cash would later be sent to my address. Unfortunately, I did not check twice and had the Bitcoin Cash sent to my Bitcoin address and not Bitcoin Cash address.
Is there a way for me to reclaim these Bitcoin Cash? They are on a Bitcoi... | 2017/11/11 | [
"https://bitcoin.stackexchange.com/questions/62456",
"https://bitcoin.stackexchange.com",
"https://bitcoin.stackexchange.com/users/64313/"
] | You'll have to negotiate with your service provider whether they can help you.
Whoever holds the private keys for your Bitcoin wallet should be theoretically able to generate a transaction that sends the BCH from the Bitcoin address to wherever you wanted them to go.
In practice this may be difficult or infeasible: ... | Nope,impossible to get back, effectively you sent them to another bitcoin cash address that less likely might be for anyone or used..your coins are lost into the void on that address and you cannot have the keys to it, nor anybody can get them back
You can though see them on the BCH blockchain stuck there
Sorry to deli... |
57,826,782 | I have a shell script that executes multiple sql files that updates to the database. I am calling the shell script from jenkins- build- execute shell. The jenkins console shows success at all times irrespective of the errors from the sql files. I want Jenkins to fail the build, if there is an error or any of the sql fi... | 2019/09/06 | [
"https://Stackoverflow.com/questions/57826782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7423240/"
] | Thanks for all the inputs. I was able to fix this issue. I installed 'log parser plugin' in Jenkins which will parse the keywords like /Error/ in the console output and make the build to fail. | This S/O answer will probably address your scenario: [Automatic exit from bash shell script on error](https://stackoverflow.com/questions/2870992/automatic-exit-from-bash-shell-script-on-error)
This duplicate answer also provides useful guidance:[Stop on first error [duplicate]](https://stackoverflow.com/questions/347... |
57,826,782 | I have a shell script that executes multiple sql files that updates to the database. I am calling the shell script from jenkins- build- execute shell. The jenkins console shows success at all times irrespective of the errors from the sql files. I want Jenkins to fail the build, if there is an error or any of the sql fi... | 2019/09/06 | [
"https://Stackoverflow.com/questions/57826782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7423240/"
] | Thanks for all the inputs. I was able to fix this issue. I installed 'log parser plugin' in Jenkins which will parse the keywords like /Error/ in the console output and make the build to fail. | Below code may help you. This is how i sorted the issue with mine.
Instead of `sudo -u postgres psql <DBName> -f $pathname`
Use below code:
```
OUTPUT=$(psql -U postgres -d <DBName> -c "\i $pathname;")
echo $OUTPUT | grep ERROR
if [[ $? -eq 0 ]]
then
echo "Error while running sql file $pathname"
exit 2
else
ech... |
57,826,782 | I have a shell script that executes multiple sql files that updates to the database. I am calling the shell script from jenkins- build- execute shell. The jenkins console shows success at all times irrespective of the errors from the sql files. I want Jenkins to fail the build, if there is an error or any of the sql fi... | 2019/09/06 | [
"https://Stackoverflow.com/questions/57826782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7423240/"
] | Thanks for all the inputs. I was able to fix this issue. I installed 'log parser plugin' in Jenkins which will parse the keywords like /Error/ in the console output and make the build to fail. | Jenkins will not provide you the SQL files error code. Jenkins just checks if your shell script is executed or not and based on that it will return a status code which generally is zero as it is executing the shell script successfully. |
3,487 | How can I select every other edge loop. In this example its not too bad to do it manually but it other cases it might be. How can I easily select alternating face loops?
 | 2013/10/23 | [
"https://blender.stackexchange.com/questions/3487",
"https://blender.stackexchange.com",
"https://blender.stackexchange.com/users/1476/"
] | I don't think there's a direct tool to do this.
I've been playing with all sorts of methods to try and get the effect you want and only one thing has worked, and it doesn't seem like it should.
If you can end up selecting all the vertical *edge* loops, with all the horizontal *edge* loops deselected (I used edge r... | In 2.70a:
Change to polygon mode
Press Alt + Right mouse button to select loop (or left if you have changed defaults). Where you click on the polygon determines which loop is selected. You want to click in the upper half of a polygon near the top edge in the middle
For subsequent loops also hold down the Sift key wh... |
3,487 | How can I select every other edge loop. In this example its not too bad to do it manually but it other cases it might be. How can I easily select alternating face loops?
 | 2013/10/23 | [
"https://blender.stackexchange.com/questions/3487",
"https://blender.stackexchange.com",
"https://blender.stackexchange.com/users/1476/"
] | Every nth face loop:
====================
1. Switch to edge select mode (`Ctrl``Tab`*> Edge*)
2. Select an edge loop (`Alt``RMB`) going in the direction you want the edge ring selection to go.
3. Checker deselect (3D view > Header > checker deselect) the edge ring (you can use the `F6` menu to set the number of edges ... | I don't think there's a direct tool to do this.
I've been playing with all sorts of methods to try and get the effect you want and only one thing has worked, and it doesn't seem like it should.
If you can end up selecting all the vertical *edge* loops, with all the horizontal *edge* loops deselected (I used edge r... |
3,487 | How can I select every other edge loop. In this example its not too bad to do it manually but it other cases it might be. How can I easily select alternating face loops?
 | 2013/10/23 | [
"https://blender.stackexchange.com/questions/3487",
"https://blender.stackexchange.com",
"https://blender.stackexchange.com/users/1476/"
] | This is not working in 2.93.8, but I found a video with an even easier answer. (Did not test on 2.79b.)
<https://www.youtube.com/watch?v=yCAWAOfFqDg>
1: In Edge Select Mode: Select one Edge only (not an Edge Loop) that is parallel to the loops you want to select, then select the next edge (the other side of the quad).... | I don't think there's a direct tool to do this.
I've been playing with all sorts of methods to try and get the effect you want and only one thing has worked, and it doesn't seem like it should.
If you can end up selecting all the vertical *edge* loops, with all the horizontal *edge* loops deselected (I used edge r... |
3,487 | How can I select every other edge loop. In this example its not too bad to do it manually but it other cases it might be. How can I easily select alternating face loops?
 | 2013/10/23 | [
"https://blender.stackexchange.com/questions/3487",
"https://blender.stackexchange.com",
"https://blender.stackexchange.com/users/1476/"
] | Every nth face loop:
====================
1. Switch to edge select mode (`Ctrl``Tab`*> Edge*)
2. Select an edge loop (`Alt``RMB`) going in the direction you want the edge ring selection to go.
3. Checker deselect (3D view > Header > checker deselect) the edge ring (you can use the `F6` menu to set the number of edges ... | In 2.70a:
Change to polygon mode
Press Alt + Right mouse button to select loop (or left if you have changed defaults). Where you click on the polygon determines which loop is selected. You want to click in the upper half of a polygon near the top edge in the middle
For subsequent loops also hold down the Sift key wh... |
3,487 | How can I select every other edge loop. In this example its not too bad to do it manually but it other cases it might be. How can I easily select alternating face loops?
 | 2013/10/23 | [
"https://blender.stackexchange.com/questions/3487",
"https://blender.stackexchange.com",
"https://blender.stackexchange.com/users/1476/"
] | This is not working in 2.93.8, but I found a video with an even easier answer. (Did not test on 2.79b.)
<https://www.youtube.com/watch?v=yCAWAOfFqDg>
1: In Edge Select Mode: Select one Edge only (not an Edge Loop) that is parallel to the loops you want to select, then select the next edge (the other side of the quad).... | In 2.70a:
Change to polygon mode
Press Alt + Right mouse button to select loop (or left if you have changed defaults). Where you click on the polygon determines which loop is selected. You want to click in the upper half of a polygon near the top edge in the middle
For subsequent loops also hold down the Sift key wh... |
3,487 | How can I select every other edge loop. In this example its not too bad to do it manually but it other cases it might be. How can I easily select alternating face loops?
 | 2013/10/23 | [
"https://blender.stackexchange.com/questions/3487",
"https://blender.stackexchange.com",
"https://blender.stackexchange.com/users/1476/"
] | Every nth face loop:
====================
1. Switch to edge select mode (`Ctrl``Tab`*> Edge*)
2. Select an edge loop (`Alt``RMB`) going in the direction you want the edge ring selection to go.
3. Checker deselect (3D view > Header > checker deselect) the edge ring (you can use the `F6` menu to set the number of edges ... | This is not working in 2.93.8, but I found a video with an even easier answer. (Did not test on 2.79b.)
<https://www.youtube.com/watch?v=yCAWAOfFqDg>
1: In Edge Select Mode: Select one Edge only (not an Edge Loop) that is parallel to the loops you want to select, then select the next edge (the other side of the quad).... |
59,589,330 | ```
class A{
virtual void a();
};
class B : A{
virtual void a();
};
class C{
virtual void a();
};
class E : A, C{
virtual void a();
};
int main(){
std::cout << (sizeof(B)) << "\n"; // 4
std::cout << (sizeof(C)) << "\n"; // 4
std::cout << (sizeof(E)) << "\n"; // 8
}
```
in 32 bits system... | 2020/01/04 | [
"https://Stackoverflow.com/questions/59589330",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8461300/"
] | No, there is only one vtable pointer in every object which uses virtual functions, independently if the virtual function was defined in the class itself or the class derives from another class which uses virtual functions.
What the compiler generates is a table of function pointers, so that every class ( not instance/... | For single inheritance, derived class B just inserts one more entry to virtual table.
For multiple inheritance, derived class E has 2 virtual table pointers.
Further: [C++ virtual table layout of MI(multiple inheritance)](https://stackoverflow.com/questions/15921372/c-virtual-table-layout-of-mimultiple-inheritance) |
34,451,990 | I am fixing corrupted DB export to txt file, I am new to Regular expressions:
My corrupted lines can be found using Notepad++ regular expression:
```
\r\n[^"]
```
(fine line breaks followed by everything that is not " )
I need to delete these \r\n but I need to preserve the characters following it (in my data the... | 2015/12/24 | [
"https://Stackoverflow.com/questions/34451990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5714225/"
] | Make a minor change to the expression so that it reads `\r\n([^"])` (notice the extra `(` and `)`). This will place the match in a regex group.
Then, simply replace that by `\1`, which is the regex group you are matching in the expression above. | You could use a positive lookahead:
Find what: `\R(?!=[ ^"])`
Replace with: `NOTHING`
`\R` stands for any kind of linebreak.
`(?!=[ ^"])` is a zero width assertion that assumes there're no quotes after the linebreak |
2,013,835 | I'm running into a paradigm problem here. I don't know whether I should store money as a Decimal(), or if I should store it as a string and convert it to a decimal myself. My reasoning is this:
**PayPal requires 2 decimal places**, so if I have a product that is 49 dollars even, PayPal wants to see 49.00 come across t... | 2010/01/06 | [
"https://Stackoverflow.com/questions/2013835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/128463/"
] | You store it as a DecimalField and manually add the decimals if you need to, as Valya said, using basic formatting techniques.
You can even add a Model Method to you product or transaction model that will spit out the DecimalField as an appropriately formatted string. | I'm first-hands-on on Django and storing money values, too.
There is another possibility to store money values: just convert a money value to its minor representation and store that integer value in the database. If the rounding of the db backend can be adjusted to monetary arithmetic needs, this should work.
When r... |
2,013,835 | I'm running into a paradigm problem here. I don't know whether I should store money as a Decimal(), or if I should store it as a string and convert it to a decimal myself. My reasoning is this:
**PayPal requires 2 decimal places**, so if I have a product that is 49 dollars even, PayPal wants to see 49.00 come across t... | 2010/01/06 | [
"https://Stackoverflow.com/questions/2013835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/128463/"
] | I think you should store it in a decimal format and format it to 00.00 format **only** then sending it to PayPal, like this:
```
pricestr = "%01.2f" % price
```
If you want, you can add a method to your model:
```
def formattedprice(self):
return "%01.2f" % self.price
``` | You store it as a DecimalField and manually add the decimals if you need to, as Valya said, using basic formatting techniques.
You can even add a Model Method to you product or transaction model that will spit out the DecimalField as an appropriately formatted string. |
2,013,835 | I'm running into a paradigm problem here. I don't know whether I should store money as a Decimal(), or if I should store it as a string and convert it to a decimal myself. My reasoning is this:
**PayPal requires 2 decimal places**, so if I have a product that is 49 dollars even, PayPal wants to see 49.00 come across t... | 2010/01/06 | [
"https://Stackoverflow.com/questions/2013835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/128463/"
] | I suggest to avoid mixing representation with storage. Store the data as a decimal value with 2 places.
In the UI layer, display it in a form which is suitable for the user (so maybe omit the ".00").
When you send the data to PayPal, format it as the interface requires. | A better idea is to store money in minor currency units (smallest units possible). For euros and dollars the minor currency units are cents. There's a Python (and Django) package called [valuta](https://pypi.org/project/valuta/) based on the concept.
**Using currency classes directly**
```py
import valuta
valuta.EUR... |
2,013,835 | I'm running into a paradigm problem here. I don't know whether I should store money as a Decimal(), or if I should store it as a string and convert it to a decimal myself. My reasoning is this:
**PayPal requires 2 decimal places**, so if I have a product that is 49 dollars even, PayPal wants to see 49.00 come across t... | 2010/01/06 | [
"https://Stackoverflow.com/questions/2013835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/128463/"
] | Money should be stored in money field, which sadly does not exist. Since money is two dimensional value (amount, currency).
There is **python-money** lib, that has many forks, yet I haven't found working one.
---
Recommendations:
**python-money** probably the best fork <https://bitbucket.org/acoobe/python-money>
*... | You store it as a DecimalField and manually add the decimals if you need to, as Valya said, using basic formatting techniques.
You can even add a Model Method to you product or transaction model that will spit out the DecimalField as an appropriately formatted string. |
2,013,835 | I'm running into a paradigm problem here. I don't know whether I should store money as a Decimal(), or if I should store it as a string and convert it to a decimal myself. My reasoning is this:
**PayPal requires 2 decimal places**, so if I have a product that is 49 dollars even, PayPal wants to see 49.00 come across t... | 2010/01/06 | [
"https://Stackoverflow.com/questions/2013835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/128463/"
] | My late to the party version that adds South migrations.
```
from decimal import Decimal
from django.db import models
try:
from south.modelsinspector import add_introspection_rules
except ImportError:
SOUTH = False
else:
SOUTH = True
class CurrencyField(models.DecimalField):
__metaclass__ = models.Su... | You store it as a DecimalField and manually add the decimals if you need to, as Valya said, using basic formatting techniques.
You can even add a Model Method to you product or transaction model that will spit out the DecimalField as an appropriately formatted string. |
2,013,835 | I'm running into a paradigm problem here. I don't know whether I should store money as a Decimal(), or if I should store it as a string and convert it to a decimal myself. My reasoning is this:
**PayPal requires 2 decimal places**, so if I have a product that is 49 dollars even, PayPal wants to see 49.00 come across t... | 2010/01/06 | [
"https://Stackoverflow.com/questions/2013835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/128463/"
] | You might want to use the `.quantize()` method. This will round a decimal value to a certain number of places, the argument you provide specifies the number of places:
```
>>> from decimal import Decimal
>>> Decimal("12.234").quantize(Decimal("0.00"))
Decimal("12.23")
```
It can also take an argument to specify what... | I'm first-hands-on on Django and storing money values, too.
There is another possibility to store money values: just convert a money value to its minor representation and store that integer value in the database. If the rounding of the db backend can be adjusted to monetary arithmetic needs, this should work.
When r... |
2,013,835 | I'm running into a paradigm problem here. I don't know whether I should store money as a Decimal(), or if I should store it as a string and convert it to a decimal myself. My reasoning is this:
**PayPal requires 2 decimal places**, so if I have a product that is 49 dollars even, PayPal wants to see 49.00 come across t... | 2010/01/06 | [
"https://Stackoverflow.com/questions/2013835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/128463/"
] | Money should be stored in money field, which sadly does not exist. Since money is two dimensional value (amount, currency).
There is **python-money** lib, that has many forks, yet I haven't found working one.
---
Recommendations:
**python-money** probably the best fork <https://bitbucket.org/acoobe/python-money>
*... | I'm first-hands-on on Django and storing money values, too.
There is another possibility to store money values: just convert a money value to its minor representation and store that integer value in the database. If the rounding of the db backend can be adjusted to monetary arithmetic needs, this should work.
When r... |
2,013,835 | I'm running into a paradigm problem here. I don't know whether I should store money as a Decimal(), or if I should store it as a string and convert it to a decimal myself. My reasoning is this:
**PayPal requires 2 decimal places**, so if I have a product that is 49 dollars even, PayPal wants to see 49.00 come across t... | 2010/01/06 | [
"https://Stackoverflow.com/questions/2013835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/128463/"
] | I suggest to avoid mixing representation with storage. Store the data as a decimal value with 2 places.
In the UI layer, display it in a form which is suitable for the user (so maybe omit the ".00").
When you send the data to PayPal, format it as the interface requires. | In my experience and also from [others](http://www.databasesandlife.com/store-currency-amounts-as-number-of-cents-pence-etc/), money is best stored as combination of currency and the amount in cents.
It's very easy to handle and calculate with it. |
2,013,835 | I'm running into a paradigm problem here. I don't know whether I should store money as a Decimal(), or if I should store it as a string and convert it to a decimal myself. My reasoning is this:
**PayPal requires 2 decimal places**, so if I have a product that is 49 dollars even, PayPal wants to see 49.00 come across t... | 2010/01/06 | [
"https://Stackoverflow.com/questions/2013835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/128463/"
] | Money should be stored in money field, which sadly does not exist. Since money is two dimensional value (amount, currency).
There is **python-money** lib, that has many forks, yet I haven't found working one.
---
Recommendations:
**python-money** probably the best fork <https://bitbucket.org/acoobe/python-money>
*... | In my experience and also from [others](http://www.databasesandlife.com/store-currency-amounts-as-number-of-cents-pence-etc/), money is best stored as combination of currency and the amount in cents.
It's very easy to handle and calculate with it. |
2,013,835 | I'm running into a paradigm problem here. I don't know whether I should store money as a Decimal(), or if I should store it as a string and convert it to a decimal myself. My reasoning is this:
**PayPal requires 2 decimal places**, so if I have a product that is 49 dollars even, PayPal wants to see 49.00 come across t... | 2010/01/06 | [
"https://Stackoverflow.com/questions/2013835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/128463/"
] | My late to the party version that adds South migrations.
```
from decimal import Decimal
from django.db import models
try:
from south.modelsinspector import add_introspection_rules
except ImportError:
SOUTH = False
else:
SOUTH = True
class CurrencyField(models.DecimalField):
__metaclass__ = models.Su... | I suggest to avoid mixing representation with storage. Store the data as a decimal value with 2 places.
In the UI layer, display it in a form which is suitable for the user (so maybe omit the ".00").
When you send the data to PayPal, format it as the interface requires. |
443,728 | I'm in the processes of 'solarising' my electric bike, and would appreciate a more experienced opinion on how I intend to do it.
The motor is a 350W running off a 36 volt battery. I intend to get three 150W panels, each rated at 12V, and wire them in series to achieve 36V.
I've found an MPPT controller unit that ch... | 2019/06/15 | [
"https://electronics.stackexchange.com/questions/443728",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/224041/"
] | **Updated to use correct 150W panel sizes.**
>
> Given:
>
> - 350w 36 volt motor.
>
> - 36V battery
>
> - Three 150w 12V panels, each rated at 12v, wired in series
>
> - MPPT controller unit
>
>
> Would this be sufficient voltage to charge the battery with?
>
>
>
The panels will charge your ba... | PV panels meanly recognized by the short-circuit current and open-circuit voltage. They have a characteristic curve like the one shows bellow in half sun and full sun (It is the simplified curve). Full sun means that the PV module absorbs enough energy from the light to produce its rated power. When some PV cells are c... |
9,405 | I'm trying to learn russian, I would like to know what "светло мне" means. The complete phrase is: "Даже тёмной ночью светло мне". | 2015/08/09 | [
"https://russian.stackexchange.com/questions/9405",
"https://russian.stackexchange.com",
"https://russian.stackexchange.com/users/5848/"
] | "Светло" itself is an impersonal construction in the line with "Холодно", "Сыро", "Грязно", "Жарко" etc. Yet together with dative case it rather means *a particular person feels* that.
```
"Плохо" - It is bad
"Ему плохо" - He feels bad
```
Next, "*Мне светло*" is a kind of common poetical trope which even if may be ... | "Светло мне" означает, что у этого человека "светло на душе", то есть он испытывает чувство радости и душевный подъём даже тёмной ночью.
"Светло мне" means that this person "is light on the soul", that is, he feels a sense of joy and elation in the darkest of nights. |
2,128,137 | We are developed a custom [MOLAP](http://en.wikipedia.org/wiki/MOLAP) engine for live processing a large amount of data in process. And now we got a requirement to integrate SSAS with our system. Dimension's meta info and attributes data are very easy to get.
But how can I get facts data without making SSAS to calculat... | 2010/01/24 | [
"https://Stackoverflow.com/questions/2128137",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/127409/"
] | Try looking at DrillThrough in SSAS. This can display the fact-grain data, and is available in Excel as the default action when you double-click a cell. You can customise the result set, so long as all measures/dimensions come from the relevant fact table:
<http://csjohnlam.spaces.live.com/Blog/cns!996308EF3A99432B!21... | Bottom line, you cannot get the updated facts without reprocessing the cube. If you want the raw data in real time you will have to actually calculate it yourself from the dimension/fact tables in the data warehouse. |
2,128,137 | We are developed a custom [MOLAP](http://en.wikipedia.org/wiki/MOLAP) engine for live processing a large amount of data in process. And now we got a requirement to integrate SSAS with our system. Dimension's meta info and attributes data are very easy to get.
But how can I get facts data without making SSAS to calculat... | 2010/01/24 | [
"https://Stackoverflow.com/questions/2128137",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/127409/"
] | Try looking at DrillThrough in SSAS. This can display the fact-grain data, and is available in Excel as the default action when you double-click a cell. You can customise the result set, so long as all measures/dimensions come from the relevant fact table:
<http://csjohnlam.spaces.live.com/Blog/cns!996308EF3A99432B!21... | in ssas u can disable hierarchy level aggregation and for the empty rows use non- empty as a keyword before fetching the data |
65,079,245 | I have an array of objects that I get from database.
```
const users = await User.findAll();
```
To each of them, I want to call an async function `user.getDependency()` to get another related table, and devolve it nested in the object to a final format like this:
```
[
User {
attr1: value,
attr2: value,
... | 2020/11/30 | [
"https://Stackoverflow.com/questions/65079245",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5364792/"
] | To build some intuition, here is your forEach example converted with a push in the right direction.
```js
users.forEach((user) => {
user.getDependency().then(dependency => {
user.dependency = dependency
})
})
```
The above reads "for each user, start off the dependency fetching, then add the dependency to th... | I guess the best way is to do like this. Mapping users, updating every object (better to do this without mutation), and using Promise.all
```
const pupulatedUsers = await Promise.all(users.map(async (user) => ({
...user,
dependency: await getDependency(user.dependency_id)
// or something like getDependency
// ... |
65,079,245 | I have an array of objects that I get from database.
```
const users = await User.findAll();
```
To each of them, I want to call an async function `user.getDependency()` to get another related table, and devolve it nested in the object to a final format like this:
```
[
User {
attr1: value,
attr2: value,
... | 2020/11/30 | [
"https://Stackoverflow.com/questions/65079245",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5364792/"
] | To build some intuition, here is your forEach example converted with a push in the right direction.
```js
users.forEach((user) => {
user.getDependency().then(dependency => {
user.dependency = dependency
})
})
```
The above reads "for each user, start off the dependency fetching, then add the dependency to th... | you're right there is a straightforward way to resolve the promise
as the `users` variable is not a promise waiting to be resolved, you should try
```js
users.then((userList) => {
// function logic here
})
```
the `userList` in the then function should be iterable and contain the desired user list
also you c... |
65,079,245 | I have an array of objects that I get from database.
```
const users = await User.findAll();
```
To each of them, I want to call an async function `user.getDependency()` to get another related table, and devolve it nested in the object to a final format like this:
```
[
User {
attr1: value,
attr2: value,
... | 2020/11/30 | [
"https://Stackoverflow.com/questions/65079245",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5364792/"
] | I guess the best way is to do like this. Mapping users, updating every object (better to do this without mutation), and using Promise.all
```
const pupulatedUsers = await Promise.all(users.map(async (user) => ({
...user,
dependency: await getDependency(user.dependency_id)
// or something like getDependency
// ... | you're right there is a straightforward way to resolve the promise
as the `users` variable is not a promise waiting to be resolved, you should try
```js
users.then((userList) => {
// function logic here
})
```
the `userList` in the then function should be iterable and contain the desired user list
also you c... |
49,700,051 | I'm trying to make a POST request and send some values in the body of an API call. In the [documentation of the API](https://www.apify.com/docs/api/v1#/reference/executions/start-execution/start-execution) it says I need to make a POST request, using `startUrls` as an array with `key` and `value`.
```
<?php
$url = 'ht... | 2018/04/06 | [
"https://Stackoverflow.com/questions/49700051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9609345/"
] | According to [the documentation](http://php.net/manual/en/context.http.php), there is no `body` option for the HTTP context. Try `content` instead:
```
<?php
$url = "https://api.apify.com/v1/USERID/crawlers/CRAWLERID/execute?token=TOKENID";
$postData = [
"startUrls" => [
["key"=>"START", "value" => "https... | The following code will work. I have set the headers and specified the content type.
```
$request = new HttpRequest();
$request->setUrl('$url = 'https://api.apify.com/v1/USERID/crawlers/CRAWLERID/execute?token=TOKENID');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'cache-control' => 'no-cache'... |
24,669,765 | I want to loop li with different condition and apply different html depending on that condition.
If i code this way
```
<ul ng-repeat="item in items">
<li ng-if="item == '1'">
<div><span> <span>My test 123</span>
{{item }}
</span></div>
</li>
<li ng-if="item == '2'">
<div><span class="xyz"... | 2014/07/10 | [
"https://Stackoverflow.com/questions/24669765",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/171351/"
] | Repeat on the DOM element you want repeated?
```
<ul>
<li ng-repeat="item in items">{{item }}</li>
</ul>
``` | ```
<ul >
<li ng-repeat="item in items">{{item }}</li>
</ul>
``` |
7,231,999 | Although Rails and PHP have different deployment methods, what is the preferable way to distribute a FOSS Rails app? Suppose one of the major PHP apps - Magento, Drupal, Wordpress had been build upon RoR, what would have been the preferable way for them to have distributed their application?
Packaging up the code as a... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7231999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/509271/"
] | Many applications are packaged with the source code just like typical PHP applications. While deploying Rails applications may seem difficult its expected that the user will know how to set up the server properly according to their environment and needs. The only issue you need to worry about is distributing the code, ... | Well, usually Rails apps run in environment running Apache + Passenger (aka mod\_rails).
Deployment is easily done with Capistrano gem.
When you're running Rails app in shared host environment, they usually use fcgi/cgi dispatchers to run Ruby. |
7,231,999 | Although Rails and PHP have different deployment methods, what is the preferable way to distribute a FOSS Rails app? Suppose one of the major PHP apps - Magento, Drupal, Wordpress had been build upon RoR, what would have been the preferable way for them to have distributed their application?
Packaging up the code as a... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7231999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/509271/"
] | Packaging a completed Rails app as a gem *is* probably the wrong approach. I think the best solution is to provide access to a git repository or a tarball of your git repo.
If you want to offer your users something more than `rake db:schema:load` to setup your app it's pretty easy to create custom setup commands. | Well, usually Rails apps run in environment running Apache + Passenger (aka mod\_rails).
Deployment is easily done with Capistrano gem.
When you're running Rails app in shared host environment, they usually use fcgi/cgi dispatchers to run Ruby. |
7,231,999 | Although Rails and PHP have different deployment methods, what is the preferable way to distribute a FOSS Rails app? Suppose one of the major PHP apps - Magento, Drupal, Wordpress had been build upon RoR, what would have been the preferable way for them to have distributed their application?
Packaging up the code as a... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7231999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/509271/"
] | Packaging a completed Rails app as a gem *is* probably the wrong approach. I think the best solution is to provide access to a git repository or a tarball of your git repo.
If you want to offer your users something more than `rake db:schema:load` to setup your app it's pretty easy to create custom setup commands. | Many applications are packaged with the source code just like typical PHP applications. While deploying Rails applications may seem difficult its expected that the user will know how to set up the server properly according to their environment and needs. The only issue you need to worry about is distributing the code, ... |
19,909,846 | I am having an issue with VSExpress2012 keeping hold of the running exe after I have pressed stop debugging or closed the window.
I am creating a WPF app in C Sharp (my mac doesn't let me put the hash).
To re-run the app, I have to close VS, delete the bin folder, then re-open the solution.
This is super annoying. I ... | 2013/11/11 | [
"https://Stackoverflow.com/questions/19909846",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2139503/"
] | You can do by the following javascript which are as under:
```
<script type="text/javascript">
$(document).ready(function () {
$("input").not($(":button")).keypress(function (evt) {
if (evt.keyCode == 13) {
iname = $(this).val();
if (iname !== 'Submit') {
... | Instead of
```
iname = $(this).val();
if (iname !== 'Submit')..
```
better use
```
itype = $(this).attr('type');
if (itype !== 'submit')..
```
because val() returns the content of the input-field. Type 'Submit' and the content is submitted on enter. |
24,796,587 | ```
import java.net.*;
import java.io.*;
import java.sql.*;
import java.util.*;
public class URLConnectionReader {
static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
static final String DB_URL = "jdbc:mysql://localhost/EMP";
static final String USER = "root";
static final String PASS = "pas... | 2014/07/17 | [
"https://Stackoverflow.com/questions/24796587",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3839320/"
] | Your code doesn't compile and you will hit an ArrayOutOfBoundException at `myArray[3]="http://www.worldportsource.com/ports/index/IND.php";`
* You are creating the same reference name o1 2 times in the same scope.
* You are creating an array which can store 3 objects and you put 4 objects in it.
To answer your title,... | I don't think this code compiles. You have duplicate declaration of variable "o1". Also you will hit a run time exception as you are trying to assign myArray[3] when myArray is only of size 3. Your logic is creating new URL object each time in the loop, so there should not be any problem there. You have to close the st... |
37,308,179 | I would like to know if there are particular signals that indicate whether a site is using Solr or another search platform. | 2016/05/18 | [
"https://Stackoverflow.com/questions/37308179",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3277436/"
] | A well designed system usually has a layer of abstraction which hides the backend stack. There are many types of implementations for getting a text index. Various products available are: Elastic Search, Lucene, Solr, Sphinx, Postgres GIN index(with ts\_vector), etc. A good comparison is given in this [link](https://sta... | As commented by @kretan, no. You might be able to do a more or less qualified guess if the service exposes the query language for the backend service, but there's several services that uses the same syntax such as the Lucene query syntax - Elastic, Solr, raw Lucene, etc.).
You'll probably get better results by searchi... |
21,968,981 | I'm new to VBA, and have some trouble with using the Solver in a macro. I'm assigning a macro to a command button in Excel, and they calculate everything perfectly, but an ugly error shows up as well at the end ("Runtime error 1004, method calculation of object \_application failed").
```
Sub serieus1()
'
' serieus1 ... | 2014/02/23 | [
"https://Stackoverflow.com/questions/21968981",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3343378/"
] | Try the following for reading:
```
BufferedReader in = new BufferedReader(new InputStreamReader(xmbc_socket.getInputStream()));
String line = null;
StringBuilder responseData = new StringBuilder();
while((line = in.readLine()) != null) {
responseData.append(line);
}
```
Don't forget to close the BufferedReader whe... | you should use an asynctask to execute your json requests
here [you can find more info](http://developer.android.com/reference/android/os/AsyncTask.html) about asynctask
in that asynctask you can mannage your request with an httpclient |
21,968,981 | I'm new to VBA, and have some trouble with using the Solver in a macro. I'm assigning a macro to a command button in Excel, and they calculate everything perfectly, but an ugly error shows up as well at the end ("Runtime error 1004, method calculation of object \_application failed").
```
Sub serieus1()
'
' serieus1 ... | 2014/02/23 | [
"https://Stackoverflow.com/questions/21968981",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3343378/"
] | Try the following for reading:
```
BufferedReader in = new BufferedReader(new InputStreamReader(xmbc_socket.getInputStream()));
String line = null;
StringBuilder responseData = new StringBuilder();
while((line = in.readLine()) != null) {
responseData.append(line);
}
```
Don't forget to close the BufferedReader whe... | You could try to buffer the data locally, before doing any checks. Create a StringBuilder or StringBuffer, then read everything from the server.
You should also try to use a BufferedReader, and wrap it around the InputStreamReader. It is faster, because it loads more daa at once. |
29,510,626 | I am trying to find a way, within my code to search for an object that is in the Vectors that I have used. I am already pushing back the information into the different vectors and I know about .size to display the info. I want the user to be able to enter the bank account number then if that is correct display the cont... | 2015/04/08 | [
"https://Stackoverflow.com/questions/29510626",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4632784/"
] | In Oracle a variable name or identifier starts with underscore("\_") or letters. So, for `1order`, the interpreter knows there is no identifier, it must be a number, so it tries to get the number and separate the rest and succeeds. | Looking at the **explain plan**, you can see that Oracle could resolve the filter predicate, and the query is considered valid.
```
SQL> EXPLAIN PLAN FOR
2 SELECT * FROM OE.CUSTOMERS WHERE CUSTOMER_ID = 232ORDER BY CUSTOMER_ID;
Explained.
SQL>
SQL> SELECT * FROM TABLE(dbms_xplan.display);
PLAN_TABLE_OUTPUT
-----... |
12,707,654 | I m trying to understand the concept of fragment on android. The [official pages](http://developer.android.com/guide/components/fragments.html#Example) has some code snippets and a link mentioning the entire source code called `FragementLayout.java.` However on clicking it , I get redirected to this page
<http://deve... | 2012/10/03 | [
"https://Stackoverflow.com/questions/12707654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1203565/"
] | I have that exact file in the samples folder of 13, 14 & 16.
For extra credit, I recommend checking out the Fragments demo of Action Bar Sherlock, since I believe it shows a better way of learning Fragments.
For more discussion about this, check out my question & the related answers:
* [How many Activities vs Fragm... | You can find the Sample code as well as explanation in official Android Docs
[Here](http://developer.android.com/training/basics/fragments/index.html) |
12,707,654 | I m trying to understand the concept of fragment on android. The [official pages](http://developer.android.com/guide/components/fragments.html#Example) has some code snippets and a link mentioning the entire source code called `FragementLayout.java.` However on clicking it , I get redirected to this page
<http://deve... | 2012/10/03 | [
"https://Stackoverflow.com/questions/12707654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1203565/"
] | >
> Make a new project using
> create project from existing sample. Choose maximum target name then Select Sample ApiDemo.
> Finish. Now go to ApiDemos->src->com.example.android.apis.app->FragmentLayout.java
> .Enjoy
>
>
> | You can find the Sample code as well as explanation in official Android Docs
[Here](http://developer.android.com/training/basics/fragments/index.html) |
12,707,654 | I m trying to understand the concept of fragment on android. The [official pages](http://developer.android.com/guide/components/fragments.html#Example) has some code snippets and a link mentioning the entire source code called `FragementLayout.java.` However on clicking it , I get redirected to this page
<http://deve... | 2012/10/03 | [
"https://Stackoverflow.com/questions/12707654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1203565/"
] | Yes, it seems to be removed from the official Android online documentation.
However, it can be found in the downloadable "Samples for SDK" for each API level.
To download "Samples for SDK", using "Android 4.4.2 (API 19)" as an example:
1. Open Android SDK Manager (E.g. Eclipse > Window > Android SDK Manager).
2. Tic... | You can find the Sample code as well as explanation in official Android Docs
[Here](http://developer.android.com/training/basics/fragments/index.html) |
12,707,654 | I m trying to understand the concept of fragment on android. The [official pages](http://developer.android.com/guide/components/fragments.html#Example) has some code snippets and a link mentioning the entire source code called `FragementLayout.java.` However on clicking it , I get redirected to this page
<http://deve... | 2012/10/03 | [
"https://Stackoverflow.com/questions/12707654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1203565/"
] | I have that exact file in the samples folder of 13, 14 & 16.
For extra credit, I recommend checking out the Fragments demo of Action Bar Sherlock, since I believe it shows a better way of learning Fragments.
For more discussion about this, check out my question & the related answers:
* [How many Activities vs Fragm... | >
> Make a new project using
> create project from existing sample. Choose maximum target name then Select Sample ApiDemo.
> Finish. Now go to ApiDemos->src->com.example.android.apis.app->FragmentLayout.java
> .Enjoy
>
>
> |
12,707,654 | I m trying to understand the concept of fragment on android. The [official pages](http://developer.android.com/guide/components/fragments.html#Example) has some code snippets and a link mentioning the entire source code called `FragementLayout.java.` However on clicking it , I get redirected to this page
<http://deve... | 2012/10/03 | [
"https://Stackoverflow.com/questions/12707654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1203565/"
] | I have that exact file in the samples folder of 13, 14 & 16.
For extra credit, I recommend checking out the Fragments demo of Action Bar Sherlock, since I believe it shows a better way of learning Fragments.
For more discussion about this, check out my question & the related answers:
* [How many Activities vs Fragm... | Just clic on this link to download the example from Android Developers wbesite : [FragmentBasics.zip](http://developer.android.com/shareables/training/FragmentBasics.zip) |
12,707,654 | I m trying to understand the concept of fragment on android. The [official pages](http://developer.android.com/guide/components/fragments.html#Example) has some code snippets and a link mentioning the entire source code called `FragementLayout.java.` However on clicking it , I get redirected to this page
<http://deve... | 2012/10/03 | [
"https://Stackoverflow.com/questions/12707654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1203565/"
] | I have that exact file in the samples folder of 13, 14 & 16.
For extra credit, I recommend checking out the Fragments demo of Action Bar Sherlock, since I believe it shows a better way of learning Fragments.
For more discussion about this, check out my question & the related answers:
* [How many Activities vs Fragm... | Yes, it seems to be removed from the official Android online documentation.
However, it can be found in the downloadable "Samples for SDK" for each API level.
To download "Samples for SDK", using "Android 4.4.2 (API 19)" as an example:
1. Open Android SDK Manager (E.g. Eclipse > Window > Android SDK Manager).
2. Tic... |
12,707,654 | I m trying to understand the concept of fragment on android. The [official pages](http://developer.android.com/guide/components/fragments.html#Example) has some code snippets and a link mentioning the entire source code called `FragementLayout.java.` However on clicking it , I get redirected to this page
<http://deve... | 2012/10/03 | [
"https://Stackoverflow.com/questions/12707654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1203565/"
] | >
> Make a new project using
> create project from existing sample. Choose maximum target name then Select Sample ApiDemo.
> Finish. Now go to ApiDemos->src->com.example.android.apis.app->FragmentLayout.java
> .Enjoy
>
>
> | Just clic on this link to download the example from Android Developers wbesite : [FragmentBasics.zip](http://developer.android.com/shareables/training/FragmentBasics.zip) |
12,707,654 | I m trying to understand the concept of fragment on android. The [official pages](http://developer.android.com/guide/components/fragments.html#Example) has some code snippets and a link mentioning the entire source code called `FragementLayout.java.` However on clicking it , I get redirected to this page
<http://deve... | 2012/10/03 | [
"https://Stackoverflow.com/questions/12707654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1203565/"
] | >
> Make a new project using
> create project from existing sample. Choose maximum target name then Select Sample ApiDemo.
> Finish. Now go to ApiDemos->src->com.example.android.apis.app->FragmentLayout.java
> .Enjoy
>
>
> | Yes, it seems to be removed from the official Android online documentation.
However, it can be found in the downloadable "Samples for SDK" for each API level.
To download "Samples for SDK", using "Android 4.4.2 (API 19)" as an example:
1. Open Android SDK Manager (E.g. Eclipse > Window > Android SDK Manager).
2. Tic... |
12,707,654 | I m trying to understand the concept of fragment on android. The [official pages](http://developer.android.com/guide/components/fragments.html#Example) has some code snippets and a link mentioning the entire source code called `FragementLayout.java.` However on clicking it , I get redirected to this page
<http://deve... | 2012/10/03 | [
"https://Stackoverflow.com/questions/12707654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1203565/"
] | Yes, it seems to be removed from the official Android online documentation.
However, it can be found in the downloadable "Samples for SDK" for each API level.
To download "Samples for SDK", using "Android 4.4.2 (API 19)" as an example:
1. Open Android SDK Manager (E.g. Eclipse > Window > Android SDK Manager).
2. Tic... | Just clic on this link to download the example from Android Developers wbesite : [FragmentBasics.zip](http://developer.android.com/shareables/training/FragmentBasics.zip) |
39,508,533 | I have on the page, there are two identical sliders, but they may be more. I need to make a custom button `Next` for each of sliders. I try to do so:
HTML
```
<div class="slider-wrap">
<div class="slider">
<div class="slider-item">Slide 1</div>
<div class="slider-item">Slide 2</div>
<div c... | 2016/09/15 | [
"https://Stackoverflow.com/questions/39508533",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4160725/"
] | Add unique ids+ class to each slider & navigation
```
$('.slider').slick({
dots: true,
nextArrow: $('#next')
});
$('.slider2').slick({
dots: true,
nextArrow: $('#next2')
});
```
<http://codepen.io/anon/pen/QKNxNj>
for your second example you change the navigation id to a class
```
$('.slider').slick({
do... | You should use unique `ids` for this
```
$('#slider1').slick({
dots: true,
nextArrow: $('#next1')
});
$('#slider2').slick({
dots: true,
nextArrow: $('#next2')
});
```
<http://codepen.io/pranesh-r/pen/qakKNY> |
39,508,533 | I have on the page, there are two identical sliders, but they may be more. I need to make a custom button `Next` for each of sliders. I try to do so:
HTML
```
<div class="slider-wrap">
<div class="slider">
<div class="slider-item">Slide 1</div>
<div class="slider-item">Slide 2</div>
<div c... | 2016/09/15 | [
"https://Stackoverflow.com/questions/39508533",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4160725/"
] | Add unique ids+ class to each slider & navigation
```
$('.slider').slick({
dots: true,
nextArrow: $('#next')
});
$('.slider2').slick({
dots: true,
nextArrow: $('#next2')
});
```
<http://codepen.io/anon/pen/QKNxNj>
for your second example you change the navigation id to a class
```
$('.slider').slick({
do... | A more elegant solution might be to trigger off a class name, and then create nextArrow events for each instance of that class.
```
$('.slider-wrap').each(function (index, sliderWrap) {
var $slider = $(sliderWrap).find('.slider');
var $next = $(sliderWrap).find('.next');
$slider.slick({
dots: true,... |
39,508,533 | I have on the page, there are two identical sliders, but they may be more. I need to make a custom button `Next` for each of sliders. I try to do so:
HTML
```
<div class="slider-wrap">
<div class="slider">
<div class="slider-item">Slide 1</div>
<div class="slider-item">Slide 2</div>
<div c... | 2016/09/15 | [
"https://Stackoverflow.com/questions/39508533",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4160725/"
] | A more elegant solution might be to trigger off a class name, and then create nextArrow events for each instance of that class.
```
$('.slider-wrap').each(function (index, sliderWrap) {
var $slider = $(sliderWrap).find('.slider');
var $next = $(sliderWrap).find('.next');
$slider.slick({
dots: true,... | You should use unique `ids` for this
```
$('#slider1').slick({
dots: true,
nextArrow: $('#next1')
});
$('#slider2').slick({
dots: true,
nextArrow: $('#next2')
});
```
<http://codepen.io/pranesh-r/pen/qakKNY> |
66,592,302 | I am just trying to execute some Java code and print them out to the console, however, when I try to run it, it gives an error and says illegal start to expression. Does anyone know what is going on here?
```
package com.craneai;
public class Main {
public static void main(String[] args) {
public st... | 2021/03/12 | [
"https://Stackoverflow.com/questions/66592302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12253055/"
] | ```
public static void main(String[] args) {
System.out.println(F(6));
System.out.println(F(0));
System.out.println(F(1));
}
public static int F(int N) {
int X, Y, Z, I;
X = 2;
if(N <= 0) {
X = 3;
} else {
Y = 1;
Z =... | First: you're declaring a method inside another method - see that the `F` method is inside the `main` method. Java does not support nested methods.
Second: you're declaring `X` and `I` twice.
Third: You wrote two return types to your method: `void` and `int`.
This will work:
```
public class Main {
public stat... |
66,592,302 | I am just trying to execute some Java code and print them out to the console, however, when I try to run it, it gives an error and says illegal start to expression. Does anyone know what is going on here?
```
package com.craneai;
public class Main {
public static void main(String[] args) {
public st... | 2021/03/12 | [
"https://Stackoverflow.com/questions/66592302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12253055/"
] | ```
public static void main(String[] args) {
System.out.println(F(6));
System.out.println(F(0));
System.out.println(F(1));
}
public static int F(int N) {
int X, Y, Z, I;
X = 2;
if(N <= 0) {
X = 3;
} else {
Y = 1;
Z =... | Three main errors:
1. Nested method: `F` method inside `main`
2. Method F return `int` and `void`
3. You declared X and I twice.
Here is your class fixed:
```
public class Main {
public static void main(String[] args) {
System.out.println(F(6));
System.out.println(F(0));
... |
8,845,357 | I have a model (1) that has a field pointing to another model (2). I have a list of values coming from model (2) and I would like to filter objects in model(1) on all of them.
Basically I want to do this:
```
SomeModel.objects.filter(field1=x OR field1=y OR field1=z)
```
Is this possible, can't find anything in doc... | 2012/01/13 | [
"https://Stackoverflow.com/questions/8845357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/954950/"
] | If you want to 'OR' them together, Q objects should help you achieve this:
```
from django.db.models import Q
Samplemodel.objects.filter(Q(field1='x') | Q(field1='y'))
```
Ref link: <http://docs.djangoproject.com/en/dev/topics/db/queries/#complex-lookups-with-q-objects> | You can do this using `field1__in=['x', 'y']`
```
Samplemodel.objects.filter(field1__in=['x', 'y'])
``` |
69,812,253 | I have to make a http request for an api
base url is: <https://learning-objects-v2.p.rapidapi.com>
```
GET /search-provider?keywords=Python&lang=en&provider=Coursera&sort=popularity&model=strict&max=20&page=2
X-Rapidapi-Host: learning-objects-v2.p.rapidapi.com
X-Rapidapi-Key: key
Host: learning-objects-v2.p.rapidapi... | 2021/11/02 | [
"https://Stackoverflow.com/questions/69812253",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16840482/"
] | Try
```
Map<String, String> requestHeaders = {
'Content-type': 'application/json',
'Accept': 'application/json',
'Authorization': '<Your token>'
};
``` | ```
Client client = Client();
final baseHeader = {
HttpHeaders.authorizationHeader: getBaseAuth(),
HttpHeaders.contentTypeHeader: 'application/json; charset=UTF-8'
};
final response = await client.get(Uri.parse('$baseUrl/services/mobile/info'),
headers: baseHeader);
``` |
28,256,651 | I'm trying to decrease the size of an Android numberpicker, but already tried several things and I could not. I did not find a responsible attribute the change in size.
Wanted to do the following:

Must decrease because I have to put the numberpicker... | 2015/01/31 | [
"https://Stackoverflow.com/questions/28256651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4360167/"
] | I was facing a similar problem, I wanted to increase the text size of the NumberPicker but couldn't find a way to do it as part of the Widget. In my research I found the following solution:
```
<NumberPicker
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleX="0.75"
... | You may change directly on XML properties.
```
<NumberPicker
android:id="@+id/numberPicker"
android:layout_width="wrap_content"
android:layout_height="90dp"
android:orientation="vertical" />
``` |
28,256,651 | I'm trying to decrease the size of an Android numberpicker, but already tried several things and I could not. I did not find a responsible attribute the change in size.
Wanted to do the following:

Must decrease because I have to put the numberpicker... | 2015/01/31 | [
"https://Stackoverflow.com/questions/28256651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4360167/"
] | **Number Picker is quite not straight forword to modify or customize.
Below is code which will adjust the NumberPicker height to 360dp actual values are considered match parent or wrap content in height will not be considered.**
Text color,Text size,divider color can be changed as per style mentioned below
**Height ... | You may change directly on XML properties.
```
<NumberPicker
android:id="@+id/numberPicker"
android:layout_width="wrap_content"
android:layout_height="90dp"
android:orientation="vertical" />
``` |
28,256,651 | I'm trying to decrease the size of an Android numberpicker, but already tried several things and I could not. I did not find a responsible attribute the change in size.
Wanted to do the following:

Must decrease because I have to put the numberpicker... | 2015/01/31 | [
"https://Stackoverflow.com/questions/28256651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4360167/"
] | I was facing a similar problem, I wanted to increase the text size of the NumberPicker but couldn't find a way to do it as part of the Widget. In my research I found the following solution:
```
<NumberPicker
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleX="0.75"
... | **Number Picker is quite not straight forword to modify or customize.
Below is code which will adjust the NumberPicker height to 360dp actual values are considered match parent or wrap content in height will not be considered.**
Text color,Text size,divider color can be changed as per style mentioned below
**Height ... |
1,333,555 | I would like to copy files that are under the same name but in different folders into destdir. The issue is about not overwriting them in destdir.
Basically this could be enough, although I have no clue how to rename each of the file. As for now they all being overwritten:
>
> $ cp /src/folder/\*/file ~/dest/\*
>
>... | 2018/06/22 | [
"https://superuser.com/questions/1333555",
"https://superuser.com",
"https://superuser.com/users/722258/"
] | Here's one method:
```
cd /src/folder
for f in */file; do
cp -v "$f" ~/dest/"${f//\//_}"
done
```
that will copy `/src/folder/foobar/file` to `~/dest/foobar_file` which should be unique | You can see whether the `--backup` option of `cp` is available (I believe it isn't on MacOS, but I might be wrong):
```
cp --backup=t /src/folder/*/file /dest
```
will create file.jpg.~1~, file.jpg.~2~ and so on. |
34,776 | How can I remove the slash at the end of my breadcrumbs?
*Markup:*
```
<div class="breadcrumb">
<a href="/">Главная</a>
/
<a href="/admin">Управление</a>
/
<a href="/admin/build">Конструкция сайта</a>
</div>
```
*Screenshot:*
 | 2012/06/22 | [
"https://drupal.stackexchange.com/questions/34776",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/8208/"
] | I don't know of an example module that has all of those pieces together, but I think you'll find that field\_example and node\_example from the [Examples for Developers](http://drupal.org/project/examples/) project useful.
As well, [this page](http://drupal.org/node/582648) of the Features documentation mentions somet... | In my experience, you just want to create a content type by a custom module.
If this is your goal, all you need is to create a .install file.
When you install your module all the content type and field will be set up completely. |
9,798,684 | I have a view controller that it part of a UIPageViewController. Within this view controller, there is a view called `pdfView`. This view has a UIScrollview.
```
-UIPageViewController
-UIViewController
-pdfView (UIView)
-UIScrollView
```
I set the gesture recognizers of `pdfView` to be the UIP... | 2012/03/21 | [
"https://Stackoverflow.com/questions/9798684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/775624/"
] | Try this,
instead using a scrollview use a regural UIView
Add to this new UIView an UIPinchGestureRecognizer to zoom it and an UIPanGestureRecognizer to move the content. (you have to create the pinch and pan actions, but you can google them)
I did something similar and worked, the only problem is sometimes it detect ... | I made this library that makes this setup work
```
-UIPageViewController
-UIViewController
-UIView
-UIScrollView
-UIImageView
```
<https://github.com/holyman2k/WXPagedPhotoView>
the only issue i have is when user zoom the photo, the pageviewcontroller pan gesture is disabled t... |
9,798,684 | I have a view controller that it part of a UIPageViewController. Within this view controller, there is a view called `pdfView`. This view has a UIScrollview.
```
-UIPageViewController
-UIViewController
-pdfView (UIView)
-UIScrollView
```
I set the gesture recognizers of `pdfView` to be the UIP... | 2012/03/21 | [
"https://Stackoverflow.com/questions/9798684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/775624/"
] | I know my answer is the accepted, but I have tryed to change my UIView to a scrollView and all works better.
when I zoom a page, the pageview gestures of that page stop working, so I can zoom in and out, and pan the zoomed image withouth problem, and when I zoom to the initial scale, the page gestures start to work ag... | I made this library that makes this setup work
```
-UIPageViewController
-UIViewController
-UIView
-UIScrollView
-UIImageView
```
<https://github.com/holyman2k/WXPagedPhotoView>
the only issue i have is when user zoom the photo, the pageviewcontroller pan gesture is disabled t... |
20,665 | I am using [Fast Secure Contact Form plugin](http://wordpress.org/extend/plugins/si-contact-form/) to create contact form widget.It working fine . Now i like to change captcha appearance.
Original captcha generated by plugin

But, I need to c... | 2011/06/22 | [
"https://wordpress.stackexchange.com/questions/20665",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/4022/"
] | First, you should know that a image like that is very easy to read by almost any OCR. The first one is much more hard to crack.
Anyway, if you don't want to hack the existing plugin, you can use [Really Simple Captcha](http://wordpress.org/extend/plugins/really-simple-captcha/), it looks exactly like that.
In your fo... | I recently added reCAPTCHA feature to the forms:
By default, the original Secure Image CAPTCHA is enabled, but you can enable Google reCAPTCHA if you want. Just go to the form edit page Security tab - CAPTCHA Settings. Check the setting "Enable reCAPTCHA", enter your Google reCAPTCHA keys for the site. Included is a li... |
2,729,402 | Suppose $V$ and $W$ are vector spaces, and suppose $T : V \to W$ is a linear transformation. Let $S = \{v\_1,v\_2,v\_3\}$ be a set of linearly dependent vectors in $V$ .
Prove that $S' = \{T(v\_1), T(v\_2), T(v\_3)\}$ is a linearly dependent set of vectors in $W$. | 2018/04/09 | [
"https://math.stackexchange.com/questions/2729402",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/526930/"
] | By definition $\exists a,b,c\neq(0,0,0)$ such that
$$av\_1+bv\_2+cv\_3=0$$
then
$$T(av\_1+bv\_2+cv\_3)=aT(v\_1)+bT(v\_2)+cT(v\_3)=0$$
thus also $T(v\_1),T(v\_2), T(v\_3)$ are linearly dependent. | The vectors are linearly dependents iff there exist $(\lambda\_1,\lambda\_2,\lambda\_3) \neq (0,0,0)$ such that:
$$ \lambda\_1 v\_1 +\lambda\_2 v\_2 +\lambda\_3 v\_3=0$$
Using the linearity of $T$ we obtain:
$$\lambda\_1 T(v\_1) +\lambda\_2 T(v\_2) +\lambda\_3 T(v\_3)=T( \lambda\_1 v\_1 +\lambda\_2 v\_2 +\lambda\_3 v\_... |
40,160,233 | I'm looking for a set data structure that's optimised for a very low probability that an item is part of the set.
The use case is the Gnip/Twitter compliance firehose where we get approx 1,000 events per second (that's deletions from all of Twitter). We have a table of, let's say 10 million stored tweets (growing by ... | 2016/10/20 | [
"https://Stackoverflow.com/questions/40160233",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/148423/"
] | Finally, eureka!
I'm not sure about what was the mistake but I paste it here in case anyone is experiencig the same error:
1) I deleted my app on Firebase console
2) Create in Firebase console a new app with different name
3) Create and download a new GoogleService-Info.plist
4) Delete previous keys(`rm $HOME/Libr... | Your upload script doesn't appear to be setting the GOOGLE\_APP\_ID env var. The upload run script step should look something like the following:
```
# Replace this with the GOOGLE_APP_ID from your GoogleService-Info.plist file
GOOGLE_APP_ID=1:1234567890123:ios:1234abc567de89
# Replace the /Path/To/ServiceAccount.js... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.