qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
32,987,621 | Visual Studio Code is highly customizable in its key bindings, especially when it comes to contextual bindings (using `"when"` to bind the same shortcut to different commands in different contexts).
I'm looking for a **list of variables that can be used in those `"when"` conditions**. (There is a great [list of comman... | 2015/10/07 | [
"https://Stackoverflow.com/questions/32987621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1168892/"
] | Updated. April 2019 (version 1.34)
==================================
List of all variables that can be used in [when](https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts) conditions in **version 1.34**:
```
acceptSuggestionOnEnter
accessibilityHelpWidgetVisible
activeEditor
activeEditorGr... | The `when clause` documentation has been moved to [when clause contexts](https://code.visualstudio.com/api/references/when-clause-contexts).
But it is essentially the same info as was available before and does not provide much of a list of available contexts unfortunately.
Your best bet is to use the `Developer: Insp... |
513,009 | Systemd allows you to create template units, as documented in [systemd.unit](https://www.freedesktop.org/software/systemd/man/systemd.unit.html).
There are a number of variables you can use in your template unit.
I'm interested in `"%j"`:
>
> This is the string between the last "-" and the end of the prefix name. ... | 2019/04/17 | [
"https://unix.stackexchange.com/questions/513009",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/20239/"
] | Units can have additional settings in `.d/` directories alongside the unit. For example, `foo.service` can be extended via `foo.service.d/*.conf`.
Template units will use two directories – instance and template, so `getty@ttyS1.service` will be extended from both `getty@ttyS1.service.d/*.conf` **and** `getty@.service.... | One example of this might be systems units that refer to paths in the name. In such units, `/` is replaced by `-` (and the leading `-` is dropped). For example, a mount unit for `/home/muru` would be named `home-muru.mount`. Similarly, I can see other path-based unit names when I run `systemctl list-units`:
```
sys-de... |
18,809,552 | i have a lot of batch command files they use the same resource, if they running. The result is, that "kill" each other. Each of the batch jobs has different triggers, so it is not easy to queue them.How can i queue this batches to make sure, that each job runs alone and start the next, if finished? | 2013/09/15 | [
"https://Stackoverflow.com/questions/18809552",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/648597/"
] | Use a lock file.
Create an empty file called lock.txt at the beginning of each batch file and remove it at the end. Then at the very top of each file add a wait loop and check for existence of lock.txt. | I wrote this little batch script some time ago called `QSTART`. Maybe it will help.
It allows you (in theory) to create and execute queues of any BATCH commands.
Queues are plain text files stored in `%TEMP%` directory.
It's a very simple script I use i.e. to queue zip commands when doing backups.
I didn't do much d... |
55,423,441 | I am plotting the relationships between flight speed and time for females and males in my species. My generalized linear mixed model (random intercept for individual ID) suggests that there is a difference between females in males, so in figure, I would like to show those differences.
So far I have the following plot:... | 2019/03/29 | [
"https://Stackoverflow.com/questions/55423441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3220999/"
] | I found that you could display a curve for the glm regression that used the log10-transformation the X-axis but not on the Y-axis.
```
p <- ggplot(data = df, aes(time, pace), shape = 1) +
geom_jitter()
p2 <- p + geom_smooth( aes(time, pace),
method = "glm", method.args = list(family = "Gamma"),
... | The main issue is that you are fitting a multivariate model, so when you are plotting in two-dimensional space you have to represent the model predictions using fitted values. In other words, the coefficients you are getting are conditional marginal effects associated with each variable; they do not represent the two-d... |
39,350,671 | I'm trying to write a script that will post two images to Twitter using the API, any idea why this doesn't work? It only posts the first image. New to this, thanks!
```
from TwitterAPI import TwitterAPI
import urllib
api = TwitterAPI('','','','')
x = []
file = open('im1.png', 'rb')
data = file.read()
r = api.reque... | 2016/09/06 | [
"https://Stackoverflow.com/questions/39350671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4173437/"
] | When an attribute is [private](https://docs.python.org/3/tutorial/classes.html#tut-private) (starting with two underscores `__`), its real name when running is `_ClassName__attribute`. So, to get `__myvariable`, you should ask for `_Members__myvariable`:
```
def __repr__(self):
return '{self.__class__.__name__}({s... | You could format it like this instead:
```
def __repr__(self):
return "{}({})".format(self.__class__.__name__,self.getVariable())
```
or like this:
```
def __repr__(self):
return "{}({})".format(self.__class__.__name__,self.__myvariable)
``` |
39,350,671 | I'm trying to write a script that will post two images to Twitter using the API, any idea why this doesn't work? It only posts the first image. New to this, thanks!
```
from TwitterAPI import TwitterAPI
import urllib
api = TwitterAPI('','','','')
x = []
file = open('im1.png', 'rb')
data = file.read()
r = api.reque... | 2016/09/06 | [
"https://Stackoverflow.com/questions/39350671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4173437/"
] | When an attribute is [private](https://docs.python.org/3/tutorial/classes.html#tut-private) (starting with two underscores `__`), its real name when running is `_ClassName__attribute`. So, to get `__myvariable`, you should ask for `_Members__myvariable`:
```
def __repr__(self):
return '{self.__class__.__name__}({s... | You can't access `__myvariable` because names with two leading \_\_ get mangled (see [Does Python have “private” variables in classes?](https://stackoverflow.com/questions/1641219/does-python-have-private-variables-in-classes))
And python doesn't do variable interpolation so the other method is not going to work eithe... |
39,350,671 | I'm trying to write a script that will post two images to Twitter using the API, any idea why this doesn't work? It only posts the first image. New to this, thanks!
```
from TwitterAPI import TwitterAPI
import urllib
api = TwitterAPI('','','','')
x = []
file = open('im1.png', 'rb')
data = file.read()
r = api.reque... | 2016/09/06 | [
"https://Stackoverflow.com/questions/39350671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4173437/"
] | Attempt 1 fails because [format function](https://docs.python.org/2/library/string.html#format-examples) does not call method at all
Attempt 2 fails because of name mangling behavior, see [PEP8](https://www.python.org/dev/peps/pep-0008/#descriptive-naming-styles)
```
- __double_leading_underscore: when naming a clas... | You could format it like this instead:
```
def __repr__(self):
return "{}({})".format(self.__class__.__name__,self.getVariable())
```
or like this:
```
def __repr__(self):
return "{}({})".format(self.__class__.__name__,self.__myvariable)
``` |
39,350,671 | I'm trying to write a script that will post two images to Twitter using the API, any idea why this doesn't work? It only posts the first image. New to this, thanks!
```
from TwitterAPI import TwitterAPI
import urllib
api = TwitterAPI('','','','')
x = []
file = open('im1.png', 'rb')
data = file.read()
r = api.reque... | 2016/09/06 | [
"https://Stackoverflow.com/questions/39350671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4173437/"
] | Attempt 1 fails because [format function](https://docs.python.org/2/library/string.html#format-examples) does not call method at all
Attempt 2 fails because of name mangling behavior, see [PEP8](https://www.python.org/dev/peps/pep-0008/#descriptive-naming-styles)
```
- __double_leading_underscore: when naming a clas... | You can't access `__myvariable` because names with two leading \_\_ get mangled (see [Does Python have “private” variables in classes?](https://stackoverflow.com/questions/1641219/does-python-have-private-variables-in-classes))
And python doesn't do variable interpolation so the other method is not going to work eithe... |
17,323,457 | Thanks to the help of Serge insas, I've been creating a form with google apps script. It was working well until I started to set some persistant variables.
First I started with persistant variables made of text (example var choice1 = 'Hello') and it was working just fine. But I've made it a little more complicated usin... | 2013/06/26 | [
"https://Stackoverflow.com/questions/17323457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2481597/"
] | You can only assign constants to global variables outside of the executed code. Instead of:
```
var choix1 = Math.floor((Math.random() * (33-13)) + 13);
var choix2 = Math.floor((Math.random() * (66-33)) + 33);
function doGet() {
var app = UiApp.createApplication().setTitle('test Questionnaire');
...
```
write
``... | Well I found a way to do what I want to. I store the different options in a spreadsheet and add directly the propositions into the question. Answers are just 'option1', 'option2'... so I still can know which option was chosen.
```
function doGet() {
var choix1 = Math.floor((Math.random() * (33-13)) + 13);
var choi... |
12,998,389 | I know how to allocate memory to 2-D array but if the ptr is defined as `int *ptr[][100];`
Then how can I allocate memory for `ptr` ? | 2012/10/21 | [
"https://Stackoverflow.com/questions/12998389",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1662935/"
] | Quoting from section 6.2.5 of the C standard:
>
> An array type of unknown size is an incomplete type. It is completed,
> for an identifier of that type, by specifying the size in a later
> declaration (with internal or external linkage).
>
>
>
thus, to use `int *ptr[][100];` you have to link against a definiti... | Use `malloc` and specify the amount of bytes you need for the 3D array.
```
int *array3d = (int *)malloc(x * y * z * sizeof(int));
```
where x, y and z are the dimensions of your 3d array.
You can of course also have other types of array elements (float, chars, structs), just make sure you get the correct size usin... |
5,172,065 | If I want to replace all cases of foo with bar I simply do this.
```
perl -pi -e 's/foo/bar/gi' /home/smith/myfile.txt
```
What if I only want to replace |foo| with |bar|?
Related question..What if I want to only replace >foo< with >bar< ? | 2011/03/02 | [
"https://Stackoverflow.com/questions/5172065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/584583/"
] | You have to escape the | character:
`perl -pi -e 's/\|foo\|/\|bar\|/gi' /home/smith/myfile.txt` | You simply need to use proper quoting. With ' quotes you're fairly safe to do what you want. Except for things related to regexp characters, like the '|'. so it would become this:
```
perl -pi -e 's/\|foo\|/|bar|/gi' /home/smith/myfile.txt
```
The >foo< examples are easier because they're not regexp characters. |
5,172,065 | If I want to replace all cases of foo with bar I simply do this.
```
perl -pi -e 's/foo/bar/gi' /home/smith/myfile.txt
```
What if I only want to replace |foo| with |bar|?
Related question..What if I want to only replace >foo< with >bar< ? | 2011/03/02 | [
"https://Stackoverflow.com/questions/5172065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/584583/"
] | Try:
```
perl-pi -e 's/\Q|foo|\E/|bar|gi' /home/smith/myfile.txt
```
See `perldoc perlre` and search for `/Escape sequences/`. | You simply need to use proper quoting. With ' quotes you're fairly safe to do what you want. Except for things related to regexp characters, like the '|'. so it would become this:
```
perl -pi -e 's/\|foo\|/|bar|/gi' /home/smith/myfile.txt
```
The >foo< examples are easier because they're not regexp characters. |
5,172,065 | If I want to replace all cases of foo with bar I simply do this.
```
perl -pi -e 's/foo/bar/gi' /home/smith/myfile.txt
```
What if I only want to replace |foo| with |bar|?
Related question..What if I want to only replace >foo< with >bar< ? | 2011/03/02 | [
"https://Stackoverflow.com/questions/5172065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/584583/"
] | You have to escape the | character:
`perl -pi -e 's/\|foo\|/\|bar\|/gi' /home/smith/myfile.txt` | Try:
```
perl-pi -e 's/\Q|foo|\E/|bar|gi' /home/smith/myfile.txt
```
See `perldoc perlre` and search for `/Escape sequences/`. |
50,591,213 | I'm dealing with the following situation: many trips exist between many cities. Both have various properties. E.g the cities have a name and an amount of trips that passed them, whereas trips have a distance and time.
What is *'best practise'* in Neo4j?
a) Add all cities and trips as nodes, and connect the trips to t... | 2018/05/29 | [
"https://Stackoverflow.com/questions/50591213",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7981534/"
] | The answer above is also correct, alternatively you can use the following formula:
if(B1 <> "",B1, "")
-------------------
Enter the above formula into cell A1 and drag it down column A as far as it needs to be.
Broken down this says, if B1 is not blank, then make A1 the same as B1, else make A1 blank. | Here is Google Script unnecessary.
Just use [Formula](https://support.google.com/docs/answer/46977?co=GENIE.Platform%3DDesktop&hl=en). Here you can put to A1:
```
=B1
```
and in A1 will be the same word as in B1. If you need condition, try to A1 set:
```
="My magic word is: " & IF(ISBLANK(B1),"(nothing)",B1)
``... |
54,918,087 | I have a spring mvc project, but it throws out `Caused by: java.util.zip.ZipException: error in opening zip file` when I run it by Tomcat. How to figure out which jar file has not been loaded correctly.
I have added `-verbose:class` to VM options, but it only prints out Loaded jar, not the error one.
Tomcat version:... | 2019/02/28 | [
"https://Stackoverflow.com/questions/54918087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6730454/"
] | Given you have access to a Bash terminal, you can try this one-liner to test your jars assuming they are all in the same directory
```
for j in $(find /path/to/lib -name '*.jar'); do jar -tvf $j > /dev/null 2>&1; [ "$?" -ne 0 ] && echo "$j jar is broken"; done
```
Result:
```
/path/to/lib/test.jar jar is broken
/pa... | This is an older thread but I just ran into this issue. It turns out, if you package up your application using tar (rather than creating a war file) on Mac OS and then extract it on a Linux server, you'll end up with a ".\_libraryX.jar" for every "libraryX.jar". Unfortunately, because Tomcat tries to load every jar in ... |
54,918,087 | I have a spring mvc project, but it throws out `Caused by: java.util.zip.ZipException: error in opening zip file` when I run it by Tomcat. How to figure out which jar file has not been loaded correctly.
I have added `-verbose:class` to VM options, but it only prints out Loaded jar, not the error one.
Tomcat version:... | 2019/02/28 | [
"https://Stackoverflow.com/questions/54918087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6730454/"
] | Given you have access to a Bash terminal, you can try this one-liner to test your jars assuming they are all in the same directory
```
for j in $(find /path/to/lib -name '*.jar'); do jar -tvf $j > /dev/null 2>&1; [ "$?" -ne 0 ] && echo "$j jar is broken"; done
```
Result:
```
/path/to/lib/test.jar jar is broken
/pa... | This exception occurres when your war file is damaged. Not only jar files but also other files in war file may be damaged. In my case, I found a damaged png file and after removing it, war file deployed successfully.
In order to find the damaged file use this command:
```
jar xvf yourApp.war
```
By running the comma... |
14,280,769 | I want to parse PDF files from websites.
Can anyone say how to extract text (word by word) from a PDF file using Grails? | 2013/01/11 | [
"https://Stackoverflow.com/questions/14280769",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1958037/"
] | I don't know in Grails / Groovy but you can use the Apache lib [PDF Box](http://pdfbox.apache.org/) to parse PDF in your project. | Just as another option, I've always had success with [Aspose](http://www.aspose.com/java/pdf-component.aspx) products for such things. I have no relationship with Aspose in any way. I just like their products. |
14,280,769 | I want to parse PDF files from websites.
Can anyone say how to extract text (word by word) from a PDF file using Grails? | 2013/01/11 | [
"https://Stackoverflow.com/questions/14280769",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1958037/"
] | I don't know in Grails / Groovy but you can use the Apache lib [PDF Box](http://pdfbox.apache.org/) to parse PDF in your project. | Other options include [Apache Tika](http://tika.apache.org/) which supports pdf and other formats and [iText](http://itextpdf.com/).
To use with Groovy/Grails use the Java below as you would with Groovy/Grails
To use Apache tika with Java you would have to:
* download the tika-app-1.2.jar from [tika.apache.org](http... |
14,280,769 | I want to parse PDF files from websites.
Can anyone say how to extract text (word by word) from a PDF file using Grails? | 2013/01/11 | [
"https://Stackoverflow.com/questions/14280769",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1958037/"
] | Other options include [Apache Tika](http://tika.apache.org/) which supports pdf and other formats and [iText](http://itextpdf.com/).
To use with Groovy/Grails use the Java below as you would with Groovy/Grails
To use Apache tika with Java you would have to:
* download the tika-app-1.2.jar from [tika.apache.org](http... | Just as another option, I've always had success with [Aspose](http://www.aspose.com/java/pdf-component.aspx) products for such things. I have no relationship with Aspose in any way. I just like their products. |
47,205,859 | I don't understand the output of this code:
```
package examplepriorities;
class Counter extends Thread {
public Counter(String name) {
super(name);
}
@Override
public void run() {
int count = 0;
while (count <= 1000) {
System.out.println(this.getName() + ": " + c... | 2017/11/09 | [
"https://Stackoverflow.com/questions/47205859",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7359013/"
] | It would look something like this:
```
{% if(Client != "") { %}
<div class="client-heading">
<h5 class="data-heading">Client:</h5>
<h5>{% Client %}</h5>
</div>
{% } %}
```
Also know your transformation is combining both ASCX and Macro transformation methods. Might want to make sure you clean this up. | First quick question i would ask is you are referencing the "CurrentDocument" which is NOT the transformed object, it is the actual current document. So if you want to get the City value of the transformed object, you should use `{% City %}` instead of `{% CurrentDocument.GetValue("City") %}`
As for testing if somethi... |
40,457,873 | I want to launch native application with data by app\_control in web application.
I can't find get app control extra data in my native application.
I already tried to use 'app\_control\_get\_extra\_data', 'app\_control\_foreach\_extra\_data'.
Let me know how to get extra data from web application's app control.
In my... | 2016/11/07 | [
"https://Stackoverflow.com/questions/40457873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5671868/"
] | Just intialize an array of strings and pass it:
```
method(new String[]{"This", "is", "an", "array"});
``` | Use varargs:
```
public void method(String... values) {
//...
}
method("Hello", "World");
``` |
40,457,873 | I want to launch native application with data by app\_control in web application.
I can't find get app control extra data in my native application.
I already tried to use 'app\_control\_get\_extra\_data', 'app\_control\_foreach\_extra\_data'.
Let me know how to get extra data from web application's app control.
In my... | 2016/11/07 | [
"https://Stackoverflow.com/questions/40457873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5671868/"
] | Use varargs:
```
public void method(String... values) {
//...
}
method("Hello", "World");
``` | You can send array of strings like below.
```
method(String[] arr){}
```
and call that method with string array as argument.
```
String array = new String[]{"value1","value2"};
method(array);
``` |
40,457,873 | I want to launch native application with data by app\_control in web application.
I can't find get app control extra data in my native application.
I already tried to use 'app\_control\_get\_extra\_data', 'app\_control\_foreach\_extra\_data'.
Let me know how to get extra data from web application's app control.
In my... | 2016/11/07 | [
"https://Stackoverflow.com/questions/40457873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5671868/"
] | Use varargs:
```
public void method(String... values) {
//...
}
method("Hello", "World");
``` | You can try this can take an optional list of strings and also you need to make it the last argument and mention other before.
```
private void method(String... values){
for (String s : values){
}
}
``` |
40,457,873 | I want to launch native application with data by app\_control in web application.
I can't find get app control extra data in my native application.
I already tried to use 'app\_control\_get\_extra\_data', 'app\_control\_foreach\_extra\_data'.
Let me know how to get extra data from web application's app control.
In my... | 2016/11/07 | [
"https://Stackoverflow.com/questions/40457873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5671868/"
] | Use varargs:
```
public void method(String... values) {
//...
}
method("Hello", "World");
``` | You can do it like this.
```
public static void arrayString(String[] params)
{
System.out.println(Arrays.toString(params));
}
```
While calling call it as
```
arrayString(new String[]{"This","is","an","array"});
``` |
40,457,873 | I want to launch native application with data by app\_control in web application.
I can't find get app control extra data in my native application.
I already tried to use 'app\_control\_get\_extra\_data', 'app\_control\_foreach\_extra\_data'.
Let me know how to get extra data from web application's app control.
In my... | 2016/11/07 | [
"https://Stackoverflow.com/questions/40457873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5671868/"
] | Just intialize an array of strings and pass it:
```
method(new String[]{"This", "is", "an", "array"});
``` | You can send array of strings like below.
```
method(String[] arr){}
```
and call that method with string array as argument.
```
String array = new String[]{"value1","value2"};
method(array);
``` |
40,457,873 | I want to launch native application with data by app\_control in web application.
I can't find get app control extra data in my native application.
I already tried to use 'app\_control\_get\_extra\_data', 'app\_control\_foreach\_extra\_data'.
Let me know how to get extra data from web application's app control.
In my... | 2016/11/07 | [
"https://Stackoverflow.com/questions/40457873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5671868/"
] | Just intialize an array of strings and pass it:
```
method(new String[]{"This", "is", "an", "array"});
``` | You can try this can take an optional list of strings and also you need to make it the last argument and mention other before.
```
private void method(String... values){
for (String s : values){
}
}
``` |
40,457,873 | I want to launch native application with data by app\_control in web application.
I can't find get app control extra data in my native application.
I already tried to use 'app\_control\_get\_extra\_data', 'app\_control\_foreach\_extra\_data'.
Let me know how to get extra data from web application's app control.
In my... | 2016/11/07 | [
"https://Stackoverflow.com/questions/40457873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5671868/"
] | Just intialize an array of strings and pass it:
```
method(new String[]{"This", "is", "an", "array"});
``` | You can do it like this.
```
public static void arrayString(String[] params)
{
System.out.println(Arrays.toString(params));
}
```
While calling call it as
```
arrayString(new String[]{"This","is","an","array"});
``` |
6,074,688 | I need to find resources for learning openGL ES for the iPhone.
I've already watched Brad Larson's awesome videos and I'm downloading the advanced videos from apple now.
I know a lot about iOS programming but am clueless on OpenGL, so resources that don't assume I already know openGL.
I want to learn a majority of... | 2011/05/20 | [
"https://Stackoverflow.com/questions/6074688",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/640618/"
] | I appreciate the kind words on the videos. That definitely makes the class feel like it was worth doing.
Do you have the course notes for both semesters of the class? The spring session notes can be found [here](http://www.sunsetlakesoftware.com/sites/default/files/Spring2010CourseNotes/index.html) in HTML format (Voo... | You might want to have a look at this: <http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-table-of.html>
These tutorials seem to be relatively beginner-friendly. |
6,074,688 | I need to find resources for learning openGL ES for the iPhone.
I've already watched Brad Larson's awesome videos and I'm downloading the advanced videos from apple now.
I know a lot about iOS programming but am clueless on OpenGL, so resources that don't assume I already know openGL.
I want to learn a majority of... | 2011/05/20 | [
"https://Stackoverflow.com/questions/6074688",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/640618/"
] | You might want to have a look at this: <http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-table-of.html>
These tutorials seem to be relatively beginner-friendly. | >
> More specifically I want to create a water ripple effect that follows the users finger.
>
>
>
Here is code that does exactly that: <http://developer.apple.com/library/ios/#samplecode/GLCameraRipple/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011222> |
6,074,688 | I need to find resources for learning openGL ES for the iPhone.
I've already watched Brad Larson's awesome videos and I'm downloading the advanced videos from apple now.
I know a lot about iOS programming but am clueless on OpenGL, so resources that don't assume I already know openGL.
I want to learn a majority of... | 2011/05/20 | [
"https://Stackoverflow.com/questions/6074688",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/640618/"
] | I appreciate the kind words on the videos. That definitely makes the class feel like it was worth doing.
Do you have the course notes for both semesters of the class? The spring session notes can be found [here](http://www.sunsetlakesoftware.com/sites/default/files/Spring2010CourseNotes/index.html) in HTML format (Voo... | >
> More specifically I want to create a water ripple effect that follows the users finger.
>
>
>
Here is code that does exactly that: <http://developer.apple.com/library/ios/#samplecode/GLCameraRipple/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011222> |
58,288,227 | I have X classes with different information and calculation methods that should be shared but could be overwritten, so:
```
class Rule1 {
int type = 1;
string name = "Rule";
public float Calc()
{
return 1 + 2 + type; // SAME
}
}
class Rule2 {
int type = 2;
string name = "Rule2";
... | 2019/10/08 | [
"https://Stackoverflow.com/questions/58288227",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133584/"
] | If you have an implementation that's correct for most inheritors but not all, mark it `virtual` and `override` it in a derived class:
```
public class BaseCalculation
{
public virtual float Calculate()
{
return 42;
}
}
public class HalfCalculation : BaseCalculation
{
public override float Calc... | You can try this using an asbtract base class and polymorphism on `Calc`.
[What is polymorphism](https://stackoverflow.com/questions/1031273/what-is-polymorphism-what-is-it-for-and-how-is-it-used/58197730#58197730)
No need to use interface unless you have a real and good reason to do that.
[What is the difference be... |
58,288,227 | I have X classes with different information and calculation methods that should be shared but could be overwritten, so:
```
class Rule1 {
int type = 1;
string name = "Rule";
public float Calc()
{
return 1 + 2 + type; // SAME
}
}
class Rule2 {
int type = 2;
string name = "Rule2";
... | 2019/10/08 | [
"https://Stackoverflow.com/questions/58288227",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133584/"
] | If you have an implementation that's correct for most inheritors but not all, mark it `virtual` and `override` it in a derived class:
```
public class BaseCalculation
{
public virtual float Calculate()
{
return 42;
}
}
public class HalfCalculation : BaseCalculation
{
public override float Calc... | Every class must support the interface. The implementation of method Calc in each class is not important. They can be the same or different.
If you want to have a standard implementation (virtual implementation), you could use a base class and overwrite the method in some classes (in your example Rule3).
If you do ... |
58,288,227 | I have X classes with different information and calculation methods that should be shared but could be overwritten, so:
```
class Rule1 {
int type = 1;
string name = "Rule";
public float Calc()
{
return 1 + 2 + type; // SAME
}
}
class Rule2 {
int type = 2;
string name = "Rule2";
... | 2019/10/08 | [
"https://Stackoverflow.com/questions/58288227",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133584/"
] | If you have an implementation that's correct for most inheritors but not all, mark it `virtual` and `override` it in a derived class:
```
public class BaseCalculation
{
public virtual float Calculate()
{
return 42;
}
}
public class HalfCalculation : BaseCalculation
{
public override float Calc... | You are searching for inherited class and virtual method (wich allows override) :
```
class GenericRule {
int type = 1;
string name = "Rule";
public virtual float Calc()
{
return 1 + 2 + type; // SAME
}
}
class Rule3 : GenericRule
{
int type = 3;
string name = "Rule3";
public o... |
58,288,227 | I have X classes with different information and calculation methods that should be shared but could be overwritten, so:
```
class Rule1 {
int type = 1;
string name = "Rule";
public float Calc()
{
return 1 + 2 + type; // SAME
}
}
class Rule2 {
int type = 2;
string name = "Rule2";
... | 2019/10/08 | [
"https://Stackoverflow.com/questions/58288227",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133584/"
] | You can try this using an asbtract base class and polymorphism on `Calc`.
[What is polymorphism](https://stackoverflow.com/questions/1031273/what-is-polymorphism-what-is-it-for-and-how-is-it-used/58197730#58197730)
No need to use interface unless you have a real and good reason to do that.
[What is the difference be... | Every class must support the interface. The implementation of method Calc in each class is not important. They can be the same or different.
If you want to have a standard implementation (virtual implementation), you could use a base class and overwrite the method in some classes (in your example Rule3).
If you do ... |
58,288,227 | I have X classes with different information and calculation methods that should be shared but could be overwritten, so:
```
class Rule1 {
int type = 1;
string name = "Rule";
public float Calc()
{
return 1 + 2 + type; // SAME
}
}
class Rule2 {
int type = 2;
string name = "Rule2";
... | 2019/10/08 | [
"https://Stackoverflow.com/questions/58288227",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133584/"
] | You can try this using an asbtract base class and polymorphism on `Calc`.
[What is polymorphism](https://stackoverflow.com/questions/1031273/what-is-polymorphism-what-is-it-for-and-how-is-it-used/58197730#58197730)
No need to use interface unless you have a real and good reason to do that.
[What is the difference be... | You are searching for inherited class and virtual method (wich allows override) :
```
class GenericRule {
int type = 1;
string name = "Rule";
public virtual float Calc()
{
return 1 + 2 + type; // SAME
}
}
class Rule3 : GenericRule
{
int type = 3;
string name = "Rule3";
public o... |
58,288,227 | I have X classes with different information and calculation methods that should be shared but could be overwritten, so:
```
class Rule1 {
int type = 1;
string name = "Rule";
public float Calc()
{
return 1 + 2 + type; // SAME
}
}
class Rule2 {
int type = 2;
string name = "Rule2";
... | 2019/10/08 | [
"https://Stackoverflow.com/questions/58288227",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133584/"
] | You are searching for inherited class and virtual method (wich allows override) :
```
class GenericRule {
int type = 1;
string name = "Rule";
public virtual float Calc()
{
return 1 + 2 + type; // SAME
}
}
class Rule3 : GenericRule
{
int type = 3;
string name = "Rule3";
public o... | Every class must support the interface. The implementation of method Calc in each class is not important. They can be the same or different.
If you want to have a standard implementation (virtual implementation), you could use a base class and overwrite the method in some classes (in your example Rule3).
If you do ... |
58,971,543 | I use jackson `ObjectMapper` to serialize and deserialize some data of mine, which have fields of javaslang `Option` type. I use `JavaslangModule` (and `Jdk8Module`). And when it write the json, `Option.None` value fields are written as `null`.
To reduce the json size and provide some simple backward compatibility whe... | 2019/11/21 | [
"https://Stackoverflow.com/questions/58971543",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1206998/"
] | Luckily there is a much simpler solution.
1) In your ObjectMapper configuration, set serialization inclusion to only include non absent field:
```
@Bean
public ObjectMapper objectMapper() {
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModules(vavr());
objectMapper.setSerializat... | I found a solution that works with immuatble (lombok @Value) models:
1. add a filter on all `Object` using mixIn that doesn't write Option.None (see "the solution" below)
2. my existing `ObjectMapper` (with `JavaslangModule`) is already setting None to Option field when the corresponding json entry is missing
**The ... |
50,944,508 | I have a qml application which performs a rather long action upon a users request. During the time, I want to display an overlay over the whole screen, so the user is aware that the application is working, basically a busy indicator.
My Problem is, that the application starts with the task, before updating the UI comp... | 2018/06/20 | [
"https://Stackoverflow.com/questions/50944508",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2865814/"
] | A possible approach is to use transform the sequential logic of the *"for"* to an asynchronous logic through a `Timer`:
```
import QtQuick 2.9
import QtQuick.Window 2.3
Window {
visible: true
width: 640
height: 480
title: qsTr("Ui Demo")
Rectangle {
id: rectangle
anchors.fill: par... | Reliable Workaround
===================
Thanks to eyllanesc's [answer](https://stackoverflow.com/a/50944720/2865814) I figured out a possible solution.
I use a single shot timer, to start my work, because in the actual code I cannot call different steps with a repeating timer - but I do not need to anyway, as I don't ... |
18,925,231 | I am looking for some help in validating that this string is valid. I need a regex pattern that will catch any letters within the set of parenthesis. I also need to make sure there is a semi-colon at the end of the parentheses. Any ideas? My regex is absolutely terrible......
This is what I want to match:
```
Total H... | 2013/09/20 | [
"https://Stackoverflow.com/questions/18925231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2574537/"
] | This is just an example using as input the following 3 strings:
```
Total Hours Worked (.5);
Total Hours Worked (.A);
Total Hours Worked (A);
```
I am not considering any nested inner parenthesis only that the possible combinations inside the parenthesis are letters and dot.
Here is a simple example:
```
string[] ... | Your regex is `/\([^)]+\);/` or `/\(.+?\)/` if you don't have nested parenthesis. It works even if you have two or more of these parenthesis group in the same line.
If you have nested parenthesis use `/\(.+\);/`, but this will not work if you have two or more parenthesis group in the same line.
In the end, if you ha... |
18,925,231 | I am looking for some help in validating that this string is valid. I need a regex pattern that will catch any letters within the set of parenthesis. I also need to make sure there is a semi-colon at the end of the parentheses. Any ideas? My regex is absolutely terrible......
This is what I want to match:
```
Total H... | 2013/09/20 | [
"https://Stackoverflow.com/questions/18925231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2574537/"
] | Your regex is `/\([^)]+\);/` or `/\(.+?\)/` if you don't have nested parenthesis. It works even if you have two or more of these parenthesis group in the same line.
If you have nested parenthesis use `/\(.+\);/`, but this will not work if you have two or more parenthesis group in the same line.
In the end, if you ha... | Try this;
```
string[] inputstrings = new string[] { "Total Hours Worked (.5);", "Total Hours Worked (.A);", "Total Hours Worked (A);" };//Collection of inputs.
Regex rgx = new Regex(@"\(\.?(?<StringValue>[a-zA-Z]*)\)\;{1}");//Regular expression to find all matches.
foreach (string input in inp... |
18,925,231 | I am looking for some help in validating that this string is valid. I need a regex pattern that will catch any letters within the set of parenthesis. I also need to make sure there is a semi-colon at the end of the parentheses. Any ideas? My regex is absolutely terrible......
This is what I want to match:
```
Total H... | 2013/09/20 | [
"https://Stackoverflow.com/questions/18925231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2574537/"
] | This is just an example using as input the following 3 strings:
```
Total Hours Worked (.5);
Total Hours Worked (.A);
Total Hours Worked (A);
```
I am not considering any nested inner parenthesis only that the possible combinations inside the parenthesis are letters and dot.
Here is a simple example:
```
string[] ... | Try following regex:
```
\([^0-9]+\)\s*;
```
This will match any characters within parenthesis except digits.
I would recommend to put `\s*` between `)` and `;` to allow space as in most of the programming language. |
18,925,231 | I am looking for some help in validating that this string is valid. I need a regex pattern that will catch any letters within the set of parenthesis. I also need to make sure there is a semi-colon at the end of the parentheses. Any ideas? My regex is absolutely terrible......
This is what I want to match:
```
Total H... | 2013/09/20 | [
"https://Stackoverflow.com/questions/18925231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2574537/"
] | This is just an example using as input the following 3 strings:
```
Total Hours Worked (.5);
Total Hours Worked (.A);
Total Hours Worked (A);
```
I am not considering any nested inner parenthesis only that the possible combinations inside the parenthesis are letters and dot.
Here is a simple example:
```
string[] ... | Try this;
```
string[] inputstrings = new string[] { "Total Hours Worked (.5);", "Total Hours Worked (.A);", "Total Hours Worked (A);" };//Collection of inputs.
Regex rgx = new Regex(@"\(\.?(?<StringValue>[a-zA-Z]*)\)\;{1}");//Regular expression to find all matches.
foreach (string input in inp... |
18,925,231 | I am looking for some help in validating that this string is valid. I need a regex pattern that will catch any letters within the set of parenthesis. I also need to make sure there is a semi-colon at the end of the parentheses. Any ideas? My regex is absolutely terrible......
This is what I want to match:
```
Total H... | 2013/09/20 | [
"https://Stackoverflow.com/questions/18925231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2574537/"
] | Try following regex:
```
\([^0-9]+\)\s*;
```
This will match any characters within parenthesis except digits.
I would recommend to put `\s*` between `)` and `;` to allow space as in most of the programming language. | Try this;
```
string[] inputstrings = new string[] { "Total Hours Worked (.5);", "Total Hours Worked (.A);", "Total Hours Worked (A);" };//Collection of inputs.
Regex rgx = new Regex(@"\(\.?(?<StringValue>[a-zA-Z]*)\)\;{1}");//Regular expression to find all matches.
foreach (string input in inp... |
251,505 | We're testing WYSIWYG editors, and we cannot see to make them work with asynchronous postbacks. We put the TextBox(/textarea) in the UpdatePanel and call a simple save to the DB, and all of our WYSIWYG toolbars disappear, leaving us with a bunch of HTML in textboxes.
This is the one we've been working to implement: ni... | 2008/10/30 | [
"https://Stackoverflow.com/questions/251505",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25538/"
] | See if this helps <http://nicedit.pbwiki.com/Saving+via+AJAX> | From what I remember from TinyMCE, you need to turn off the editor before your POST.
I've also had success with [InnovaStudio](http://www.innovastudio.com/), but you have to pay for it ($59.99).
I'm waiting for [WysiHat](http://www.37signals.com/svn/posts/1330-introducing-wysihat-an-eventually-better-open-source-wysi... |
251,505 | We're testing WYSIWYG editors, and we cannot see to make them work with asynchronous postbacks. We put the TextBox(/textarea) in the UpdatePanel and call a simple save to the DB, and all of our WYSIWYG toolbars disappear, leaving us with a bunch of HTML in textboxes.
This is the one we've been working to implement: ni... | 2008/10/30 | [
"https://Stackoverflow.com/questions/251505",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25538/"
] | This is mostly (independent upon your WYSIWYG control) due to two problems. Either the WYSIWG editor runs JS on the "onLoad" event (which you cannot fix easily) or your WYSIWYG editor includes JavaScript upon becoming Visible (which won't be rendered back to client in an Ajax Request without taking special actions) | From what I remember from TinyMCE, you need to turn off the editor before your POST.
I've also had success with [InnovaStudio](http://www.innovastudio.com/), but you have to pay for it ($59.99).
I'm waiting for [WysiHat](http://www.37signals.com/svn/posts/1330-introducing-wysihat-an-eventually-better-open-source-wysi... |
251,505 | We're testing WYSIWYG editors, and we cannot see to make them work with asynchronous postbacks. We put the TextBox(/textarea) in the UpdatePanel and call a simple save to the DB, and all of our WYSIWYG toolbars disappear, leaving us with a bunch of HTML in textboxes.
This is the one we've been working to implement: ni... | 2008/10/30 | [
"https://Stackoverflow.com/questions/251505",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25538/"
] | This is mostly (independent upon your WYSIWYG control) due to two problems. Either the WYSIWG editor runs JS on the "onLoad" event (which you cannot fix easily) or your WYSIWYG editor includes JavaScript upon becoming Visible (which won't be rendered back to client in an Ajax Request without taking special actions) | See if this helps <http://nicedit.pbwiki.com/Saving+via+AJAX> |
20,656,485 | I am building a Sharepoint 2013 app part that is supposed to show information about a particular person. The person GUID will be supplied via a querystring in the Sharepoint page URL and somehow that querystring (key/value) needs to get passed into all the iFrame / app part.
At first I was hoping I could just send th... | 2013/12/18 | [
"https://Stackoverflow.com/questions/20656485",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/653328/"
] | Are you using Chrome 30.x or 31.x? Because there seems to be a problem with refresing iframes in these two builds of Chrome[University of Wisconsin, dated November 23rd 2013](https://kb.wisc.edu/helpdesk/news.php?id=5224). | **Script to get the current page URL(With query-string) from the SharePoint hosted apps.**
```
var currentPageURL = (window.location != window.parent.location) ? document.referrer : document.location;
``` |
4,645,718 | assume we have an `enum` that has `FlagsAttribute`.
```
[Flags]
enum CarOptions
{
Sunroof = 1,
Spoiler = 2,
TintedWindow = 4
}
```
this could be used easily.
now assume this one
```
[Flags]
enum CarOptions
{
SunroofElectrical,
SunroofMechanical,
Spoiler,
TintedWindowBlack,
TintedWindowPurple
}
```
... | 2011/01/10 | [
"https://Stackoverflow.com/questions/4645718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I guess you would do this by using different enums for Sunroofs and TindedWindows. | You have two options, as I see it:
1) Don't use an `enum`. Use another mechanism for setting options that come in combinations that conflict with one another.
2) Define invalid combinations and Check for them when setting flags:
```
[flags]
enum CarOptions
{
SunroofElectrical = 1,
SunroofMechanical = 2,
Spoile... |
4,645,718 | assume we have an `enum` that has `FlagsAttribute`.
```
[Flags]
enum CarOptions
{
Sunroof = 1,
Spoiler = 2,
TintedWindow = 4
}
```
this could be used easily.
now assume this one
```
[Flags]
enum CarOptions
{
SunroofElectrical,
SunroofMechanical,
Spoiler,
TintedWindowBlack,
TintedWindowPurple
}
```
... | 2011/01/10 | [
"https://Stackoverflow.com/questions/4645718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I guess you would do this by using different enums for Sunroofs and TindedWindows. | You could use one bit of the flags to indicate a particular feature being present, and another to indicate the "flavour" of the feature:
```
[Flags]
enum CarOptions
{
Sunroof = 1,
SunroofElectrical = 1,
SunroofMechanical = 3,
Spoiler = 4,
TintedWindow = 8,
TintedWindowBlack = 8,
TintedWindowPurple = 24
}... |
4,645,718 | assume we have an `enum` that has `FlagsAttribute`.
```
[Flags]
enum CarOptions
{
Sunroof = 1,
Spoiler = 2,
TintedWindow = 4
}
```
this could be used easily.
now assume this one
```
[Flags]
enum CarOptions
{
SunroofElectrical,
SunroofMechanical,
Spoiler,
TintedWindowBlack,
TintedWindowPurple
}
```
... | 2011/01/10 | [
"https://Stackoverflow.com/questions/4645718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | There is no built-in mechanism for this. Flag-enumerations allow any combination of the members to be combined. You will need to perform manual validation in such a scenario or create a model that does not accept invalid options. There are other options but the preferred approach I would choose is similar to this:
```... | I guess you would do this by using different enums for Sunroofs and TindedWindows. |
4,645,718 | assume we have an `enum` that has `FlagsAttribute`.
```
[Flags]
enum CarOptions
{
Sunroof = 1,
Spoiler = 2,
TintedWindow = 4
}
```
this could be used easily.
now assume this one
```
[Flags]
enum CarOptions
{
SunroofElectrical,
SunroofMechanical,
Spoiler,
TintedWindowBlack,
TintedWindowPurple
}
```
... | 2011/01/10 | [
"https://Stackoverflow.com/questions/4645718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | There is no built-in mechanism for this. Flag-enumerations allow any combination of the members to be combined. You will need to perform manual validation in such a scenario or create a model that does not accept invalid options. There are other options but the preferred approach I would choose is similar to this:
```... | You have two options, as I see it:
1) Don't use an `enum`. Use another mechanism for setting options that come in combinations that conflict with one another.
2) Define invalid combinations and Check for them when setting flags:
```
[flags]
enum CarOptions
{
SunroofElectrical = 1,
SunroofMechanical = 2,
Spoile... |
4,645,718 | assume we have an `enum` that has `FlagsAttribute`.
```
[Flags]
enum CarOptions
{
Sunroof = 1,
Spoiler = 2,
TintedWindow = 4
}
```
this could be used easily.
now assume this one
```
[Flags]
enum CarOptions
{
SunroofElectrical,
SunroofMechanical,
Spoiler,
TintedWindowBlack,
TintedWindowPurple
}
```
... | 2011/01/10 | [
"https://Stackoverflow.com/questions/4645718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | There is no built-in mechanism for this. Flag-enumerations allow any combination of the members to be combined. You will need to perform manual validation in such a scenario or create a model that does not accept invalid options. There are other options but the preferred approach I would choose is similar to this:
```... | You could use one bit of the flags to indicate a particular feature being present, and another to indicate the "flavour" of the feature:
```
[Flags]
enum CarOptions
{
Sunroof = 1,
SunroofElectrical = 1,
SunroofMechanical = 3,
Spoiler = 4,
TintedWindow = 8,
TintedWindowBlack = 8,
TintedWindowPurple = 24
}... |
70,837,474 | I am trying to click the button with selenium headless webdriver
```
<button data-qa="STREAKS-QA_claim-button" class="css-19g9d2g" disabled=""><span class="css-kqn307"><span class="css-z2sz3e">Claim</span> <span class="css-1k2c4a5"><span class="infl-fe__styles__icon___3YFBO infl-fe__styles__coins___BelNu" aria-hi... | 2022/01/24 | [
"https://Stackoverflow.com/questions/70837474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4854572/"
] | Please check in the `dev tools` (Google chrome) if we have **unique** entry in `HTML DOM` or not.
**Steps to check:**
`Press F12 in Chrome` -> go to `element` section -> do a `CTRL + F` -> then paste the `xpath/css` and see, if your desired `element` is getting **highlighted** with `1/1` matching node.
If this is a ... | You are missing `'` in your locator.
Also you are probably missing a delay.
If so adding a dummy sleep of
```py
time.sleep(5)
```
Before
```py
element = browser.find_element_by_css_selector("button[data-qa='STREAKS-QA_claim-button']")
element.click()
```
Should work.
However it is recommended to use Expe... |
70,837,474 | I am trying to click the button with selenium headless webdriver
```
<button data-qa="STREAKS-QA_claim-button" class="css-19g9d2g" disabled=""><span class="css-kqn307"><span class="css-z2sz3e">Claim</span> <span class="css-1k2c4a5"><span class="infl-fe__styles__icon___3YFBO infl-fe__styles__coins___BelNu" aria-hi... | 2022/01/24 | [
"https://Stackoverflow.com/questions/70837474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4854572/"
] | Please check in the `dev tools` (Google chrome) if we have **unique** entry in `HTML DOM` or not.
**Steps to check:**
`Press F12 in Chrome` -> go to `element` section -> do a `CTRL + F` -> then paste the `xpath/css` and see, if your desired `element` is getting **highlighted** with `1/1` matching node.
If this is a ... | The element is a ***dynamic*** element. So to click on the element you need to induce [WebDriverWait](https://stackoverflow.com/questions/59130200/selenium-wait-until-element-is-present-visible-and-interactable/59130336#59130336) for the [*element\_to\_be\_clickable()*](https://stackoverflow.com/questions/54193625/how-... |
70,837,474 | I am trying to click the button with selenium headless webdriver
```
<button data-qa="STREAKS-QA_claim-button" class="css-19g9d2g" disabled=""><span class="css-kqn307"><span class="css-z2sz3e">Claim</span> <span class="css-1k2c4a5"><span class="infl-fe__styles__icon___3YFBO infl-fe__styles__coins___BelNu" aria-hi... | 2022/01/24 | [
"https://Stackoverflow.com/questions/70837474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4854572/"
] | You are missing `'` in your locator.
Also you are probably missing a delay.
If so adding a dummy sleep of
```py
time.sleep(5)
```
Before
```py
element = browser.find_element_by_css_selector("button[data-qa='STREAKS-QA_claim-button']")
element.click()
```
Should work.
However it is recommended to use Expe... | The element is a ***dynamic*** element. So to click on the element you need to induce [WebDriverWait](https://stackoverflow.com/questions/59130200/selenium-wait-until-element-is-present-visible-and-interactable/59130336#59130336) for the [*element\_to\_be\_clickable()*](https://stackoverflow.com/questions/54193625/how-... |
26,194 | My 4 year old decided to push in the soft plastic/vinyl domes in the center of two of my M-Audio LX4 studio monitors' woofers.
Can anyone suggest a safe way to pop them back out? I have heard of using a vacuum cleaner which sounds a little extreme, and I know it's possible to use a hooked needle to extract the cloth ... | 2011/09/30 | [
"https://sound.stackexchange.com/questions/26194",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/-1/"
] | I used a piece of duct tape - stick it to the middle of the dome, then pull it out. | I had partial success by sticking a hot glue bar to the dust cap and pulling it. Then using the same hot glue gun to heat and unstick it (Inspired by an automotive painters trick I've seen in videos).
This was a cheap pressed paper dome on a cheap 8 inch woofer. The cap returned mostly to its form but naturally some o... |
4,092,776 | I'm [making a jquery clone](http://code.google.com/p/sharp-query/) for C#. Right now I've got it set up so that every method is an extension method on `IEnumerable<HtmlNode>` so it works well with existing projects that are already using `HtmlAgilityPack`. I thought I could get away without preserving state... however,... | 2010/11/04 | [
"https://Stackoverflow.com/questions/4092776",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/65387/"
] | I think the major stumbling block you're running into here is that you're trying to get away with just having one `SharpQuery` object for each document. That's not how jQuery works; in general, jQuery objects are immutable. When you call a method that changes the set of elements (like `find` or `end` or `add`), it does... | I would lean towards a variant on option 2. In jQuery $() is a function call. C# doesn't have global functions, a static function call is the closest. I would use a method that indicates you're creating a wrapper like..
```
SharpQuery.Create("ul.first").Find(".foo")
```
I wouldn't be concerned about shortening Sharp... |
3,935,675 | I have a relatively large dictionary in Python and would like to be able to not only delete items from it, but actually *reclaim* the memory back from these deletions in my program. I am running across a problem whereby although I delete items from the dictionary and even run the garbage collector manually, Python does... | 2010/10/14 | [
"https://Stackoverflow.com/questions/3935675",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/129475/"
] | A lot of factors go into whether Python returns this memory to the underlying OS or not, which is probably how you're trying to tell if memory is being freed. CPython has a pooled allocator system that tends to hold on to freed memory so that it can be reused in an efficient manner (but these subsequent allocations won... | You're right that Python doesn't resize dictionary back if items are deleted from dictionary. This have nothing to do with OS memory management and garbage collection, it is an implementation detail of Python's dict data structure.
A workaround is to create a new dictionary by copying the old dictionary. Check this g... |
18,509,324 | I got solution(it worked for someone) for my problem:
[Error with Autogenerated file BuildConfig.java - Android](https://stackoverflow.com/questions/11025538/error-with-autogenerated-file-buildconfig-java-android)
Actually I do not have idea how to do this in Sybase unwired platform/eclipse:
**"Fix project propertie... | 2013/08/29 | [
"https://Stackoverflow.com/questions/18509324",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1911947/"
] | Adding jar from Android SDK path...cleared the error. :)
Josh Edit:
Basically I copied the file android.jar from my computer and added it to the path of my Sap Mobile Platform project, which is running on a remote virtual machine.
These are the detailed steps (We all love detailed steps):
go to:
YourAndroidSDKPath\... | Right click the project -> Properties -> Java Build Path -> Libraries -> Add Library -> Android Clathpath Container -> Select your project from avaliable projects in your workspace -> Finish. |
18,509,324 | I got solution(it worked for someone) for my problem:
[Error with Autogenerated file BuildConfig.java - Android](https://stackoverflow.com/questions/11025538/error-with-autogenerated-file-buildconfig-java-android)
Actually I do not have idea how to do this in Sybase unwired platform/eclipse:
**"Fix project propertie... | 2013/08/29 | [
"https://Stackoverflow.com/questions/18509324",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1911947/"
] | Adding jar from Android SDK path...cleared the error. :)
Josh Edit:
Basically I copied the file android.jar from my computer and added it to the path of my Sap Mobile Platform project, which is running on a remote virtual machine.
These are the detailed steps (We all love detailed steps):
go to:
YourAndroidSDKPath\... | I also had this same problem. The solution ended up being that I was using the Android SDK when I needed the Google APIs SDK. Right click project > Android > Select one of the Google APIs checkboxes, then clean and build. |
18,509,324 | I got solution(it worked for someone) for my problem:
[Error with Autogenerated file BuildConfig.java - Android](https://stackoverflow.com/questions/11025538/error-with-autogenerated-file-buildconfig-java-android)
Actually I do not have idea how to do this in Sybase unwired platform/eclipse:
**"Fix project propertie... | 2013/08/29 | [
"https://Stackoverflow.com/questions/18509324",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1911947/"
] | Right click the project -> Properties -> Java Build Path -> Libraries -> Add Library -> Android Clathpath Container -> Select your project from avaliable projects in your workspace -> Finish. | I also had this same problem. The solution ended up being that I was using the Android SDK when I needed the Google APIs SDK. Right click project > Android > Select one of the Google APIs checkboxes, then clean and build. |
70,792,891 | I am new to R so no idea about the code. I have two data frames. One dataframe looks like this.
##### df
| ID | Disease |
| --- | --- |
| GSM239170 | Control |
| GSM239323 | Control |
| GSM239324 | Control |
| GSM239326 | Control |
| GSM239328 | AML |
| GSM239329 | AML |
| GSM239331 | AML |
| GSM239332 | Control |
| ... | 2022/01/20 | [
"https://Stackoverflow.com/questions/70792891",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | We could combine `pivot_longer` with `right_join` and then use `summarise` on the group:
```
library(dplyr)
library(tidyr)
df1 %>%
pivot_longer(
everything(),
names_to = "ID",
values_to = "value"
) %>%
right_join(df, by="ID") %>%
group_by(Disease) %>%
summarise(Min = min(value), Mean = mean(... | It will help to put the second dataframe in long format using `pivot_longer()`:
```
library(tidyr)
newdf <- pivot_longer(df1,
cols = everything(),
names_to = 'ID',
values_to = 'value')
```
Then `merge()` the two dataframes into one:
```
df.all <- merge(df, newdf, by = 'ID', all = T)
```
Then you can ... |
70,792,891 | I am new to R so no idea about the code. I have two data frames. One dataframe looks like this.
##### df
| ID | Disease |
| --- | --- |
| GSM239170 | Control |
| GSM239323 | Control |
| GSM239324 | Control |
| GSM239326 | Control |
| GSM239328 | AML |
| GSM239329 | AML |
| GSM239331 | AML |
| GSM239332 | Control |
| ... | 2022/01/20 | [
"https://Stackoverflow.com/questions/70792891",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | We could combine `pivot_longer` with `right_join` and then use `summarise` on the group:
```
library(dplyr)
library(tidyr)
df1 %>%
pivot_longer(
everything(),
names_to = "ID",
values_to = "value"
) %>%
right_join(df, by="ID") %>%
group_by(Disease) %>%
summarise(Min = min(value), Mean = mean(... | A **base R** approach.
```
df_new <- data.frame(t(df1), ID=colnames(df1))
df_new <- merge(df, df_new, by = 'ID')
out <- apply(df_new[, grep('^X', names(df_new))], 1, function(x) {
data.frame(min=min(x), IQR_low=quantile(x, .25),
mean=mean(x), median=median(x),IQR_high=quantile(x, .75),
max=max(... |
70,792,891 | I am new to R so no idea about the code. I have two data frames. One dataframe looks like this.
##### df
| ID | Disease |
| --- | --- |
| GSM239170 | Control |
| GSM239323 | Control |
| GSM239324 | Control |
| GSM239326 | Control |
| GSM239328 | AML |
| GSM239329 | AML |
| GSM239331 | AML |
| GSM239332 | Control |
| ... | 2022/01/20 | [
"https://Stackoverflow.com/questions/70792891",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Another option with old function `tidyr::gather` to have a column df:
```r
library(tidyverse)
df2_spread <- df1 %>%
tidyr::gather(ID, val) %>%
left_join(df, by = 'ID')
result_1 <- df2_spread %>%
group_by(Disease, gene = ID) %>%
summarise(n = n(),
mean = mean(val),
sd = sd(val),
... | It will help to put the second dataframe in long format using `pivot_longer()`:
```
library(tidyr)
newdf <- pivot_longer(df1,
cols = everything(),
names_to = 'ID',
values_to = 'value')
```
Then `merge()` the two dataframes into one:
```
df.all <- merge(df, newdf, by = 'ID', all = T)
```
Then you can ... |
70,792,891 | I am new to R so no idea about the code. I have two data frames. One dataframe looks like this.
##### df
| ID | Disease |
| --- | --- |
| GSM239170 | Control |
| GSM239323 | Control |
| GSM239324 | Control |
| GSM239326 | Control |
| GSM239328 | AML |
| GSM239329 | AML |
| GSM239331 | AML |
| GSM239332 | Control |
| ... | 2022/01/20 | [
"https://Stackoverflow.com/questions/70792891",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Another option with old function `tidyr::gather` to have a column df:
```r
library(tidyverse)
df2_spread <- df1 %>%
tidyr::gather(ID, val) %>%
left_join(df, by = 'ID')
result_1 <- df2_spread %>%
group_by(Disease, gene = ID) %>%
summarise(n = n(),
mean = mean(val),
sd = sd(val),
... | A **base R** approach.
```
df_new <- data.frame(t(df1), ID=colnames(df1))
df_new <- merge(df, df_new, by = 'ID')
out <- apply(df_new[, grep('^X', names(df_new))], 1, function(x) {
data.frame(min=min(x), IQR_low=quantile(x, .25),
mean=mean(x), median=median(x),IQR_high=quantile(x, .75),
max=max(... |
13,910,046 | We have used Hibernate jars in spring application. Data persistence is done by Java Persistence API using EntityManagerFactory being injected via context xml.
When we switched to Hibernate 4, the application is not getting stopped when it is deployed in tomcat 7. Following is the error.
```
SEVERE: A child container... | 2012/12/17 | [
"https://Stackoverflow.com/questions/13910046",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1785320/"
] | You're going to have to post more than just the stacktrace. I would imagine this is stemming from your injection of your EntityManager into one of your beans. Could you post a sample of one of your beans showing your injection?
Should be similar to:
**Config**
```
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=... | One reason for the HibernateException you are getting could be that your application has explicitly called close() on the EntityManagerFactory that was actually created by Spring.
When Spring destroys the bean for the EntityManagerFactory, it will call close() on it.
Hibernate internally maintains a registry of Entity... |
491,997 | **`Leaks:`**
```
None
```
**`ObjectAlloc:`**
```
Net Bytes: 4,332,512
# Net: 26,696
Overall Bytes: 103,769,552
# Overall: 738,987
```
**`Activity Monitor (MyApp):`**
```
# Thread: 6
Real Memory: 63.65 MB
Virtual Memory: 209.45 MB
```
Memory monitor showed same readings as Activity Monitor. I don't know whether... | 2009/01/29 | [
"https://Stackoverflow.com/questions/491997",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49739/"
] | Memory usage as reported by Object Allocation is not very autoritative, at least according to my experience. The real deal is the real memory consumption as reported by Memory Monitor, see [my question on iPhone memory consumption](https://stackoverflow.com/questions/363493/understanding-the-memory-consumption-on-iphon... | Object Alloc is reporting to the total memory used over the entire lifespan of the run. That means if objects are allocated and deallocated (which they often are) you see all the memory consumed in total.
Far more useful is to select the option "created and still living", then highlight regions of the graph where memo... |
57,588 | I haven't read the novel yet but according to the online sources, the events in *The Martian* take place in 2035 in the novel. I've watched the movie for about 7-8 times till now but couldn't find any clue in the movie about the date. I did carefully inspect many of the computer screens in it where none of them did inc... | 2016/08/01 | [
"https://movies.stackexchange.com/questions/57588",
"https://movies.stackexchange.com",
"https://movies.stackexchange.com/users/16523/"
] | This is opinion, but I'd say there are two reasons:
1. **The film isn't hard SciFi**. Unlike Alien/Blade Runner/Prometheus the sci-fi isn't the driver of the story, it's intended to be a Robinson Crusoe/Cast Away/Apollo 13 kind of thing, about man's will to survive against the odds using ingenuity. To set the film too... | To quote Andy Weir from [this inverview](https://youtu.be/gMfuLtjgzA8?t=19m22s).
>
> The launch window: I won't tell you the date, because I may have a contest some day to have people figure out the launch date from the information in the book. But it is based on a real world date.
>
>
> |
21,947,803 | I am exactly following the steps mentioned in the following doc under the following heading:
[How Do I Run a Sample in an IDE?](http://docs.oracle.com/javafx/2/overview/jfxpub-overview.htm)
However, in Netbeans 7.4, I am getting the following error:
```
ant -f C:\\Users\\akhare\\Desktop\\javafx_samples-2_2_51-wi... | 2014/02/22 | [
"https://Stackoverflow.com/questions/21947803",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | According to solution [here](http://www.smogon.com/forums/threads/cannot-compile-shoddybattleclient2.59844/), Which solved my problem, You need to go to your project properties and change your `java platform` from `JDK xxx(default)` to `JDK xxx` | Usually when I try opening a project with those kind of errors, it asks me to resolve the problem.
What you can do now is right click on the project in the project window and choose properties. In the Libraries node you can set the java platform. Then it will build the project using that platform.

However, in Netbeans 7.4, I am getting the following error:
```
ant -f C:\\Users\\akhare\\Desktop\\javafx_samples-2_2_51-wi... | 2014/02/22 | [
"https://Stackoverflow.com/questions/21947803",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | According to solution [here](http://www.smogon.com/forums/threads/cannot-compile-shoddybattleclient2.59844/), Which solved my problem, You need to go to your project properties and change your `java platform` from `JDK xxx(default)` to `JDK xxx` | Yashar's solution worked for me if you do a clean and build after.
To elaborate, right-click on project, select properties, click on libraries, click on manage platforms..., then add platform..., then just reselect your default platform, so it doesnt have the JDK x.x (Default), instead is just JDK x.x
the output windo... |
21,947,803 | I am exactly following the steps mentioned in the following doc under the following heading:
[How Do I Run a Sample in an IDE?](http://docs.oracle.com/javafx/2/overview/jfxpub-overview.htm)
However, in Netbeans 7.4, I am getting the following error:
```
ant -f C:\\Users\\akhare\\Desktop\\javafx_samples-2_2_51-wi... | 2014/02/22 | [
"https://Stackoverflow.com/questions/21947803",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | According to solution [here](http://www.smogon.com/forums/threads/cannot-compile-shoddybattleclient2.59844/), Which solved my problem, You need to go to your project properties and change your `java platform` from `JDK xxx(default)` to `JDK xxx` | Right-click on
>
> Project libraries --> properties --> select a platform
>
>
>
even if a platform is selected, reselect it. |
2,778,558 | I am at the point where I understand binary quite well, so I decided to look at the hexadecimal numerical system, but I'm a bit stumped with the logic behind it. For those of you who understand it, you know that numbers 10 through 15 (decimal) are represented by letters A through F respectively within the hexadecimal s... | 2018/05/12 | [
"https://math.stackexchange.com/questions/2778558",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/554214/"
] | It is like positional notation in decimal. Each digit to the left is worth $16$ times more than the one on the right, so $1F\_{16}=1\cdot 16+15\cdot 1=31$ For a larger example, note that the third digit is worth $16\cdot 16=256$, so $ABC\_{16}=10\cdot 256+11\cdot 16+12=2748$ | You might find it more helpful to compare it to the decimal system you are also familiar with, where the number written as $d\_k d\_{k-1} \dotsm d\_2 d\_1 d\_0$ (where each $d\_i$ is between $0$ and $9$ inclusive) means $10^0 d\_0 + 10^1 d\_1 + 10^2 d\_2 + \dotsb + 10^{k-1}d\_{k-1} + 10^k d\_k $: in hexadecimal you hav... |
49,241 | As homework, I need to proove whether a few linear transformations are isomorphic or not, however i do not know how to achieve this. First of all i have proven that the following map is linear:
$$f:\mathbb{R}^2\mapsto\mathbb{R}^2, f\left( \begin{bmatrix}x\\y\end{bmatrix} \right)=x\begin{bmatrix}1\\1\end{bmatrix} + y \b... | 2011/07/03 | [
"https://math.stackexchange.com/questions/49241",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/12864/"
] | See the kernel of the linear transformation. If it contains only the zero vector, then the linear transformation is one to one and hence an isomorphism (as the two spaces in question are of the same finite dimension).
Clearly,
$$\begin{aligned}
\operatorname{ker}T&=\{(x,y):T(x,y)=(0,0)\} \\
&=\{(x,y):(x-y,x+y)=(0,0)\... | By the definition the linear isomorphism is a linear bijective map. We should show that for *any* point $(x,y)\in \mathbb R^2$ there exists *unique* point $(x',y')\in \mathbb R^2$ such that $f(x',y') = (x,y)$ (this point is called *pre-image* of $(x,y)$).
Note that these *any* + *unique* are properties of a bijection.... |
13,287,726 | For the context, client-side I use the MVP pattern, so the view with the `One` list knows only the ID, and when my new `Many` is received on the server, I want to be able to just update the `One`'s foreign key, with a "setOneId" or an empty `One` object with an ID set to the wanted value.
So I try to create a many-to-... | 2012/11/08 | [
"https://Stackoverflow.com/questions/13287726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1365284/"
] | You could use a function from [here](https://stackoverflow.com/a/7557433/1520714) to check if the `list_item_btn` is in the viewport and if not then hide it.
```
var anyHidden = 0;
$("div.list_item_btn").each(function() {
if (!elementInViewport($(this))) {
anyHidden = 1;
$(this).hide();
} else {
$(this... | ```
function resizeMenu() {
var win_h = $(window).height();
var height = 220;
for(var i=1; i <= $('div.list_item_btn').length; i++){
if (win_h < height) {
$('div.list_item_btn').show().slice(i).hide();
$('.down_arrow').show();
height += 68;
... |
32,494,793 | I have a file named lol.txt containing text as following:
```
10000002$11-beta-hydroxylase deficiency$$10010331$$$$$$$$
10000005$17 ketosteroids urine$$10022891$$$$$$$$
10000007$17 ketosteroids urine decreased$$10022891$$$$$$$$
10000009$17 ketosteroids urine increased$$10022891$$$$$$$$
10000011$17 ketosteroids urine n... | 2015/09/10 | [
"https://Stackoverflow.com/questions/32494793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4837092/"
] | The method accepts a regex, and not a String. `$` has a special meaning in regex, you should quote it to treat it as the *String* "$", you have two options:
* Escaping the special characters with `\` (in Java `\` is represented as `\\`):
`read.useDelimiter("\\$");`
* Use [`Pattern#quote`](http://docs.oracle.com/javas... | I'd suggest to read the input line-by-line and then parse lines (for example, using [`String.split`](https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#split%28java.lang.String,%20int%29)). Also store the result to the [`ArrayList`](https://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html), not t... |
32,494,793 | I have a file named lol.txt containing text as following:
```
10000002$11-beta-hydroxylase deficiency$$10010331$$$$$$$$
10000005$17 ketosteroids urine$$10022891$$$$$$$$
10000007$17 ketosteroids urine decreased$$10022891$$$$$$$$
10000009$17 ketosteroids urine increased$$10022891$$$$$$$$
10000011$17 ketosteroids urine n... | 2015/09/10 | [
"https://Stackoverflow.com/questions/32494793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4837092/"
] | The method accepts a regex, and not a String. `$` has a special meaning in regex, you should quote it to treat it as the *String* "$", you have two options:
* Escaping the special characters with `\` (in Java `\` is represented as `\\`):
`read.useDelimiter("\\$");`
* Use [`Pattern#quote`](http://docs.oracle.com/javas... | First of all you need to escape your `$` character, because [delimiter](http://www.java2s.com/Tutorial/Java/0180__File/SettingDelimitersforScanner.htm) in scan accepts regexp.
And secondly use list instead of list of variables, its's more flexible.
```
public static void main(String[] args) throws FileNotFoundExceptio... |
41,935 | I ask, because I have to come up with a first-order logic sentence that shows that there are exactly N objects in the universe. What I've been able to come up with is:
$$ \forall x \; \exists y\_1, y\_2, \dots , y\_{n-1} \; (x \neq y\_1) \land (x \neq y\_2) \land \dots \land (x \neq y\_{n-1})$$
I'm not sure if this i... | 2015/04/28 | [
"https://cs.stackexchange.com/questions/41935",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/31147/"
] | Strictly speaking, your statement is invalid because $\ldots$ is not part of the syntax of first-order logic. However, your statement is an *abbreviation* of a statement in first-order logic. For example, when $n = 3$, your statement is an abbreviation of the bona fide statement
$$ \forall x, \exists y\_1, y\_2 (x \neq... | Your question was: find a first-order logic sentence stating that there are exactly $n$ objects in the universe. The following formula should work:
$$
\exists x\_1\ ... \exists x\_n\ \Bigl(\bigwedge\_{1 \leqslant i < j \leqslant n} \neg(x\_i = x\_j)\Bigr) \wedge \forall x \ \Bigl(\bigvee\_{1 \leqslant i \leqslant n} (... |
41,935 | I ask, because I have to come up with a first-order logic sentence that shows that there are exactly N objects in the universe. What I've been able to come up with is:
$$ \forall x \; \exists y\_1, y\_2, \dots , y\_{n-1} \; (x \neq y\_1) \land (x \neq y\_2) \land \dots \land (x \neq y\_{n-1})$$
I'm not sure if this i... | 2015/04/28 | [
"https://cs.stackexchange.com/questions/41935",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/31147/"
] | Strictly speaking, your statement is invalid because $\ldots$ is not part of the syntax of first-order logic. However, your statement is an *abbreviation* of a statement in first-order logic. For example, when $n = 3$, your statement is an abbreviation of the bona fide statement
$$ \forall x, \exists y\_1, y\_2 (x \neq... | ### Short answer
Yes, you can use ellipses, as long as it is absolutely clear what they mean. In the example in your question, it is absolutely clear what the ellipses mean.
**Note.** The formula does not, in fact, express the property that the domain has exactly $n$ elements but this is a side-issue: your question w... |
41,935 | I ask, because I have to come up with a first-order logic sentence that shows that there are exactly N objects in the universe. What I've been able to come up with is:
$$ \forall x \; \exists y\_1, y\_2, \dots , y\_{n-1} \; (x \neq y\_1) \land (x \neq y\_2) \land \dots \land (x \neq y\_{n-1})$$
I'm not sure if this i... | 2015/04/28 | [
"https://cs.stackexchange.com/questions/41935",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/31147/"
] | Strictly speaking, your statement is invalid because $\ldots$ is not part of the syntax of first-order logic. However, your statement is an *abbreviation* of a statement in first-order logic. For example, when $n = 3$, your statement is an abbreviation of the bona fide statement
$$ \forall x, \exists y\_1, y\_2 (x \neq... | Assuming you work with the usual definition of FOL, no, that iss *not* a syntactically valid formula. "$\dots$" does not appear in the formal grammar specifying the language.
However, "$\dots$" is commonly and implicitly accepted as a shorthand. As long as it is clear how to fill the gap with finitely many symbols, it... |
41,935 | I ask, because I have to come up with a first-order logic sentence that shows that there are exactly N objects in the universe. What I've been able to come up with is:
$$ \forall x \; \exists y\_1, y\_2, \dots , y\_{n-1} \; (x \neq y\_1) \land (x \neq y\_2) \land \dots \land (x \neq y\_{n-1})$$
I'm not sure if this i... | 2015/04/28 | [
"https://cs.stackexchange.com/questions/41935",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/31147/"
] | ### Short answer
Yes, you can use ellipses, as long as it is absolutely clear what they mean. In the example in your question, it is absolutely clear what the ellipses mean.
**Note.** The formula does not, in fact, express the property that the domain has exactly $n$ elements but this is a side-issue: your question w... | Your question was: find a first-order logic sentence stating that there are exactly $n$ objects in the universe. The following formula should work:
$$
\exists x\_1\ ... \exists x\_n\ \Bigl(\bigwedge\_{1 \leqslant i < j \leqslant n} \neg(x\_i = x\_j)\Bigr) \wedge \forall x \ \Bigl(\bigvee\_{1 \leqslant i \leqslant n} (... |
41,935 | I ask, because I have to come up with a first-order logic sentence that shows that there are exactly N objects in the universe. What I've been able to come up with is:
$$ \forall x \; \exists y\_1, y\_2, \dots , y\_{n-1} \; (x \neq y\_1) \land (x \neq y\_2) \land \dots \land (x \neq y\_{n-1})$$
I'm not sure if this i... | 2015/04/28 | [
"https://cs.stackexchange.com/questions/41935",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/31147/"
] | Assuming you work with the usual definition of FOL, no, that iss *not* a syntactically valid formula. "$\dots$" does not appear in the formal grammar specifying the language.
However, "$\dots$" is commonly and implicitly accepted as a shorthand. As long as it is clear how to fill the gap with finitely many symbols, it... | Your question was: find a first-order logic sentence stating that there are exactly $n$ objects in the universe. The following formula should work:
$$
\exists x\_1\ ... \exists x\_n\ \Bigl(\bigwedge\_{1 \leqslant i < j \leqslant n} \neg(x\_i = x\_j)\Bigr) \wedge \forall x \ \Bigl(\bigvee\_{1 \leqslant i \leqslant n} (... |
41,935 | I ask, because I have to come up with a first-order logic sentence that shows that there are exactly N objects in the universe. What I've been able to come up with is:
$$ \forall x \; \exists y\_1, y\_2, \dots , y\_{n-1} \; (x \neq y\_1) \land (x \neq y\_2) \land \dots \land (x \neq y\_{n-1})$$
I'm not sure if this i... | 2015/04/28 | [
"https://cs.stackexchange.com/questions/41935",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/31147/"
] | ### Short answer
Yes, you can use ellipses, as long as it is absolutely clear what they mean. In the example in your question, it is absolutely clear what the ellipses mean.
**Note.** The formula does not, in fact, express the property that the domain has exactly $n$ elements but this is a side-issue: your question w... | Assuming you work with the usual definition of FOL, no, that iss *not* a syntactically valid formula. "$\dots$" does not appear in the formal grammar specifying the language.
However, "$\dots$" is commonly and implicitly accepted as a shorthand. As long as it is clear how to fill the gap with finitely many symbols, it... |
320,409 | Is there any way I can disable bluetooth in the BIOS of a HP ProBook 4530S? I want to permanently remove bluetooth from the system. | 2011/08/08 | [
"https://superuser.com/questions/320409",
"https://superuser.com",
"https://superuser.com/users/93232/"
] | You can't really "permanently remove" bluetooth from the system because it is actually just a piece of hardware.
The closes to this you can do is to disable access to it for anyone using the system:
In your BIOS there should be an option to set the wireless-antennae status. Find the bluetooth adapter section and disa... | You can't really do that without a screwdriver, but if all you want is to shut it off permanently, go into device manager (type it into the search in the start menu), go to network devices, find bluetooth, and disable it. If you want pictures, or more info, your OS could help. |
320,409 | Is there any way I can disable bluetooth in the BIOS of a HP ProBook 4530S? I want to permanently remove bluetooth from the system. | 2011/08/08 | [
"https://superuser.com/questions/320409",
"https://superuser.com",
"https://superuser.com/users/93232/"
] | You can't really "permanently remove" bluetooth from the system because it is actually just a piece of hardware.
The closes to this you can do is to disable access to it for anyone using the system:
In your BIOS there should be an option to set the wireless-antennae status. Find the bluetooth adapter section and disa... | Must be run with root privileges:
defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState 0
Turns OFF bluetooth
defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState 1
Turns on bluetooth |
3,176,977 | I am using the OnMouseMove event to detect when the mouse pointer is over my TPanel, is there a way to know when the mouse pointer had moved away from it?
I need the panel to change colour when the mouse pointer is over it and return to its original colour once it moved away from it?
I am using Delphi 6 by the way.
... | 2010/07/05 | [
"https://Stackoverflow.com/questions/3176977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/195060/"
] | You can use OnMouseEnter/OnMouseLeave event pair to detect mouse
```
procedure TForm1.Panel1MouseEnter(Sender: TObject);
begin
Panel1.Caption:= 'IN';
Panel1.Color:= clBlue;
end;
procedure TForm1.Panel1MouseLeave(Sender: TObject);
begin
Panel1.Caption:= 'OUT';
Panel1.Color:= clWhite;
end;
```
---
I can't te... | If you don't have OnMouseEnter and OnMouseLeave then use OnMouseMove and capture the mouse to your panel. Capturing the mouse is slightly more work but the effects are better.
```
procedure Form1.Panel1MouseMove(Sender:TObject; Shift:TShiftState; X,Y:Integer);
begin
if (X >= 0) and (Y >= 0) and (X < Panel1.Width) an... |
3,176,977 | I am using the OnMouseMove event to detect when the mouse pointer is over my TPanel, is there a way to know when the mouse pointer had moved away from it?
I need the panel to change colour when the mouse pointer is over it and return to its original colour once it moved away from it?
I am using Delphi 6 by the way.
... | 2010/07/05 | [
"https://Stackoverflow.com/questions/3176977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/195060/"
] | Yet another solution, using `TrackMouseEvent` to receive `WM_MOUSELEAVE`;
```
type
TMyPanel = class(TPanel)
private
FMouseTracking: Boolean;
FOnMouseLeave: TNotifyEvent;
procedure WMMouseLeave(var Msg: TMessage); message WM_MOUSELEAVE;
protected
procedure MouseMove(Shift: TShiftState; X, Y: Integ... | If you don't have OnMouseEnter and OnMouseLeave then use OnMouseMove and capture the mouse to your panel. Capturing the mouse is slightly more work but the effects are better.
```
procedure Form1.Panel1MouseMove(Sender:TObject; Shift:TShiftState; X,Y:Integer);
begin
if (X >= 0) and (Y >= 0) and (X < Panel1.Width) an... |
3,176,977 | I am using the OnMouseMove event to detect when the mouse pointer is over my TPanel, is there a way to know when the mouse pointer had moved away from it?
I need the panel to change colour when the mouse pointer is over it and return to its original colour once it moved away from it?
I am using Delphi 6 by the way.
... | 2010/07/05 | [
"https://Stackoverflow.com/questions/3176977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/195060/"
] | OnMouseLeave. Beware that you also need to see if the mouse left the whole application as I've had OnMouseLeave not fire when the panel was on the edge of the form and I went off the form. | thanks for the help. To me work very well, I make a new bitbtn control derived from original bitbtn and implements the mouseenter and mouse leave, with Delphi 7. Follow my code:
```
TBitBtnPanel = class(TBitBtn)
private
{ Private declarations }
FOnMouseLeave: TNotifyEvent;
FOnMouseEnter: TNotifyEvent;
... |
3,176,977 | I am using the OnMouseMove event to detect when the mouse pointer is over my TPanel, is there a way to know when the mouse pointer had moved away from it?
I need the panel to change colour when the mouse pointer is over it and return to its original colour once it moved away from it?
I am using Delphi 6 by the way.
... | 2010/07/05 | [
"https://Stackoverflow.com/questions/3176977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/195060/"
] | Yet another solution, using `TrackMouseEvent` to receive `WM_MOUSELEAVE`;
```
type
TMyPanel = class(TPanel)
private
FMouseTracking: Boolean;
FOnMouseLeave: TNotifyEvent;
procedure WMMouseLeave(var Msg: TMessage); message WM_MOUSELEAVE;
protected
procedure MouseMove(Shift: TShiftState; X, Y: Integ... | thanks for the help. To me work very well, I make a new bitbtn control derived from original bitbtn and implements the mouseenter and mouse leave, with Delphi 7. Follow my code:
```
TBitBtnPanel = class(TBitBtn)
private
{ Private declarations }
FOnMouseLeave: TNotifyEvent;
FOnMouseEnter: TNotifyEvent;
... |
3,176,977 | I am using the OnMouseMove event to detect when the mouse pointer is over my TPanel, is there a way to know when the mouse pointer had moved away from it?
I need the panel to change colour when the mouse pointer is over it and return to its original colour once it moved away from it?
I am using Delphi 6 by the way.
... | 2010/07/05 | [
"https://Stackoverflow.com/questions/3176977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/195060/"
] | Yet another solution, using `TrackMouseEvent` to receive `WM_MOUSELEAVE`;
```
type
TMyPanel = class(TPanel)
private
FMouseTracking: Boolean;
FOnMouseLeave: TNotifyEvent;
procedure WMMouseLeave(var Msg: TMessage); message WM_MOUSELEAVE;
protected
procedure MouseMove(Shift: TShiftState; X, Y: Integ... | Create your own component derived from the `TCustomPanel` (or `TPanel`), since Delphi 6 doesn't have the MouseEnter and MouseLeave events on by default, you can add them yourself. Add this to the private section of your declaration section:
```
procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
proc... |
3,176,977 | I am using the OnMouseMove event to detect when the mouse pointer is over my TPanel, is there a way to know when the mouse pointer had moved away from it?
I need the panel to change colour when the mouse pointer is over it and return to its original colour once it moved away from it?
I am using Delphi 6 by the way.
... | 2010/07/05 | [
"https://Stackoverflow.com/questions/3176977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/195060/"
] | You can use OnMouseEnter/OnMouseLeave event pair to detect mouse
```
procedure TForm1.Panel1MouseEnter(Sender: TObject);
begin
Panel1.Caption:= 'IN';
Panel1.Color:= clBlue;
end;
procedure TForm1.Panel1MouseLeave(Sender: TObject);
begin
Panel1.Caption:= 'OUT';
Panel1.Color:= clWhite;
end;
```
---
I can't te... | thanks for the help. To me work very well, I make a new bitbtn control derived from original bitbtn and implements the mouseenter and mouse leave, with Delphi 7. Follow my code:
```
TBitBtnPanel = class(TBitBtn)
private
{ Private declarations }
FOnMouseLeave: TNotifyEvent;
FOnMouseEnter: TNotifyEvent;
... |
3,176,977 | I am using the OnMouseMove event to detect when the mouse pointer is over my TPanel, is there a way to know when the mouse pointer had moved away from it?
I need the panel to change colour when the mouse pointer is over it and return to its original colour once it moved away from it?
I am using Delphi 6 by the way.
... | 2010/07/05 | [
"https://Stackoverflow.com/questions/3176977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/195060/"
] | OnMouseLeave. Beware that you also need to see if the mouse left the whole application as I've had OnMouseLeave not fire when the panel was on the edge of the form and I went off the form. | Create your own component derived from the `TCustomPanel` (or `TPanel`), since Delphi 6 doesn't have the MouseEnter and MouseLeave events on by default, you can add them yourself. Add this to the private section of your declaration section:
```
procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
proc... |
3,176,977 | I am using the OnMouseMove event to detect when the mouse pointer is over my TPanel, is there a way to know when the mouse pointer had moved away from it?
I need the panel to change colour when the mouse pointer is over it and return to its original colour once it moved away from it?
I am using Delphi 6 by the way.
... | 2010/07/05 | [
"https://Stackoverflow.com/questions/3176977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/195060/"
] | If you don't have OnMouseEnter and OnMouseLeave then use OnMouseMove and capture the mouse to your panel. Capturing the mouse is slightly more work but the effects are better.
```
procedure Form1.Panel1MouseMove(Sender:TObject; Shift:TShiftState; X,Y:Integer);
begin
if (X >= 0) and (Y >= 0) and (X < Panel1.Width) an... | thanks for the help. To me work very well, I make a new bitbtn control derived from original bitbtn and implements the mouseenter and mouse leave, with Delphi 7. Follow my code:
```
TBitBtnPanel = class(TBitBtn)
private
{ Private declarations }
FOnMouseLeave: TNotifyEvent;
FOnMouseEnter: TNotifyEvent;
... |
3,176,977 | I am using the OnMouseMove event to detect when the mouse pointer is over my TPanel, is there a way to know when the mouse pointer had moved away from it?
I need the panel to change colour when the mouse pointer is over it and return to its original colour once it moved away from it?
I am using Delphi 6 by the way.
... | 2010/07/05 | [
"https://Stackoverflow.com/questions/3176977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/195060/"
] | You can use OnMouseEnter/OnMouseLeave event pair to detect mouse
```
procedure TForm1.Panel1MouseEnter(Sender: TObject);
begin
Panel1.Caption:= 'IN';
Panel1.Color:= clBlue;
end;
procedure TForm1.Panel1MouseLeave(Sender: TObject);
begin
Panel1.Caption:= 'OUT';
Panel1.Color:= clWhite;
end;
```
---
I can't te... | OnMouseLeave. Beware that you also need to see if the mouse left the whole application as I've had OnMouseLeave not fire when the panel was on the edge of the form and I went off the form. |
3,176,977 | I am using the OnMouseMove event to detect when the mouse pointer is over my TPanel, is there a way to know when the mouse pointer had moved away from it?
I need the panel to change colour when the mouse pointer is over it and return to its original colour once it moved away from it?
I am using Delphi 6 by the way.
... | 2010/07/05 | [
"https://Stackoverflow.com/questions/3176977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/195060/"
] | Yet another solution, using `TrackMouseEvent` to receive `WM_MOUSELEAVE`;
```
type
TMyPanel = class(TPanel)
private
FMouseTracking: Boolean;
FOnMouseLeave: TNotifyEvent;
procedure WMMouseLeave(var Msg: TMessage); message WM_MOUSELEAVE;
protected
procedure MouseMove(Shift: TShiftState; X, Y: Integ... | OnMouseLeave. Beware that you also need to see if the mouse left the whole application as I've had OnMouseLeave not fire when the panel was on the edge of the form and I went off the form. |
66,305,252 | I want to extract specific elements, specifically ID, from rows that have NAs. Here is my df:
```
df
ID x
1-12 1
1-13 NA
1-14 3
2-12 20
3-11 NA
```
I want a dataframe that has the IDs of observations that are NA, like so:
```
df
ID x
1-13 NA
3-11 ... | 2021/02/21 | [
"https://Stackoverflow.com/questions/66305252",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10568575/"
] | Fetching the `Address` objects here is the bottleneck. You can fetch the `Adress` objects in bulk and use a dictionary, like:
```
def update_postal_code_addresses(request):
postal_codes = PostalCode.objects.all()
addresses = Address.objects.only('pk', 'postal_code')
address_dict = {
address.pos... | All the read calls to the Address table are what's making your query slow.
There are many ways to help with your query based on the resources at your disposal, but the first step would be to reduce the amount of reads you're doing by iterating into the Address table instead of gathering them one by one and by storing P... |
11,368,670 | If I wish to store application username/passwords in a database, it is unclear whether I should use the RDBMS Authentication Provider functionality (on the Providers tab in the Security Realm section of the WebLogic console) or the RDBMS Security Store functionality (on the RDBMS security store tab in the Security Real... | 2012/07/06 | [
"https://Stackoverflow.com/questions/11368670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/203802/"
] | EntityListners do not support CDI, at least in JPA 2.0. It's apparently on the list of things new in [JPA 2.1](https://blogs.oracle.com/arungupta/entry/jpa_2_1_early_draft)
I was also surprised when I ran across this. | >
> To this time, I tried the plain @Inject UserSession us; which always injects a null value.
>
>
>
This is because in JPA 2.0 the classes are not managed by CDI, so @Inject won't work with them. These classes are managed by CDI from JPA 2.1 onward as pointed out by Steve K.
>
> I also tried UserSession us = (U... |
11,368,670 | If I wish to store application username/passwords in a database, it is unclear whether I should use the RDBMS Authentication Provider functionality (on the Providers tab in the Security Realm section of the WebLogic console) or the RDBMS Security Store functionality (on the RDBMS security store tab in the Security Real... | 2012/07/06 | [
"https://Stackoverflow.com/questions/11368670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/203802/"
] | I eventually found a workaround, which allows me to get a reference of the `@Stateful` bean:
I created a `@Named @Singleton @Startup` bean SessionController which holds a local `HashMap<String, UserSession> sessionMap` with the references of my `@Stateful` beans:
```
@Named
@Singleton
@Startup
@ConcurrencyManagement(... | >
> To this time, I tried the plain @Inject UserSession us; which always injects a null value.
>
>
>
This is because in JPA 2.0 the classes are not managed by CDI, so @Inject won't work with them. These classes are managed by CDI from JPA 2.1 onward as pointed out by Steve K.
>
> I also tried UserSession us = (U... |
233,307 | I am trying to measure distances between basket assortments in a grocery shopping.
I have all information that who buys what in every shopping by online and offline.
I want to see the pattern of the assortments in baskets and compare between online shopping and offline shopping.
So, for a certain customer, I am try... | 2016/09/04 | [
"https://stats.stackexchange.com/questions/233307",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/111567/"
] | [Jaccard Index](https://en.wikipedia.org/wiki/Jaccard_index) is often used to calculate similarity of such sample sets.
Let's assume there are 4 products $P\_1,P\_2,P\_3,P\_4$ that can be bought offline or online.
So if $S\_{off} = [1,0,1,1]$ and $S\_{on} = [1,0,0,1]$
Jaccard similarity = $\frac{S\_{off}\cap S\_{on}... | If you have the data in the form of a large table (well, matrix) with one row for each customer (or, maybe, each "basket") and one column for each product, and each matrix entry is maybe number of items bought or simply money. Then, one possible and natural method of analysis will be correspondence analysis (mostly use... |
567,985 | Since updating to the 2020 Fall release (MikTeX on Windows but also tested with TeXLive), I can no longer compile files where tables are imported from an external file using `\input` and followed by `\hline` (or `\bottomrule`).
Things work perfectly with older releases.
Note that it works if the last `\\` is outside ... | 2020/10/23 | [
"https://tex.stackexchange.com/questions/567985",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/227401/"
] | Yes, LaTeX changed here, but it also added new environments hooks, and you could use them to change to the primitive input in all tabular, This would have the additional benefit, that it will also work, if the file starts with a `\multicolumn`.
(That the engine accepts a braced input is rather new too).
```
\document... | Using the primitive behaviour of TeX's `\input` works. This can be used in LaTeX if you omit the braces around the filename, in which case LaTeX will fallback to the primitive.
You'll lose some of the niceties of LaTeX's file handling (no hooks, no utf8 support for filenames in pdfTeX, no spaces in filenames allowed, ... |
54,705,388 | I am setting sharedPreferences value on my fragment (Kotlin) , then I would like to use this value on my FirebaseMessagingService (Java). When I set value and destroy app and open again, there isn't any problem on my fragment. I can see the set value. So I am sure that sharedPreferences value updated by my fragment. Bu... | 2019/02/15 | [
"https://Stackoverflow.com/questions/54705388",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1744538/"
] | I had a similar problem, with not everything from Android api working correctly in my FirebaseMessagingService.
I figured this can have something to do with limitations of running background services from Oreo and higher, and FCM messages being of exception to those
<https://developer.android.com/about/versions/oreo/b... | I solved the problem finally..
There are two types of messages in FCM (Firebase Cloud Messaging):
Display Messages: These messages trigger the onMessageReceived() callback only when your app is in foreground
Data Messages: Theses messages trigger the onMessageReceived() callback even if your app is in foreground/bac... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.