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 |
|---|---|---|---|---|---|
15,823,756 | I know this question has been answered a few hundred times, but I have run through a load of the potential solutons, but none of them seem to work in my instance.
Below is my form and code for submitting the form. It fires off to a PHP script. Now I know the script itself isn't the cause of the submit, as I've tried t... | 2013/04/04 | [
"https://Stackoverflow.com/questions/15823756",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1513473/"
] | while all the listed solutions are valid, in my case, what what causing my multiple form submission was the e i was passing to the function called on submit.
i had
```
$('form').bind('submit', function(e){
e.preventDefault()
return false
})
```
but i changed it to
```
$('form').bind('submit', function(){
eve... | As you are using AJAX request to send data to the server there's no reason even to use `form` tag and `<input type="submit" .../>` (you can use simple button instead). Also I think Cumbo's answer should work. If it doesn't you can also try `event.stopPropagation()`. |
15,823,756 | I know this question has been answered a few hundred times, but I have run through a load of the potential solutons, but none of them seem to work in my instance.
Below is my form and code for submitting the form. It fires off to a PHP script. Now I know the script itself isn't the cause of the submit, as I've tried t... | 2013/04/04 | [
"https://Stackoverflow.com/questions/15823756",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1513473/"
] | while all the listed solutions are valid, in my case, what what causing my multiple form submission was the e i was passing to the function called on submit.
i had
```
$('form').bind('submit', function(e){
e.preventDefault()
return false
})
```
but i changed it to
```
$('form').bind('submit', function(){
eve... | Underneath your click function, add a `preventDefault()` to the event.
```
$("#addpayment_submit").click(function(event) {
event.preventDefault();
// Code here
return false;
});
```
This may solve your problem. `preventDeafult()` stops the default event from triggering. In this case, your form is trigger... |
15,823,756 | I know this question has been answered a few hundred times, but I have run through a load of the potential solutons, but none of them seem to work in my instance.
Below is my form and code for submitting the form. It fires off to a PHP script. Now I know the script itself isn't the cause of the submit, as I've tried t... | 2013/04/04 | [
"https://Stackoverflow.com/questions/15823756",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1513473/"
] | Try adding the following lines.
```
event.preventDefault();
event.stopImmediatePropagation();
```
This worked for me. | I ended up changing the script upon the recommendations of @user2247104 unfortunately the form still submitted twice.
However @Cumbo, @Barmar were also on the right track, except that to get it to work
`event.preventDefault();`
Needed to be placed at the bottom of the script:
```
});
event.preventDefault();
return... |
15,823,756 | I know this question has been answered a few hundred times, but I have run through a load of the potential solutons, but none of them seem to work in my instance.
Below is my form and code for submitting the form. It fires off to a PHP script. Now I know the script itself isn't the cause of the submit, as I've tried t... | 2013/04/04 | [
"https://Stackoverflow.com/questions/15823756",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1513473/"
] | while all the listed solutions are valid, in my case, what what causing my multiple form submission was the e i was passing to the function called on submit.
i had
```
$('form').bind('submit', function(e){
e.preventDefault()
return false
})
```
but i changed it to
```
$('form').bind('submit', function(){
eve... | I ended up changing the script upon the recommendations of @user2247104 unfortunately the form still submitted twice.
However @Cumbo, @Barmar were also on the right track, except that to get it to work
`event.preventDefault();`
Needed to be placed at the bottom of the script:
```
});
event.preventDefault();
return... |
15,823,756 | I know this question has been answered a few hundred times, but I have run through a load of the potential solutons, but none of them seem to work in my instance.
Below is my form and code for submitting the form. It fires off to a PHP script. Now I know the script itself isn't the cause of the submit, as I've tried t... | 2013/04/04 | [
"https://Stackoverflow.com/questions/15823756",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1513473/"
] | Some times you have to not only prevent the default behauviour for handling the event, but also to prevent executing any downstream chain of event handlers.
This can be done by calling [`event.stopImmediatePropagation()`](https://api.jquery.com/event.stopimmediatepropagation/) in addition to [`event.preventDefault()`](... | Try adding the following lines.
```
event.preventDefault();
event.stopImmediatePropagation();
```
This worked for me. |
15,823,756 | I know this question has been answered a few hundred times, but I have run through a load of the potential solutons, but none of them seem to work in my instance.
Below is my form and code for submitting the form. It fires off to a PHP script. Now I know the script itself isn't the cause of the submit, as I've tried t... | 2013/04/04 | [
"https://Stackoverflow.com/questions/15823756",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1513473/"
] | Also, you're binding the action to the submit button 'click'. But, what if the user presses 'enter' while typing in a text field and triggers the default form action? Your function won't run.
I would change this:
```
$("#addpayment_submit").click(function(event) {
event.preventDefault();
//code
}
```
to thi... | As you are using AJAX request to send data to the server there's no reason even to use `form` tag and `<input type="submit" .../>` (you can use simple button instead). Also I think Cumbo's answer should work. If it doesn't you can also try `event.stopPropagation()`. |
311,206 | In the below config I want to remove the body field from **content** and add it in **hidden** as **body: true** when I uninstall the layout module.
*Basically when I install the layout module the fields in manage display should get disabled/hidden and when I uninstall the module the fields should be displayed.* How can... | 2022/05/18 | [
"https://drupal.stackexchange.com/questions/311206",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/106781/"
] | I have solved the issue. Instead of `\Drupal::entityTypeManager()` I used
```
$articleDefaultLayout = LayoutBuilderEntityViewDisplay::load(
'node.article.default'
);
$articleDefaultLayout->setComponent('body');
``` | To disable the body field when you install the custom module:
*mymodule.install*
```
/**
* Implements hook_install().
*/
function mymodule_install() {
\Drupal::entityTypeManager()
->getStorage('entity_view_display')
->load('node.article.default')
->removeComponent('body')
->save();
}
```
How to ... |
60,515,444 | I am trying to compute average scores for responses to different events. My data is in long format with one row for each event, sample dataset `data` here:
```
Subject Event R1 R2 R3 R4 Average
1 A 1 2 2 N/A 2.5
1 B 1 1 1 1 1
```
So to get the average for event A, it wou... | 2020/03/03 | [
"https://Stackoverflow.com/questions/60515444",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11510607/"
] | You don't need to filter for each event at a time. `dplyr` is able to process all rows at once, one by one. Also when using `dplyr`, you don't need to assign to a variable outside of its context, such as `data$average <- (something)`. You can use `mutate()`. So the intuitive syntax for `dplyr` would be:
```
data <-
... | You can use `rowMeans` to calculate means for each row of a dataframe. Specify in the input which columns you want to include. To ignore the `NA` set `na.rm=TRUE`.
```
data$Average <- rowMeans(data[,c("R1", "R2", "R3", "R4")], na.rm=TRUE)
```
If you had lots of columns to average and didn't want to type them all out... |
60,515,444 | I am trying to compute average scores for responses to different events. My data is in long format with one row for each event, sample dataset `data` here:
```
Subject Event R1 R2 R3 R4 Average
1 A 1 2 2 N/A 2.5
1 B 1 1 1 1 1
```
So to get the average for event A, it wou... | 2020/03/03 | [
"https://Stackoverflow.com/questions/60515444",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11510607/"
] | You don't need to filter for each event at a time. `dplyr` is able to process all rows at once, one by one. Also when using `dplyr`, you don't need to assign to a variable outside of its context, such as `data$average <- (something)`. You can use `mutate()`. So the intuitive syntax for `dplyr` would be:
```
data <-
... | Just to complete all previous answers, if you have multiple values named `R1`, `R2`, .... `R100`, instead of writing all of them into the `mean` function, you could be interested by reshaping your dataframe into a longer format using `pivot_longer` function and then group by Event and calculate the mean. Finally, using... |
60,515,444 | I am trying to compute average scores for responses to different events. My data is in long format with one row for each event, sample dataset `data` here:
```
Subject Event R1 R2 R3 R4 Average
1 A 1 2 2 N/A 2.5
1 B 1 1 1 1 1
```
So to get the average for event A, it wou... | 2020/03/03 | [
"https://Stackoverflow.com/questions/60515444",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11510607/"
] | The following doesn't include the NA value as part of the mean calculation (*na.rm=TRUE*). Also, I think grouping by Event is important. When run without group\_by, the calculations combine all events and the resulting value is 1.285714 (=9/7 obs).
```
data <- data.frame(
Subject=c(1,1),
Event=c('A', 'B'),
R1=c(... | You can use `rowMeans` to calculate means for each row of a dataframe. Specify in the input which columns you want to include. To ignore the `NA` set `na.rm=TRUE`.
```
data$Average <- rowMeans(data[,c("R1", "R2", "R3", "R4")], na.rm=TRUE)
```
If you had lots of columns to average and didn't want to type them all out... |
60,515,444 | I am trying to compute average scores for responses to different events. My data is in long format with one row for each event, sample dataset `data` here:
```
Subject Event R1 R2 R3 R4 Average
1 A 1 2 2 N/A 2.5
1 B 1 1 1 1 1
```
So to get the average for event A, it wou... | 2020/03/03 | [
"https://Stackoverflow.com/questions/60515444",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11510607/"
] | The following doesn't include the NA value as part of the mean calculation (*na.rm=TRUE*). Also, I think grouping by Event is important. When run without group\_by, the calculations combine all events and the resulting value is 1.285714 (=9/7 obs).
```
data <- data.frame(
Subject=c(1,1),
Event=c('A', 'B'),
R1=c(... | Just to complete all previous answers, if you have multiple values named `R1`, `R2`, .... `R100`, instead of writing all of them into the `mean` function, you could be interested by reshaping your dataframe into a longer format using `pivot_longer` function and then group by Event and calculate the mean. Finally, using... |
60,515,444 | I am trying to compute average scores for responses to different events. My data is in long format with one row for each event, sample dataset `data` here:
```
Subject Event R1 R2 R3 R4 Average
1 A 1 2 2 N/A 2.5
1 B 1 1 1 1 1
```
So to get the average for event A, it wou... | 2020/03/03 | [
"https://Stackoverflow.com/questions/60515444",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11510607/"
] | You can use `rowMeans` to calculate means for each row of a dataframe. Specify in the input which columns you want to include. To ignore the `NA` set `na.rm=TRUE`.
```
data$Average <- rowMeans(data[,c("R1", "R2", "R3", "R4")], na.rm=TRUE)
```
If you had lots of columns to average and didn't want to type them all out... | Just to complete all previous answers, if you have multiple values named `R1`, `R2`, .... `R100`, instead of writing all of them into the `mean` function, you could be interested by reshaping your dataframe into a longer format using `pivot_longer` function and then group by Event and calculate the mean. Finally, using... |
10,367,957 | I have noticed a high memory and CPU usage during mvn-gwt operation especially during compile phase. Memory usage just soars. I just wanna know if this is normal and if anyone else is experiencing this.
My current JVM setting is `-Xms64m -Xmx1280m -XX:MaxPermSize=512m`
 that must be analyzed during compilation and a number of compiler optimizations that require much memory and processing power. Thus, the GWT compiler use much memory internally... | Yes, it's normal. It derives from the awsome CPU utilization Google made when they've written the gwtc command (gwtc = GWT Compile).
I consider it good since the tradeoff for the CPU would typically be memory usage which is far more valuable for me.
(I do not work for Google :-)) |
10,367,957 | I have noticed a high memory and CPU usage during mvn-gwt operation especially during compile phase. Memory usage just soars. I just wanna know if this is normal and if anyone else is experiencing this.
My current JVM setting is `-Xms64m -Xmx1280m -XX:MaxPermSize=512m`
 that must be analyzed during compilation and a number of compiler optimizations that require much memory and processing power. Thus, the GWT compiler use much memory internally... | The GWT compiler has a localWorkers setting that tells it how many cores to use. The more cores, the more memory it will use. If you are using the Eclipse plugin it defaults to just using one (I believe). But the Maven plugin defaults to using all core on your machine (ie if you have a quad core, it will use `localWork... |
43,590 | I'm planning to travel from Osaka to Tokyo and back, and since the ride will be long, I think it's the perfect time to make friends.
However, I'm unsure how the Japanese see this kind of behaviour - a stranger suddenly conversing with them who is a foreigner.
Is it considered rude? Is it a case-to-case basis?
---
A... | 2015/02/20 | [
"https://travel.stackexchange.com/questions/43590",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/18310/"
] | I haven't found Japanese as chatty as Europeans or Americans, but there are some friendly people who would want to chat with a foreigner. You won't know until you try. Old ladies and people with families tend to be the most chattiest -- young women and businessmen tend to be the least. There's a stereotype (that I've f... | It is not rude as such, but unusual for strangers to talk on the shinkansen except to ask something specific like if it's okay to recline the seat (asked to the person sitting behind you.) Usually it's very quiet in there except for groups travelling together.
I live and work in Tokyo and take the shinkansen to and fr... |
68,336,320 | I'm currently trying to write a simple C#-WPF-Application that functions as a simple universal 'launcher'. For different applications we program.
It's purpose is to check the current software version of the 'real' software and if a new one is available it starts to copy the installer from a network share and runs the ... | 2021/07/11 | [
"https://Stackoverflow.com/questions/68336320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12165174/"
] | >
> I cannot await the task, because that would block the UI again. Where to await it?
>
>
>
`await` doesn't block the UI. Using `await` here is fine.
>
> Is my concept of starting this workflow here ok in the first place?
>
>
>
I usually recommend that *some* UI is shown immediately when doing any asynchron... | Thanks for all the replys.
After reading all your comments and combining some of your answers I came up with the following example. It is working under all circumstances I tested.
Hopefully there is not to much wrong in your opinion.
**Code behind from App.xaml.cs**
```cs
public partial class App : Application
{
... |
36,515,177 | So I'm fooling around a bit with Haskell, trying to learn it by myself. I'm trying to solve a certain question where I'm supposed to create a list of random numbers and then sum them up.
I have the code to generate them - using `getStdRandom` and `randomR`. Using them both returns a list of `IO Float`: `[IO Float]`
N... | 2016/04/09 | [
"https://Stackoverflow.com/questions/36515177",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/475680/"
] | Note that a list with type `[IO Float]` is **not** a list of numbers. It is a list of I/O actions that *generate* numbers. The I/O wasn't executed yet, so in your case the random number generator hasn't actually generated the numbers.
You can use the [`sequence :: Monad m => [m a] -> m [a]`](http://hackage.haskell.org... | How about something like the following using liftM:
```
import System.Random
import Control.Monad
rnd :: IO Float
rnd = getStdRandom (randomR (0.0,1.0))
main = do
let l = map (\_ -> rnd) [1..10]
n <- foldl (liftM2 (+)) (return (0 :: Float)) l
print n
``` |
8,604,499 | I am using AQGridView in my project. we need to create a black colored border around each image. Can anyone help me on this.
Thanks in advance.
Regards,
Jas. | 2011/12/22 | [
"https://Stackoverflow.com/questions/8604499",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978091/"
] | If your file contains empty lines, neither of the posted solutions will work.
For correct handling of empty lines try this:
```
$ cat f.awk
BEGIN{getline;min=max=$6}
NF{
max=(max>$6)?max:$6
min=(min>$6)?$6:min
}
END{print min,max}
```
Then run this command:
```
sed "/^#/d" my_file | awk -f f.awk
```
At f... | ```
awk 'BEGIN {max = 0} {if ($6>max) max=$6} END {print max}' yourfile.txt
``` |
8,604,499 | I am using AQGridView in my project. we need to create a black colored border around each image. Can anyone help me on this.
Thanks in advance.
Regards,
Jas. | 2011/12/22 | [
"https://Stackoverflow.com/questions/8604499",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978091/"
] | ```
awk 'BEGIN {max = 0} {if ($6>max) max=$6} END {print max}' yourfile.txt
``` | Use the `BEGIN` and `END` blocks to initialize and print variables that keep track of the min and max.
e.g.,
```
awk 'BEGIN{max=0;min=512} { if (max < $1){ max = $1 }; if(min > $1){ min = $1 } } END{ print max, min}'
``` |
8,604,499 | I am using AQGridView in my project. we need to create a black colored border around each image. Can anyone help me on this.
Thanks in advance.
Regards,
Jas. | 2011/12/22 | [
"https://Stackoverflow.com/questions/8604499",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978091/"
] | If your file contains empty lines, neither of the posted solutions will work.
For correct handling of empty lines try this:
```
$ cat f.awk
BEGIN{getline;min=max=$6}
NF{
max=(max>$6)?max:$6
min=(min>$6)?$6:min
}
END{print min,max}
```
Then run this command:
```
sed "/^#/d" my_file | awk -f f.awk
```
At f... | The min can be found by:
```
awk 'BEGIN {min=1000000; max=0;}; { if($2<min && $2 != "") min = $2; if($2>max && $2 != "") max = $2; } END {print min, max}' file
```
This will output the minimum and maximum, comma-separated |
8,604,499 | I am using AQGridView in my project. we need to create a black colored border around each image. Can anyone help me on this.
Thanks in advance.
Regards,
Jas. | 2011/12/22 | [
"https://Stackoverflow.com/questions/8604499",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978091/"
] | If your file contains empty lines, neither of the posted solutions will work.
For correct handling of empty lines try this:
```
$ cat f.awk
BEGIN{getline;min=max=$6}
NF{
max=(max>$6)?max:$6
min=(min>$6)?$6:min
}
END{print min,max}
```
Then run this command:
```
sed "/^#/d" my_file | awk -f f.awk
```
At f... | ```
awk 'BEGIN{first=1;}
{if (first) { max = min = $2; first = 0; next;}
if (max < $2) max=$2; if (min > $2) min=$2; }
END { print min, max }' file
``` |
8,604,499 | I am using AQGridView in my project. we need to create a black colored border around each image. Can anyone help me on this.
Thanks in advance.
Regards,
Jas. | 2011/12/22 | [
"https://Stackoverflow.com/questions/8604499",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978091/"
] | You can create two user defined functions and use them as per your need. This will offer more generic solution.
```
[jaypal:~/Temp] cat file
a 212
b 323
c 23
d 45
e 54
f 102
[jaypal:~/Temp] awk '
function max(x){i=0;for(val in x){if(i<=x[val]){i=x[val];}}return i;}
function min(x){i=max(x);for(val in x){if(i>x[... | ```
awk 'BEGIN {max = 0} {if ($6>max) max=$6} END {print max}' yourfile.txt
``` |
8,604,499 | I am using AQGridView in my project. we need to create a black colored border around each image. Can anyone help me on this.
Thanks in advance.
Regards,
Jas. | 2011/12/22 | [
"https://Stackoverflow.com/questions/8604499",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978091/"
] | You can create two user defined functions and use them as per your need. This will offer more generic solution.
```
[jaypal:~/Temp] cat file
a 212
b 323
c 23
d 45
e 54
f 102
[jaypal:~/Temp] awk '
function max(x){i=0;for(val in x){if(i<=x[val]){i=x[val];}}return i;}
function min(x){i=max(x);for(val in x){if(i>x[... | Use the `BEGIN` and `END` blocks to initialize and print variables that keep track of the min and max.
e.g.,
```
awk 'BEGIN{max=0;min=512} { if (max < $1){ max = $1 }; if(min > $1){ min = $1 } } END{ print max, min}'
``` |
8,604,499 | I am using AQGridView in my project. we need to create a black colored border around each image. Can anyone help me on this.
Thanks in advance.
Regards,
Jas. | 2011/12/22 | [
"https://Stackoverflow.com/questions/8604499",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978091/"
] | ```
awk 'BEGIN {max = 0} {if ($6>max) max=$6} END {print max}' yourfile.txt
``` | ```
awk 'BEGIN{first=1;}
{if (first) { max = min = $2; first = 0; next;}
if (max < $2) max=$2; if (min > $2) min=$2; }
END { print min, max }' file
``` |
8,604,499 | I am using AQGridView in my project. we need to create a black colored border around each image. Can anyone help me on this.
Thanks in advance.
Regards,
Jas. | 2011/12/22 | [
"https://Stackoverflow.com/questions/8604499",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978091/"
] | You can create two user defined functions and use them as per your need. This will offer more generic solution.
```
[jaypal:~/Temp] cat file
a 212
b 323
c 23
d 45
e 54
f 102
[jaypal:~/Temp] awk '
function max(x){i=0;for(val in x){if(i<=x[val]){i=x[val];}}return i;}
function min(x){i=max(x);for(val in x){if(i>x[... | If your file contains empty lines, neither of the posted solutions will work.
For correct handling of empty lines try this:
```
$ cat f.awk
BEGIN{getline;min=max=$6}
NF{
max=(max>$6)?max:$6
min=(min>$6)?$6:min
}
END{print min,max}
```
Then run this command:
```
sed "/^#/d" my_file | awk -f f.awk
```
At f... |
8,604,499 | I am using AQGridView in my project. we need to create a black colored border around each image. Can anyone help me on this.
Thanks in advance.
Regards,
Jas. | 2011/12/22 | [
"https://Stackoverflow.com/questions/8604499",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978091/"
] | ```
awk 'BEGIN {max = 0} {if ($6>max) max=$6} END {print max}' yourfile.txt
``` | The min can be found by:
```
awk 'BEGIN {min=1000000; max=0;}; { if($2<min && $2 != "") min = $2; if($2>max && $2 != "") max = $2; } END {print min, max}' file
```
This will output the minimum and maximum, comma-separated |
8,604,499 | I am using AQGridView in my project. we need to create a black colored border around each image. Can anyone help me on this.
Thanks in advance.
Regards,
Jas. | 2011/12/22 | [
"https://Stackoverflow.com/questions/8604499",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978091/"
] | You can create two user defined functions and use them as per your need. This will offer more generic solution.
```
[jaypal:~/Temp] cat file
a 212
b 323
c 23
d 45
e 54
f 102
[jaypal:~/Temp] awk '
function max(x){i=0;for(val in x){if(i<=x[val]){i=x[val];}}return i;}
function min(x){i=max(x);for(val in x){if(i>x[... | The min can be found by:
```
awk 'BEGIN {min=1000000; max=0;}; { if($2<min && $2 != "") min = $2; if($2>max && $2 != "") max = $2; } END {print min, max}' file
```
This will output the minimum and maximum, comma-separated |
3,927 | I've been wanting to post on this for some time, but don't want to post something just to have it shut down as a duplicate because it talks about disabilities and someone else has already posted about disabilities.
Autism Spectrum has some fairly unique problems specific to the workplace that other disabilities do not... | 2016/09/21 | [
"https://workplace.meta.stackexchange.com/questions/3927",
"https://workplace.meta.stackexchange.com",
"https://workplace.meta.stackexchange.com/users/46894/"
] | I deal with aspbergers as well so please do not think that I am dismissing your needs or concerns.
SE is designed around providing answers to questions that will potentially help many people. So when asking any question it is important to make sure that your question is as broadly applicable as possible. If your quest... | Handling disabilities on workplace is a real matter nowadays, they're laws to enforce that they're provided an adequate environment to work and to not get discriminated. So I can't see why this won't be on-topic as long as it is related to problems that affect the workplace.
However I guess that in some specific issue... |
3,927 | I've been wanting to post on this for some time, but don't want to post something just to have it shut down as a duplicate because it talks about disabilities and someone else has already posted about disabilities.
Autism Spectrum has some fairly unique problems specific to the workplace that other disabilities do not... | 2016/09/21 | [
"https://workplace.meta.stackexchange.com/questions/3927",
"https://workplace.meta.stackexchange.com",
"https://workplace.meta.stackexchange.com/users/46894/"
] | Just post the question(s), either we can deal with them or we can't. But there's a host of keen, intelligent and observant people here with a lot of experience in all sorts of things, I reckon someone will be able to answer you.
Just not me, because I never even heard of it before coming here except some maths wizard ... | Handling disabilities on workplace is a real matter nowadays, they're laws to enforce that they're provided an adequate environment to work and to not get discriminated. So I can't see why this won't be on-topic as long as it is related to problems that affect the workplace.
However I guess that in some specific issue... |
3,927 | I've been wanting to post on this for some time, but don't want to post something just to have it shut down as a duplicate because it talks about disabilities and someone else has already posted about disabilities.
Autism Spectrum has some fairly unique problems specific to the workplace that other disabilities do not... | 2016/09/21 | [
"https://workplace.meta.stackexchange.com/questions/3927",
"https://workplace.meta.stackexchange.com",
"https://workplace.meta.stackexchange.com/users/46894/"
] | I deal with aspbergers as well so please do not think that I am dismissing your needs or concerns.
SE is designed around providing answers to questions that will potentially help many people. So when asking any question it is important to make sure that your question is as broadly applicable as possible. If your quest... | Just post the question(s), either we can deal with them or we can't. But there's a host of keen, intelligent and observant people here with a lot of experience in all sorts of things, I reckon someone will be able to answer you.
Just not me, because I never even heard of it before coming here except some maths wizard ... |
16,443,223 | I am working n getting the source code of remote page the url of that remote page it got dynamically from the url the user click according to the arrays `array('event_id', 'tv_id', 'tid', 'channel')` : i use the code below to get the who;e page source and it works great.
```
<?php
$keys = array('event_id', 'tv_id', 't... | 2013/05/08 | [
"https://Stackoverflow.com/questions/16443223",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2362208/"
] | The dump from ncdump -k gives the netcdf file format as netCDF-4. I was able to open the file with the `ncdf4` package since ncdf does not seem to be backwards compatible with version 4 files:
>
> "However, the ncdf package does not provide an interface for netcdf
> version 4 files."
>
>
>
from the `ncdf4` docu... | I think that the harvest maize netcdf file is simply corrupt, or not even a netcdf file (file name does not say anything about the real contents). Try and open it in [NCView](http://meteora.ucsd.edu/~pierce/ncview_home_page.html) or dump using [ncdump](https://www.unidata.ucar.edu/software/netcdf/docs/ncdump-man-1.html... |
33,644,839 | I am having an issue in Visual Studio 2015 (VB.Net) where the Navigation Bar is not showing.
I have set the settings in Tools > Options > Text Editor > All Languages and set the "Navigation Bar" setting to checked.
The bar will show up for a second and then disappear.
I have tried it in Safe Mode and still the same.... | 2015/11/11 | [
"https://Stackoverflow.com/questions/33644839",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5549372/"
] | Try this: **uncheck** the checkbox in tools\options\text editor\all languages\general\navigation bar and click OK. This is unintuitive, but then--come back to the same checkbox, which should now be Unchecked, check it, and click OK. This has worked for me. Why the navigation bar disappears randomly is a mystery. | Try Clicking on the Build Menu > Clean Solution
then click Build Menu > Rebuild Solution |
33,644,839 | I am having an issue in Visual Studio 2015 (VB.Net) where the Navigation Bar is not showing.
I have set the settings in Tools > Options > Text Editor > All Languages and set the "Navigation Bar" setting to checked.
The bar will show up for a second and then disappear.
I have tried it in Safe Mode and still the same.... | 2015/11/11 | [
"https://Stackoverflow.com/questions/33644839",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5549372/"
] | Try this: **uncheck** the checkbox in tools\options\text editor\all languages\general\navigation bar and click OK. This is unintuitive, but then--come back to the same checkbox, which should now be Unchecked, check it, and click OK. This has worked for me. Why the navigation bar disappears randomly is a mystery. | for me such issue happens in the scenario that in one file the navigation bar disappeared but in other files it is still there. my solution is:
1) find the project that the missing navigation bar file located;
2) unload the project(in solution explorer->right click project name->in popup dialog, select unload project).... |
30,350,208 | My models
CAR BRANDS MODEL
```
class CarBrand < ActiveRecord::Base
has_many :car_ads
end
```
CAR ADVERTISEMENTS MODEL
```
class CarAd < ActiveRecord::Base
has_one :car_brand
end
```
my controller:
```
def index
@car_ads = CarAd.all.order("car_ads.created_at DESC")
end
```
car ads mig... | 2015/05/20 | [
"https://Stackoverflow.com/questions/30350208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4666863/"
] | Put `ng-cloak` at your controller definition (or wherever you don't want to see the template rendering... specs recommend placing it in small portions of the page):
```
<div ng-controller="MyCtrl" ng-cloak>
```
<https://docs.angularjs.org/api/ng/directive/ngCloak> | You can also try to work with `ng-bind` instead of `{{}}` in your view. It is always possible, even in your code :
```
<select ng-model="invoice.inCurrency">
<option ng-repeat="c in invoice.currencies" ng-bind="c"></option>
</select>
```
Please refer to [this topic](https://stackoverflow.com/questions/16125872/... |
58,452,256 | I recently update my spring boot app 2.1.9 to 2.2.0 and i'm facing a problem. When i'm calling "configprops" from actuator endpoint, an exception is throw :
Scope 'job' is not active for the current thread
I reproduce the bug : <https://github.com/guillaumeyan/bugspringbatch> (just launch the test). Original project c... | 2019/10/18 | [
"https://Stackoverflow.com/questions/58452256",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2178038/"
] | I downloaded your project and was able to reproduce the case. There are two issues with your example:
* You are defining a job scoped bean in your app but the `JobScope` is not defined in your context (and you are not using `@EnableBatchProcessing` annotation that adds it automatically to the context). If you want to ... | Bug resolve in spring boot 2.2.1 <https://github.com/spring-projects/spring-boot/issues/18714> |
11,378,982 | I want to execute a SELECT query but I don't how many columns to select.
Like:
```
select name, family from persons;
```
How can I know which columns to select?
"I am currently designing a site for the execute query by users.
So when the user executes this query, I won't know which columns selected.
But when I wan... | 2012/07/07 | [
"https://Stackoverflow.com/questions/11378982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1105438/"
] | First, understand exactly what data you want to retrieve. Then look at the database schema to find out which tables the database contains, and which columns the tables contain.
The following query returns a result set of every column of every table in the database:
```
SELECT table_name, column_name
FROM INFORMATION_... | Use `mysql_query()` and execute this query:
```
SHOW COLUMNS FROM table
```
Example:
```
<?php
$result = mysql_query("SHOW COLUMNS FROM sometable");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_assoc($result)) {
p... |
11,378,982 | I want to execute a SELECT query but I don't how many columns to select.
Like:
```
select name, family from persons;
```
How can I know which columns to select?
"I am currently designing a site for the execute query by users.
So when the user executes this query, I won't know which columns selected.
But when I wan... | 2012/07/07 | [
"https://Stackoverflow.com/questions/11378982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1105438/"
] | For unknown query fields, you can just use this code.
It gives you every row fields name=>data. You can even change the key to `''` to get ordered array columns by num following the columns' order in the database.
```
$data = array();
while($row = mysql_fetch_assoc($query))
{
foreach($row as $key => $value) {
... | Use `mysql_query()` and execute this query:
```
SHOW COLUMNS FROM table
```
Example:
```
<?php
$result = mysql_query("SHOW COLUMNS FROM sometable");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_assoc($result)) {
p... |
11,378,982 | I want to execute a SELECT query but I don't how many columns to select.
Like:
```
select name, family from persons;
```
How can I know which columns to select?
"I am currently designing a site for the execute query by users.
So when the user executes this query, I won't know which columns selected.
But when I wan... | 2012/07/07 | [
"https://Stackoverflow.com/questions/11378982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1105438/"
] | If I understand what you are asking, you probably want to use MySQLIi and the the fetch\_fields method on the result set:
<http://us3.php.net/manual/en/mysqli-result.fetch-fields.php>
See the examples on that page. | use `DESC table` or
**Example**
```
SELECT GROUP_CONCAT(column_name) FROM information_schema.columns WHERE table_name='your_table';
```
**output**
```
column1,column2,column3
``` |
11,378,982 | I want to execute a SELECT query but I don't how many columns to select.
Like:
```
select name, family from persons;
```
How can I know which columns to select?
"I am currently designing a site for the execute query by users.
So when the user executes this query, I won't know which columns selected.
But when I wan... | 2012/07/07 | [
"https://Stackoverflow.com/questions/11378982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1105438/"
] | For unknown query fields, you can just use this code.
It gives you every row fields name=>data. You can even change the key to `''` to get ordered array columns by num following the columns' order in the database.
```
$data = array();
while($row = mysql_fetch_assoc($query))
{
foreach($row as $key => $value) {
... | First, understand exactly what data you want to retrieve. Then look at the database schema to find out which tables the database contains, and which columns the tables contain.
The following query returns a result set of every column of every table in the database:
```
SELECT table_name, column_name
FROM INFORMATION_... |
11,378,982 | I want to execute a SELECT query but I don't how many columns to select.
Like:
```
select name, family from persons;
```
How can I know which columns to select?
"I am currently designing a site for the execute query by users.
So when the user executes this query, I won't know which columns selected.
But when I wan... | 2012/07/07 | [
"https://Stackoverflow.com/questions/11378982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1105438/"
] | For unknown query fields, you can just use this code.
It gives you every row fields name=>data. You can even change the key to `''` to get ordered array columns by num following the columns' order in the database.
```
$data = array();
while($row = mysql_fetch_assoc($query))
{
foreach($row as $key => $value) {
... | If I understand what you are asking, you probably want to use MySQLIi and the the fetch\_fields method on the result set:
<http://us3.php.net/manual/en/mysqli-result.fetch-fields.php>
See the examples on that page. |
11,378,982 | I want to execute a SELECT query but I don't how many columns to select.
Like:
```
select name, family from persons;
```
How can I know which columns to select?
"I am currently designing a site for the execute query by users.
So when the user executes this query, I won't know which columns selected.
But when I wan... | 2012/07/07 | [
"https://Stackoverflow.com/questions/11378982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1105438/"
] | If you want to get column names for any query in all cases it's not so easy.
In case at least one row is returned you can get columns directly from this row.
But when you want to get column names when there is no result to display table/export to CSV, you need to use PDO functions that are not 100% reliable.
```
/... | use `DESC table` or
**Example**
```
SELECT GROUP_CONCAT(column_name) FROM information_schema.columns WHERE table_name='your_table';
```
**output**
```
column1,column2,column3
``` |
11,378,982 | I want to execute a SELECT query but I don't how many columns to select.
Like:
```
select name, family from persons;
```
How can I know which columns to select?
"I am currently designing a site for the execute query by users.
So when the user executes this query, I won't know which columns selected.
But when I wan... | 2012/07/07 | [
"https://Stackoverflow.com/questions/11378982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1105438/"
] | If I understand what you are asking, you probably want to use MySQLIi and the the fetch\_fields method on the result set:
<http://us3.php.net/manual/en/mysqli-result.fetch-fields.php>
See the examples on that page. | Use `mysql_query()` and execute this query:
```
SHOW COLUMNS FROM table
```
Example:
```
<?php
$result = mysql_query("SHOW COLUMNS FROM sometable");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_assoc($result)) {
p... |
11,378,982 | I want to execute a SELECT query but I don't how many columns to select.
Like:
```
select name, family from persons;
```
How can I know which columns to select?
"I am currently designing a site for the execute query by users.
So when the user executes this query, I won't know which columns selected.
But when I wan... | 2012/07/07 | [
"https://Stackoverflow.com/questions/11378982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1105438/"
] | For unknown query fields, you can just use this code.
It gives you every row fields name=>data. You can even change the key to `''` to get ordered array columns by num following the columns' order in the database.
```
$data = array();
while($row = mysql_fetch_assoc($query))
{
foreach($row as $key => $value) {
... | use `DESC table` or
**Example**
```
SELECT GROUP_CONCAT(column_name) FROM information_schema.columns WHERE table_name='your_table';
```
**output**
```
column1,column2,column3
``` |
11,378,982 | I want to execute a SELECT query but I don't how many columns to select.
Like:
```
select name, family from persons;
```
How can I know which columns to select?
"I am currently designing a site for the execute query by users.
So when the user executes this query, I won't know which columns selected.
But when I wan... | 2012/07/07 | [
"https://Stackoverflow.com/questions/11378982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1105438/"
] | First, understand exactly what data you want to retrieve. Then look at the database schema to find out which tables the database contains, and which columns the tables contain.
The following query returns a result set of every column of every table in the database:
```
SELECT table_name, column_name
FROM INFORMATION_... | use `DESC table` or
**Example**
```
SELECT GROUP_CONCAT(column_name) FROM information_schema.columns WHERE table_name='your_table';
```
**output**
```
column1,column2,column3
``` |
11,378,982 | I want to execute a SELECT query but I don't how many columns to select.
Like:
```
select name, family from persons;
```
How can I know which columns to select?
"I am currently designing a site for the execute query by users.
So when the user executes this query, I won't know which columns selected.
But when I wan... | 2012/07/07 | [
"https://Stackoverflow.com/questions/11378982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1105438/"
] | If you want to get column names for any query in all cases it's not so easy.
In case at least one row is returned you can get columns directly from this row.
But when you want to get column names when there is no result to display table/export to CSV, you need to use PDO functions that are not 100% reliable.
```
/... | Use `mysql_query()` and execute this query:
```
SHOW COLUMNS FROM table
```
Example:
```
<?php
$result = mysql_query("SHOW COLUMNS FROM sometable");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_assoc($result)) {
p... |
10,694,139 | I have a question about Maven, the maven-release-plugin, git integration, pom.xml's, and having pom.xml's in subdirectories of the repo's local copy rather than in the root.
Here's the setup:
* I have a github account with a limited number of private repositories
* I want to (am just learning to) use Maven to organiz... | 2012/05/21 | [
"https://Stackoverflow.com/questions/10694139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1409003/"
] | You can do it in the same way you normally [tell Maven to run from a POM that's somewhere else](http://www.sonatype.com/books/mvnref-book/reference/running-sect-options.html#running-sect-custom-locations-option): the `-f` option. `mvn --help` describes it thusly:
```
-f,--file <arg> Force the use of an alternate PO... | The first thing is to understand git which has it's convention that every project has it's own repository. The next thing is that Maven has it's conventions and putting the pom.xml into the root of it's project is the most obvious one. Furthermore you are trying to fight against Maven and i will predict that you will l... |
10,694,139 | I have a question about Maven, the maven-release-plugin, git integration, pom.xml's, and having pom.xml's in subdirectories of the repo's local copy rather than in the root.
Here's the setup:
* I have a github account with a limited number of private repositories
* I want to (am just learning to) use Maven to organiz... | 2012/05/21 | [
"https://Stackoverflow.com/questions/10694139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1409003/"
] | This should do the trick:
```
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.3.2</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>perform</goal>
</goals>
... | You can do it in the same way you normally [tell Maven to run from a POM that's somewhere else](http://www.sonatype.com/books/mvnref-book/reference/running-sect-options.html#running-sect-custom-locations-option): the `-f` option. `mvn --help` describes it thusly:
```
-f,--file <arg> Force the use of an alternate PO... |
10,694,139 | I have a question about Maven, the maven-release-plugin, git integration, pom.xml's, and having pom.xml's in subdirectories of the repo's local copy rather than in the root.
Here's the setup:
* I have a github account with a limited number of private repositories
* I want to (am just learning to) use Maven to organiz... | 2012/05/21 | [
"https://Stackoverflow.com/questions/10694139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1409003/"
] | You can do it in the same way you normally [tell Maven to run from a POM that's somewhere else](http://www.sonatype.com/books/mvnref-book/reference/running-sect-options.html#running-sect-custom-locations-option): the `-f` option. `mvn --help` describes it thusly:
```
-f,--file <arg> Force the use of an alternate PO... | This question was asked over 10 years ago so I wanted to provide a more up-to-date answer.
As of Oct 2022, the current/modern Maven works without any problems in a sub-directory. The current version of the maven plugin release is [version: 3.0.0-M6](https://maven.apache.org/maven-release/maven-release-plugin/index.htm... |
10,694,139 | I have a question about Maven, the maven-release-plugin, git integration, pom.xml's, and having pom.xml's in subdirectories of the repo's local copy rather than in the root.
Here's the setup:
* I have a github account with a limited number of private repositories
* I want to (am just learning to) use Maven to organiz... | 2012/05/21 | [
"https://Stackoverflow.com/questions/10694139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1409003/"
] | This should do the trick:
```
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.3.2</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>perform</goal>
</goals>
... | The first thing is to understand git which has it's convention that every project has it's own repository. The next thing is that Maven has it's conventions and putting the pom.xml into the root of it's project is the most obvious one. Furthermore you are trying to fight against Maven and i will predict that you will l... |
10,694,139 | I have a question about Maven, the maven-release-plugin, git integration, pom.xml's, and having pom.xml's in subdirectories of the repo's local copy rather than in the root.
Here's the setup:
* I have a github account with a limited number of private repositories
* I want to (am just learning to) use Maven to organiz... | 2012/05/21 | [
"https://Stackoverflow.com/questions/10694139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1409003/"
] | This question was asked over 10 years ago so I wanted to provide a more up-to-date answer.
As of Oct 2022, the current/modern Maven works without any problems in a sub-directory. The current version of the maven plugin release is [version: 3.0.0-M6](https://maven.apache.org/maven-release/maven-release-plugin/index.htm... | The first thing is to understand git which has it's convention that every project has it's own repository. The next thing is that Maven has it's conventions and putting the pom.xml into the root of it's project is the most obvious one. Furthermore you are trying to fight against Maven and i will predict that you will l... |
10,694,139 | I have a question about Maven, the maven-release-plugin, git integration, pom.xml's, and having pom.xml's in subdirectories of the repo's local copy rather than in the root.
Here's the setup:
* I have a github account with a limited number of private repositories
* I want to (am just learning to) use Maven to organiz... | 2012/05/21 | [
"https://Stackoverflow.com/questions/10694139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1409003/"
] | This should do the trick:
```
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.3.2</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>perform</goal>
</goals>
... | This question was asked over 10 years ago so I wanted to provide a more up-to-date answer.
As of Oct 2022, the current/modern Maven works without any problems in a sub-directory. The current version of the maven plugin release is [version: 3.0.0-M6](https://maven.apache.org/maven-release/maven-release-plugin/index.htm... |
56,833,298 | I have multiple buttons (with the ids 'a', 'b', ...) and if you click them, they should display their corresponding image ('a.JPG', 'b.JPG', ...) at a fixed point on the website.
The idea is to listen for when a button is clicked and change the code inside the output to include its id.
```
'use strict';
var bild = ''... | 2019/07/01 | [
"https://Stackoverflow.com/questions/56833298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11723122/"
] | This code should change the src on each button click, changing the picture according the the ID of the button:
```js
let img = document.getElementById('img')
const change = id => {
img.src = `${id}.jpeg`
img.alt = `${id}.jpeg`
}
```
```html
<img id="img" src="">
<br>
<button onclick="change(this.id)" id="a"... | Get all the buttons and attach an `click` listener to it. Create `img` element on `button` click and append it to the element with `id` output.
```js
const buttons = document.querySelectorAll('button')
const output = document.querySelector('#output');
buttons.forEach((button) => {
button.addEventListener('click'... |
56,584,966 | i have a dataframe as below.
```
test = pd.DataFrame({'col1':[0,0,1,0,0,0,1,2,0], 'col2': [0,0,1,2,3,0,0,0,0]})
col1 col2
0 0 0
1 0 0
2 1 1
3 0 2
4 0 3
5 0 0
6 1 0
7 2 0
8 0 0
```
For each column, i want to find the index of value 1 before t... | 2019/06/13 | [
"https://Stackoverflow.com/questions/56584966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3862109/"
] | Use [**`Series.mask`**](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.mask.html) to hide elements that aren't 1, then apply [**`Series.last_valid_index`**](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.last_valid_index.html) to each column.
```
m = test.eq(test.max... | Using @cs95 idea of `last_valid_index`:
```
test.apply(lambda x: x[:x.idxmax()].eq(1)[lambda i:i].last_valid_index())
```
Output:
```
col1 6
col2 2
dtype: int64
```
Expained:
Using index slicing to cut each column to start to max value, then look for the values that are equal to one and find the index of t... |
56,584,966 | i have a dataframe as below.
```
test = pd.DataFrame({'col1':[0,0,1,0,0,0,1,2,0], 'col2': [0,0,1,2,3,0,0,0,0]})
col1 col2
0 0 0
1 0 0
2 1 1
3 0 2
4 0 3
5 0 0
6 1 0
7 2 0
8 0 0
```
For each column, i want to find the index of value 1 before t... | 2019/06/13 | [
"https://Stackoverflow.com/questions/56584966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3862109/"
] | Use [**`Series.mask`**](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.mask.html) to hide elements that aren't 1, then apply [**`Series.last_valid_index`**](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.last_valid_index.html) to each column.
```
m = test.eq(test.max... | Here's a mixed `numpy` and `pandas` solution:
```
(test.eq(1) & (test.index.values[:,None] < test.idxmax().values)).cumsum().idxmax()
```
which is a bit faster than the other solutions. |
56,584,966 | i have a dataframe as below.
```
test = pd.DataFrame({'col1':[0,0,1,0,0,0,1,2,0], 'col2': [0,0,1,2,3,0,0,0,0]})
col1 col2
0 0 0
1 0 0
2 1 1
3 0 2
4 0 3
5 0 0
6 1 0
7 2 0
8 0 0
```
For each column, i want to find the index of value 1 before t... | 2019/06/13 | [
"https://Stackoverflow.com/questions/56584966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3862109/"
] | Use [**`Series.mask`**](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.mask.html) to hide elements that aren't 1, then apply [**`Series.last_valid_index`**](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.last_valid_index.html) to each column.
```
m = test.eq(test.max... | I would use `dropna` with `where` to drop duplicated `1` keeping the last `1`, and call `idxmin` on it.
```
test.apply(lambda x: x.where(x[:x.idxmax()].eq(1)).drop_duplicates(keep='last').idxmin())
Out[1433]:
col1 6
col2 2
dtype: int64
``` |
56,584,966 | i have a dataframe as below.
```
test = pd.DataFrame({'col1':[0,0,1,0,0,0,1,2,0], 'col2': [0,0,1,2,3,0,0,0,0]})
col1 col2
0 0 0
1 0 0
2 1 1
3 0 2
4 0 3
5 0 0
6 1 0
7 2 0
8 0 0
```
For each column, i want to find the index of value 1 before t... | 2019/06/13 | [
"https://Stackoverflow.com/questions/56584966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3862109/"
] | Use [**`Series.mask`**](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.mask.html) to hide elements that aren't 1, then apply [**`Series.last_valid_index`**](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.last_valid_index.html) to each column.
```
m = test.eq(test.max... | ### Overkill with Numpy
```
t = test.to_numpy()
a = t.argmax(0)
i, j = np.where(t == 1)
mask = i <= a[j]
i = i[mask]
j = j[mask]
b = np.empty_like(a)
b.fill(-1)
np.maximum.at(b, j, i)
pd.Series(b, test.columns)
col1 6
col2 2
dtype: int64
```
---
### `apply`
```
test.apply(lambda s: max(s.index, key=lamb... |
56,584,966 | i have a dataframe as below.
```
test = pd.DataFrame({'col1':[0,0,1,0,0,0,1,2,0], 'col2': [0,0,1,2,3,0,0,0,0]})
col1 col2
0 0 0
1 0 0
2 1 1
3 0 2
4 0 3
5 0 0
6 1 0
7 2 0
8 0 0
```
For each column, i want to find the index of value 1 before t... | 2019/06/13 | [
"https://Stackoverflow.com/questions/56584966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3862109/"
] | Use [**`Series.mask`**](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.mask.html) to hide elements that aren't 1, then apply [**`Series.last_valid_index`**](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.last_valid_index.html) to each column.
```
m = test.eq(test.max... | A little bit logic here
```
(df.iloc[::-1].cummax().eq(df.max())&df.eq(1).iloc[::-1]).idxmax()
Out[187]:
col1 6
col2 2
dtype: int64
``` |
56,584,966 | i have a dataframe as below.
```
test = pd.DataFrame({'col1':[0,0,1,0,0,0,1,2,0], 'col2': [0,0,1,2,3,0,0,0,0]})
col1 col2
0 0 0
1 0 0
2 1 1
3 0 2
4 0 3
5 0 0
6 1 0
7 2 0
8 0 0
```
For each column, i want to find the index of value 1 before t... | 2019/06/13 | [
"https://Stackoverflow.com/questions/56584966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3862109/"
] | Using @cs95 idea of `last_valid_index`:
```
test.apply(lambda x: x[:x.idxmax()].eq(1)[lambda i:i].last_valid_index())
```
Output:
```
col1 6
col2 2
dtype: int64
```
Expained:
Using index slicing to cut each column to start to max value, then look for the values that are equal to one and find the index of t... | I would use `dropna` with `where` to drop duplicated `1` keeping the last `1`, and call `idxmin` on it.
```
test.apply(lambda x: x.where(x[:x.idxmax()].eq(1)).drop_duplicates(keep='last').idxmin())
Out[1433]:
col1 6
col2 2
dtype: int64
``` |
56,584,966 | i have a dataframe as below.
```
test = pd.DataFrame({'col1':[0,0,1,0,0,0,1,2,0], 'col2': [0,0,1,2,3,0,0,0,0]})
col1 col2
0 0 0
1 0 0
2 1 1
3 0 2
4 0 3
5 0 0
6 1 0
7 2 0
8 0 0
```
For each column, i want to find the index of value 1 before t... | 2019/06/13 | [
"https://Stackoverflow.com/questions/56584966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3862109/"
] | Here's a mixed `numpy` and `pandas` solution:
```
(test.eq(1) & (test.index.values[:,None] < test.idxmax().values)).cumsum().idxmax()
```
which is a bit faster than the other solutions. | I would use `dropna` with `where` to drop duplicated `1` keeping the last `1`, and call `idxmin` on it.
```
test.apply(lambda x: x.where(x[:x.idxmax()].eq(1)).drop_duplicates(keep='last').idxmin())
Out[1433]:
col1 6
col2 2
dtype: int64
``` |
56,584,966 | i have a dataframe as below.
```
test = pd.DataFrame({'col1':[0,0,1,0,0,0,1,2,0], 'col2': [0,0,1,2,3,0,0,0,0]})
col1 col2
0 0 0
1 0 0
2 1 1
3 0 2
4 0 3
5 0 0
6 1 0
7 2 0
8 0 0
```
For each column, i want to find the index of value 1 before t... | 2019/06/13 | [
"https://Stackoverflow.com/questions/56584966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3862109/"
] | ### Overkill with Numpy
```
t = test.to_numpy()
a = t.argmax(0)
i, j = np.where(t == 1)
mask = i <= a[j]
i = i[mask]
j = j[mask]
b = np.empty_like(a)
b.fill(-1)
np.maximum.at(b, j, i)
pd.Series(b, test.columns)
col1 6
col2 2
dtype: int64
```
---
### `apply`
```
test.apply(lambda s: max(s.index, key=lamb... | I would use `dropna` with `where` to drop duplicated `1` keeping the last `1`, and call `idxmin` on it.
```
test.apply(lambda x: x.where(x[:x.idxmax()].eq(1)).drop_duplicates(keep='last').idxmin())
Out[1433]:
col1 6
col2 2
dtype: int64
``` |
56,584,966 | i have a dataframe as below.
```
test = pd.DataFrame({'col1':[0,0,1,0,0,0,1,2,0], 'col2': [0,0,1,2,3,0,0,0,0]})
col1 col2
0 0 0
1 0 0
2 1 1
3 0 2
4 0 3
5 0 0
6 1 0
7 2 0
8 0 0
```
For each column, i want to find the index of value 1 before t... | 2019/06/13 | [
"https://Stackoverflow.com/questions/56584966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3862109/"
] | A little bit logic here
```
(df.iloc[::-1].cummax().eq(df.max())&df.eq(1).iloc[::-1]).idxmax()
Out[187]:
col1 6
col2 2
dtype: int64
``` | I would use `dropna` with `where` to drop duplicated `1` keeping the last `1`, and call `idxmin` on it.
```
test.apply(lambda x: x.where(x[:x.idxmax()].eq(1)).drop_duplicates(keep='last').idxmin())
Out[1433]:
col1 6
col2 2
dtype: int64
``` |
39,897,670 | I have a service in an Angular 2 using TypeScript. I want to be able to share an array of values that I get from that service. when one component makes a change to the array I need it to be reflected in another component.
This is the basics of my service and the object it uses
```
export class deviceObj {
device_I... | 2016/10/06 | [
"https://Stackoverflow.com/questions/39897670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1710501/"
] | While it can probably be done with Promises, I can answer in the form of Observables at the very least, if you're of a mind to read about them...
Given `ComponentA` and `ComponentB` both looking at a `SharedService` for their source of `SomeObject[]` data:
The service:
```
import { Injectable } from '@angular/core';... | In your component
```
//set favorites
getFavorites(): void{
this.favoriteService
.getFavorites()
.then(favorites => this.favoriteService.favorites = favorites);
}
// get favorite
this.favorites = this.favoriteService.favorites;//access it from service
``` |
39,897,670 | I have a service in an Angular 2 using TypeScript. I want to be able to share an array of values that I get from that service. when one component makes a change to the array I need it to be reflected in another component.
This is the basics of my service and the object it uses
```
export class deviceObj {
device_I... | 2016/10/06 | [
"https://Stackoverflow.com/questions/39897670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1710501/"
] | @Krenom's answer was corrrect. with one import needing to be changed on my setup.
I needed `import { Observable, Observer } from 'rxjs/Rx';import { Observable, Observer } from 'rxjs/Rx';` | In your component
```
//set favorites
getFavorites(): void{
this.favoriteService
.getFavorites()
.then(favorites => this.favoriteService.favorites = favorites);
}
// get favorite
this.favorites = this.favoriteService.favorites;//access it from service
``` |
39,897,670 | I have a service in an Angular 2 using TypeScript. I want to be able to share an array of values that I get from that service. when one component makes a change to the array I need it to be reflected in another component.
This is the basics of my service and the object it uses
```
export class deviceObj {
device_I... | 2016/10/06 | [
"https://Stackoverflow.com/questions/39897670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1710501/"
] | While it can probably be done with Promises, I can answer in the form of Observables at the very least, if you're of a mind to read about them...
Given `ComponentA` and `ComponentB` both looking at a `SharedService` for their source of `SomeObject[]` data:
The service:
```
import { Injectable } from '@angular/core';... | @Krenom's answer was corrrect. with one import needing to be changed on my setup.
I needed `import { Observable, Observer } from 'rxjs/Rx';import { Observable, Observer } from 'rxjs/Rx';` |
25,961,140 | I have two table and first named **table1**:
```
ID | Name | Type | isActive | isDeleted |
-----------------------------------------------
1 | item 1 | 4 | 1 | 0 |
2 | item 2 | 2 | 1 | 0 |
3 | item 3 | 1 | 1 | 1 |
4 | item 4 | 1 | 1 ... | 2014/09/21 | [
"https://Stackoverflow.com/questions/25961140",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1720048/"
] | When using `CASE` the syntax is `WHEN "00" =>`, thus no use of `THEN`. The
code is therefore:
```
CASE input24 IS
WHEN "00" =>
output0 <= '1' ;
output1 <= '0' ;
output2 <= '0' ;
output3 <= '0' ;
...
```
If `input24` is `std_logic_vector` you must when the case with a `WHEN OTHERS
=>` to handle the ... | I think the issue is the "then"
```
CASE input24 IS
WHEN "00" =>
output0 <= '1' ;
output1 <= '0' ;
output2 <= '0' ;
output3 <= '0' ;
WHEN "01" =>
output0 <= '0' ;
output1 <= '1' ;
... |
47,591,425 | I am trying to place a button after an already existing button on another website. I'm trying to test it out in Chrome console, but can't figure it out.
```
var buttonPosition = document.getElementById('<button class="button black ">Black</button>');
```
This is the button that I want to place my button behind.
I t... | 2017/12/01 | [
"https://Stackoverflow.com/questions/47591425",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9038538/"
] | That's because the value of your `getElementById()` is not an element's ID name but an element. Try adding an ID on your button then pass its ID name to `getElementById()` as the value, like this:
HTML
```
<button class="button black" id="btn">Your button with an ID</button>
```
Javascript
```
var btn = document.g... | **"document.getElementById"** itself clarify that it want "id" of the element. As per your snippet `var buttonPosition = document.getElementById('<button class="button black ">Black</button>');` I can say that you are missing the "id" but the element itself.
**Solution 1::**
Provide the id to the button and then try ... |
55,940,758 | I have a components.js file that looks like this:
```
import { lookCoordinate } from './tools.js'; // I get: SyntaxError: Unexpected token {
Vue.component('coordform', {
template: `<form id="popup-box" @submit.prevent="process" v-if="visible"><input type="text" autofocus refs="coordinput" v-model="coords"></input><... | 2019/05/01 | [
"https://Stackoverflow.com/questions/55940758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/162414/"
] | You will get this error if trying to load a Javascript file without ES6 support enabled. The parser does not understand the syntax of `import` is as it begins parsing the file.
Check your webpack or vue-cli settings to make sure that you are transpiling the code.
For instance, a browser does not know what `import` m... | Can you please try this without `{}`.
```
import { lookCoordinate } from './tools.js'
```
`{}` is used when you define multiple functions inside tools.js
like,
```
import { lookCoordinate, lookCoordinate2 } from './tools.js'
``` |
55,940,758 | I have a components.js file that looks like this:
```
import { lookCoordinate } from './tools.js'; // I get: SyntaxError: Unexpected token {
Vue.component('coordform', {
template: `<form id="popup-box" @submit.prevent="process" v-if="visible"><input type="text" autofocus refs="coordinput" v-model="coords"></input><... | 2019/05/01 | [
"https://Stackoverflow.com/questions/55940758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/162414/"
] | It is supported if you add script with `type="module"`:
```
<script type="module" src="main.js"></script>
``` | Can you please try this without `{}`.
```
import { lookCoordinate } from './tools.js'
```
`{}` is used when you define multiple functions inside tools.js
like,
```
import { lookCoordinate, lookCoordinate2 } from './tools.js'
``` |
22,750,482 | I am writing a program that converts strings to linked lists, and alters them, in C.
For some reason after I call my reverse function, and then print the list, it will print a new line before printing the reversed list.
for example, say my 'list' contains... a->p->p->l->e->NULL
in main() if i call... `print(list); ... | 2014/03/30 | [
"https://Stackoverflow.com/questions/22750482",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2755244/"
] | [`Proc#curry`](http://ruby-doc.org/core-2.0/Proc.html#method-i-curry)
>
> Returns a curried proc. If the optional arity argument is given, it determines the number of arguments. A *curried* `proc` receives some arguments. If a *sufficient number* of arguments are supplied, it passes the supplied arguments to the orig... | You are using `.map`, it requires a `block` of type `proc`. In your first case `b` returns `16` as `y=2` uses default value `2` for exponent when you are sending single argument using `curry`. `b` returning `16` is not a `proc` `object` and can not be used with `.map`.
`Curry` when used with a proc with `sufficient ar... |
2,509,233 | Part of a complex query that our app is running contains the lines:
...(inner query)
```
SELECT
...
NULL as column_A,
NULL as column_B,
...
FROM
...
```
This syntax of creating columns with **null** values is not allowed in DB2 altough it is totally OK in **MSSQL** and **Oracle** DBs.
Technically I can change it to:... | 2010/03/24 | [
"https://Stackoverflow.com/questions/2509233",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/242389/"
] | DB2 is strongly typed, so you need to tell DB2 what kind of column your NULL is:
```
select
...
cast(NULL as int) as column_A,
cast(NULL as varchar(128)) as column_B,
...
FROM
...
``` | For Db2 LUW, since version 9.7, you can (if you like) use the `NULL` value without explicitly casting it to a particular data type.
`NULL` on it's own will be implicitly cast to `VARCHAR(1)`. This knowledge center page will show what happens in other cases: [Determining data types of untyped expressions](https://www.i... |
12,823 | I've been trying to create a short-cut key for grabbing part of the screen.
If I run the command `/usr/bin/gnome-screenshot --area` the program I want runs and does what I want. When I createa a custom action in the keyboard shortcuts menu, and I activate the command (using ctrl-prnscr) the command fires up but behave... | 2010/11/12 | [
"https://askubuntu.com/questions/12823",
"https://askubuntu.com",
"https://askubuntu.com/users/4863/"
] | It works for me when pressing the shortcut twice (fast).
This seems to have worked at some point but doesn't anymore (see [this thread](http://ubuntuforums.org/showthread.php?t=1199669) at ubuntuforums.org - it doesn't work for me, with or without the '-i' switch).
There's already a bug report opened: <https://bugs.... | An alternative is to use [Shutter](http://shutter-project.org/) and:
1. Set Preferences -> Advanced to start with the selection size and location you want.
2. Set Preferences -> Keyboard to Capture with Selection.
When you press your shortcut key the screen will freeze and the default selection will be made. You can ... |
12,823 | I've been trying to create a short-cut key for grabbing part of the screen.
If I run the command `/usr/bin/gnome-screenshot --area` the program I want runs and does what I want. When I createa a custom action in the keyboard shortcuts menu, and I activate the command (using ctrl-prnscr) the command fires up but behave... | 2010/11/12 | [
"https://askubuntu.com/questions/12823",
"https://askubuntu.com",
"https://askubuntu.com/users/4863/"
] | It works for me when pressing the shortcut twice (fast).
This seems to have worked at some point but doesn't anymore (see [this thread](http://ubuntuforums.org/showthread.php?t=1199669) at ubuntuforums.org - it doesn't work for me, with or without the '-i' switch).
There's already a bug report opened: <https://bugs.... | In 12.04 (at least), the default shortcut is `Shift`+`PrtScr`. |
12,823 | I've been trying to create a short-cut key for grabbing part of the screen.
If I run the command `/usr/bin/gnome-screenshot --area` the program I want runs and does what I want. When I createa a custom action in the keyboard shortcuts menu, and I activate the command (using ctrl-prnscr) the command fires up but behave... | 2010/11/12 | [
"https://askubuntu.com/questions/12823",
"https://askubuntu.com",
"https://askubuntu.com/users/4863/"
] | In 12.04 (at least), the default shortcut is `Shift`+`PrtScr`. | An alternative is to use [Shutter](http://shutter-project.org/) and:
1. Set Preferences -> Advanced to start with the selection size and location you want.
2. Set Preferences -> Keyboard to Capture with Selection.
When you press your shortcut key the screen will freeze and the default selection will be made. You can ... |
10,724,253 | This should be pretty simple, yet it's blowing up. Any ideas?
```
d = BigDecimal.new("2.0")
YAML::load({:a => d}.to_yaml)
TypeError: BigDecimal can't be coerced into BigDecimal
from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/inspector.rb:86:in `inspect'
from /Users/benjohnson/.rvm/rubies/ruby-1.9... | 2012/05/23 | [
"https://Stackoverflow.com/questions/10724253",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/507718/"
] | This is a bug that has been [reported](https://github.com/tenderlove/psych/issues/31) and [fixed](https://github.com/tenderlove/psych/commit/33ce8650bac29190dde937b1b7d3e21fd06926e7).
The best solution would be upgrade to the latest Ruby (the fix is in patch level 194 onwards).
If you can’t upgrade your Ruby version,... | Yeah, I ran into that once. Here's a version of what I did:
[YAML & BigDecimal workaround](http://blog.induktiv.at/archives/6-YAML-and-BigDecimal-a-temporary-solution.html) |
10,724,253 | This should be pretty simple, yet it's blowing up. Any ideas?
```
d = BigDecimal.new("2.0")
YAML::load({:a => d}.to_yaml)
TypeError: BigDecimal can't be coerced into BigDecimal
from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/inspector.rb:86:in `inspect'
from /Users/benjohnson/.rvm/rubies/ruby-1.9... | 2012/05/23 | [
"https://Stackoverflow.com/questions/10724253",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/507718/"
] | This is a bug that has been [reported](https://github.com/tenderlove/psych/issues/31) and [fixed](https://github.com/tenderlove/psych/commit/33ce8650bac29190dde937b1b7d3e21fd06926e7).
The best solution would be upgrade to the latest Ruby (the fix is in patch level 194 onwards).
If you can’t upgrade your Ruby version,... | Here's David's answer, updated to work in 1.9.3 thanks to [this related question](https://stackoverflow.com/questions/6530412/cant-define-singleton-method-encode-with-for-bigdecimal):
```
require 'yaml'
require 'bigdecimal'
YAML::ENGINE.yamler= 'syck'
class BigDecimal
def to_yaml(opts={})
YAML::quick_emit(object... |
32,878,678 | Currently incredibly confused about how I would go about moving the logic for determining if a string is a palindrome from the main method into a method named checkPalindrome? My method should have a single String argument and return a boolean value, but I'm still unsure of how to do this.
```
import java.util.Scanner... | 2015/10/01 | [
"https://Stackoverflow.com/questions/32878678",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5016178/"
] | ```
static boolean checkPalindrome(String str)
{
int strEndPoint=str.length()-1;
int strStartPoint=0;
boolean isPalindrome=true;
while(strStartPoint<=strEndPoint)
{
if(str.charAt(strStartPoint)!=str.charAt(strEndPoint))
{
isPalindrome=false;
break;
}
strStar... | Well, I would use a [`StringBuilder`](http://docs.oracle.com/javase/7/docs/api/java/lang/StringBuilder.html) and implement a method of that description with something like,
```
static boolean checkPalindrome(final String s) {
StringBuilder sb = new StringBuilder(s);
sb.reverse();
return sb.toString().equal... |
32,878,678 | Currently incredibly confused about how I would go about moving the logic for determining if a string is a palindrome from the main method into a method named checkPalindrome? My method should have a single String argument and return a boolean value, but I'm still unsure of how to do this.
```
import java.util.Scanner... | 2015/10/01 | [
"https://Stackoverflow.com/questions/32878678",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5016178/"
] | ```
static boolean checkPalindrome(String str)
{
int strEndPoint=str.length()-1;
int strStartPoint=0;
boolean isPalindrome=true;
while(strStartPoint<=strEndPoint)
{
if(str.charAt(strStartPoint)!=str.charAt(strEndPoint))
{
isPalindrome=false;
break;
}
strStar... | Why dont you think simple. Precisely, mirror image of the chars would be same and if it is not it is not palindrome. When you cross middle of the array without finding a difference it is an absolute palindrome. Check this out.
```
int len = str.getLenght();
int i = 0;
do {
if (str.get(i) == str.get(len-1-i))
... |
33,421 | I have a acquaintance who lives in the United States with a young daughter who will be starting Kindergarten next year.
However, her preschool feels she should be "held back", because among other things, she does not appear to be interested in writing her name.
I do not live in the United States, so perhaps I am in t... | 2018/03/07 | [
"https://parenting.stackexchange.com/questions/33421",
"https://parenting.stackexchange.com",
"https://parenting.stackexchange.com/users/14007/"
] | I'd say in this case the preschool is offering advice and not necessarily perpetrating a scam, at least by a simple definition.
Preschool is optional in the USA. It can be free if you meet some wage requirements, or if you're part of a church, work, or academic program that offers it as incentive or grace. You can't f... | Technically, no, you can't fail pre-school in the US. If you are of age and your parents want to enroll you, there's nothing a pre-school can do to prevent that.
However, that does NOT mean that this is a scam. There are plenty of good reasons to hold a child back a year before they start kindergarten if you suspect ... |
23,123,035 | Ideally I'd like `ctrl`+`space` to bring up "search everywhere" from anywhere in windows (8.1) and also dismiss it if it's already active (with something like #IfWinActive ...).
So far I've been able to make `ctrl`+`space` simulate pressing the `winkey` with the following AutoHotKey script:
```
<^Space::
KeyWait Ctrl... | 2014/04/17 | [
"https://Stackoverflow.com/questions/23123035",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/624041/"
] | One way to do this is through:
```
SendInput, {RWin Down}s{RWin Up}
``` | Really simple:
```
^Space::SendInput, #s
``` |
55,062,489 | I have queries that can return large resultsets (> 100K rows). I need to display the number of results to the user and the user is able to page through the results in our application. However, nobody is going to page through 100K items when 25 are displayed on a page. So I want to limit the number of pageable results t... | 2019/03/08 | [
"https://Stackoverflow.com/questions/55062489",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1207701/"
] | Add max rating programmatically , It should fix the issue
```
ratingBar.setMax(5);
```
**Edit:**
replace your rating bar with and check
```
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="45dp"
android:layout_alignParentEnd="true"
android:layout_below="@+id/... | ratingBar.setStepSize(1f); worked for me |
10,876,621 | Consider a simple example like this which links two sliders using signals and slots:
```
from PySide.QtCore import *
from PySide.QtGui import *
import sys
class MyMainWindow(QWidget):
def __init__(self):
QWidget.__init__(self, None)
vbox = QVBoxLayout()
sone = QSlider(Qt.Horizontal)
vbox.addWidget(sone)
... | 2012/06/04 | [
"https://Stackoverflow.com/questions/10876621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/463994/"
] | You can connect signals to functions that do things. Your code isn't structured to do that easily and required refactoring, so you can do it the easy way:
```
stwo.setInvertedAppearance(True)
sone.valueChanged.connect(stwo.setValue)
``` | Here's the way I did it. I added this class which reimplements setValue. (I got the idea from <http://zetcode.com/tutorials/pyqt4/eventsandsignals/>)
```
class MySlider(QSlider):
def __init__(self):
QSlider.__init__(self, Qt.Horizontal)
def setValue(self, int):
QSlider.setValue(self, 99-int)
... |
10,876,621 | Consider a simple example like this which links two sliders using signals and slots:
```
from PySide.QtCore import *
from PySide.QtGui import *
import sys
class MyMainWindow(QWidget):
def __init__(self):
QWidget.__init__(self, None)
vbox = QVBoxLayout()
sone = QSlider(Qt.Horizontal)
vbox.addWidget(sone)
... | 2012/06/04 | [
"https://Stackoverflow.com/questions/10876621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/463994/"
] | Your example is a bit broken, because you forgot to set the parent of the layout, and also to save the slider widgets as member attributes to be accessed later... But to answer your question, its really as simple as just pointing your connection to your own function:
```
class MyMainWindow(QWidget):
def __init__(s... | You can connect signals to functions that do things. Your code isn't structured to do that easily and required refactoring, so you can do it the easy way:
```
stwo.setInvertedAppearance(True)
sone.valueChanged.connect(stwo.setValue)
``` |
10,876,621 | Consider a simple example like this which links two sliders using signals and slots:
```
from PySide.QtCore import *
from PySide.QtGui import *
import sys
class MyMainWindow(QWidget):
def __init__(self):
QWidget.__init__(self, None)
vbox = QVBoxLayout()
sone = QSlider(Qt.Horizontal)
vbox.addWidget(sone)
... | 2012/06/04 | [
"https://Stackoverflow.com/questions/10876621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/463994/"
] | Your example is a bit broken, because you forgot to set the parent of the layout, and also to save the slider widgets as member attributes to be accessed later... But to answer your question, its really as simple as just pointing your connection to your own function:
```
class MyMainWindow(QWidget):
def __init__(s... | Here's the way I did it. I added this class which reimplements setValue. (I got the idea from <http://zetcode.com/tutorials/pyqt4/eventsandsignals/>)
```
class MySlider(QSlider):
def __init__(self):
QSlider.__init__(self, Qt.Horizontal)
def setValue(self, int):
QSlider.setValue(self, 99-int)
... |
67,782,043 | First of all
============
I searched for it for a long time, and I have **already seen** many questions including the two:
[How to draw Arc between two points on the Canvas?](https://stackoverflow.com/questions/11131954/how-to-draw-arc-between-two-points-on-the-canvas)
[How to draw a curved line between 2 points on ... | 2021/06/01 | [
"https://Stackoverflow.com/questions/67782043",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12611441/"
] | Probably there is no easier way. All what can do would be to refine your solution by geometrical approach. Since the center of circle is always on the perpendicular bisector of the chord, it's not required to solve so generalized equations.
By the way, it's not clear how you defined Clockwise/Counter-clockwise. Arc's ... | **1. find the center of the circle**
This can be solved by a binary quadratic equation, as the image shows:
[](https://i.stack.imgur.com/kNXZw.png)
Though there are other solutions, anyway, now the position of circle center is known.
**2. calculate start angle and sweep... |
2,674,964 | Is it possible to develop an application in groovy using GWT components?
Luis | 2010/04/20 | [
"https://Stackoverflow.com/questions/2674964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72420/"
] | If you want to use Groovy on the server-side and GWT for the UI, that is certainly possible. You can use Grails (a Groovy web framework on the server), and the [Grails GWT plugin](http://www.grails.org/plugin/gwt) to help you integrate GWT with this framework. | I don't think so, because the GWT compiler is basically a [Java to JavaScript *source*](http://java.dzone.com/news/understanding-gwt-compiler) compiler (it would be possible if the GWT compiler needed Java bytecode). You can use Groovy on the server side though. |
2,674,964 | Is it possible to develop an application in groovy using GWT components?
Luis | 2010/04/20 | [
"https://Stackoverflow.com/questions/2674964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72420/"
] | I don't think so, because the GWT compiler is basically a [Java to JavaScript *source*](http://java.dzone.com/news/understanding-gwt-compiler) compiler (it would be possible if the GWT compiler needed Java bytecode). You can use Groovy on the server side though. | I have also wondered this, as it would be very nice. Vaadin essentially does this and you can use their plugin: <http://grails.org/plugin/vaadin>
Doing it this model, though, it is compiling components into Javascript and delivering from the server. But unlike GWT components, these are calling back to the server ever... |
2,674,964 | Is it possible to develop an application in groovy using GWT components?
Luis | 2010/04/20 | [
"https://Stackoverflow.com/questions/2674964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72420/"
] | If you want to use Groovy on the server-side and GWT for the UI, that is certainly possible. You can use Grails (a Groovy web framework on the server), and the [Grails GWT plugin](http://www.grails.org/plugin/gwt) to help you integrate GWT with this framework. | Right now you cant use Groovy on the client side. One big reason is that Groovy relies a lot on introspection, and this is not available on GWT. |
2,674,964 | Is it possible to develop an application in groovy using GWT components?
Luis | 2010/04/20 | [
"https://Stackoverflow.com/questions/2674964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72420/"
] | If you want to use Groovy on the server-side and GWT for the UI, that is certainly possible. You can use Grails (a Groovy web framework on the server), and the [Grails GWT plugin](http://www.grails.org/plugin/gwt) to help you integrate GWT with this framework. | I have also wondered this, as it would be very nice. Vaadin essentially does this and you can use their plugin: <http://grails.org/plugin/vaadin>
Doing it this model, though, it is compiling components into Javascript and delivering from the server. But unlike GWT components, these are calling back to the server ever... |
2,674,964 | Is it possible to develop an application in groovy using GWT components?
Luis | 2010/04/20 | [
"https://Stackoverflow.com/questions/2674964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72420/"
] | Right now you cant use Groovy on the client side. One big reason is that Groovy relies a lot on introspection, and this is not available on GWT. | I have also wondered this, as it would be very nice. Vaadin essentially does this and you can use their plugin: <http://grails.org/plugin/vaadin>
Doing it this model, though, it is compiling components into Javascript and delivering from the server. But unlike GWT components, these are calling back to the server ever... |
55,466,506 | I'm new to Hibernate and I've a basic question. I have two entity classes User and Comments with the relationship defined as One toMany from user to comments and manytoOne from comments to user. Now, if my UI sends me back some comments with comment\_text and user\_id what is the best way to save it? By defining @ManyT... | 2019/04/02 | [
"https://Stackoverflow.com/questions/55466506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11296633/"
] | The relationship between users and comments is many-to-many, so you can try to create a table with the following fields:
* key
* commenter
* commented
* comment-text | You question touches 2 very big points.
Having a fully connected database model is a recipe for low performance and quite some entanglement.
From a design point of view, you probably don't want to change a user when a comment is created, updated or deleted. So from Hibernate, probably you can skip the relationship be... |
198,993 | I must admit, I entirely did not understand why
>
> Queenie
>
>
>
chose to join Grindelwald at the climax of *The Crimes of Grindelwald.* She seems like the least likely, given her relationship with
>
> Jacob.
>
>
>
Can anyone explain? | 2018/11/20 | [
"https://scifi.stackexchange.com/questions/198993",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/50565/"
] | When Queenie met with Grindelwald earlier in the movie, he swayed her by hinting that the current laws banning marriage between Muggles and Wizards/Witches would no longer exist and that if she were to follow him, that she would be free to marry who she wished. | This is just my opinion. Think about what time period we're talking about. It's the 1920s. If Queenie were perhaps pregnant, that would explain her despair on the streets of Paris, her frustration at Jacob refusing to marry her and her feeling like she didn't matter. Women in pre 1970s were treated horribly if they wer... |
198,993 | I must admit, I entirely did not understand why
>
> Queenie
>
>
>
chose to join Grindelwald at the climax of *The Crimes of Grindelwald.* She seems like the least likely, given her relationship with
>
> Jacob.
>
>
>
Can anyone explain? | 2018/11/20 | [
"https://scifi.stackexchange.com/questions/198993",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/50565/"
] | Because she heard what she wanted to hear
-----------------------------------------
***To avoid a spoiler-formatting "hell", this post contains unprotected spoiler information***
In *Crimes of Grindelwald*
>
> Queenie
>
>
>
join forces with Grindelwald at the end.
As others have suggested before, Queenie was ... | It’s unclear exactly but it would appear to be either because Grindelwald persuaded or enchanted her. I’ll detail reasons for both below:
Both
====
Grindelwald is described as being very persuasive and having a silver tongue. This could be a reason to say he is either very persuasive or is enchanting people.
>
> *... |
198,993 | I must admit, I entirely did not understand why
>
> Queenie
>
>
>
chose to join Grindelwald at the climax of *The Crimes of Grindelwald.* She seems like the least likely, given her relationship with
>
> Jacob.
>
>
>
Can anyone explain? | 2018/11/20 | [
"https://scifi.stackexchange.com/questions/198993",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/50565/"
] | **SPOILER ALERT**
An obvious reason (properly described by @Valorum) is being able to marry Jacob. It's her greatest desire, and she sees Grindelwald's way is the only way to achieve that. It's like the last resort for her: either that or nothing. She doesn't seem to think deeply about the possible consequences.
But... | It’s unclear exactly but it would appear to be either because Grindelwald persuaded or enchanted her. I’ll detail reasons for both below:
Both
====
Grindelwald is described as being very persuasive and having a silver tongue. This could be a reason to say he is either very persuasive or is enchanting people.
>
> *... |
198,993 | I must admit, I entirely did not understand why
>
> Queenie
>
>
>
chose to join Grindelwald at the climax of *The Crimes of Grindelwald.* She seems like the least likely, given her relationship with
>
> Jacob.
>
>
>
Can anyone explain? | 2018/11/20 | [
"https://scifi.stackexchange.com/questions/198993",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/50565/"
] | At the start of the film we see that Queenie is struggling with the idea that Jacob can't/won't marry her because she'd become an outcast in wizarding society (essentially exiled from her home country) and he'd either be killed or obliviated.
>
> **JACOB:** *Okay, wait. **We talked about this, like, a million times. ... | **SPOILER ALERT**
An obvious reason (properly described by @Valorum) is being able to marry Jacob. It's her greatest desire, and she sees Grindelwald's way is the only way to achieve that. It's like the last resort for her: either that or nothing. She doesn't seem to think deeply about the possible consequences.
But... |
198,993 | I must admit, I entirely did not understand why
>
> Queenie
>
>
>
chose to join Grindelwald at the climax of *The Crimes of Grindelwald.* She seems like the least likely, given her relationship with
>
> Jacob.
>
>
>
Can anyone explain? | 2018/11/20 | [
"https://scifi.stackexchange.com/questions/198993",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/50565/"
] | **SPOILER ALERT**
An obvious reason (properly described by @Valorum) is being able to marry Jacob. It's her greatest desire, and she sees Grindelwald's way is the only way to achieve that. It's like the last resort for her: either that or nothing. She doesn't seem to think deeply about the possible consequences.
But... | Because she heard what she wanted to hear
-----------------------------------------
***To avoid a spoiler-formatting "hell", this post contains unprotected spoiler information***
In *Crimes of Grindelwald*
>
> Queenie
>
>
>
join forces with Grindelwald at the end.
As others have suggested before, Queenie was ... |
198,993 | I must admit, I entirely did not understand why
>
> Queenie
>
>
>
chose to join Grindelwald at the climax of *The Crimes of Grindelwald.* She seems like the least likely, given her relationship with
>
> Jacob.
>
>
>
Can anyone explain? | 2018/11/20 | [
"https://scifi.stackexchange.com/questions/198993",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/50565/"
] | At the start of the film we see that Queenie is struggling with the idea that Jacob can't/won't marry her because she'd become an outcast in wizarding society (essentially exiled from her home country) and he'd either be killed or obliviated.
>
> **JACOB:** *Okay, wait. **We talked about this, like, a million times. ... | It’s unclear exactly but it would appear to be either because Grindelwald persuaded or enchanted her. I’ll detail reasons for both below:
Both
====
Grindelwald is described as being very persuasive and having a silver tongue. This could be a reason to say he is either very persuasive or is enchanting people.
>
> *... |
198,993 | I must admit, I entirely did not understand why
>
> Queenie
>
>
>
chose to join Grindelwald at the climax of *The Crimes of Grindelwald.* She seems like the least likely, given her relationship with
>
> Jacob.
>
>
>
Can anyone explain? | 2018/11/20 | [
"https://scifi.stackexchange.com/questions/198993",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/50565/"
] | It’s unclear exactly but it would appear to be either because Grindelwald persuaded or enchanted her. I’ll detail reasons for both below:
Both
====
Grindelwald is described as being very persuasive and having a silver tongue. This could be a reason to say he is either very persuasive or is enchanting people.
>
> *... | This is just my opinion. Think about what time period we're talking about. It's the 1920s. If Queenie were perhaps pregnant, that would explain her despair on the streets of Paris, her frustration at Jacob refusing to marry her and her feeling like she didn't matter. Women in pre 1970s were treated horribly if they wer... |
198,993 | I must admit, I entirely did not understand why
>
> Queenie
>
>
>
chose to join Grindelwald at the climax of *The Crimes of Grindelwald.* She seems like the least likely, given her relationship with
>
> Jacob.
>
>
>
Can anyone explain? | 2018/11/20 | [
"https://scifi.stackexchange.com/questions/198993",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/50565/"
] | At the start of the film we see that Queenie is struggling with the idea that Jacob can't/won't marry her because she'd become an outcast in wizarding society (essentially exiled from her home country) and he'd either be killed or obliviated.
>
> **JACOB:** *Okay, wait. **We talked about this, like, a million times. ... | Because she heard what she wanted to hear
-----------------------------------------
***To avoid a spoiler-formatting "hell", this post contains unprotected spoiler information***
In *Crimes of Grindelwald*
>
> Queenie
>
>
>
join forces with Grindelwald at the end.
As others have suggested before, Queenie was ... |
198,993 | I must admit, I entirely did not understand why
>
> Queenie
>
>
>
chose to join Grindelwald at the climax of *The Crimes of Grindelwald.* She seems like the least likely, given her relationship with
>
> Jacob.
>
>
>
Can anyone explain? | 2018/11/20 | [
"https://scifi.stackexchange.com/questions/198993",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/50565/"
] | **SPOILER ALERT**
An obvious reason (properly described by @Valorum) is being able to marry Jacob. It's her greatest desire, and she sees Grindelwald's way is the only way to achieve that. It's like the last resort for her: either that or nothing. She doesn't seem to think deeply about the possible consequences.
But... | This is just my opinion. Think about what time period we're talking about. It's the 1920s. If Queenie were perhaps pregnant, that would explain her despair on the streets of Paris, her frustration at Jacob refusing to marry her and her feeling like she didn't matter. Women in pre 1970s were treated horribly if they wer... |
198,993 | I must admit, I entirely did not understand why
>
> Queenie
>
>
>
chose to join Grindelwald at the climax of *The Crimes of Grindelwald.* She seems like the least likely, given her relationship with
>
> Jacob.
>
>
>
Can anyone explain? | 2018/11/20 | [
"https://scifi.stackexchange.com/questions/198993",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/50565/"
] | **SPOILER ALERT**
An obvious reason (properly described by @Valorum) is being able to marry Jacob. It's her greatest desire, and she sees Grindelwald's way is the only way to achieve that. It's like the last resort for her: either that or nothing. She doesn't seem to think deeply about the possible consequences.
But... | When Queenie met with Grindelwald earlier in the movie, he swayed her by hinting that the current laws banning marriage between Muggles and Wizards/Witches would no longer exist and that if she were to follow him, that she would be free to marry who she wished. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.