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 |
|---|---|---|---|---|---|
20,360 | I'm developing a WordPress theme framework. I want organize CSS for each section into separate files for the following reasons.
1. Developers can easily deregister styles by parent theme and load their own styles.
2. Easy to maintain.
3. I can load only the required styles based on the options selected by the user.
D... | 2011/06/18 | [
"https://wordpress.stackexchange.com/questions/20360",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2193/"
] | From <http://headjs.com/> :
There is a common misbelief that a single combined script performs best. Wrong:
* latest browsers and Head JS can load scripts in parallel. loading 3 parts in parallel instead of as a single chunk is usually faster.
* iPhone 3.x cannot cache files larger than 15kb and in iPhone 4 the limit... | Following @edelwater's excellent answer, another side-effect of the 'combine all' mantra is the induction of unused selectors.
Whilst perhaps unnoticeable on modern desktops, there's still an extra hit on rendering time. For example, [Chrome audit advises their removal](http://2.bp.blogspot.com/-V04Coubgp3I/Taq11H7uYr... |
20,360 | I'm developing a WordPress theme framework. I want organize CSS for each section into separate files for the following reasons.
1. Developers can easily deregister styles by parent theme and load their own styles.
2. Easy to maintain.
3. I can load only the required styles based on the options selected by the user.
D... | 2011/06/18 | [
"https://wordpress.stackexchange.com/questions/20360",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2193/"
] | From <http://headjs.com/> :
There is a common misbelief that a single combined script performs best. Wrong:
* latest browsers and Head JS can load scripts in parallel. loading 3 parts in parallel instead of as a single chunk is usually faster.
* iPhone 3.x cannot cache files larger than 15kb and in iPhone 4 the limit... | Thank you edelwater and TheDeadMedic for you answers.
I think I will use the WordPress file system to save the files to uploads directory.
<http://ottopress.com/2011/tutorial-using-the-wp_filesystem/>
I have to ask for ftp login on some wordpress installs, I think I can handle that without loosing the AJAX options p... |
17,634 | Usually (eg, intro. in M. Rost's 'Cycle modules with coefficients'), for a variety, $X$, over a field one can define the Chow group of p-cycles, $CH\_p (X)$, as
$$CH\_p (X) = coker\; \left[\bigoplus\_{x\in X\_{p+1}} k(x)^\times \rightarrow \bigoplus\_{x\in X\_p} \mathbb{Z}\; \right]$$.
What about for an arithmetic sc... | 2010/03/09 | [
"https://mathoverflow.net/questions/17634",
"https://mathoverflow.net",
"https://mathoverflow.net/users/4235/"
] | The last chapter of Fulton's book defines Chow groups on schemes $X$ of finite type over a fixed smooth scheme $S$. It not automatic to have an intersection product for $X$ smooth, but there is one as long as $S$ is $1$-dimensional. So it should cover the case of $\mathbb{Z}$. | I think intersection of vertical divisors cannot be defined, see Liu 9.1.33. This should be fixed by Arakelov theory. |
17,634 | Usually (eg, intro. in M. Rost's 'Cycle modules with coefficients'), for a variety, $X$, over a field one can define the Chow group of p-cycles, $CH\_p (X)$, as
$$CH\_p (X) = coker\; \left[\bigoplus\_{x\in X\_{p+1}} k(x)^\times \rightarrow \bigoplus\_{x\in X\_p} \mathbb{Z}\; \right]$$.
What about for an arithmetic sc... | 2010/03/09 | [
"https://mathoverflow.net/questions/17634",
"https://mathoverflow.net",
"https://mathoverflow.net/users/4235/"
] | One can define Chow groups over any Noetherian scheme $X$. Let $Z\_iX$ be the free abelian group on the $i$-dimensional
subvarieties (closed integral subschemes) of $X$. For any $i+1$-dimensional
subscheme $W$ of $X$, and a rational function $f$ on $W$, we can
define an element of $Z\_iX$ as follows:
$$ [div(f,W)] = \s... | The last chapter of Fulton's book defines Chow groups on schemes $X$ of finite type over a fixed smooth scheme $S$. It not automatic to have an intersection product for $X$ smooth, but there is one as long as $S$ is $1$-dimensional. So it should cover the case of $\mathbb{Z}$. |
17,634 | Usually (eg, intro. in M. Rost's 'Cycle modules with coefficients'), for a variety, $X$, over a field one can define the Chow group of p-cycles, $CH\_p (X)$, as
$$CH\_p (X) = coker\; \left[\bigoplus\_{x\in X\_{p+1}} k(x)^\times \rightarrow \bigoplus\_{x\in X\_p} \mathbb{Z}\; \right]$$.
What about for an arithmetic sc... | 2010/03/09 | [
"https://mathoverflow.net/questions/17634",
"https://mathoverflow.net",
"https://mathoverflow.net/users/4235/"
] | As explained by Hailong, one can define the Chow group CH($X$) (without grading by the dimension of the cycles) of any Noetherian scheme $X$. But in general one has to be careful about the behavior of the rational equivalence.
* A principal divisor in an integral closed subscheme $W$ of dimension $i+1$ is not necessa... | The last chapter of Fulton's book defines Chow groups on schemes $X$ of finite type over a fixed smooth scheme $S$. It not automatic to have an intersection product for $X$ smooth, but there is one as long as $S$ is $1$-dimensional. So it should cover the case of $\mathbb{Z}$. |
17,634 | Usually (eg, intro. in M. Rost's 'Cycle modules with coefficients'), for a variety, $X$, over a field one can define the Chow group of p-cycles, $CH\_p (X)$, as
$$CH\_p (X) = coker\; \left[\bigoplus\_{x\in X\_{p+1}} k(x)^\times \rightarrow \bigoplus\_{x\in X\_p} \mathbb{Z}\; \right]$$.
What about for an arithmetic sc... | 2010/03/09 | [
"https://mathoverflow.net/questions/17634",
"https://mathoverflow.net",
"https://mathoverflow.net/users/4235/"
] | One can define Chow groups over any Noetherian scheme $X$. Let $Z\_iX$ be the free abelian group on the $i$-dimensional
subvarieties (closed integral subschemes) of $X$. For any $i+1$-dimensional
subscheme $W$ of $X$, and a rational function $f$ on $W$, we can
define an element of $Z\_iX$ as follows:
$$ [div(f,W)] = \s... | I think intersection of vertical divisors cannot be defined, see Liu 9.1.33. This should be fixed by Arakelov theory. |
17,634 | Usually (eg, intro. in M. Rost's 'Cycle modules with coefficients'), for a variety, $X$, over a field one can define the Chow group of p-cycles, $CH\_p (X)$, as
$$CH\_p (X) = coker\; \left[\bigoplus\_{x\in X\_{p+1}} k(x)^\times \rightarrow \bigoplus\_{x\in X\_p} \mathbb{Z}\; \right]$$.
What about for an arithmetic sc... | 2010/03/09 | [
"https://mathoverflow.net/questions/17634",
"https://mathoverflow.net",
"https://mathoverflow.net/users/4235/"
] | As explained by Hailong, one can define the Chow group CH($X$) (without grading by the dimension of the cycles) of any Noetherian scheme $X$. But in general one has to be careful about the behavior of the rational equivalence.
* A principal divisor in an integral closed subscheme $W$ of dimension $i+1$ is not necessa... | I think intersection of vertical divisors cannot be defined, see Liu 9.1.33. This should be fixed by Arakelov theory. |
17,634 | Usually (eg, intro. in M. Rost's 'Cycle modules with coefficients'), for a variety, $X$, over a field one can define the Chow group of p-cycles, $CH\_p (X)$, as
$$CH\_p (X) = coker\; \left[\bigoplus\_{x\in X\_{p+1}} k(x)^\times \rightarrow \bigoplus\_{x\in X\_p} \mathbb{Z}\; \right]$$.
What about for an arithmetic sc... | 2010/03/09 | [
"https://mathoverflow.net/questions/17634",
"https://mathoverflow.net",
"https://mathoverflow.net/users/4235/"
] | So with a lot of extra care about dimension/codimension it seems to be possible to define Chow groups over Spec Z if I understand the above answers correctly.
I may point out that in the book by Elman, Karpenko and Merkurjev "Algebraic and Geometry Theory of Quadratic Forms" (even though the title does not suggest so)... | I think intersection of vertical divisors cannot be defined, see Liu 9.1.33. This should be fixed by Arakelov theory. |
17,634 | Usually (eg, intro. in M. Rost's 'Cycle modules with coefficients'), for a variety, $X$, over a field one can define the Chow group of p-cycles, $CH\_p (X)$, as
$$CH\_p (X) = coker\; \left[\bigoplus\_{x\in X\_{p+1}} k(x)^\times \rightarrow \bigoplus\_{x\in X\_p} \mathbb{Z}\; \right]$$.
What about for an arithmetic sc... | 2010/03/09 | [
"https://mathoverflow.net/questions/17634",
"https://mathoverflow.net",
"https://mathoverflow.net/users/4235/"
] | One can define Chow groups over any Noetherian scheme $X$. Let $Z\_iX$ be the free abelian group on the $i$-dimensional
subvarieties (closed integral subschemes) of $X$. For any $i+1$-dimensional
subscheme $W$ of $X$, and a rational function $f$ on $W$, we can
define an element of $Z\_iX$ as follows:
$$ [div(f,W)] = \s... | As explained by Hailong, one can define the Chow group CH($X$) (without grading by the dimension of the cycles) of any Noetherian scheme $X$. But in general one has to be careful about the behavior of the rational equivalence.
* A principal divisor in an integral closed subscheme $W$ of dimension $i+1$ is not necessa... |
17,634 | Usually (eg, intro. in M. Rost's 'Cycle modules with coefficients'), for a variety, $X$, over a field one can define the Chow group of p-cycles, $CH\_p (X)$, as
$$CH\_p (X) = coker\; \left[\bigoplus\_{x\in X\_{p+1}} k(x)^\times \rightarrow \bigoplus\_{x\in X\_p} \mathbb{Z}\; \right]$$.
What about for an arithmetic sc... | 2010/03/09 | [
"https://mathoverflow.net/questions/17634",
"https://mathoverflow.net",
"https://mathoverflow.net/users/4235/"
] | One can define Chow groups over any Noetherian scheme $X$. Let $Z\_iX$ be the free abelian group on the $i$-dimensional
subvarieties (closed integral subschemes) of $X$. For any $i+1$-dimensional
subscheme $W$ of $X$, and a rational function $f$ on $W$, we can
define an element of $Z\_iX$ as follows:
$$ [div(f,W)] = \s... | So with a lot of extra care about dimension/codimension it seems to be possible to define Chow groups over Spec Z if I understand the above answers correctly.
I may point out that in the book by Elman, Karpenko and Merkurjev "Algebraic and Geometry Theory of Quadratic Forms" (even though the title does not suggest so)... |
17,634 | Usually (eg, intro. in M. Rost's 'Cycle modules with coefficients'), for a variety, $X$, over a field one can define the Chow group of p-cycles, $CH\_p (X)$, as
$$CH\_p (X) = coker\; \left[\bigoplus\_{x\in X\_{p+1}} k(x)^\times \rightarrow \bigoplus\_{x\in X\_p} \mathbb{Z}\; \right]$$.
What about for an arithmetic sc... | 2010/03/09 | [
"https://mathoverflow.net/questions/17634",
"https://mathoverflow.net",
"https://mathoverflow.net/users/4235/"
] | As explained by Hailong, one can define the Chow group CH($X$) (without grading by the dimension of the cycles) of any Noetherian scheme $X$. But in general one has to be careful about the behavior of the rational equivalence.
* A principal divisor in an integral closed subscheme $W$ of dimension $i+1$ is not necessa... | So with a lot of extra care about dimension/codimension it seems to be possible to define Chow groups over Spec Z if I understand the above answers correctly.
I may point out that in the book by Elman, Karpenko and Merkurjev "Algebraic and Geometry Theory of Quadratic Forms" (even though the title does not suggest so)... |
48,820,254 | Is there a difference in speed between declaring an array variable before using it on the foreach loop?
e.g.
```
$variable = [1, 2, 3];
foreach ($variable as $value) {}
VS
foreach ([1, 2, 3] as $value) {}
``` | 2018/02/16 | [
"https://Stackoverflow.com/questions/48820254",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2947274/"
] | I did a small experiment
```
function measure($time, $func)
{
$before = microtime(true);
for($i = 0; $i < $time; $i++) $func();
$after = microtime(true);
return $after - $before;
}
var_dump(measure(10000000, function() {
$variable = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
foreach ($variable as $value... | PHP creates a copy or caches the array, so for example doing this can expose this behaviour
```
$array = array("1" => "PHP code tester Sandbox Online",
"foo" => "bar", 5 , 5 => 89009,
"case" => "Random Stuff: " . rand(100,999),
"PHP Version" => phpversion()
);
foreach( $array as $key => $value ){
ec... |
42,176,026 | Can anyone tell me where i have gone wrong in creating a construtor to call a method in another class file. It tells me constructor cannot be applied to given type | 2017/02/11 | [
"https://Stackoverflow.com/questions/42176026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | If you remove your constructor declaration from the Student class, then the implicit empty constructor will exist.
But if you declared explicitly a constructor like your `public Student(String firstname, String surname, String total)` then the empty constructor won't be available, unless you add it explicitly to your c... | You Student class don't have an empty constructor like youd do :
```
Student newStudent = new Student();
```
So you have a Constructor which should take three String :
```
public Student(String firstname, String surname, String total) {
```
So to solve your problem you have two ways :
1st
===
Create an empty co... |
42,176,026 | Can anyone tell me where i have gone wrong in creating a construtor to call a method in another class file. It tells me constructor cannot be applied to given type | 2017/02/11 | [
"https://Stackoverflow.com/questions/42176026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | If you remove your constructor declaration from the Student class, then the implicit empty constructor will exist.
But if you declared explicitly a constructor like your `public Student(String firstname, String surname, String total)` then the empty constructor won't be available, unless you add it explicitly to your c... | Some change I made to correct the code :
```
public class Main {
public static void main(String[] args) {
Student newStudent = new Student("Toto", "FromStack");
newStudent.setFirstName("Jack");
System.out.println(newStudent.getFirstName());
System.out.println(newStudent.getSurname()... |
42,176,026 | Can anyone tell me where i have gone wrong in creating a construtor to call a method in another class file. It tells me constructor cannot be applied to given type | 2017/02/11 | [
"https://Stackoverflow.com/questions/42176026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You Student class don't have an empty constructor like youd do :
```
Student newStudent = new Student();
```
So you have a Constructor which should take three String :
```
public Student(String firstname, String surname, String total) {
```
So to solve your problem you have two ways :
1st
===
Create an empty co... | Some change I made to correct the code :
```
public class Main {
public static void main(String[] args) {
Student newStudent = new Student("Toto", "FromStack");
newStudent.setFirstName("Jack");
System.out.println(newStudent.getFirstName());
System.out.println(newStudent.getSurname()... |
23,124,235 | **Problem:** I have database containing several lines of longtext fields to insert into a table containing 4,960,372 characters and keep getting **"Error code: 2103 Lost connection to MySQL server during query"**.
We are trying to restore a 16GB MySQL database, the table contains email header + email code.
Have expor... | 2014/04/17 | [
"https://Stackoverflow.com/questions/23124235",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3543675/"
] | Check if the user **1598934\_user** exists in the database. If it does exists, run the following mysql query to grant privileges.
```
GRANT ALL PRIVILEGES ON `postsData`.* TO '1598934_user'@'%';
FLUSH PRIVILEGES;
```
or if you do not want to grant all privileges then use:
```
GRANT <privileges> ON postsData.* TO '1... | Reset your Database password, it happens when password is wrong. |
59,859,985 | I am new to OOP, and my question is trivial, but I have to know it.
Basically, I have done some experiments in Python language. I have conducted 5 experiments, each experiment contain multiple functions such as:
```
def exp1():
func 1
func 2
func 3
def exp2():
func 1
func 2
func 3
...
```
... | 2020/01/22 | [
"https://Stackoverflow.com/questions/59859985",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9051085/"
] | No. Classes are not a (only) way to group functions together. It can happen but is not the most common use.
Classes normally appear from the analysis and conception steps **before** starting the code. Said differently, the good question to ask is not to wonder about existing functions, but to wonder about what kinds o... | Whether you define them as saperate classes really depends on your problem. As a side note if you even implement OOPS, you can define a Base Class where you can implement the repeated functions and override them in the respective classes. |
63,305,235 | I'm learning python, and I'm having trouble saving the return of a function to a specific variable. I have computed a simple function 'average' that is supposed to return the average value of a list. This works fine, however, when I try to store the result of average in a variable, I get told that x isn't defined.
```... | 2020/08/07 | [
"https://Stackoverflow.com/questions/63305235",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6361465/"
] | `x` indeed is not defined
```
def average(x):
return sum(x)/len(x)
x = [1,2,3] # this was missing
var=average(x)
```
<https://repl.it/join/eldrjqcr-datamafia> | Read the error message, x isn't defined. The variable x exists only in the average function and not in the program. You need to set x to something first.
e.g.
```
def average(x):
return sum(x)/len(x)
x=[1,2,3]
var=average(x)
```
this will not cause an error |
63,305,235 | I'm learning python, and I'm having trouble saving the return of a function to a specific variable. I have computed a simple function 'average' that is supposed to return the average value of a list. This works fine, however, when I try to store the result of average in a variable, I get told that x isn't defined.
```... | 2020/08/07 | [
"https://Stackoverflow.com/questions/63305235",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6361465/"
] | The function is a black box. You made the black box expect one mandatory input (`x`), therefore you have to provide it first i.e. `var = average([1, 2, 3])`. | Read the error message, x isn't defined. The variable x exists only in the average function and not in the program. You need to set x to something first.
e.g.
```
def average(x):
return sum(x)/len(x)
x=[1,2,3]
var=average(x)
```
this will not cause an error |
59,723,396 | I'm joining two collections, but the result of trends is an array, each item always has only one trend, how do I remove the trend inside array?
'Items' collection:
```
{
"itemid" : "370",
"name" : "A"
},
{
"itemid" : "378",
"name" : "B"
}
```
'Trends' collection
```
{
"itemid" : "370",
"max" : "715705",
},
{
... | 2020/01/13 | [
"https://Stackoverflow.com/questions/59723396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5822149/"
] | It's not an unexpected result, as `$lookup` would result in retrieving all matched documents into an array i.e; `trend` will be an array in your case. It's for a reason, Assume if you're joining `collection A` with `collection B` & documents in `collection A` might multiple matching documents in `collection B` then all... | You can do it with [$unwind](https://docs.mongodb.com/manual/reference/operator/aggregation/unwind/) pipeline stage
```
db.items.aggregate([
{
$lookup: {
from: "trends",
localField: "itemid",
foreignField: "itemid",
as: "trend"
}
},
$unwind:"$tren... |
102,400 | I asked my Swedish bank to transfer to my UK bank 50,000 euros through a SEPA payment. Unfortunately, the IBAN and BIC were old and no longer in use and the UK bank returned the money the same day, i.e. the transaction failed. The 50,000 euros was put back into my account after conversion to Swedish kronor (SEK).
Howe... | 2018/11/27 | [
"https://money.stackexchange.com/questions/102400",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/79140/"
] | **It isn't a simple reversal, because money actually changed hands when the transfer was made.**
When the transfer was made 50,000 Euros was credited to a UK bank, and some number of kronor was debited to your Swedish bank. When the transaction was reversed 50,000 Euros were transferred back to the Swedish bank. Those... | What the bank 'should' have done is a question of law, but I will point out that the reason for the rejection was not the bank's error, it was yours / the payee's [which, in the bank's eyes, is still kind of your error].
Consider from the bank's point of view:
(1) You release 50k SEK from your account;
(2) The bank,... |
102,400 | I asked my Swedish bank to transfer to my UK bank 50,000 euros through a SEPA payment. Unfortunately, the IBAN and BIC were old and no longer in use and the UK bank returned the money the same day, i.e. the transaction failed. The 50,000 euros was put back into my account after conversion to Swedish kronor (SEK).
Howe... | 2018/11/27 | [
"https://money.stackexchange.com/questions/102400",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/79140/"
] | **It isn't a simple reversal, because money actually changed hands when the transfer was made.**
When the transfer was made 50,000 Euros was credited to a UK bank, and some number of kronor was debited to your Swedish bank. When the transaction was reversed 50,000 Euros were transferred back to the Swedish bank. Those... | Most likely this will be an expensive lesson to learn. However, I believe there still is a chance to recover some of the difference, since your wording of "*my* Swedish bank" and "*my* UK bank" implies you have a relationship with both banks.
If your Swedish bank converted the funds to Euros first, and then attempted ... |
102,400 | I asked my Swedish bank to transfer to my UK bank 50,000 euros through a SEPA payment. Unfortunately, the IBAN and BIC were old and no longer in use and the UK bank returned the money the same day, i.e. the transaction failed. The 50,000 euros was put back into my account after conversion to Swedish kronor (SEK).
Howe... | 2018/11/27 | [
"https://money.stackexchange.com/questions/102400",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/79140/"
] | **It isn't a simple reversal, because money actually changed hands when the transfer was made.**
When the transfer was made 50,000 Euros was credited to a UK bank, and some number of kronor was debited to your Swedish bank. When the transaction was reversed 50,000 Euros were transferred back to the Swedish bank. Those... | The other answers attribute the loss due to changes in conversion rates. For me the change seems to be more due to the [buy/sell rate](https://en.wikipedia.org/wiki/Exchange_rate#Exchange_rate_classification) difference. Every FOREX agency/ bank sets the rates different on purpose so that they make profit on each trans... |
102,400 | I asked my Swedish bank to transfer to my UK bank 50,000 euros through a SEPA payment. Unfortunately, the IBAN and BIC were old and no longer in use and the UK bank returned the money the same day, i.e. the transaction failed. The 50,000 euros was put back into my account after conversion to Swedish kronor (SEK).
Howe... | 2018/11/27 | [
"https://money.stackexchange.com/questions/102400",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/79140/"
] | Most likely this will be an expensive lesson to learn. However, I believe there still is a chance to recover some of the difference, since your wording of "*my* Swedish bank" and "*my* UK bank" implies you have a relationship with both banks.
If your Swedish bank converted the funds to Euros first, and then attempted ... | What the bank 'should' have done is a question of law, but I will point out that the reason for the rejection was not the bank's error, it was yours / the payee's [which, in the bank's eyes, is still kind of your error].
Consider from the bank's point of view:
(1) You release 50k SEK from your account;
(2) The bank,... |
102,400 | I asked my Swedish bank to transfer to my UK bank 50,000 euros through a SEPA payment. Unfortunately, the IBAN and BIC were old and no longer in use and the UK bank returned the money the same day, i.e. the transaction failed. The 50,000 euros was put back into my account after conversion to Swedish kronor (SEK).
Howe... | 2018/11/27 | [
"https://money.stackexchange.com/questions/102400",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/79140/"
] | What the bank 'should' have done is a question of law, but I will point out that the reason for the rejection was not the bank's error, it was yours / the payee's [which, in the bank's eyes, is still kind of your error].
Consider from the bank's point of view:
(1) You release 50k SEK from your account;
(2) The bank,... | The other answers attribute the loss due to changes in conversion rates. For me the change seems to be more due to the [buy/sell rate](https://en.wikipedia.org/wiki/Exchange_rate#Exchange_rate_classification) difference. Every FOREX agency/ bank sets the rates different on purpose so that they make profit on each trans... |
102,400 | I asked my Swedish bank to transfer to my UK bank 50,000 euros through a SEPA payment. Unfortunately, the IBAN and BIC were old and no longer in use and the UK bank returned the money the same day, i.e. the transaction failed. The 50,000 euros was put back into my account after conversion to Swedish kronor (SEK).
Howe... | 2018/11/27 | [
"https://money.stackexchange.com/questions/102400",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/79140/"
] | Most likely this will be an expensive lesson to learn. However, I believe there still is a chance to recover some of the difference, since your wording of "*my* Swedish bank" and "*my* UK bank" implies you have a relationship with both banks.
If your Swedish bank converted the funds to Euros first, and then attempted ... | The other answers attribute the loss due to changes in conversion rates. For me the change seems to be more due to the [buy/sell rate](https://en.wikipedia.org/wiki/Exchange_rate#Exchange_rate_classification) difference. Every FOREX agency/ bank sets the rates different on purpose so that they make profit on each trans... |
51,537,460 | I have JSON data coming from two different API endpoints. The first JSON contains data about stores and the second contains data on transactions(sales).
For each store Id I'm getting an array of transactions and parsing it into `JsValue`. So I have a `store` Jsvalue representing the certain store and `transactions` J... | 2018/07/26 | [
"https://Stackoverflow.com/questions/51537460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7644168/"
] | One way to do this would be converting the jsons to objects, create a new object with the attributes "store" and "transactions" and transform it to JSON again.
That way you would get:
```
{
"store": {
"store_id":"01",
"name":"Store_1"
},
"transactions": [
{
"saleId": 12,
"name": "Ne... | In Play you can use the Json `Reads/Writes` helpers to convert from a `case class` to `Json` and vice versa. So, for your example:
```
case class Store(store_id: String, name: String)
```
Then if you have a Json and want to turn it into `Store` case class you need a 'reader':
```
val storeReads: Reads[Store] = Js... |
51,537,460 | I have JSON data coming from two different API endpoints. The first JSON contains data about stores and the second contains data on transactions(sales).
For each store Id I'm getting an array of transactions and parsing it into `JsValue`. So I have a `store` Jsvalue representing the certain store and `transactions` J... | 2018/07/26 | [
"https://Stackoverflow.com/questions/51537460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7644168/"
] | I've managed to achieve the desired result.
```
val store = Json.stringify(storeJsValue)
val transactions = Json.stringify(transactionsJsValue)
val storeWithTransactions: String = s"{store: $store , transactions: $transactions}"
```
This way I'm getting a string with data on a store and all its transactions. So I j... | In Play you can use the Json `Reads/Writes` helpers to convert from a `case class` to `Json` and vice versa. So, for your example:
```
case class Store(store_id: String, name: String)
```
Then if you have a Json and want to turn it into `Store` case class you need a 'reader':
```
val storeReads: Reads[Store] = Js... |
51,537,460 | I have JSON data coming from two different API endpoints. The first JSON contains data about stores and the second contains data on transactions(sales).
For each store Id I'm getting an array of transactions and parsing it into `JsValue`. So I have a `store` Jsvalue representing the certain store and `transactions` J... | 2018/07/26 | [
"https://Stackoverflow.com/questions/51537460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7644168/"
] | you have two json values, you can make a new object out of them:
```
val storeWithTransactions: String = Json.stringify(Json.obj(
"store" -> storeJsValue,
"transactions" -> transactionsJsValue))
``` | In Play you can use the Json `Reads/Writes` helpers to convert from a `case class` to `Json` and vice versa. So, for your example:
```
case class Store(store_id: String, name: String)
```
Then if you have a Json and want to turn it into `Store` case class you need a 'reader':
```
val storeReads: Reads[Store] = Js... |
18,132,144 | I have a cron task that runs periodically. This task depends on a condition to be valid in order to complete its processing. In case it matters this condition is just a SELECT for specific records in the database. If the condition is not satisfied (i.e the SELECT does not return the result set expected) then the script... | 2013/08/08 | [
"https://Stackoverflow.com/questions/18132144",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/384706/"
] | You can simply use `JOptionPane` for this. Just call it like so:
```
JOptionPane.showMessageDialog(this, "Name is missing");
```
It will display the message in a dialog box and wait for OK. | To show a popup messages from any kind you can use the class JOptionPane and their static methods. in your case `JOptionPane.showMessageDialog(null, "Name is missing");` should do the thing. |
45,360,052 | So I have this script which im trying to create a filelist.js file from in php here's the code:
```
//CREATE fileslist.js
$thumbssize = "1";
$moviesize= "1";
$thumbarray = array_slice(scandir($tpath), 2);
echo print_r($thumbarray) . "<br/>";
if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST"){
$script="
f... | 2017/07/27 | [
"https://Stackoverflow.com/questions/45360052",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5152183/"
] | Thank you for your feedback. Just a minute ago I refined the code and tested it in my localhost. Here is the changed code that gives the result:
```
$script1 = "";
$i = 0;
$j = 0;
$inrow = 6; // files in row
foreach($thumbarray as $item => $itemv) {
// beginning of the row
if($j % $inrow == 0){
... | you need to change below part
```
$index = 1;
foreach($thumbarray as $item) {
$script .= "fileList[\"thumbs\"][$index]= ".json_encode($item).";" ;
$index++;
}
``` |
45,360,052 | So I have this script which im trying to create a filelist.js file from in php here's the code:
```
//CREATE fileslist.js
$thumbssize = "1";
$moviesize= "1";
$thumbarray = array_slice(scandir($tpath), 2);
echo print_r($thumbarray) . "<br/>";
if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST"){
$script="
f... | 2017/07/27 | [
"https://Stackoverflow.com/questions/45360052",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5152183/"
] | Thank you for your feedback. Just a minute ago I refined the code and tested it in my localhost. Here is the changed code that gives the result:
```
$script1 = "";
$i = 0;
$j = 0;
$inrow = 6; // files in row
foreach($thumbarray as $item => $itemv) {
// beginning of the row
if($j % $inrow == 0){
... | You need two indexes. $i is incremented every time $i is deleted in $inrow times properly with the remainder of 0. If you want 6 rows of files then $i should be increased 6 times less then $j which is increased every time. This way $i would change when $j is 6,12,18,24 and etc. You will need to play a little bit with t... |
2,906 | I am confused on whether I should use the infinitive form of the verb after `antaŭ ol`.
>
> Lavu viajn manojn antaŭ ol **forlasi** la banejon.
>
>
> *Wash your hands before leaving the bathroom.*
>
>
>
or
>
> Lavu viajn manojn antaŭ ol **vi forlasas** la banejon.
>
>
> *Wash your hands before you leave the ... | 2017/02/06 | [
"https://esperanto.stackexchange.com/questions/2906",
"https://esperanto.stackexchange.com",
"https://esperanto.stackexchange.com/users/279/"
] | You can't have two verbs in the same clause with a different tense, therefore the second verb should have no tense, like the infinitive or a gerund, or it should be the same tense as the first. Just like in English we would say "Wash (imperative) your hands before you leave (infinitive) the washroom."
It is better to ... | If you add the subject in the second part of the sentence you have a tense, without the subject it should be -i. The sentences listed above with -as -is -os are fine because there's a subject in that part of the sentence.
Mi helpos vin antaŭ ol fari tion.
I'll help you before doing that.
Mi helpos vin antaŭ ol mi faros... |
20,245 | En la pregunta [Términos para aludir a alguien cuyo nombre se desconoce](https://spanish.stackexchange.com/q/17999/12637) se hizo un repaso de aquellas formas de las que dispone el lenguaje para designar a las personas cuyo nombre se ignora o se quiere omitir. Sin embargo, ¿existe algún término similar para los lugares... | 2017/03/27 | [
"https://spanish.stackexchange.com/questions/20245",
"https://spanish.stackexchange.com",
"https://spanish.stackexchange.com/users/12637/"
] | En Español no hay un nombre genérico para un lugar cualquiera. Al decir "fulano" o "mengano" queremos decir tanto "un señor cualquiera" como "un señor del que no sabemos el nombre" (que sería "un desconocido").
Esto no se aplica a países. Lo más parecido sería usar "donde sea" y "no se dónde".
>
> Eso es como si lle... | No creo que "Conchinchina" se refiera a un lugar desconocido sino a un lugar lejano. "aquí y en la Conchinchina" significaría "aquí y en cualquier parte del mundo".
Esos circunstanciales de lugar, creo, se adaptan a la toponimia de cada lugar. En Argentina decimos, por ejemplo, "de acá a La Quiaca" o "hasta en La Quia... |
20,245 | En la pregunta [Términos para aludir a alguien cuyo nombre se desconoce](https://spanish.stackexchange.com/q/17999/12637) se hizo un repaso de aquellas formas de las que dispone el lenguaje para designar a las personas cuyo nombre se ignora o se quiere omitir. Sin embargo, ¿existe algún término similar para los lugares... | 2017/03/27 | [
"https://spanish.stackexchange.com/questions/20245",
"https://spanish.stackexchange.com",
"https://spanish.stackexchange.com/users/12637/"
] | En Español no hay un nombre genérico para un lugar cualquiera. Al decir "fulano" o "mengano" queremos decir tanto "un señor cualquiera" como "un señor del que no sabemos el nombre" (que sería "un desconocido").
Esto no se aplica a países. Lo más parecido sería usar "donde sea" y "no se dónde".
>
> Eso es como si lle... | Usamos expresiones tipo "Aquí y en la **Conchinchina**" o "Aquí y en la China." (o la *china chapuchina*, *Pernambuco* o *Timbuktu*) con el significado de "eso es así en todos lados; aquí y en un sitio muy lejano". El que sea un sito lejano le da cierta validez de ser "universalmente cierta" a la afirmación, pues como ... |
133,583 | I've noticed that in analysis we often treat the unit-interval $[0,1]$ differently from $[0,\infty)$, particularly in improper-integration (but certainly not limited to).
By lieu of example, consider proving that the *Gamma function* converges; i.e., the integral exists. The *Gamma function* is defined as follows:
... | 2012/04/18 | [
"https://math.stackexchange.com/questions/133583",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/29411/"
] | I think there are a variety of reasons why $[0,1]$ is special. Most will be related to picking $0$ and $1$ as the simplest example distinct numbers, for instance when making an interval. But there may be additional requirements selecting $0$ or $1$ as endpoints for your interval (e.g. positive number, smallest positive... | Maybe you are not looking in the right direction here. $[0,1]$ is not a group under multiplication (which is the inverse of $0$? of $1/2$?) It is however a "normalized" (of length 1) closed interval, every closed interval of $\mathbb{R}$ is homeomorphic to it (under a map which preserves the natural order, if you want)... |
133,583 | I've noticed that in analysis we often treat the unit-interval $[0,1]$ differently from $[0,\infty)$, particularly in improper-integration (but certainly not limited to).
By lieu of example, consider proving that the *Gamma function* converges; i.e., the integral exists. The *Gamma function* is defined as follows:
... | 2012/04/18 | [
"https://math.stackexchange.com/questions/133583",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/29411/"
] | I think there are a variety of reasons why $[0,1]$ is special. Most will be related to picking $0$ and $1$ as the simplest example distinct numbers, for instance when making an interval. But there may be additional requirements selecting $0$ or $1$ as endpoints for your interval (e.g. positive number, smallest positive... | The intuitively simplest notion of integral is the *Riemann integral*. It deals with bounded functions on sets $B$ of finite total measure, e.g., continuous functions on the interval $[0,1]$. The exact definition via arbitrary partitions of $B$ into small "blocks" is already quite involved, but in the end you have a we... |
133,583 | I've noticed that in analysis we often treat the unit-interval $[0,1]$ differently from $[0,\infty)$, particularly in improper-integration (but certainly not limited to).
By lieu of example, consider proving that the *Gamma function* converges; i.e., the integral exists. The *Gamma function* is defined as follows:
... | 2012/04/18 | [
"https://math.stackexchange.com/questions/133583",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/29411/"
] | I think there are a variety of reasons why $[0,1]$ is special. Most will be related to picking $0$ and $1$ as the simplest example distinct numbers, for instance when making an interval. But there may be additional requirements selecting $0$ or $1$ as endpoints for your interval (e.g. positive number, smallest positive... | Thanks for the thoughts! Definitely some help! However, I suppose I misdirected the potential answer by discussing improper integration; I really am more concerned with $[0,1] \subset \mathbb R$ itself.
So if I'm correct with my algebra, $(0,1]$ is the set of units for $\{x ~| ~ x \in \mathbb R, x\geq 1\}$. I suppose... |
133,583 | I've noticed that in analysis we often treat the unit-interval $[0,1]$ differently from $[0,\infty)$, particularly in improper-integration (but certainly not limited to).
By lieu of example, consider proving that the *Gamma function* converges; i.e., the integral exists. The *Gamma function* is defined as follows:
... | 2012/04/18 | [
"https://math.stackexchange.com/questions/133583",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/29411/"
] | I think there are a variety of reasons why $[0,1]$ is special. Most will be related to picking $0$ and $1$ as the simplest example distinct numbers, for instance when making an interval. But there may be additional requirements selecting $0$ or $1$ as endpoints for your interval (e.g. positive number, smallest positive... | Sorry but what you ask for seems to be based on misconceptions and is essentially a dead-end.
>
> what makes the unit-interval $[0,1] \subset \mathbb R$ so special?
>
>
>
Nothing, at least as regards integration purposes. In particular, $[0,1]$ has nothing special in the examples you mention.
>
> perhaps this s... |
36,899,850 | I had my PC re-imaged for me. I have Visual Studio Version 14.0.25123.00 Update 2 installed on my computer. I'm getting this error when I try to use VS intellisense to reference another project.
>
> CSharpAddImportCodeFixProvider encountered an error and has been disabled
>
>
>
I have two projects. One of them u... | 2016/04/27 | [
"https://Stackoverflow.com/questions/36899850",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1234374/"
] | Happened to me when chose `Add using System.Data.SqlClient` automatically after typing `using (SqlConnection...){}` in DataLayer, in one of Repository classes.
Nothing helped (except creating new project), but I saw that the problem was with loading `System.Data.SqlClient.dll` file, although it existed in appropriate ... | Judging from the label you were given, "CSharpAddImportCodeFixProvider", I'd guess your problem was due to Visual Studio trying to identify and/or correct a missing "using" statement at the top of your C# source code file in which you made reference to a class that needed it. The Visual Studio components that usually d... |
36,899,850 | I had my PC re-imaged for me. I have Visual Studio Version 14.0.25123.00 Update 2 installed on my computer. I'm getting this error when I try to use VS intellisense to reference another project.
>
> CSharpAddImportCodeFixProvider encountered an error and has been disabled
>
>
>
I have two projects. One of them u... | 2016/04/27 | [
"https://Stackoverflow.com/questions/36899850",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1234374/"
] | Happened to me when chose `Add using System.Data.SqlClient` automatically after typing `using (SqlConnection...){}` in DataLayer, in one of Repository classes.
Nothing helped (except creating new project), but I saw that the problem was with loading `System.Data.SqlClient.dll` file, although it existed in appropriate ... | anyone trying this solution from here ?
<https://developercommunity.visualstudio.com/content/problem/623872/add-import-not-working.html>
the last reply solves my issue..
`Tools` > `Options` > `Text Editor` > `C#` > `Advanced`
turning off `Suggest usings for types in NuGet packages` |
36,899,850 | I had my PC re-imaged for me. I have Visual Studio Version 14.0.25123.00 Update 2 installed on my computer. I'm getting this error when I try to use VS intellisense to reference another project.
>
> CSharpAddImportCodeFixProvider encountered an error and has been disabled
>
>
>
I have two projects. One of them u... | 2016/04/27 | [
"https://Stackoverflow.com/questions/36899850",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1234374/"
] | Had the same problem solved by installing the sqlClient package from nuget package manager
right-click on the project choose manage nuget packages.. and go to browse tab and search for System.Data.SqlClient and install it. that easy :) | anyone trying this solution from here ?
<https://developercommunity.visualstudio.com/content/problem/623872/add-import-not-working.html>
the last reply solves my issue..
`Tools` > `Options` > `Text Editor` > `C#` > `Advanced`
turning off `Suggest usings for types in NuGet packages` |
36,899,850 | I had my PC re-imaged for me. I have Visual Studio Version 14.0.25123.00 Update 2 installed on my computer. I'm getting this error when I try to use VS intellisense to reference another project.
>
> CSharpAddImportCodeFixProvider encountered an error and has been disabled
>
>
>
I have two projects. One of them u... | 2016/04/27 | [
"https://Stackoverflow.com/questions/36899850",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1234374/"
] | I had the same issue on VS-2015 update 3.
I did was :
1) Closing visual studio
2) restarting as administrator | Judging from the label you were given, "CSharpAddImportCodeFixProvider", I'd guess your problem was due to Visual Studio trying to identify and/or correct a missing "using" statement at the top of your C# source code file in which you made reference to a class that needed it. The Visual Studio components that usually d... |
36,899,850 | I had my PC re-imaged for me. I have Visual Studio Version 14.0.25123.00 Update 2 installed on my computer. I'm getting this error when I try to use VS intellisense to reference another project.
>
> CSharpAddImportCodeFixProvider encountered an error and has been disabled
>
>
>
I have two projects. One of them u... | 2016/04/27 | [
"https://Stackoverflow.com/questions/36899850",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1234374/"
] | I end up with this same error.
what i did was to manually go and find the nuget packet for System.Data.SqlClient, installed and then invoke it in the class i was working on, like:
```
using System.Data.SqlClient;
```
Dont know if this is some kind of bug, cause it happens on a new blank project i create using visua... | anyone trying this solution from here ?
<https://developercommunity.visualstudio.com/content/problem/623872/add-import-not-working.html>
the last reply solves my issue..
`Tools` > `Options` > `Text Editor` > `C#` > `Advanced`
turning off `Suggest usings for types in NuGet packages` |
36,899,850 | I had my PC re-imaged for me. I have Visual Studio Version 14.0.25123.00 Update 2 installed on my computer. I'm getting this error when I try to use VS intellisense to reference another project.
>
> CSharpAddImportCodeFixProvider encountered an error and has been disabled
>
>
>
I have two projects. One of them u... | 2016/04/27 | [
"https://Stackoverflow.com/questions/36899850",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1234374/"
] | I end up with this same error.
what i did was to manually go and find the nuget packet for System.Data.SqlClient, installed and then invoke it in the class i was working on, like:
```
using System.Data.SqlClient;
```
Dont know if this is some kind of bug, cause it happens on a new blank project i create using visua... | Judging from the label you were given, "CSharpAddImportCodeFixProvider", I'd guess your problem was due to Visual Studio trying to identify and/or correct a missing "using" statement at the top of your C# source code file in which you made reference to a class that needed it. The Visual Studio components that usually d... |
36,899,850 | I had my PC re-imaged for me. I have Visual Studio Version 14.0.25123.00 Update 2 installed on my computer. I'm getting this error when I try to use VS intellisense to reference another project.
>
> CSharpAddImportCodeFixProvider encountered an error and has been disabled
>
>
>
I have two projects. One of them u... | 2016/04/27 | [
"https://Stackoverflow.com/questions/36899850",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1234374/"
] | There may be multiple reasons why this error occurs. So this answer may not apply to all situations, though it seems that it only occurs when another project is referenced.
The error does not occur for all statements. In my case I had the following code:
```
private System.Threading.Timer Timer;
public void Start()
... | Judging from the label you were given, "CSharpAddImportCodeFixProvider", I'd guess your problem was due to Visual Studio trying to identify and/or correct a missing "using" statement at the top of your C# source code file in which you made reference to a class that needed it. The Visual Studio components that usually d... |
36,899,850 | I had my PC re-imaged for me. I have Visual Studio Version 14.0.25123.00 Update 2 installed on my computer. I'm getting this error when I try to use VS intellisense to reference another project.
>
> CSharpAddImportCodeFixProvider encountered an error and has been disabled
>
>
>
I have two projects. One of them u... | 2016/04/27 | [
"https://Stackoverflow.com/questions/36899850",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1234374/"
] | I had the same issue on VS-2015 update 3.
I did was :
1) Closing visual studio
2) restarting as administrator | Had the same problem solved by installing the sqlClient package from nuget package manager
right-click on the project choose manage nuget packages.. and go to browse tab and search for System.Data.SqlClient and install it. that easy :) |
36,899,850 | I had my PC re-imaged for me. I have Visual Studio Version 14.0.25123.00 Update 2 installed on my computer. I'm getting this error when I try to use VS intellisense to reference another project.
>
> CSharpAddImportCodeFixProvider encountered an error and has been disabled
>
>
>
I have two projects. One of them u... | 2016/04/27 | [
"https://Stackoverflow.com/questions/36899850",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1234374/"
] | Happened to me when chose `Add using System.Data.SqlClient` automatically after typing `using (SqlConnection...){}` in DataLayer, in one of Repository classes.
Nothing helped (except creating new project), but I saw that the problem was with loading `System.Data.SqlClient.dll` file, although it existed in appropriate ... | I end up with this same error.
what i did was to manually go and find the nuget packet for System.Data.SqlClient, installed and then invoke it in the class i was working on, like:
```
using System.Data.SqlClient;
```
Dont know if this is some kind of bug, cause it happens on a new blank project i create using visua... |
36,899,850 | I had my PC re-imaged for me. I have Visual Studio Version 14.0.25123.00 Update 2 installed on my computer. I'm getting this error when I try to use VS intellisense to reference another project.
>
> CSharpAddImportCodeFixProvider encountered an error and has been disabled
>
>
>
I have two projects. One of them u... | 2016/04/27 | [
"https://Stackoverflow.com/questions/36899850",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1234374/"
] | I had the same issue on VS-2015 update 3.
I did was :
1) Closing visual studio
2) restarting as administrator | anyone trying this solution from here ?
<https://developercommunity.visualstudio.com/content/problem/623872/add-import-not-working.html>
the last reply solves my issue..
`Tools` > `Options` > `Text Editor` > `C#` > `Advanced`
turning off `Suggest usings for types in NuGet packages` |
16,618,785 | I'm trying to determine how many pixels down I've scrolled using `window.scrollY`. But this isn't supported in IE8. What is the safe, cross-browser alternative? | 2013/05/17 | [
"https://Stackoverflow.com/questions/16618785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172350/"
] | The cross-browser compatible version for `window.scrollY` is `document.documentElement.scrollTop`. Please see the 'Notes' section of this piece of [**Mozilla documentation**](https://developer.mozilla.org/en-US/docs/Web/API/window.scrollY?redirectlocale=en-US&redirectslug=DOM/window.scrollY) for a full, detailed workar... | Based on Niels' answer, I come up with a slightly more compact solution when just the Y coord is needed:
```
function get_scroll_y() {
return window.pageYOffset || document.body.scrollTop || document.html.scrollTop;
}
``` |
16,618,785 | I'm trying to determine how many pixels down I've scrolled using `window.scrollY`. But this isn't supported in IE8. What is the safe, cross-browser alternative? | 2013/05/17 | [
"https://Stackoverflow.com/questions/16618785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172350/"
] | If you're using jQuery, I used $(window).scrollTop() to get the Y position in IE 8. It seemed to work. | window.scrollY & window.scrollX works fine in all modern browers like (Chrome, FireFox & Safari) but does not work in IE so to fix the use window.pageXOffset or window.pageYOffset.
Here is a sample code I wrote to fix ie issue so that the programmatic scrolling works in all browsers including IE
```
if((window.scroll... |
16,618,785 | I'm trying to determine how many pixels down I've scrolled using `window.scrollY`. But this isn't supported in IE8. What is the safe, cross-browser alternative? | 2013/05/17 | [
"https://Stackoverflow.com/questions/16618785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172350/"
] | If you don't have to use it a lot, just do:
```
var scroll = window.scrollY //Modern Way (Chrome, Firefox)
|| document.documentElement.scrollTop (Old IE, 6,7,8)
``` | Based on Niels' answer, I come up with a slightly more compact solution when just the Y coord is needed:
```
function get_scroll_y() {
return window.pageYOffset || document.body.scrollTop || document.html.scrollTop;
}
``` |
16,618,785 | I'm trying to determine how many pixels down I've scrolled using `window.scrollY`. But this isn't supported in IE8. What is the safe, cross-browser alternative? | 2013/05/17 | [
"https://Stackoverflow.com/questions/16618785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172350/"
] | If you have a valid reason for not just using a library to handle this kind of base functionality, don't hesitate 'not to re-invent the wheel'.
[Mootools is open source](https://github.com/mootools/mootools-core/blob/master/Source/Element/Element.Dimensions.js), and you can just 'steal' its implementation, relevant sn... | In angular, we use:
```
var windowEl = angular.element($window);
scrolldist = windowEl.scrollTop();
``` |
16,618,785 | I'm trying to determine how many pixels down I've scrolled using `window.scrollY`. But this isn't supported in IE8. What is the safe, cross-browser alternative? | 2013/05/17 | [
"https://Stackoverflow.com/questions/16618785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172350/"
] | The cross-browser compatible version for `window.scrollY` is `document.documentElement.scrollTop`. Please see the 'Notes' section of this piece of [**Mozilla documentation**](https://developer.mozilla.org/en-US/docs/Web/API/window.scrollY?redirectlocale=en-US&redirectslug=DOM/window.scrollY) for a full, detailed workar... | Based on Mozilla, and answers above, I have a created the functions below to more easily get the coords:
```js
var windowEl = (function () {
var isCSS1Compat = ((document.compatMode || "") === "CSS1Compat");
function scroll() {
return { left: scrollLeft, top: scrollTop };
};
function scrollLeft... |
16,618,785 | I'm trying to determine how many pixels down I've scrolled using `window.scrollY`. But this isn't supported in IE8. What is the safe, cross-browser alternative? | 2013/05/17 | [
"https://Stackoverflow.com/questions/16618785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172350/"
] | If you don't have to use it a lot, just do:
```
var scroll = window.scrollY //Modern Way (Chrome, Firefox)
|| document.documentElement.scrollTop (Old IE, 6,7,8)
``` | If you have a valid reason for not just using a library to handle this kind of base functionality, don't hesitate 'not to re-invent the wheel'.
[Mootools is open source](https://github.com/mootools/mootools-core/blob/master/Source/Element/Element.Dimensions.js), and you can just 'steal' its implementation, relevant sn... |
16,618,785 | I'm trying to determine how many pixels down I've scrolled using `window.scrollY`. But this isn't supported in IE8. What is the safe, cross-browser alternative? | 2013/05/17 | [
"https://Stackoverflow.com/questions/16618785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172350/"
] | If you're using jQuery, I used $(window).scrollTop() to get the Y position in IE 8. It seemed to work. | Based on Niels' answer, I come up with a slightly more compact solution when just the Y coord is needed:
```
function get_scroll_y() {
return window.pageYOffset || document.body.scrollTop || document.html.scrollTop;
}
``` |
16,618,785 | I'm trying to determine how many pixels down I've scrolled using `window.scrollY`. But this isn't supported in IE8. What is the safe, cross-browser alternative? | 2013/05/17 | [
"https://Stackoverflow.com/questions/16618785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172350/"
] | The cross-browser compatible version for `window.scrollY` is `document.documentElement.scrollTop`. Please see the 'Notes' section of this piece of [**Mozilla documentation**](https://developer.mozilla.org/en-US/docs/Web/API/window.scrollY?redirectlocale=en-US&redirectslug=DOM/window.scrollY) for a full, detailed workar... | If you're using jQuery, I used $(window).scrollTop() to get the Y position in IE 8. It seemed to work. |
16,618,785 | I'm trying to determine how many pixels down I've scrolled using `window.scrollY`. But this isn't supported in IE8. What is the safe, cross-browser alternative? | 2013/05/17 | [
"https://Stackoverflow.com/questions/16618785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172350/"
] | The cross-browser compatible version for `window.scrollY` is `document.documentElement.scrollTop`. Please see the 'Notes' section of this piece of [**Mozilla documentation**](https://developer.mozilla.org/en-US/docs/Web/API/window.scrollY?redirectlocale=en-US&redirectslug=DOM/window.scrollY) for a full, detailed workar... | window.scrollY & window.scrollX works fine in all modern browers like (Chrome, FireFox & Safari) but does not work in IE so to fix the use window.pageXOffset or window.pageYOffset.
Here is a sample code I wrote to fix ie issue so that the programmatic scrolling works in all browsers including IE
```
if((window.scroll... |
16,618,785 | I'm trying to determine how many pixels down I've scrolled using `window.scrollY`. But this isn't supported in IE8. What is the safe, cross-browser alternative? | 2013/05/17 | [
"https://Stackoverflow.com/questions/16618785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172350/"
] | If you don't have to use it a lot, just do:
```
var scroll = window.scrollY //Modern Way (Chrome, Firefox)
|| document.documentElement.scrollTop (Old IE, 6,7,8)
``` | In angular, we use:
```
var windowEl = angular.element($window);
scrolldist = windowEl.scrollTop();
``` |
57,898,415 | Below is my controller method definition
```
@Autowired
private HttpServletRequest request;
@PostMapping(path = "/abc")
public String createAbc(@RequestBody HttpServletRequest request)
throws IOException {
logger.info("Request body: "+request.getInputStream());
return "abc";
}
```
All i want to d... | 2019/09/12 | [
"https://Stackoverflow.com/questions/57898415",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5034036/"
] | First, remove the `@Autowired` field. It's wrong and you're not using it anyway.
Now you have two choices:
1. Let Spring process the request body for you, by using the `@RequestBody` annotation:
```
@PostMapping(path = "/abc")
public String createAbc(@RequestBody String requestBody) throws IOException {
logger.i... | if you want to take it out easily:
```
private ObjectMapper objectMapper;
byte[] bytes = request.getInputStream().readAllBytes();
User u = objectMapper.readValue(bytes, User.class);
``` |
61,423,280 | I have a list of data frames with stock data and want to add a new column with return of the stock price to each data frame in the list. The data frames looks as:
```
ABB.ST.Open ABB.ST.High ABB.ST.Low ABB.ST.Close ABB.ST.Volume ABB.ST.Adjusted Date
1 166.4 167.4 165.5 166.0... | 2020/04/25 | [
"https://Stackoverflow.com/questions/61423280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11666489/"
] | because you are reading two lines in a loop. The readline moves the cursor one down each time you call it. So what happens there with the second call of readline() you actually skip it(in the print log)
Also checking for end of file should not be done on empty string, because you may hit an empty line before the end o... | Your code reads three lines and prints only one:
```
f=open("dati.txt","r")
riga=f.readline() # Reads a line into riga
while riga!="":
print(f.readline()) # Reads a line and prints it
riga=f.readline() # Reads a line into riga
f.close()
```
So the problem seems that you read lines into `riga... |
61,423,280 | I have a list of data frames with stock data and want to add a new column with return of the stock price to each data frame in the list. The data frames looks as:
```
ABB.ST.Open ABB.ST.High ABB.ST.Low ABB.ST.Close ABB.ST.Volume ABB.ST.Adjusted Date
1 166.4 167.4 165.5 166.0... | 2020/04/25 | [
"https://Stackoverflow.com/questions/61423280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11666489/"
] | because you are reading two lines in a loop. The readline moves the cursor one down each time you call it. So what happens there with the second call of readline() you actually skip it(in the print log)
Also checking for end of file should not be done on empty string, because you may hit an empty line before the end o... | The reason why your program is not printing all the rows in the file, but rather only every even numbered row, is because you use `f.readline()` multiple times in the `while` statement.
```
f=open("dati.txt","r")
riga=f.readline() # This line means that the variable "riga" contains the first line in your file
while ri... |
61,423,280 | I have a list of data frames with stock data and want to add a new column with return of the stock price to each data frame in the list. The data frames looks as:
```
ABB.ST.Open ABB.ST.High ABB.ST.Low ABB.ST.Close ABB.ST.Volume ABB.ST.Adjusted Date
1 166.4 167.4 165.5 166.0... | 2020/04/25 | [
"https://Stackoverflow.com/questions/61423280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11666489/"
] | The reason why your program is not printing all the rows in the file, but rather only every even numbered row, is because you use `f.readline()` multiple times in the `while` statement.
```
f=open("dati.txt","r")
riga=f.readline() # This line means that the variable "riga" contains the first line in your file
while ri... | Your code reads three lines and prints only one:
```
f=open("dati.txt","r")
riga=f.readline() # Reads a line into riga
while riga!="":
print(f.readline()) # Reads a line and prints it
riga=f.readline() # Reads a line into riga
f.close()
```
So the problem seems that you read lines into `riga... |
15,105,828 | I'm not sure how best to describe my problem in a single title, so I hope that makes a little bit of sense.
Let me explain what I'm trying to do. I want to create a task list widget. Users write a description of the task in one `<input>` field, and then select a point value for that task from a `<select>`. Upon clicki... | 2013/02/27 | [
"https://Stackoverflow.com/questions/15105828",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2110135/"
] | See this: <http://jsfiddle.net/8L25m/9/>
```
$(document).on('click', '.task', function () {
$(this).hide('fast', function () {
$this.remove();
});
$("#score").html(parseInt($("#score").html(),10) + parseInt($(this).find(".taskValue").html(),10));
});
``` | Another good one can be found at jsfiddle: <http://jsfiddle.net/RWhitbeck/ZyYFG/>
the js (from source above):
```
$(document).ready(function () {
$('#button').click(function () {
//save inputs as variables:
var taskName = $('input[name=newTaskName]').val();
var pointWorth = $('select[name=... |
10,252,230 | I want to check if an item has been selected in ListBox when user click on label
if i execute like that i got this error `list index out of bounds`
```
procedure TfrMain.Label15Click(Sender: TObject);
var
saveDialog : TSaveDialog;
FileContents: TStringStream;
saveLine,Selected : String;
begin
saveDialog := T... | 2012/04/20 | [
"https://Stackoverflow.com/questions/10252230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/944858/"
] | This code
```
if Selected then
```
will not compile because `Selected` is a string. I guess you were experimenting just before posting this.
All the same you error messages and the question title suggests that `ListBox1.ItemIndex` is equal to -1. Hence the list index out of bounds error.
You need to add a check th... | This occurs if nothing is selected in the list box.
Try Using:
```
procedure TfrMain.Label15Click(Sender: TObject);
var
saveDialog : TSaveDialog;
FileContents: TStringStream;
saveLine,Selected : String;
begin
saveDialog := TSaveDialog.Create(self);
saveDialog.Title := 'Save your text or word file';
saveDialog.I... |
5,797,590 | Say I have a graph (network) of nodes, with weightings on the following:
1. travelling one way on a link between two nodes.
2. travelling the other way on a link between two nodes (these might be different).
3. changing from one link to another.
Also, some of the nodes are one-way only.
In this case, what would be th... | 2011/04/26 | [
"https://Stackoverflow.com/questions/5797590",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/318414/"
] | Yes, treat these as two edges instead of one. Then you can use traditional graph theory algorithms on this without a problem, especially if you are always guaranteed to have weights in each direction. These algorithms are easy to find if you are just using a 'normal' graph like I have just helped you create.
You can u... | For your "interchange" weights, you can make a little subgraph to encode those. For example, you have:
```
|
|3
8 D --
|2
|
```
You can encode that using just weights on edges, like this:
```
|
|
D0
| \3
| \
8| D2--
| /
| /2
D1
|
|
```
Just watch out for the fact that you don... |
19,236,793 | I have several charts on one of my sheets (charts) and I only want to export 6 specific charts. When I select a chart and go to the `Layout` tab I see something called `Chart Name` which I assume lets me choose the chart name. I've tried changing the name to "ChartA" for one of the charts. Please help with this simple ... | 2013/10/07 | [
"https://Stackoverflow.com/questions/19236793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/223513/"
] | Added `basePath` to save the jpg in the same directory as the excel file. Saved as a PNG because it seems to be better quality and smaller file size than JPG. Not sure if this is the best file format to use though.
This code sets sheet `charts` and chart `ChartA` active, then saves the active chart.
```
Sub SaveArea... | Copied from: <http://windowssecrets.com/forums/showthread.php/129693-Export-charts-from-Excel-into-any-image-format> with minor adaptation.
```
Sub ChartToJPG()
Dim Chrt As Chart
Application.ScreenUpdating = False
ActiveSheet.ChartObjects("ChartA").Activate
ActiveChart.ChartArea.Copy
Set Chrt = Charts.Add
Chrt.Paste
C... |
19,236,793 | I have several charts on one of my sheets (charts) and I only want to export 6 specific charts. When I select a chart and go to the `Layout` tab I see something called `Chart Name` which I assume lets me choose the chart name. I've tried changing the name to "ChartA" for one of the charts. Please help with this simple ... | 2013/10/07 | [
"https://Stackoverflow.com/questions/19236793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/223513/"
] | Copied from: <http://windowssecrets.com/forums/showthread.php/129693-Export-charts-from-Excel-into-any-image-format> with minor adaptation.
```
Sub ChartToJPG()
Dim Chrt As Chart
Application.ScreenUpdating = False
ActiveSheet.ChartObjects("ChartA").Activate
ActiveChart.ChartArea.Copy
Set Chrt = Charts.Add
Chrt.Paste
C... | I modified this code for when your chart is in it's own sheet. It also automatically gets the active sheet name, `SheetName`, and uses it as the file name for when you save it similar to above. I also changed `basePath` a bit by putting the "\" in the `Filename`. Enjoy.
```
Sub Save_Chart()
Dim basePath As String
... |
19,236,793 | I have several charts on one of my sheets (charts) and I only want to export 6 specific charts. When I select a chart and go to the `Layout` tab I see something called `Chart Name` which I assume lets me choose the chart name. I've tried changing the name to "ChartA" for one of the charts. Please help with this simple ... | 2013/10/07 | [
"https://Stackoverflow.com/questions/19236793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/223513/"
] | Added `basePath` to save the jpg in the same directory as the excel file. Saved as a PNG because it seems to be better quality and smaller file size than JPG. Not sure if this is the best file format to use though.
This code sets sheet `charts` and chart `ChartA` active, then saves the active chart.
```
Sub SaveArea... | I modified this code for when your chart is in it's own sheet. It also automatically gets the active sheet name, `SheetName`, and uses it as the file name for when you save it similar to above. I also changed `basePath` a bit by putting the "\" in the `Filename`. Enjoy.
```
Sub Save_Chart()
Dim basePath As String
... |
1,479,452 | What purpose do protected or private (non-static) events in .NET really serve?
It seems like any private or protected event is more easily handled via a virtual method. I can (somewhat) see the need for this in static events, but not for normal events.
Have you had a use case before that clearly demonstrates a need ... | 2009/09/25 | [
"https://Stackoverflow.com/questions/1479452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/65358/"
] | Seems to me that a good example of where a private event is useful is in component/control building, often you may have a component that is a composite of 1 or more other components, private events that contained components can subscribe to is a handy and easy implementation of an observer pattern.
Edit:
Let me give ... | Here's a slightly bizarre but real-world scenario I implemented once. You have machine-generated and user-generated halves of a partial class. The machine-generated half contains code which wishes to inform the user-generated half when some event occurs. But the user-generated half might not care to do anything, or it ... |
1,479,452 | What purpose do protected or private (non-static) events in .NET really serve?
It seems like any private or protected event is more easily handled via a virtual method. I can (somewhat) see the need for this in static events, but not for normal events.
Have you had a use case before that clearly demonstrates a need ... | 2009/09/25 | [
"https://Stackoverflow.com/questions/1479452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/65358/"
] | Seems to me that a good example of where a private event is useful is in component/control building, often you may have a component that is a composite of 1 or more other components, private events that contained components can subscribe to is a handy and easy implementation of an observer pattern.
Edit:
Let me give ... | Nested types have access to the enclosing type's private and protected events. I've used this feature to notify child controls (the nested type) of state changes in the parent control (the enclosing type) in a Silverlight application. |
1,479,452 | What purpose do protected or private (non-static) events in .NET really serve?
It seems like any private or protected event is more easily handled via a virtual method. I can (somewhat) see the need for this in static events, but not for normal events.
Have you had a use case before that clearly demonstrates a need ... | 2009/09/25 | [
"https://Stackoverflow.com/questions/1479452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/65358/"
] | Seems to me that a good example of where a private event is useful is in component/control building, often you may have a component that is a composite of 1 or more other components, private events that contained components can subscribe to is a handy and easy implementation of an observer pattern.
Edit:
Let me give ... | Sorry to drag up an old thread, but I use private events with impunity in one of my projects, and personally, I find it's a good way of solving a design issue:
Here's the abbreviated code:
```
public class MyClass
{
private event EventHandler _myEvent;
public ExternalObject { get; set; }
public event EventHan... |
1,479,452 | What purpose do protected or private (non-static) events in .NET really serve?
It seems like any private or protected event is more easily handled via a virtual method. I can (somewhat) see the need for this in static events, but not for normal events.
Have you had a use case before that clearly demonstrates a need ... | 2009/09/25 | [
"https://Stackoverflow.com/questions/1479452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/65358/"
] | Seems to me that a good example of where a private event is useful is in component/control building, often you may have a component that is a composite of 1 or more other components, private events that contained components can subscribe to is a handy and easy implementation of an observer pattern.
Edit:
Let me give ... | Not only the current instance can access a private member. Other instances of the same type can too! This enables some scenarios where this access control may be useful.
I am thinking of a tree structure where all nodes inherit a certain type and a private/protected event allows to propagate leaf events to their paren... |
1,479,452 | What purpose do protected or private (non-static) events in .NET really serve?
It seems like any private or protected event is more easily handled via a virtual method. I can (somewhat) see the need for this in static events, but not for normal events.
Have you had a use case before that clearly demonstrates a need ... | 2009/09/25 | [
"https://Stackoverflow.com/questions/1479452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/65358/"
] | Here's a slightly bizarre but real-world scenario I implemented once. You have machine-generated and user-generated halves of a partial class. The machine-generated half contains code which wishes to inform the user-generated half when some event occurs. But the user-generated half might not care to do anything, or it ... | Nested types have access to the enclosing type's private and protected events. I've used this feature to notify child controls (the nested type) of state changes in the parent control (the enclosing type) in a Silverlight application. |
1,479,452 | What purpose do protected or private (non-static) events in .NET really serve?
It seems like any private or protected event is more easily handled via a virtual method. I can (somewhat) see the need for this in static events, but not for normal events.
Have you had a use case before that clearly demonstrates a need ... | 2009/09/25 | [
"https://Stackoverflow.com/questions/1479452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/65358/"
] | Here's a slightly bizarre but real-world scenario I implemented once. You have machine-generated and user-generated halves of a partial class. The machine-generated half contains code which wishes to inform the user-generated half when some event occurs. But the user-generated half might not care to do anything, or it ... | Sorry to drag up an old thread, but I use private events with impunity in one of my projects, and personally, I find it's a good way of solving a design issue:
Here's the abbreviated code:
```
public class MyClass
{
private event EventHandler _myEvent;
public ExternalObject { get; set; }
public event EventHan... |
1,479,452 | What purpose do protected or private (non-static) events in .NET really serve?
It seems like any private or protected event is more easily handled via a virtual method. I can (somewhat) see the need for this in static events, but not for normal events.
Have you had a use case before that clearly demonstrates a need ... | 2009/09/25 | [
"https://Stackoverflow.com/questions/1479452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/65358/"
] | Here's a slightly bizarre but real-world scenario I implemented once. You have machine-generated and user-generated halves of a partial class. The machine-generated half contains code which wishes to inform the user-generated half when some event occurs. But the user-generated half might not care to do anything, or it ... | Not only the current instance can access a private member. Other instances of the same type can too! This enables some scenarios where this access control may be useful.
I am thinking of a tree structure where all nodes inherit a certain type and a private/protected event allows to propagate leaf events to their paren... |
1,479,452 | What purpose do protected or private (non-static) events in .NET really serve?
It seems like any private or protected event is more easily handled via a virtual method. I can (somewhat) see the need for this in static events, but not for normal events.
Have you had a use case before that clearly demonstrates a need ... | 2009/09/25 | [
"https://Stackoverflow.com/questions/1479452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/65358/"
] | Nested types have access to the enclosing type's private and protected events. I've used this feature to notify child controls (the nested type) of state changes in the parent control (the enclosing type) in a Silverlight application. | Sorry to drag up an old thread, but I use private events with impunity in one of my projects, and personally, I find it's a good way of solving a design issue:
Here's the abbreviated code:
```
public class MyClass
{
private event EventHandler _myEvent;
public ExternalObject { get; set; }
public event EventHan... |
1,479,452 | What purpose do protected or private (non-static) events in .NET really serve?
It seems like any private or protected event is more easily handled via a virtual method. I can (somewhat) see the need for this in static events, but not for normal events.
Have you had a use case before that clearly demonstrates a need ... | 2009/09/25 | [
"https://Stackoverflow.com/questions/1479452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/65358/"
] | Nested types have access to the enclosing type's private and protected events. I've used this feature to notify child controls (the nested type) of state changes in the parent control (the enclosing type) in a Silverlight application. | Not only the current instance can access a private member. Other instances of the same type can too! This enables some scenarios where this access control may be useful.
I am thinking of a tree structure where all nodes inherit a certain type and a private/protected event allows to propagate leaf events to their paren... |
9,987,670 | I want to use an **`activity as dialog`** and i made the theme of the activity as dialog & i succeed.
but
i have the problem here is when i click outside of the activity
its automatically get closed & the previous activity get started..
i tried a thing to make transparent parent layout it does not look like a dialog.... | 2012/04/03 | [
"https://Stackoverflow.com/questions/9987670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1173378/"
] | try with following property
```
this.setFinishOnTouchOutside(false);
``` | Using Same Activity in Mobile devices and Tablets.
**Mobile :-**
1. Goto res -> values.
2. Open styles.xml and add following theme settings.
styles.xml :-
```
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPr... |
9,987,670 | I want to use an **`activity as dialog`** and i made the theme of the activity as dialog & i succeed.
but
i have the problem here is when i click outside of the activity
its automatically get closed & the previous activity get started..
i tried a thing to make transparent parent layout it does not look like a dialog.... | 2012/04/03 | [
"https://Stackoverflow.com/questions/9987670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1173378/"
] | Make change in code as per your need.
Thanks
```
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/transparent"
android:orientation="vertical"
andr... | to Start activity as dialog I defined:
```
<activity android:theme="@android:style/Theme.Dialog" />
```
Now when I `startActivity()` it displays like a dialog and parent activity displays behind it. I want a Button which when clicked Dialog gets dismissed and parent activity should display without refreshing the pag... |
9,987,670 | I want to use an **`activity as dialog`** and i made the theme of the activity as dialog & i succeed.
but
i have the problem here is when i click outside of the activity
its automatically get closed & the previous activity get started..
i tried a thing to make transparent parent layout it does not look like a dialog.... | 2012/04/03 | [
"https://Stackoverflow.com/questions/9987670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1173378/"
] | to Start activity as dialog I defined:
```
<activity android:theme="@android:style/Theme.Dialog" />
```
Now when I `startActivity()` it displays like a dialog and parent activity displays behind it. I want a Button which when clicked Dialog gets dismissed and parent activity should display without refreshing the pag... | Using Same Activity in Mobile devices and Tablets.
**Mobile :-**
1. Goto res -> values.
2. Open styles.xml and add following theme settings.
styles.xml :-
```
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPr... |
9,987,670 | I want to use an **`activity as dialog`** and i made the theme of the activity as dialog & i succeed.
but
i have the problem here is when i click outside of the activity
its automatically get closed & the previous activity get started..
i tried a thing to make transparent parent layout it does not look like a dialog.... | 2012/04/03 | [
"https://Stackoverflow.com/questions/9987670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1173378/"
] | Make change in code as per your need.
Thanks
```
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/transparent"
android:orientation="vertical"
andr... | For the issue of avoiding closing the activity when clicking outside window
from API 11
as mentioned by Vivek use this.setFinishOnTouchOutside(false);
but for prior APIs use this code:
```
@Override
public boolean onTouchEvent(MotionEvent event) {
if ( event.getAction() == MotionEvent.ACTION_DOWN && isOutOfBoun... |
9,987,670 | I want to use an **`activity as dialog`** and i made the theme of the activity as dialog & i succeed.
but
i have the problem here is when i click outside of the activity
its automatically get closed & the previous activity get started..
i tried a thing to make transparent parent layout it does not look like a dialog.... | 2012/04/03 | [
"https://Stackoverflow.com/questions/9987670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1173378/"
] | For the issue of avoiding closing the activity when clicking outside window
from API 11
as mentioned by Vivek use this.setFinishOnTouchOutside(false);
but for prior APIs use this code:
```
@Override
public boolean onTouchEvent(MotionEvent event) {
if ( event.getAction() == MotionEvent.ACTION_DOWN && isOutOfBoun... | Using Same Activity in Mobile devices and Tablets.
**Mobile :-**
1. Goto res -> values.
2. Open styles.xml and add following theme settings.
styles.xml :-
```
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPr... |
9,987,670 | I want to use an **`activity as dialog`** and i made the theme of the activity as dialog & i succeed.
but
i have the problem here is when i click outside of the activity
its automatically get closed & the previous activity get started..
i tried a thing to make transparent parent layout it does not look like a dialog.... | 2012/04/03 | [
"https://Stackoverflow.com/questions/9987670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1173378/"
] | try with following property
```
this.setFinishOnTouchOutside(false);
``` | For the issue of avoiding closing the activity when clicking outside window
from API 11
as mentioned by Vivek use this.setFinishOnTouchOutside(false);
but for prior APIs use this code:
```
@Override
public boolean onTouchEvent(MotionEvent event) {
if ( event.getAction() == MotionEvent.ACTION_DOWN && isOutOfBoun... |
9,987,670 | I want to use an **`activity as dialog`** and i made the theme of the activity as dialog & i succeed.
but
i have the problem here is when i click outside of the activity
its automatically get closed & the previous activity get started..
i tried a thing to make transparent parent layout it does not look like a dialog.... | 2012/04/03 | [
"https://Stackoverflow.com/questions/9987670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1173378/"
] | Make change in code as per your need.
Thanks
```
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/transparent"
android:orientation="vertical"
andr... | if you haven't already tried it, then this is the way to achieve activity as dialog:
in your manifest file, add to your activity the following attribute:
```
<activity
android:name=".MyActivityName"
android:theme="@android:style/Theme.Dialog" />
``` |
9,987,670 | I want to use an **`activity as dialog`** and i made the theme of the activity as dialog & i succeed.
but
i have the problem here is when i click outside of the activity
its automatically get closed & the previous activity get started..
i tried a thing to make transparent parent layout it does not look like a dialog.... | 2012/04/03 | [
"https://Stackoverflow.com/questions/9987670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1173378/"
] | try with following property
```
this.setFinishOnTouchOutside(false);
``` | Make change in code as per your need.
Thanks
```
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/transparent"
android:orientation="vertical"
andr... |
9,987,670 | I want to use an **`activity as dialog`** and i made the theme of the activity as dialog & i succeed.
but
i have the problem here is when i click outside of the activity
its automatically get closed & the previous activity get started..
i tried a thing to make transparent parent layout it does not look like a dialog.... | 2012/04/03 | [
"https://Stackoverflow.com/questions/9987670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1173378/"
] | try with following property
```
this.setFinishOnTouchOutside(false);
``` | to Start activity as dialog I defined:
```
<activity android:theme="@android:style/Theme.Dialog" />
```
Now when I `startActivity()` it displays like a dialog and parent activity displays behind it. I want a Button which when clicked Dialog gets dismissed and parent activity should display without refreshing the pag... |
9,987,670 | I want to use an **`activity as dialog`** and i made the theme of the activity as dialog & i succeed.
but
i have the problem here is when i click outside of the activity
its automatically get closed & the previous activity get started..
i tried a thing to make transparent parent layout it does not look like a dialog.... | 2012/04/03 | [
"https://Stackoverflow.com/questions/9987670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1173378/"
] | Make change in code as per your need.
Thanks
```
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/transparent"
android:orientation="vertical"
andr... | Using Same Activity in Mobile devices and Tablets.
**Mobile :-**
1. Goto res -> values.
2. Open styles.xml and add following theme settings.
styles.xml :-
```
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPr... |
69,969,104 | I am trying to write a an input code that can put 2 output all together and add it up. The code is below;
```
import numpy as np
x, y = input("Insert value").split()
print(x)
print(y)
print(np.add(x,y))
```
Output:
```
4
3
---------------------------------------------------------------------------
UFuncTypeError ... | 2021/11/15 | [
"https://Stackoverflow.com/questions/69969104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16330649/"
] | Try this
```
observe({
lapply(1:input$nomaps, function(i) {
observeEvent(input[[paste0("plot_", i,"_shape_click")]], {
# execute only if the polygon has never been clicked
selected.id <- input[[paste0("plot_", i,"_shape_click")]]
data <- rv$df[rv$df$ID==selected.id$id,]
if (... | ```
observe ({
lapply(1:input$nomaps, function(i) {
observeEvent(input[[paste0("plot_", i,"_shape_click",sep="")]], {
# execute only if the polygon has never been clicked
if (input[[paste0("plot_", i,"_shape_click",sep="")]]$group == "unclicked_poly") {
selected.id <- input[[paste0(... |
71,105,629 | I need to make the `@Get` method, and for users with `ROLE_USER` it should return other values than for users with `ROLE_ADMIN`.
The URL have to be the same.
How to do it with Spring Security? | 2022/02/13 | [
"https://Stackoverflow.com/questions/71105629",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16539422/"
] | If your authentification passed well you could just inject [@AuthenticationPrincipal](https://docs.spring.io/spring-security/site/docs/current/api/org/springframework/security/core/annotation/AuthenticationPrincipal.html):
```
@GetMapping("/get-url-here")
public String main(@AuthenticationPrincipal User user) {
if... | Question is not 100% clear, but what I would do is make an Enum field in the user class (assuming that class exists) for the role and return the value of that field when the URL is called. |
4,017,721 | I'm trying to get my datepicker (jQuery UI Datepicker), which has one field for "check-in" and another for "check-out" to update the check-out date based on the minimum period (in seconds) pulled in via ajax when the user chooses a check-in date, but to also allow choices to be changed.
For example I want to check-in ... | 2010/10/25 | [
"https://Stackoverflow.com/questions/4017721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/78843/"
] | <http://jsfiddle.net/generalhenry/LerRw/2/>
I think I have it working | Does this get you any closer to what you want?
<http://jsbin.com/eramu5>
### UPDATED
I've updated my script so that you can have a minimum of 1 month. And you can set the dates in the checkin and the checkout date pickers.
<http://jsbin.com/ihufi5>
### [Here's a video explaining how my script works](http://screenr... |
58,185,271 | A teacher friend of mine asked me to cook up a program to help them assign classroom jobs to their students. There are 23 kids and 12 different job types, where some jobs require multiple kids, totaling 23 available positions. Each week they want to randomly assign new jobs to the kids, where no kid does the same job m... | 2019/10/01 | [
"https://Stackoverflow.com/questions/58185271",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11429975/"
] | Here is a simple greedy algorithm without any guarantees:
Create a [bipartite graph](https://en.wikipedia.org/wiki/Bipartite_graph) where the students are nodes in one set and the task slots are nodes in the other set.
Now we create edges between students and nodes for those assignments that are viable. Initially, th... | Let us first find some common-sense boundaries to possible answers:
* if there are M tasks, and kids are not allowed to repeat tasks, then there cannot be more than M assignments, because an M+1th assignment would have to repeat one among the M previous assignments. Therefore, generating M valid, non-repeating assign... |
58,185,271 | A teacher friend of mine asked me to cook up a program to help them assign classroom jobs to their students. There are 23 kids and 12 different job types, where some jobs require multiple kids, totaling 23 available positions. Each week they want to randomly assign new jobs to the kids, where no kid does the same job m... | 2019/10/01 | [
"https://Stackoverflow.com/questions/58185271",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11429975/"
] | This is a trivial scheduling problem. You have 23 students for 23 slots; your largest equivalence group is 4 (Table Captain). Line them up and assign jobs. Every week, shift the kids over 4 spots. 23 and 4 are relatively prime, so the pattern won't repeat for 23 weeks.
Let's designate the job types with the ten numera... | Here is a simple greedy algorithm without any guarantees:
Create a [bipartite graph](https://en.wikipedia.org/wiki/Bipartite_graph) where the students are nodes in one set and the task slots are nodes in the other set.
Now we create edges between students and nodes for those assignments that are viable. Initially, th... |
58,185,271 | A teacher friend of mine asked me to cook up a program to help them assign classroom jobs to their students. There are 23 kids and 12 different job types, where some jobs require multiple kids, totaling 23 available positions. Each week they want to randomly assign new jobs to the kids, where no kid does the same job m... | 2019/10/01 | [
"https://Stackoverflow.com/questions/58185271",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11429975/"
] | This is a trivial scheduling problem. You have 23 students for 23 slots; your largest equivalence group is 4 (Table Captain). Line them up and assign jobs. Every week, shift the kids over 4 spots. 23 and 4 are relatively prime, so the pattern won't repeat for 23 weeks.
Let's designate the job types with the ten numera... | Let us first find some common-sense boundaries to possible answers:
* if there are M tasks, and kids are not allowed to repeat tasks, then there cannot be more than M assignments, because an M+1th assignment would have to repeat one among the M previous assignments. Therefore, generating M valid, non-repeating assign... |
72,878,645 | I am trying find out if there is a subarray, which has the sum exactly as K. But in some its giving runtime error

```
int sum = 0, count = 0;
HashMap<Integer, Integer> hm = new HashMap<>();
hm.put(0, 1);
for (int i = 0; i < n; i++) {
sum += arr[i];
... | 2022/07/06 | [
"https://Stackoverflow.com/questions/72878645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19491999/"
] | <https://stackoverflow.com/a/288479>
-> It seems that in some old C-Standards you had to declare all variables in the beginning of a method. So I think they are just adhering to this when teaching it like this, but nowadays there is no real reason for this. | Your correct extended version should be
```
Scanner scan = new Scanner(System.in);
String name;
System.out.println("What is your name?");
name = scan.nextLine(); // no need of String keyword here
System.out.println(name);
```
And why someone would prefer it?
Consider a method definition, May be something like belo... |
72,878,645 | I am trying find out if there is a subarray, which has the sum exactly as K. But in some its giving runtime error

```
int sum = 0, count = 0;
HashMap<Integer, Integer> hm = new HashMap<>();
hm.put(0, 1);
for (int i = 0; i < n; i++) {
sum += arr[i];
... | 2022/07/06 | [
"https://Stackoverflow.com/questions/72878645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19491999/"
] | In your case its one and the same thing. It is more useful though when used in the context of variable scoping.
Creating a reference variable before initializing it with a value is the preferred way while using code blocks, so that the reference can be used outside of the block as well. Check out this example:
```
in... | Your correct extended version should be
```
Scanner scan = new Scanner(System.in);
String name;
System.out.println("What is your name?");
name = scan.nextLine(); // no need of String keyword here
System.out.println(name);
```
And why someone would prefer it?
Consider a method definition, May be something like belo... |
10,387,349 | Host machine was ported from 11.10 to 12.04 LTS (Xubuntu)
Virtualbox image is win7 x64
With upgrade /dev/vboxdrv was missing, so within synaptics I reinstalled:
* virtualbox (4.1.12dsfg-2 not OSE)
* virtualbox-qt 4.1.12dsfg
* virtualbox-dkms 4.1.12dsfg
Then it works again but my windows is badly crashed. Once start... | 2012/04/30 | [
"https://Stackoverflow.com/questions/10387349",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1366230/"
] | I can confirm this bug on two of my Ubuntu 12.04 machines (i7 Desktop, Samsung Dual Core Laptop):
All my Windows (Win7, WinServer2003,WinServer 2008) 64bit guest machines which were working under Ubuntu 11.10 behave the same way after upgrading / reinstalling to Ubuntu Precise:
During guest bootup or shortly after bo... | I can't be sure that I was having the same problem, but I also just upgraded from ubuntu 11.10 to 12.04 and attempting to boot my virtual machine (xp 32bit) would cause the host to freeze.
The fix was to do the following:
* Enable absolute pointing device (almost certainly wasnt this that fixed it but hey ho!)
* Enab... |
10,387,349 | Host machine was ported from 11.10 to 12.04 LTS (Xubuntu)
Virtualbox image is win7 x64
With upgrade /dev/vboxdrv was missing, so within synaptics I reinstalled:
* virtualbox (4.1.12dsfg-2 not OSE)
* virtualbox-qt 4.1.12dsfg
* virtualbox-dkms 4.1.12dsfg
Then it works again but my windows is badly crashed. Once start... | 2012/04/30 | [
"https://Stackoverflow.com/questions/10387349",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1366230/"
] | I can confirm this bug on two of my Ubuntu 12.04 machines (i7 Desktop, Samsung Dual Core Laptop):
All my Windows (Win7, WinServer2003,WinServer 2008) 64bit guest machines which were working under Ubuntu 11.10 behave the same way after upgrading / reinstalling to Ubuntu Precise:
During guest bootup or shortly after bo... | The [probably-related VirtualBox bug ticket](https://www.virtualbox.org/ticket/10528) says it is fixed in VirtualBox source, and also details a workaround via grub.
The Debian bug is [here](http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=655202).
Hopefully the patch will be applied to Ubuntu-12.04 .
(This answer is... |
10,387,349 | Host machine was ported from 11.10 to 12.04 LTS (Xubuntu)
Virtualbox image is win7 x64
With upgrade /dev/vboxdrv was missing, so within synaptics I reinstalled:
* virtualbox (4.1.12dsfg-2 not OSE)
* virtualbox-qt 4.1.12dsfg
* virtualbox-dkms 4.1.12dsfg
Then it works again but my windows is badly crashed. Once start... | 2012/04/30 | [
"https://Stackoverflow.com/questions/10387349",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1366230/"
] | The [probably-related VirtualBox bug ticket](https://www.virtualbox.org/ticket/10528) says it is fixed in VirtualBox source, and also details a workaround via grub.
The Debian bug is [here](http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=655202).
Hopefully the patch will be applied to Ubuntu-12.04 .
(This answer is... | I can't be sure that I was having the same problem, but I also just upgraded from ubuntu 11.10 to 12.04 and attempting to boot my virtual machine (xp 32bit) would cause the host to freeze.
The fix was to do the following:
* Enable absolute pointing device (almost certainly wasnt this that fixed it but hey ho!)
* Enab... |
42,477,466 | I create a class SecureImpalaDataSource that extends DriverManagerDataSource, and use `UserGroupInformation.doAs()` to get a Connection to impala with keytab file. But I get the error as follow:
>
> java.sql.SQLException: [Simba]ImpalaJDBCDriver Error
> initialized or created transport for authentication:
> [Simba... | 2017/02/27 | [
"https://Stackoverflow.com/questions/42477466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7627651/"
] | Forget about the Hadoop UGI: a JDBC driver just needs the raw JAAS configuration to create a Kerberos ticket on-the-fly *(with `useKeyTab` raised and `useTicketCache` lowered)*.
**System properties**
* `java.security.krb5.conf` => (optional) non-defaut Kerberos conf
* `java.security.auth.login.config` => JAAS config ... | One way to authentication your jdbc connection is using ugi.doAs. Here is the sample code:
```
// 1. login use keytab
System.setProperty("java.security.krb5.realm", "XXX.COM");
System.setProperty("java.security.krb5.kdc", "kdcXXX");
Configuration conf = new Configuration();
conf.set("hadoop.security.authentication", "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.