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 |
|---|---|---|---|---|---|
63,088,123 | I am getting gradle build error while running the app. I am using windows 10 with 8GB RAM, Android studio version 4.0.1
>
> Out of memory: Java heap space. Please assign more memory to Gradle in
> the project's gradle.properties file. For example, the following line,
> in the gradle.properties file, sets the maximum ... | 2020/07/25 | [
"https://Stackoverflow.com/questions/63088123",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6345799/"
] | I'm working on a big android project with multiple modules and flavors and had the same problem.
I tried everything from tweaking memory to cleaning project, restarting while invalidating cache, deleting sources and recloning from repo.
I ended up deleting the ".gradle" folder in my user folder and recloning my proje... | Adding `android:largeHeap="true"` to the `AndroidManifest.xml` may solve your problem, if you haven't already added. But note that the main issue is your app is consuming too much memory. Consider tracking your app at runtime to find the unusual memory consuming process/objects.
```
<manifest
...
<applicati... |
63,088,123 | I am getting gradle build error while running the app. I am using windows 10 with 8GB RAM, Android studio version 4.0.1
>
> Out of memory: Java heap space. Please assign more memory to Gradle in
> the project's gradle.properties file. For example, the following line,
> in the gradle.properties file, sets the maximum ... | 2020/07/25 | [
"https://Stackoverflow.com/questions/63088123",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6345799/"
] | I faced the same issue in my `"react": "17.0.2","react-native": "0.66.1"` project
Goto `project/android/gradlew.properties`
& uncomment this line
`# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8`
and only change the code before colan(:)
`org.gra... | Adding `android:largeHeap="true"` to the `AndroidManifest.xml` may solve your problem, if you haven't already added. But note that the main issue is your app is consuming too much memory. Consider tracking your app at runtime to find the unusual memory consuming process/objects.
```
<manifest
...
<applicati... |
63,088,123 | I am getting gradle build error while running the app. I am using windows 10 with 8GB RAM, Android studio version 4.0.1
>
> Out of memory: Java heap space. Please assign more memory to Gradle in
> the project's gradle.properties file. For example, the following line,
> in the gradle.properties file, sets the maximum ... | 2020/07/25 | [
"https://Stackoverflow.com/questions/63088123",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6345799/"
] | 1. Give more RAM for gradle `org.gradle.jvmargs=-Xmx4g`
2. If you face the same problem after can run for a few times, open `Task Manager`, `End task` any `Open JDK Platform binary` or `Java(TM) Se Binary` to release RAM, then you can run project again.
If your computer have less than 8GB RAM, set like this in your `g... | I'm working on a big android project with multiple modules and flavors and had the same problem.
I tried everything from tweaking memory to cleaning project, restarting while invalidating cache, deleting sources and recloning from repo.
I ended up deleting the ".gradle" folder in my user folder and recloning my proje... |
63,088,123 | I am getting gradle build error while running the app. I am using windows 10 with 8GB RAM, Android studio version 4.0.1
>
> Out of memory: Java heap space. Please assign more memory to Gradle in
> the project's gradle.properties file. For example, the following line,
> in the gradle.properties file, sets the maximum ... | 2020/07/25 | [
"https://Stackoverflow.com/questions/63088123",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6345799/"
] | 1. Give more RAM for gradle `org.gradle.jvmargs=-Xmx4g`
2. If you face the same problem after can run for a few times, open `Task Manager`, `End task` any `Open JDK Platform binary` or `Java(TM) Se Binary` to release RAM, then you can run project again.
If your computer have less than 8GB RAM, set like this in your `g... | I faced the same issue in my `"react": "17.0.2","react-native": "0.66.1"` project
Goto `project/android/gradlew.properties`
& uncomment this line
`# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8`
and only change the code before colan(:)
`org.gra... |
240,135 | We've recently had a penetration test for one of our applications.
The Penetration Testing company identified that our application lacks protections against brute-force attacks on the login page.
`Ref: https://owasp.org/www-community/controls/Blocking_Brute_Force_Attacks`
We've been recommended to implement a captch... | 2020/10/28 | [
"https://security.stackexchange.com/questions/240135",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/244799/"
] | You are right that **using PBKDF2 does not protect against brute-force attacks on web application login pages**. Credentials submitted by users and attackers travel unchanged until the server, where PBKDF2 is then computed. PBKDF2 is therefore only meaningful for offline attacks which have direct access to the correct ... | If you are [hashing and storing passwords correctly](https://security.stackexchange.com/questions/211/how-to-securely-hash-passwords) (regardless of whether you use PBKDF2 as your hashing function, or some other hashing funcion), then *your server* is doing the heavy lifting for each login attempt made at your site.
P... |
34,153,058 | I have to insert 3 recordset from array 1 already exists and 2 are new
e.g:
```
db.products.insert(
[
{ imagename: "pen1", qty: 21 },
{ imagename: "pen", qty: 20 },
{ imagename: "eraser", qty: 25 }
]
)
```
Wherein "{ imagename: "pen", qty: 20 }"` already exists and has unique key
on field "i... | 2015/12/08 | [
"https://Stackoverflow.com/questions/34153058",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1333794/"
] | [Unordered insert](https://docs.mongodb.com/v5.0/reference/method/db.collection.insert/#perform-an-unordered-insert) will do the trick
```
db.products.insert(
[{ imagename: "pen1", qty: 21 },
{ imagename: "pen", qty: 20 },
{ imagename: "eraser", qty: 25 }],
{ ordered: false }
)
``` | **Note: ensureIndex is deprecated since v3.0.0**
<https://docs.mongodb.com/manual/reference/method/db.collection.ensureIndex/>
The following response is left as-is (since `ensure` is now an alias for `create` - both will work at present), but for newer versions you should replace `db.products.ensureIndex` with `db.pro... |
34,153,058 | I have to insert 3 recordset from array 1 already exists and 2 are new
e.g:
```
db.products.insert(
[
{ imagename: "pen1", qty: 21 },
{ imagename: "pen", qty: 20 },
{ imagename: "eraser", qty: 25 }
]
)
```
Wherein "{ imagename: "pen", qty: 20 }"` already exists and has unique key
on field "i... | 2015/12/08 | [
"https://Stackoverflow.com/questions/34153058",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1333794/"
] | [Unordered insert](https://docs.mongodb.com/v5.0/reference/method/db.collection.insert/#perform-an-unordered-insert) will do the trick
```
db.products.insert(
[{ imagename: "pen1", qty: 21 },
{ imagename: "pen", qty: 20 },
{ imagename: "eraser", qty: 25 }],
{ ordered: false }
)
``` | Set the `ordered` option to `false`. This is not a trick, but a *reliable* method to achieve it. If errors occur, you may obtain information regarding each of them.
```
const documents = [{name: "Star Wars"}, {name: "Sword Art Online"}];
db.product.insertMany(documents, {ordered: false});
```
If you're using *Mongoo... |
34,153,058 | I have to insert 3 recordset from array 1 already exists and 2 are new
e.g:
```
db.products.insert(
[
{ imagename: "pen1", qty: 21 },
{ imagename: "pen", qty: 20 },
{ imagename: "eraser", qty: 25 }
]
)
```
Wherein "{ imagename: "pen", qty: 20 }"` already exists and has unique key
on field "i... | 2015/12/08 | [
"https://Stackoverflow.com/questions/34153058",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1333794/"
] | Set the `ordered` option to `false`. This is not a trick, but a *reliable* method to achieve it. If errors occur, you may obtain information regarding each of them.
```
const documents = [{name: "Star Wars"}, {name: "Sword Art Online"}];
db.product.insertMany(documents, {ordered: false});
```
If you're using *Mongoo... | **Note: ensureIndex is deprecated since v3.0.0**
<https://docs.mongodb.com/manual/reference/method/db.collection.ensureIndex/>
The following response is left as-is (since `ensure` is now an alias for `create` - both will work at present), but for newer versions you should replace `db.products.ensureIndex` with `db.pro... |
51,470,233 | I am creating a bootstrap 3 page with a 25% left column and a 75% right column. In the right column I have a resizable div. I would like the left column to always be the same height as the right one (even after the div on the right is resized). Here is some sample code:
```
<head>
<meta charset="utf-8">
<meta ... | 2018/07/23 | [
"https://Stackoverflow.com/questions/51470233",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/195539/"
] | One way of doing it is using tables, here's a bit of code that should provide you with what you want.
```
<div id="a-row" class="row">
<div class="col-md-3 panel" style="background-color: red">
some content
</div>
<div class="col-md-9 panel" style="background-color: green">
some more content
</div... | ```
<body>
<!-- bootstrap container -->
<div class="container-fluid">
<div class="row row-eq-height">
<!-- 25% of screen -->
<div id="left" class="col-md-3">
Left
</div>
<!-- 75% of screen -->
<div class="col-md... |
9,867,628 | how's it goin?
Sorry if I sound stupid here.
I'm trying to create a basic play2.0 - HBase app. When I try to connect HBase from play, ZooKeeper is returning me junk characters for HBase server address.
```
def main(args : Array[String]) : Unit = {
val conf = HBaseConfiguration create
val admin = new HBaseAdmin(co... | 2012/03/26 | [
"https://Stackoverflow.com/questions/9867628",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1040866/"
] | I found the solution. I just changed my device-side code using custom InputStream.
**Device side :**
```
HttpPost httpPost = new HttpPost(url);
httpPost.setEntity(new InputStreamEntity(new MyInputStream(),
4096 * 1024 * 10));
HttpResponse response = null;
try {
response = httpClient.e... | You have a lot of options:
* send the byte values: 125,11,25,40 (that's a dumb option)
* send it base64- or hex- encoded, and then decode it (use apache commons-codec)
* submit it as `multipart/form-data` |
15,827,326 | Given the following files
```sh
$ ls
bar.txt baz.txt qux.txt
```
I would like to save only the first `txt` file to a variable. I tried this
```
$ var=*.txt
```
but it just saves all files
```
$ echo $var
bar.txt baz.txt qux.txt
```
I would like to do this using a wildcard if possible, and `extglob` is okay. ... | 2013/04/05 | [
"https://Stackoverflow.com/questions/15827326",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1002260/"
] | Use this:
```
$ var=(*.txt)
$ echo $var
bar.txt
```
Key here is to use parentheses - putting elements into array. So `echo $var` prints the first element from the array (`bar.txt`). You can see that by printing the whole array:
```
$ echo ${var[@]}
bar.txt baz.txt qux.txt
``` | You can (slightly) abuse the `for` statement to set the variable:
```
$ for var in *.txt; do break; done
$ echo $var
bar.txt
```
On the plus side, `var` only contains the name of the first file, not everything matching the pattern. On the minus side, this is more verbose than the array solution that kamituel gives, ... |
15,827,326 | Given the following files
```sh
$ ls
bar.txt baz.txt qux.txt
```
I would like to save only the first `txt` file to a variable. I tried this
```
$ var=*.txt
```
but it just saves all files
```
$ echo $var
bar.txt baz.txt qux.txt
```
I would like to do this using a wildcard if possible, and `extglob` is okay. ... | 2013/04/05 | [
"https://Stackoverflow.com/questions/15827326",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1002260/"
] | Use this:
```
$ var=(*.txt)
$ echo $var
bar.txt
```
Key here is to use parentheses - putting elements into array. So `echo $var` prints the first element from the array (`bar.txt`). You can see that by printing the whole array:
```
$ echo ${var[@]}
bar.txt baz.txt qux.txt
``` | ```
$ touch "test file1.txt"
$ touch "test file2.txt"
$ var=`ls *.txt | head -1`
$ echo $var
test file1.txt`
```
This will return the first file.
To find the last one, either do "ls -r" instead of "ls" or "tail -1" instead of "head -1". |
50,472,727 | I know this is a frequently asked question, however I do not have access to the Counter module as I'm using v2.6 of Python. I want to count the number of time a specific key appears in a list of dictionaries.
If my dictionary looks like this:
```
data = [{'a':1, 'b':1}, {'a':1, 'c':1}, {'b':1, 'c':1}, {'a':1, 'c':1},... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50472727",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3093032/"
] | You won't have access to **`collections.Counter`**, but **`collections.defaultdict`** was added in Python 2.5
**`keys`** and flatten list
```
data = [j for i in data for j in i.keys()]
# ['a', 'b', 'a', 'c', 'c', 'b', 'a', 'c', 'a', 'd']
```
**`collections.defaultdict`**
```
from collections import defaultdict
dc... | This question looks very much like a class assignment. Here is a simple bit of code that will do the job:
```
n=0
for d in data:
if 'a' in d:
n+=1
print(n)
```
Here `n` is a counter, the `for` loop iterates through the list of dictionaries.
The `'a' in d` expression will return true if the key 'a' is in t... |
50,472,727 | I know this is a frequently asked question, however I do not have access to the Counter module as I'm using v2.6 of Python. I want to count the number of time a specific key appears in a list of dictionaries.
If my dictionary looks like this:
```
data = [{'a':1, 'b':1}, {'a':1, 'c':1}, {'b':1, 'c':1}, {'a':1, 'c':1},... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50472727",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3093032/"
] | You can use list comprehension.
```
data = [{'a':1, 'b':1}, {'a':1, 'c':1}, {'b':1, 'c':1}, {'a':1, 'c':1}, {'a':1, 'd':1}]
sum([1 for d in data if 'a' in d])
```
*Explanation:
First take the dictionary object from list data, check if key 'a' is present in the dictionary or not, if present, add 1 to the list. Then ... | You won't have access to **`collections.Counter`**, but **`collections.defaultdict`** was added in Python 2.5
**`keys`** and flatten list
```
data = [j for i in data for j in i.keys()]
# ['a', 'b', 'a', 'c', 'c', 'b', 'a', 'c', 'a', 'd']
```
**`collections.defaultdict`**
```
from collections import defaultdict
dc... |
50,472,727 | I know this is a frequently asked question, however I do not have access to the Counter module as I'm using v2.6 of Python. I want to count the number of time a specific key appears in a list of dictionaries.
If my dictionary looks like this:
```
data = [{'a':1, 'b':1}, {'a':1, 'c':1}, {'b':1, 'c':1}, {'a':1, 'c':1},... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50472727",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3093032/"
] | You won't have access to **`collections.Counter`**, but **`collections.defaultdict`** was added in Python 2.5
**`keys`** and flatten list
```
data = [j for i in data for j in i.keys()]
# ['a', 'b', 'a', 'c', 'c', 'b', 'a', 'c', 'a', 'd']
```
**`collections.defaultdict`**
```
from collections import defaultdict
dc... | A one-line solution could be:
`len([k for d in data for k in d.keys() if k == 'a'])` |
50,472,727 | I know this is a frequently asked question, however I do not have access to the Counter module as I'm using v2.6 of Python. I want to count the number of time a specific key appears in a list of dictionaries.
If my dictionary looks like this:
```
data = [{'a':1, 'b':1}, {'a':1, 'c':1}, {'b':1, 'c':1}, {'a':1, 'c':1},... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50472727",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3093032/"
] | You won't have access to **`collections.Counter`**, but **`collections.defaultdict`** was added in Python 2.5
**`keys`** and flatten list
```
data = [j for i in data for j in i.keys()]
# ['a', 'b', 'a', 'c', 'c', 'b', 'a', 'c', 'a', 'd']
```
**`collections.defaultdict`**
```
from collections import defaultdict
dc... | For this you could write the following function that would work for data in the structure you provided (a list of dicts):
```
def count_key(key,dict_list):
keys_list = []
for item in dict_list:
keys_list += item.keys()
return keys_list.count(key)
```
Then, you could invoke the function as follows... |
50,472,727 | I know this is a frequently asked question, however I do not have access to the Counter module as I'm using v2.6 of Python. I want to count the number of time a specific key appears in a list of dictionaries.
If my dictionary looks like this:
```
data = [{'a':1, 'b':1}, {'a':1, 'c':1}, {'b':1, 'c':1}, {'a':1, 'c':1},... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50472727",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3093032/"
] | You can use list comprehension.
```
data = [{'a':1, 'b':1}, {'a':1, 'c':1}, {'b':1, 'c':1}, {'a':1, 'c':1}, {'a':1, 'd':1}]
sum([1 for d in data if 'a' in d])
```
*Explanation:
First take the dictionary object from list data, check if key 'a' is present in the dictionary or not, if present, add 1 to the list. Then ... | This question looks very much like a class assignment. Here is a simple bit of code that will do the job:
```
n=0
for d in data:
if 'a' in d:
n+=1
print(n)
```
Here `n` is a counter, the `for` loop iterates through the list of dictionaries.
The `'a' in d` expression will return true if the key 'a' is in t... |
50,472,727 | I know this is a frequently asked question, however I do not have access to the Counter module as I'm using v2.6 of Python. I want to count the number of time a specific key appears in a list of dictionaries.
If my dictionary looks like this:
```
data = [{'a':1, 'b':1}, {'a':1, 'c':1}, {'b':1, 'c':1}, {'a':1, 'c':1},... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50472727",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3093032/"
] | A one-line solution could be:
`len([k for d in data for k in d.keys() if k == 'a'])` | This question looks very much like a class assignment. Here is a simple bit of code that will do the job:
```
n=0
for d in data:
if 'a' in d:
n+=1
print(n)
```
Here `n` is a counter, the `for` loop iterates through the list of dictionaries.
The `'a' in d` expression will return true if the key 'a' is in t... |
50,472,727 | I know this is a frequently asked question, however I do not have access to the Counter module as I'm using v2.6 of Python. I want to count the number of time a specific key appears in a list of dictionaries.
If my dictionary looks like this:
```
data = [{'a':1, 'b':1}, {'a':1, 'c':1}, {'b':1, 'c':1}, {'a':1, 'c':1},... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50472727",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3093032/"
] | You can use list comprehension.
```
data = [{'a':1, 'b':1}, {'a':1, 'c':1}, {'b':1, 'c':1}, {'a':1, 'c':1}, {'a':1, 'd':1}]
sum([1 for d in data if 'a' in d])
```
*Explanation:
First take the dictionary object from list data, check if key 'a' is present in the dictionary or not, if present, add 1 to the list. Then ... | A one-line solution could be:
`len([k for d in data for k in d.keys() if k == 'a'])` |
50,472,727 | I know this is a frequently asked question, however I do not have access to the Counter module as I'm using v2.6 of Python. I want to count the number of time a specific key appears in a list of dictionaries.
If my dictionary looks like this:
```
data = [{'a':1, 'b':1}, {'a':1, 'c':1}, {'b':1, 'c':1}, {'a':1, 'c':1},... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50472727",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3093032/"
] | You can use list comprehension.
```
data = [{'a':1, 'b':1}, {'a':1, 'c':1}, {'b':1, 'c':1}, {'a':1, 'c':1}, {'a':1, 'd':1}]
sum([1 for d in data if 'a' in d])
```
*Explanation:
First take the dictionary object from list data, check if key 'a' is present in the dictionary or not, if present, add 1 to the list. Then ... | For this you could write the following function that would work for data in the structure you provided (a list of dicts):
```
def count_key(key,dict_list):
keys_list = []
for item in dict_list:
keys_list += item.keys()
return keys_list.count(key)
```
Then, you could invoke the function as follows... |
50,472,727 | I know this is a frequently asked question, however I do not have access to the Counter module as I'm using v2.6 of Python. I want to count the number of time a specific key appears in a list of dictionaries.
If my dictionary looks like this:
```
data = [{'a':1, 'b':1}, {'a':1, 'c':1}, {'b':1, 'c':1}, {'a':1, 'c':1},... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50472727",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3093032/"
] | A one-line solution could be:
`len([k for d in data for k in d.keys() if k == 'a'])` | For this you could write the following function that would work for data in the structure you provided (a list of dicts):
```
def count_key(key,dict_list):
keys_list = []
for item in dict_list:
keys_list += item.keys()
return keys_list.count(key)
```
Then, you could invoke the function as follows... |
18,886,082 | this code works, but my question is I dont understand the purpose of `var that = this`. Why do I need to reference it like that to pass it to setInterval. I read about 'this' in <http://www.sitepoint.com/what-is-this-in-javascript/>, but it doesn't really answer my question
my JavaScript code
```
function spinClass(i... | 2013/09/19 | [
"https://Stackoverflow.com/questions/18886082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/308553/"
] | The value of the [`this` keyword](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this) is tied to the `function` it's used within and to how that `function` was called.
That includes both `letSpin()` and the short, anonymous `function` being passed to `setTimeout()`. And, the anonymous `fu... | Instantiate object with this function:
```js
function newClass(klass) {
var obj = new klass;
$.map(obj, function(value, key) {
if (typeof value == "function") {
obj[key] = value.bind(obj);
}
});
return obj;
}
```
This will do automatic binding of all function, so you wi... |
45,417 | Is it possible to limit access to a page using wordpress user roles that isn't included in the wordpress install.
For example I have a CS Cart install with only a couple of products but I need to limit access to these pages to certain users.
Can I add something in to my CS Cart install to call on Wordpress to be able... | 2012/03/13 | [
"https://wordpress.stackexchange.com/questions/45417",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1859/"
] | This is certainly possible but will require you to alter CS Cart a titbit. I'm not too familiar with CS Cart's inner workings, from the little that I've explored the source code (they actually make you fill in a form to download a community edition, bleh) you would want to do something of this kind:
```
$current_worki... | No, it is not possible, not cleanly anyway
There are kludges that will get you half there but they are ugly, and trivial to bypass, making it a waste of time, and time is money. It would thus be insecure, costly to build, and costly to maintain, without actually delivering the goal.
You would be far better off going ... |
45,417 | Is it possible to limit access to a page using wordpress user roles that isn't included in the wordpress install.
For example I have a CS Cart install with only a couple of products but I need to limit access to these pages to certain users.
Can I add something in to my CS Cart install to call on Wordpress to be able... | 2012/03/13 | [
"https://wordpress.stackexchange.com/questions/45417",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1859/"
] | if you can include the `wp-load.php` from WP install; after this you can use all WP Core functions and can also check the user and his rights with core function - `current_user_can()`.
But maybe it's easier to create an bridge from CS Cart to WP, if CS Cart has an own user table; i dont know. | No, it is not possible, not cleanly anyway
There are kludges that will get you half there but they are ugly, and trivial to bypass, making it a waste of time, and time is money. It would thus be insecure, costly to build, and costly to maintain, without actually delivering the goal.
You would be far better off going ... |
45,417 | Is it possible to limit access to a page using wordpress user roles that isn't included in the wordpress install.
For example I have a CS Cart install with only a couple of products but I need to limit access to these pages to certain users.
Can I add something in to my CS Cart install to call on Wordpress to be able... | 2012/03/13 | [
"https://wordpress.stackexchange.com/questions/45417",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1859/"
] | This is certainly possible but will require you to alter CS Cart a titbit. I'm not too familiar with CS Cart's inner workings, from the little that I've explored the source code (they actually make you fill in a form to download a community edition, bleh) you would want to do something of this kind:
```
$current_worki... | if you can include the `wp-load.php` from WP install; after this you can use all WP Core functions and can also check the user and his rights with core function - `current_user_can()`.
But maybe it's easier to create an bridge from CS Cart to WP, if CS Cart has an own user table; i dont know. |
45,417 | Is it possible to limit access to a page using wordpress user roles that isn't included in the wordpress install.
For example I have a CS Cart install with only a couple of products but I need to limit access to these pages to certain users.
Can I add something in to my CS Cart install to call on Wordpress to be able... | 2012/03/13 | [
"https://wordpress.stackexchange.com/questions/45417",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1859/"
] | This is certainly possible but will require you to alter CS Cart a titbit. I'm not too familiar with CS Cart's inner workings, from the little that I've explored the source code (they actually make you fill in a form to download a community edition, bleh) you would want to do something of this kind:
```
$current_worki... | If you just need to restrict to a specific WP page (that the CS cart is embedded within it with a [shortcode] or something, I presume - I don't know CS cart), the best way of doing this is by using one of the role managers plugin.
This one - [User Access Manager](http://wordpress.org/extend/plugins/user-access-manager... |
45,417 | Is it possible to limit access to a page using wordpress user roles that isn't included in the wordpress install.
For example I have a CS Cart install with only a couple of products but I need to limit access to these pages to certain users.
Can I add something in to my CS Cart install to call on Wordpress to be able... | 2012/03/13 | [
"https://wordpress.stackexchange.com/questions/45417",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1859/"
] | if you can include the `wp-load.php` from WP install; after this you can use all WP Core functions and can also check the user and his rights with core function - `current_user_can()`.
But maybe it's easier to create an bridge from CS Cart to WP, if CS Cart has an own user table; i dont know. | If you just need to restrict to a specific WP page (that the CS cart is embedded within it with a [shortcode] or something, I presume - I don't know CS cart), the best way of doing this is by using one of the role managers plugin.
This one - [User Access Manager](http://wordpress.org/extend/plugins/user-access-manager... |
64,540,998 | I've just started working with Vue.js and learning it through some online code snippet and tutorials. I'm trying to implement internationalization support for my vue project, but I'm getting error in web-console.
Here are my code snippets
**main.js**
```
import { createApp } from 'vue';
import App from './App.vue';
... | 2020/10/26 | [
"https://Stackoverflow.com/questions/64540998",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1842036/"
] | You should install [`vue-i18n@next`](https://github.com/intlify/vue-i18n-next) which is compatible with Vue 3:
```
npm install --save vue-i18n@next
```
or via using yarn
```
yarn add vue-i18n@next
```
**Basic usage :**
```
import { createApp } from "vue";
import App from "./App.vue";
import { createI18n } from... | I believe `"vue-i18n": "^8.22.1"` ([git](https://github.com/kazupon/vue-i18n)) you are using is not compatible with Vue 3 due to a major changes how Vue 3 works with regards to plugins (not very clear from the readme for sure). You can try [vue-i18n-next](https://github.com/intlify/vue-i18n-next) which is Vue 3 "ready"... |
590,829 | I have seen both options used interchangeably, is there a reason why?
* Example with ***on***: <https://www.springer.com/series/15362>
>
> Lecture Notes **on** Data Engineering and Communications Technologies
>
>
>
* Example with ***in***: <https://www.springer.com/series/7818>
>
> Lecture Notes **in** Electrica... | 2022/06/23 | [
"https://english.stackexchange.com/questions/590829",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/456082/"
] | [Ngrams](https://books.google.com/ngrams/graph?content=lecture%20notes%20on%2Clecture%20notes%20in&year_start=1900&year_end=2019&corpus=26&smoothing=3) shows both in use with comparable frequency
[](https://i.stack.imgur.com/fMpSR.jpg) | [american-english](/questions/tagged/american-english "show questions tagged 'american-english'")
"On" to me is a shorthand for "on the topic of," e.g. "Lecture Notes on (the topic of) Data Engineering and Communications Technologies," while "in" is a shorthand for "in the field of," e.g. "Lecture Notes in (the field ... |
28,496,791 | I'm having problems using a local version of a library which I don't want to push up to Clojars to test and find out it's broken. I appreciate this is a common problem for lots of devs new to Clojure and Leiningen. I've followed the steps provided by others and it still doesn't work.
**In summary**:
I've tried `lei... | 2015/02/13 | [
"https://Stackoverflow.com/questions/28496791",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4288305/"
] | Justin Smith from the #clojure irc channel helped me to resolve this issue.
It seems that just running `lein install` was enough, but the real issue was that the error I was seeing about the namespace not being found was actually misleading as there were errors within my helper library that needed to be fixed first be... | `lein install` is the correct approach, but you must have some inconsistency in naming or versions.
It can be helpful to show the classpath that leiningen is actually using:
`lein classpath`
Or with a profile (the +dev means default +dev):
`lein with-profile +dev classpath`
You should find the library somewhere un... |
28,496,791 | I'm having problems using a local version of a library which I don't want to push up to Clojars to test and find out it's broken. I appreciate this is a common problem for lots of devs new to Clojure and Leiningen. I've followed the steps provided by others and it still doesn't work.
**In summary**:
I've tried `lei... | 2015/02/13 | [
"https://Stackoverflow.com/questions/28496791",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4288305/"
] | Justin Smith from the #clojure irc channel helped me to resolve this issue.
It seems that just running `lein install` was enough, but the real issue was that the error I was seeing about the namespace not being found was actually misleading as there were errors within my helper library that needed to be fixed first be... | I had essentially the same issue, could not deal with it for 1.5 days...
The solution involved:
1. Getting the groupid/artifactid dependancies right in all `project.clj` files and in the namespace declarations.
2. There was an unused test file in the library project that had a reference to another charting library wh... |
58,171,374 | New users cannot log in via Facebook, receiving an error message saying: "Application not available: the application you are trying to use is no longer available or access is limited.".
Users have no problems accessing with their existing Facebook accounts. | 2019/09/30 | [
"https://Stackoverflow.com/questions/58171374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2281175/"
] | I get this issue when I create fake/test accounts on facebook. It seems like they take 1-2 hours to review the account before they will let you use the graphAPI. | If you just created a new business account, you will need to add one friend. |
58,171,374 | New users cannot log in via Facebook, receiving an error message saying: "Application not available: the application you are trying to use is no longer available or access is limited.".
Users have no problems accessing with their existing Facebook accounts. | 2019/09/30 | [
"https://Stackoverflow.com/questions/58171374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2281175/"
] | I get this issue when I create fake/test accounts on facebook. It seems like they take 1-2 hours to review the account before they will let you use the graphAPI. | This issue was on Facebook's current SDK. Please update the SDK this issue will be resolved. |
58,171,374 | New users cannot log in via Facebook, receiving an error message saying: "Application not available: the application you are trying to use is no longer available or access is limited.".
Users have no problems accessing with their existing Facebook accounts. | 2019/09/30 | [
"https://Stackoverflow.com/questions/58171374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2281175/"
] | This issue was on Facebook's current SDK. Please update the SDK this issue will be resolved. | If you just created a new business account, you will need to add one friend. |
45,809,048 | I am using primeng 4. Have added p-checkbox in my template and have also imported it to the corresponding ts file. But whenever the page is getting loaded on browser I get this error of - "'p-checkbox' is not a known element " | 2017/08/22 | [
"https://Stackoverflow.com/questions/45809048",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You should import `CheckboxModule` in you `app.module.ts`.
Example:
```
...
import {CheckboxModule} from 'primeng';
...
@NgModule({
imports: [
...
CheckboxModule,
...
],
declarations: [InputOverviewExample],
bootstrap: [InputOverviewExample],
providers: []
})
```
[Plunker demo of the setup](... | For PrimeNG v14, had to use this in the module file
```
...
import {CheckboxModule} from 'primeng/checkbox';
...
@NgModule({
imports: [
...
CheckboxModule,
...
],
declarations: [InputOverviewExample],
bootstrap: [InputOverviewExample],
providers: []
})
``` |
10,684,383 | I have created an EC2 instance (called A), and want to test the open source NerdDinner on it.
After having created and RDS instance for my database and created a database, how can I deploy my NerdDinner to the A instance?
And after that, I want to create two other EC2 instances (B,C) that can run the same app with th... | 2012/05/21 | [
"https://Stackoverflow.com/questions/10684383",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can use "fitXY" to scale an ImageView:
```
<ImageView android:layout_width="150dp"
android:layout_height="150dp"
android:scaleType="fitXY" />
```
You can set the source of the ImageView programmatically. | The following piece of code will do the trick ;)
```
public static Bitmap decodeFile(File f, boolean goodQuality){
try {
//Decode image size
BitmapFactory.Options o = new BitmapFactory.Options();
o.inJustDecodeBounds = true;
BitmapFactory.decodeStream(new FileInp... |
25,515,325 | I had a problem on ARM Cortex M3
with some functionality that requires multiply and divide natural numbers.
The point is: if it's possible to make calculations between 128 bits numbers?
I need to know how many assembly operations need software emulate multiple two 32 numbers and divide two 32bits numbers and then I w... | 2014/08/26 | [
"https://Stackoverflow.com/questions/25515325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/981403/"
] | [ARM Instructions](http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0337h/CHDDIGAC.html)
This page contains all of the cycle counts per instruction for the ARM M-Series processor. If you have the assembly code (which it sounds like you do?) then it should be easy enough to add up all of your cycles, mult... | The another solution is to use systick to measure cycle count.
See this [link from ARM](http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka8713.html)
**Edit:** You can set Counter to max and force to re-load its counter value once it has reached to 0.
// Configure Systick
\*STRVR = 0xFFFFFF; // m... |
70,395,334 | Hi I'm doing a coding challenge and I'm trying to fetch data from an html page but I keep getting the 400 error. I don't see where my syntax would be wrong. The Promise returns an empty string as PromiseResult. Why do I not get the data from <https://adventofcode.com/2021/day/2/input>?
```
fetch('https://adventofcode.... | 2021/12/17 | [
"https://Stackoverflow.com/questions/70395334",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15463235/"
] | This is ~33% faster (for the data given):
```
def index_last_value2(tbl, get_val=lambda obj:obj):
prev_v = get_val(tbl[-1])
for i in range(len(tbl) - 2, -1, -1):
if get_val(tbl[i]) != prev_v:
return i + 1
return 0
```
You could get another ~15% of speepdup by changing argument `get_va... | **General answer**
We scan the list from its beginning to its end
```
def index_last_value(tbl, get_val=lambda obj:obj):
lastv = get_val(tbl[-1])
for i,v in enumerate(tbl):
if get_val(v) == lastv:
return i
```
**Special case** : the values are contiguous (ie. there is no gap) :
[1, 1, 2,... |
29,404 | I live in Indonesia where 90% of our population is Muslim. Every mosque in my locality uses high volume loudspeakers during every prayer. All of the mosques make a loud prayer sound, and it seems like they are competing with each other to make loud noise, but their sound is not clear.
My question is: Are these loudspe... | 2016/01/11 | [
"https://islam.stackexchange.com/questions/29404",
"https://islam.stackexchange.com",
"https://islam.stackexchange.com/users/15350/"
] | Loudspeakers can't be mandatory since they didn't exist in the time of the Prophet(p.b.u.h) in 600-700 CE. The Islamic traditional method of relaying the voice of the Imam to a large group of people is to have a human repeater.
A little bit of trivia here is that when loudspeakers were initially introduced some schola... | Loud speakers are used for convenience. Take a note,
* Without them the Imam had to put in a lot of effort to make his voice reach the last qatar of the mosque.
* For large congregational prayers Mukabbir `(a person from the muktadi assigned to repeat the takbeers)`can be assigned from the muktadi. But the problem is,... |
25,655,686 | I have an Abaqus script that needs to be run iteratively, and continue running even if the job submitted does not converge. This is no problem if the script is submitted from the command line as following:
`abaqus cae script=script.py`
However, when executing a python script in Abaqus from the command line such as:
... | 2014/09/04 | [
"https://Stackoverflow.com/questions/25655686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4006046/"
] | Seems like probably what you are trying to achieve is not yet supported in angular version, you can instead create a directive of your own and do something like this;-
```
.directive('popover', function($compile, $timeout){
return {
restrict: 'A',
link:function(scope, el, attrs){
var content = attrs.co... | You can make this work out of the box using angular-strap popovers.
[Angular Strap Project](http://mgcrea.github.io/angular-strap/##popovers)
Angular Strap is native bootstrap directives done right. So basically it would look like this:
---
HTML for calling/activating popover
-----------------------------------
``... |
66,646,181 | Trying to read data of specific envelopes from DocuSign using completely backend java process ... and after some trial and error I've obtained AccessToken with JWT grant but still getting authorization error when asking for actual data :(
* Defined new integration key 9xxx7e
+ User Application: Authorization Code Gra... | 2021/03/15 | [
"https://Stackoverflow.com/questions/66646181",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4793722/"
] | there are 2 major problems that are there.
1. You are trying to access a static variable outside a class which is wrong. This problem can be fixed by adding `List<int> listOutside = Lists().list[0];` (notice the parentheses)
2. By accessing the `list[0];` you are saying that the element always exists but here the comp... | Seems to work when adding a "!".
```
List<int> listOutside = Lists.list[0]!;
```
I have no clue why, but anyways it works :D |
66,646,181 | Trying to read data of specific envelopes from DocuSign using completely backend java process ... and after some trial and error I've obtained AccessToken with JWT grant but still getting authorization error when asking for actual data :(
* Defined new integration key 9xxx7e
+ User Application: Authorization Code Gra... | 2021/03/15 | [
"https://Stackoverflow.com/questions/66646181",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4793722/"
] | there are 2 major problems that are there.
1. You are trying to access a static variable outside a class which is wrong. This problem can be fixed by adding `List<int> listOutside = Lists().list[0];` (notice the parentheses)
2. By accessing the `list[0];` you are saying that the element always exists but here the comp... | `?` means that this field can have the null value. The Dart language now supports sound null safety and to indicate that a variable might have the value `null`, just add `?` to its type declaration:
```dart
int? aNullableInt = null;
```
For your problem, you try to access list variable as a static usage and you use ... |
415,747 | Similar to [rm on cygwin, cannot unlink not owner](https://superuser.com/questions/61197/rm-on-cygwin-cannot-unlink-not-owner), but for MINGW32. I tried chmod u+w path but this did not help.
```
user@computer /d
$ rm dir -d
rm: cannot unlink `dir': Not owner
user@computer /d
$ chmod u+w dir
user@computer /d
$ rm dir... | 2012/04/23 | [
"https://superuser.com/questions/415747",
"https://superuser.com",
"https://superuser.com/users/68280/"
] | I don't know mingw but on "real" \*nix systems you need write access to the parent dir. You don't specify the permissions of "dir" or it's parent directory but I assume that is the problem here as well. | From the looks of it, it seems like you're trying to 'rm' a directory ("dir"). "rmdir" would rather do the trick.
Otherwise, other things that come to mind:
1. Can you remove the file from windows explorer or a dos prompt? If yes, then it could be a mingw bug.
2. If the file is marked as "read-only" then you can't rm... |
415,747 | Similar to [rm on cygwin, cannot unlink not owner](https://superuser.com/questions/61197/rm-on-cygwin-cannot-unlink-not-owner), but for MINGW32. I tried chmod u+w path but this did not help.
```
user@computer /d
$ rm dir -d
rm: cannot unlink `dir': Not owner
user@computer /d
$ chmod u+w dir
user@computer /d
$ rm dir... | 2012/04/23 | [
"https://superuser.com/questions/415747",
"https://superuser.com",
"https://superuser.com/users/68280/"
] | super-user (root) is the only account able to use `rm -d` flag
---
From the rm man page
```
-d, --directory
unlink FILE, even if it is a non-empty directory (super-user
only; this works only if your system supports ‘unlink’ for
nonempty directories)
```
I don't think mingw supports `su... | I don't know mingw but on "real" \*nix systems you need write access to the parent dir. You don't specify the permissions of "dir" or it's parent directory but I assume that is the problem here as well. |
415,747 | Similar to [rm on cygwin, cannot unlink not owner](https://superuser.com/questions/61197/rm-on-cygwin-cannot-unlink-not-owner), but for MINGW32. I tried chmod u+w path but this did not help.
```
user@computer /d
$ rm dir -d
rm: cannot unlink `dir': Not owner
user@computer /d
$ chmod u+w dir
user@computer /d
$ rm dir... | 2012/04/23 | [
"https://superuser.com/questions/415747",
"https://superuser.com",
"https://superuser.com/users/68280/"
] | super-user (root) is the only account able to use `rm -d` flag
---
From the rm man page
```
-d, --directory
unlink FILE, even if it is a non-empty directory (super-user
only; this works only if your system supports ‘unlink’ for
nonempty directories)
```
I don't think mingw supports `su... | From the looks of it, it seems like you're trying to 'rm' a directory ("dir"). "rmdir" would rather do the trick.
Otherwise, other things that come to mind:
1. Can you remove the file from windows explorer or a dos prompt? If yes, then it could be a mingw bug.
2. If the file is marked as "read-only" then you can't rm... |
47,029,039 | Here's my problem: I have two example tables below, where I tried inserting data from table two to table one with new id start from four.
I tried updating table two to change the auto increment and after that inserting to table one but it did not work.
Table 1
```
ID DESC
1. 1 one
2. 2 two
3. 3 three
```... | 2017/10/31 | [
"https://Stackoverflow.com/questions/47029039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4941144/"
] | Insert only `desc` to table 1
Example :
```
Insert into table_1(desc)
select desc from table_2
``` | When `table_1` **id field is an autoincrement value with the primary key**, it will add the next number to it.
Or you can do it by this
```
ALTER TABLE table_1
MODIFY COLUMN
ID INT auto_increment
```
So in query, you can do
```
INSERT INTO table_1(desc)
VALUES ('four') ,('five');
```
---
When you create tab... |
47,029,039 | Here's my problem: I have two example tables below, where I tried inserting data from table two to table one with new id start from four.
I tried updating table two to change the auto increment and after that inserting to table one but it did not work.
Table 1
```
ID DESC
1. 1 one
2. 2 two
3. 3 three
```... | 2017/10/31 | [
"https://Stackoverflow.com/questions/47029039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4941144/"
] | Rewrite your code like this.
```
ALTER TABLE Table_2 AUTO_INCREMENT = 4;
insert into table_1(desc)values('four'),('five');
``` | When `table_1` **id field is an autoincrement value with the primary key**, it will add the next number to it.
Or you can do it by this
```
ALTER TABLE table_1
MODIFY COLUMN
ID INT auto_increment
```
So in query, you can do
```
INSERT INTO table_1(desc)
VALUES ('four') ,('five');
```
---
When you create tab... |
30,237,702 | I am trying to start CakePHP. I made bookmarker and tested by command `bin\cake server`. It showed one error as connection to database could not be established:
`SQLSTATE[HY000] [1045] Access denied for user 'my_app'@'localhost' (using password: YES).`
I read the `config/app.default.php` file. It says there is a dat... | 2015/05/14 | [
"https://Stackoverflow.com/questions/30237702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4899827/"
] | * Edit **Config/app\_local.php** file instead of *Config/app.php* with your database connection parameters, i.e. host, username, password, database name. This will solve the problem.
* *Be sure to create same database first and providing enough privileges to same user you're writing in app\_local.php file.* | Error:
>
> SQLSTATE[HY000] [1045] Access denied for user 'my\_app'@'localhost'
> (using password: YES).
>
>
>
Reason:
>
> No user id: "my\_app" with password: "secret" [or any other] set in config/app.php
> file.
>
>
>
Solution:
>
> In case of WAMP, go to phpmyadmin page, then we can select cake\_cms
>... |
30,237,702 | I am trying to start CakePHP. I made bookmarker and tested by command `bin\cake server`. It showed one error as connection to database could not be established:
`SQLSTATE[HY000] [1045] Access denied for user 'my_app'@'localhost' (using password: YES).`
I read the `config/app.default.php` file. It says there is a dat... | 2015/05/14 | [
"https://Stackoverflow.com/questions/30237702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4899827/"
] | **See in Mysql.php:**
class Mysql extends Driver
{
```
use MysqlDialectTrait;
use PDODriverTrait;
/**
* Base configuration settings for MySQL driver
*
* @var array
*/
protected $_baseConfig = [
'persistent' => true,
'host' => 'localhost',
'username' => 'root',
'password' => '',
'database' => ... | [](https://i.stack.imgur.com/Ec5lM.png)I solved this problem by checking port at phpmyadmin top
and uncommit below line in app\_local.php
```
'port' => '3308',
``` |
30,237,702 | I am trying to start CakePHP. I made bookmarker and tested by command `bin\cake server`. It showed one error as connection to database could not be established:
`SQLSTATE[HY000] [1045] Access denied for user 'my_app'@'localhost' (using password: YES).`
I read the `config/app.default.php` file. It says there is a dat... | 2015/05/14 | [
"https://Stackoverflow.com/questions/30237702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4899827/"
] | Cake will not create the database or database user for you. You need to create them yourself and then match these database credentials into the db config file. Your datasource in `app/Config/app.php` file should look something similar to:
```
'Datasources' => [
'default' => [
'className' => 'Cake\Database\... | **See in Mysql.php:**
class Mysql extends Driver
{
```
use MysqlDialectTrait;
use PDODriverTrait;
/**
* Base configuration settings for MySQL driver
*
* @var array
*/
protected $_baseConfig = [
'persistent' => true,
'host' => 'localhost',
'username' => 'root',
'password' => '',
'database' => ... |
30,237,702 | I am trying to start CakePHP. I made bookmarker and tested by command `bin\cake server`. It showed one error as connection to database could not be established:
`SQLSTATE[HY000] [1045] Access denied for user 'my_app'@'localhost' (using password: YES).`
I read the `config/app.default.php` file. It says there is a dat... | 2015/05/14 | [
"https://Stackoverflow.com/questions/30237702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4899827/"
] | Edit **Config/app\_local.php** file with your database connection parameters. You will find host, username, password, database name their.
**don't edit config/app.php** with database connection parameters.
**Your problem will be now solved**
*CakePHP 4.x* | [](https://i.stack.imgur.com/Ec5lM.png)I solved this problem by checking port at phpmyadmin top
and uncommit below line in app\_local.php
```
'port' => '3308',
``` |
30,237,702 | I am trying to start CakePHP. I made bookmarker and tested by command `bin\cake server`. It showed one error as connection to database could not be established:
`SQLSTATE[HY000] [1045] Access denied for user 'my_app'@'localhost' (using password: YES).`
I read the `config/app.default.php` file. It says there is a dat... | 2015/05/14 | [
"https://Stackoverflow.com/questions/30237702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4899827/"
] | Cake will not create the database or database user for you. You need to create them yourself and then match these database credentials into the db config file. Your datasource in `app/Config/app.php` file should look something similar to:
```
'Datasources' => [
'default' => [
'className' => 'Cake\Database\... | If you are using wamp, make sure port is uncomment in Datasources and 'port' => '3308' |
30,237,702 | I am trying to start CakePHP. I made bookmarker and tested by command `bin\cake server`. It showed one error as connection to database could not be established:
`SQLSTATE[HY000] [1045] Access denied for user 'my_app'@'localhost' (using password: YES).`
I read the `config/app.default.php` file. It says there is a dat... | 2015/05/14 | [
"https://Stackoverflow.com/questions/30237702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4899827/"
] | Edit **Config/app\_local.php** file with your database connection parameters. You will find host, username, password, database name their.
**don't edit config/app.php** with database connection parameters.
**Your problem will be now solved**
*CakePHP 4.x* | If you are using wamp, make sure port is uncomment in Datasources and 'port' => '3308' |
30,237,702 | I am trying to start CakePHP. I made bookmarker and tested by command `bin\cake server`. It showed one error as connection to database could not be established:
`SQLSTATE[HY000] [1045] Access denied for user 'my_app'@'localhost' (using password: YES).`
I read the `config/app.default.php` file. It says there is a dat... | 2015/05/14 | [
"https://Stackoverflow.com/questions/30237702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4899827/"
] | Cake will not create the database or database user for you. You need to create them yourself and then match these database credentials into the db config file. Your datasource in `app/Config/app.php` file should look something similar to:
```
'Datasources' => [
'default' => [
'className' => 'Cake\Database\... | Edit **Config/app\_local.php** file with your database connection parameters. You will find host, username, password, database name their.
**don't edit config/app.php** with database connection parameters.
**Your problem will be now solved**
*CakePHP 4.x* |
30,237,702 | I am trying to start CakePHP. I made bookmarker and tested by command `bin\cake server`. It showed one error as connection to database could not be established:
`SQLSTATE[HY000] [1045] Access denied for user 'my_app'@'localhost' (using password: YES).`
I read the `config/app.default.php` file. It says there is a dat... | 2015/05/14 | [
"https://Stackoverflow.com/questions/30237702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4899827/"
] | **See in Mysql.php:**
class Mysql extends Driver
{
```
use MysqlDialectTrait;
use PDODriverTrait;
/**
* Base configuration settings for MySQL driver
*
* @var array
*/
protected $_baseConfig = [
'persistent' => true,
'host' => 'localhost',
'username' => 'root',
'password' => '',
'database' => ... | Error:
>
> SQLSTATE[HY000] [1045] Access denied for user 'my\_app'@'localhost'
> (using password: YES).
>
>
>
Reason:
>
> No user id: "my\_app" with password: "secret" [or any other] set in config/app.php
> file.
>
>
>
Solution:
>
> In case of WAMP, go to phpmyadmin page, then we can select cake\_cms
>... |
30,237,702 | I am trying to start CakePHP. I made bookmarker and tested by command `bin\cake server`. It showed one error as connection to database could not be established:
`SQLSTATE[HY000] [1045] Access denied for user 'my_app'@'localhost' (using password: YES).`
I read the `config/app.default.php` file. It says there is a dat... | 2015/05/14 | [
"https://Stackoverflow.com/questions/30237702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4899827/"
] | Cake will not create the database or database user for you. You need to create them yourself and then match these database credentials into the db config file. Your datasource in `app/Config/app.php` file should look something similar to:
```
'Datasources' => [
'default' => [
'className' => 'Cake\Database\... | Error:
>
> SQLSTATE[HY000] [1045] Access denied for user 'my\_app'@'localhost'
> (using password: YES).
>
>
>
Reason:
>
> No user id: "my\_app" with password: "secret" [or any other] set in config/app.php
> file.
>
>
>
Solution:
>
> In case of WAMP, go to phpmyadmin page, then we can select cake\_cms
>... |
30,237,702 | I am trying to start CakePHP. I made bookmarker and tested by command `bin\cake server`. It showed one error as connection to database could not be established:
`SQLSTATE[HY000] [1045] Access denied for user 'my_app'@'localhost' (using password: YES).`
I read the `config/app.default.php` file. It says there is a dat... | 2015/05/14 | [
"https://Stackoverflow.com/questions/30237702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4899827/"
] | * Edit **Config/app\_local.php** file instead of *Config/app.php* with your database connection parameters, i.e. host, username, password, database name. This will solve the problem.
* *Be sure to create same database first and providing enough privileges to same user you're writing in app\_local.php file.* | If you are using wamp, make sure port is uncomment in Datasources and 'port' => '3308' |
47,109,275 | I am trying to replicate a game tutorial from w3 schools. Everything has been successful so far up until the part where I have to create multiple obstacles by defining it as an array and calling upon the .push() function every 150th interval.
When I try to run the game with this exact Javascript code it keeps returnin... | 2017/11/04 | [
"https://Stackoverflow.com/questions/47109275",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7955432/"
] | ```
function startGame() {
gameArea.start();
pbfGamePiece = new component(8, 15, "#3baffc", 15, 115);
pbfObstacle.push(new component(3, 50, "#ff4000", 95, 100));
}
```
in `startGame()` you are assigning new Component to `pbfObstacle`. So its showing error. push that `new component` it will work. | I just had to remove the pbfObstacle line in the startGame function.
```
// This loads the function tagged on the <body>
function startGame() {
gameArea.start();
pbfGamePiece = new component(8, 15, "#3baffc", 15, 115);
}
``` |
367,251 | So I was having a discussion with some co-workers, imagine I'm designing an API. The API takes in a list of IDs, and returns a list of corresponding objects for each ID, each ID corresponds to exactly 1 object, and if any ID is not found the entire call fails. The objects returned do not have the ID used to query for t... | 2018/03/08 | [
"https://softwareengineering.stackexchange.com/questions/367251",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/57736/"
] | Result order is a very strict agreement and makes the API less flexible.
What will happen, if there is no data for id?
So my suggestion is to return a collection with `id : data` pairs:
```
{
"1" : "obj-1",
"2" : "obj-2",
"3" : null,
"4" : "obj-4"
}
```
Or if you have multiple data for an id:
```
{
"1" ... | Actually, it's bad design, if an API is implementing implicite behavior. If you consider interfaces and method signatures as contract (like, I guarantee that you will get a list, if you give me a list) to the caller e.g.
```
public IList<SomeClass> GetAListForAList(IList<int> inputList)
{
// some code here ...
}
... |
38,638,003 | any way to do $anchorScroll in ionic 2/Angular2 as of Angular 1.x?
Trying to scroll to an element on page.
I tried something like ng2-page-scroll
<https://github.com/Nolanus/ng2-page-scroll>
not sure if i m doing it right, i followed through the tutorial and got error:
```
ParseError: 'import' and 'export' may appea... | 2016/07/28 | [
"https://Stackoverflow.com/questions/38638003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4606577/"
] | I don't know if you are still facing this issue, but this can be solved it using `YourHTMLelement.getBoundingClientRect()`, which returns the bounds of that element as top, right, bottom and left.
With that, you can use [content](http://ionicframework.com/docs/v2/api/components/content/Content/) and `scrollTo(left, t... | I was in the same situation, where I wanted to scroll to the next page/element for each click of a button.
I looked at the same options you mentioned, and I found that in ion-slides (<http://ionicframework.com/docs/v2/api/components/slides/Slides/>), you can set the direction to 'vertical', which did the trick for me... |
34,283,570 | I am migrating my app on prod mariadb database from default django's sqlitedb. There are python3.3 + centos 7 + django 1.8 + apache envirounment.
On sqlite everything is working fine but after there migration i have such error after apache restarting:
```
Traceback (most recent call last):
File "/usr/local/mainproje... | 2015/12/15 | [
"https://Stackoverflow.com/questions/34283570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5653822/"
] | There is a complete list of Visual Studio Shortcuts available here <https://msdn.microsoft.com/en-us/library/da5kh0wa.aspx>. As already mentioned the default shortcut for go to `Edit.FindAllReferences` is `Shift` + `F12`.
Also if you rightclick a symbol in your code you can find the available actions in the context m... | May be you can try Alt + F12 [peek Definition] |
34,283,570 | I am migrating my app on prod mariadb database from default django's sqlitedb. There are python3.3 + centos 7 + django 1.8 + apache envirounment.
On sqlite everything is working fine but after there migration i have such error after apache restarting:
```
Traceback (most recent call last):
File "/usr/local/mainproje... | 2015/12/15 | [
"https://Stackoverflow.com/questions/34283570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5653822/"
] | **"Find all references"** is the easiest buit-in way to go, but that requires clicking through them one by one. "Find all references" can be accessed using the context menu or (by default) CTRL+K,R.
If you have VS2013 Ultimate and if your constants are in the same project or in the same file/class, you could use [**Co... | May be you can try Alt + F12 [peek Definition] |
21,768,590 | I'm using a ttf for my fonts in my app. The font i'm using is like:
<http://www.dafont.com/unlearned-bitmap.font?nb_ppp=50>
When i print text on a textview, the area in and around the strokes of the font is transparent, so i see only the black strokes of the font. When i set the backgroundcolor of the textview, the ar... | 2014/02/14 | [
"https://Stackoverflow.com/questions/21768590",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1816300/"
] | Although this is a completely wrong approach(\*), the problem is probably in database transactions. Current thread saves the article but within this uncommited transaction you are trying to get these data through another thread (through web server). In that case, this behaviour is fully correct. Either you need to comm... | Have you tried overriding the object's save method, calling super, waiting and then trying to retrieve the HTML?
Also are you using the development server? It may have issues handling the second request while the first one is still going. Maybe try it on a proper server? |
21,768,590 | I'm using a ttf for my fonts in my app. The font i'm using is like:
<http://www.dafont.com/unlearned-bitmap.font?nb_ppp=50>
When i print text on a textview, the area in and around the strokes of the font is transparent, so i see only the black strokes of the font. When i set the backgroundcolor of the textview, the ar... | 2014/02/14 | [
"https://Stackoverflow.com/questions/21768590",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1816300/"
] | Although this is a completely wrong approach(\*), the problem is probably in database transactions. Current thread saves the article but within this uncommited transaction you are trying to get these data through another thread (through web server). In that case, this behaviour is fully correct. Either you need to comm... | I had similar problem caused probably by the same issue (Asked differently, <https://plus.google.com/u/0/106729891586898564412/posts/Aoq3X1g4MvX>).
I did not solve it in a proper way, but you can try playing with the database cache, or (seen it in another django database problem) close all of the database connections a... |
21,768,590 | I'm using a ttf for my fonts in my app. The font i'm using is like:
<http://www.dafont.com/unlearned-bitmap.font?nb_ppp=50>
When i print text on a textview, the area in and around the strokes of the font is transparent, so i see only the black strokes of the font. When i set the backgroundcolor of the textview, the ar... | 2014/02/14 | [
"https://Stackoverflow.com/questions/21768590",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1816300/"
] | Although this is a completely wrong approach(\*), the problem is probably in database transactions. Current thread saves the article but within this uncommited transaction you are trying to get these data through another thread (through web server). In that case, this behaviour is fully correct. Either you need to comm... | **Edit 2:**
I have created a simple example (using Django 1.5.5) to test whether this works as intended. As far as I can tell, it does. pre\_save fires before a database commit and post\_save fires after.
Example detailed:
Two example models.
Article is used for triggering signals.
ArticleUrl is used to lo... |
32,444,031 | I have an enum representing all column values in a specific table. Now I want to store a type per enum element which is queried for later casting.
```
public enum Value {
MEMBER1(?...?),
MEMBER2(?...?);
private final ?...? type;
Value(?...? type) {
this.type = type;
}
public ?...? g... | 2015/09/07 | [
"https://Stackoverflow.com/questions/32444031",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You could do it by storing the Class of the object and use it to cast when necessary:
```
class Test {
public static void main(String[] arguments) throws Exception {
Object object = new MyClassA();
Class<MyClassA> clazz = Value.MEMBER1.getType();
MyClassA instance = clazz.cast(object);
... | >
> how can I use this value for this operation:
>
>
>
```
MyClassA instance = (MEMBER1.getType()) object;
```
Use **instanceof** to check object type.
```
MyClassA instance;
if (object instanceof MyClassA && object instanceof MEMBER1.getType()){
instance = (MyClassA) object;
}
``` |
32,444,031 | I have an enum representing all column values in a specific table. Now I want to store a type per enum element which is queried for later casting.
```
public enum Value {
MEMBER1(?...?),
MEMBER2(?...?);
private final ?...? type;
Value(?...? type) {
this.type = type;
}
public ?...? g... | 2015/09/07 | [
"https://Stackoverflow.com/questions/32444031",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You are right. The enum should be defined as follows
```
public enum Value {
MEMBER1(String.class),
MEMBER2(Integer.class);
private final Class<?> type;
private Value(Class<?> type) {
this.type = type;
}
public Class<?> getType(){
return this.type;
}
}
```
The second part is act... | >
> how can I use this value for this operation:
>
>
>
```
MyClassA instance = (MEMBER1.getType()) object;
```
Use **instanceof** to check object type.
```
MyClassA instance;
if (object instanceof MyClassA && object instanceof MEMBER1.getType()){
instance = (MyClassA) object;
}
``` |
32,444,031 | I have an enum representing all column values in a specific table. Now I want to store a type per enum element which is queried for later casting.
```
public enum Value {
MEMBER1(?...?),
MEMBER2(?...?);
private final ?...? type;
Value(?...? type) {
this.type = type;
}
public ?...? g... | 2015/09/07 | [
"https://Stackoverflow.com/questions/32444031",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You are right. The enum should be defined as follows
```
public enum Value {
MEMBER1(String.class),
MEMBER2(Integer.class);
private final Class<?> type;
private Value(Class<?> type) {
this.type = type;
}
public Class<?> getType(){
return this.type;
}
}
```
The second part is act... | You could do it by storing the Class of the object and use it to cast when necessary:
```
class Test {
public static void main(String[] arguments) throws Exception {
Object object = new MyClassA();
Class<MyClassA> clazz = Value.MEMBER1.getType();
MyClassA instance = clazz.cast(object);
... |
32,444,031 | I have an enum representing all column values in a specific table. Now I want to store a type per enum element which is queried for later casting.
```
public enum Value {
MEMBER1(?...?),
MEMBER2(?...?);
private final ?...? type;
Value(?...? type) {
this.type = type;
}
public ?...? g... | 2015/09/07 | [
"https://Stackoverflow.com/questions/32444031",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You could do it by storing the Class of the object and use it to cast when necessary:
```
class Test {
public static void main(String[] arguments) throws Exception {
Object object = new MyClassA();
Class<MyClassA> clazz = Value.MEMBER1.getType();
MyClassA instance = clazz.cast(object);
... | >
> I have an enum representing all column values in a specific table. Now
> I want to store a type per enum element which is queried for later
> casting.
>
>
>
In general, this can't be done the way you want it to be done.
What you want is for the enum to hold the keys for a *heterogenous type safe container* ... |
32,444,031 | I have an enum representing all column values in a specific table. Now I want to store a type per enum element which is queried for later casting.
```
public enum Value {
MEMBER1(?...?),
MEMBER2(?...?);
private final ?...? type;
Value(?...? type) {
this.type = type;
}
public ?...? g... | 2015/09/07 | [
"https://Stackoverflow.com/questions/32444031",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You are right. The enum should be defined as follows
```
public enum Value {
MEMBER1(String.class),
MEMBER2(Integer.class);
private final Class<?> type;
private Value(Class<?> type) {
this.type = type;
}
public Class<?> getType(){
return this.type;
}
}
```
The second part is act... | >
> I have an enum representing all column values in a specific table. Now
> I want to store a type per enum element which is queried for later
> casting.
>
>
>
In general, this can't be done the way you want it to be done.
What you want is for the enum to hold the keys for a *heterogenous type safe container* ... |
8,440,788 | How i can make this whitout php notice error:
```
$id = $_GET['id'];
$name = $_POST['name'];
$sql = mysql_query("SELECT * FROM table WHERE id = '$id' or name = '$name');
```
And how i can do one search in many tables at once.
Thank you | 2011/12/09 | [
"https://Stackoverflow.com/questions/8440788",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1088993/"
] | Do you have a manufacturer specific monitor driver installed? Have a look at the monitor profile. Its probably different from the colour profile in photoshop | I had to tweak the numbers I used in IB to get my colors to match.
For example: You want (240,240,240) and it gives you (236,236,236) dispite that you entered (240,240,240).
I entered (244,244,244) and it gave me a color closer to (240,240,240). I figured if I entered 240 and it gave me 236, then I should add 4 to m... |
8,440,788 | How i can make this whitout php notice error:
```
$id = $_GET['id'];
$name = $_POST['name'];
$sql = mysql_query("SELECT * FROM table WHERE id = '$id' or name = '$name');
```
And how i can do one search in many tables at once.
Thank you | 2011/12/09 | [
"https://Stackoverflow.com/questions/8440788",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1088993/"
] | Do you have a manufacturer specific monitor driver installed? Have a look at the monitor profile. Its probably different from the colour profile in photoshop | RGB value is meaningless without knowing the colorspace. Make sure you choose "Generic RGB" colorspace when selecting the color using the RGB sliders in Interface Builder. |
18,249 | [This article](http://tuxgraphics.org/electronics/201005/bench-power-supply-v3.shtml) describes a rather nice solution for building a current- and voltage- controlled benchtop power supply using a DC supply in the range of 20-30 volts and some additional down-regulation circuitry, with current and voltage control provi... | 2011/08/15 | [
"https://electronics.stackexchange.com/questions/18249",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/3707/"
] | There are two possible ways to go here: **linear regulator** vs **switcher**, aka SMPS (Switch Mode Power Supply).
**Linear**
This is the old school solution, and for a variable power supply has 1 major drawback: **power dissipation**. If you have a high enough input voltage to supply 25V out (e.g. 27V) you'll hav... | [Here](http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2524¶m=en539261) is a more sophisticated way to do it, and more design information is available. You won't need the power-factor correction with your lower power level. You can get more information from the Microchip forums. |
18,249 | [This article](http://tuxgraphics.org/electronics/201005/bench-power-supply-v3.shtml) describes a rather nice solution for building a current- and voltage- controlled benchtop power supply using a DC supply in the range of 20-30 volts and some additional down-regulation circuitry, with current and voltage control provi... | 2011/08/15 | [
"https://electronics.stackexchange.com/questions/18249",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/3707/"
] | [Here](http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2524¶m=en539261) is a more sophisticated way to do it, and more design information is available. You won't need the power-factor correction with your lower power level. You can get more information from the Microchip forums. | If you have a regulator with a fixed reference voltage, you can adjust the output voltage simply using a programmable potentiometer. For example, a MAX5387LAUD+ will let you vary the resistance between 0 and 10k in 256 steps using I2C control. I2C control is easy to output from the AVR part, especially if using the Ard... |
18,249 | [This article](http://tuxgraphics.org/electronics/201005/bench-power-supply-v3.shtml) describes a rather nice solution for building a current- and voltage- controlled benchtop power supply using a DC supply in the range of 20-30 volts and some additional down-regulation circuitry, with current and voltage control provi... | 2011/08/15 | [
"https://electronics.stackexchange.com/questions/18249",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/3707/"
] | There are two possible ways to go here: **linear regulator** vs **switcher**, aka SMPS (Switch Mode Power Supply).
**Linear**
This is the old school solution, and for a variable power supply has 1 major drawback: **power dissipation**. If you have a high enough input voltage to supply 25V out (e.g. 27V) you'll hav... | If you have a regulator with a fixed reference voltage, you can adjust the output voltage simply using a programmable potentiometer. For example, a MAX5387LAUD+ will let you vary the resistance between 0 and 10k in 256 steps using I2C control. I2C control is easy to output from the AVR part, especially if using the Ard... |
54,508,440 | I am writing some code to extend `Object`, and I would like to loop over the methods within the object. When I output the value of `this.constructor`, I see the methods that I would like (in the example below I see `test`). However, when I loop over the methods using a for, it only displays the method `getType`. How ca... | 2019/02/03 | [
"https://Stackoverflow.com/questions/54508440",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1778465/"
] | Two problems:
1. Properties can be enumerable – visited by for…in loops – or not. When you define a method in a `class`, the default is non-enumerable. (`Object.prototype.getType`, on the other hand, is enumerable because that’s the default when you create a property by assignment.)
2. You’re looping over properties o... | Perhaps not the most elegant solution, but one way to do this is via a call to `Object.getOwnPropertyNames()`, passing the object instances `__proto__` reference.
```js
Object.prototype.getType = function () {
/*
// Outputs correct class and methods
console.log(this.constructor)
for (let i in this.constr... |
54,508,440 | I am writing some code to extend `Object`, and I would like to loop over the methods within the object. When I output the value of `this.constructor`, I see the methods that I would like (in the example below I see `test`). However, when I loop over the methods using a for, it only displays the method `getType`. How ca... | 2019/02/03 | [
"https://Stackoverflow.com/questions/54508440",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1778465/"
] | Two problems:
1. Properties can be enumerable – visited by for…in loops – or not. When you define a method in a `class`, the default is non-enumerable. (`Object.prototype.getType`, on the other hand, is enumerable because that’s the default when you create a property by assignment.)
2. You’re looping over properties o... | The *getType* name seems inappropriate, what you're looking for are properties, so *getAllProperties* seems a better name.
As others have said, you need to go up the `[[Prototype]]` chain for a number of reasons:
1. Objects inherit from their constructor's prototype, not the constructor itself
2. The *constructor* pr... |
21,337 | She could have just nestled down to nap and I’ll pet her gently. Even if it’s for a few seconds then she gets up and wants to play.
I hope she doesn’t take petting as a cue to play. How could I break the habit and let her continue resting?
I play with her every day for 5-10 minutes every few hours. She has no siblin... | 2018/09/16 | [
"https://pets.stackexchange.com/questions/21337",
"https://pets.stackexchange.com",
"https://pets.stackexchange.com/users/12918/"
] | My best guess (and it is just a guess) is that your cat is bored, and jumps at the chance of any kind of active interaction with you.
5-10 minutes once or twice a day is not likely to satisfy the needs of most normal young to middle-aged cats, so unless yours is "elderly" is likely that she's starved for attention a... | There can be a number of reasons for the cat doing so, but none of them are really indicative of a problem.
* Some cats prefer playing to cuddling, and will always try to play with whoever gives them attention.
* Some cats get playful when they're really happy, even if they're generally not that playful. One of our ca... |
2,792,286 | Let $X\_1,...,X\_n$ be mutually independent RVs.
Suppose $X\_i \perp \mathcal F $ for $1\ \leq \forall i \leq n$.
How can I show that:
$$\sigma (X\_1,...,X\_n) \perp \mathcal F$$ ?
What I have tried:
$\sigma (X\_1...X\_n) = \sigma(\cup\_{i=1} ^n \sigma(X\_i))$ holds. I think I need some Dynkin's lemma-ish argum... | 2018/05/23 | [
"https://math.stackexchange.com/questions/2792286",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/254076/"
] | I doubt the conclusion. I remember that there is something like "pairwise independent does not imply independent".
More precisely, let $X\_1$, $X\_2$, $X\_3$ be random variables such that for any $i\neq j$, $X\_i$ and $X\_j$ are independent. However, $X\_1$, $X\_2$, $X\_3$ need not be independent. If my memory is corr... | I'll answer for $n=2$. This should be sufficient to show that if it's not true for $n>2$.
---
>
> If $\sigma(X),\sigma(Y)$ and $\mathscr {F}$ are independent, then $f(X,Y)$ is independent from $\mathscr{F}$.
>
>
>
In this respect, your question is similar to asking about pairwise independence. If $\sigma(X)$ and... |
26,560,654 | Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
For example,
"A man, a plan, a canal: Panama" is a palindrome.
"race a car" is not a palindrome.
```
class Solution {
public:
bool isPalindrome(string s) {
if (!s.length()) return true;
i... | 2014/10/25 | [
"https://Stackoverflow.com/questions/26560654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4180208/"
] | You never convert the last character to lower case because the loop condition is k < j and j is the index of the last character. Change the loop to:
```
for (int k = 0; k <= j; ++k)
s[k] = tolower(s[k]);
```
Also, the code would be a easier to read if you used character constants such as `'a'` instead of ASCII c... | You may iterate through the string in both directions until the pointers meet. It will be something like this:
```
bool isPalindrome(std::string const& s) {
int len = s.length();
int i = 0;
int j = len - 1;
while (true) {
// Skip garbage characters.
while (i < len && !isalpha(s[i])) ++i... |
26,560,654 | Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
For example,
"A man, a plan, a canal: Panama" is a palindrome.
"race a car" is not a palindrome.
```
class Solution {
public:
bool isPalindrome(string s) {
if (!s.length()) return true;
i... | 2014/10/25 | [
"https://Stackoverflow.com/questions/26560654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4180208/"
] | You never convert the last character to lower case because the loop condition is k < j and j is the index of the last character. Change the loop to:
```
for (int k = 0; k <= j; ++k)
s[k] = tolower(s[k]);
```
Also, the code would be a easier to read if you used character constants such as `'a'` instead of ASCII c... | Using JavaScript
```
var isPalindrome = function (s) {
let originalStringWithoutSplChr = s.replace(/[^a-zA-Z0-9]/g, "").toLowerCase()
let newString = originalStringWithoutSplChr.split("").reverse().join("")
if (newString === originalStringWithoutSplChr) {
return true
}
else {
retu... |
26,560,654 | Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
For example,
"A man, a plan, a canal: Panama" is a palindrome.
"race a car" is not a palindrome.
```
class Solution {
public:
bool isPalindrome(string s) {
if (!s.length()) return true;
i... | 2014/10/25 | [
"https://Stackoverflow.com/questions/26560654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4180208/"
] | Do not use "magic numbers". Take into account that apart from ASCII there is EBCDIIC coding scheme.
I would write the function the following way
```
#include <iostream>
#include <iomanip>
#include <string>
#include <cctype>
bool IsPalindrome( const std::string &s )
{
std::string::size_type i = 0, j = s.length();... | You may iterate through the string in both directions until the pointers meet. It will be something like this:
```
bool isPalindrome(std::string const& s) {
int len = s.length();
int i = 0;
int j = len - 1;
while (true) {
// Skip garbage characters.
while (i < len && !isalpha(s[i])) ++i... |
26,560,654 | Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
For example,
"A man, a plan, a canal: Panama" is a palindrome.
"race a car" is not a palindrome.
```
class Solution {
public:
bool isPalindrome(string s) {
if (!s.length()) return true;
i... | 2014/10/25 | [
"https://Stackoverflow.com/questions/26560654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4180208/"
] | Do not use "magic numbers". Take into account that apart from ASCII there is EBCDIIC coding scheme.
I would write the function the following way
```
#include <iostream>
#include <iomanip>
#include <string>
#include <cctype>
bool IsPalindrome( const std::string &s )
{
std::string::size_type i = 0, j = s.length();... | Using JavaScript
```
var isPalindrome = function (s) {
let originalStringWithoutSplChr = s.replace(/[^a-zA-Z0-9]/g, "").toLowerCase()
let newString = originalStringWithoutSplChr.split("").reverse().join("")
if (newString === originalStringWithoutSplChr) {
return true
}
else {
retu... |
51,429,490 | How come? I thought that "+1" is the lowest number it can generate... This is the question:
"(int) Math.random()\*(65535 + 1) returns a random number between:
Between 0 and 65535. <- answer
This is a question from a sololearn challenge. | 2018/07/19 | [
"https://Stackoverflow.com/questions/51429490",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9387675/"
] | Just pass `-n` and it should fix that.
`$ssh->write("echo -n '$file' > /directory/test.txt\n");`
`-n` tell not to append a new line. | I'm not sure why `write()` was sending additional line breaks. I'm sure if I went line by line and appended to the file that would have worked. In the end, I simply used `SFTP::put()` which allowed me to place the `@` that which wouldn't work with `SSH::exec()`. Thanks for all the input - it's a little different method... |
47,379,344 | I've used Git LFS for GitLab for a few months now without any problems, but it returned the following error while pushing files lately:
```
$ git push origin master
Git LFS: (14 of 14 files) 8.88 MB / 8.88 MB
Counting objects: 54, done.
Delta compression using up to 6 threads.
Compressing objects: 100% (49/49), done.
... | 2017/11/19 | [
"https://Stackoverflow.com/questions/47379344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8966912/"
] | This happened to our repositories on GitLab when they introduced their own LFS support recently. If you want to continue to use your own LFS then the process is rather painful - you need to disable their own LFS support on each repository, but there doesn't seem to be a web option for it, you need to do it via their co... | This command helped me:
```sh
git lfs ls-files -l | awk '{ print $1 }' | xargs git lfs push --object-id origin
```
And it is faster than the other answer. |
47,379,344 | I've used Git LFS for GitLab for a few months now without any problems, but it returned the following error while pushing files lately:
```
$ git push origin master
Git LFS: (14 of 14 files) 8.88 MB / 8.88 MB
Counting objects: 54, done.
Delta compression using up to 6 threads.
Compressing objects: 100% (49/49), done.
... | 2017/11/19 | [
"https://Stackoverflow.com/questions/47379344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8966912/"
] | This happened to our repositories on GitLab when they introduced their own LFS support recently. If you want to continue to use your own LFS then the process is rather painful - you need to disable their own LFS support on each repository, but there doesn't seem to be a web option for it, you need to do it via their co... | I got this error even though (to my knowledge) I did not have any LFS objects in my gitlab repository.
```
remote: GitLab: LFS objects are missing. Ensure LFS is properly set up or try a manual "git lfs push --all".
```
The solution was to disable **Git Large File Storage (LFS)** in the gitlab project settings.
Set... |
47,379,344 | I've used Git LFS for GitLab for a few months now without any problems, but it returned the following error while pushing files lately:
```
$ git push origin master
Git LFS: (14 of 14 files) 8.88 MB / 8.88 MB
Counting objects: 54, done.
Delta compression using up to 6 threads.
Compressing objects: 100% (49/49), done.
... | 2017/11/19 | [
"https://Stackoverflow.com/questions/47379344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8966912/"
] | I got this error even though (to my knowledge) I did not have any LFS objects in my gitlab repository.
```
remote: GitLab: LFS objects are missing. Ensure LFS is properly set up or try a manual "git lfs push --all".
```
The solution was to disable **Git Large File Storage (LFS)** in the gitlab project settings.
Set... | This command helped me:
```sh
git lfs ls-files -l | awk '{ print $1 }' | xargs git lfs push --object-id origin
```
And it is faster than the other answer. |
588,486 | I am taking notes in LaTeX for sometime now. But I'm stuck with this one now. I want to create the equation below in LaTeX.
[](https://i.stack.imgur.com/rPbbx.png)
I tried using `\underbrace` `\Centerstack` command but I don't know how... | 2021/03/22 | [
"https://tex.stackexchange.com/questions/588486",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/238100/"
] | Not pretty code, but the formula isn't pretty, too.
```
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\textup{FCFF}+
\textup{NOPLAT}+
{\underbrace{%
\begin{tabular}{@{}c@{}} Non-cash \\ Operating Expenses \end{tabular}%
\;-\;
\overset{\substack{\textup{Gross Investment\smash[t]{\strut}}\\\b... | ```
\documentclass[fleqn]{article}
\usepackage{amsmath}
\begin{document}
\[\text{FCFF}+\text{NOPLAT}
=\underbrace{\begin{tabular}{@{}c@{}}
Non-cash\\
operating expenses\end{tabular}
-\overset{\begin{array}{@{}c@{}}\text{Gross investment}\\
\downarrow
\end{array}}{\begin{tabular}{@{}c@{}}
Investment in\\
invested capita... |
588,486 | I am taking notes in LaTeX for sometime now. But I'm stuck with this one now. I want to create the equation below in LaTeX.
[](https://i.stack.imgur.com/rPbbx.png)
I tried using `\underbrace` `\Centerstack` command but I don't know how... | 2021/03/22 | [
"https://tex.stackexchange.com/questions/588486",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/238100/"
] | Not pretty code, but the formula isn't pretty, too.
```
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\textup{FCFF}+
\textup{NOPLAT}+
{\underbrace{%
\begin{tabular}{@{}c@{}} Non-cash \\ Operating Expenses \end{tabular}%
\;-\;
\overset{\substack{\textup{Gross Investment\smash[t]{\strut}}\\\b... | I have made some small changes to your 2nd screenshot that make your formula slightly clearer and I have added the specific font for your second image.
Here there is my approach.
```
\documentclass[a4paper,12pt]{article}
\usepackage[OT1]{fontenc}
\usepackage{amsmath}
\usepackage{mathpazo}
\usepackage[scaled=.95]{helv... |
1,029,840 | I run a small golf eclectic with excel. One of the things we have is a points system. I would like to get the 5 highest points scored over the season and have them ranked from 1 (being the highest points scored) to 5.
My knowledge of excel "sums" goes only a wee bit further than add and subtract.
Thanks! | 2009/06/22 | [
"https://Stackoverflow.com/questions/1029840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | If you have a column containing the scores, you could add a filter (Data->Filter I think) and sort descending.
Though, if you just have rows that are something like [Date][Person][Score] you'll need to go to another sheet and SUM the scores for each person then sort that... Unfortunately my Excel skills aren't up to p... | If you have Excel 2007,
Check that your data is continuous, with no blank rows or columns. Click on your scores and then select **'Data - Filter'**
Using the dropdown that the filter creates at the top of your scores column and select **'Number filters - Top ten'**
A **'Top ten Autofilter'** dialog will be displayed... |
1,029,840 | I run a small golf eclectic with excel. One of the things we have is a points system. I would like to get the 5 highest points scored over the season and have them ranked from 1 (being the highest points scored) to 5.
My knowledge of excel "sums" goes only a wee bit further than add and subtract.
Thanks! | 2009/06/22 | [
"https://Stackoverflow.com/questions/1029840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | If you don't want to change the order that they are presently in you can use the LARGE function. It returns the kth largest value.
Below is a great formula, if you drag it down it will automatically get the second, third and nth largest value from a table of data (in this example the data is between A1 to A10).
```
... | If you have a column containing the scores, you could add a filter (Data->Filter I think) and sort descending.
Though, if you just have rows that are something like [Date][Person][Score] you'll need to go to another sheet and SUM the scores for each person then sort that... Unfortunately my Excel skills aren't up to p... |
1,029,840 | I run a small golf eclectic with excel. One of the things we have is a points system. I would like to get the 5 highest points scored over the season and have them ranked from 1 (being the highest points scored) to 5.
My knowledge of excel "sums" goes only a wee bit further than add and subtract.
Thanks! | 2009/06/22 | [
"https://Stackoverflow.com/questions/1029840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | If you have a column containing the scores, you could add a filter (Data->Filter I think) and sort descending.
Though, if you just have rows that are something like [Date][Person][Score] you'll need to go to another sheet and SUM the scores for each person then sort that... Unfortunately my Excel skills aren't up to p... | If you want to use the LARGE Function as described above, make sure you put the same range in the list for each of the LARGE functions. That is, change =LARGE(A1:A10,ROW(A1)-ROW($A$1)+1) to =LARGE(A$1:A$10,ROW(A1)-ROW($A$1)+1) or you will get some strange incorrect results |
1,029,840 | I run a small golf eclectic with excel. One of the things we have is a points system. I would like to get the 5 highest points scored over the season and have them ranked from 1 (being the highest points scored) to 5.
My knowledge of excel "sums" goes only a wee bit further than add and subtract.
Thanks! | 2009/06/22 | [
"https://Stackoverflow.com/questions/1029840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Given a list of numbers in A1 to A10, you can work out their 'Rank' relative to each other by using 'RANK'.
e.g.
```
RANK(A1,A1:A6,0)
```
RANK(cell, list of cells to check against, order)
For order, 0 = descending.
From there you can work out which one is first pragmatically. | If you have Excel 2007,
Check that your data is continuous, with no blank rows or columns. Click on your scores and then select **'Data - Filter'**
Using the dropdown that the filter creates at the top of your scores column and select **'Number filters - Top ten'**
A **'Top ten Autofilter'** dialog will be displayed... |
1,029,840 | I run a small golf eclectic with excel. One of the things we have is a points system. I would like to get the 5 highest points scored over the season and have them ranked from 1 (being the highest points scored) to 5.
My knowledge of excel "sums" goes only a wee bit further than add and subtract.
Thanks! | 2009/06/22 | [
"https://Stackoverflow.com/questions/1029840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | If you don't want to change the order that they are presently in you can use the LARGE function. It returns the kth largest value.
Below is a great formula, if you drag it down it will automatically get the second, third and nth largest value from a table of data (in this example the data is between A1 to A10).
```
... | Given a list of numbers in A1 to A10, you can work out their 'Rank' relative to each other by using 'RANK'.
e.g.
```
RANK(A1,A1:A6,0)
```
RANK(cell, list of cells to check against, order)
For order, 0 = descending.
From there you can work out which one is first pragmatically. |
1,029,840 | I run a small golf eclectic with excel. One of the things we have is a points system. I would like to get the 5 highest points scored over the season and have them ranked from 1 (being the highest points scored) to 5.
My knowledge of excel "sums" goes only a wee bit further than add and subtract.
Thanks! | 2009/06/22 | [
"https://Stackoverflow.com/questions/1029840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Given a list of numbers in A1 to A10, you can work out their 'Rank' relative to each other by using 'RANK'.
e.g.
```
RANK(A1,A1:A6,0)
```
RANK(cell, list of cells to check against, order)
For order, 0 = descending.
From there you can work out which one is first pragmatically. | If you want to use the LARGE Function as described above, make sure you put the same range in the list for each of the LARGE functions. That is, change =LARGE(A1:A10,ROW(A1)-ROW($A$1)+1) to =LARGE(A$1:A$10,ROW(A1)-ROW($A$1)+1) or you will get some strange incorrect results |
1,029,840 | I run a small golf eclectic with excel. One of the things we have is a points system. I would like to get the 5 highest points scored over the season and have them ranked from 1 (being the highest points scored) to 5.
My knowledge of excel "sums" goes only a wee bit further than add and subtract.
Thanks! | 2009/06/22 | [
"https://Stackoverflow.com/questions/1029840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | If you don't want to change the order that they are presently in you can use the LARGE function. It returns the kth largest value.
Below is a great formula, if you drag it down it will automatically get the second, third and nth largest value from a table of data (in this example the data is between A1 to A10).
```
... | If you have Excel 2007,
Check that your data is continuous, with no blank rows or columns. Click on your scores and then select **'Data - Filter'**
Using the dropdown that the filter creates at the top of your scores column and select **'Number filters - Top ten'**
A **'Top ten Autofilter'** dialog will be displayed... |
1,029,840 | I run a small golf eclectic with excel. One of the things we have is a points system. I would like to get the 5 highest points scored over the season and have them ranked from 1 (being the highest points scored) to 5.
My knowledge of excel "sums" goes only a wee bit further than add and subtract.
Thanks! | 2009/06/22 | [
"https://Stackoverflow.com/questions/1029840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | If you don't want to change the order that they are presently in you can use the LARGE function. It returns the kth largest value.
Below is a great formula, if you drag it down it will automatically get the second, third and nth largest value from a table of data (in this example the data is between A1 to A10).
```
... | If you want to use the LARGE Function as described above, make sure you put the same range in the list for each of the LARGE functions. That is, change =LARGE(A1:A10,ROW(A1)-ROW($A$1)+1) to =LARGE(A$1:A$10,ROW(A1)-ROW($A$1)+1) or you will get some strange incorrect results |
21,868,771 | ```
header ul {
display: inline; }
header ul .nav-header li {
list-style: none;
margin-right: 1em;
float: left; }
header ul a {
text-decoration: none; }
*{ border: 0; margin: 0; padding: 0; }
```
this is my css now using the reset wildcard seems to cancel out the display: inline; anyone know a ... | 2014/02/19 | [
"https://Stackoverflow.com/questions/21868771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2434321/"
] | Next time please create a threaddump, a sampling snapshot of NetBeans (using JVisualVM from your JDK) aand attach it to a new issue at <https://netbeans.org/bugzilla/>
Do not forget to attach the IDE log too
Perhaps one of the plugins causes a deadlock. | I use from netbeans 8.02 on windows 7 and my net beans hang constantly and recently i fixed hanging problem just with renaming "component" folder name of netbeans in following path ...AppData\Roaming\NetBeans\8.0.2\config\Windows2Local
when hanging occurred again |
21,868,771 | ```
header ul {
display: inline; }
header ul .nav-header li {
list-style: none;
margin-right: 1em;
float: left; }
header ul a {
text-decoration: none; }
*{ border: 0; margin: 0; padding: 0; }
```
this is my css now using the reset wildcard seems to cancel out the display: inline; anyone know a ... | 2014/02/19 | [
"https://Stackoverflow.com/questions/21868771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2434321/"
] | Most recently I have added to NetBeans j2me plugin , then after installation of related J2ME sdk it started stick on that forever "starting modules.."
I simply uninstalled that j2me sdk outside and netbeans now starts ok again. | I use from netbeans 8.02 on windows 7 and my net beans hang constantly and recently i fixed hanging problem just with renaming "component" folder name of netbeans in following path ...AppData\Roaming\NetBeans\8.0.2\config\Windows2Local
when hanging occurred again |
67,004,639 | Consider this type definition:
```
type ChoiceOne =
| A
| B
```
and this binding
```
let c1 = A
```
I assume the correct way to translate this into natural language would be *"the value A of type ChoiceOne is constructed and bound to the name c1"*.
Now take a look at this next type definition and binding:
... | 2021/04/08 | [
"https://Stackoverflow.com/questions/67004639",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3771427/"
] | This is all splitting hairs. Nobody really cares about how exactly to say these things outside of a quiz in college, and even then, I would recommend maybe transferring to a different college :-)
But if you really want to split hairs, here we go.
In your very first example, the value `A` is not "constructed". Since i... | Here's the terminology that I use, which I believe is widely accepted, using my own example:
```ml
type MyDU =
| A of int
| B
```
* `A` is a case
* `A` is also a function that takes an `int` and returns a value of type `MyDU`
* Therefore, `A 1` is a value of type `MyDU`
* `B` is a case
* `B` is also a value ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.