qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
15,695,992 | I am trying to capitalise every word in a php string but the function isn't detecting a word that is being immediately followed by a bracket. How can I make it so that a word directly after a bracket is capitalised?
Example: amharic (ethiopian) .... Amharic (Ethiopian)
(currently using ucwords(), PHP displays Amharic... | 2013/03/29 | [
"https://Stackoverflow.com/questions/15695992",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/844438/"
] | Try this,i tried it ,
```
$text= "amharic (ethiopian)";
echo mb_convert_case($text, MB_CASE_TITLE, "UTF-8");
```
>
> **output** : Amharic (Ethiopian)
>
>
>
Note:It looks like the mbstring function on PHP is to be enabled. | For anyone else needing to title case around other characters including dashes, brackets and parentheses. You can use regex with preg\_replace\_callback to capture a word that is split with a dash or begins with a character not in the alphabet.
```
/** Capitalize first letter if string is only one word **/
$STR =... |
15,695,992 | I am trying to capitalise every word in a php string but the function isn't detecting a word that is being immediately followed by a bracket. How can I make it so that a word directly after a bracket is capitalised?
Example: amharic (ethiopian) .... Amharic (Ethiopian)
(currently using ucwords(), PHP displays Amharic... | 2013/03/29 | [
"https://Stackoverflow.com/questions/15695992",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/844438/"
] | Try this,i tried it ,
```
$text= "amharic (ethiopian)";
echo mb_convert_case($text, MB_CASE_TITLE, "UTF-8");
```
>
> **output** : Amharic (Ethiopian)
>
>
>
Note:It looks like the mbstring function on PHP is to be enabled. | You should be able to solve it with preg\_replace (<http://php.net/manual/en/function.preg-replace.php>) and a regular expression like `/[A-Z][a-zA-Z]*/` or similar. |
15,695,992 | I am trying to capitalise every word in a php string but the function isn't detecting a word that is being immediately followed by a bracket. How can I make it so that a word directly after a bracket is capitalised?
Example: amharic (ethiopian) .... Amharic (Ethiopian)
(currently using ucwords(), PHP displays Amharic... | 2013/03/29 | [
"https://Stackoverflow.com/questions/15695992",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/844438/"
] | This is a [known bug](https://bugs.php.net/bug.php?id=21626) which requires there to be whitespace between open-parenthesis and the first letter. Here's a workaround:
```
$var = "amharic (ethiopian)";
echo str_replace('( ', '(', ucwords(str_replace('(', '( ', $var)));
```
**Result**
```
Amharic (Ethiopian)
```
[S... | For anyone else needing to title case around other characters including dashes, brackets and parentheses. You can use regex with preg\_replace\_callback to capture a word that is split with a dash or begins with a character not in the alphabet.
```
/** Capitalize first letter if string is only one word **/
$STR =... |
15,695,992 | I am trying to capitalise every word in a php string but the function isn't detecting a word that is being immediately followed by a bracket. How can I make it so that a word directly after a bracket is capitalised?
Example: amharic (ethiopian) .... Amharic (Ethiopian)
(currently using ucwords(), PHP displays Amharic... | 2013/03/29 | [
"https://Stackoverflow.com/questions/15695992",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/844438/"
] | This is a [known bug](https://bugs.php.net/bug.php?id=21626) which requires there to be whitespace between open-parenthesis and the first letter. Here's a workaround:
```
$var = "amharic (ethiopian)";
echo str_replace('( ', '(', ucwords(str_replace('(', '( ', $var)));
```
**Result**
```
Amharic (Ethiopian)
```
[S... | Below function use to covert word with Bracket into Capitalize after Bracket
```
function ucWordWithBracket($edit){
$new_word = str_replace("(","( ",$edit);
$temp = ucwords($new_word);
$new_word = str_replace("( ","(",$temp);
return $new_word;
}
```
ucWordWithBracket(amharic ... |
15,695,992 | I am trying to capitalise every word in a php string but the function isn't detecting a word that is being immediately followed by a bracket. How can I make it so that a word directly after a bracket is capitalised?
Example: amharic (ethiopian) .... Amharic (Ethiopian)
(currently using ucwords(), PHP displays Amharic... | 2013/03/29 | [
"https://Stackoverflow.com/questions/15695992",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/844438/"
] | Below function use to covert word with Bracket into Capitalize after Bracket
```
function ucWordWithBracket($edit){
$new_word = str_replace("(","( ",$edit);
$temp = ucwords($new_word);
$new_word = str_replace("( ","(",$temp);
return $new_word;
}
```
ucWordWithBracket(amharic ... | For anyone else needing to title case around other characters including dashes, brackets and parentheses. You can use regex with preg\_replace\_callback to capture a word that is split with a dash or begins with a character not in the alphabet.
```
/** Capitalize first letter if string is only one word **/
$STR =... |
15,695,992 | I am trying to capitalise every word in a php string but the function isn't detecting a word that is being immediately followed by a bracket. How can I make it so that a word directly after a bracket is capitalised?
Example: amharic (ethiopian) .... Amharic (Ethiopian)
(currently using ucwords(), PHP displays Amharic... | 2013/03/29 | [
"https://Stackoverflow.com/questions/15695992",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/844438/"
] | Try this,i tried it ,
```
$text= "amharic (ethiopian)";
echo mb_convert_case($text, MB_CASE_TITLE, "UTF-8");
```
>
> **output** : Amharic (Ethiopian)
>
>
>
Note:It looks like the mbstring function on PHP is to be enabled. | I think that the problem is that php is going to capitalise the first character after the space and because the bracket is just a character after the space so it is considered as the first character in the word must be capitalise and other characters folow it are considered as characters of this world
So to work aroun... |
15,695,992 | I am trying to capitalise every word in a php string but the function isn't detecting a word that is being immediately followed by a bracket. How can I make it so that a word directly after a bracket is capitalised?
Example: amharic (ethiopian) .... Amharic (Ethiopian)
(currently using ucwords(), PHP displays Amharic... | 2013/03/29 | [
"https://Stackoverflow.com/questions/15695992",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/844438/"
] | This is a [known bug](https://bugs.php.net/bug.php?id=21626) which requires there to be whitespace between open-parenthesis and the first letter. Here's a workaround:
```
$var = "amharic (ethiopian)";
echo str_replace('( ', '(', ucwords(str_replace('(', '( ', $var)));
```
**Result**
```
Amharic (Ethiopian)
```
[S... | I think that the problem is that php is going to capitalise the first character after the space and because the bracket is just a character after the space so it is considered as the first character in the word must be capitalise and other characters folow it are considered as characters of this world
So to work aroun... |
15,695,992 | I am trying to capitalise every word in a php string but the function isn't detecting a word that is being immediately followed by a bracket. How can I make it so that a word directly after a bracket is capitalised?
Example: amharic (ethiopian) .... Amharic (Ethiopian)
(currently using ucwords(), PHP displays Amharic... | 2013/03/29 | [
"https://Stackoverflow.com/questions/15695992",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/844438/"
] | This is a [known bug](https://bugs.php.net/bug.php?id=21626) which requires there to be whitespace between open-parenthesis and the first letter. Here's a workaround:
```
$var = "amharic (ethiopian)";
echo str_replace('( ', '(', ucwords(str_replace('(', '( ', $var)));
```
**Result**
```
Amharic (Ethiopian)
```
[S... | You should be able to solve it with preg\_replace (<http://php.net/manual/en/function.preg-replace.php>) and a regular expression like `/[A-Z][a-zA-Z]*/` or similar. |
15,695,992 | I am trying to capitalise every word in a php string but the function isn't detecting a word that is being immediately followed by a bracket. How can I make it so that a word directly after a bracket is capitalised?
Example: amharic (ethiopian) .... Amharic (Ethiopian)
(currently using ucwords(), PHP displays Amharic... | 2013/03/29 | [
"https://Stackoverflow.com/questions/15695992",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/844438/"
] | Try this,i tried it ,
```
$text= "amharic (ethiopian)";
echo mb_convert_case($text, MB_CASE_TITLE, "UTF-8");
```
>
> **output** : Amharic (Ethiopian)
>
>
>
Note:It looks like the mbstring function on PHP is to be enabled. | Below function use to covert word with Bracket into Capitalize after Bracket
```
function ucWordWithBracket($edit){
$new_word = str_replace("(","( ",$edit);
$temp = ucwords($new_word);
$new_word = str_replace("( ","(",$temp);
return $new_word;
}
```
ucWordWithBracket(amharic ... |
15,695,992 | I am trying to capitalise every word in a php string but the function isn't detecting a word that is being immediately followed by a bracket. How can I make it so that a word directly after a bracket is capitalised?
Example: amharic (ethiopian) .... Amharic (Ethiopian)
(currently using ucwords(), PHP displays Amharic... | 2013/03/29 | [
"https://Stackoverflow.com/questions/15695992",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/844438/"
] | Below function use to covert word with Bracket into Capitalize after Bracket
```
function ucWordWithBracket($edit){
$new_word = str_replace("(","( ",$edit);
$temp = ucwords($new_word);
$new_word = str_replace("( ","(",$temp);
return $new_word;
}
```
ucWordWithBracket(amharic ... | You should be able to solve it with preg\_replace (<http://php.net/manual/en/function.preg-replace.php>) and a regular expression like `/[A-Z][a-zA-Z]*/` or similar. |
25,078 | As we've rolled into fruit season this year I've started canning up some jams using a traditional boiling process in my big stock pot (though I'm getting pretty close to investing in a pressure canner at this point) and I'm running into a problem: I wind up with too much jam to process in a single batch (which comforta... | 2012/07/17 | [
"https://cooking.stackexchange.com/questions/25078",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/2859/"
] | If it's getting cooked too much, well, stop cooking it. You can cover it to prevent water loss. If it's too hot sitting on the same burner (on an electric stove), move the pot. It sounds like your cast-iron pot might be part of the problem, too - if it's still staying too hot, you could pour it into something else. Fin... | You could avoid the problems by having more jars ready. Here's what I do to get my jars ready.
\*When you want to clean jars up for canning, the sterilizing process is between you and yours, not the health authorities.
Here is what I do to clean up my jars quickly. I save jars where the lid acts as a button indicator... |
25,078 | As we've rolled into fruit season this year I've started canning up some jams using a traditional boiling process in my big stock pot (though I'm getting pretty close to investing in a pressure canner at this point) and I'm running into a problem: I wind up with too much jam to process in a single batch (which comforta... | 2012/07/17 | [
"https://cooking.stackexchange.com/questions/25078",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/2859/"
] | If it's getting cooked too much, well, stop cooking it. You can cover it to prevent water loss. If it's too hot sitting on the same burner (on an electric stove), move the pot. It sounds like your cast-iron pot might be part of the problem, too - if it's still staying too hot, you could pour it into something else. Fin... | Why are you boiling-filling-boiling again? Check out canning myths. Trust me it’s there. I simply run my jars through the dishwasher checking for any possible grit after (we’re in a farm so sometimes get a silt/sand in the bottom of cups) turn the jars upside down on a towel while making jam. Fill bottles with pipping ... |
25,078 | As we've rolled into fruit season this year I've started canning up some jams using a traditional boiling process in my big stock pot (though I'm getting pretty close to investing in a pressure canner at this point) and I'm running into a problem: I wind up with too much jam to process in a single batch (which comforta... | 2012/07/17 | [
"https://cooking.stackexchange.com/questions/25078",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/2859/"
] | You could avoid the problems by having more jars ready. Here's what I do to get my jars ready.
\*When you want to clean jars up for canning, the sterilizing process is between you and yours, not the health authorities.
Here is what I do to clean up my jars quickly. I save jars where the lid acts as a button indicator... | Why are you boiling-filling-boiling again? Check out canning myths. Trust me it’s there. I simply run my jars through the dishwasher checking for any possible grit after (we’re in a farm so sometimes get a silt/sand in the bottom of cups) turn the jars upside down on a towel while making jam. Fill bottles with pipping ... |
15,772,626 | First off I'm not used to dealing with images, so if my wording is off please excuse me.
I am looking to take an image that is dropped onto a HTML5 canvas, sample it, do a reduction of the sampling, then create a polygonal representation of the image using mostly triangles with a few other polygons and draw that image... | 2013/04/02 | [
"https://Stackoverflow.com/questions/15772626",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/525374/"
] | I would do the following:
1. Create a field of randomly-placed dots.
2. Create a [Voronoi diagram](http://en.wikipedia.org/wiki/Voronoi_diagram) from the dots.
* Here's a good JavaScript library that I've used in the past for this: <https://github.com/gorhill/Javascript-Voronoi>
3. Color each cell based on sampling t... | Ok, it's a bit indirect, but here goes.....!
This is a plugin for SVG that turns images into pointilized art: <https://github.com/gsmith85/SeuratJS/blob/master/seurat.js>
Here's the interesting part. Under the hood, it uses **canvas** to do the processing!
The examples show images composed of "dots" and "squares".
... |
19,518,086 | i have a css file with a bunch of background image urls:
```
.alert-01 {
background: url('img/alert-01.jpg') center no-repeat;
}
.alert-02 {
background: url('img/alert-02.jpg') center no-repeat;
}
.alert-03 {
background: url('img/alert-03.jpg') center no-repeat;
}
.alert-04 {
background: url('img/alert-04.jpg'... | 2013/10/22 | [
"https://Stackoverflow.com/questions/19518086",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2907019/"
] | Using a tool like [**Regexper**](http://www.regexper.com/) we can see what your regular expression is matching:

As you can see there are a few problems with this:
1. This assumes "url(" is at the start of the line.
2. This assumes the content ends with "g)", wherea... | I came to this question from google. Old one, but none of the answer is discussing about **data:image/\*** urls. Here is what I found on another google result that will only match http or relative urls.
```
/url\((?!['"]?(?:data):)['"]?([^'"\)]*)['"]?\)/g
```
I hope this would help other people coming from search en... |
19,518,086 | i have a css file with a bunch of background image urls:
```
.alert-01 {
background: url('img/alert-01.jpg') center no-repeat;
}
.alert-02 {
background: url('img/alert-02.jpg') center no-repeat;
}
.alert-03 {
background: url('img/alert-03.jpg') center no-repeat;
}
.alert-04 {
background: url('img/alert-04.jpg'... | 2013/10/22 | [
"https://Stackoverflow.com/questions/19518086",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2907019/"
] | Try:
```
/url\(.*?g'\)/ig
```
Your mistake was including `^` and `$` in the regexp, which anchors it to the beginning and end of the input string. And you forgot to allow for the quote. | ```
/^url\((['"]?)(.*)\1\)$/
```
with jQuery :
```
var bg = $('.my_element').css('background-image'); // or pure js like element.style.backgroundImage
bg = /^url\((['"]?)(.*)\1\)$/.exec(bg);
bg = bg ? bg[2] : false;
if(bg) {
// Do something
}
```
*Cross with Chrome / Firefox*
<http://jsfiddle.net/KFWWv/> |
19,518,086 | i have a css file with a bunch of background image urls:
```
.alert-01 {
background: url('img/alert-01.jpg') center no-repeat;
}
.alert-02 {
background: url('img/alert-02.jpg') center no-repeat;
}
.alert-03 {
background: url('img/alert-03.jpg') center no-repeat;
}
.alert-04 {
background: url('img/alert-04.jpg'... | 2013/10/22 | [
"https://Stackoverflow.com/questions/19518086",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2907019/"
] | Using a tool like [**Regexper**](http://www.regexper.com/) we can see what your regular expression is matching:

As you can see there are a few problems with this:
1. This assumes "url(" is at the start of the line.
2. This assumes the content ends with "g)", wherea... | You were just not accounting for the closing quote
```
url\(.*g\'\)
```
and anchoring |
19,518,086 | i have a css file with a bunch of background image urls:
```
.alert-01 {
background: url('img/alert-01.jpg') center no-repeat;
}
.alert-02 {
background: url('img/alert-02.jpg') center no-repeat;
}
.alert-03 {
background: url('img/alert-03.jpg') center no-repeat;
}
.alert-04 {
background: url('img/alert-04.jpg'... | 2013/10/22 | [
"https://Stackoverflow.com/questions/19518086",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2907019/"
] | Using a tool like [**Regexper**](http://www.regexper.com/) we can see what your regular expression is matching:

As you can see there are a few problems with this:
1. This assumes "url(" is at the start of the line.
2. This assumes the content ends with "g)", wherea... | Use the following regex:
```
/\burl\([^)]+\)/gi
```
There's no need to use anchors (`^` and `$`) as they would restrict the match over whole string input and hence fail. To capture the image path separately so that you can use it easily (and avoid substring) when constructing your `<img>` tags use:
```
/\burl\('([^... |
19,518,086 | i have a css file with a bunch of background image urls:
```
.alert-01 {
background: url('img/alert-01.jpg') center no-repeat;
}
.alert-02 {
background: url('img/alert-02.jpg') center no-repeat;
}
.alert-03 {
background: url('img/alert-03.jpg') center no-repeat;
}
.alert-04 {
background: url('img/alert-04.jpg'... | 2013/10/22 | [
"https://Stackoverflow.com/questions/19518086",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2907019/"
] | Try:
```
/url\(.*?g'\)/ig
```
Your mistake was including `^` and `$` in the regexp, which anchors it to the beginning and end of the input string. And you forgot to allow for the quote. | You were just not accounting for the closing quote
```
url\(.*g\'\)
```
and anchoring |
19,518,086 | i have a css file with a bunch of background image urls:
```
.alert-01 {
background: url('img/alert-01.jpg') center no-repeat;
}
.alert-02 {
background: url('img/alert-02.jpg') center no-repeat;
}
.alert-03 {
background: url('img/alert-03.jpg') center no-repeat;
}
.alert-04 {
background: url('img/alert-04.jpg'... | 2013/10/22 | [
"https://Stackoverflow.com/questions/19518086",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2907019/"
] | ```
/^url\((['"]?)(.*)\1\)$/
```
with jQuery :
```
var bg = $('.my_element').css('background-image'); // or pure js like element.style.backgroundImage
bg = /^url\((['"]?)(.*)\1\)$/.exec(bg);
bg = bg ? bg[2] : false;
if(bg) {
// Do something
}
```
*Cross with Chrome / Firefox*
<http://jsfiddle.net/KFWWv/> | You were just not accounting for the closing quote
```
url\(.*g\'\)
```
and anchoring |
19,518,086 | i have a css file with a bunch of background image urls:
```
.alert-01 {
background: url('img/alert-01.jpg') center no-repeat;
}
.alert-02 {
background: url('img/alert-02.jpg') center no-repeat;
}
.alert-03 {
background: url('img/alert-03.jpg') center no-repeat;
}
.alert-04 {
background: url('img/alert-04.jpg'... | 2013/10/22 | [
"https://Stackoverflow.com/questions/19518086",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2907019/"
] | Using a tool like [**Regexper**](http://www.regexper.com/) we can see what your regular expression is matching:

As you can see there are a few problems with this:
1. This assumes "url(" is at the start of the line.
2. This assumes the content ends with "g)", wherea... | ```
/^url\((['"]?)(.*)\1\)$/
```
with jQuery :
```
var bg = $('.my_element').css('background-image'); // or pure js like element.style.backgroundImage
bg = /^url\((['"]?)(.*)\1\)$/.exec(bg);
bg = bg ? bg[2] : false;
if(bg) {
// Do something
}
```
*Cross with Chrome / Firefox*
<http://jsfiddle.net/KFWWv/> |
19,518,086 | i have a css file with a bunch of background image urls:
```
.alert-01 {
background: url('img/alert-01.jpg') center no-repeat;
}
.alert-02 {
background: url('img/alert-02.jpg') center no-repeat;
}
.alert-03 {
background: url('img/alert-03.jpg') center no-repeat;
}
.alert-04 {
background: url('img/alert-04.jpg'... | 2013/10/22 | [
"https://Stackoverflow.com/questions/19518086",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2907019/"
] | Use the following regex:
```
/\burl\([^)]+\)/gi
```
There's no need to use anchors (`^` and `$`) as they would restrict the match over whole string input and hence fail. To capture the image path separately so that you can use it easily (and avoid substring) when constructing your `<img>` tags use:
```
/\burl\('([^... | You were just not accounting for the closing quote
```
url\(.*g\'\)
```
and anchoring |
19,518,086 | i have a css file with a bunch of background image urls:
```
.alert-01 {
background: url('img/alert-01.jpg') center no-repeat;
}
.alert-02 {
background: url('img/alert-02.jpg') center no-repeat;
}
.alert-03 {
background: url('img/alert-03.jpg') center no-repeat;
}
.alert-04 {
background: url('img/alert-04.jpg'... | 2013/10/22 | [
"https://Stackoverflow.com/questions/19518086",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2907019/"
] | I came to this question from google. Old one, but none of the answer is discussing about **data:image/\*** urls. Here is what I found on another google result that will only match http or relative urls.
```
/url\((?!['"]?(?:data):)['"]?([^'"\)]*)['"]?\)/g
```
I hope this would help other people coming from search en... | You were just not accounting for the closing quote
```
url\(.*g\'\)
```
and anchoring |
19,518,086 | i have a css file with a bunch of background image urls:
```
.alert-01 {
background: url('img/alert-01.jpg') center no-repeat;
}
.alert-02 {
background: url('img/alert-02.jpg') center no-repeat;
}
.alert-03 {
background: url('img/alert-03.jpg') center no-repeat;
}
.alert-04 {
background: url('img/alert-04.jpg'... | 2013/10/22 | [
"https://Stackoverflow.com/questions/19518086",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2907019/"
] | Try:
```
/url\(.*?g'\)/ig
```
Your mistake was including `^` and `$` in the regexp, which anchors it to the beginning and end of the input string. And you forgot to allow for the quote. | Use the following regex:
```
/\burl\([^)]+\)/gi
```
There's no need to use anchors (`^` and `$`) as they would restrict the match over whole string input and hence fail. To capture the image path separately so that you can use it easily (and avoid substring) when constructing your `<img>` tags use:
```
/\burl\('([^... |
42,315,432 | We have a session logout script like:
```
<?php
//24 2 2015
session_start();
session_destroy();
header("location:login.php")
?>
```
now this script logouts and redirect it to login page where, username and password will be required to login again.
what if i wanted to have a temporary logout where af... | 2017/02/18 | [
"https://Stackoverflow.com/questions/42315432",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6833562/"
] | You could add a `"temp_logout"` field to the `$_SESSION` variable and when you redirect the user to the login page, you can check for it `$_SESSION["temp_logout"]` and if it is true, add the username in the input field.
logout script:
```
<?php
//24 2 2015
session_start();
$_SESSION['temp_logout'] = true;... | it is really depend on your platform:
You can only unset something like `password` instead of destroying session,
```
unset($_SESSION['password']);
```
or set another key in session:
```
$_SESSION['loggedIn'] = false;
```
and redirect to login page.
also you can put username in cookie and destroy session.
[set... |
130,414 | I would like to have a virtual machine of ubuntu , that I can access everywhere , without having to carry my Virtual HD ,
could I put the VHD on something like dropbox or google drive and use it there ?
is this practical ? because as far as I know whenever I update the file , it will be uploaded to Dropbox or Google D... | 2012/05/02 | [
"https://askubuntu.com/questions/130414",
"https://askubuntu.com",
"https://askubuntu.com/users/59270/"
] | You can also try Amazon Web Services EC2 [http://aws.amazon.com/ec2/][1]. EC2 is cloud computing facility. You can spawn a Virtual machine there and then install Ubuntu (or whatever OS) you want. There are free tiers in AWS.
Essentially, here is what you should try:-
1. Create an account on AWS.
2. Launch a Micro inst... | The minimum requirements for an Ubuntu install is 15GB of hard disk space. To back it up on Dropbox, you would need to go for their 'Pro50' plan which will cost around $10/month.
Further, you would need to ensure that the location you want to use the VHD from has a sufficiently speedy broadband connection, which may n... |
130,414 | I would like to have a virtual machine of ubuntu , that I can access everywhere , without having to carry my Virtual HD ,
could I put the VHD on something like dropbox or google drive and use it there ?
is this practical ? because as far as I know whenever I update the file , it will be uploaded to Dropbox or Google D... | 2012/05/02 | [
"https://askubuntu.com/questions/130414",
"https://askubuntu.com",
"https://askubuntu.com/users/59270/"
] | I don't believe that Dropbox could be used that way efficiently. The VHD file is going to change all the time when the VM is running. Dropbox calculates hashes of files to check them with its online copy (it also helps them to de-duplicate the data), it will take ages just to compute the hash of a 15 Gb file each time ... | The minimum requirements for an Ubuntu install is 15GB of hard disk space. To back it up on Dropbox, you would need to go for their 'Pro50' plan which will cost around $10/month.
Further, you would need to ensure that the location you want to use the VHD from has a sufficiently speedy broadband connection, which may n... |
130,414 | I would like to have a virtual machine of ubuntu , that I can access everywhere , without having to carry my Virtual HD ,
could I put the VHD on something like dropbox or google drive and use it there ?
is this practical ? because as far as I know whenever I update the file , it will be uploaded to Dropbox or Google D... | 2012/05/02 | [
"https://askubuntu.com/questions/130414",
"https://askubuntu.com",
"https://askubuntu.com/users/59270/"
] | I don't believe that Dropbox could be used that way efficiently. The VHD file is going to change all the time when the VM is running. Dropbox calculates hashes of files to check them with its online copy (it also helps them to de-duplicate the data), it will take ages just to compute the hash of a 15 Gb file each time ... | You can also try Amazon Web Services EC2 [http://aws.amazon.com/ec2/][1]. EC2 is cloud computing facility. You can spawn a Virtual machine there and then install Ubuntu (or whatever OS) you want. There are free tiers in AWS.
Essentially, here is what you should try:-
1. Create an account on AWS.
2. Launch a Micro inst... |
13,986,634 | I am working with a PHP mailer in which template will be select with `HTML` browse button to get data to send mail.
i wants to get data in a variable ..
Not able to get data..
```
Warning: fopen(filename.txt) [function.fopen]: failed to open stream: No such file or directory in PATH/php_mailer\sendmail.php on line 18... | 2012/12/21 | [
"https://Stackoverflow.com/questions/13986634",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1868277/"
] | It doesn't work because `$_FILES['template_file']['name']` is the local file name that the browser sent to the server; to read the uploaded file you need `$_FILES['template_file']['tmp_name']` instead:
```
echo $templFile = $_FILES["template_file"]["tmp_name"] ;
echo $templFileData = file_get_contents($templFile);
``... | Please Replace $\_FILES["template\_file"]["name"] to $\_FILES["template\_file"]["tmp\_name"] |
65,057,331 | I'm new to java. I'm trying to make my program output this [5,4] [3] [2,1] but instead I get [5,5] [4,4] [3,3] [2,2] [1,1].. what am I missing? I tried to answer it on my own but I just can't think of the answer.
Here's my full code:
```
public static void main(String[]args){
Scanner sc = new Scanner(System.in... | 2020/11/29 | [
"https://Stackoverflow.com/questions/65057331",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14727854/"
] | I have a theory on what happened: since the requestUserToken function is called on the main thread, using a semaphore creates an infinite wait(lock.wait() and lock.signal() are called on the same thread). What eventually worked for me was using completion handlers instead of semaphores. So my getUserToken function look... | Cleaning up a little of what has already been posted.
```
func getUserToken(completion: @escaping(_ userToken: String?) -> Void) {
SKCloudServiceController().requestUserToken(forDeveloperToken: developerToken) { (receivedToken, error) in
guard error == nil else { return }
completion(receivedToken)... |
23,033 | Recently when looking at my memory card I noticed that there were multiple folders on the memory card. The file path looked like this:
```
DCIM/100D5100
DCIM/101D5100
```
The D5100 is the camera I am using but I have seen this behavior on multiple cameras. Why does the camera(s) automatically split the photos into... | 2012/05/02 | [
"https://photo.stackexchange.com/questions/23033",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/7438/"
] | This is really a case of *read your camera manual*. If your camera did not come with a full one, there will be one on a CD. The behavior greatly varies.
Usually cameras use filenames which gives them 4-digit numbering (some use 5 numbers), so you could in theory have 9999 photos in a single folder. However, cameras ca... | On most (all?) cameras I have seen, the directories are numbered starting at 100, and the files are numbered 0000-9999 in each folder for up to 10,000 images in each folder.
One logical reason I can think of to split files like this is to avoid running into filesystem limits with the maximum number of files per direct... |
23,033 | Recently when looking at my memory card I noticed that there were multiple folders on the memory card. The file path looked like this:
```
DCIM/100D5100
DCIM/101D5100
```
The D5100 is the camera I am using but I have seen this behavior on multiple cameras. Why does the camera(s) automatically split the photos into... | 2012/05/02 | [
"https://photo.stackexchange.com/questions/23033",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/7438/"
] | On most (all?) cameras I have seen, the directories are numbered starting at 100, and the files are numbered 0000-9999 in each folder for up to 10,000 images in each folder.
One logical reason I can think of to split files like this is to avoid running into filesystem limits with the maximum number of files per direct... | On my Nikkon D5100 it puts 1000 photos in each directory. The problem, as mentioned above, is that when connecting to the PC from the camera, Windows Exploerer does not see the folders. I recently had over 2300 photos from one session. I only got the photos from the first one. I have a USB chip reader that supports a n... |
23,033 | Recently when looking at my memory card I noticed that there were multiple folders on the memory card. The file path looked like this:
```
DCIM/100D5100
DCIM/101D5100
```
The D5100 is the camera I am using but I have seen this behavior on multiple cameras. Why does the camera(s) automatically split the photos into... | 2012/05/02 | [
"https://photo.stackexchange.com/questions/23033",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/7438/"
] | On most (all?) cameras I have seen, the directories are numbered starting at 100, and the files are numbered 0000-9999 in each folder for up to 10,000 images in each folder.
One logical reason I can think of to split files like this is to avoid running into filesystem limits with the maximum number of files per direct... | Flimzy is on track with his theory about filesystem limits, but not quite. I don't recall it completely (it's been a couple of years since I learned it at the university) but the actual reason is performance. The more files you put in a directory the more difficult it gets to handle them. A list with 1000 files consume... |
23,033 | Recently when looking at my memory card I noticed that there were multiple folders on the memory card. The file path looked like this:
```
DCIM/100D5100
DCIM/101D5100
```
The D5100 is the camera I am using but I have seen this behavior on multiple cameras. Why does the camera(s) automatically split the photos into... | 2012/05/02 | [
"https://photo.stackexchange.com/questions/23033",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/7438/"
] | On most (all?) cameras I have seen, the directories are numbered starting at 100, and the files are numbered 0000-9999 in each folder for up to 10,000 images in each folder.
One logical reason I can think of to split files like this is to avoid running into filesystem limits with the maximum number of files per direct... | Consider this: 1000, 5000, or 10000 files (photos) per folder, you're always at risk of losing some if they get consolidated into any SAME PC folder.
Once you see the message "File IMG 3333 (OR, any # from 1 - 9999) already exists in the folder you are moving [or copying] to -- do you wish to proceed"?
Which image do... |
23,033 | Recently when looking at my memory card I noticed that there were multiple folders on the memory card. The file path looked like this:
```
DCIM/100D5100
DCIM/101D5100
```
The D5100 is the camera I am using but I have seen this behavior on multiple cameras. Why does the camera(s) automatically split the photos into... | 2012/05/02 | [
"https://photo.stackexchange.com/questions/23033",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/7438/"
] | This is really a case of *read your camera manual*. If your camera did not come with a full one, there will be one on a CD. The behavior greatly varies.
Usually cameras use filenames which gives them 4-digit numbering (some use 5 numbers), so you could in theory have 9999 photos in a single folder. However, cameras ca... | On my Nikkon D5100 it puts 1000 photos in each directory. The problem, as mentioned above, is that when connecting to the PC from the camera, Windows Exploerer does not see the folders. I recently had over 2300 photos from one session. I only got the photos from the first one. I have a USB chip reader that supports a n... |
23,033 | Recently when looking at my memory card I noticed that there were multiple folders on the memory card. The file path looked like this:
```
DCIM/100D5100
DCIM/101D5100
```
The D5100 is the camera I am using but I have seen this behavior on multiple cameras. Why does the camera(s) automatically split the photos into... | 2012/05/02 | [
"https://photo.stackexchange.com/questions/23033",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/7438/"
] | This is really a case of *read your camera manual*. If your camera did not come with a full one, there will be one on a CD. The behavior greatly varies.
Usually cameras use filenames which gives them 4-digit numbering (some use 5 numbers), so you could in theory have 9999 photos in a single folder. However, cameras ca... | Flimzy is on track with his theory about filesystem limits, but not quite. I don't recall it completely (it's been a couple of years since I learned it at the university) but the actual reason is performance. The more files you put in a directory the more difficult it gets to handle them. A list with 1000 files consume... |
23,033 | Recently when looking at my memory card I noticed that there were multiple folders on the memory card. The file path looked like this:
```
DCIM/100D5100
DCIM/101D5100
```
The D5100 is the camera I am using but I have seen this behavior on multiple cameras. Why does the camera(s) automatically split the photos into... | 2012/05/02 | [
"https://photo.stackexchange.com/questions/23033",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/7438/"
] | This is really a case of *read your camera manual*. If your camera did not come with a full one, there will be one on a CD. The behavior greatly varies.
Usually cameras use filenames which gives them 4-digit numbering (some use 5 numbers), so you could in theory have 9999 photos in a single folder. However, cameras ca... | Consider this: 1000, 5000, or 10000 files (photos) per folder, you're always at risk of losing some if they get consolidated into any SAME PC folder.
Once you see the message "File IMG 3333 (OR, any # from 1 - 9999) already exists in the folder you are moving [or copying] to -- do you wish to proceed"?
Which image do... |
23,033 | Recently when looking at my memory card I noticed that there were multiple folders on the memory card. The file path looked like this:
```
DCIM/100D5100
DCIM/101D5100
```
The D5100 is the camera I am using but I have seen this behavior on multiple cameras. Why does the camera(s) automatically split the photos into... | 2012/05/02 | [
"https://photo.stackexchange.com/questions/23033",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/7438/"
] | Flimzy is on track with his theory about filesystem limits, but not quite. I don't recall it completely (it's been a couple of years since I learned it at the university) but the actual reason is performance. The more files you put in a directory the more difficult it gets to handle them. A list with 1000 files consume... | On my Nikkon D5100 it puts 1000 photos in each directory. The problem, as mentioned above, is that when connecting to the PC from the camera, Windows Exploerer does not see the folders. I recently had over 2300 photos from one session. I only got the photos from the first one. I have a USB chip reader that supports a n... |
23,033 | Recently when looking at my memory card I noticed that there were multiple folders on the memory card. The file path looked like this:
```
DCIM/100D5100
DCIM/101D5100
```
The D5100 is the camera I am using but I have seen this behavior on multiple cameras. Why does the camera(s) automatically split the photos into... | 2012/05/02 | [
"https://photo.stackexchange.com/questions/23033",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/7438/"
] | On my Nikkon D5100 it puts 1000 photos in each directory. The problem, as mentioned above, is that when connecting to the PC from the camera, Windows Exploerer does not see the folders. I recently had over 2300 photos from one session. I only got the photos from the first one. I have a USB chip reader that supports a n... | Consider this: 1000, 5000, or 10000 files (photos) per folder, you're always at risk of losing some if they get consolidated into any SAME PC folder.
Once you see the message "File IMG 3333 (OR, any # from 1 - 9999) already exists in the folder you are moving [or copying] to -- do you wish to proceed"?
Which image do... |
23,033 | Recently when looking at my memory card I noticed that there were multiple folders on the memory card. The file path looked like this:
```
DCIM/100D5100
DCIM/101D5100
```
The D5100 is the camera I am using but I have seen this behavior on multiple cameras. Why does the camera(s) automatically split the photos into... | 2012/05/02 | [
"https://photo.stackexchange.com/questions/23033",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/7438/"
] | Flimzy is on track with his theory about filesystem limits, but not quite. I don't recall it completely (it's been a couple of years since I learned it at the university) but the actual reason is performance. The more files you put in a directory the more difficult it gets to handle them. A list with 1000 files consume... | Consider this: 1000, 5000, or 10000 files (photos) per folder, you're always at risk of losing some if they get consolidated into any SAME PC folder.
Once you see the message "File IMG 3333 (OR, any # from 1 - 9999) already exists in the folder you are moving [or copying] to -- do you wish to proceed"?
Which image do... |
8,287,597 | Are there any projects that used node.js and closure-compiler (CC for short) together?
The official CC recommendation is to compile all code for an application together, but when I compile some simple node.js code which contains a `require("./MyLib.js")`, that line is put directly into the output, but it doesn't make ... | 2011/11/27 | [
"https://Stackoverflow.com/questions/8287597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/146821/"
] | I have been using the Closure Compiler with Node for a project I haven't released yet. It has taken a bit of tooling, but it has helped catch many errors and has a pretty short edit-restart-test cycle.
First, I use [plovr](http://plovr.com/) (which is a project that I created and maintain) in order to use the Closure ... | Option 4: Don't use closure compiler.
People in the node community don't tend to use it. You don't need to minify node.js source code, that's silly.
There's simply no good use for minification.
As for the performance benefits of closure, I personally doubt it actually makes your programs faster.
And of course ther... |
8,287,597 | Are there any projects that used node.js and closure-compiler (CC for short) together?
The official CC recommendation is to compile all code for an application together, but when I compile some simple node.js code which contains a `require("./MyLib.js")`, that line is put directly into the output, but it doesn't make ... | 2011/11/27 | [
"https://Stackoverflow.com/questions/8287597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/146821/"
] | The svn HEAD of closure compiler seems to have [support for AMD](http://www.nonblocking.io/2011/12/experimental-support-for-common-js-and.html) | Option 4: Don't use closure compiler.
People in the node community don't tend to use it. You don't need to minify node.js source code, that's silly.
There's simply no good use for minification.
As for the performance benefits of closure, I personally doubt it actually makes your programs faster.
And of course ther... |
8,287,597 | Are there any projects that used node.js and closure-compiler (CC for short) together?
The official CC recommendation is to compile all code for an application together, but when I compile some simple node.js code which contains a `require("./MyLib.js")`, that line is put directly into the output, but it doesn't make ... | 2011/11/27 | [
"https://Stackoverflow.com/questions/8287597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/146821/"
] | I replaced my old approach with a way simpler approach:
**New approach**
* No require() calls for my own app code, only for Node modules
* I need to concatenate server code to a single file before I can run or compile it
* Concatenating and compiling is done using [a simple grunt script](https://github.com/blaise-io/... | Option 4: Don't use closure compiler.
People in the node community don't tend to use it. You don't need to minify node.js source code, that's silly.
There's simply no good use for minification.
As for the performance benefits of closure, I personally doubt it actually makes your programs faster.
And of course ther... |
8,287,597 | Are there any projects that used node.js and closure-compiler (CC for short) together?
The official CC recommendation is to compile all code for an application together, but when I compile some simple node.js code which contains a `require("./MyLib.js")`, that line is put directly into the output, but it doesn't make ... | 2011/11/27 | [
"https://Stackoverflow.com/questions/8287597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/146821/"
] | Closure Library on Node.js in 60 seconds.
It's supported, check <https://code.google.com/p/closure-library/wiki/NodeJS>. | Option 4: Don't use closure compiler.
People in the node community don't tend to use it. You don't need to minify node.js source code, that's silly.
There's simply no good use for minification.
As for the performance benefits of closure, I personally doubt it actually makes your programs faster.
And of course ther... |
8,287,597 | Are there any projects that used node.js and closure-compiler (CC for short) together?
The official CC recommendation is to compile all code for an application together, but when I compile some simple node.js code which contains a `require("./MyLib.js")`, that line is put directly into the output, but it doesn't make ... | 2011/11/27 | [
"https://Stackoverflow.com/questions/8287597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/146821/"
] | I have been using the Closure Compiler with Node for a project I haven't released yet. It has taken a bit of tooling, but it has helped catch many errors and has a pretty short edit-restart-test cycle.
First, I use [plovr](http://plovr.com/) (which is a project that I created and maintain) in order to use the Closure ... | The svn HEAD of closure compiler seems to have [support for AMD](http://www.nonblocking.io/2011/12/experimental-support-for-common-js-and.html) |
8,287,597 | Are there any projects that used node.js and closure-compiler (CC for short) together?
The official CC recommendation is to compile all code for an application together, but when I compile some simple node.js code which contains a `require("./MyLib.js")`, that line is put directly into the output, but it doesn't make ... | 2011/11/27 | [
"https://Stackoverflow.com/questions/8287597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/146821/"
] | I have been using the Closure Compiler with Node for a project I haven't released yet. It has taken a bit of tooling, but it has helped catch many errors and has a pretty short edit-restart-test cycle.
First, I use [plovr](http://plovr.com/) (which is a project that I created and maintain) in order to use the Closure ... | I replaced my old approach with a way simpler approach:
**New approach**
* No require() calls for my own app code, only for Node modules
* I need to concatenate server code to a single file before I can run or compile it
* Concatenating and compiling is done using [a simple grunt script](https://github.com/blaise-io/... |
8,287,597 | Are there any projects that used node.js and closure-compiler (CC for short) together?
The official CC recommendation is to compile all code for an application together, but when I compile some simple node.js code which contains a `require("./MyLib.js")`, that line is put directly into the output, but it doesn't make ... | 2011/11/27 | [
"https://Stackoverflow.com/questions/8287597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/146821/"
] | I have been using the Closure Compiler with Node for a project I haven't released yet. It has taken a bit of tooling, but it has helped catch many errors and has a pretty short edit-restart-test cycle.
First, I use [plovr](http://plovr.com/) (which is a project that I created and maintain) in order to use the Closure ... | Closure Library on Node.js in 60 seconds.
It's supported, check <https://code.google.com/p/closure-library/wiki/NodeJS>. |
8,287,597 | Are there any projects that used node.js and closure-compiler (CC for short) together?
The official CC recommendation is to compile all code for an application together, but when I compile some simple node.js code which contains a `require("./MyLib.js")`, that line is put directly into the output, but it doesn't make ... | 2011/11/27 | [
"https://Stackoverflow.com/questions/8287597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/146821/"
] | The svn HEAD of closure compiler seems to have [support for AMD](http://www.nonblocking.io/2011/12/experimental-support-for-common-js-and.html) | I replaced my old approach with a way simpler approach:
**New approach**
* No require() calls for my own app code, only for Node modules
* I need to concatenate server code to a single file before I can run or compile it
* Concatenating and compiling is done using [a simple grunt script](https://github.com/blaise-io/... |
8,287,597 | Are there any projects that used node.js and closure-compiler (CC for short) together?
The official CC recommendation is to compile all code for an application together, but when I compile some simple node.js code which contains a `require("./MyLib.js")`, that line is put directly into the output, but it doesn't make ... | 2011/11/27 | [
"https://Stackoverflow.com/questions/8287597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/146821/"
] | The svn HEAD of closure compiler seems to have [support for AMD](http://www.nonblocking.io/2011/12/experimental-support-for-common-js-and.html) | Closure Library on Node.js in 60 seconds.
It's supported, check <https://code.google.com/p/closure-library/wiki/NodeJS>. |
66,122,035 | So I was working on a automated whatsapp messenger and I tried to install the module known as "pywhatkit" but I am getting an error everytime.
The error trace is the following:
```
ERROR: Exception: Traceback (most recent call last): File
"c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_v... | 2021/02/09 | [
"https://Stackoverflow.com/questions/66122035",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14027695/"
] | `pip install pywhatkit`
If this doesn't work use
`pip install pipwin`
And then
`pipwin install pywhatkit`
If it is installed and giving error try
`pip install pywhatkit --upgrade` | I had the same problem. I used a lot of tricks but finally got my solution. I didn't add my python scripts directory in the path variable. `C:\Users\Computer\AppData\Roaming\Python\Python310\Scripts`. When I added this path to the path variable. Then **pywhatkit** was running on my machine. Note: I had recently reset m... |
55,461,960 | Let's say I have an array 3x3 `a` and would like to upsample it to a 30x30 array `b` with nearest neighbor interpolation.
Is it possible to use a technique which does not actually store repeated values? Something similar on how `broadcasting` works in `numpy`.
e.g. I would like to have an object such that when I call... | 2019/04/01 | [
"https://Stackoverflow.com/questions/55461960",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7812912/"
] | Which version of Laravel are you using? Since Laravel 5 you should define your routes and controllers in the file routes/web.php
**web.php**
`Route::get('user/{id}', 'UserController@show');`
**app\Http\Controllers\UserController**
```
<?php
namespace App\Http\Controllers;
use App\User;
use App\Http\Controllers\... | You'll load the view from within the corresponding controller method. For instance:
```
public function index()
{
$employees = Employee::all();
return view('employees.index')->with('employees', $employees);
}
```
Laravel will translate `employees.index` to `resources/views/employees/index.blade.php`.
Nex... |
48,798,846 | I'm trying to deploy a rails 5.1 & react app created with webpacker gem using AWS Elastic Beanstalk. The problem is I keep getting the following error:
```
Webpacker requires Node.js >= 6.0.0 and you are using 4.6.0
```
I'm using Node 9.5.0 on my computer. Any suggestions?? | 2018/02/15 | [
"https://Stackoverflow.com/questions/48798846",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9362734/"
] | To install nodejs using yum (assuming you're using the default Amazon Linux)
<https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora>
```
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
yum -y install nodejs
```
Now to execute this on your instances, you need to add ... | For those of you who found this issue when upgrading to Rails 6, [I wrote a post](https://austingwalters.com/rails-6-on-elastic-beanstalk/) on how to fix it.
Basically, you have to:
* Create directory .ebextensions in the top level of your application
* Create .config file which contains the commands to fix deployme... |
48,798,846 | I'm trying to deploy a rails 5.1 & react app created with webpacker gem using AWS Elastic Beanstalk. The problem is I keep getting the following error:
```
Webpacker requires Node.js >= 6.0.0 and you are using 4.6.0
```
I'm using Node 9.5.0 on my computer. Any suggestions?? | 2018/02/15 | [
"https://Stackoverflow.com/questions/48798846",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9362734/"
] | For those that run into needing to also install Yarn, I have found the below just worked for me:
```
commands:
01_install_yarn:
command: "sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo && curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash - && sudo yum install... | For those of you who found this issue when upgrading to Rails 6, [I wrote a post](https://austingwalters.com/rails-6-on-elastic-beanstalk/) on how to fix it.
Basically, you have to:
* Create directory .ebextensions in the top level of your application
* Create .config file which contains the commands to fix deployme... |
30,800,046 | I want to extract a menu index with python. The menu index is a tree like this:
```
1.
1.1.
1.1.1.
2.
3.1.
3.2.
```
To find this I wrote the following code:
```
first = re.findall(r"[0-9]{1}[.]{1}(?:([0-9][.])?(?:([0-9]?[.]?)))" , menu)
```
This doesn't work, but when I put the regex in the online regex tool (<ht... | 2015/06/12 | [
"https://Stackoverflow.com/questions/30800046",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1104939/"
] | Here is a possible solution. I have made a traversal to the innermost text element and then convert that into a checkbox.
```
$('#checkbox').click(function() {
var $p = "";
$p = $('.outputBox');
wrapText($p);
});
function wrapText(domObj) {
var re = /\S/;
domObj.contents().filter(function() ... | How about using `*(space)` to generate `li`? I used regex and process string to generate it.
```
function update() {
var str = $('#inputBox').html();
$('#outputBox').html(str);
$('#showHTML').text(str);
str = str.replace(/(<br>$)/,'')
.replace(/(<br>)/g,'$1\n')
.replace(/\* (... |
30,800,046 | I want to extract a menu index with python. The menu index is a tree like this:
```
1.
1.1.
1.1.1.
2.
3.1.
3.2.
```
To find this I wrote the following code:
```
first = re.findall(r"[0-9]{1}[.]{1}(?:([0-9][.])?(?:([0-9]?[.]?)))" , menu)
```
This doesn't work, but when I put the regex in the online regex tool (<ht... | 2015/06/12 | [
"https://Stackoverflow.com/questions/30800046",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1104939/"
] | Here is a possible solution. I have made a traversal to the innermost text element and then convert that into a checkbox.
```
$('#checkbox').click(function() {
var $p = "";
$p = $('.outputBox');
wrapText($p);
});
function wrapText(domObj) {
var re = /\S/;
domObj.contents().filter(function() ... | Hello I change your js code as follow,
```
$('div[contenteditable=true]').blur(function() {
$('.outputBox').append('<br>').append("<input type='checkbox' value='"+$(this).html()+"' />"+$(this).html());
$(this).html("");
});
$('div[contenteditable=true]').keydown(function(e) {
//$('.outputBox').html($(this)... |
30,800,046 | I want to extract a menu index with python. The menu index is a tree like this:
```
1.
1.1.
1.1.1.
2.
3.1.
3.2.
```
To find this I wrote the following code:
```
first = re.findall(r"[0-9]{1}[.]{1}(?:([0-9][.])?(?:([0-9]?[.]?)))" , menu)
```
This doesn't work, but when I put the regex in the online regex tool (<ht... | 2015/06/12 | [
"https://Stackoverflow.com/questions/30800046",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1104939/"
] | Almost everybody has given answer to first case of question but i found answer for 2nd case
i added this two lines in the click event of **SHOW CONTENT with CHECKBOX**
I guess @arthi sreekumar is also getting me `li's` into `checkbox` Upvote to that.
```
$('.outputBox').find("ol").find("li").wrapInner(('<label style... | Here is a possible solution. I have made a traversal to the innermost text element and then convert that into a checkbox.
```
$('#checkbox').click(function() {
var $p = "";
$p = $('.outputBox');
wrapText($p);
});
function wrapText(domObj) {
var re = /\S/;
domObj.contents().filter(function() ... |
30,800,046 | I want to extract a menu index with python. The menu index is a tree like this:
```
1.
1.1.
1.1.1.
2.
3.1.
3.2.
```
To find this I wrote the following code:
```
first = re.findall(r"[0-9]{1}[.]{1}(?:([0-9][.])?(?:([0-9]?[.]?)))" , menu)
```
This doesn't work, but when I put the regex in the online regex tool (<ht... | 2015/06/12 | [
"https://Stackoverflow.com/questions/30800046",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1104939/"
] | you can use template for checkbox instead of hardcoding html
```
<div id="template" style="visibility:hidden">
<label> <input type="checkbox" name="field_1" value="on" /></label>
</div>
```
in code
```
$('#checkbox').click(function() {});
function createElement()
{
var targetElement=$("#template").clone(true);
... | How about using `*(space)` to generate `li`? I used regex and process string to generate it.
```
function update() {
var str = $('#inputBox').html();
$('#outputBox').html(str);
$('#showHTML').text(str);
str = str.replace(/(<br>$)/,'')
.replace(/(<br>)/g,'$1\n')
.replace(/\* (... |
30,800,046 | I want to extract a menu index with python. The menu index is a tree like this:
```
1.
1.1.
1.1.1.
2.
3.1.
3.2.
```
To find this I wrote the following code:
```
first = re.findall(r"[0-9]{1}[.]{1}(?:([0-9][.])?(?:([0-9]?[.]?)))" , menu)
```
This doesn't work, but when I put the regex in the online regex tool (<ht... | 2015/06/12 | [
"https://Stackoverflow.com/questions/30800046",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1104939/"
] | Almost everybody has given answer to first case of question but i found answer for 2nd case
i added this two lines in the click event of **SHOW CONTENT with CHECKBOX**
I guess @arthi sreekumar is also getting me `li's` into `checkbox` Upvote to that.
```
$('.outputBox').find("ol").find("li").wrapInner(('<label style... | How about using `*(space)` to generate `li`? I used regex and process string to generate it.
```
function update() {
var str = $('#inputBox').html();
$('#outputBox').html(str);
$('#showHTML').text(str);
str = str.replace(/(<br>$)/,'')
.replace(/(<br>)/g,'$1\n')
.replace(/\* (... |
30,800,046 | I want to extract a menu index with python. The menu index is a tree like this:
```
1.
1.1.
1.1.1.
2.
3.1.
3.2.
```
To find this I wrote the following code:
```
first = re.findall(r"[0-9]{1}[.]{1}(?:([0-9][.])?(?:([0-9]?[.]?)))" , menu)
```
This doesn't work, but when I put the regex in the online regex tool (<ht... | 2015/06/12 | [
"https://Stackoverflow.com/questions/30800046",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1104939/"
] | you can use template for checkbox instead of hardcoding html
```
<div id="template" style="visibility:hidden">
<label> <input type="checkbox" name="field_1" value="on" /></label>
</div>
```
in code
```
$('#checkbox').click(function() {});
function createElement()
{
var targetElement=$("#template").clone(true);
... | Hello I change your js code as follow,
```
$('div[contenteditable=true]').blur(function() {
$('.outputBox').append('<br>').append("<input type='checkbox' value='"+$(this).html()+"' />"+$(this).html());
$(this).html("");
});
$('div[contenteditable=true]').keydown(function(e) {
//$('.outputBox').html($(this)... |
30,800,046 | I want to extract a menu index with python. The menu index is a tree like this:
```
1.
1.1.
1.1.1.
2.
3.1.
3.2.
```
To find this I wrote the following code:
```
first = re.findall(r"[0-9]{1}[.]{1}(?:([0-9][.])?(?:([0-9]?[.]?)))" , menu)
```
This doesn't work, but when I put the regex in the online regex tool (<ht... | 2015/06/12 | [
"https://Stackoverflow.com/questions/30800046",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1104939/"
] | Almost everybody has given answer to first case of question but i found answer for 2nd case
i added this two lines in the click event of **SHOW CONTENT with CHECKBOX**
I guess @arthi sreekumar is also getting me `li's` into `checkbox` Upvote to that.
```
$('.outputBox').find("ol").find("li").wrapInner(('<label style... | you can use template for checkbox instead of hardcoding html
```
<div id="template" style="visibility:hidden">
<label> <input type="checkbox" name="field_1" value="on" /></label>
</div>
```
in code
```
$('#checkbox').click(function() {});
function createElement()
{
var targetElement=$("#template").clone(true);
... |
30,800,046 | I want to extract a menu index with python. The menu index is a tree like this:
```
1.
1.1.
1.1.1.
2.
3.1.
3.2.
```
To find this I wrote the following code:
```
first = re.findall(r"[0-9]{1}[.]{1}(?:([0-9][.])?(?:([0-9]?[.]?)))" , menu)
```
This doesn't work, but when I put the regex in the online regex tool (<ht... | 2015/06/12 | [
"https://Stackoverflow.com/questions/30800046",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1104939/"
] | Almost everybody has given answer to first case of question but i found answer for 2nd case
i added this two lines in the click event of **SHOW CONTENT with CHECKBOX**
I guess @arthi sreekumar is also getting me `li's` into `checkbox` Upvote to that.
```
$('.outputBox').find("ol").find("li").wrapInner(('<label style... | Hello I change your js code as follow,
```
$('div[contenteditable=true]').blur(function() {
$('.outputBox').append('<br>').append("<input type='checkbox' value='"+$(this).html()+"' />"+$(this).html());
$(this).html("");
});
$('div[contenteditable=true]').keydown(function(e) {
//$('.outputBox').html($(this)... |
2,998,384 | I trying to write a program that navigates the local file system using a config file containing relevant filepaths. My question is this: What are the best practices to use when performing file I/O (this will be from the desktop app to a server and back) and file system navigation in C#?
I know how to google, and I hav... | 2010/06/08 | [
"https://Stackoverflow.com/questions/2998384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/259648/"
] | You don't need a separate library, use the classes in the `System.IO` namespace like `File`, `FileInfo`, `Directory`, `DirectoryInfo`. A simple example:
```
var d = new DirectoryInfo(@"c:\");
foreach(FileInfo fi in d.GetFiles())
Console.WriteLine(fi.Name);
``` | What various libraries are you talking about?
I would pretty much stick to `System.IO.Directory` and such. It has everything you need.
Something like:
```
foreach (var file in System.IO.Directory.GetFiles(@"C:\Yourpath"))
{
// Do ya thang.
}
``` |
2,998,384 | I trying to write a program that navigates the local file system using a config file containing relevant filepaths. My question is this: What are the best practices to use when performing file I/O (this will be from the desktop app to a server and back) and file system navigation in C#?
I know how to google, and I hav... | 2010/06/08 | [
"https://Stackoverflow.com/questions/2998384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/259648/"
] | You don't need a separate library, use the classes in the `System.IO` namespace like `File`, `FileInfo`, `Directory`, `DirectoryInfo`. A simple example:
```
var d = new DirectoryInfo(@"c:\");
foreach(FileInfo fi in d.GetFiles())
Console.WriteLine(fi.Name);
``` | There are various classes you can use in the `System.IO` namespace, including `File`, `FileInfo`, `Directory`, and `DirectoryInfo`.
As for practices... as with any IO, make sure you close any streams you open. You also may need to utilize a `Disposable` object, so look into the `using` keyword. |
2,998,384 | I trying to write a program that navigates the local file system using a config file containing relevant filepaths. My question is this: What are the best practices to use when performing file I/O (this will be from the desktop app to a server and back) and file system navigation in C#?
I know how to google, and I hav... | 2010/06/08 | [
"https://Stackoverflow.com/questions/2998384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/259648/"
] | You don't need a separate library, use the classes in the `System.IO` namespace like `File`, `FileInfo`, `Directory`, `DirectoryInfo`. A simple example:
```
var d = new DirectoryInfo(@"c:\");
foreach(FileInfo fi in d.GetFiles())
Console.WriteLine(fi.Name);
``` | `System.IO` is all you need :)
As regards exception handling. Unless we are *expecting* an exception, we should never catch it. Truly unexpected exceptions should go unhandled. [looks guilty] ok, the only exception is at the highest level, and *only* for reporting purposes, such as
```
// assuming console program, bu... |
817,325 | We're currently running on IIS6, but hoping to move to IIS 7 soon.
We're moving an existing web forms site over to ASP.Net MVC. We have quite a few legacy pages which we need to redirect to the new controllers. I came across this article which looked interesting:
<http://blog.eworldui.net/post/2008/04/ASPNET-MVC---Leg... | 2009/05/03 | [
"https://Stackoverflow.com/questions/817325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2048091/"
] | depending on the article you mentioned, these are the steps to accomplish this:
1-Your LegacyHandler must extract the routes values from the query string(in this case it is the artist's id)
here is the code to do that:
```
public class LegacyHandler:MvcHandler
{
private RequestContext requestContext;
... | I was struggling a bit with this until I got my head around it. It was a lot easier to do this in a Controller like Perhentian did then directly in the route config, at least in my situation since our new URLs don't have `id` in them. The reason is that in the Controller I had access to all my repositories and domain o... |
29,780,266 | In the process of decoupling some code and I extracted an interface for one of our classes, and mapped it using Unity like so
```
Container.RegisterType<IUserAuthorizationBC, UserAuthorizationBC>(
new Interceptor<InterfaceInterceptor>(), new InterceptionBehavior<PolicyInjectionBehavior>());
```
As you can see th... | 2015/04/21 | [
"https://Stackoverflow.com/questions/29780266",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/491366/"
] | A .txt file contains plain text characters of 1 byte, a .doc file includes all Word document metadata such as font style, size, page margins etc. | Self exploration:
1. Save the document as a ".docx" file.
2. Rename `foo.docx` to `foo.docx.zip` (all Microsoft "X-document" files are zips).
3. Extract `foo.docx.zip`.
View the extracted XML files - most of the files related to additional [*metadata*](http://en.wikipedia.org/wiki/Metadata) resources that are include... |
19,554,835 | I have seen functions and variables beginning with underscores in various programming languages(PHP and Python) and am confused about the meaning behind it. | 2013/10/24 | [
"https://Stackoverflow.com/questions/19554835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Assuming normal conventions are used in PHP:
* single underscore indicates a protected member variable or method
* double underscore indicates a private member variable or method
This stems from when PHP had weak OOP support and did not have a concept of private and protected (everything was public). This convention ... | single underscore has no special meaning for class/instance attributes in Python. By *convention* it indicates private variables/function. `from module import *` will not import functions and variables beginning with a single underscore. (thanks Bi Rico).
double underscore invokes [name mangling](http://en.wikipedia.... |
34,470,085 | **Template Strings.**
This link might help a little bit:
[Does PHP have a feature like Python's template strings?](https://stackoverflow.com/questions/7683133/does-php-have-a-feature-like-pythons-template-strings1)
What **my main issue is**, is to know if there's a better way to **store** Text Strings.
Now, is thi... | 2015/12/26 | [
"https://Stackoverflow.com/questions/34470085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2051815/"
] | To add values to templates, you can use [`strtr`](http://php.net/manual/en/function.strtr.php). Example below:
```
$msg = strtr('Welcome {firstname} {lastname}', array(
'{firstname}' => $user->getFistName(),
'{lastname}' => $user->getLastName()
));
```
Regarding storing strings, you can save one array per la... | First, take a look at [gettext](http://php.net/manual/en/book.gettext.php). It is widely used and there is plenty of tools to handle translation process, like xgettext and [POEdit](https://poedit.net/). It is more comfortable to use real english strings in source code and then extract them using xgettext tool. Gettext ... |
34,470,085 | **Template Strings.**
This link might help a little bit:
[Does PHP have a feature like Python's template strings?](https://stackoverflow.com/questions/7683133/does-php-have-a-feature-like-pythons-template-strings1)
What **my main issue is**, is to know if there's a better way to **store** Text Strings.
Now, is thi... | 2015/12/26 | [
"https://Stackoverflow.com/questions/34470085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2051815/"
] | To add values to templates, you can use [`strtr`](http://php.net/manual/en/function.strtr.php). Example below:
```
$msg = strtr('Welcome {firstname} {lastname}', array(
'{firstname}' => $user->getFistName(),
'{lastname}' => $user->getLastName()
));
```
Regarding storing strings, you can save one array per la... | You could store all the templates in one associative array and also the variables that are to replace the placeholders, like
```
$capt=array('welcome' => 'Welcome {firstname} {lastname}',
'good_morning' => 'Good morning {firstname}',
'good_afternoon' => 'Good afternoon {firstname}');
$vars=arr... |
34,470,085 | **Template Strings.**
This link might help a little bit:
[Does PHP have a feature like Python's template strings?](https://stackoverflow.com/questions/7683133/does-php-have-a-feature-like-pythons-template-strings1)
What **my main issue is**, is to know if there's a better way to **store** Text Strings.
Now, is thi... | 2015/12/26 | [
"https://Stackoverflow.com/questions/34470085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2051815/"
] | To add values to templates, you can use [`strtr`](http://php.net/manual/en/function.strtr.php). Example below:
```
$msg = strtr('Welcome {firstname} {lastname}', array(
'{firstname}' => $user->getFistName(),
'{lastname}' => $user->getLastName()
));
```
Regarding storing strings, you can save one array per la... | OK John I will elaborate.
The best way is to create a php file, for each language, containing the definition of an array of texts, using printf format for string substitution.
If the amount of text is very large, you might consider partitioning it further. (a few MB is usually fine)
This is efficient in production, a... |
34,470,085 | **Template Strings.**
This link might help a little bit:
[Does PHP have a feature like Python's template strings?](https://stackoverflow.com/questions/7683133/does-php-have-a-feature-like-pythons-template-strings1)
What **my main issue is**, is to know if there's a better way to **store** Text Strings.
Now, is thi... | 2015/12/26 | [
"https://Stackoverflow.com/questions/34470085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2051815/"
] | First, take a look at [gettext](http://php.net/manual/en/book.gettext.php). It is widely used and there is plenty of tools to handle translation process, like xgettext and [POEdit](https://poedit.net/). It is more comfortable to use real english strings in source code and then extract them using xgettext tool. Gettext ... | You could store all the templates in one associative array and also the variables that are to replace the placeholders, like
```
$capt=array('welcome' => 'Welcome {firstname} {lastname}',
'good_morning' => 'Good morning {firstname}',
'good_afternoon' => 'Good afternoon {firstname}');
$vars=arr... |
34,470,085 | **Template Strings.**
This link might help a little bit:
[Does PHP have a feature like Python's template strings?](https://stackoverflow.com/questions/7683133/does-php-have-a-feature-like-pythons-template-strings1)
What **my main issue is**, is to know if there's a better way to **store** Text Strings.
Now, is thi... | 2015/12/26 | [
"https://Stackoverflow.com/questions/34470085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2051815/"
] | OK John I will elaborate.
The best way is to create a php file, for each language, containing the definition of an array of texts, using printf format for string substitution.
If the amount of text is very large, you might consider partitioning it further. (a few MB is usually fine)
This is efficient in production, a... | First, take a look at [gettext](http://php.net/manual/en/book.gettext.php). It is widely used and there is plenty of tools to handle translation process, like xgettext and [POEdit](https://poedit.net/). It is more comfortable to use real english strings in source code and then extract them using xgettext tool. Gettext ... |
34,470,085 | **Template Strings.**
This link might help a little bit:
[Does PHP have a feature like Python's template strings?](https://stackoverflow.com/questions/7683133/does-php-have-a-feature-like-pythons-template-strings1)
What **my main issue is**, is to know if there's a better way to **store** Text Strings.
Now, is thi... | 2015/12/26 | [
"https://Stackoverflow.com/questions/34470085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2051815/"
] | OK John I will elaborate.
The best way is to create a php file, for each language, containing the definition of an array of texts, using printf format for string substitution.
If the amount of text is very large, you might consider partitioning it further. (a few MB is usually fine)
This is efficient in production, a... | You could store all the templates in one associative array and also the variables that are to replace the placeholders, like
```
$capt=array('welcome' => 'Welcome {firstname} {lastname}',
'good_morning' => 'Good morning {firstname}',
'good_afternoon' => 'Good afternoon {firstname}');
$vars=arr... |
33,844,357 | Im trying to solve project euler 10 problem (find the sum of all the primes below two million), but the code takes forever to finish, how do i make it go faster?
```
console.log("Starting...")
var primes = [1000];
var x = 0;
var n = 0;
var i = 2;
var b = 0;
var sum = 0;
for (i; i < 2000000; i++) {
x = 0;
... | 2015/11/21 | [
"https://Stackoverflow.com/questions/33844357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5289392/"
] | The biggest super easy things you can do to make this a lot faster:
* Break out of the inner loop when you find a divisor!
* When you're checking for primality, start with the small divisors instead of the big ones. You'll find the composites a lot faster.
* You only have to check for divisors <= Math.sqrt(n)
* You on... | Since you keep an array of your primes anyway, you can split the process in two steps:
* Generating the primes up to your limit of 2 million
* and summing up.
As pointed out by others, you need only check whether a candidate number is divisable by another prime not larger than the square root of the candidate. If yo... |
33,844,357 | Im trying to solve project euler 10 problem (find the sum of all the primes below two million), but the code takes forever to finish, how do i make it go faster?
```
console.log("Starting...")
var primes = [1000];
var x = 0;
var n = 0;
var i = 2;
var b = 0;
var sum = 0;
for (i; i < 2000000; i++) {
x = 0;
... | 2015/11/21 | [
"https://Stackoverflow.com/questions/33844357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5289392/"
] | The biggest super easy things you can do to make this a lot faster:
* Break out of the inner loop when you find a divisor!
* When you're checking for primality, start with the small divisors instead of the big ones. You'll find the composites a lot faster.
* You only have to check for divisors <= Math.sqrt(n)
* You on... | Here is another version based on the [Sieve of Eratosthenes](https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes). It requires much more memory but if this does not concern you it's also pretty fast.
```
// just a helper to create integer arrays
function range(from, to) {
var numbers = [];
for (var i=from ; i<... |
22,077,178 | I'm trying to set a connection string dynamically to the MyDataContext inheriting DbContext and I got this error:
>
> No connection string named 'Data Source=myserver\mine;Initial Catalog=MyDb;User ID=user1;Password=mypassword;Connect Timeout=300' could be found in the application config file.
>
>
>
Here's what m... | 2014/02/27 | [
"https://Stackoverflow.com/questions/22077178",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2374722/"
] | You probably want [`DbContext(String)`](http://msdn.microsoft.com/en-us/library/gg679467%28v=vs.113%29.aspx) and not [`DataContext(String)`](http://msdn.microsoft.com/en-us/library/bb350721%28v=vs.110%29.aspx) given the EF tag (and you referencing `nameOrConnectionString` argument).
```
public class MyDataContext : Db... | Try copying the connections string to the `.config` file in the MVC project (i.e main project) and make sure that MVC project as a startup. |
44,190 | I tried using iTunes, but it only seems to have downloads for iPhone and iPad only. How can I get a version I can play on my iMac? | 2012/03/18 | [
"https://apple.stackexchange.com/questions/44190",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/18060/"
] | The App Store found in iTunes is only for iPhone/iPod/iPad apps. Mac apps can be found on the [Mac App Store](http://www.apple.com/mac/app-store/). Angry Birds is available for Mac for [$5](http://itunes.apple.com/us/app/angry-birds/id403961173?mt=12).
You can also play for free online at <http://chrome.angrybirds.c... | Unfortunately, it is not supported anymore.
<https://support.rovio.com/hc/en-us/articles/360042909613-I-can-t-find-Angry-Birds-Classic-in-my-app-store-anymore-what-s-up-with-that-> |
4,297,708 | I want to print the contents of a single file from a remote repository, at a specified revision. How can I do that? In svn, it'd be:
```
svn cat <path to remote file>
```
### update
The main thing I want to avoid is cloning the entire repository; some of the ones I'm working with are quite large, and I just need pr... | 2010/11/28 | [
"https://Stackoverflow.com/questions/4297708",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23309/"
] | There's two ways to do what you want:
1. Clone the repository locally, and execute the appropriate `hg cat -r REV FILE` against it
2. Use a web interface that gives access to the remote repository
If you don't have the web interface, then you need to clone. | You may be able to download the file content with `wget` or your favorite browser. For example, for bitbucket repositories the URL looks like this:
```
http://bitbucket.org/<user>/<project>/raw/<revision>/<filename>
```
For the `hg serve` web interface, the URL looks like this:
```
http://<host>:<port>/raw-file/<re... |
444,280 | >
> Взяли собаку из приюта. Добрый пес, но слишком лохматый.
>
>
>
Возможно ли здесь трактовать предложение "Добрый пес" как назывное? По моему мнению, здесь возможна двоякая трактовка: с одной стороны, "Добрый пес" может рассматриваться как неполное предложение (подлежащее ясно из контекста, а "добрый пес" - сказ... | 2018/09/25 | [
"https://rus.stackexchange.com/questions/444280",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/189895/"
] | Вариант редактирования:
**Животные предстанут перед экспертной комиссией, она и определит, чей владелец получит главный приз в 9,5 млн долларов.**
**Стилистические неточности**: повтор местоимений они, она, из них; союзное слово КОТОРОГО расположено на значительном расстоянии от "корабля пустыни". | По-моему, формально все правила согласования соблюдены. Не очень мне нравится тяжелое "владелец которого из них", я бы написал просто "владелец какого верблюда". |
444,280 | >
> Взяли собаку из приюта. Добрый пес, но слишком лохматый.
>
>
>
Возможно ли здесь трактовать предложение "Добрый пес" как назывное? По моему мнению, здесь возможна двоякая трактовка: с одной стороны, "Добрый пес" может рассматриваться как неполное предложение (подлежащее ясно из контекста, а "добрый пес" - сказ... | 2018/09/25 | [
"https://rus.stackexchange.com/questions/444280",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/189895/"
] | **Ошибка** - нагромождение местоимений: "**Они** предстанут перед экспертной комиссией, **она** и определит, владелец **которого** из **них** получит главный приз в 9,5 млн долларов."
Предлагаю правку:
**КОТОРОГО (ассоциируется со счётом) меняем на КАКОГО, два других местоимения заменяем существительными.**
***Верб... | По-моему, формально все правила согласования соблюдены. Не очень мне нравится тяжелое "владелец которого из них", я бы написал просто "владелец какого верблюда". |
15,022 | Given $F = F(x\_0,\ldots,x\_n)$ the free group on $n+1$ generators. Define a function $M: F\rightarrow \mathbb{N}$ such that $F(w) = l$, if the smallest group in which $w$ is not an identity is of size $l$.
My question is what the function $M$ looks like. Are there nice bounds?
Here are some observations that have co... | 2010/02/11 | [
"https://mathoverflow.net/questions/15022",
"https://mathoverflow.net",
"https://mathoverflow.net/users/3956/"
] | To make the question a little less open-ended while (I hope) retaining its spirit, let me interpret the question as asking for the rate of growth of the function $\mu(k)$ defined as the maximum of $M(w)$ over all nontrivial words $w$ of length up to $k$ in any number of symbols, where *length* is the number of symbols ... | The asymptotic version of this question raised by Bjorn Poonen has been studied by [Khalid Bou-Rabee](http://www.math.uchicago.edu/~khalid/) for general groups, not just free groups. That is, given G a residually finite group, for each g we can ask: how large is the smallest finite group F which detects g, meaning ther... |
69,231,149 | I'm do output with json\_encode to sending to javascript, with this code.
```
<?php
include "Connection.php";
$syntax_query = "select * from product";
$thisExecuter = mysqli_query($conn, $syntax_query);
$result = array();
while($row = mysqli_fetch_assoc($thisExecuter)){
array_push(
... | 2021/09/18 | [
"https://Stackoverflow.com/questions/69231149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12891802/"
] | As far as I recall from 45 years ago. PIC ZZZ ,ZZZ9(6) is a 12-digit number that has 6 zero-suppressed digits and 6 non-zero-suppressed digits, as well as a single curiously-placed comma separator.
Don't write 9(6) if you don't want leading zeroes. Using Z(6). Or maybe Z(5)9.
Did you really need 12 digits for 'area' ... | Your declarations define too large fields. e.g.
```
05 neOutputPop PIC ZZZ,ZZZ,ZZZ9(8).
```
This is equivalent to:
```
05 neOutputPop PIC ZZZ,ZZZ,ZZZ99999999.
```
Now only numbers larger than 99999999 will have any digits in the positions where you want zero suppression. In your sample data, the population ... |
69,231,149 | I'm do output with json\_encode to sending to javascript, with this code.
```
<?php
include "Connection.php";
$syntax_query = "select * from product";
$thisExecuter = mysqli_query($conn, $syntax_query);
$result = array();
while($row = mysqli_fetch_assoc($thisExecuter)){
array_push(
... | 2021/09/18 | [
"https://Stackoverflow.com/questions/69231149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12891802/"
] | As far as I recall from 45 years ago. PIC ZZZ ,ZZZ9(6) is a 12-digit number that has 6 zero-suppressed digits and 6 non-zero-suppressed digits, as well as a single curiously-placed comma separator.
Don't write 9(6) if you don't want leading zeroes. Using Z(6). Or maybe Z(5)9.
Did you really need 12 digits for 'area' ... | I do not know how many digits you want to display at most, so I post a general solution:
```
05 9digits pic zzz,zzz,zz9.
```
This will show
```
1
12
123
1,234
12,345
123,456
1,234,567
12,345,678
123,456,789
``` |
69,231,149 | I'm do output with json\_encode to sending to javascript, with this code.
```
<?php
include "Connection.php";
$syntax_query = "select * from product";
$thisExecuter = mysqli_query($conn, $syntax_query);
$result = array();
while($row = mysqli_fetch_assoc($thisExecuter)){
array_push(
... | 2021/09/18 | [
"https://Stackoverflow.com/questions/69231149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12891802/"
] | Your declarations define too large fields. e.g.
```
05 neOutputPop PIC ZZZ,ZZZ,ZZZ9(8).
```
This is equivalent to:
```
05 neOutputPop PIC ZZZ,ZZZ,ZZZ99999999.
```
Now only numbers larger than 99999999 will have any digits in the positions where you want zero suppression. In your sample data, the population ... | I do not know how many digits you want to display at most, so I post a general solution:
```
05 9digits pic zzz,zzz,zz9.
```
This will show
```
1
12
123
1,234
12,345
123,456
1,234,567
12,345,678
123,456,789
``` |
3,500,738 | is it possible to embed comments in my .xhtml-files that are only displayed in the source and not the rendered result?
I want to include author, date,... in the files but they should not be visible to the enduser in the generated output. If I use the standard comment-tags `<!-- -->` the browser displays them. | 2010/08/17 | [
"https://Stackoverflow.com/questions/3500738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/417177/"
] | Add the following into your `web.xml`:
```xml
<context-param>
<param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
```
This way `Facelets` will skip the comments while parsing the view `xhtml` template. | Invisible comments in JSF is a drawback, specially for beginers. I agree with answer of Mr Minchev. Anyway, I provide an alternative way to comment content in JSF consisting of using **ui:remove**
```
<ui:remove> This is a comment </ui:remove>
```
The UI Remove tag is used to specify tags or blocks of content that s... |
3,500,738 | is it possible to embed comments in my .xhtml-files that are only displayed in the source and not the rendered result?
I want to include author, date,... in the files but they should not be visible to the enduser in the generated output. If I use the standard comment-tags `<!-- -->` the browser displays them. | 2010/08/17 | [
"https://Stackoverflow.com/questions/3500738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/417177/"
] | Add the following into your `web.xml`:
```xml
<context-param>
<param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
```
This way `Facelets` will skip the comments while parsing the view `xhtml` template. | Wrong, the right way is:
```
<context-param>
<param-name>facelets.SKIP_COMMENTS</param-name>
<param-value>true</param-value>
```
This work for me, javax.faces.FACELETS\_SKIP\_COMMENTS no! |
3,500,738 | is it possible to embed comments in my .xhtml-files that are only displayed in the source and not the rendered result?
I want to include author, date,... in the files but they should not be visible to the enduser in the generated output. If I use the standard comment-tags `<!-- -->` the browser displays them. | 2010/08/17 | [
"https://Stackoverflow.com/questions/3500738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/417177/"
] | Invisible comments in JSF is a drawback, specially for beginers. I agree with answer of Mr Minchev. Anyway, I provide an alternative way to comment content in JSF consisting of using **ui:remove**
```
<ui:remove> This is a comment </ui:remove>
```
The UI Remove tag is used to specify tags or blocks of content that s... | Wrong, the right way is:
```
<context-param>
<param-name>facelets.SKIP_COMMENTS</param-name>
<param-value>true</param-value>
```
This work for me, javax.faces.FACELETS\_SKIP\_COMMENTS no! |
2,155,745 | >
> Find the integer $n$ which has the following property: If the numbers from $1$ to $n$ are all written down in decimal notation the total number of digit written down is $1998$. What is the next higher number (instead of $1998$) for which this problem has an answer?
>
>
>
My try:
This problem was given under e... | 2017/02/22 | [
"https://math.stackexchange.com/questions/2155745",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/296971/"
] | Since $3\cdot900=2700>1998$, you need to solve the equation:
$1\cdot9+2\cdot90+3\cdot{k}=1998\iff3k=1998-189\iff{k}=603$.
This means that there are $603$ numbers of $3$ digits each, hence $n=100+603-1=702$.
The next number for which this problem has an answer is of course $1998+3=2001$. | The number of digits when we write down all numbers till 100 is 192.
Now adding 100 more will cause total number of digits to increase by 300, as every number added was a three digit number.
Then for n=700 gives 1992 total digits
Because the first 100 gives 192 and the rest of the 100s gives 300 digits.
Then n=701 wi... |
32,412 | Your headquarter has sent an encrypted message to your phone:
```
OGZOTZHETZKOBOZRESTOZTAZETHZLIARYAWZNISTATOZWORTROOMZ8ZMAZDENYTIFIZGINSAKZORFZA
774060025101
000511014005
110123431121
200120404006
```
It didn't take you long to figure out the letters, but the numbers were a bit tricky. You worked on them a... | 2016/05/11 | [
"https://puzzling.stackexchange.com/questions/32412",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/20933/"
] | The first string of letters translates to
>
> GO TO THE BOOK STORE AT THE RAILWAY STATION TOMORROW 8 AM IDENTIFY ASKING FOR A
>
>
>
If you
>
> Remove the letter 'Z' separator and unscramble each word separately.
>
>
>
Using the new info from the hint, if the first series of numbers needs to be translate... | Ideas for the squares:
>
> I don't think the numbers and letters have to be combined as @Khale\_Kitha does, because the text says "knew what to do" before getting the letter rectangle.
>
>
>
You worked on them and got some clue, but you could have bet you needed some word:
>
> There is no 8 or 9 in the number... |
32,412 | Your headquarter has sent an encrypted message to your phone:
```
OGZOTZHETZKOBOZRESTOZTAZETHZLIARYAWZNISTATOZWORTROOMZ8ZMAZDENYTIFIZGINSAKZORFZA
774060025101
000511014005
110123431121
200120404006
```
It didn't take you long to figure out the letters, but the numbers were a bit tricky. You worked on them a... | 2016/05/11 | [
"https://puzzling.stackexchange.com/questions/32412",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/20933/"
] | The first string of letters translates to
>
> GO TO THE BOOK STORE AT THE RAILWAY STATION TOMORROW 8 AM IDENTIFY ASKING FOR A
>
>
>
If you
>
> Remove the letter 'Z' separator and unscramble each word separately.
>
>
>
Using the new info from the hint, if the first series of numbers needs to be translate... | Khale\_Kitha's answer produces this sequence of 1's and 0's:
>
> `111 111 100 000 110 000 000 010 101 001 000 001`
>
> `000 000 000 101 001 001 000 001 100 000 000 101`
>
> `001 001 000 001 010 011 100 011 001 001 010 001`
>
> `010 000 000 001 010 000 100 000 100 000 000 110`
>
>
>
Now you can
>
> Re... |
32,412 | Your headquarter has sent an encrypted message to your phone:
```
OGZOTZHETZKOBOZRESTOZTAZETHZLIARYAWZNISTATOZWORTROOMZ8ZMAZDENYTIFIZGINSAKZORFZA
774060025101
000511014005
110123431121
200120404006
```
It didn't take you long to figure out the letters, but the numbers were a bit tricky. You worked on them a... | 2016/05/11 | [
"https://puzzling.stackexchange.com/questions/32412",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/20933/"
] | The first string of letters translates to
>
> GO TO THE BOOK STORE AT THE RAILWAY STATION TOMORROW 8 AM IDENTIFY ASKING FOR A
>
>
>
If you
>
> Remove the letter 'Z' separator and unscramble each word separately.
>
>
>
Using the new info from the hint, if the first series of numbers needs to be translate... | Partial:
The newspaper revealed:
>
> TAKE RAIL ONE AT FOUR PM
>
>
>
By taking the newspaper letters and converting them to numbers yields:
>
> `9 7 4 1 7 1 0 7 7 5 1 9`
>
> `0 1 1 4 2 3 2 5 5 5 1 9`
>
> `1 6 2 5 2 4 6 3 3 5 2 7`
>
> `3 5 2 2 3 8 6 4 5 6 1 9`
>
>
>
Pairing the numbers in the two ... |
32,412 | Your headquarter has sent an encrypted message to your phone:
```
OGZOTZHETZKOBOZRESTOZTAZETHZLIARYAWZNISTATOZWORTROOMZ8ZMAZDENYTIFIZGINSAKZORFZA
774060025101
000511014005
110123431121
200120404006
```
It didn't take you long to figure out the letters, but the numbers were a bit tricky. You worked on them a... | 2016/05/11 | [
"https://puzzling.stackexchange.com/questions/32412",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/20933/"
] | Khale\_Kitha's answer produces this sequence of 1's and 0's:
>
> `111 111 100 000 110 000 000 010 101 001 000 001`
>
> `000 000 000 101 001 001 000 001 100 000 000 101`
>
> `001 001 000 001 010 011 100 011 001 001 010 001`
>
> `010 000 000 001 010 000 100 000 100 000 000 110`
>
>
>
Now you can
>
> Re... | Ideas for the squares:
>
> I don't think the numbers and letters have to be combined as @Khale\_Kitha does, because the text says "knew what to do" before getting the letter rectangle.
>
>
>
You worked on them and got some clue, but you could have bet you needed some word:
>
> There is no 8 or 9 in the number... |
32,412 | Your headquarter has sent an encrypted message to your phone:
```
OGZOTZHETZKOBOZRESTOZTAZETHZLIARYAWZNISTATOZWORTROOMZ8ZMAZDENYTIFIZGINSAKZORFZA
774060025101
000511014005
110123431121
200120404006
```
It didn't take you long to figure out the letters, but the numbers were a bit tricky. You worked on them a... | 2016/05/11 | [
"https://puzzling.stackexchange.com/questions/32412",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/20933/"
] | Partial:
The newspaper revealed:
>
> TAKE RAIL ONE AT FOUR PM
>
>
>
By taking the newspaper letters and converting them to numbers yields:
>
> `9 7 4 1 7 1 0 7 7 5 1 9`
>
> `0 1 1 4 2 3 2 5 5 5 1 9`
>
> `1 6 2 5 2 4 6 3 3 5 2 7`
>
> `3 5 2 2 3 8 6 4 5 6 1 9`
>
>
>
Pairing the numbers in the two ... | Ideas for the squares:
>
> I don't think the numbers and letters have to be combined as @Khale\_Kitha does, because the text says "knew what to do" before getting the letter rectangle.
>
>
>
You worked on them and got some clue, but you could have bet you needed some word:
>
> There is no 8 or 9 in the number... |
62,601,946 | So I was looking through PyPI and I found this: <https://pypi.org/project/pip/>
What is the reason for this? Why does this exist, and why would it be useful?? Isnt it kinda recursive in a way? | 2020/06/26 | [
"https://Stackoverflow.com/questions/62601946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8849702/"
] | Anyone looking for a quick copy-paste solution:
```
$ pip install altair_saver
$ npm install vega-lite vega-cli canvas
``` | To save charts to PNG, you need more than just the [altair\_saver](https://github.com/altair-viz/altair_saver) package. You also need either *selenium* or *node* dependencies, as outlined in altair\_saver's [installation](https://github.com/altair-viz/altair_saver#installation) section.
Follow those instructions and i... |
27,867,499 | I have two elements and I want to delegate click event to their children.
This code works:
```
list.on('click', '> *', function (e) {
clickHandler($(this), e);
});
listSelected.on('click', '> *', function (e) {
clickHandler($(this), e);
});
```
Tried to use jQuery element array, but this code doesn't work:
... | 2015/01/09 | [
"https://Stackoverflow.com/questions/27867499",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3841049/"
] | You can use `add()`
```
list.add(listSelected).on('click', '> *', function (e) {
clickHandler($(this), e);
});
``` | ```
$('#your_list').children().each(function(){
$(this).bind('click', clickHandler) ;
}) ;
``` |
15,462,523 | I am super confused and have been searching. But as the title suggests I am trying to enter an array.
My question is how do I get this array to import into the database? As of now with the current script, it only imports the first record and not the rest. Here also, I am able to import other values within the same arra... | 2013/03/17 | [
"https://Stackoverflow.com/questions/15462523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2169854/"
] | Although it is not recommended to store an array in a database, you could `serialize()` your array to store it in a database. Basically, PHP will convert the array into a specially crafted string, which it can later interpret.
[Serialize](http://php.net/manual/en/function.serialize.php) to store it in the database, an... | You should be looking about PDO\_MySQL and your insert string is outside the loop and should be execute inside it. |
15,462,523 | I am super confused and have been searching. But as the title suggests I am trying to enter an array.
My question is how do I get this array to import into the database? As of now with the current script, it only imports the first record and not the rest. Here also, I am able to import other values within the same arra... | 2013/03/17 | [
"https://Stackoverflow.com/questions/15462523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2169854/"
] | Although it is not recommended to store an array in a database, you could `serialize()` your array to store it in a database. Basically, PHP will convert the array into a specially crafted string, which it can later interpret.
[Serialize](http://php.net/manual/en/function.serialize.php) to store it in the database, an... | You have to iterate through the array and insert every field of the array by it's own.
```
foreach($array as $value) {
// execute your insert statement here with $value
}
``` |
15,462,523 | I am super confused and have been searching. But as the title suggests I am trying to enter an array.
My question is how do I get this array to import into the database? As of now with the current script, it only imports the first record and not the rest. Here also, I am able to import other values within the same arra... | 2013/03/17 | [
"https://Stackoverflow.com/questions/15462523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2169854/"
] | Although it is not recommended to store an array in a database, you could `serialize()` your array to store it in a database. Basically, PHP will convert the array into a specially crafted string, which it can later interpret.
[Serialize](http://php.net/manual/en/function.serialize.php) to store it in the database, an... | First of all you can't insert array in MySQL as you are doing .. Do as with iterating..
```
foreach ($output as $key => $value) {
if (isset($output[$key]["stats"]["damage_given"]["vehicle"])) {
$damage_given[$key] = $output[$key]["stats"]["damage_given"]["vehicle"];
foreach ($damage_given[$key]... |
15,462,523 | I am super confused and have been searching. But as the title suggests I am trying to enter an array.
My question is how do I get this array to import into the database? As of now with the current script, it only imports the first record and not the rest. Here also, I am able to import other values within the same arra... | 2013/03/17 | [
"https://Stackoverflow.com/questions/15462523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2169854/"
] | Although it is not recommended to store an array in a database, you could `serialize()` your array to store it in a database. Basically, PHP will convert the array into a specially crafted string, which it can later interpret.
[Serialize](http://php.net/manual/en/function.serialize.php) to store it in the database, an... | try building your insert data in an array and then implode the results into a single query:
```
<?php
foreach ($output as $key => $value) {
if (isset($output[$key]["stats"]["damage_given"]["vehicle"])) {
$damage_given[$key] = $output[$key]["stats"]["damage_given"]["vehicle"];
foreach ($damage_g... |
15,462,523 | I am super confused and have been searching. But as the title suggests I am trying to enter an array.
My question is how do I get this array to import into the database? As of now with the current script, it only imports the first record and not the rest. Here also, I am able to import other values within the same arra... | 2013/03/17 | [
"https://Stackoverflow.com/questions/15462523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2169854/"
] | Although it is not recommended to store an array in a database, you could `serialize()` your array to store it in a database. Basically, PHP will convert the array into a specially crafted string, which it can later interpret.
[Serialize](http://php.net/manual/en/function.serialize.php) to store it in the database, an... | here is what I got to fix the problem!
$stmt = $dbh->prepare(
"INSERT INTO kills\_vehicle (character\_number, veh\_id, veh\_name, veh\_total, veh\_faction\_nc, veh\_faction\_tr, veh\_faction\_vs)
VALUES(:char\_id, :id, :vehname, :total\_value, :faction\_nc, :faction\_tr, :faction\_vs)");
```
foreach ($output as... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.