qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
34,041,384 | I created a setup by Advanced Installer software for my program that I've written by c#. I installed my program on VMWare Windows7.
When I try to run it this message is displayed:
 | 2015/12/02 | [
"https://Stackoverflow.com/questions/34041384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5394345/"
] | It would be a good idea to add a default case to your switch statement.
Example:
```
switch (monthNumber) {
case 1: monthString = "January";
break;
//other cases...
default: monthString = "Invalid Month Number";
break;
}
```
This way if `monthNumber` is not 1-12 then there is still a d... | Because the designer of Java language believes it made more sense for it to be! Codes are easier to read when variables are initialised. A statement `String foo;` feels non-deterministic because you have to guess what's the default value of String is whereas `String foo = null;` is more deterministic.
To give you a mo... |
34,041,384 | I created a setup by Advanced Installer software for my program that I've written by c#. I installed my program on VMWare Windows7.
When I try to run it this message is displayed:
 | 2015/12/02 | [
"https://Stackoverflow.com/questions/34041384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5394345/"
] | It would be a good idea to add a default case to your switch statement.
Example:
```
switch (monthNumber) {
case 1: monthString = "January";
break;
//other cases...
default: monthString = "Invalid Month Number";
break;
}
```
This way if `monthNumber` is not 1-12 then there is still a d... | Local variables MUST always be initialized before use.
For Java 6, the compiler doesn't consider the **"Incomplete"** initialization of variables within flow control blocks and try-catch blocks. The initialization must be done for all cases:
**If - else**:
```
String s;
int a = 10;
if(a > 5){
s = "5";
}else{
System... |
34,041,384 | I created a setup by Advanced Installer software for my program that I've written by c#. I installed my program on VMWare Windows7.
When I try to run it this message is displayed:
 | 2015/12/02 | [
"https://Stackoverflow.com/questions/34041384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5394345/"
] | May be this link will help to get proper understanding.
```
http://stackoverflow.com/questions/5478996/should-java-string-method-local-variables-be-initialized-to-null-or
``` | Local variables MUST always be initialized before use.
For Java 6, the compiler doesn't consider the **"Incomplete"** initialization of variables within flow control blocks and try-catch blocks. The initialization must be done for all cases:
**If - else**:
```
String s;
int a = 10;
if(a > 5){
s = "5";
}else{
System... |
34,041,384 | I created a setup by Advanced Installer software for my program that I've written by c#. I installed my program on VMWare Windows7.
When I try to run it this message is displayed:
 | 2015/12/02 | [
"https://Stackoverflow.com/questions/34041384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5394345/"
] | Because the designer of Java language believes it made more sense for it to be! Codes are easier to read when variables are initialised. A statement `String foo;` feels non-deterministic because you have to guess what's the default value of String is whereas `String foo = null;` is more deterministic.
To give you a mo... | Local variables MUST always be initialized before use.
For Java 6, the compiler doesn't consider the **"Incomplete"** initialization of variables within flow control blocks and try-catch blocks. The initialization must be done for all cases:
**If - else**:
```
String s;
int a = 10;
if(a > 5){
s = "5";
}else{
System... |
34,041,384 | I created a setup by Advanced Installer software for my program that I've written by c#. I installed my program on VMWare Windows7.
When I try to run it this message is displayed:
 | 2015/12/02 | [
"https://Stackoverflow.com/questions/34041384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5394345/"
] | monthString is a local variable within main(), therefore, it must be initialized to prevent the compiler error.
If monthString were a Class variable then it does not have to be initialized explicitly.
You can do this by moving monthString outside of main() and declare it as:
static String monthString; | Local variables MUST always be initialized before use.
For Java 6, the compiler doesn't consider the **"Incomplete"** initialization of variables within flow control blocks and try-catch blocks. The initialization must be done for all cases:
**If - else**:
```
String s;
int a = 10;
if(a > 5){
s = "5";
}else{
System... |
34,041,384 | I created a setup by Advanced Installer software for my program that I've written by c#. I installed my program on VMWare Windows7.
When I try to run it this message is displayed:
 | 2015/12/02 | [
"https://Stackoverflow.com/questions/34041384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5394345/"
] | May be this link will help to get proper understanding.
```
http://stackoverflow.com/questions/5478996/should-java-string-method-local-variables-be-initialized-to-null-or
``` | Because the designer of Java language believes it made more sense for it to be! Codes are easier to read when variables are initialised. A statement `String foo;` feels non-deterministic because you have to guess what's the default value of String is whereas `String foo = null;` is more deterministic.
To give you a mo... |
34,041,384 | I created a setup by Advanced Installer software for my program that I've written by c#. I installed my program on VMWare Windows7.
When I try to run it this message is displayed:
 | 2015/12/02 | [
"https://Stackoverflow.com/questions/34041384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5394345/"
] | What if `monthNumber` is not between 1 and 12? In that case, `monthString` won't be initialized. You should give it some default value when you declare it :
```
String monthString = null; // or ""
``` | Because the designer of Java language believes it made more sense for it to be! Codes are easier to read when variables are initialised. A statement `String foo;` feels non-deterministic because you have to guess what's the default value of String is whereas `String foo = null;` is more deterministic.
To give you a mo... |
7,032,562 | I need to create a INNO Setup script that will allow me to have a dialog, where the user can type in a serial number, then I need to save the serial number they entered into the Windows registry.
Also, if they don't enter a serial number, the next button needs to be disabled, so that they cannot proceed with the insta... | 2011/08/11 | [
"https://Stackoverflow.com/questions/7032562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/416056/"
] | Here's a stripped down sample of what I use in my scripts. Also, take a look at the InnoSetup docs for CheckSerial (http://www.jrsoftware.org/ishelp/topic\_setup\_userinfopage.htm).
```
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#defin... | Inno can prompt the user for this information when you set the UserInfoPage=yes directivve.
If you add a CheckSerial event function, it will also ask for the registration details.
See the [UserInfoPage](http://www.jrsoftware.org/ishelp/topic_setup_userinfopage.htm) page in the help file for more details. |
53,514,700 | Table is given as
```
Food ID | Food Review
1 | good Review
1 | good Review
1 | Bad Review
2 | good Review
2 | Bad Review
3 | Good Review
```
and the Output expected is
```
Food ID | Good Review | All Review | Acceptance score
1 | 2 | 3 | 2/3
... | 2018/11/28 | [
"https://Stackoverflow.com/questions/53514700",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10715741/"
] | Instead of setting the style in each click, [toggle](http://api.jquery.com/toggleclass/) the class `$( "#toogle_menu" ).toggleClass( "toggled" )` and style this class in css
```js
$("#toogle_menu").click(function() {
$("#jy_nav_pos_main").slideToggle("slow"),
$("#toogle_menu").toggleClass("toggled")
});
```
... | Try this..
```js
var clicked = false;
$("#toogle_menu").click(function() {
var deg = clicked ? 0 : -90;
$("#jy_nav_pos_main").slideToggle("slow"),
$("#toogle_menu").css({
transform: "rotate("+deg+"deg)"
});
clicked = !clicked;
});
```
```html
<script src="https://cdnjs.cloudflare.com/aja... |
53,514,700 | Table is given as
```
Food ID | Food Review
1 | good Review
1 | good Review
1 | Bad Review
2 | good Review
2 | Bad Review
3 | Good Review
```
and the Output expected is
```
Food ID | Good Review | All Review | Acceptance score
1 | 2 | 3 | 2/3
... | 2018/11/28 | [
"https://Stackoverflow.com/questions/53514700",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10715741/"
] | Instead of setting the style in each click, [toggle](http://api.jquery.com/toggleclass/) the class `$( "#toogle_menu" ).toggleClass( "toggled" )` and style this class in css
```js
$("#toogle_menu").click(function() {
$("#jy_nav_pos_main").slideToggle("slow"),
$("#toogle_menu").toggleClass("toggled")
});
```
... | try this...
```
<style type="text/css">
.nav{
display: none;
}
.rotate{
transform: rotate(90deg);
-webkit-transform:rotate(90deg);
-moz-transform:rotate(90deg);
-o-transform:rotate(90deg);
-ms-transform:rotate(90deg);
transition: all 0.4s linear;
... |
8,377,312 | What is the most direct way to convert a symlink into a regular file (i.e. a copy of the symlink target)?
Suppose `filename` is a symlink to `target`. The obvious procedure to turn it into a copy is:
```
cp filename filename-backup
rm filename
mv filename-backup filename
```
Is there a more direct way (i.e. a singl... | 2011/12/04 | [
"https://Stackoverflow.com/questions/8377312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/462335/"
] | There is no single command to convert a symlink to a regular file. The most direct way is to use `readlink` to find the file a symlink points to, and then copy that file over the symlink:
```
cp --remove-destination `readlink bar.pdf` bar.pdf
```
Of course, if `bar.pdf` is, in fact, a regular file to begin with, the... | Change all file.txt from link into file.
```sh
for f in *.txt; do echo $(readlink $f) $f | awk '{print "rsync -L "$1" "$2}'; done | bash
``` |
8,377,312 | What is the most direct way to convert a symlink into a regular file (i.e. a copy of the symlink target)?
Suppose `filename` is a symlink to `target`. The obvious procedure to turn it into a copy is:
```
cp filename filename-backup
rm filename
mv filename-backup filename
```
Is there a more direct way (i.e. a singl... | 2011/12/04 | [
"https://Stackoverflow.com/questions/8377312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/462335/"
] | There is no single command to convert a symlink to a regular file. The most direct way is to use `readlink` to find the file a symlink points to, and then copy that file over the symlink:
```
cp --remove-destination `readlink bar.pdf` bar.pdf
```
Of course, if `bar.pdf` is, in fact, a regular file to begin with, the... | Rsync can nativly deference the symlink for you using -L flag.
```
[user@workstation ~]$ rsync -h | grep -- -L
-L, --copy-links transform symlink into referent file/dir
```
It would be as simple as: `rsync -L <symlink> <destination>` |
8,377,312 | What is the most direct way to convert a symlink into a regular file (i.e. a copy of the symlink target)?
Suppose `filename` is a symlink to `target`. The obvious procedure to turn it into a copy is:
```
cp filename filename-backup
rm filename
mv filename-backup filename
```
Is there a more direct way (i.e. a singl... | 2011/12/04 | [
"https://Stackoverflow.com/questions/8377312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/462335/"
] | On OSX
>
> rsync `readlink bar.pdf` bar.pdf
>
>
> | Rsync can nativly deference the symlink for you using -L flag.
```
[user@workstation ~]$ rsync -h | grep -- -L
-L, --copy-links transform symlink into referent file/dir
```
It would be as simple as: `rsync -L <symlink> <destination>` |
8,377,312 | What is the most direct way to convert a symlink into a regular file (i.e. a copy of the symlink target)?
Suppose `filename` is a symlink to `target`. The obvious procedure to turn it into a copy is:
```
cp filename filename-backup
rm filename
mv filename-backup filename
```
Is there a more direct way (i.e. a singl... | 2011/12/04 | [
"https://Stackoverflow.com/questions/8377312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/462335/"
] | Just a rehash of other's answers, but adding the "sanity check" to ensure the link passed in is actually a symbolic link:
```
removelink() {
[ -L "$1" ] && cp --remove-destination "$(readlink "$1")" "$1"
}
```
This is saying that if the file is a symbolic link, then run the copy command. | Another approach if you find yourself doing this often is adapting kbrock's answer into a shell script and putting it into /usr/bin/. Something along the lines of:
```
if [ $# -ne 1 ]
then
echo "Usage: $0 filename"
exit 1
fi
[ -L "$1" ] && cp --remove-destination "$(readlink "$1")" "$1"
```
chmod +x it, and the... |
8,377,312 | What is the most direct way to convert a symlink into a regular file (i.e. a copy of the symlink target)?
Suppose `filename` is a symlink to `target`. The obvious procedure to turn it into a copy is:
```
cp filename filename-backup
rm filename
mv filename-backup filename
```
Is there a more direct way (i.e. a singl... | 2011/12/04 | [
"https://Stackoverflow.com/questions/8377312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/462335/"
] | Many have already stated the following solution:
```
cp --remove-destination `readlink file` file
```
However, this will not work on symbolically linked directories.
Adding a **recursive** and **force** will not work either:
```
cp -rf --remove-destination `readlink file` file
```
**cp: cannot copy a director... | This worked perfectly for me (**edited to work with spaces**):
```
find . -type l | while read f; do /bin/cp -rf --remove-destination -f $(find . -name $(readlink "${f}")) "${f}";done;
```
Allows you to recursively convert all symlinks under the current working folder to its regular file. Also doesn't ask you to ove... |
8,377,312 | What is the most direct way to convert a symlink into a regular file (i.e. a copy of the symlink target)?
Suppose `filename` is a symlink to `target`. The obvious procedure to turn it into a copy is:
```
cp filename filename-backup
rm filename
mv filename-backup filename
```
Is there a more direct way (i.e. a singl... | 2011/12/04 | [
"https://Stackoverflow.com/questions/8377312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/462335/"
] | On OSX
>
> rsync `readlink bar.pdf` bar.pdf
>
>
> | This solution works with symlink files and symlink folders/subfolders.
One line, no script needed.
This would be ideal to export or transfer symlinks elsewhere.
Put everything inside a folder.
rsync --archive --copy-links --recursive folderContainingSymlinkFilesAndSymlinkFoldersAndSubfolders myNewFolder |
8,377,312 | What is the most direct way to convert a symlink into a regular file (i.e. a copy of the symlink target)?
Suppose `filename` is a symlink to `target`. The obvious procedure to turn it into a copy is:
```
cp filename filename-backup
rm filename
mv filename-backup filename
```
Is there a more direct way (i.e. a singl... | 2011/12/04 | [
"https://Stackoverflow.com/questions/8377312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/462335/"
] | ```
for f in $(find -type l);do cp --remove-destination $(readlink $f) $f;done;
```
* Check symlinks in the current directory and subdirectories `find -type l`
* Get the linked file path `readlink $f`
* Remove symlink and copy the file `cp --remove-destination $(readlink $f) $f` | On OSX
>
> rsync `readlink bar.pdf` bar.pdf
>
>
> |
8,377,312 | What is the most direct way to convert a symlink into a regular file (i.e. a copy of the symlink target)?
Suppose `filename` is a symlink to `target`. The obvious procedure to turn it into a copy is:
```
cp filename filename-backup
rm filename
mv filename-backup filename
```
Is there a more direct way (i.e. a singl... | 2011/12/04 | [
"https://Stackoverflow.com/questions/8377312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/462335/"
] | There is no single command to convert a symlink to a regular file. The most direct way is to use `readlink` to find the file a symlink points to, and then copy that file over the symlink:
```
cp --remove-destination `readlink bar.pdf` bar.pdf
```
Of course, if `bar.pdf` is, in fact, a regular file to begin with, the... | in case of "relative" symlinks you could add a awk statement to @jared answer:
```
for f in $(find . -type l); do /bin/cp -rf --remove-destination -f $(find . \! -type l -name $(readlink $f | awk -F"../" '{print $NF}')) $f;done;
```
If you have symlinks pointing to directories you need to use a more radical approach... |
8,377,312 | What is the most direct way to convert a symlink into a regular file (i.e. a copy of the symlink target)?
Suppose `filename` is a symlink to `target`. The obvious procedure to turn it into a copy is:
```
cp filename filename-backup
rm filename
mv filename-backup filename
```
Is there a more direct way (i.e. a singl... | 2011/12/04 | [
"https://Stackoverflow.com/questions/8377312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/462335/"
] | Just a rehash of other's answers, but adding the "sanity check" to ensure the link passed in is actually a symbolic link:
```
removelink() {
[ -L "$1" ] && cp --remove-destination "$(readlink "$1")" "$1"
}
```
This is saying that if the file is a symbolic link, then run the copy command. | There's no single command. But if you don't want a copy and all you want is another reference, you can replace the symlink with a link (aka "hard link"). This only works if they're on the same partition, BTW.
```
rm filename
ln target filename
``` |
8,377,312 | What is the most direct way to convert a symlink into a regular file (i.e. a copy of the symlink target)?
Suppose `filename` is a symlink to `target`. The obvious procedure to turn it into a copy is:
```
cp filename filename-backup
rm filename
mv filename-backup filename
```
Is there a more direct way (i.e. a singl... | 2011/12/04 | [
"https://Stackoverflow.com/questions/8377312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/462335/"
] | For text files the `sed` command can do this in one line if you pass it the *in-place* switch (`-i`). This is because `sed` does a single pass over a file, cats the output into a temporary file which it subsequently renames to match the original.
Just do an inline `sed` with no transforms:
```
sed -i ';' /path/to/sym... | On OSX
>
> rsync `readlink bar.pdf` bar.pdf
>
>
> |
1,475,551 | I'm trying to use the pigeonhole principle to prove that
>
> if $S$ is a subset of the power set of the first $n$ positive integers, and if $S$ has at least $2^{n-1}+1$ elements, then $S$ must contain a pair of pairwise disjoint sets.
>
>
>
I've been playing around with a small set $\{1,2,3\}$ and I can see the ... | 2015/10/11 | [
"https://math.stackexchange.com/questions/1475551",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/274450/"
] | Given $S \subseteq \mathcal{P}(n)$ with $|S| \ge 2^{n-1} + 1$, suppose $S$ does not contain a disjoint pair of sets. Let $T = \{n \setminus X \mid X \in S\}$. Then $S, T$ are disjoint subsets of $\mathcal{P}(n)$ having the same cardinality ($X \mapsto (n \setminus X)$ bijects $S \leftrightarrow T$), so:
$$
\begin{align... | Try this: there are always as many even-cardinality subsets of a set as there are odd-numbered subsets. Use even-cardinality subsets and odd-cardinality subsets as your pigeonholes. |
33,517,232 | In my app I have a controller that takes a user input consisting of a twitter handle from one view and passes it along through my controller into my factory where it is sent through to my backend code where some API calls are made and ultimately I want to get an image url returned.
I am able to get the image url back... | 2015/11/04 | [
"https://Stackoverflow.com/questions/33517232",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4699240/"
] | You find that convention in [Karma](http://karma-runner.github.io/0.13/dev/git-commit-msg.html)
```
<type>(<scope>): <subject>
<body>
<footer>
```
It can help for:
* automatic generation of the changelog
* simple navigation through git history (eg. ignoring style changes)
Karma's convention include:
>
> Allowe... | Those commit messages follow the Conventional Commits specification: <https://www.conventionalcommits.org/en/v1.0.0/> |
4,153,421 | How can an Eclipse bundle (eg. within activator code) find the dependent Bundle instances at runtime? I would like to find the bundles that Eclipse has choosen to satisfy the dependency requirements, I do not want to interprete the manifest myself.
An example: I would like to find all resources named "marker.txt" in ... | 2010/11/11 | [
"https://Stackoverflow.com/questions/4153421",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4900/"
] | Please see my answer to [this question](https://stackoverflow.com/questions/3906222/printing-osgi-bundle-classpath/4143048). 4.3 will have a new bundle wiring API that will allow things like this. | You can open an OSGi console and issue the following commands:
```
ss
```
To the the list of bundles, including the numeric id
```
bundle <id>
```
to get more information, including dependencies.
You should also try
```
help
```
to get more commands |
4,153,421 | How can an Eclipse bundle (eg. within activator code) find the dependent Bundle instances at runtime? I would like to find the bundles that Eclipse has choosen to satisfy the dependency requirements, I do not want to interprete the manifest myself.
An example: I would like to find all resources named "marker.txt" in ... | 2010/11/11 | [
"https://Stackoverflow.com/questions/4153421",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4900/"
] | There is no easy way to determine the dependency.
The best way is to go through the PackageAdmin interface. See the OSGi spec for PackageAdmin and getImportingBundles in particular: [http://www.osgi.org/javadoc/r4v42/org/osgi/service/packageadmin/ExportedPackage.html#getImportingBundles()](http://www.osgi.org/javadoc/r... | You can open an OSGi console and issue the following commands:
```
ss
```
To the the list of bundles, including the numeric id
```
bundle <id>
```
to get more information, including dependencies.
You should also try
```
help
```
to get more commands |
4,153,421 | How can an Eclipse bundle (eg. within activator code) find the dependent Bundle instances at runtime? I would like to find the bundles that Eclipse has choosen to satisfy the dependency requirements, I do not want to interprete the manifest myself.
An example: I would like to find all resources named "marker.txt" in ... | 2010/11/11 | [
"https://Stackoverflow.com/questions/4153421",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4900/"
] | There is no easy way to determine the dependency.
The best way is to go through the PackageAdmin interface. See the OSGi spec for PackageAdmin and getImportingBundles in particular: [http://www.osgi.org/javadoc/r4v42/org/osgi/service/packageadmin/ExportedPackage.html#getImportingBundles()](http://www.osgi.org/javadoc/r... | Please see my answer to [this question](https://stackoverflow.com/questions/3906222/printing-osgi-bundle-classpath/4143048). 4.3 will have a new bundle wiring API that will allow things like this. |
49,508 | StackExchange uses "Tags" which I feel might be more geared towards a tech-savvy audience.
For the mainstream users, do you think "Tags" works or would they understand "Topics" better? | 2013/12/29 | [
"https://ux.stackexchange.com/questions/49508",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/39300/"
] | Topic could be used, but it would be wrong. A topic is an information structure which has relations to other topics and is often governed by some kind of authority. Tags are a folksonomy driven information entity, which has no authority and is governed by all users. Everyone in a community participates in the creation ... | I say "topics". Whenever possible use the most common language you can. "Tags" may be more meaningful to the technologically elite, but usually there's no useful reason to exclude the plebeians.
While I agree with Benny Skogberg's contention that "Topic" has a different meaning than "Tag", the benefits of that precisi... |
32,264,571 | I am new to Elastic search . Please help me in finding the filter/query to be written to match the exact records using Java API.
```
Below is the mongodb record .I need to get both the record matching the word 'Jerry' using elastic search.
{
"searchcontent" : [
{
"key" ... | 2015/08/28 | [
"https://Stackoverflow.com/questions/32264571",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3440746/"
] | A [Multi-Match](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html) query is what you need to search across multiple fields. Below query will search for the word "jerry" in both the fields "searchcontent.key" and "keyword" which is what you want.
```
POST <index name>/<typ... | There is no single solution, it depends how you map your data in elastic search and what you are indexing
GET /intu/\_settings
You can use: **query string**.
If you don't need to combine filter you can remove bool and should.
From the documentation: *"The bool query takes a more-matches-is-better approach, so the s... |
32,264,571 | I am new to Elastic search . Please help me in finding the filter/query to be written to match the exact records using Java API.
```
Below is the mongodb record .I need to get both the record matching the word 'Jerry' using elastic search.
{
"searchcontent" : [
{
"key" ... | 2015/08/28 | [
"https://Stackoverflow.com/questions/32264571",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3440746/"
] | A [Multi-Match](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html) query is what you need to search across multiple fields. Below query will search for the word "jerry" in both the fields "searchcontent.key" and "keyword" which is what you want.
```
POST <index name>/<typ... | Using filter is a better option as it caches the results..
```
{
"query":
{
"bool":
{
"should":
[
{
"term":
{
"searchcontent.key":"jerry"
}
},
{
"term":
{
"keyword":"jerry"
}
}
]
}
}
}
```
<https://www.elastic.co/blog/found-optimizing-elasticsearch-s... |
32,264,571 | I am new to Elastic search . Please help me in finding the filter/query to be written to match the exact records using Java API.
```
Below is the mongodb record .I need to get both the record matching the word 'Jerry' using elastic search.
{
"searchcontent" : [
{
"key" ... | 2015/08/28 | [
"https://Stackoverflow.com/questions/32264571",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3440746/"
] | And if you would like to search in all the fields.
Then you can just do a match \_all query,
```
POST <index name>/<type name>/_search.
{
"query": {
"match" : {
"_all" : "Jerry"
}
}
}
```
This searches for 'Jerry' in all the fields. | There is no single solution, it depends how you map your data in elastic search and what you are indexing
GET /intu/\_settings
You can use: **query string**.
If you don't need to combine filter you can remove bool and should.
From the documentation: *"The bool query takes a more-matches-is-better approach, so the s... |
32,264,571 | I am new to Elastic search . Please help me in finding the filter/query to be written to match the exact records using Java API.
```
Below is the mongodb record .I need to get both the record matching the word 'Jerry' using elastic search.
{
"searchcontent" : [
{
"key" ... | 2015/08/28 | [
"https://Stackoverflow.com/questions/32264571",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3440746/"
] | And if you would like to search in all the fields.
Then you can just do a match \_all query,
```
POST <index name>/<type name>/_search.
{
"query": {
"match" : {
"_all" : "Jerry"
}
}
}
```
This searches for 'Jerry' in all the fields. | Using filter is a better option as it caches the results..
```
{
"query":
{
"bool":
{
"should":
[
{
"term":
{
"searchcontent.key":"jerry"
}
},
{
"term":
{
"keyword":"jerry"
}
}
]
}
}
}
```
<https://www.elastic.co/blog/found-optimizing-elasticsearch-s... |
36,303,051 | This is main.axml file.
```
`<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="25px"
android:minHeight="25px">
<L... | 2016/03/30 | [
"https://Stackoverflow.com/questions/36303051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6133463/"
] | Try rebuilding the app again and saving the main.axml file .
* Build > Clean Solution
* Build Solution | Adjust properties for resource file like here:
[](https://i.stack.imgur.com/2hMr1.png) |
36,303,051 | This is main.axml file.
```
`<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="25px"
android:minHeight="25px">
<L... | 2016/03/30 | [
"https://Stackoverflow.com/questions/36303051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6133463/"
] | **For Visual Studio Community 2019 Preview (V 16.0.0, Pr 5.0):**
For this problem and a lot of the problem with the designer I have to repeatedly do the following:
* Save all documents and close VS.
* Navigate to the project folder in your file browser
* Delete (or rename, if you're paranoid) the "obj" and "bin" fold... | Option 1) Make sure update the Xamarin.Android (Tools>Options>Xamarin>Other>Check Now)
Option 2) Run VS as Administrator and Build>Clean and Rebuild the solution.
For my case option 1 did work. [](https://i.stack.imgur.com/BlUXf.png) |
36,303,051 | This is main.axml file.
```
`<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="25px"
android:minHeight="25px">
<L... | 2016/03/30 | [
"https://Stackoverflow.com/questions/36303051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6133463/"
] | **For Visual Studio Community 2019 Preview (V 16.0.0, Pr 5.0):**
For this problem and a lot of the problem with the designer I have to repeatedly do the following:
* Save all documents and close VS.
* Navigate to the project folder in your file browser
* Delete (or rename, if you're paranoid) the "obj" and "bin" fold... | 1)Build -> Clean Solution
2)Build Solution |
36,303,051 | This is main.axml file.
```
`<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="25px"
android:minHeight="25px">
<L... | 2016/03/30 | [
"https://Stackoverflow.com/questions/36303051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6133463/"
] | Try rebuilding the app again and saving the main.axml file .
* Build > Clean Solution
* Build Solution | Option 1) Make sure update the Xamarin.Android (Tools>Options>Xamarin>Other>Check Now)
Option 2) Run VS as Administrator and Build>Clean and Rebuild the solution.
For my case option 1 did work. [](https://i.stack.imgur.com/BlUXf.png) |
36,303,051 | This is main.axml file.
```
`<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="25px"
android:minHeight="25px">
<L... | 2016/03/30 | [
"https://Stackoverflow.com/questions/36303051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6133463/"
] | **For Visual Studio Community 2019 Preview (V 16.0.0, Pr 5.0):**
For this problem and a lot of the problem with the designer I have to repeatedly do the following:
* Save all documents and close VS.
* Navigate to the project folder in your file browser
* Delete (or rename, if you're paranoid) the "obj" and "bin" fold... | I faced this kind of problem. The cause may be from the duplicate resource IDs in the project. For instance, this problem occurs when you copy a layout file (.axml) and simply paste directly into the layout resource folder in the solution explorer pane without meticulous resource ID name review in it.
Since the ID ref... |
36,303,051 | This is main.axml file.
```
`<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="25px"
android:minHeight="25px">
<L... | 2016/03/30 | [
"https://Stackoverflow.com/questions/36303051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6133463/"
] | Try rebuilding the app again and saving the main.axml file .
* Build > Clean Solution
* Build Solution | **For Visual Studio Community 2019 Preview (V 16.0.0, Pr 5.0):**
For this problem and a lot of the problem with the designer I have to repeatedly do the following:
* Save all documents and close VS.
* Navigate to the project folder in your file browser
* Delete (or rename, if you're paranoid) the "obj" and "bin" fold... |
36,303,051 | This is main.axml file.
```
`<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="25px"
android:minHeight="25px">
<L... | 2016/03/30 | [
"https://Stackoverflow.com/questions/36303051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6133463/"
] | Adjust properties for resource file like here:
[](https://i.stack.imgur.com/2hMr1.png) | 1)Build -> Clean Solution
2)Build Solution |
36,303,051 | This is main.axml file.
```
`<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="25px"
android:minHeight="25px">
<L... | 2016/03/30 | [
"https://Stackoverflow.com/questions/36303051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6133463/"
] | Try rebuilding the app again and saving the main.axml file .
* Build > Clean Solution
* Build Solution | 1)Build -> Clean Solution
2)Build Solution |
36,303,051 | This is main.axml file.
```
`<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="25px"
android:minHeight="25px">
<L... | 2016/03/30 | [
"https://Stackoverflow.com/questions/36303051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6133463/"
] | Option 1) Make sure update the Xamarin.Android (Tools>Options>Xamarin>Other>Check Now)
Option 2) Run VS as Administrator and Build>Clean and Rebuild the solution.
For my case option 1 did work. [](https://i.stack.imgur.com/BlUXf.png) | I faced this kind of problem. The cause may be from the duplicate resource IDs in the project. For instance, this problem occurs when you copy a layout file (.axml) and simply paste directly into the layout resource folder in the solution explorer pane without meticulous resource ID name review in it.
Since the ID ref... |
36,303,051 | This is main.axml file.
```
`<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="25px"
android:minHeight="25px">
<L... | 2016/03/30 | [
"https://Stackoverflow.com/questions/36303051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6133463/"
] | Try rebuilding the app again and saving the main.axml file .
* Build > Clean Solution
* Build Solution | I faced this kind of problem. The cause may be from the duplicate resource IDs in the project. For instance, this problem occurs when you copy a layout file (.axml) and simply paste directly into the layout resource folder in the solution explorer pane without meticulous resource ID name review in it.
Since the ID ref... |
58,240,100 | I have created a VCL Form containing multiple copies of a `TFrame`, each containing multiple `TLabel` components.
The labels take up most of the area inside the frame, providing little exposed client area for selecting the frame specifically. The program must take action when the user selects a frame component and dis... | 2019/10/04 | [
"https://Stackoverflow.com/questions/58240100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1040289/"
] | Simply assign the very same `OnClick` event handler also to each of the labels inside. Multiple controls can share the same event handler, so long as they have the same signature. | If you don't mind Label's text to be greyed then you can simply set `Enabled` property of your Labels to `False`. This will prevent your labels to capture any keyboard or mouse events and thus all of these will got to the underlying frame. |
58,240,100 | I have created a VCL Form containing multiple copies of a `TFrame`, each containing multiple `TLabel` components.
The labels take up most of the area inside the frame, providing little exposed client area for selecting the frame specifically. The program must take action when the user selects a frame component and dis... | 2019/10/04 | [
"https://Stackoverflow.com/questions/58240100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1040289/"
] | VCL tests a graphic (non windowed) control's response to mouse events before it decides if it is a valid target. You can use a specialized label then that modifies this response. Easiest would be to use an interposer class in your frame unit (if all the labels are expected to behave the same).
```delphi
type
TLabel ... | Simply assign the very same `OnClick` event handler also to each of the labels inside. Multiple controls can share the same event handler, so long as they have the same signature. |
58,240,100 | I have created a VCL Form containing multiple copies of a `TFrame`, each containing multiple `TLabel` components.
The labels take up most of the area inside the frame, providing little exposed client area for selecting the frame specifically. The program must take action when the user selects a frame component and dis... | 2019/10/04 | [
"https://Stackoverflow.com/questions/58240100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1040289/"
] | VCL tests a graphic (non windowed) control's response to mouse events before it decides if it is a valid target. You can use a specialized label then that modifies this response. Easiest would be to use an interposer class in your frame unit (if all the labels are expected to behave the same).
```delphi
type
TLabel ... | If you don't mind Label's text to be greyed then you can simply set `Enabled` property of your Labels to `False`. This will prevent your labels to capture any keyboard or mouse events and thus all of these will got to the underlying frame. |
296,288 | I have a requirement like below.
If there aren't any payment methods, There is a text showing in payment page
**No Payment method available.**
under the path
>
> Magento\_Checkout\web\template\payment.html
>
>
>
My requirement here is to include a link after the text like below
`No Payment method available.... | 2019/11/20 | [
"https://magento.stackexchange.com/questions/296288",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/80394/"
] | First of all, To update message in checkout payment step you need to update **payment.html** file and then, to pass custom link you need to create **mixin of payment.js**
Follow below steps for add link in payment steps when no payment methods available :
>
> **1)** app/code/RH/CustomCheckout/view/frontend/requirejs... | You can create one function in `payment.js` file using this way
Create `requirejs-config.js` file here in your custom module
>
> app/code/Vendor/Module/view/frontend/requirejs-config.js
>
>
>
Content for this file is..
```
var config = {
config: {
mixins: {
'Magento_Checkout/js/view/paym... |
40,707,738 | I'm using VueJS to make a simple enough resource management game/interface. At the minute I'm looking to activate the `roll` function every 12.5 seconds and use the result in another function.
At the moment though I keep getting the following error:
>
> Uncaught TypeError: Cannot read property 'roll' of undefined(..... | 2016/11/20 | [
"https://Stackoverflow.com/questions/40707738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3200485/"
] | >
> You can access these methods directly on the VM instance, or use them in directive expressions. All methods will have their `this` context automatically bound to the Vue instance.
>
>
>
– [Vue API Guide on `methods`](https://v2.vuejs.org/v2/api/#methods)
Within a method on a Vue instance you can access other ... | You can use `vm.methodName();`
Example:
```
let vm = new Vue({
el: '#app',
data: {},
methods: {
methodA: function () {
console.log('hello');
},
methodB: function () {
// calling methodA
vm.methodA();
}
},
})
``` |
40,707,738 | I'm using VueJS to make a simple enough resource management game/interface. At the minute I'm looking to activate the `roll` function every 12.5 seconds and use the result in another function.
At the moment though I keep getting the following error:
>
> Uncaught TypeError: Cannot read property 'roll' of undefined(..... | 2016/11/20 | [
"https://Stackoverflow.com/questions/40707738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3200485/"
] | >
> You can access these methods directly on the VM instance, or use them in directive expressions. All methods will have their `this` context automatically bound to the Vue instance.
>
>
>
– [Vue API Guide on `methods`](https://v2.vuejs.org/v2/api/#methods)
Within a method on a Vue instance you can access other ... | ```js
let vm = new Vue({
el: '#testfunc',
data:{
sp1: "Hi I'm textbox1",
sp2: "Hi I'm textbox2"
},
methods:{
chsp1:function(){
this.sp1 = "I'm swapped from textbox2"
},
chsp2:function(){
this.sp2 = "I'm swapped from textbox1";
this.chsp1();
},
swapit:f... |
40,707,738 | I'm using VueJS to make a simple enough resource management game/interface. At the minute I'm looking to activate the `roll` function every 12.5 seconds and use the result in another function.
At the moment though I keep getting the following error:
>
> Uncaught TypeError: Cannot read property 'roll' of undefined(..... | 2016/11/20 | [
"https://Stackoverflow.com/questions/40707738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3200485/"
] | You can use `vm.methodName();`
Example:
```
let vm = new Vue({
el: '#app',
data: {},
methods: {
methodA: function () {
console.log('hello');
},
methodB: function () {
// calling methodA
vm.methodA();
}
},
})
``` | ```js
let vm = new Vue({
el: '#testfunc',
data:{
sp1: "Hi I'm textbox1",
sp2: "Hi I'm textbox2"
},
methods:{
chsp1:function(){
this.sp1 = "I'm swapped from textbox2"
},
chsp2:function(){
this.sp2 = "I'm swapped from textbox1";
this.chsp1();
},
swapit:f... |
41,759,273 | I am converting html to pdf using jspdf library. i am facing two problems.
1. When i am using pagesplit: true ,it splits the page but the problem is half of data in li remains in first page and half comes in second page and so on.
2.in my image tag src link is not contains extension. It fetchs from url. For eg:"<http:... | 2017/01/20 | [
"https://Stackoverflow.com/questions/41759273",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7125183/"
] | For your 2nd question:
You can use base64 encoded images. It works with jspdf.
To convert image into base64, check this: [How to convert image into base64 string using javascript](https://stackoverflow.com/questions/6150289/how-to-convert-image-into-base64-string-using-javascript) | 1 You need to check the pdf size and adjust it.
2 The base64 image renders in the jspdf. You can use this link for getting base64 code and paste it in img src value <https://www.base64-image.de/> |
29,696,044 | I've wrote a script to change a few CSS properties of a div. I've tried 2 methods I found on google but neither of them work. I've thoroughly read the examples and I don't know why this won't work.
When there is less content in the `#rightsection` then there are images in the `#leftsection`, the `#rightsection` attach... | 2015/04/17 | [
"https://Stackoverflow.com/questions/29696044",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4373648/"
] | I have found the solution: the problem was that the sub name was the same as the module name. I didn't know it had to be different, but I hope someone will find this useful!
Thanks for all the answers guys! | I came across another issue while running a simple test attempting to run an Access VBA function in an empty database (except for the VBA code) from an Excel procedure. Without any other objects (tables/forms/etc), the Access VBA function was unable to be found. Once I put in a nominal table, the call to the Access VBA... |
15,867,391 | My Caeser cipher works interactively in the shell with a string, but when I've tried to undertake separate programs to encrypt and decrypt I've run into problems, I don't know whether the input is not being split into a list or not, but the if statement in my encryption function is being bypassed and defaulting to the ... | 2013/04/07 | [
"https://Stackoverflow.com/questions/15867391",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/967818/"
] | ```
caeser.encrypt(source)
```
into
```
caeser.encrypt(source.read())
```
`source` is a file object - the fact that this code "works" (by not encrypting anything) is interesting - turns out that you call `list()` over the source before iterating and that turns it into a **list of lines in the file**. Instead of th... | It isn't obvious to me that there will be anything in `source` after the call to `openFileReadRobust()`. I don't know the specification for `openFileReadRobust()` but it seems like it won't know what file to open unless there is a filename given as a parameter, and there isn't one.
Thus, I suspect `source` is empty, ... |
15,867,391 | My Caeser cipher works interactively in the shell with a string, but when I've tried to undertake separate programs to encrypt and decrypt I've run into problems, I don't know whether the input is not being split into a list or not, but the if statement in my encryption function is being bypassed and defaulting to the ... | 2013/04/07 | [
"https://Stackoverflow.com/questions/15867391",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/967818/"
] | Some points:
* Using a context manager (`with`) makes sure that files are closed after being read or written.
* Since the caesar cipher is a substitution cipher where the shift parameter is the key, there is no need for a separate `encrypt` and `decrypt` member function: they are the same but with the "key" negated.
*... | It isn't obvious to me that there will be anything in `source` after the call to `openFileReadRobust()`. I don't know the specification for `openFileReadRobust()` but it seems like it won't know what file to open unless there is a filename given as a parameter, and there isn't one.
Thus, I suspect `source` is empty, ... |
15,867,391 | My Caeser cipher works interactively in the shell with a string, but when I've tried to undertake separate programs to encrypt and decrypt I've run into problems, I don't know whether the input is not being split into a list or not, but the if statement in my encryption function is being bypassed and defaulting to the ... | 2013/04/07 | [
"https://Stackoverflow.com/questions/15867391",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/967818/"
] | ```
caeser.encrypt(source)
```
into
```
caeser.encrypt(source.read())
```
`source` is a file object - the fact that this code "works" (by not encrypting anything) is interesting - turns out that you call `list()` over the source before iterating and that turns it into a **list of lines in the file**. Instead of th... | Some points:
* Using a context manager (`with`) makes sure that files are closed after being read or written.
* Since the caesar cipher is a substitution cipher where the shift parameter is the key, there is no need for a separate `encrypt` and `decrypt` member function: they are the same but with the "key" negated.
*... |
2,532,105 | I'm having trouble with writing this sequence as a function of $n$ because it's neither geometric nor arithmetic.
>
> $$\begin{cases}
> u\_{n+1} = \frac12 u\_{n} + 3\qquad \forall n \in \mathbb N\\
> u\_{0} = \frac13
> \end{cases}$$
>
>
> | 2017/11/22 | [
"https://math.stackexchange.com/questions/2532105",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/482160/"
] | Hint. Note that for some real number $a$ (which one?),
$$u\_{n+1}-a = \frac12 \left(u\_{n}-a\right).$$
Hence, the sequence $(u\_n-a)\_n$ is of geometric type:
$$u\_{n}-a=\frac12 \left(u\_{n-1}-a\right)=\frac{1}{2^2} \left(u\_{n-2}-a\right)=\dots =\frac{1}{2^{n}} \left(u\_{0}-a\right).$$ | Let $u\_m=v\_m+a\_0+a\_1m+\cdots$
$$6=2u\_{n+1}-u\_n=2v\_{m+1}-v\_m+a\_0(2-1)+a\_1(2(m+1)-m)+\cdots$$
Set $a\_0=6,a\_r=0\forall r>0$
to find $$v\_{n+1}=\dfrac{v\_n}2=\cdots=\dfrac{v\_{n-p}}{2^{p+1}}$$
Now $v\_0+6=u\_0\iff v\_0=?$ |
2,532,105 | I'm having trouble with writing this sequence as a function of $n$ because it's neither geometric nor arithmetic.
>
> $$\begin{cases}
> u\_{n+1} = \frac12 u\_{n} + 3\qquad \forall n \in \mathbb N\\
> u\_{0} = \frac13
> \end{cases}$$
>
>
> | 2017/11/22 | [
"https://math.stackexchange.com/questions/2532105",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/482160/"
] | Hint. Note that for some real number $a$ (which one?),
$$u\_{n+1}-a = \frac12 \left(u\_{n}-a\right).$$
Hence, the sequence $(u\_n-a)\_n$ is of geometric type:
$$u\_{n}-a=\frac12 \left(u\_{n-1}-a\right)=\frac{1}{2^2} \left(u\_{n-2}-a\right)=\dots =\frac{1}{2^{n}} \left(u\_{0}-a\right).$$ | Similarly to what RobertZ did, turning the arithmetico-geometric recurrence to a purely geometric one, you can get rid of the multiplicative coefficient.
Let $u\_n:=\dfrac{v\_n}{2^n}$. Then
$$\dfrac{v\_{n+1}}{2^{n+1}}=\frac12\dfrac{v\_n}{2^n}+3$$ or
$$v\_{n+1}=v\_n+3\cdot2^{n+1}.$$
This recurrence is now easily sol... |
2,532,105 | I'm having trouble with writing this sequence as a function of $n$ because it's neither geometric nor arithmetic.
>
> $$\begin{cases}
> u\_{n+1} = \frac12 u\_{n} + 3\qquad \forall n \in \mathbb N\\
> u\_{0} = \frac13
> \end{cases}$$
>
>
> | 2017/11/22 | [
"https://math.stackexchange.com/questions/2532105",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/482160/"
] | Write $$ 2u\_{n+1}-u\_n = 6 = 2u\_n-u\_{n-1}$$
so we have $$ 2u\_{n+1}-3u\_n +u\_{n-1}=0$$
Then solving the characteristic equation $2x^2-3x+1=0$ which has a solution $x\_1=1$ ans $x\_2={1\over 2}$ we get a general solution $$ u\_n = a\cdot 1^n +b\cdot \Big({1\over 2} \Big)^n$$
Since $u\_1 = {19\over 6}$ by solving a... | Let $u\_m=v\_m+a\_0+a\_1m+\cdots$
$$6=2u\_{n+1}-u\_n=2v\_{m+1}-v\_m+a\_0(2-1)+a\_1(2(m+1)-m)+\cdots$$
Set $a\_0=6,a\_r=0\forall r>0$
to find $$v\_{n+1}=\dfrac{v\_n}2=\cdots=\dfrac{v\_{n-p}}{2^{p+1}}$$
Now $v\_0+6=u\_0\iff v\_0=?$ |
2,532,105 | I'm having trouble with writing this sequence as a function of $n$ because it's neither geometric nor arithmetic.
>
> $$\begin{cases}
> u\_{n+1} = \frac12 u\_{n} + 3\qquad \forall n \in \mathbb N\\
> u\_{0} = \frac13
> \end{cases}$$
>
>
> | 2017/11/22 | [
"https://math.stackexchange.com/questions/2532105",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/482160/"
] | Write $$ 2u\_{n+1}-u\_n = 6 = 2u\_n-u\_{n-1}$$
so we have $$ 2u\_{n+1}-3u\_n +u\_{n-1}=0$$
Then solving the characteristic equation $2x^2-3x+1=0$ which has a solution $x\_1=1$ ans $x\_2={1\over 2}$ we get a general solution $$ u\_n = a\cdot 1^n +b\cdot \Big({1\over 2} \Big)^n$$
Since $u\_1 = {19\over 6}$ by solving a... | Similarly to what RobertZ did, turning the arithmetico-geometric recurrence to a purely geometric one, you can get rid of the multiplicative coefficient.
Let $u\_n:=\dfrac{v\_n}{2^n}$. Then
$$\dfrac{v\_{n+1}}{2^{n+1}}=\frac12\dfrac{v\_n}{2^n}+3$$ or
$$v\_{n+1}=v\_n+3\cdot2^{n+1}.$$
This recurrence is now easily sol... |
2,532,105 | I'm having trouble with writing this sequence as a function of $n$ because it's neither geometric nor arithmetic.
>
> $$\begin{cases}
> u\_{n+1} = \frac12 u\_{n} + 3\qquad \forall n \in \mathbb N\\
> u\_{0} = \frac13
> \end{cases}$$
>
>
> | 2017/11/22 | [
"https://math.stackexchange.com/questions/2532105",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/482160/"
] | Similarly to what RobertZ did, turning the arithmetico-geometric recurrence to a purely geometric one, you can get rid of the multiplicative coefficient.
Let $u\_n:=\dfrac{v\_n}{2^n}$. Then
$$\dfrac{v\_{n+1}}{2^{n+1}}=\frac12\dfrac{v\_n}{2^n}+3$$ or
$$v\_{n+1}=v\_n+3\cdot2^{n+1}.$$
This recurrence is now easily sol... | Let $u\_m=v\_m+a\_0+a\_1m+\cdots$
$$6=2u\_{n+1}-u\_n=2v\_{m+1}-v\_m+a\_0(2-1)+a\_1(2(m+1)-m)+\cdots$$
Set $a\_0=6,a\_r=0\forall r>0$
to find $$v\_{n+1}=\dfrac{v\_n}2=\cdots=\dfrac{v\_{n-p}}{2^{p+1}}$$
Now $v\_0+6=u\_0\iff v\_0=?$ |
40,768,570 | I am using python 3.4. I am able to run my python script without any problem.
But While running my freezed python script , following error have appeared.
I am able to freeze my script successfully too with cx\_freeze.
```
C:\Program Files (x86)\utils>utils.exe
Traceback (most recent call last):
File "C:\Python34\l... | 2016/11/23 | [
"https://Stackoverflow.com/questions/40768570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2678648/"
] | I had the same issues running on Ubuntu with Python 3.5. It seems that `cx_freeze` has problems with libraries that import other files or something like that.
Importing `Queue` together with `requests` worked for me, so:
```
import requests
from multiprocessing import Queue
```
And I don't think specifying `urllib`... | There are Several options based on project packages:
Method1:
>
> Answer: I solve the problem my issue was I had file named queue.py in the same
> directory
>
>
>
Method2:
Queue is in the multiprocessing module so:
```
from multiprocessing import Queue
```
Method3:
Updating pip from 1.5.6 to 8.1.2
```
`su... |
40,768,570 | I am using python 3.4. I am able to run my python script without any problem.
But While running my freezed python script , following error have appeared.
I am able to freeze my script successfully too with cx\_freeze.
```
C:\Program Files (x86)\utils>utils.exe
Traceback (most recent call last):
File "C:\Python34\l... | 2016/11/23 | [
"https://Stackoverflow.com/questions/40768570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2678648/"
] | I had the same issues running on Ubuntu with Python 3.5. It seems that `cx_freeze` has problems with libraries that import other files or something like that.
Importing `Queue` together with `requests` worked for me, so:
```
import requests
from multiprocessing import Queue
```
And I don't think specifying `urllib`... | In addition to
```
from multiprocessing import Queue
```
I rolled back to the older version of cx\_freeze:
```
pip install cx-freeze==4.3.3
```
Besides, the "requests" library complained on absence of "urllib3" module. I upgraded this to *requests==2.13.0* and all now works.
I'm using Python 3.4 on Win10. Hope ... |
40,768,570 | I am using python 3.4. I am able to run my python script without any problem.
But While running my freezed python script , following error have appeared.
I am able to freeze my script successfully too with cx\_freeze.
```
C:\Program Files (x86)\utils>utils.exe
Traceback (most recent call last):
File "C:\Python34\l... | 2016/11/23 | [
"https://Stackoverflow.com/questions/40768570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2678648/"
] | I had the same issues running on Ubuntu with Python 3.5. It seems that `cx_freeze` has problems with libraries that import other files or something like that.
Importing `Queue` together with `requests` worked for me, so:
```
import requests
from multiprocessing import Queue
```
And I don't think specifying `urllib`... | In setup.py, `options={"build_exe": {"packages": ["multiprocessing"]}}` can also do the trick. |
40,768,570 | I am using python 3.4. I am able to run my python script without any problem.
But While running my freezed python script , following error have appeared.
I am able to freeze my script successfully too with cx\_freeze.
```
C:\Program Files (x86)\utils>utils.exe
Traceback (most recent call last):
File "C:\Python34\l... | 2016/11/23 | [
"https://Stackoverflow.com/questions/40768570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2678648/"
] | There are Several options based on project packages:
Method1:
>
> Answer: I solve the problem my issue was I had file named queue.py in the same
> directory
>
>
>
Method2:
Queue is in the multiprocessing module so:
```
from multiprocessing import Queue
```
Method3:
Updating pip from 1.5.6 to 8.1.2
```
`su... | In addition to
```
from multiprocessing import Queue
```
I rolled back to the older version of cx\_freeze:
```
pip install cx-freeze==4.3.3
```
Besides, the "requests" library complained on absence of "urllib3" module. I upgraded this to *requests==2.13.0* and all now works.
I'm using Python 3.4 on Win10. Hope ... |
40,768,570 | I am using python 3.4. I am able to run my python script without any problem.
But While running my freezed python script , following error have appeared.
I am able to freeze my script successfully too with cx\_freeze.
```
C:\Program Files (x86)\utils>utils.exe
Traceback (most recent call last):
File "C:\Python34\l... | 2016/11/23 | [
"https://Stackoverflow.com/questions/40768570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2678648/"
] | In setup.py, `options={"build_exe": {"packages": ["multiprocessing"]}}` can also do the trick. | In addition to
```
from multiprocessing import Queue
```
I rolled back to the older version of cx\_freeze:
```
pip install cx-freeze==4.3.3
```
Besides, the "requests" library complained on absence of "urllib3" module. I upgraded this to *requests==2.13.0* and all now works.
I'm using Python 3.4 on Win10. Hope ... |
78,798 | An API design is actually a programming question, but it can't be answered like "replace `=` by `==` on line 10". Moreover, the asking person has some idea how it should look like and has to start with presenting the idea, otherwise the answers would explore many different directions and not fit together. Starting with... | 2011/02/10 | [
"https://meta.stackexchange.com/questions/78798",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/155925/"
] | I would say programmers.stackexchange.com
This is from its FAQ (emphasis mine):
* **Software engineering**
* Developer testing
* Algorithm and data structure concepts
* **Design patterns**
* **Architecture**
* Development methodologies
* Quality assurance
* Software law
* Programming puzzles
* Freelancing and busines... | Stack Exchange, in general is setup for questions and answers rather than a discussion. So you are going to have to be tactful in the formulation of your question to avoid close votes. Plus you are going to have to give a clear goal ("question") of what you are looking to solve so that everyone stays on the same course... |
12,751,936 | I am trying to run a fairly simple count based on two MySQL tables but I can't get the syntax right.
```
Table_1 Table_2
Actor | Behavior | Receiver | | Behavior | Type_of_behavior |
Eric a ann a Good
Eric b ann ... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12751936",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1723683/"
] | What you have there is called a "template". As such, you are looking for a templating system.
Assuming those quotes aren't actually in the string, the only template system I know capable of understanding that templating language is [String::Interpolate](http://search.cpan.org/perldoc?String%3a%3aInterpolate).
```
$ p... | This should work:
```
$foo->{"bar"} = 5;
printf "This is a string with hash value of $foo->{\"bar\"}]";
``` |
66,106,318 | I've got something that bugs me : when somebody requests a route with an id greater than PHP\_INT\_MAX, the id is passed as a string to my controller, thus throwing a 500 error, as my controller's parameters are typed.
For example, given I'm on a 64-bit system, PHP\_INT\_MAX's value is 2^63-1 (9223372036854775807).
If... | 2021/02/08 | [
"https://Stackoverflow.com/questions/66106318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4834168/"
] | On your system `PHP_INT_MAX` has 19 digits. So you could add a route requirement to match only when id has 1-18 digits:
```
/**
* @Route(
* "/some/route/{id}",
* requirements={"id"="\d{1,18}"}
* )
*/
public function yourAction(int $id)
{
...
}
```
More than 18 digits wouldn't match and result in a 4... | You can create a customer Param Converter in your case (<https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/converters.html#creating-a-converter>). And apply only for this kind of routes. |
10,102,998 | When I use emacs, I often meet some errors in my code.
When there are some errors in my code, emacs ask me whether I want to "abort" or "terminate-thread".
I want to know what the difference is between "abort" and "terminate-thread" in emacs.
Which one should I choose that will be better?
![enter image description h... | 2012/04/11 | [
"https://Stackoverflow.com/questions/10102998",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1326134/"
] | I don't think this question comes from Emacs. So please give us more information (OS in which you run Emacs, which processes you might be running within Emacs, what kind of error happens, where is the actual question displayed (within Emacs's minibuffer, or some popup dialog), ... | Are you using SLIME?
In that case, "abort" will just stop your program, whereas "terminate-thread" will also kill the Lisp thread that SLIME is talking to. |
6,344,655 | I'm consolidating 2 programs into one, and in 2 different files (I have many files), I have a typedef with the same name, different types though.
These types will be used in completely different parts of the program and will never talk to each other, or be used interachangely.
I can of cause just do a search replace... | 2011/06/14 | [
"https://Stackoverflow.com/questions/6344655",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/237472/"
] | You can encapsulate those `typedef` inside a `namespace`:
```
namespace N1 {
typedef int T;
}
namespace N2 {
typedef int T;
}
```
And in whatever file you want to use first `typedef` simply declare:
```
using namespace N1;
```
same thing for the other one also. | >
> [...]Or making a typedef local to a class
> and it's subclasses.
>
>
>
Well, that's simple:
```
struct A
{
typedef int X;
};
struct B : A
{
X a;
};
struct C
{
typedef double X;
};
```
Typedefs are scoped in C++. |
6,344,655 | I'm consolidating 2 programs into one, and in 2 different files (I have many files), I have a typedef with the same name, different types though.
These types will be used in completely different parts of the program and will never talk to each other, or be used interachangely.
I can of cause just do a search replace... | 2011/06/14 | [
"https://Stackoverflow.com/questions/6344655",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/237472/"
] | `typedef`s are *always* "local to a file". So it is not exactly clear what you mean by "making it local to a file". Typedef does not introduce an entity with its own linkage, it simply creates an alias to an existing type. For that reason the problem of "making it local to a file" simply does not exist. Each typedef is... | >
> [...]Or making a typedef local to a class
> and it's subclasses.
>
>
>
Well, that's simple:
```
struct A
{
typedef int X;
};
struct B : A
{
X a;
};
struct C
{
typedef double X;
};
```
Typedefs are scoped in C++. |
49,237,821 | I want to change values in a large amount of rows into something else.
I open my data from a csv using pandas as follows:
```
import pandas as pd
import numpy as np
import os
df = pd.read_csv('data.csv', encoding = "ISO-8859-")
```
I then slice my DF changing column names:
```
df1 = df['col 1', 'col 2', 'col 3' ... | 2018/03/12 | [
"https://Stackoverflow.com/questions/49237821",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9375102/"
] | You can pass your conditions to dict
```
df.replace({'c': None,'a':'s','b':'n'})
Out[164]:
1 2 3 4 5
0 s n s n None
1 s None s s None
2 n s None s n
``` | One way is to use a dictionary combined with [`pd.DataFrame.applymap`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.applymap.html), which applies a function elementwise.
```
d = {'c': None, 'a': 's', 'b': 'n'}
res = df.applymap(d.get)
# 1 2 3 4 5
# 0 s n s n None... |
4,490,158 | I am getting suspicious that there is no need whatsoever for quantifiers in formal first-order logic. Why do we write $\forall x, P(x)$, when can simply write $P(x)$, assuming that we know that $x$ is a variable (as opposed to a constant).
A similar question has been asked here: [Is the universal quantifier redundant?... | 2022/07/10 | [
"https://math.stackexchange.com/questions/4490158",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/923549/"
] | The problem with replacing $\exists$ with $\neg\forall\neg$ to not have to worry about the order of quantifiers becomes apparent if you actually try doing so and omitting the quantifiers. For instance, $\exists x P(x)$ becomes $\neg \forall x \neg P(x)$ and then you omit the quantifier to get $\neg\neg P(x)$. Wait, tha... | Let's consider these two quantified statements:
$$
\begin{align\*}
\forall x\exists y M(x, y) \tag\*{(1)}\\
\exists x\forall y M(x, y) \tag\*{(2)}
\end{align\*}
$$
and let's take the universe of discourse to be people and interpret $M(x,y)$ to mean $y$ is the mother of $x$. Statement (1) says that everybody has a mothe... |
4,490,158 | I am getting suspicious that there is no need whatsoever for quantifiers in formal first-order logic. Why do we write $\forall x, P(x)$, when can simply write $P(x)$, assuming that we know that $x$ is a variable (as opposed to a constant).
A similar question has been asked here: [Is the universal quantifier redundant?... | 2022/07/10 | [
"https://math.stackexchange.com/questions/4490158",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/923549/"
] | The problem with replacing $\exists$ with $\neg\forall\neg$ to not have to worry about the order of quantifiers becomes apparent if you actually try doing so and omitting the quantifiers. For instance, $\exists x P(x)$ becomes $\neg \forall x \neg P(x)$ and then you omit the quantifier to get $\neg\neg P(x)$. Wait, tha... | Rob Arthan's answer is exactly right; let me supplement it with an observation from computability theory.
Consider the structure $\mathcal{N}=(\mathbb{N};+,\times)$. It turns out that the quantifier hierarchy over $\mathcal{N}$ is **non-collapsing**: no fixed number of quantifiers will ever be sufficient for capturing... |
53,103,321 | I want to convert .raw file to .jpg or .png using some plain python code or any module that is supported in python 2.7 in windows environment.
I tried `rawpy`, PIL modules.
But I am getting some attribute error(frombytes not found); because it is supported in Python3. Let me know if i am wrong..
In `rawpy` the RAW fo... | 2018/11/01 | [
"https://Stackoverflow.com/questions/53103321",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9305639/"
] | use PIL library
```
from PIL import Image
im = Image.open("img.raw")
rgb_im = im.convert('RGB')
rgb_im.save('img.jpg')
``` | You can use the convert utility which comes with image magic.
```
convert -size 640x360 -depth 8 bgr:input.raw out.jpeg
```
-size -> WxH
bgr is the format of data. it can be rgb also. |
29,887,232 | I am trying to finish one activity from another.
For that purpose I am having **only** the component name of that activity.
How can i finish that ? | 2015/04/27 | [
"https://Stackoverflow.com/questions/29887232",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4627995/"
] | >
> Question - is it not possible to ignore the apachehttpclient library provided by google and use a newer version of the library instead?
>
>
>
It is not. The [Apache HttpClient Android Port](http://hc.apache.org/httpcomponents-client-4.3.x/android-port.html) can deployed along-side with the old version shipped... | ok, so i found this at the Apache website,
Google Android 1.0 was released with a pre-BETA snapshot of Apache HttpClient. To coincide with the first Android release Apache HttpClient 4.0 APIs had to be frozen prematurely, while many of interfaces and internal structures were still not fully worked out. As Apache HttpC... |
29,887,232 | I am trying to finish one activity from another.
For that purpose I am having **only** the component name of that activity.
How can i finish that ? | 2015/04/27 | [
"https://Stackoverflow.com/questions/29887232",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4627995/"
] | >
> Question - is it not possible to ignore the apachehttpclient library provided by google and use a newer version of the library instead?
>
>
>
It is not. The [Apache HttpClient Android Port](http://hc.apache.org/httpcomponents-client-4.3.x/android-port.html) can deployed along-side with the old version shipped... | You need to give the below code snippet in the dependencies section in the build.gradle file of you app module.
```
configurations {
compile.exclude group: "org.apache.httpcomponents", module: "httpclient"
}
``` |
22,998,699 | >
> Windows 7 - 64-bit
>
>
> Git version: 1.7.9
>
>
>
I don't have any problem with lightweight tag, but when trying Annotated git tag command under windows command console (DOS), I get the error as shown below:
```
c:\tempWorkingFolder\Tobedeleted\mastertemp\btc>git tag -a test_tag -f 'test_tag'
fatal: too man... | 2014/04/10 | [
"https://Stackoverflow.com/questions/22998699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3521095/"
] | I had the same issue, using double quotes instead of single quotes solved it:
```
git tag -a test_tag -f "test_tag"
``` | Tag name should be the last parameter in your command. See the below syntax.
```
git tag [-a | -s | -u <keyid>] [-f] [-m <msg> | -F <file>]
<tagname> [<commit> | <object>]
```
Your command should look like:
```
git tag -a -f -m 'Commit message' test_tag
``` |
169,692 | I recently ran an encounter on a "restaurant boat" where my players had to obtain info from a noble on board. They successfully bluffed/bribed/sneaked their way on board. Certain areas of the ship were off limits to guest, such as the crew's quarter's, the captain's cabin, and the lower deck with rowers moving the ship... | 2020/05/29 | [
"https://rpg.stackexchange.com/questions/169692",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/56835/"
] | Stealth was most likely the wrong choice
========================================
Stealth implies that you are impossible to see. If you succeed on your stealth attempt, you are hidden, if you fail, you are not hidden.
Your players aren't actually trying to be hidden, anybody can see them, they simply don't register ... | A Charisma (Deception) vs Wisdom (Insight) check
================================================
I'm guessing that you're referring to a *certain location* in Storm King's Thunder. If I'm right, the book suggests the following on page 216:
>
> The adventurers might try to replace one or more of the workers [of the... |
169,692 | I recently ran an encounter on a "restaurant boat" where my players had to obtain info from a noble on board. They successfully bluffed/bribed/sneaked their way on board. Certain areas of the ship were off limits to guest, such as the crew's quarter's, the captain's cabin, and the lower deck with rowers moving the ship... | 2020/05/29 | [
"https://rpg.stackexchange.com/questions/169692",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/56835/"
] | Stealth was most likely the wrong choice
========================================
Stealth implies that you are impossible to see. If you succeed on your stealth attempt, you are hidden, if you fail, you are not hidden.
Your players aren't actually trying to be hidden, anybody can see them, they simply don't register ... | Pass without trace probably wouldn't help
-----------------------------------------
[](https://i.stack.imgur.com/1noz5.jpg)
Does this camo suit make you more stealthy? I bet it does.
Would it help you to blend in with crowds better? I don't think so.
But let... |
169,692 | I recently ran an encounter on a "restaurant boat" where my players had to obtain info from a noble on board. They successfully bluffed/bribed/sneaked their way on board. Certain areas of the ship were off limits to guest, such as the crew's quarter's, the captain's cabin, and the lower deck with rowers moving the ship... | 2020/05/29 | [
"https://rpg.stackexchange.com/questions/169692",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/56835/"
] | Stealth was most likely the wrong choice
========================================
Stealth implies that you are impossible to see. If you succeed on your stealth attempt, you are hidden, if you fail, you are not hidden.
Your players aren't actually trying to be hidden, anybody can see them, they simply don't register ... | There are some clear rules concerning hiding in the PHB:
>
> The GM decides when circumstances are appropriate for hiding.
>
>
>
And
>
> You can't hide from a creature that can see you clearly.
>
>
>
When you find that waiting for an opportune moment to slip past someone is appropriate, that is covered by ... |
169,692 | I recently ran an encounter on a "restaurant boat" where my players had to obtain info from a noble on board. They successfully bluffed/bribed/sneaked their way on board. Certain areas of the ship were off limits to guest, such as the crew's quarter's, the captain's cabin, and the lower deck with rowers moving the ship... | 2020/05/29 | [
"https://rpg.stackexchange.com/questions/169692",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/56835/"
] | A Stealth check is appropriate for this, but probably Charisma (Stealth) as opposed to the usual Dexterity (Stealth). It should probably be opposed by a Perception or Insight check on the pursuers part.
---------------------------------------------------------------------------------------------------------------------... | Stealth fits the situation
==========================
The [Stealth](https://www.dndbeyond.com/sources/basic-rules/using-ability-scores#Stealth) section lists the situation you describe as an example:
>
> Make a Dexterity (Stealth) check when you attempt to **conceal yourself from enemies, slink past guards, slip awa... |
169,692 | I recently ran an encounter on a "restaurant boat" where my players had to obtain info from a noble on board. They successfully bluffed/bribed/sneaked their way on board. Certain areas of the ship were off limits to guest, such as the crew's quarter's, the captain's cabin, and the lower deck with rowers moving the ship... | 2020/05/29 | [
"https://rpg.stackexchange.com/questions/169692",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/56835/"
] | Pass without trace probably wouldn't help
-----------------------------------------
[](https://i.stack.imgur.com/1noz5.jpg)
Does this camo suit make you more stealthy? I bet it does.
Would it help you to blend in with crowds better? I don't think so.
But let... | Stealth fits the situation
==========================
The [Stealth](https://www.dndbeyond.com/sources/basic-rules/using-ability-scores#Stealth) section lists the situation you describe as an example:
>
> Make a Dexterity (Stealth) check when you attempt to **conceal yourself from enemies, slink past guards, slip awa... |
169,692 | I recently ran an encounter on a "restaurant boat" where my players had to obtain info from a noble on board. They successfully bluffed/bribed/sneaked their way on board. Certain areas of the ship were off limits to guest, such as the crew's quarter's, the captain's cabin, and the lower deck with rowers moving the ship... | 2020/05/29 | [
"https://rpg.stackexchange.com/questions/169692",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/56835/"
] | Pass without trace probably wouldn't help
-----------------------------------------
[](https://i.stack.imgur.com/1noz5.jpg)
Does this camo suit make you more stealthy? I bet it does.
Would it help you to blend in with crowds better? I don't think so.
But let... | A Charisma (Deception) vs Wisdom (Insight) check
================================================
I'm guessing that you're referring to a *certain location* in Storm King's Thunder. If I'm right, the book suggests the following on page 216:
>
> The adventurers might try to replace one or more of the workers [of the... |
169,692 | I recently ran an encounter on a "restaurant boat" where my players had to obtain info from a noble on board. They successfully bluffed/bribed/sneaked their way on board. Certain areas of the ship were off limits to guest, such as the crew's quarter's, the captain's cabin, and the lower deck with rowers moving the ship... | 2020/05/29 | [
"https://rpg.stackexchange.com/questions/169692",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/56835/"
] | A Charisma (Deception) vs Wisdom (Insight) check
================================================
I'm guessing that you're referring to a *certain location* in Storm King's Thunder. If I'm right, the book suggests the following on page 216:
>
> The adventurers might try to replace one or more of the workers [of the... | Stealth fits the situation
==========================
The [Stealth](https://www.dndbeyond.com/sources/basic-rules/using-ability-scores#Stealth) section lists the situation you describe as an example:
>
> Make a Dexterity (Stealth) check when you attempt to **conceal yourself from enemies, slink past guards, slip awa... |
169,692 | I recently ran an encounter on a "restaurant boat" where my players had to obtain info from a noble on board. They successfully bluffed/bribed/sneaked their way on board. Certain areas of the ship were off limits to guest, such as the crew's quarter's, the captain's cabin, and the lower deck with rowers moving the ship... | 2020/05/29 | [
"https://rpg.stackexchange.com/questions/169692",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/56835/"
] | Pass without trace probably wouldn't help
-----------------------------------------
[](https://i.stack.imgur.com/1noz5.jpg)
Does this camo suit make you more stealthy? I bet it does.
Would it help you to blend in with crowds better? I don't think so.
But let... | There are some clear rules concerning hiding in the PHB:
>
> The GM decides when circumstances are appropriate for hiding.
>
>
>
And
>
> You can't hide from a creature that can see you clearly.
>
>
>
When you find that waiting for an opportune moment to slip past someone is appropriate, that is covered by ... |
169,692 | I recently ran an encounter on a "restaurant boat" where my players had to obtain info from a noble on board. They successfully bluffed/bribed/sneaked their way on board. Certain areas of the ship were off limits to guest, such as the crew's quarter's, the captain's cabin, and the lower deck with rowers moving the ship... | 2020/05/29 | [
"https://rpg.stackexchange.com/questions/169692",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/56835/"
] | A Charisma (Deception) vs Wisdom (Insight) check
================================================
I'm guessing that you're referring to a *certain location* in Storm King's Thunder. If I'm right, the book suggests the following on page 216:
>
> The adventurers might try to replace one or more of the workers [of the... | There are some clear rules concerning hiding in the PHB:
>
> The GM decides when circumstances are appropriate for hiding.
>
>
>
And
>
> You can't hide from a creature that can see you clearly.
>
>
>
When you find that waiting for an opportune moment to slip past someone is appropriate, that is covered by ... |
169,692 | I recently ran an encounter on a "restaurant boat" where my players had to obtain info from a noble on board. They successfully bluffed/bribed/sneaked their way on board. Certain areas of the ship were off limits to guest, such as the crew's quarter's, the captain's cabin, and the lower deck with rowers moving the ship... | 2020/05/29 | [
"https://rpg.stackexchange.com/questions/169692",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/56835/"
] | A Stealth check is appropriate for this, but probably Charisma (Stealth) as opposed to the usual Dexterity (Stealth). It should probably be opposed by a Perception or Insight check on the pursuers part.
---------------------------------------------------------------------------------------------------------------------... | There are some clear rules concerning hiding in the PHB:
>
> The GM decides when circumstances are appropriate for hiding.
>
>
>
And
>
> You can't hide from a creature that can see you clearly.
>
>
>
When you find that waiting for an opportune moment to slip past someone is appropriate, that is covered by ... |
70,597,841 | I'm trying to make the text-info element display only when I hover over the container element using only CSS and no JS and it doesn't work, would love some advice.
I was assuming it had something to do with the display flex instead of display block so I attempted that too, but it didn't help.
Note that even without t... | 2022/01/05 | [
"https://Stackoverflow.com/questions/70597841",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16761342/"
] | ```
import requests
baseURL = "https://myurl.repl.co"
x = requests.get(baseURL)
print(x.content)
``` | Install the requests module (much nicer than using urllib2) and then define a route which makes the necessary request - something like:
```
import requests
from flask import Flask
app = Flask(__name__)
@app.route('/some-url')
def get_data():
return requests.get('http://example.com').content
```
Depending on you... |
56,291 | I'm not sure if commercial fish is inspected in any way. I know that most commercial fish is caught in nets, so I don't think that bait is used.
When individuals go fishing, they use worms, flies, or non-kosher fish as bait. After they catch the fish and reel it in, before using the fish, do they need to inspect it fo... | 2015/03/10 | [
"https://judaism.stackexchange.com/questions/56291",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/5275/"
] | The OU kashrus site writes <https://www.ou.org/torah/halacha/hashoneh-halachos/sat_08_25_12/>
"46:43 Small worms are sometimes found in fish, in the brain, the liver, the intestines, the mouth and the gills. This is common in such fish as pike and herring. When this is common, one must check for them. Small insects can... | Modern commercial fishing uses many different techniques depending on the species sought. [Both trawling, nets and line with auto-baited hooks are utilized](https://en.wikipedia.org/wiki/Fish_processing). Additionally, there are many different types of processing done commercially. Some would require supervision to be ... |
20,558,153 | I have a search button that goes into my database and searches on a name but when there are two entries for the same name it is only bringing me back one and i can't figure out why. Below is the code I am using now.
```
public boolean search(String str1, String username){//search function for the access history searc... | 2013/12/13 | [
"https://Stackoverflow.com/questions/20558153",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3073941/"
] | Matthias is spot on.
A @Stateless annotated bean is an EJB which by default provides [Container-Managed-Transactions](http://docs.oracle.com/javaee/6/tutorial/doc/bncij.html). CMT will by default create a new transaction if the client of the EJB did not provide one.
>
> **Required Attribute** If the client is runnin... | When you don't want to make your root resource as an EJB (by annotating it with `@Stateless`), you can use a `UserTransaction`.
```
@Path("/things")
@RequestScoped
public class ThingsResource{
@POST
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response create(final Thing thing... |
67,425,200 | HTML and inline JS code:
```
<a onclick='show(user)'>${user.firstName + " " + user.lastName}</a>
```
Inside this show function I am passing an object User which has 5-6 properties, but when I used debugger it is not showing me as an object.
I also tried this , and this is showing be user as object in debugger but I... | 2021/05/06 | [
"https://Stackoverflow.com/questions/67425200",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15856627/"
] | We can use transform here with groupby:
```py
s = df["Business hours"].eq("Yes").groupby(df["Date"]).transform("Sum")
df[s >= 7]
``` | Try groupby filter function :
```
def filter_rows(x):
try:
x['Business hours'].value_counts()['Yes'] >= 7
return True
except KeyError as e:
return False
df = df.groupby('Date').filter(filter_rows)
``` |
29,022,569 | I've written a VB .Net program that does selective intensity pixel modification on graphic files. It's a lot faster than it was when I started (20 seconds vs 90 seconds), but the total time to process multiple images is still slow. I typically run 64 12 MP images, and it takes about 24 minutes to process them all. I th... | 2015/03/13 | [
"https://Stackoverflow.com/questions/29022569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4665101/"
] | Change the image's cap insets to make the image fit the way you want:
```
UIImage *barButtonImage = [[UIImage imageNamed:@"ZSSBackArrow"] resizableImageWithCapInsets:UIEdgeInsetsMake(0,width,0,0)];
```
This will keep the width of the image as your specified width.
You may need to play with the numbers a bit to get ... | Using the background image property forces the stretching. Try using the image property and play around with the image inset/offset to position the image where you want it. |
45,730,832 | I am using **rxjs/Rx** in angular 2 to create a clock and making lap and Sprint time laps from it.
The Code block is as follows:
**HTML:** (app.component.html)
```
<div class="row">
<div class="col-xs-5">
<div class="row">
<div class="col-xs-6">
<h2>Lap Time</h2>
... | 2017/08/17 | [
"https://Stackoverflow.com/questions/45730832",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6152976/"
] | After some digging and understanding in the doc, I found a working solution:
```
"mappings": {
// ...
"cartproduct": {
"_parent": {
"type": "product"
},
"properties": {
"productId": {
"type": "keyword"
},
// etc...
... | Why are you restricting your search to only **cartproduct** type? Assuming that you want to aggregate the **productid** throughout the entire index, this type level restriction can be substituted by following to fulfil your requirement.
```
{
"query": {
"bool": {
"filter": {
"term": {
"en... |
10,844,448 | Is there a way to detect if the javascript see if there was a click, and if there was, it can do something?
```
function clickin() {
var mouseDown = 0;
document.body.onmousedown = function() {
++mouseDown;
var alle = document.getElementsByClassName('box');
for (var i = 0; i < alle.lengt... | 2012/06/01 | [
"https://Stackoverflow.com/questions/10844448",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1418521/"
] | And the question is?
You have already the code.
Anyway, from my point of view, go for [jQuery](http://jquery.com/) and it's [mouse events](http://api.jquery.com/category/events/mouse-events/). | javascript can handle clicks, we use it for that. But it seems that you want to check if clicks are being handled on the document.
if you want to check that specifically at document level you can check if
```
document.onclick==null
```
and also checking mousedown/mouseup events on same way
because if you define a h... |
8,710,581 | >
> **Possible Duplicate:**
>
> [What is the difference between Managed C++ and C++/CLI?](https://stackoverflow.com/questions/2443811/what-is-the-difference-between-managed-c-and-c-cli)
>
> [What is CLI/C++ exactly? How does it differ to 'normal' c++?](https://stackoverflow.com/questions/6399493/what-is-cli-c-... | 2012/01/03 | [
"https://Stackoverflow.com/questions/8710581",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/413174/"
] | >
> Is that right C++ is unmanaged code and C++.NET is managed code.
>
>
>
There's no such thing as "C++.NET". There's C++/CLI, which is basically C++ with Microsoft extensions that allow you to write code targeting the .NET framework. C++/CLI code compiles to CLR bytecode, and runs on a virtual machine just like ... | * Yes, C++ is unmanaged code and C++/CLI is managed.
* Yes, you can use your unmanaged C++ DLL in your C++/CLI project. But you have to write a wrapper for that. That means you have to define the unmanaged methods you want to access in your C++/CLI project.
Example:
```
using System.Runtime.InteropServices;
[DllImpo... |
8,710,581 | >
> **Possible Duplicate:**
>
> [What is the difference between Managed C++ and C++/CLI?](https://stackoverflow.com/questions/2443811/what-is-the-difference-between-managed-c-and-c-cli)
>
> [What is CLI/C++ exactly? How does it differ to 'normal' c++?](https://stackoverflow.com/questions/6399493/what-is-cli-c-... | 2012/01/03 | [
"https://Stackoverflow.com/questions/8710581",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/413174/"
] | >
> Is that right C++ is unmanaged code and C++.NET is managed code.
>
>
>
There's no such thing as "C++.NET". There's C++/CLI, which is basically C++ with Microsoft extensions that allow you to write code targeting the .NET framework. C++/CLI code compiles to CLR bytecode, and runs on a virtual machine just like ... | Well... C++ .NET is kind of a misnomer.
You can program in C++ using visual studio .NET. Well that's what it was called along time ago. Now a days folks just call it Visual Studio, with the dot NET moniker. Well, at least the splash screen doesn't have a big ol .NET in the logo anymore.
It is kind of understood that ... |
8,710,581 | >
> **Possible Duplicate:**
>
> [What is the difference between Managed C++ and C++/CLI?](https://stackoverflow.com/questions/2443811/what-is-the-difference-between-managed-c-and-c-cli)
>
> [What is CLI/C++ exactly? How does it differ to 'normal' c++?](https://stackoverflow.com/questions/6399493/what-is-cli-c-... | 2012/01/03 | [
"https://Stackoverflow.com/questions/8710581",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/413174/"
] | >
> Is that right C++ is unmanaged code and C++.NET is managed code.
>
>
>
There's no such thing as "C++.NET". There's C++/CLI, which is basically C++ with Microsoft extensions that allow you to write code targeting the .NET framework. C++/CLI code compiles to CLR bytecode, and runs on a virtual machine just like ... | Managed C++ is a now **deprecated** Microsoft set of deviations from C++, including grammatical and syntactic extensions, keywords and attributes, to bring the C++ syntax and language to the .NET Framework. These extensions allowed C++ code to be targeted to the Common Language Runtime (CLR) in the form of managed code... |
8,710,581 | >
> **Possible Duplicate:**
>
> [What is the difference between Managed C++ and C++/CLI?](https://stackoverflow.com/questions/2443811/what-is-the-difference-between-managed-c-and-c-cli)
>
> [What is CLI/C++ exactly? How does it differ to 'normal' c++?](https://stackoverflow.com/questions/6399493/what-is-cli-c-... | 2012/01/03 | [
"https://Stackoverflow.com/questions/8710581",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/413174/"
] | Well... C++ .NET is kind of a misnomer.
You can program in C++ using visual studio .NET. Well that's what it was called along time ago. Now a days folks just call it Visual Studio, with the dot NET moniker. Well, at least the splash screen doesn't have a big ol .NET in the logo anymore.
It is kind of understood that ... | * Yes, C++ is unmanaged code and C++/CLI is managed.
* Yes, you can use your unmanaged C++ DLL in your C++/CLI project. But you have to write a wrapper for that. That means you have to define the unmanaged methods you want to access in your C++/CLI project.
Example:
```
using System.Runtime.InteropServices;
[DllImpo... |
8,710,581 | >
> **Possible Duplicate:**
>
> [What is the difference between Managed C++ and C++/CLI?](https://stackoverflow.com/questions/2443811/what-is-the-difference-between-managed-c-and-c-cli)
>
> [What is CLI/C++ exactly? How does it differ to 'normal' c++?](https://stackoverflow.com/questions/6399493/what-is-cli-c-... | 2012/01/03 | [
"https://Stackoverflow.com/questions/8710581",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/413174/"
] | Managed C++ is a now **deprecated** Microsoft set of deviations from C++, including grammatical and syntactic extensions, keywords and attributes, to bring the C++ syntax and language to the .NET Framework. These extensions allowed C++ code to be targeted to the Common Language Runtime (CLR) in the form of managed code... | * Yes, C++ is unmanaged code and C++/CLI is managed.
* Yes, you can use your unmanaged C++ DLL in your C++/CLI project. But you have to write a wrapper for that. That means you have to define the unmanaged methods you want to access in your C++/CLI project.
Example:
```
using System.Runtime.InteropServices;
[DllImpo... |
180,579 | If the caster is in the radius of a harmful area of effect, such as a fireball spell, will the illusory duplicates exist after damage is taken or will they be destroyed? | 2021/02/09 | [
"https://rpg.stackexchange.com/questions/180579",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/60697/"
] | ### The spell description explicitly states only attacks can destroy a duplicate.
The spell description of *mirror image* states:
>
> A duplicate can be destroyed only by an attack that hits it. It ignores all other damage and effects.
>
>
>
Area of effect spells such as *fireball* are “other damage and effects”... | No—they are only destroyed when you are targeted with an *attack*
-----------------------------------------------------------------
The spell's [description](https://www.dndbeyond.com/spells/mirror-image) states, in relevant part:
>
> Each time a creature targets you with an attack during the spell's duration, roll ... |
52,445,834 | I'm trying to teach my test automation framework to detect a selected item in an app using opencv (the framework grabs frames/screenshots from the device under test). Selected items are always a certain size and always have blue border which helps but they contain different thumbnail images. See the example image provi... | 2018/09/21 | [
"https://Stackoverflow.com/questions/52445834",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8937566/"
] | According to the documentation, `#pragma GCC unroll 1` is supposed to work, if you place it just so. If it doesn't then you should submit a bug report.
Alternatively, you can use a function attribute to set optimizations, I think:
```
void myfn () __attribute__((optimize("no-unroll-loops")));
``` | For concise functions
sans full and partial loop unrolling
when required
the following function attribute
please try.
```
__attribute__((optimize("Os")))
``` |
67,806,380 | I have an array of complex *dict* that have some value as a string "NULL" and I want to remove, my dict looks like this:
```
d = [{
"key1": "value1",
"key2": {
"key3": "value3",
"key4": "NULL",
"z": {
"z1": "NULL",
"z2": "zzz",
},
},
"key5": "NULL"
}, {
"KEY": "NULL",
"AAA": "... | 2021/06/02 | [
"https://Stackoverflow.com/questions/67806380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/832490/"
] | Here is how you can do this with recursion:
```
def remove_null(d):
if isinstance(d, list):
for i in d:
remove_null(i)
elif isinstance(d, dict):
for k, v in d.copy().items():
if v == 'NULL':
d.pop(k)
else:
remove_null(v)
d = [... | **Solution:**
```
d = [{
"key1": "value1",
"key2": {
"key3": "value3",
"key4": "NULL",
"z": {
"z1": "NULL",
"z2": "zzz",
},
},
"key5": "NULL"
}, {
"KEY": "NULL",
"AAA": "BBB",
}]
for element in list(d):
for key, value in element.copy().items():
if value == "NULL":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.