qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
177,082 | When I say
>
> My friends and I went snowboarding.
>
>
>
somebody said to me there is a grammar mistake in my sentence but I could not figure out what it is. What is the grammar mistake in the sentence? Should it be
>
> I and my friends went snowboarding.
>
>
> | 2018/08/23 | [
"https://ell.stackexchange.com/questions/177082",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/11631/"
] | It is possible your friend had your sentence confused with a similar grammar error that you did NOT make.
It is incorrect to say "John gave apples to Ann and I"
Same reason:
You can say "John gave apples to Ann"
but you cannot say "John gave apples to I" | Your friends expected to see 'me' instead of 'I' . For example: 'Me and my friends went snowboarding.' |
177,082 | When I say
>
> My friends and I went snowboarding.
>
>
>
somebody said to me there is a grammar mistake in my sentence but I could not figure out what it is. What is the grammar mistake in the sentence? Should it be
>
> I and my friends went snowboarding.
>
>
> | 2018/08/23 | [
"https://ell.stackexchange.com/questions/177082",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/11631/"
] | >
> My friends and I went snowboarding
>
>
>
There's nothing wrong with the sentence; it's perfect.
How come somebody says that your sentence is not correct? Maybe he likes to use object pronouns when they are cojoined with other nouns/subject pronouns as many people tend to do so in informal speaking and writing... | Your friends expected to see 'me' instead of 'I' . For example: 'Me and my friends went snowboarding.' |
177,082 | When I say
>
> My friends and I went snowboarding.
>
>
>
somebody said to me there is a grammar mistake in my sentence but I could not figure out what it is. What is the grammar mistake in the sentence? Should it be
>
> I and my friends went snowboarding.
>
>
> | 2018/08/23 | [
"https://ell.stackexchange.com/questions/177082",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/11631/"
] | Your friends expected to see 'me' instead of 'I' . For example: 'Me and my friends went snowboarding.' | "me and my friends" is a fixed construction, which works well as subject in this sentence, allowing the object form "me". "I and my friends" is not.
One could argue that "my friends and me" is a totally acceptable construction too, but in this sentence, "me" would be followed by the verb, which makes it sound much too... |
177,082 | When I say
>
> My friends and I went snowboarding.
>
>
>
somebody said to me there is a grammar mistake in my sentence but I could not figure out what it is. What is the grammar mistake in the sentence? Should it be
>
> I and my friends went snowboarding.
>
>
> | 2018/08/23 | [
"https://ell.stackexchange.com/questions/177082",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/11631/"
] | Your sentence is entirely correct. I'm not sure why they thought it was incorrect, but I'll explain why you're correct, and then guess what *their* mistake may have been.
When we use two subjects together, we should be able to use either one by itself.
>
> My friends went snowboarding.
>
>
> I went snowboarding.
>... | "me and my friends" is a fixed construction, which works well as subject in this sentence, allowing the object form "me". "I and my friends" is not.
One could argue that "my friends and me" is a totally acceptable construction too, but in this sentence, "me" would be followed by the verb, which makes it sound much too... |
177,082 | When I say
>
> My friends and I went snowboarding.
>
>
>
somebody said to me there is a grammar mistake in my sentence but I could not figure out what it is. What is the grammar mistake in the sentence? Should it be
>
> I and my friends went snowboarding.
>
>
> | 2018/08/23 | [
"https://ell.stackexchange.com/questions/177082",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/11631/"
] | >
> My friends and I went snowboarding
>
>
>
There's nothing wrong with the sentence; it's perfect.
How come somebody says that your sentence is not correct? Maybe he likes to use object pronouns when they are cojoined with other nouns/subject pronouns as many people tend to do so in informal speaking and writing... | Generally speaking..
>
> My friends and I went snowboarding
>
>
>
..would be considered good "proper" English and is grammatically correct.
However, in general conversation people will say..
>
> Me and my friends went snowboarding
>
>
>
..which is *perfectly acceptable* in all but the most polite of circum... |
177,082 | When I say
>
> My friends and I went snowboarding.
>
>
>
somebody said to me there is a grammar mistake in my sentence but I could not figure out what it is. What is the grammar mistake in the sentence? Should it be
>
> I and my friends went snowboarding.
>
>
> | 2018/08/23 | [
"https://ell.stackexchange.com/questions/177082",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/11631/"
] | It is possible your friend had your sentence confused with a similar grammar error that you did NOT make.
It is incorrect to say "John gave apples to Ann and I"
Same reason:
You can say "John gave apples to Ann"
but you cannot say "John gave apples to I" | Generally speaking..
>
> My friends and I went snowboarding
>
>
>
..would be considered good "proper" English and is grammatically correct.
However, in general conversation people will say..
>
> Me and my friends went snowboarding
>
>
>
..which is *perfectly acceptable* in all but the most polite of circum... |
3,674,944 | In Exercise 2.24 of Enderton's *Elements of Set Theory*, we are asked to show that $$\bigcup{\{\mathcal{P}}X \ \mid X \in A\} \subseteq \mathcal{P} \bigcup A.$$
Fascinated by this exhilerating problem, I started off my proof by taking an arbitrary element $x$ of $\bigcup{\{\mathcal{P}}X \ \mid X \in A\}$ and showing ... | 2020/05/14 | [
"https://math.stackexchange.com/questions/3674944",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/773147/"
] | Let’s see if I can explain the source of your confusion.
By definition, if $Z$ is a set, then
$$\bigcup Z = \{b\mid \exists W\in Z(b\in W)\}.$$
You are correct on that.
Here what we have is
$$\bigcup \{\mathcal{P}X\mid X\in A\}.$$
The set $Z$ from the definition is
$$Z=\{\mathcal{P}X\mid X\in A\}.$$
That means that ... | You are applying the definition of union incorrectly. $$ x\in \bigcup\{\mathcal PX:X\in A\} $$ means that $x\in \mathcal P X$ for some $X\in A,$ not that $x\in b$ for some $b\in \mathcal P X$ for some $X\in A.$ |
3,674,944 | In Exercise 2.24 of Enderton's *Elements of Set Theory*, we are asked to show that $$\bigcup{\{\mathcal{P}}X \ \mid X \in A\} \subseteq \mathcal{P} \bigcup A.$$
Fascinated by this exhilerating problem, I started off my proof by taking an arbitrary element $x$ of $\bigcup{\{\mathcal{P}}X \ \mid X \in A\}$ and showing ... | 2020/05/14 | [
"https://math.stackexchange.com/questions/3674944",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/773147/"
] | You are applying the definition of union incorrectly. $$ x\in \bigcup\{\mathcal PX:X\in A\} $$ means that $x\in \mathcal P X$ for some $X\in A,$ not that $x\in b$ for some $b\in \mathcal P X$ for some $X\in A.$ | Thanks to the wonderful comments of @Arturo Magidin and @spaceisdarkgreen, I have figured out both the problem with my original proof, along with the solution to this exercise.
My original answer to the problem was based on a misunderstanding of the notation $\bigcup \{ \mathcal{P} X \mid x \in A\}$. I had assumed tha... |
3,674,944 | In Exercise 2.24 of Enderton's *Elements of Set Theory*, we are asked to show that $$\bigcup{\{\mathcal{P}}X \ \mid X \in A\} \subseteq \mathcal{P} \bigcup A.$$
Fascinated by this exhilerating problem, I started off my proof by taking an arbitrary element $x$ of $\bigcup{\{\mathcal{P}}X \ \mid X \in A\}$ and showing ... | 2020/05/14 | [
"https://math.stackexchange.com/questions/3674944",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/773147/"
] | Let’s see if I can explain the source of your confusion.
By definition, if $Z$ is a set, then
$$\bigcup Z = \{b\mid \exists W\in Z(b\in W)\}.$$
You are correct on that.
Here what we have is
$$\bigcup \{\mathcal{P}X\mid X\in A\}.$$
The set $Z$ from the definition is
$$Z=\{\mathcal{P}X\mid X\in A\}.$$
That means that ... | Thanks to the wonderful comments of @Arturo Magidin and @spaceisdarkgreen, I have figured out both the problem with my original proof, along with the solution to this exercise.
My original answer to the problem was based on a misunderstanding of the notation $\bigcup \{ \mathcal{P} X \mid x \in A\}$. I had assumed tha... |
25,205,228 | I am curious about Django database model pk.
Is there any difference this
```
class Category(models.Model):
category_id = models.AutoField(primary_key=True)
category_name = models.CharField(max_length=50)
```
between this?
```
class Category(models.Model):
category_name = models.CharField(max_length=50... | 2014/08/08 | [
"https://Stackoverflow.com/questions/25205228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2117469/"
] | Yes, the difference is, the column name in the database for the primary key is `category_id` and in the second case is `id`.
One way you can make the second example emulate the first one is:
```
class Category(models.Model):
category_name = models.CharField(max_length=50)
@property
def category_id(self):
... | The difference is **field name**.
For example, I definded **the model "Category"** with **the field "category\_id"**:
```py
# "myapp/models.py"
from django.db import models
class Category(models.Model):
category_id = models.AutoField(primary_key=True)
category_name = models.CharField(max_length=50)
```
Th... |
4,481,318 | >
> **Possible Duplicate:**
>
> [How do I get this CSS text-decoration override to work?](https://stackoverflow.com/questions/1823341/how-do-i-get-this-css-text-decoration-override-to-work)
>
>
>
Take a look at this simple example:
```html
<a href="#"> A <span>red</span> anchor </a>
```
```css
a {
colo... | 2010/12/19 | [
"https://Stackoverflow.com/questions/4481318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/425275/"
] | From the [`text-decoration` spec](http://www.w3.org/TR/CSS21/text.html#lining-striking-props):
>
> The 'text-decoration' property on descendant elements cannot have any effect on the decoration of the ancestor.
>
>
>
[The answer in the linked question](https://stackoverflow.com/questions/1823341/how-do-i-get-this... | As suggested by Pekka, here is my answer:
The text decoration DOES get changed when you set the text-decoration value. The problem is that since the Parent Element (the anchor) surrounds the span, it looks as though the span is getting underlined.
This is made obvious if you set the text-decoration of the span to tru... |
27,625,665 | I understand that -i flag takes a file (which may contain list of URLs) and I know that -o followed by a name can be specified to rename a item being downloaded using wget.
example:
`wget -i list_of_urls.txt`
`wget -o my_custom_name.mp3 http://example.com/some_file.mp3`
I have a file that looks like this:
file na... | 2014/12/23 | [
"https://Stackoverflow.com/questions/27625665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3393361/"
] | You can overload the division operator, but:
* It must always be a binary operator - you've only provider one operand
* It must always be static
* At least one of the operand types must be the type you're declaring it in
So for example:
```
using System;
class Program
{
public static string operator/ (Program l... | The `/` operator is a "binary" operator, meaning that it takes two arguments: `a / b`. The way you've written this, it's trying to overload it as a "unary" operator, such as `a++`.
Something like this ought to work, assuming your class is called "MyObject".
```
public static string[] operator/ (MyObject mine, object ... |
34,882,114 | i'm confused with this problem
when im working **locally** it's all fine
with this :
`foreach (glob("public/FolderA/B/") as $filename) {`
but when i put
`foreach (glob("http://www.exemple.com/public/FolderA/B/") as $filename) {`
doesn't work any solution ???
**History** : in the past i'm working with glob() a... | 2016/01/19 | [
"https://Stackoverflow.com/questions/34882114",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3542413/"
] | **glob()** per definition finds pathnames matching a pattern.
This means that the function will not work on remote files as the diretory / files to be examined must be accessible via the server's filesystem.
What you probably would need is accessing a remote filesystem thru an **FTP** server.
This is how it could ... | If your PHP script is running under Windows, you can use
```
glob("\\\\remoteServer\\public\\FolderA\\B\\*.*")
```
because as hherger said "directory / files to be examined must be accessible via the server's file system." and Windows allows access to other PCs using a UNC path. Because Windows uses backslashes inst... |
575,710 | I'm trying to [monkey patch](http://en.wikipedia.org/wiki/Monkey_patch) a Perl class: I want to change the behavior of an existing method.
[This node on perlmonks](http://www.perlmonks.org/?node_id=694332) shows how to *add* a function to an existing class. I found that this pattern can also be used to provide a new ... | 2009/02/22 | [
"https://Stackoverflow.com/questions/575710",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Typeglob assignment
-------------------
```
*ExistingClass::oldExistingFunction = *ExistingClass::existingFunction;
```
Quick and dirty. This aliases all `existingFunction` symbols to `oldExistingFunction`. This includes the sub you're interested in, but also any scalars, arrays, hashes, handles that might happen to... | For [Moose](http://metacpan.org/module/Moose) classes, you can just [do what jrockway says](https://stackoverflow.com/a/576425/40468); for non-Moose classes, do this:
```
use Class::MOP ();
use ExistingClass;
Class::MOP::Class->initialize('ExistingClass')->add_around_method_modifier(
existingFunction => sub {
... |
575,710 | I'm trying to [monkey patch](http://en.wikipedia.org/wiki/Monkey_patch) a Perl class: I want to change the behavior of an existing method.
[This node on perlmonks](http://www.perlmonks.org/?node_id=694332) shows how to *add* a function to an existing class. I found that this pattern can also be used to provide a new ... | 2009/02/22 | [
"https://Stackoverflow.com/questions/575710",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Just copy it to a lexical variable and call it.
```
my $existing_function_ref = \&ExistingClass::existingFunction;
*ExistingClass::existingFunction = sub {
my $self = shift;
$self->go_and_do_some_stuff();
my @returns = $existing_function_ref->( $self, @_ );
$self->do_some_stuff_with_returns( @returns ... | For [Moose](http://metacpan.org/module/Moose) classes, you can just [do what jrockway says](https://stackoverflow.com/a/576425/40468); for non-Moose classes, do this:
```
use Class::MOP ();
use ExistingClass;
Class::MOP::Class->initialize('ExistingClass')->add_around_method_modifier(
existingFunction => sub {
... |
575,710 | I'm trying to [monkey patch](http://en.wikipedia.org/wiki/Monkey_patch) a Perl class: I want to change the behavior of an existing method.
[This node on perlmonks](http://www.perlmonks.org/?node_id=694332) shows how to *add* a function to an existing class. I found that this pattern can also be used to provide a new ... | 2009/02/22 | [
"https://Stackoverflow.com/questions/575710",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | [Memoize](http://search.cpan.org/perldoc/Memoize) is a good example of this. | As an alterative, what's wrong with:
```
package NewClass;
use base qw/ExistingClass/;
sub existingFunction {
# ....
}
sub oldExistingFunction {
my $self = shift;
return $self->SUPER::existingFunction(@_);
}
``` |
575,710 | I'm trying to [monkey patch](http://en.wikipedia.org/wiki/Monkey_patch) a Perl class: I want to change the behavior of an existing method.
[This node on perlmonks](http://www.perlmonks.org/?node_id=694332) shows how to *add* a function to an existing class. I found that this pattern can also be used to provide a new ... | 2009/02/22 | [
"https://Stackoverflow.com/questions/575710",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You should use [Moose](http://search.cpan.org/perldoc?Moose) or [Class::Method::Modifiers](http://search.cpan.org/perldoc?Class::Method::Modifiers).
In that case, you can just say:
```
around 'some_method' => sub {
my ($orig, $self, @args) = @_;
# ... before original ...
$self->$orig(@_);
# ... after ... | [Memoize](http://search.cpan.org/perldoc/Memoize) is a good example of this. |
575,710 | I'm trying to [monkey patch](http://en.wikipedia.org/wiki/Monkey_patch) a Perl class: I want to change the behavior of an existing method.
[This node on perlmonks](http://www.perlmonks.org/?node_id=694332) shows how to *add* a function to an existing class. I found that this pattern can also be used to provide a new ... | 2009/02/22 | [
"https://Stackoverflow.com/questions/575710",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Typeglob assignment
-------------------
```
*ExistingClass::oldExistingFunction = *ExistingClass::existingFunction;
```
Quick and dirty. This aliases all `existingFunction` symbols to `oldExistingFunction`. This includes the sub you're interested in, but also any scalars, arrays, hashes, handles that might happen to... | [Memoize](http://search.cpan.org/perldoc/Memoize) is a good example of this. |
575,710 | I'm trying to [monkey patch](http://en.wikipedia.org/wiki/Monkey_patch) a Perl class: I want to change the behavior of an existing method.
[This node on perlmonks](http://www.perlmonks.org/?node_id=694332) shows how to *add* a function to an existing class. I found that this pattern can also be used to provide a new ... | 2009/02/22 | [
"https://Stackoverflow.com/questions/575710",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Besides the other answers, look at modules such as:
* [Sub::Override](http://search.cpan.org/dist/Sub-Override)
* [Hook::LexWrap](http://search.cpan.org/dist/Hook-LexWrap)
I also talk about this in the "Dynamic Languages" chapter in [Mastering Perl](http://oreilly.com/catalog/9780596527242/). | For [Moose](http://metacpan.org/module/Moose) classes, you can just [do what jrockway says](https://stackoverflow.com/a/576425/40468); for non-Moose classes, do this:
```
use Class::MOP ();
use ExistingClass;
Class::MOP::Class->initialize('ExistingClass')->add_around_method_modifier(
existingFunction => sub {
... |
575,710 | I'm trying to [monkey patch](http://en.wikipedia.org/wiki/Monkey_patch) a Perl class: I want to change the behavior of an existing method.
[This node on perlmonks](http://www.perlmonks.org/?node_id=694332) shows how to *add* a function to an existing class. I found that this pattern can also be used to provide a new ... | 2009/02/22 | [
"https://Stackoverflow.com/questions/575710",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You should use [Moose](http://search.cpan.org/perldoc?Moose) or [Class::Method::Modifiers](http://search.cpan.org/perldoc?Class::Method::Modifiers).
In that case, you can just say:
```
around 'some_method' => sub {
my ($orig, $self, @args) = @_;
# ... before original ...
$self->$orig(@_);
# ... after ... | As an alterative, what's wrong with:
```
package NewClass;
use base qw/ExistingClass/;
sub existingFunction {
# ....
}
sub oldExistingFunction {
my $self = shift;
return $self->SUPER::existingFunction(@_);
}
``` |
575,710 | I'm trying to [monkey patch](http://en.wikipedia.org/wiki/Monkey_patch) a Perl class: I want to change the behavior of an existing method.
[This node on perlmonks](http://www.perlmonks.org/?node_id=694332) shows how to *add* a function to an existing class. I found that this pattern can also be used to provide a new ... | 2009/02/22 | [
"https://Stackoverflow.com/questions/575710",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Besides the other answers, look at modules such as:
* [Sub::Override](http://search.cpan.org/dist/Sub-Override)
* [Hook::LexWrap](http://search.cpan.org/dist/Hook-LexWrap)
I also talk about this in the "Dynamic Languages" chapter in [Mastering Perl](http://oreilly.com/catalog/9780596527242/). | As an alterative, what's wrong with:
```
package NewClass;
use base qw/ExistingClass/;
sub existingFunction {
# ....
}
sub oldExistingFunction {
my $self = shift;
return $self->SUPER::existingFunction(@_);
}
``` |
575,710 | I'm trying to [monkey patch](http://en.wikipedia.org/wiki/Monkey_patch) a Perl class: I want to change the behavior of an existing method.
[This node on perlmonks](http://www.perlmonks.org/?node_id=694332) shows how to *add* a function to an existing class. I found that this pattern can also be used to provide a new ... | 2009/02/22 | [
"https://Stackoverflow.com/questions/575710",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Typeglob assignment
-------------------
```
*ExistingClass::oldExistingFunction = *ExistingClass::existingFunction;
```
Quick and dirty. This aliases all `existingFunction` symbols to `oldExistingFunction`. This includes the sub you're interested in, but also any scalars, arrays, hashes, handles that might happen to... | As an alterative, what's wrong with:
```
package NewClass;
use base qw/ExistingClass/;
sub existingFunction {
# ....
}
sub oldExistingFunction {
my $self = shift;
return $self->SUPER::existingFunction(@_);
}
``` |
575,710 | I'm trying to [monkey patch](http://en.wikipedia.org/wiki/Monkey_patch) a Perl class: I want to change the behavior of an existing method.
[This node on perlmonks](http://www.perlmonks.org/?node_id=694332) shows how to *add* a function to an existing class. I found that this pattern can also be used to provide a new ... | 2009/02/22 | [
"https://Stackoverflow.com/questions/575710",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Typeglob assignment
-------------------
```
*ExistingClass::oldExistingFunction = *ExistingClass::existingFunction;
```
Quick and dirty. This aliases all `existingFunction` symbols to `oldExistingFunction`. This includes the sub you're interested in, but also any scalars, arrays, hashes, handles that might happen to... | You should use [Moose](http://search.cpan.org/perldoc?Moose) or [Class::Method::Modifiers](http://search.cpan.org/perldoc?Class::Method::Modifiers).
In that case, you can just say:
```
around 'some_method' => sub {
my ($orig, $self, @args) = @_;
# ... before original ...
$self->$orig(@_);
# ... after ... |
63,509,183 | Is there a way to stream your webcam to your android app using Webrtc? | 2020/08/20 | [
"https://Stackoverflow.com/questions/63509183",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11141427/"
] | ### Update (Qt 6.2+)
As of Qt 6.2, [qt\_add\_qml\_module](https://doc-snapshots.qt.io/qt6-6.2/qt-add-qml-module.html) is a single command for building qml modules that should take care of virtually everything, replacing amongst others the old `qt6_qml_type_registration` command.
### Old answer (Qt 6.0/6.1)
Now that ... | Edit (Qt 6.x)
-------------
This answer was originally posted for Qt 5.15. Now that Qt 6 is available, and if you are using Qt 6, refer to the [answer from @Adversus](https://stackoverflow.com/a/65530243/4223664).
Original answer (Qt 5.x)
------------------------
From what I can see, `CONFIG += qmltypes`, which is r... |
1,090,447 | >
> For $z\in\mathbb{C}$, calculate the minimum value of
>
>
> $$
> f(z) = \left|z^2+z+1\right|+\left|z^2-z+1\right|
> $$
>
>
>
**My Attempt:**
Let $z= x+iy$. Then
$$
\begin{align}
z^2+z+1 &= (x+iy)^2+(x+iy)+1\\
&= (x^2-y^2+x+1)+i(2xy+y)
\end{align}
$$
and
$$
\begin{align}
z^2-z+1 &= (x+iy)^2-(x+iy)+1\\
&= (... | 2015/01/04 | [
"https://math.stackexchange.com/questions/1090447",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/14311/"
] | We can write $f$ in the form
$$f(z)=2|z|\>\left(\left|J(z)-{1\over2}\right|+\left|J(z)+{1\over2}\right|\right)\ ,$$
where $J$ denotes the so-called *Joukowski function*:
$$J(z):={1\over2}\left(z+{1\over z}\right)\ .$$
It is well known that $J$ maps circles $|z|=r$ onto ellipses centered at $0$ with foci $\pm1$ and semi... | Your analysis starts the right way. Substituting $z=x+iy$, you get as you write:
$$f(x,y)=\sqrt{(x^2-y^2+x+1)^2+(2xy+y)^2}+\sqrt{(x^2-y^2-x+1)^2+(y-2xy)^2}$$
The above now is a real multivariable function, so standard calculus techniques apply. In particular, the critical points are determined by looking first at the... |
10,522,343 | I need to write following query in Linq to SQL but not sure what is the best way of doing, given it has two derived tables. Any suggestions.
```
SELECT A.ID
FROM
(
SELECT *
FROM Orders
WHERE ProductID = 5
) A
JOIN
(
SELECT CustomerID, MAX(Price) Price
FROM Orders
WHER... | 2012/05/09 | [
"https://Stackoverflow.com/questions/10522343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/459876/"
] | ```
var b = (
from o in db.Orders
where o.ProductID == 5
group o by o.CustomerID into og
select new {
CustomerID = og.Key
Price = Max(og.Price)
}
);
var a = (
from o in db.Orders
join p in b on new {a.CustomerID, a.Price} equals
new {b.CustomerID, b.Price}
w... | Something along these lines:
```
var result = from a in context.Orders
join b in (context.Orders.Where(o => o.ProductID == 5).GroupBy(o => o.CustomerID).Select(g => new { CustomerID = g.Key, Price = g.Max(o => o.Price)))
on new {a.CustomerID, a.Price} equals new {b.CustomerID, b.Price}
... |
10,522,343 | I need to write following query in Linq to SQL but not sure what is the best way of doing, given it has two derived tables. Any suggestions.
```
SELECT A.ID
FROM
(
SELECT *
FROM Orders
WHERE ProductID = 5
) A
JOIN
(
SELECT CustomerID, MAX(Price) Price
FROM Orders
WHER... | 2012/05/09 | [
"https://Stackoverflow.com/questions/10522343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/459876/"
] | Can you simplify this with LINQ, especially if you use method syntax instead of query syntax.
```
orders.Where(o => o.ProductID == 5)
.GroupBy(o => o.CustomerID)
.SelectMany(g => g.Where(o => o.Price == g.Max(m => m.Price)));
```
My advice when writing LINQ, do not simply attempt to convert a SQL statement e... | Something along these lines:
```
var result = from a in context.Orders
join b in (context.Orders.Where(o => o.ProductID == 5).GroupBy(o => o.CustomerID).Select(g => new { CustomerID = g.Key, Price = g.Max(o => o.Price)))
on new {a.CustomerID, a.Price} equals new {b.CustomerID, b.Price}
... |
10,522,343 | I need to write following query in Linq to SQL but not sure what is the best way of doing, given it has two derived tables. Any suggestions.
```
SELECT A.ID
FROM
(
SELECT *
FROM Orders
WHERE ProductID = 5
) A
JOIN
(
SELECT CustomerID, MAX(Price) Price
FROM Orders
WHER... | 2012/05/09 | [
"https://Stackoverflow.com/questions/10522343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/459876/"
] | ```
var b = (
from o in db.Orders
where o.ProductID == 5
group o by o.CustomerID into og
select new {
CustomerID = og.Key
Price = Max(og.Price)
}
);
var a = (
from o in db.Orders
join p in b on new {a.CustomerID, a.Price} equals
new {b.CustomerID, b.Price}
w... | Can you simplify this with LINQ, especially if you use method syntax instead of query syntax.
```
orders.Where(o => o.ProductID == 5)
.GroupBy(o => o.CustomerID)
.SelectMany(g => g.Where(o => o.Price == g.Max(m => m.Price)));
```
My advice when writing LINQ, do not simply attempt to convert a SQL statement e... |
437,565 | I am trying to make a circuit using a 3V3 Arduino and other modules working on 3V3, but I have a problem with [an analog water sensor](https://www.thingbits.net/products/dfrobot-gravity-analog-water-pressure-sensor) I need to use. The output is a voltage range is from 0.5V to 4.5V.
I think I cannot use 4.5V signal on ... | 2019/05/08 | [
"https://electronics.stackexchange.com/questions/437565",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/221002/"
] | That's the standard way to do it but you might consider lowering your resistors so that the net effective impedance seen by the Arduino's ADC input is only a few kohm. Maybe use 5k1 and 10 kohm. You'll find in the data sheet that the ATMEGA328 chip likes to have a source impedance not greater than 10 kohm.
You might a... | >
> Scaling a 5V sensor with offset into a 3.3V full scale A/D
>
>
>
Since the sensor has a large offset (approximately 0.5V) and a span of 4V you have to scale the input and provide an adjustable offset control.
One possible solution is to use a single rail to rail op-amp powered by the 3.3V supply. This provid... |
437,565 | I am trying to make a circuit using a 3V3 Arduino and other modules working on 3V3, but I have a problem with [an analog water sensor](https://www.thingbits.net/products/dfrobot-gravity-analog-water-pressure-sensor) I need to use. The output is a voltage range is from 0.5V to 4.5V.
I think I cannot use 4.5V signal on ... | 2019/05/08 | [
"https://electronics.stackexchange.com/questions/437565",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/221002/"
] | That's the standard way to do it but you might consider lowering your resistors so that the net effective impedance seen by the Arduino's ADC input is only a few kohm. Maybe use 5k1 and 10 kohm. You'll find in the data sheet that the ATMEGA328 chip likes to have a source impedance not greater than 10 kohm.
You might a... | With 4.7K and 10K the values (3v3 Arduino 1023 max) are:
```
+5V Source
^
| 4.7K AX 10K
----/\/\/\----*----/\/\/\------GND
5V Source AX Analog AX
-------- ------ ------------
4.8 3.31 1023
4.5 3.12 964
4.0 2.80 865
3.5 2.45 757
3... |
437,565 | I am trying to make a circuit using a 3V3 Arduino and other modules working on 3V3, but I have a problem with [an analog water sensor](https://www.thingbits.net/products/dfrobot-gravity-analog-water-pressure-sensor) I need to use. The output is a voltage range is from 0.5V to 4.5V.
I think I cannot use 4.5V signal on ... | 2019/05/08 | [
"https://electronics.stackexchange.com/questions/437565",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/221002/"
] | With 4.7K and 10K the values (3v3 Arduino 1023 max) are:
```
+5V Source
^
| 4.7K AX 10K
----/\/\/\----*----/\/\/\------GND
5V Source AX Analog AX
-------- ------ ------------
4.8 3.31 1023
4.5 3.12 964
4.0 2.80 865
3.5 2.45 757
3... | >
> Scaling a 5V sensor with offset into a 3.3V full scale A/D
>
>
>
Since the sensor has a large offset (approximately 0.5V) and a span of 4V you have to scale the input and provide an adjustable offset control.
One possible solution is to use a single rail to rail op-amp powered by the 3.3V supply. This provid... |
3,086,481 | How to find the value this sum converges to?$$\sum\_{n=2}^{\infty}\frac{n+1}{n(2n-1)(2n+1)} $$
I've tried separating it like
$$\sum\_{n=2}^{\infty}\frac{1/2}{(2n+1)}+\frac{3/2}{(2n-1)}-\frac{1}{n}$$
and writing some terms and I get
$$1/6·(1+1/2+...+1/6n+3)+1/2·(1/3+1+1/2+...+1/6n-3)-(1+1/2+...1/n)$$
but I don't know h... | 2019/01/24 | [
"https://math.stackexchange.com/questions/3086481",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/602323/"
] | Hint: $\frac {n+1} {n(2n-1)(2n+1)}=\frac 3 4 \frac 1 {n(2n-1)} -\frac 1 4 \frac 1 {n(2n+1)}$. So what is left is to find the sums $\sum \frac 1 {n(2n-1)}$ and $\sum \frac 1 {n(2n+1)}$. | Proceeding on the partial fraction decomposition you already got
$$
\eqalign{
& S = \sum\limits\_{2\, \le \,n} {{{n + 1} \over {n\left( {2n - 1} \right)\left( {2n + 1} \right)}}} = \cr
& = \sum\limits\_{2\, \le \,n} {{{1/2} \over {\left( {2n + 1} \right)}} + {{3/2} \over {\left( {2n - 1} \right)}} + {1 \over n}} = \... |
3,086,481 | How to find the value this sum converges to?$$\sum\_{n=2}^{\infty}\frac{n+1}{n(2n-1)(2n+1)} $$
I've tried separating it like
$$\sum\_{n=2}^{\infty}\frac{1/2}{(2n+1)}+\frac{3/2}{(2n-1)}-\frac{1}{n}$$
and writing some terms and I get
$$1/6·(1+1/2+...+1/6n+3)+1/2·(1/3+1+1/2+...+1/6n-3)-(1+1/2+...1/n)$$
but I don't know h... | 2019/01/24 | [
"https://math.stackexchange.com/questions/3086481",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/602323/"
] | Hint: $\frac {n+1} {n(2n-1)(2n+1)}=\frac 3 4 \frac 1 {n(2n-1)} -\frac 1 4 \frac 1 {n(2n+1)}$. So what is left is to find the sums $\sum \frac 1 {n(2n-1)}$ and $\sum \frac 1 {n(2n+1)}$. | Here is a way to find those two sums @Kavi Rama Murthy refers to in his answer. They are found by first converting them to double integrals.
Let
$$S = \sum\_{n = 2}^\infty \frac{n + 1}{n(2n - 1)(2n + 1)} = \frac{3}{4} \sum\_{n = 2}^\infty \frac{1}{n (2n - 1)} - \frac{1}{4} \sum\_{n = 1}^\infty \frac{1}{n(2n + 1)} + \f... |
3,086,481 | How to find the value this sum converges to?$$\sum\_{n=2}^{\infty}\frac{n+1}{n(2n-1)(2n+1)} $$
I've tried separating it like
$$\sum\_{n=2}^{\infty}\frac{1/2}{(2n+1)}+\frac{3/2}{(2n-1)}-\frac{1}{n}$$
and writing some terms and I get
$$1/6·(1+1/2+...+1/6n+3)+1/2·(1/3+1+1/2+...+1/6n-3)-(1+1/2+...1/n)$$
but I don't know h... | 2019/01/24 | [
"https://math.stackexchange.com/questions/3086481",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/602323/"
] | Proceeding on the partial fraction decomposition you already got
$$
\eqalign{
& S = \sum\limits\_{2\, \le \,n} {{{n + 1} \over {n\left( {2n - 1} \right)\left( {2n + 1} \right)}}} = \cr
& = \sum\limits\_{2\, \le \,n} {{{1/2} \over {\left( {2n + 1} \right)}} + {{3/2} \over {\left( {2n - 1} \right)}} + {1 \over n}} = \... | Here is a way to find those two sums @Kavi Rama Murthy refers to in his answer. They are found by first converting them to double integrals.
Let
$$S = \sum\_{n = 2}^\infty \frac{n + 1}{n(2n - 1)(2n + 1)} = \frac{3}{4} \sum\_{n = 2}^\infty \frac{1}{n (2n - 1)} - \frac{1}{4} \sum\_{n = 1}^\infty \frac{1}{n(2n + 1)} + \f... |
51,739,255 | Say if there's a class attribute that is calculated depending on another class attribute:
```
class ClassA(object):
attr1=5
attr2=attr1+10
>>ClassA.attr2
15
```
And then in a child class I want to update the first class attribute to cause a change in the second one, without re-defining the second. e.g:
```... | 2018/08/08 | [
"https://Stackoverflow.com/questions/51739255",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5977437/"
] | You can use a `@classproperty` descriptor (similar to `@property`) if you don't want to use metaclasses.
Here's a simple implementation of a `classproperty` decorator
```
class classproperty(object):
def __init__(self, fget):
self.fget = classmethod(fget)
def __get__(self, obj, owner):
return... | Well, you can do those calculations in metaclass' `__new__` method:
```
class MyCalculatedClassAttrsMeta(type):
def __new__(cls, name, bases, dct):
c = super().__new__(cls, name, bases, dct)
c.y = c.x + 100
return c
class A(metaclass=MyCalculatedClassAttrsMeta):
x = 1
class B(A):
... |
51,739,255 | Say if there's a class attribute that is calculated depending on another class attribute:
```
class ClassA(object):
attr1=5
attr2=attr1+10
>>ClassA.attr2
15
```
And then in a child class I want to update the first class attribute to cause a change in the second one, without re-defining the second. e.g:
```... | 2018/08/08 | [
"https://Stackoverflow.com/questions/51739255",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5977437/"
] | There's no way to do this directly.
For instance attributes, rather than class attributes, you can simulate it pretty easily by using [`@property`](https://docs.python.org/3/library/functions.html#property). Either calculate `attr2` on the fly every time you ask for it:
```
class Spam:
def __init__(self, a):
... | Well, you can do those calculations in metaclass' `__new__` method:
```
class MyCalculatedClassAttrsMeta(type):
def __new__(cls, name, bases, dct):
c = super().__new__(cls, name, bases, dct)
c.y = c.x + 100
return c
class A(metaclass=MyCalculatedClassAttrsMeta):
x = 1
class B(A):
... |
34,761,051 | I'm trying to upload an image using codeigniter and no matter what
I keep getting "You did not select a file to upload" error.
Here's my Controller:
```
<?php
class Post extends CI_Controller {
function __construct(){
parent::__construct();
}
function index(){
$thi... | 2016/01/13 | [
"https://Stackoverflow.com/questions/34761051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4800314/"
] | As per the Jenkins [command line interface documentation](https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI), you need to use the **client** JAR file (not the **server** WAR file you're using), which you can obtain directly from Jenkins, e.g. via the links on <http://localhost:8080/cli>
Then you can run the comm... | If you don't find some straight forward command for installing plugins.
Please take a look at this link: [How to install a plugin in Jenkins manually?](https://stackoverflow.com/questions/14950408/how-to-install-a-plugin-in-jenkins-manually)
But it needs to download the plugin first(\*.hpi file) and run it manually. |
34,761,051 | I'm trying to upload an image using codeigniter and no matter what
I keep getting "You did not select a file to upload" error.
Here's my Controller:
```
<?php
class Post extends CI_Controller {
function __construct(){
parent::__construct();
}
function index(){
$thi... | 2016/01/13 | [
"https://Stackoverflow.com/questions/34761051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4800314/"
] | ```
import jenkins.model.*
import java.util.logging.Logger
def logger = Logger.getLogger("")
def installed = false
def initialized = false
def pluginParameter="gitlab-plugin hipchat swarm"
def plugins =pluginParameter.split()
logger.info("" + plugins)
def instance =Jenkins.getInstance()
def pm = instance.getPl... | If you don't find some straight forward command for installing plugins.
Please take a look at this link: [How to install a plugin in Jenkins manually?](https://stackoverflow.com/questions/14950408/how-to-install-a-plugin-in-jenkins-manually)
But it needs to download the plugin first(\*.hpi file) and run it manually. |
34,761,051 | I'm trying to upload an image using codeigniter and no matter what
I keep getting "You did not select a file to upload" error.
Here's my Controller:
```
<?php
class Post extends CI_Controller {
function __construct(){
parent::__construct();
}
function index(){
$thi... | 2016/01/13 | [
"https://Stackoverflow.com/questions/34761051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4800314/"
] | Since Sept 2019, you can also use the [Plugin Installation Manager Tool](https://github.com/jenkinsci/plugin-installation-manager-tool). It takes a yaml file listing the plugins, and downloads plugins to a folder of your choice. There is no need to have a running Jenkins instance. You can specify the plugin versions in... | If you don't find some straight forward command for installing plugins.
Please take a look at this link: [How to install a plugin in Jenkins manually?](https://stackoverflow.com/questions/14950408/how-to-install-a-plugin-in-jenkins-manually)
But it needs to download the plugin first(\*.hpi file) and run it manually. |
34,761,051 | I'm trying to upload an image using codeigniter and no matter what
I keep getting "You did not select a file to upload" error.
Here's my Controller:
```
<?php
class Post extends CI_Controller {
function __construct(){
parent::__construct();
}
function index(){
$thi... | 2016/01/13 | [
"https://Stackoverflow.com/questions/34761051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4800314/"
] | You will need jenkins-cli.jar file.
It can be downloaded from ${JENKINSURL}/jnlpJars/jenkins-cli.jar
```
wget http://localhost:8080/jnlpJars/jenkins-cli.jar
```
To install a plugin :
```
java -jar jenkins-cli.jar -auth ${USER}:${PASSWORD} -s ${JENKINSURL} install-plugin ${PLUGIN_NAME}
```
If you dont provide auth... | If you don't find some straight forward command for installing plugins.
Please take a look at this link: [How to install a plugin in Jenkins manually?](https://stackoverflow.com/questions/14950408/how-to-install-a-plugin-in-jenkins-manually)
But it needs to download the plugin first(\*.hpi file) and run it manually. |
34,761,051 | I'm trying to upload an image using codeigniter and no matter what
I keep getting "You did not select a file to upload" error.
Here's my Controller:
```
<?php
class Post extends CI_Controller {
function __construct(){
parent::__construct();
}
function index(){
$thi... | 2016/01/13 | [
"https://Stackoverflow.com/questions/34761051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4800314/"
] | As per the Jenkins [command line interface documentation](https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI), you need to use the **client** JAR file (not the **server** WAR file you're using), which you can obtain directly from Jenkins, e.g. via the links on <http://localhost:8080/cli>
Then you can run the comm... | ```
import jenkins.model.*
import java.util.logging.Logger
def logger = Logger.getLogger("")
def installed = false
def initialized = false
def pluginParameter="gitlab-plugin hipchat swarm"
def plugins =pluginParameter.split()
logger.info("" + plugins)
def instance =Jenkins.getInstance()
def pm = instance.getPl... |
34,761,051 | I'm trying to upload an image using codeigniter and no matter what
I keep getting "You did not select a file to upload" error.
Here's my Controller:
```
<?php
class Post extends CI_Controller {
function __construct(){
parent::__construct();
}
function index(){
$thi... | 2016/01/13 | [
"https://Stackoverflow.com/questions/34761051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4800314/"
] | As per the Jenkins [command line interface documentation](https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI), you need to use the **client** JAR file (not the **server** WAR file you're using), which you can obtain directly from Jenkins, e.g. via the links on <http://localhost:8080/cli>
Then you can run the comm... | Since Sept 2019, you can also use the [Plugin Installation Manager Tool](https://github.com/jenkinsci/plugin-installation-manager-tool). It takes a yaml file listing the plugins, and downloads plugins to a folder of your choice. There is no need to have a running Jenkins instance. You can specify the plugin versions in... |
34,761,051 | I'm trying to upload an image using codeigniter and no matter what
I keep getting "You did not select a file to upload" error.
Here's my Controller:
```
<?php
class Post extends CI_Controller {
function __construct(){
parent::__construct();
}
function index(){
$thi... | 2016/01/13 | [
"https://Stackoverflow.com/questions/34761051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4800314/"
] | As per the Jenkins [command line interface documentation](https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI), you need to use the **client** JAR file (not the **server** WAR file you're using), which you can obtain directly from Jenkins, e.g. via the links on <http://localhost:8080/cli>
Then you can run the comm... | You will need jenkins-cli.jar file.
It can be downloaded from ${JENKINSURL}/jnlpJars/jenkins-cli.jar
```
wget http://localhost:8080/jnlpJars/jenkins-cli.jar
```
To install a plugin :
```
java -jar jenkins-cli.jar -auth ${USER}:${PASSWORD} -s ${JENKINSURL} install-plugin ${PLUGIN_NAME}
```
If you dont provide auth... |
34,761,051 | I'm trying to upload an image using codeigniter and no matter what
I keep getting "You did not select a file to upload" error.
Here's my Controller:
```
<?php
class Post extends CI_Controller {
function __construct(){
parent::__construct();
}
function index(){
$thi... | 2016/01/13 | [
"https://Stackoverflow.com/questions/34761051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4800314/"
] | ```
import jenkins.model.*
import java.util.logging.Logger
def logger = Logger.getLogger("")
def installed = false
def initialized = false
def pluginParameter="gitlab-plugin hipchat swarm"
def plugins =pluginParameter.split()
logger.info("" + plugins)
def instance =Jenkins.getInstance()
def pm = instance.getPl... | You will need jenkins-cli.jar file.
It can be downloaded from ${JENKINSURL}/jnlpJars/jenkins-cli.jar
```
wget http://localhost:8080/jnlpJars/jenkins-cli.jar
```
To install a plugin :
```
java -jar jenkins-cli.jar -auth ${USER}:${PASSWORD} -s ${JENKINSURL} install-plugin ${PLUGIN_NAME}
```
If you dont provide auth... |
34,761,051 | I'm trying to upload an image using codeigniter and no matter what
I keep getting "You did not select a file to upload" error.
Here's my Controller:
```
<?php
class Post extends CI_Controller {
function __construct(){
parent::__construct();
}
function index(){
$thi... | 2016/01/13 | [
"https://Stackoverflow.com/questions/34761051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4800314/"
] | Since Sept 2019, you can also use the [Plugin Installation Manager Tool](https://github.com/jenkinsci/plugin-installation-manager-tool). It takes a yaml file listing the plugins, and downloads plugins to a folder of your choice. There is no need to have a running Jenkins instance. You can specify the plugin versions in... | You will need jenkins-cli.jar file.
It can be downloaded from ${JENKINSURL}/jnlpJars/jenkins-cli.jar
```
wget http://localhost:8080/jnlpJars/jenkins-cli.jar
```
To install a plugin :
```
java -jar jenkins-cli.jar -auth ${USER}:${PASSWORD} -s ${JENKINSURL} install-plugin ${PLUGIN_NAME}
```
If you dont provide auth... |
7,781,155 | What's the difference between GTK+ and GTK# and which one is "more multiplatform" ?
Which one is best supported - with the least effort by a mac osx final user ?
Important for me to get out of confusion:
Does .net use gtk# to show forms on non windows platforms ? | 2011/10/15 | [
"https://Stackoverflow.com/questions/7781155",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/988591/"
] | GTK# is .net wrapper for GTK+,
GKT# sharp can run on mono or .net.
.net runs on windows platforms only.
mono is an opensource implementation of .net, it is cross platform and can run on linux, Mac OSX, windows, android and IOS. However the GTK+ is only available on linux, windows and Mac
[MonoDevelop](http://monode... | Gtk# is just a set of bindings for Mono/.NET that allows you to use Gtk+.
.NET does not use GTK#, however, Mono does use Gtk#. You can use Gtk# with .NET, but .NET does not run on any other platforms. Mono != .NET, it is close but they are not equal. |
1,053,252 | My server time is in GMT, and I do the following whenever someone comes online.
```
// Set a default timezone
$defaultTimeZone = 'America/Toronto';
// load the user, if they are online...
$onlineUser = new user();
if (isset($_SESSION['user_id']))
{
if ($onlineUser->loadUser($_SESSION['user_id']))
{
$d... | 2009/06/27 | [
"https://Stackoverflow.com/questions/1053252",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/68452/"
] | The trick here is to know what column type `date_last_active` is. I've had enough experience with `TIMESTAMP` and `DATETIME` to know that one translates (and honors) the MySQL time\_zone session variable, the other doesn't.
```
mysql> SET SESSION time_zone = 'America/New_York';
Query OK, 0 rows affected (0.00 sec)
my... | I think Mysql's NOW() function stores the current time zone, which is definitely a hassle, I would check out CONVERT\_TZ(dt,from\_tz,to\_tz), this could solve your issue, also I believe php's time() returns server time, you could store this instead. the only drawback is you'd either have to convert the returned value t... |
1,053,252 | My server time is in GMT, and I do the following whenever someone comes online.
```
// Set a default timezone
$defaultTimeZone = 'America/Toronto';
// load the user, if they are online...
$onlineUser = new user();
if (isset($_SESSION['user_id']))
{
if ($onlineUser->loadUser($_SESSION['user_id']))
{
$d... | 2009/06/27 | [
"https://Stackoverflow.com/questions/1053252",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/68452/"
] | The trick here is to know what column type `date_last_active` is. I've had enough experience with `TIMESTAMP` and `DATETIME` to know that one translates (and honors) the MySQL time\_zone session variable, the other doesn't.
```
mysql> SET SESSION time_zone = 'America/New_York';
Query OK, 0 rows affected (0.00 sec)
my... | I have spend almost half day to solve this problem and I think I need to help others. So I am providing you some guide line to avoid problem regarding timezone.
>
> First of all you have two options either use **MYSQL TIMEZONE** or **PHP
> TIMEZONE** don't mix it with each other if you want stay away from timezone n... |
13,018,081 | I have a REST service running on ASP.NET 3.5 and I have multiple concurrent asynchronous calls from the client hitting the WCF service. They all get serialized (sequential) instead of parallel calls. Here are my settings
`InstanceContextMode = InstanceContextMode.PerSession`
`ConcurrencyMode = ConcurrencyMode.Multipl... | 2012/10/22 | [
"https://Stackoverflow.com/questions/13018081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/84793/"
] | Well if you don't mind passing the entity as a generic type instead of a string parameter you could try:
For Linq-to-Entities:
```
public void Distribute<TEntity>(ComboBox cb,
DbContext db,
string valueField,
string dis... | i tried few things and it works but i'm sure about it's code:
```
public void Distribute<TEntity>(ComboBox cb, BooksDBDataContext db, string valueField, string displayField)
where TEntity : class
{
var data = db.GetTable<TEntity>();
cb.ValueMember = valueField;
cb... |
47,535,753 | I am at a loss as how to complete this task. I need to count a range in a sheet if at least one of the words in a cell in that range matches an array. For example, if cell `"B2"` has a sentence with one of the words that is in the array then count as one, and simply `countif` a range if it matches with an array. My cod... | 2017/11/28 | [
"https://Stackoverflow.com/questions/47535753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8396248/"
] | You need to compare two lists for values within each other - your `Range` and the `Array`. The easiest way to do so is through nested loop. Like this:
```
Sub TestMe()
With ThisWorkbook
Dim Keywords As Variant
Dim iVal As Long
Dim myRange As Range
Dim myCell As ... | This was my answer much the same as @Vityata. Note you can use his suggestion of SpecialCells to ignore blanks when reading the range into the Array.
Note it looks for `"*Cold*"` if that is what is in the array. Put simply `"Cold"` etc ,in the array, if that is the word being looked for within the cell.
```
Option Ex... |
69,367,914 | Validator struct
```
type RegisterValidator struct {
Name string `form:"name" json:"name" binding:"required,min=4,max=50"`
Email string `form:"email" json:"email" binding:"required,email,min=4,max=50"`
Password string `form:"password" json:"password" binding:"r... | 2021/09/28 | [
"https://Stackoverflow.com/questions/69367914",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1110309/"
] | As the exception suggests, the following line failed type conversion
```
errs := err.(validator.ValidationErrors)
```
A different type of error must have got passed into the function that is not *`validator.ValidationErrors`*.
So either make sure other errors won't be passed into `NewValidatorError`. Or do a sa... | I added a check for the UnmarshalTypeError as below:
```
if reflect.TypeOf(err).Elem().String() == "json.UnmarshalTypeError" {
errs := err.(*json.UnmarshalTypeError)
res.Errors[errs.Field] = fmt.Sprintf("{key: %v}", errs.Error())
return res
}
errs := err.(validator.ValidationError... |
1,157,209 | How to connect to a new WiFi by entering a password using CMD?
For my school project I have decided to make a WiFi\_manager program using cmd.
I know to display all WiFi networks (in cmd):
```
netsh wlan show networks
```
Now let's say I want to connect to a WiFi network that I never connected to before. And that ... | 2016/12/16 | [
"https://superuser.com/questions/1157209",
"https://superuser.com",
"https://superuser.com/users/675905/"
] | Unfortunately if you want to connect to a wireless network from command prompt that requires a passcode it won't happen.
First of all to connect to a wireless network with a password you need to setup a profile or you need to have an already set up profile you can check that profile by using
```
Netsh wlan show prof... | You can definitely connect to a password-protected wireless network using only the command prompt.
First, create an XML file with your Wi-Fi connection details. Use this as a template, replacing `{SSID}` (appears twice) and `{PASSWORD}` with your own:
```
<?xml version="1.0"?>
<WLANProfile xmlns="http://www.microsoft... |
68,037,946 | \*\*for eg
123==
312
how to move the last digit in the first position in C++ without using if statement
```
#include <iostream>
using namespace std;
int main(){
int n=123;
while(n!=0){
}
cout<<n;//==312
}
``` | 2021/06/18 | [
"https://Stackoverflow.com/questions/68037946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15355017/"
] | We can rewrite the file writing using Win32 API:
```
void writeRaw(unsigned int thread)
{
const auto str = "test_" + std::to_string(thread) + ".txt";
auto hFile = CreateFileA(str.c_str(), GENERIC_WRITE,
FILE_SHARE_WRITE, nullptr, CREATE_ALWAYS, 0, nullptr);
DWORD ret{};
WriteFile(hFile, str.da... | At least on VS 2017, I can confirm the file is closed from your snippet. (In destructor of ofstream, the code calls fclose on the handle).
I think however, that the issue is not in the C++ code, but the behavior of the OS.
With Windows, the act of removing a file which the OS thinks is open, will be blocked. In Unix ... |
68,037,946 | \*\*for eg
123==
312
how to move the last digit in the first position in C++ without using if statement
```
#include <iostream>
using namespace std;
int main(){
int n=123;
while(n!=0){
}
cout<<n;//==312
}
``` | 2021/06/18 | [
"https://Stackoverflow.com/questions/68037946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15355017/"
] | At least on VS 2017, I can confirm the file is closed from your snippet. (In destructor of ofstream, the code calls fclose on the handle).
I think however, that the issue is not in the C++ code, but the behavior of the OS.
With Windows, the act of removing a file which the OS thinks is open, will be blocked. In Unix ... | The most probable cause of the problem is that when you delete a file in windows ,it isn't immediatly deleted (it's just flagged for deletion). It can/will take some milliseconds (up to seconds if you're very unlucky) for it to be actually deleted.
Source : Niall Douglas in “Better mutual exclusion on the filesystem u... |
68,037,946 | \*\*for eg
123==
312
how to move the last digit in the first position in C++ without using if statement
```
#include <iostream>
using namespace std;
int main(){
int n=123;
while(n!=0){
}
cout<<n;//==312
}
``` | 2021/06/18 | [
"https://Stackoverflow.com/questions/68037946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15355017/"
] | We can rewrite the file writing using Win32 API:
```
void writeRaw(unsigned int thread)
{
const auto str = "test_" + std::to_string(thread) + ".txt";
auto hFile = CreateFileA(str.c_str(), GENERIC_WRITE,
FILE_SHARE_WRITE, nullptr, CREATE_ALWAYS, 0, nullptr);
DWORD ret{};
WriteFile(hFile, str.da... | The most probable cause of the problem is that when you delete a file in windows ,it isn't immediatly deleted (it's just flagged for deletion). It can/will take some milliseconds (up to seconds if you're very unlucky) for it to be actually deleted.
Source : Niall Douglas in “Better mutual exclusion on the filesystem u... |
30,451,782 | Here is the jsFiddle for what I have at the moment: <https://jsfiddle.net/vst5fky5/>
I am redoing a Flash section in jQuery. There is a logo and 7 inline list items (navigation) that I need to animate from the top. I want to use jQuery to add top:-5em at the beginning, then have them come down one by one.
Nothing is ... | 2015/05/26 | [
"https://Stackoverflow.com/questions/30451782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2959040/"
] | You can use [ngClass](https://docs.angularjs.org/api/ng/directive/ngClass)
>
> The ngClass directive allows you to dynamically set CSS classes on an HTML element by databinding an expression that represents all classes to be added.
>
>
>
Since You are using [angularjs](/questions/tagged/angularjs "show questions ... | Assuming that you are trying to search Dove in your `li` markup. For that Try below code.
```
var yourQuery ="dove";
$('.nav').on('click', 'li', function(){
$('.nav li').removeClass('active');
$("li:contains('" + yourQuery + "')").addClass('active');
});
``` |
17,834,604 | I have a simple question for You.
It is possible to return to top after click on image, which is reference to jquery content?
For example: When I choose an image in "Portfolio" on <http://dash.com.pl/> I need to return to top of this (#portfolio). Thank You for Your help. | 2013/07/24 | [
"https://Stackoverflow.com/questions/17834604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2148811/"
] | You don't really need javascript for that, anchors will scroll to an ID if you supply a hash as the href ?
```
<a href="#portfolio"><img src="image/to/click.png" /></a>
```
doing just `<a href="#"></a>` scrolls to the top, and for other pages it's the same
`<a href="http://mysite.com/some/other/page/#divToScrollT... | You could just use a link attribute
```
<div id="portfolio">...</div>
<a href="#portfolio">
<img src="screen.png">
</a>
```
With jquery you can get element's position and scorll to the top
```
scroll(0, $('#portfolio').position().top)
```
Update:
Correct the jquery scroll example it need the x value. |
17,834,604 | I have a simple question for You.
It is possible to return to top after click on image, which is reference to jquery content?
For example: When I choose an image in "Portfolio" on <http://dash.com.pl/> I need to return to top of this (#portfolio). Thank You for Your help. | 2013/07/24 | [
"https://Stackoverflow.com/questions/17834604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2148811/"
] | You don't really need javascript for that, anchors will scroll to an ID if you supply a hash as the href ?
```
<a href="#portfolio"><img src="image/to/click.png" /></a>
```
doing just `<a href="#"></a>` scrolls to the top, and for other pages it's the same
`<a href="http://mysite.com/some/other/page/#divToScrollT... | Done. Thank You everybody for Your help.
This code helped me:
```
$(document).ready(function(){
$(this).scrollTop(3200);
});
``` |
17,834,604 | I have a simple question for You.
It is possible to return to top after click on image, which is reference to jquery content?
For example: When I choose an image in "Portfolio" on <http://dash.com.pl/> I need to return to top of this (#portfolio). Thank You for Your help. | 2013/07/24 | [
"https://Stackoverflow.com/questions/17834604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2148811/"
] | You could just use a link attribute
```
<div id="portfolio">...</div>
<a href="#portfolio">
<img src="screen.png">
</a>
```
With jquery you can get element's position and scorll to the top
```
scroll(0, $('#portfolio').position().top)
```
Update:
Correct the jquery scroll example it need the x value. | Done. Thank You everybody for Your help.
This code helped me:
```
$(document).ready(function(){
$(this).scrollTop(3200);
});
``` |
1,453,934 | First off I wasn't sure if I am just stating that I am posting this question here because it appears in my differential equations course. (Although it seems rather like a physics question).
**Question**
After a mass m is attached to a spring is stretches s units and then hangs at rest in the equilibrium position. The ... | 2015/09/27 | [
"https://math.stackexchange.com/questions/1453934",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/97407/"
] | At equilibrium, the spring’s restorative force cancels that of gravity, so you have $mg=-ks$. Then $\ddot x=-(k/m)s-(k/m)x=-(k/m)(x+s)$. However, we want displacement from the (new) equilibrium position, so we move the origin to $s$, which doesn’t change the $\ddot x$ term. The spring behaves the same way as it would w... | This really isn't an answer, but I am trying to help. If the mass is in the equilibrium position then the $F\_{net} = 0,$ i.e. the mass is not accelerating. Are you sure the answer is as you state it? I do not see a D.E. here. |
46,561,381 | **Scenario ->**
1. I am working on a branch different from master lets called it `Different`.
2. As I have created a pull request to review `Different` branch to all the team members.
3. One of the members checked in certain piece of code in the pull request and checked in the changes.
**Question 1:** What should I d... | 2017/10/04 | [
"https://Stackoverflow.com/questions/46561381",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2994849/"
] | If you are trying to make this button act the same as the regular back button on the Android device itself you can make use of the onBackPressed() method
So your code would be something like this:
```
backbutton = (Button) findViewById(R.id.back_button);
backbutton.setOnClickListener(new View.OnClickListener()... | Just finish activity
```
backbutton = (Button) findViewById(R.id.back_button);
backbutton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
``` |
46,561,381 | **Scenario ->**
1. I am working on a branch different from master lets called it `Different`.
2. As I have created a pull request to review `Different` branch to all the team members.
3. One of the members checked in certain piece of code in the pull request and checked in the changes.
**Question 1:** What should I d... | 2017/10/04 | [
"https://Stackoverflow.com/questions/46561381",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2994849/"
] | If you are trying to make this button act the same as the regular back button on the Android device itself you can make use of the onBackPressed() method
So your code would be something like this:
```
backbutton = (Button) findViewById(R.id.back_button);
backbutton.setOnClickListener(new View.OnClickListener()... | You can simple call the `onBackPressed()` system method inside your `onClickListener` interface.
something like this:
```
backbutton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
``` |
46,561,381 | **Scenario ->**
1. I am working on a branch different from master lets called it `Different`.
2. As I have created a pull request to review `Different` branch to all the team members.
3. One of the members checked in certain piece of code in the pull request and checked in the changes.
**Question 1:** What should I d... | 2017/10/04 | [
"https://Stackoverflow.com/questions/46561381",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2994849/"
] | If you are trying to make this button act the same as the regular back button on the Android device itself you can make use of the onBackPressed() method
So your code would be something like this:
```
backbutton = (Button) findViewById(R.id.back_button);
backbutton.setOnClickListener(new View.OnClickListener()... | Call this method `onBackPressed();` when you are click button.
```
backbutton = (Button) findViewById(R.id.back_button);
backbutton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});`
``` |
419,406 | How to prevent chrome to take more than for example 4GB of ram. From time to time he decides to take something like 7GB (with 8GB RAM total) and makes my computer unusable.
Do you have any help.
PS: I even didn't have more than 10 tabs opened.
Edit: maybe I did ... something like 15. Anyway I want chrome to freeze o... | 2018/01/24 | [
"https://unix.stackexchange.com/questions/419406",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/206961/"
] | I believe you would want to use something like `cgroups` to limit resource usage for a individual process.
So you might want to do something like [this](https://askubuntu.com/questions/510913/how-to-set-a-memory-limit-for-a-specific-process#510936) except with
`cgcreate -g memory,cpu:chromegroup
cgset -r memory.limi... | I believe that you can use the **ulimit** utility.
The **-d** option:
[ulimit(3) man page](https://ss64.com/bash/ulimit.html)
You can lower your soft limit even without **root** access to the server. |
419,406 | How to prevent chrome to take more than for example 4GB of ram. From time to time he decides to take something like 7GB (with 8GB RAM total) and makes my computer unusable.
Do you have any help.
PS: I even didn't have more than 10 tabs opened.
Edit: maybe I did ... something like 15. Anyway I want chrome to freeze o... | 2018/01/24 | [
"https://unix.stackexchange.com/questions/419406",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/206961/"
] | I believe that you can use the **ulimit** utility.
The **-d** option:
[ulimit(3) man page](https://ss64.com/bash/ulimit.html)
You can lower your soft limit even without **root** access to the server. | Another way to improve Chrome's behavior is to simply configure the JavaScript heap limits. Add this to the command line when starting Chrome:
`--js-flags="--max_old_space_size=80 --max_semi_space_size=80"`
This tells the JavaScript GC to limit memory usage to under 160M
Of course you can change the numbers for your ... |
419,406 | How to prevent chrome to take more than for example 4GB of ram. From time to time he decides to take something like 7GB (with 8GB RAM total) and makes my computer unusable.
Do you have any help.
PS: I even didn't have more than 10 tabs opened.
Edit: maybe I did ... something like 15. Anyway I want chrome to freeze o... | 2018/01/24 | [
"https://unix.stackexchange.com/questions/419406",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/206961/"
] | I believe you would want to use something like `cgroups` to limit resource usage for a individual process.
So you might want to do something like [this](https://askubuntu.com/questions/510913/how-to-set-a-memory-limit-for-a-specific-process#510936) except with
`cgcreate -g memory,cpu:chromegroup
cgset -r memory.limi... | Another way to improve Chrome's behavior is to simply configure the JavaScript heap limits. Add this to the command line when starting Chrome:
`--js-flags="--max_old_space_size=80 --max_semi_space_size=80"`
This tells the JavaScript GC to limit memory usage to under 160M
Of course you can change the numbers for your ... |
15,707,354 | 
I'm having trouble with a custom header in my UITableView.
In InterfaceBuilder, I'm creating a XIB file with a view, and then subclassing it to UITableViewHeaderFoo... | 2013/03/29 | [
"https://Stackoverflow.com/questions/15707354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1435520/"
] | >
> How do you control the index of a python for loop? (or can you? or should you?)
>
>
>
You *can't / shouldn't* - the loop control variable will be reassigned at the end of each iteration to the next element of whatever it is you are iterating over (so that `i = i + 1` has no effect, since `i` will be reassigned... | Check out the docs on `range` [here](http://docs.python.org/2/library/functions.html#range), or from the docstr:
```
range([start,] stop[, step]) -> list of integers
Return a list containing an arithmetic progression of integers.
range(i, j) returns [i, i+1, i+2, ..., j-1]; start (!) defaults to 0.
When step is given... |
3,397,980 | I'm trying to load all the collections eagerly, using [NHibernate 3 alpha 1](http://nhforge.org/media/p/690.aspx). I'm wondering if this the right way of using ThenFetch()?
Properties with plural names are collections. The others are just a single object.
```
IQueryable<T> milestoneInstances = Db.Find<T, ... | 2010/08/03 | [
"https://Stackoverflow.com/questions/3397980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23920/"
] | Apparently, there's no "right" way to use `ThenFetch` in such a case. Your example works fine but SQL produced contains many joins to `Milestone`, which isn't that right.
Using `IQueryOver` instead of `IQueryable` allows you to use [complex syntax](https://nhibernate.jira.com/browse/NH-2972?focusedCommentId=22151#comm... | The one thing you are missing is that you should use FetchMany() and ThenFetchMany() is the child property is a collection. |
3,397,980 | I'm trying to load all the collections eagerly, using [NHibernate 3 alpha 1](http://nhforge.org/media/p/690.aspx). I'm wondering if this the right way of using ThenFetch()?
Properties with plural names are collections. The others are just a single object.
```
IQueryable<T> milestoneInstances = Db.Find<T, ... | 2010/08/03 | [
"https://Stackoverflow.com/questions/3397980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23920/"
] | The one thing you are missing is that you should use FetchMany() and ThenFetchMany() is the child property is a collection. | As leora said, make sure when fetching children collections that you use
```
FetchMany()
ThenFetchMany()
```
A new Fetch, should pick up from the root, but this does not always happen. Sometimes you need to create them as separate queries or use Criteria Futures to batch up a multiple fetch. |
3,397,980 | I'm trying to load all the collections eagerly, using [NHibernate 3 alpha 1](http://nhforge.org/media/p/690.aspx). I'm wondering if this the right way of using ThenFetch()?
Properties with plural names are collections. The others are just a single object.
```
IQueryable<T> milestoneInstances = Db.Find<T, ... | 2010/08/03 | [
"https://Stackoverflow.com/questions/3397980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23920/"
] | The one thing you are missing is that you should use FetchMany() and ThenFetchMany() is the child property is a collection. | ```
IQueryable<T> milestoneInstances = Db.Find<T, IQueryable<T>>(db =>
from mi in db
where mi.RunDate == runDate
select mi);
var fetch = milestoneInstances.Fetch(f => f.Milestone);
fetch.ThenFetch(f => f.PrimaryOwners);
fetch.ThenFetch(f => f.SecondaryOwners);
//...
``` |
3,397,980 | I'm trying to load all the collections eagerly, using [NHibernate 3 alpha 1](http://nhforge.org/media/p/690.aspx). I'm wondering if this the right way of using ThenFetch()?
Properties with plural names are collections. The others are just a single object.
```
IQueryable<T> milestoneInstances = Db.Find<T, ... | 2010/08/03 | [
"https://Stackoverflow.com/questions/3397980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23920/"
] | Apparently, there's no "right" way to use `ThenFetch` in such a case. Your example works fine but SQL produced contains many joins to `Milestone`, which isn't that right.
Using `IQueryOver` instead of `IQueryable` allows you to use [complex syntax](https://nhibernate.jira.com/browse/NH-2972?focusedCommentId=22151#comm... | As leora said, make sure when fetching children collections that you use
```
FetchMany()
ThenFetchMany()
```
A new Fetch, should pick up from the root, but this does not always happen. Sometimes you need to create them as separate queries or use Criteria Futures to batch up a multiple fetch. |
3,397,980 | I'm trying to load all the collections eagerly, using [NHibernate 3 alpha 1](http://nhforge.org/media/p/690.aspx). I'm wondering if this the right way of using ThenFetch()?
Properties with plural names are collections. The others are just a single object.
```
IQueryable<T> milestoneInstances = Db.Find<T, ... | 2010/08/03 | [
"https://Stackoverflow.com/questions/3397980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23920/"
] | Apparently, there's no "right" way to use `ThenFetch` in such a case. Your example works fine but SQL produced contains many joins to `Milestone`, which isn't that right.
Using `IQueryOver` instead of `IQueryable` allows you to use [complex syntax](https://nhibernate.jira.com/browse/NH-2972?focusedCommentId=22151#comm... | ```
IQueryable<T> milestoneInstances = Db.Find<T, IQueryable<T>>(db =>
from mi in db
where mi.RunDate == runDate
select mi);
var fetch = milestoneInstances.Fetch(f => f.Milestone);
fetch.ThenFetch(f => f.PrimaryOwners);
fetch.ThenFetch(f => f.SecondaryOwners);
//...
``` |
3,397,980 | I'm trying to load all the collections eagerly, using [NHibernate 3 alpha 1](http://nhforge.org/media/p/690.aspx). I'm wondering if this the right way of using ThenFetch()?
Properties with plural names are collections. The others are just a single object.
```
IQueryable<T> milestoneInstances = Db.Find<T, ... | 2010/08/03 | [
"https://Stackoverflow.com/questions/3397980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23920/"
] | ```
IQueryable<T> milestoneInstances = Db.Find<T, IQueryable<T>>(db =>
from mi in db
where mi.RunDate == runDate
select mi);
var fetch = milestoneInstances.Fetch(f => f.Milestone);
fetch.ThenFetch(f => f.PrimaryOwners);
fetch.ThenFetch(f => f.SecondaryOwners);
//...
``` | As leora said, make sure when fetching children collections that you use
```
FetchMany()
ThenFetchMany()
```
A new Fetch, should pick up from the root, but this does not always happen. Sometimes you need to create them as separate queries or use Criteria Futures to batch up a multiple fetch. |
14,574,239 | I'm building a child play application for Android. I need to disable all keys when it is in use.
I have set the Application as the Home App and disabled the back key (that takes care of the Home and Back button).
In order to clear the recent tasks list I've created a list of Dummy Activites which start and then finish ... | 2013/01/29 | [
"https://Stackoverflow.com/questions/14574239",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2020064/"
] | Have you tried this code?
```
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
Log.d("Focus debug", "Focus changed !");
if(!hasFocus) {
Log.d("Focus debug", "Lost focus !");
Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
sendBroadca... | To the best of my knowledge, you cannot override the behavior of the home button (like the way you can override the behavior of the BACK button) without the user confirming it. In other words, the defaults of the app that currently handles the home button -- which is whatever the current home launcher is -- would have ... |
14,574,239 | I'm building a child play application for Android. I need to disable all keys when it is in use.
I have set the Application as the Home App and disabled the back key (that takes care of the Home and Back button).
In order to clear the recent tasks list I've created a list of Dummy Activites which start and then finish ... | 2013/01/29 | [
"https://Stackoverflow.com/questions/14574239",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2020064/"
] | This will close the RecentActivity dialog. Put it in your activity class.
```
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (!hasFocus) {
windowCloseHandler.postDelayed(windowCloserRunnable, 250);
}
}
privat... | To the best of my knowledge, you cannot override the behavior of the home button (like the way you can override the behavior of the BACK button) without the user confirming it. In other words, the defaults of the app that currently handles the home button -- which is whatever the current home launcher is -- would have ... |
14,574,239 | I'm building a child play application for Android. I need to disable all keys when it is in use.
I have set the Application as the Home App and disabled the back key (that takes care of the Home and Back button).
In order to clear the recent tasks list I've created a list of Dummy Activites which start and then finish ... | 2013/01/29 | [
"https://Stackoverflow.com/questions/14574239",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2020064/"
] | To the best of my knowledge, you cannot override the behavior of the home button (like the way you can override the behavior of the BACK button) without the user confirming it. In other words, the defaults of the app that currently handles the home button -- which is whatever the current home launcher is -- would have ... | You can disable StatusBar popups:
```
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
try {
if (!hasFocus) {
Object service = getSystemService("statusbar");
Class<?> statusbarManager = Class.forName("android.app.StatusBarManag... |
14,574,239 | I'm building a child play application for Android. I need to disable all keys when it is in use.
I have set the Application as the Home App and disabled the back key (that takes care of the Home and Back button).
In order to clear the recent tasks list I've created a list of Dummy Activites which start and then finish ... | 2013/01/29 | [
"https://Stackoverflow.com/questions/14574239",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2020064/"
] | Actually, you cannot disable task button. When you press it, your activity calls `onPause()` method and you can move your task to the front in this method. See my [answer](https://stackoverflow.com/a/34680899/5506252) for related question. | To the best of my knowledge, you cannot override the behavior of the home button (like the way you can override the behavior of the BACK button) without the user confirming it. In other words, the defaults of the app that currently handles the home button -- which is whatever the current home launcher is -- would have ... |
14,574,239 | I'm building a child play application for Android. I need to disable all keys when it is in use.
I have set the Application as the Home App and disabled the back key (that takes care of the Home and Back button).
In order to clear the recent tasks list I've created a list of Dummy Activites which start and then finish ... | 2013/01/29 | [
"https://Stackoverflow.com/questions/14574239",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2020064/"
] | This will close the RecentActivity dialog. Put it in your activity class.
```
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (!hasFocus) {
windowCloseHandler.postDelayed(windowCloserRunnable, 250);
}
}
privat... | Have you tried this code?
```
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
Log.d("Focus debug", "Focus changed !");
if(!hasFocus) {
Log.d("Focus debug", "Lost focus !");
Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
sendBroadca... |
14,574,239 | I'm building a child play application for Android. I need to disable all keys when it is in use.
I have set the Application as the Home App and disabled the back key (that takes care of the Home and Back button).
In order to clear the recent tasks list I've created a list of Dummy Activites which start and then finish ... | 2013/01/29 | [
"https://Stackoverflow.com/questions/14574239",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2020064/"
] | Have you tried this code?
```
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
Log.d("Focus debug", "Focus changed !");
if(!hasFocus) {
Log.d("Focus debug", "Lost focus !");
Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
sendBroadca... | You can disable StatusBar popups:
```
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
try {
if (!hasFocus) {
Object service = getSystemService("statusbar");
Class<?> statusbarManager = Class.forName("android.app.StatusBarManag... |
14,574,239 | I'm building a child play application for Android. I need to disable all keys when it is in use.
I have set the Application as the Home App and disabled the back key (that takes care of the Home and Back button).
In order to clear the recent tasks list I've created a list of Dummy Activites which start and then finish ... | 2013/01/29 | [
"https://Stackoverflow.com/questions/14574239",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2020064/"
] | Have you tried this code?
```
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
Log.d("Focus debug", "Focus changed !");
if(!hasFocus) {
Log.d("Focus debug", "Lost focus !");
Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
sendBroadca... | Actually, you cannot disable task button. When you press it, your activity calls `onPause()` method and you can move your task to the front in this method. See my [answer](https://stackoverflow.com/a/34680899/5506252) for related question. |
14,574,239 | I'm building a child play application for Android. I need to disable all keys when it is in use.
I have set the Application as the Home App and disabled the back key (that takes care of the Home and Back button).
In order to clear the recent tasks list I've created a list of Dummy Activites which start and then finish ... | 2013/01/29 | [
"https://Stackoverflow.com/questions/14574239",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2020064/"
] | This will close the RecentActivity dialog. Put it in your activity class.
```
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (!hasFocus) {
windowCloseHandler.postDelayed(windowCloserRunnable, 250);
}
}
privat... | You can disable StatusBar popups:
```
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
try {
if (!hasFocus) {
Object service = getSystemService("statusbar");
Class<?> statusbarManager = Class.forName("android.app.StatusBarManag... |
14,574,239 | I'm building a child play application for Android. I need to disable all keys when it is in use.
I have set the Application as the Home App and disabled the back key (that takes care of the Home and Back button).
In order to clear the recent tasks list I've created a list of Dummy Activites which start and then finish ... | 2013/01/29 | [
"https://Stackoverflow.com/questions/14574239",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2020064/"
] | This will close the RecentActivity dialog. Put it in your activity class.
```
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (!hasFocus) {
windowCloseHandler.postDelayed(windowCloserRunnable, 250);
}
}
privat... | Actually, you cannot disable task button. When you press it, your activity calls `onPause()` method and you can move your task to the front in this method. See my [answer](https://stackoverflow.com/a/34680899/5506252) for related question. |
14,574,239 | I'm building a child play application for Android. I need to disable all keys when it is in use.
I have set the Application as the Home App and disabled the back key (that takes care of the Home and Back button).
In order to clear the recent tasks list I've created a list of Dummy Activites which start and then finish ... | 2013/01/29 | [
"https://Stackoverflow.com/questions/14574239",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2020064/"
] | Actually, you cannot disable task button. When you press it, your activity calls `onPause()` method and you can move your task to the front in this method. See my [answer](https://stackoverflow.com/a/34680899/5506252) for related question. | You can disable StatusBar popups:
```
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
try {
if (!hasFocus) {
Object service = getSystemService("statusbar");
Class<?> statusbarManager = Class.forName("android.app.StatusBarManag... |
7,227,910 | We need to make a `branch` on **Subverison** in these days on our project.
One time `branch` made, we need to manage in practise 2 projects contemporary. This means, that if we resolve a bug on the `branch` we should make it also on `trunk`. First times it would basically easy merging, but more time pass, more `trunk... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7227910",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/156695/"
] | Do you have Simple XML checked under "*Order and Export*" in the Build Path configuration?
I just ran across this problem after updating to the latest `SDK` and *Eclipse plugins for Android*, having been successfully using Simple for months.
For some reason, after the update, I had to go and:
* Check `simple-xml-2... | you got this error because might be you do not have declare any of your Activity in to the manifest file. So please add it into your manifest file as like below:
```
<activity android:name=".DatabaseActivity"></activity>
```
here DatabaseActivity is my Activity of the application.
try it. |
7,227,910 | We need to make a `branch` on **Subverison** in these days on our project.
One time `branch` made, we need to manage in practise 2 projects contemporary. This means, that if we resolve a bug on the `branch` we should make it also on `trunk`. First times it would basically easy merging, but more time pass, more `trunk... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7227910",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/156695/"
] | Do you have Simple XML checked under "*Order and Export*" in the Build Path configuration?
I just ran across this problem after updating to the latest `SDK` and *Eclipse plugins for Android*, having been successfully using Simple for months.
For some reason, after the update, I had to go and:
* Check `simple-xml-2... | It's little strange, but this works for me.
```
Serializer serializer;
Persister persiter = new Persister();
serializer = persiter;
``` |
7,227,910 | We need to make a `branch` on **Subverison** in these days on our project.
One time `branch` made, we need to manage in practise 2 projects contemporary. This means, that if we resolve a bug on the `branch` we should make it also on `trunk`. First times it would basically easy merging, but more time pass, more `trunk... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7227910",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/156695/"
] | Do you have Simple XML checked under "*Order and Export*" in the Build Path configuration?
I just ran across this problem after updating to the latest `SDK` and *Eclipse plugins for Android*, having been successfully using Simple for months.
For some reason, after the update, I had to go and:
* Check `simple-xml-2... | I resolved same problem like yours modifying Java Build path.
I installed `Android DDMS 17.0.0.v201203161636-291853` today and `NoClassDefFoundError` appeared.
**How to fix** -> Check check box against `simple-xml` dependency and give it higher priority than `yourproject/src/main/java`
![enter image description here... |
7,227,910 | We need to make a `branch` on **Subverison** in these days on our project.
One time `branch` made, we need to manage in practise 2 projects contemporary. This means, that if we resolve a bug on the `branch` we should make it also on `trunk`. First times it would basically easy merging, but more time pass, more `trunk... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7227910",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/156695/"
] | You don't need those three other jars in your classpath.
Make sure your classpath looks like this and that you puth the jar file in the lib folder (for conventions sake):

Add the library to the build path
 do you get any errors about the jar that you are trying to include? Not all jars will work on Android. Older code may present a problem You may need to get source and recompile the jar you are interested in. This ensures that the bytecode is compatible with Android.... |
7,227,910 | We need to make a `branch` on **Subverison** in these days on our project.
One time `branch` made, we need to manage in practise 2 projects contemporary. This means, that if we resolve a bug on the `branch` we should make it also on `trunk`. First times it would basically easy merging, but more time pass, more `trunk... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7227910",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/156695/"
] | You don't need those three other jars in your classpath.
Make sure your classpath looks like this and that you puth the jar file in the lib folder (for conventions sake):

Add the library to the build path
:

Add the library to the build path
;
serializer = persiter;
``` |
7,227,910 | We need to make a `branch` on **Subverison** in these days on our project.
One time `branch` made, we need to manage in practise 2 projects contemporary. This means, that if we resolve a bug on the `branch` we should make it also on `trunk`. First times it would basically easy merging, but more time pass, more `trunk... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7227910",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/156695/"
] | Do you have Simple XML checked under "*Order and Export*" in the Build Path configuration?
I just ran across this problem after updating to the latest `SDK` and *Eclipse plugins for Android*, having been successfully using Simple for months.
For some reason, after the update, I had to go and:
* Check `simple-xml-2... | when you deploy your app to your device (or emulator) do you get any errors about the jar that you are trying to include? Not all jars will work on Android. Older code may present a problem You may need to get source and recompile the jar you are interested in. This ensures that the bytecode is compatible with Android.... |
7,227,910 | We need to make a `branch` on **Subverison** in these days on our project.
One time `branch` made, we need to manage in practise 2 projects contemporary. This means, that if we resolve a bug on the `branch` we should make it also on `trunk`. First times it would basically easy merging, but more time pass, more `trunk... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7227910",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/156695/"
] | You don't need those three other jars in your classpath.
Make sure your classpath looks like this and that you puth the jar file in the lib folder (for conventions sake):

Add the library to the build path
;
serializer = persiter;
``` |
25,212 | This question rather stems from my last question about inspiration vs copying from another authors work. While the suggestions I got there haven't completed resolved my issues and doubts, they have started me thinking differently about it.
As a recap, this whole issue started when I read a piece of fiction that moved... | 2016/11/12 | [
"https://writers.stackexchange.com/questions/25212",
"https://writers.stackexchange.com",
"https://writers.stackexchange.com/users/22178/"
] | My Personal Experience with Copy-Phobia
---------------------------------------
**I know exactly what you're talking about.**
Because I had exactly the same thing. For example, I love the video game *Dark Souls 3* very much, and I took it as inspiration for my own writing. I heavily inspired a character arc based of ... | One solution is to try and write a story backwards...literally.
Obliterate the very idea of making sense and this helps me at least to think in terms of creating and not so much writing...thus being called "not yours" or stolen.
There is nothing wrong at all with creating in the mold of another but yes the eternal st... |
25,212 | This question rather stems from my last question about inspiration vs copying from another authors work. While the suggestions I got there haven't completed resolved my issues and doubts, they have started me thinking differently about it.
As a recap, this whole issue started when I read a piece of fiction that moved... | 2016/11/12 | [
"https://writers.stackexchange.com/questions/25212",
"https://writers.stackexchange.com",
"https://writers.stackexchange.com/users/22178/"
] | My Personal Experience with Copy-Phobia
---------------------------------------
**I know exactly what you're talking about.**
Because I had exactly the same thing. For example, I love the video game *Dark Souls 3* very much, and I took it as inspiration for my own writing. I heavily inspired a character arc based of ... | Honestly, if you have not yet the read the writer who makes you say, oh no, I will never ever be able to be that good, you are not ready to start writing. Despair has to be the starting point, because only despair at imitation will break you out of the beginner's habit of pastiche and hesitation and get you to the poin... |
25,212 | This question rather stems from my last question about inspiration vs copying from another authors work. While the suggestions I got there haven't completed resolved my issues and doubts, they have started me thinking differently about it.
As a recap, this whole issue started when I read a piece of fiction that moved... | 2016/11/12 | [
"https://writers.stackexchange.com/questions/25212",
"https://writers.stackexchange.com",
"https://writers.stackexchange.com/users/22178/"
] | Honestly, if you have not yet the read the writer who makes you say, oh no, I will never ever be able to be that good, you are not ready to start writing. Despair has to be the starting point, because only despair at imitation will break you out of the beginner's habit of pastiche and hesitation and get you to the poin... | One solution is to try and write a story backwards...literally.
Obliterate the very idea of making sense and this helps me at least to think in terms of creating and not so much writing...thus being called "not yours" or stolen.
There is nothing wrong at all with creating in the mold of another but yes the eternal st... |
52,004,676 | I am trying to pass an ArrayList to a method in Java. But it gives me the error:
```
incompatible types: java.lang.String cannot be converted to java.util.List<java.lang.String>"
```
Here is the code:
```
class hello
{
public static void main()
{
List<String> iname = new ArrayList<>();
... | 2018/08/24 | [
"https://Stackoverflow.com/questions/52004676",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10269569/"
] | Your method returns a simple String which is about to be assigned to a List.
Change changename to `public List<String> changeName(...)` or use a new varible which is of type String and assign the return value. | Your method `public String changeName(List<String> iname){}` is returning a String instead of a list of Strings. Try `public List<String> changeName(List<String> iname){}` instead. The method changeName is trying to fit an entire list into a single String. If you left your program as it, then you would have to return a... |
52,004,676 | I am trying to pass an ArrayList to a method in Java. But it gives me the error:
```
incompatible types: java.lang.String cannot be converted to java.util.List<java.lang.String>"
```
Here is the code:
```
class hello
{
public static void main()
{
List<String> iname = new ArrayList<>();
... | 2018/08/24 | [
"https://Stackoverflow.com/questions/52004676",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10269569/"
] | `iname` is `List<String>`, while the return type of method `changeName` is `String`.
If you want to return `List<String>`, you can declare it this way:
```
public List<String> changeName(List<String> iname){
// ... you should return a List<String> in this method
}
``` | Your method `public String changeName(List<String> iname){}` is returning a String instead of a list of Strings. Try `public List<String> changeName(List<String> iname){}` instead. The method changeName is trying to fit an entire list into a single String. If you left your program as it, then you would have to return a... |
52,004,676 | I am trying to pass an ArrayList to a method in Java. But it gives me the error:
```
incompatible types: java.lang.String cannot be converted to java.util.List<java.lang.String>"
```
Here is the code:
```
class hello
{
public static void main()
{
List<String> iname = new ArrayList<>();
... | 2018/08/24 | [
"https://Stackoverflow.com/questions/52004676",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10269569/"
] | `iname` is `List<String>`, while the return type of method `changeName` is `String`.
If you want to return `List<String>`, you can declare it this way:
```
public List<String> changeName(List<String> iname){
// ... you should return a List<String> in this method
}
``` | Your variable `iname` is of type `List<String>` but you are attempting to return type `String` from your method `changeName(...)`.
You need to either update the method to return a type `List<String>`:
`public List<String> changeName(List<String> iname){ ... }`
Or change the variable the method is returned into like:... |
52,004,676 | I am trying to pass an ArrayList to a method in Java. But it gives me the error:
```
incompatible types: java.lang.String cannot be converted to java.util.List<java.lang.String>"
```
Here is the code:
```
class hello
{
public static void main()
{
List<String> iname = new ArrayList<>();
... | 2018/08/24 | [
"https://Stackoverflow.com/questions/52004676",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10269569/"
] | `iname` is `List<String>`, while the return type of method `changeName` is `String`.
If you want to return `List<String>`, you can declare it this way:
```
public List<String> changeName(List<String> iname){
// ... you should return a List<String> in this method
}
``` | The problem is that you try to store the return of your `changeName` function (a `String`) in the `iname` variable, which can only hold `List<String>`. This should work:
```
String result = obj.changeName(iname);
```
The alternative would be, to change the `changeName` to return `List<String>`, and change the functi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.