qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
14,974,604 | I'm making a web-based quiz.
When I press an answer I want the count at the top to change to the next, however it keeps skipping one digit, jumping to the next (e.i. from I to III, instead of I to III).
What am I doing wrong?
Site: <http://www.carlpapworth.com/friday-quiz/#>
Html:
```
<ul id="count">
... | 2013/02/20 | [
"https://Stackoverflow.com/questions/14974604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1666110/"
] | I don't see anything wrong in your javascript, but your HTML page includes the same script twice. If the click event is registered twice, it probably causes your issue.
```
<script type="text/javascript" src='js/custom.js'></script>
<script type="text/javascript" src="js/jquery.easing.1.3.js"></script>
<script src='js... | The `js/custom.js` script is mentioned **twice** in the `<head>`. You should remove one of them, otherwise the click events are registered twice.
Furthermore, the expression inside `.next()` looks somewhat odd (you don't need the `#count` in there and maybe not even `li`) and the function itself can be simplified to t... |
14,974,604 | I'm making a web-based quiz.
When I press an answer I want the count at the top to change to the next, however it keeps skipping one digit, jumping to the next (e.i. from I to III, instead of I to III).
What am I doing wrong?
Site: <http://www.carlpapworth.com/friday-quiz/#>
Html:
```
<ul id="count">
... | 2013/02/20 | [
"https://Stackoverflow.com/questions/14974604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1666110/"
] | I don't see anything wrong in your javascript, but your HTML page includes the same script twice. If the click event is registered twice, it probably causes your issue.
```
<script type="text/javascript" src='js/custom.js'></script>
<script type="text/javascript" src="js/jquery.easing.1.3.js"></script>
<script src='js... | I'm not that familiar with jquery specifics, but I would debug this with adding some trace, inna spirit of:
```
function qNext(){
// Output data on what is your current question
$('.cCurrent').next('#count li').addClass('cCurrent');
// Output something - so you know for sure that this is the line that does... |
14,974,604 | I'm making a web-based quiz.
When I press an answer I want the count at the top to change to the next, however it keeps skipping one digit, jumping to the next (e.i. from I to III, instead of I to III).
What am I doing wrong?
Site: <http://www.carlpapworth.com/friday-quiz/#>
Html:
```
<ul id="count">
... | 2013/02/20 | [
"https://Stackoverflow.com/questions/14974604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1666110/"
] | I don't see anything wrong in your javascript, but your HTML page includes the same script twice. If the click event is registered twice, it probably causes your issue.
```
<script type="text/javascript" src='js/custom.js'></script>
<script type="text/javascript" src="js/jquery.easing.1.3.js"></script>
<script src='js... | the qnext function is working correctly
I assume the Problem is that theres also another click event, which does also slide one Question to the right, added to the answers by the slider (ulslide). Try to comment out this line and see if it works
```
nextButton: '.qAnswers a',
``` |
21,629,396 | Can someone explain why does this code works, even though i allocate memory only for 2 cells in st array?
```
int main(void){
st=(int *)malloc(sizeof(int)*2);
int j;
for(j=0; j<5; j++){
st[j]=j*10000;
}
}
```
While the next code won't work...
```
int main(void){
st=(int *)malloc(sizeof(int)*2);
int j;
for(j=0... | 2014/02/07 | [
"https://Stackoverflow.com/questions/21629396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3165271/"
] | Accessing unallocated memory is "undefined behavior". That means the program *can* exit with a runtime error, but it doesn't have to.
Many compilers build code with certain saveguards around allocated memory to cause crashs when writing beyond it, but these don't have to work in *any* condition. In your special case i... | You are writing past to allocated space for array. It invoke **undefined behavior**. In this case anything could happen. |
21,629,396 | Can someone explain why does this code works, even though i allocate memory only for 2 cells in st array?
```
int main(void){
st=(int *)malloc(sizeof(int)*2);
int j;
for(j=0; j<5; j++){
st[j]=j*10000;
}
}
```
While the next code won't work...
```
int main(void){
st=(int *)malloc(sizeof(int)*2);
int j;
for(j=0... | 2014/02/07 | [
"https://Stackoverflow.com/questions/21629396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3165271/"
] | In your first example, the memory you write to is never read again. A standard-compliant compiler that can detect this is allowed to eliminate the code, as long as it behaves identically. Since the program is not required to crash, the compiler can replace it with an empty program. | You are writing past to allocated space for array. It invoke **undefined behavior**. In this case anything could happen. |
21,629,396 | Can someone explain why does this code works, even though i allocate memory only for 2 cells in st array?
```
int main(void){
st=(int *)malloc(sizeof(int)*2);
int j;
for(j=0; j<5; j++){
st[j]=j*10000;
}
}
```
While the next code won't work...
```
int main(void){
st=(int *)malloc(sizeof(int)*2);
int j;
for(j=0... | 2014/02/07 | [
"https://Stackoverflow.com/questions/21629396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3165271/"
] | Accessing unallocated memory is "undefined behavior". That means the program *can* exit with a runtime error, but it doesn't have to.
Many compilers build code with certain saveguards around allocated memory to cause crashs when writing beyond it, but these don't have to work in *any* condition. In your special case i... | In your first example, the memory you write to is never read again. A standard-compliant compiler that can detect this is allowed to eliminate the code, as long as it behaves identically. Since the program is not required to crash, the compiler can replace it with an empty program. |
57,251,243 | I have a `utils.js` file with some generic utility functions. I use `module.exports` to expose some of the functions while keep the rest hidden.
```
module.exports = {
utils_1: function_1,
utils_2: function_2
};
```
Suppose there are other functions, namely `function_3` and `function_4` that I would like not to expo... | 2019/07/29 | [
"https://Stackoverflow.com/questions/57251243",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6950690/"
] | `function_3` and `function_4` are used inside `function_1` and `function_2`, right? So, do you really need to unit test it? I would not. But other people might think the contrary.
Here is my example
```
// utils.js
function function_3(obj) {
obj.a = 3;
return obj;
}
function function_4(obj) {
obj = function_3(... | Your private / unexposed functions are used within your exported functions, are they not? Thereby, they are tested implicitly as soon as you write all the test cases for your public / exposed functions.
Exposing functions or writing tests on private functions is missing the goal of unit tests: Testing the *public inte... |
24,853,621 | I have some server side code in `PHP` which looks like this
```
$var2 = htmlspecialchars($var1);
```
For example,
```
"It's Monday" gets converted to "It's Monday"
```
I am not able to decode the text back in javascript using the function [unescape.](http://www.w3schools.com/jsref/jsref_unescape.asp)
```
u... | 2014/07/20 | [
"https://Stackoverflow.com/questions/24853621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2225572/"
] | You should be able to use the following:
```
select x.id, x.group_id, x.itemname, count(y.id) as sort, x.type
from tbl x
left outer join tbl y
on x.group_id = y.group_id
and y.id < x.id
group by x.id, x.group_id, x.itemname, x.type
```
See fiddle at:
<http://sqlfiddle.com/#!2/bc4e8/3/0>
I know that I us... | Updated for comment:
You can use:
```
Select * from (
Select * from yourTableName ORDER BY yourTableName.Sort)
ORDER BY yourTableName.GroupID
```
When you create simple query, go to the SQL mode and insert the code. |
51,240,974 | The following is my settings by `crontab -e`, but it doesn't work.
```
*/20 * * * * export DISPLAY=:0.0;/usr/bin/notify-send "Take A Rest Please!" "Pay attention to your Eyes and Neck!"
``` | 2018/07/09 | [
"https://Stackoverflow.com/questions/51240974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9411432/"
] | Dictionaries aren't ordered.
Add `sort_keys=True` to the `json.dumps()` invocation to always sort object keys in the JSON output. | Because json in python is parsed as dictionary and normal dictionary in python is unordered if you want to be ordered you have use ordered dict
```
from collections import OrderedDict
OrderedDict({"a":1})
``` |
51,240,974 | The following is my settings by `crontab -e`, but it doesn't work.
```
*/20 * * * * export DISPLAY=:0.0;/usr/bin/notify-send "Take A Rest Please!" "Pay attention to your Eyes and Neck!"
``` | 2018/07/09 | [
"https://Stackoverflow.com/questions/51240974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9411432/"
] | Python dict was `unordered` before Python 3.7. You could use `sort_keys=True` flag from `json.dumps()`. More about [json encoder and decoder](https://docs.python.org/2/library/json.html) | Dictionaries aren't ordered.
Add `sort_keys=True` to the `json.dumps()` invocation to always sort object keys in the JSON output. |
51,240,974 | The following is my settings by `crontab -e`, but it doesn't work.
```
*/20 * * * * export DISPLAY=:0.0;/usr/bin/notify-send "Take A Rest Please!" "Pay attention to your Eyes and Neck!"
``` | 2018/07/09 | [
"https://Stackoverflow.com/questions/51240974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9411432/"
] | Python dict was `unordered` before Python 3.7. You could use `sort_keys=True` flag from `json.dumps()`. More about [json encoder and decoder](https://docs.python.org/2/library/json.html) | Because json in python is parsed as dictionary and normal dictionary in python is unordered if you want to be ordered you have use ordered dict
```
from collections import OrderedDict
OrderedDict({"a":1})
``` |
20,786,851 | Need a generic sql query for joins that can run on mysql, postgres and other major DBs
I have a table named autumn4.ip , I have `three columns: id,start,end (all ints).`
How do I make a join so that I make use of BUT not by BETWEEN but by JOINS.
like pseudo:
```
select * FROM autumn.ip WHERE :number-constant >= sta... | 2013/12/26 | [
"https://Stackoverflow.com/questions/20786851",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2432704/"
] | I would typically use the pattern
```
foo = data.get("a",{}).get("b",{}).get("c",False)
if foo:
...
```
This requires that the nesting is always the same depth and that data["a"]["b"]["c"] is not "falsy". | There's two solutions:
### Return a default value with defaultdict
You can use a [`defaultdict`](http://docs.python.org/2/library/collections.html#collections.defaultdict), and intstantiate an inner level with another `defaultdict`. Then, if the key is missing, it'll return an empty dict without throwing errors:
```... |
20,786,851 | Need a generic sql query for joins that can run on mysql, postgres and other major DBs
I have a table named autumn4.ip , I have `three columns: id,start,end (all ints).`
How do I make a join so that I make use of BUT not by BETWEEN but by JOINS.
like pseudo:
```
select * FROM autumn.ip WHERE :number-constant >= sta... | 2013/12/26 | [
"https://Stackoverflow.com/questions/20786851",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2432704/"
] | You can wrap it in a try/except block
```
try:
x = data[a][b][c]
...do stuff in your "if" clause
except KeyError:
...do stuff in your "else" clause
``` | There's two solutions:
### Return a default value with defaultdict
You can use a [`defaultdict`](http://docs.python.org/2/library/collections.html#collections.defaultdict), and intstantiate an inner level with another `defaultdict`. Then, if the key is missing, it'll return an empty dict without throwing errors:
```... |
20,786,851 | Need a generic sql query for joins that can run on mysql, postgres and other major DBs
I have a table named autumn4.ip , I have `three columns: id,start,end (all ints).`
How do I make a join so that I make use of BUT not by BETWEEN but by JOINS.
like pseudo:
```
select * FROM autumn.ip WHERE :number-constant >= sta... | 2013/12/26 | [
"https://Stackoverflow.com/questions/20786851",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2432704/"
] | If you need to do this multi-level lookup very often, this helper method can be useful:
```py
def multi_get(dict_obj, *attrs, default=None):
result = dict_obj
for attr in attrs:
if attr not in result:
return default
result = result[attr]
return result
```
To use it, just call ... | There's two solutions:
### Return a default value with defaultdict
You can use a [`defaultdict`](http://docs.python.org/2/library/collections.html#collections.defaultdict), and intstantiate an inner level with another `defaultdict`. Then, if the key is missing, it'll return an empty dict without throwing errors:
```... |
20,786,851 | Need a generic sql query for joins that can run on mysql, postgres and other major DBs
I have a table named autumn4.ip , I have `three columns: id,start,end (all ints).`
How do I make a join so that I make use of BUT not by BETWEEN but by JOINS.
like pseudo:
```
select * FROM autumn.ip WHERE :number-constant >= sta... | 2013/12/26 | [
"https://Stackoverflow.com/questions/20786851",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2432704/"
] | I would typically use the pattern
```
foo = data.get("a",{}).get("b",{}).get("c",False)
if foo:
...
```
This requires that the nesting is always the same depth and that data["a"]["b"]["c"] is not "falsy". | If you need to do this multi-level lookup very often, this helper method can be useful:
```py
def multi_get(dict_obj, *attrs, default=None):
result = dict_obj
for attr in attrs:
if attr not in result:
return default
result = result[attr]
return result
```
To use it, just call ... |
20,786,851 | Need a generic sql query for joins that can run on mysql, postgres and other major DBs
I have a table named autumn4.ip , I have `three columns: id,start,end (all ints).`
How do I make a join so that I make use of BUT not by BETWEEN but by JOINS.
like pseudo:
```
select * FROM autumn.ip WHERE :number-constant >= sta... | 2013/12/26 | [
"https://Stackoverflow.com/questions/20786851",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2432704/"
] | You can wrap it in a try/except block
```
try:
x = data[a][b][c]
...do stuff in your "if" clause
except KeyError:
...do stuff in your "else" clause
``` | If you need to do this multi-level lookup very often, this helper method can be useful:
```py
def multi_get(dict_obj, *attrs, default=None):
result = dict_obj
for attr in attrs:
if attr not in result:
return default
result = result[attr]
return result
```
To use it, just call ... |
44,509,457 | I am rotating an object with CSS upon hovering, and would like for it to remain in it's new position as you unhover it. I have searched around, but the only thing I could find is [css :hover rotate element and keep the new position](https://stackoverflow.com/questions/23313727/css-hover-rotate-element-and-keep-the-new-... | 2017/06/12 | [
"https://Stackoverflow.com/questions/44509457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8151420/"
] | I you want a pure CSS solution, you can set a transtion time to go back to the base state quite high.
It's not for ever, but it's pretty close for most users:
```css
.test {
display: inline-block;
margin: 10px;
background-color: tomato;
transform: rotate(0deg);
transition: transform 999s 999s... | Use an animation, and apply it using JS event listener, when the element is hovered (mouseover event). When the element is hovered for the 1st time, remove the event listener:
```js
var rect = document.querySelector('.rectangle')
function rotate() {
this.classList.add('rotate');
rect.removeEventListener('mous... |
44,509,457 | I am rotating an object with CSS upon hovering, and would like for it to remain in it's new position as you unhover it. I have searched around, but the only thing I could find is [css :hover rotate element and keep the new position](https://stackoverflow.com/questions/23313727/css-hover-rotate-element-and-keep-the-new-... | 2017/06/12 | [
"https://Stackoverflow.com/questions/44509457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8151420/"
] | I had a circular icon that I wanted to rotate on every hover, not just the first, and not rotate when un-hovered.
**Original**
I saw this problem when I had CSS that looked like this
```
.icon {
transition: transform 0.5s;
}
.icon:hover {
transform: rotate(90deg);
}
```
**Solution**
The simple solution w... | Use an animation, and apply it using JS event listener, when the element is hovered (mouseover event). When the element is hovered for the 1st time, remove the event listener:
```js
var rect = document.querySelector('.rectangle')
function rotate() {
this.classList.add('rotate');
rect.removeEventListener('mous... |
44,509,457 | I am rotating an object with CSS upon hovering, and would like for it to remain in it's new position as you unhover it. I have searched around, but the only thing I could find is [css :hover rotate element and keep the new position](https://stackoverflow.com/questions/23313727/css-hover-rotate-element-and-keep-the-new-... | 2017/06/12 | [
"https://Stackoverflow.com/questions/44509457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8151420/"
] | I you want a pure CSS solution, you can set a transtion time to go back to the base state quite high.
It's not for ever, but it's pretty close for most users:
```css
.test {
display: inline-block;
margin: 10px;
background-color: tomato;
transform: rotate(0deg);
transition: transform 999s 999s... | You also need an initial `transform` state in the regular CSS of your element, so that it can transform between two defined states:
```css
.rotate {
width: 20px;
height: 100px;
background: blue;
transition: 0.9s;
transform: rotate(0deg);
}
.rotate:hover {
transform: rotate(180deg);
}
body {
... |
44,509,457 | I am rotating an object with CSS upon hovering, and would like for it to remain in it's new position as you unhover it. I have searched around, but the only thing I could find is [css :hover rotate element and keep the new position](https://stackoverflow.com/questions/23313727/css-hover-rotate-element-and-keep-the-new-... | 2017/06/12 | [
"https://Stackoverflow.com/questions/44509457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8151420/"
] | I had a circular icon that I wanted to rotate on every hover, not just the first, and not rotate when un-hovered.
**Original**
I saw this problem when I had CSS that looked like this
```
.icon {
transition: transform 0.5s;
}
.icon:hover {
transform: rotate(90deg);
}
```
**Solution**
The simple solution w... | You also need an initial `transform` state in the regular CSS of your element, so that it can transform between two defined states:
```css
.rotate {
width: 20px;
height: 100px;
background: blue;
transition: 0.9s;
transform: rotate(0deg);
}
.rotate:hover {
transform: rotate(180deg);
}
body {
... |
44,509,457 | I am rotating an object with CSS upon hovering, and would like for it to remain in it's new position as you unhover it. I have searched around, but the only thing I could find is [css :hover rotate element and keep the new position](https://stackoverflow.com/questions/23313727/css-hover-rotate-element-and-keep-the-new-... | 2017/06/12 | [
"https://Stackoverflow.com/questions/44509457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8151420/"
] | I you want a pure CSS solution, you can set a transtion time to go back to the base state quite high.
It's not for ever, but it's pretty close for most users:
```css
.test {
display: inline-block;
margin: 10px;
background-color: tomato;
transform: rotate(0deg);
transition: transform 999s 999s... | If you want to maintain the rotated state, you may have to use a little JQuery to check when the transition ends and change the class so it doesn't revert back to its original state on blur.
This way the div is rotated once and then its class is changed to maintain the rotated state.
```js
$('.rotate').hover(function... |
44,509,457 | I am rotating an object with CSS upon hovering, and would like for it to remain in it's new position as you unhover it. I have searched around, but the only thing I could find is [css :hover rotate element and keep the new position](https://stackoverflow.com/questions/23313727/css-hover-rotate-element-and-keep-the-new-... | 2017/06/12 | [
"https://Stackoverflow.com/questions/44509457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8151420/"
] | I had a circular icon that I wanted to rotate on every hover, not just the first, and not rotate when un-hovered.
**Original**
I saw this problem when I had CSS that looked like this
```
.icon {
transition: transform 0.5s;
}
.icon:hover {
transform: rotate(90deg);
}
```
**Solution**
The simple solution w... | If you want to maintain the rotated state, you may have to use a little JQuery to check when the transition ends and change the class so it doesn't revert back to its original state on blur.
This way the div is rotated once and then its class is changed to maintain the rotated state.
```js
$('.rotate').hover(function... |
44,509,457 | I am rotating an object with CSS upon hovering, and would like for it to remain in it's new position as you unhover it. I have searched around, but the only thing I could find is [css :hover rotate element and keep the new position](https://stackoverflow.com/questions/23313727/css-hover-rotate-element-and-keep-the-new-... | 2017/06/12 | [
"https://Stackoverflow.com/questions/44509457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8151420/"
] | I had a circular icon that I wanted to rotate on every hover, not just the first, and not rotate when un-hovered.
**Original**
I saw this problem when I had CSS that looked like this
```
.icon {
transition: transform 0.5s;
}
.icon:hover {
transform: rotate(90deg);
}
```
**Solution**
The simple solution w... | I you want a pure CSS solution, you can set a transtion time to go back to the base state quite high.
It's not for ever, but it's pretty close for most users:
```css
.test {
display: inline-block;
margin: 10px;
background-color: tomato;
transform: rotate(0deg);
transition: transform 999s 999s... |
44,509,457 | I am rotating an object with CSS upon hovering, and would like for it to remain in it's new position as you unhover it. I have searched around, but the only thing I could find is [css :hover rotate element and keep the new position](https://stackoverflow.com/questions/23313727/css-hover-rotate-element-and-keep-the-new-... | 2017/06/12 | [
"https://Stackoverflow.com/questions/44509457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8151420/"
] | I you want a pure CSS solution, you can set a transtion time to go back to the base state quite high.
It's not for ever, but it's pretty close for most users:
```css
.test {
display: inline-block;
margin: 10px;
background-color: tomato;
transform: rotate(0deg);
transition: transform 999s 999s... | What worked for me was to put the transform not on hover but on the main css.
not:
```
#gear {
width: 3vh;
height: auto;
cursor: pointer;
&:hover {
transform: rotate(45deg);
transition: transform 200ms;
}
}
```
but
```
#gear {
width: 3vh;
height: auto;
cursor: pointer;
transition: trans... |
44,509,457 | I am rotating an object with CSS upon hovering, and would like for it to remain in it's new position as you unhover it. I have searched around, but the only thing I could find is [css :hover rotate element and keep the new position](https://stackoverflow.com/questions/23313727/css-hover-rotate-element-and-keep-the-new-... | 2017/06/12 | [
"https://Stackoverflow.com/questions/44509457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8151420/"
] | I had a circular icon that I wanted to rotate on every hover, not just the first, and not rotate when un-hovered.
**Original**
I saw this problem when I had CSS that looked like this
```
.icon {
transition: transform 0.5s;
}
.icon:hover {
transform: rotate(90deg);
}
```
**Solution**
The simple solution w... | What worked for me was to put the transform not on hover but on the main css.
not:
```
#gear {
width: 3vh;
height: auto;
cursor: pointer;
&:hover {
transform: rotate(45deg);
transition: transform 200ms;
}
}
```
but
```
#gear {
width: 3vh;
height: auto;
cursor: pointer;
transition: trans... |
48,450,628 | So I have a Student class, and I have to get the best and scores from the students, but it's all grouped by their courseid. Basically I have to get the best and worst score in each specific course. Everything is taken from a file students.txt and this is my code so far.
```
import java.io.IOException;
import java.nio.... | 2018/01/25 | [
"https://Stackoverflow.com/questions/48450628",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9211186/"
] | You can use [`Collectors.groupingBy`](https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collectors.html#groupingBy-java.util.function.Function-java.util.stream.Collector-) and [`Collectors.summarizingDouble`](https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collectors.html#summarizingDouble-java.util... | I'd approach it like this:
Create a class to encapsulate your best and worst score, something like:
```
class CourseStat{
private double bestScore;
private double worstScore;
constructor ...gettersandsetters...
}
```
Then create a HashMap where the key is the courseID. Basically something like:
```
HashM... |
62,544,782 | ```
app.post(' /', urlencodedParser, function(req, res) {
res.render('load', {data: req.body});
var token = req.body.token;
require('./loader.js')
});
```
How can I provide variable "token" to loader.js? | 2020/06/23 | [
"https://Stackoverflow.com/questions/62544782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13802050/"
] | Here is a simplified solution:
```
let isMatchingBraces = function(str) {
let stack = [];
let symbol = {
'(': ')',
'[': ']',
'{': '}'
};
for (let i = 0; i < str.length; i += 1) {
// If character is an opening brace add it to a stack
if (str[i] === '(' || str[i] =... | Here is my solution:
```
var isValid = function (s) {
let charMap = new Map();
for (let i = 0; i < s.length; i++) {
charMap.set(s[i], i);
}
return Boolean(
charMap.get("(") < charMap.get(")") &&
charMap.get("(") % 2 != charMap.get(")") % 2 &&
charMap.get("{") < charMap.get("}") &&
charMap... |
62,544,782 | ```
app.post(' /', urlencodedParser, function(req, res) {
res.render('load', {data: req.body});
var token = req.body.token;
require('./loader.js')
});
```
How can I provide variable "token" to loader.js? | 2020/06/23 | [
"https://Stackoverflow.com/questions/62544782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13802050/"
] | Hell yeah!! I'm very happy to finally reach to the solution myself using some of the hints given to me here:
```js
function validBraces(braces){
let opening = [ '(', '[', '{']
let closing = [ ')', ']', '}']
let arr = []
//console.log(closing.indexOf(braces[")"]) === opening.indexOf(arr[")"]))
for (... | Here is a simplified solution:
```
let isMatchingBraces = function(str) {
let stack = [];
let symbol = {
'(': ')',
'[': ']',
'{': '}'
};
for (let i = 0; i < str.length; i += 1) {
// If character is an opening brace add it to a stack
if (str[i] === '(' || str[i] =... |
62,544,782 | ```
app.post(' /', urlencodedParser, function(req, res) {
res.render('load', {data: req.body});
var token = req.body.token;
require('./loader.js')
});
```
How can I provide variable "token" to loader.js? | 2020/06/23 | [
"https://Stackoverflow.com/questions/62544782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13802050/"
] | ```js
var validBraces = (s) => {
let objO = {'(': 0, '[': 1, '{': 2};
let objC = {')': 0, ']': 1, '}': 2};
let stack = [];
for (let i=0; i<s.length; i++) {
if (objO.hasOwnProperty(s[i])) {
if (stack.length === 0 || stack[stack.length-1].idx!==objO[s[i]])
stack.push... | Here is a simplified solution:
```
let isMatchingBraces = function(str) {
let stack = [];
let symbol = {
'(': ')',
'[': ']',
'{': '}'
};
for (let i = 0; i < str.length; i += 1) {
// If character is an opening brace add it to a stack
if (str[i] === '(' || str[i] =... |
62,544,782 | ```
app.post(' /', urlencodedParser, function(req, res) {
res.render('load', {data: req.body});
var token = req.body.token;
require('./loader.js')
});
```
How can I provide variable "token" to loader.js? | 2020/06/23 | [
"https://Stackoverflow.com/questions/62544782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13802050/"
] | Hell yeah!! I'm very happy to finally reach to the solution myself using some of the hints given to me here:
```js
function validBraces(braces){
let opening = [ '(', '[', '{']
let closing = [ ')', ']', '}']
let arr = []
//console.log(closing.indexOf(braces[")"]) === opening.indexOf(arr[")"]))
for (... | ```
function validBraces(braces){
let par =0;
let bra =0;
let cur =0;
for(let i =0; i<braces.length; i++){
if(braces[i]==="("){
par++;
}
if(braces[i]===")"){
par--;
}
if(braces[i]==="["){
bra++;
}
if(braces[i]===... |
62,544,782 | ```
app.post(' /', urlencodedParser, function(req, res) {
res.render('load', {data: req.body});
var token = req.body.token;
require('./loader.js')
});
```
How can I provide variable "token" to loader.js? | 2020/06/23 | [
"https://Stackoverflow.com/questions/62544782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13802050/"
] | As Dave suggested, using a stack, I've wrote the code for it:
```
var leftBraces="([{";
var rightBraces=")]}";
function checkBraces(braces) {
var ok=true;
var stack=[];
for(var i=0; i<braces.length && ok; i++) {
var brace=braces[i];
if(leftBraces.includes(brace)) stack.push(brace);
else {
var ... | Here is a simplified solution:
```
let isMatchingBraces = function(str) {
let stack = [];
let symbol = {
'(': ')',
'[': ']',
'{': '}'
};
for (let i = 0; i < str.length; i += 1) {
// If character is an opening brace add it to a stack
if (str[i] === '(' || str[i] =... |
62,544,782 | ```
app.post(' /', urlencodedParser, function(req, res) {
res.render('load', {data: req.body});
var token = req.body.token;
require('./loader.js')
});
```
How can I provide variable "token" to loader.js? | 2020/06/23 | [
"https://Stackoverflow.com/questions/62544782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13802050/"
] | ```js
var validBraces = (s) => {
let objO = {'(': 0, '[': 1, '{': 2};
let objC = {')': 0, ']': 1, '}': 2};
let stack = [];
for (let i=0; i<s.length; i++) {
if (objO.hasOwnProperty(s[i])) {
if (stack.length === 0 || stack[stack.length-1].idx!==objO[s[i]])
stack.push... | Here is my solution:
```
var isValid = function (s) {
let charMap = new Map();
for (let i = 0; i < s.length; i++) {
charMap.set(s[i], i);
}
return Boolean(
charMap.get("(") < charMap.get(")") &&
charMap.get("(") % 2 != charMap.get(")") % 2 &&
charMap.get("{") < charMap.get("}") &&
charMap... |
62,544,782 | ```
app.post(' /', urlencodedParser, function(req, res) {
res.render('load', {data: req.body});
var token = req.body.token;
require('./loader.js')
});
```
How can I provide variable "token" to loader.js? | 2020/06/23 | [
"https://Stackoverflow.com/questions/62544782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13802050/"
] | Hell yeah!! I'm very happy to finally reach to the solution myself using some of the hints given to me here:
```js
function validBraces(braces){
let opening = [ '(', '[', '{']
let closing = [ ')', ']', '}']
let arr = []
//console.log(closing.indexOf(braces[")"]) === opening.indexOf(arr[")"]))
for (... | Here is my solution:
```
var isValid = function (s) {
let charMap = new Map();
for (let i = 0; i < s.length; i++) {
charMap.set(s[i], i);
}
return Boolean(
charMap.get("(") < charMap.get(")") &&
charMap.get("(") % 2 != charMap.get(")") % 2 &&
charMap.get("{") < charMap.get("}") &&
charMap... |
62,544,782 | ```
app.post(' /', urlencodedParser, function(req, res) {
res.render('load', {data: req.body});
var token = req.body.token;
require('./loader.js')
});
```
How can I provide variable "token" to loader.js? | 2020/06/23 | [
"https://Stackoverflow.com/questions/62544782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13802050/"
] | As Dave suggested, using a stack, I've wrote the code for it:
```
var leftBraces="([{";
var rightBraces=")]}";
function checkBraces(braces) {
var ok=true;
var stack=[];
for(var i=0; i<braces.length && ok; i++) {
var brace=braces[i];
if(leftBraces.includes(brace)) stack.push(brace);
else {
var ... | ```
function validBraces(braces){
let par =0;
let bra =0;
let cur =0;
for(let i =0; i<braces.length; i++){
if(braces[i]==="("){
par++;
}
if(braces[i]===")"){
par--;
}
if(braces[i]==="["){
bra++;
}
if(braces[i]===... |
62,544,782 | ```
app.post(' /', urlencodedParser, function(req, res) {
res.render('load', {data: req.body});
var token = req.body.token;
require('./loader.js')
});
```
How can I provide variable "token" to loader.js? | 2020/06/23 | [
"https://Stackoverflow.com/questions/62544782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13802050/"
] | ```
function validBraces(braces){
let par =0;
let bra =0;
let cur =0;
for(let i =0; i<braces.length; i++){
if(braces[i]==="("){
par++;
}
if(braces[i]===")"){
par--;
}
if(braces[i]==="["){
bra++;
}
if(braces[i]===... | Here is my solution:
```
var isValid = function (s) {
let charMap = new Map();
for (let i = 0; i < s.length; i++) {
charMap.set(s[i], i);
}
return Boolean(
charMap.get("(") < charMap.get(")") &&
charMap.get("(") % 2 != charMap.get(")") % 2 &&
charMap.get("{") < charMap.get("}") &&
charMap... |
62,544,782 | ```
app.post(' /', urlencodedParser, function(req, res) {
res.render('load', {data: req.body});
var token = req.body.token;
require('./loader.js')
});
```
How can I provide variable "token" to loader.js? | 2020/06/23 | [
"https://Stackoverflow.com/questions/62544782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13802050/"
] | As Dave suggested, using a stack, I've wrote the code for it:
```
var leftBraces="([{";
var rightBraces=")]}";
function checkBraces(braces) {
var ok=true;
var stack=[];
for(var i=0; i<braces.length && ok; i++) {
var brace=braces[i];
if(leftBraces.includes(brace)) stack.push(brace);
else {
var ... | Here is my solution:
```
var isValid = function (s) {
let charMap = new Map();
for (let i = 0; i < s.length; i++) {
charMap.set(s[i], i);
}
return Boolean(
charMap.get("(") < charMap.get(")") &&
charMap.get("(") % 2 != charMap.get(")") % 2 &&
charMap.get("{") < charMap.get("}") &&
charMap... |
84,742 | Let $f$ and $g$ be complex rational functions (of degree $\geq 2$ if that helps). What can be said about the relationship between $J(fg)$ and $J(gf)$, the Julia sets of the composite functions $f \circ g$ and $g \circ f$?
If I'm not mistaken, $f$ restricts to a map $J(gf) \to J(fg)$, and $g$ restricts to a map $J(fg) ... | 2012/01/02 | [
"https://mathoverflow.net/questions/84742",
"https://mathoverflow.net",
"https://mathoverflow.net/users/586/"
] | I'm not sure if this is helpful, but here is an example. The following picture shows the filled Julia set for $z^6 - 1$.

and the following picture shows the filled Julia set for $(z^2-1)^3$:

This is the case where $f(z) = z^2 - 1$... | Hy
I'm not shure that your restriction map $f: J(gf)\rightarrow J(fg)$ is right.
Insted of looking at Julia set it is equivalent to look at Fatou set where is more natural work with mapings. Since you've put $f:\{(gf)^n\}\_n \rightarrow \{(fg)^n\}\_n$ it clearly does not work. Insted you have to use conjugation $f\circ... |
84,742 | Let $f$ and $g$ be complex rational functions (of degree $\geq 2$ if that helps). What can be said about the relationship between $J(fg)$ and $J(gf)$, the Julia sets of the composite functions $f \circ g$ and $g \circ f$?
If I'm not mistaken, $f$ restricts to a map $J(gf) \to J(fg)$, and $g$ restricts to a map $J(fg) ... | 2012/01/02 | [
"https://mathoverflow.net/questions/84742",
"https://mathoverflow.net",
"https://mathoverflow.net/users/586/"
] | I'm not sure if this is helpful, but here is an example. The following picture shows the filled Julia set for $z^6 - 1$.

and the following picture shows the filled Julia set for $(z^2-1)^3$:

This is the case where $f(z) = z^2 - 1$... | Answer. $J(fg)$ is the full $g$-preimage of $J(gf)$. (And vice versa with interchange of
$f$ and $g$).
Proof. Let $A=fg$ and $B=gf$. Then we have a semi-conjugacy $gA=Bg$.
Now it is a general fact, that whenever you have such a semi-conjugacy (of rational functions)
the Julia set of $A$ is the $g$-preimage of the Jul... |
84,742 | Let $f$ and $g$ be complex rational functions (of degree $\geq 2$ if that helps). What can be said about the relationship between $J(fg)$ and $J(gf)$, the Julia sets of the composite functions $f \circ g$ and $g \circ f$?
If I'm not mistaken, $f$ restricts to a map $J(gf) \to J(fg)$, and $g$ restricts to a map $J(fg) ... | 2012/01/02 | [
"https://mathoverflow.net/questions/84742",
"https://mathoverflow.net",
"https://mathoverflow.net/users/586/"
] | Answer. $J(fg)$ is the full $g$-preimage of $J(gf)$. (And vice versa with interchange of
$f$ and $g$).
Proof. Let $A=fg$ and $B=gf$. Then we have a semi-conjugacy $gA=Bg$.
Now it is a general fact, that whenever you have such a semi-conjugacy (of rational functions)
the Julia set of $A$ is the $g$-preimage of the Jul... | Hy
I'm not shure that your restriction map $f: J(gf)\rightarrow J(fg)$ is right.
Insted of looking at Julia set it is equivalent to look at Fatou set where is more natural work with mapings. Since you've put $f:\{(gf)^n\}\_n \rightarrow \{(fg)^n\}\_n$ it clearly does not work. Insted you have to use conjugation $f\circ... |
12,345,134 | (Is there any way to write SQL statement that if this statement cannot retrieve data (because some part of its table was null) then use the other SQL statement or make it show only data that available ?)
I have SQL statement to show the production lot and each of their latest activity which show below ...
```
q_maxda... | 2012/09/10 | [
"https://Stackoverflow.com/questions/12345134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/947322/"
] | You could use @@ROWCOUNT to determine how many rows are returned by your sql1. If rowcount is 0, then probably it returned nothing, so use sql2
You could also use IF NOT EXISTS | There are several ways to accomplish this.
Oracle PL/SQL and MSSQL T-SQL, for example, both allow "if-then-else".
The *portable* way, however, is to use the ANSI-SQL "case" statement. For example:
* [SQL Case Statement Syntax?](https://stackoverflow.com/questions/4622/sql-case-statement-syntax)
* <http://www.codepr... |
12,345,134 | (Is there any way to write SQL statement that if this statement cannot retrieve data (because some part of its table was null) then use the other SQL statement or make it show only data that available ?)
I have SQL statement to show the production lot and each of their latest activity which show below ...
```
q_maxda... | 2012/09/10 | [
"https://Stackoverflow.com/questions/12345134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/947322/"
] | You could use @@ROWCOUNT to determine how many rows are returned by your sql1. If rowcount is 0, then probably it returned nothing, so use sql2
You could also use IF NOT EXISTS | I think the easiest way would be to write stored procedure you can check below link
<http://www.databasejournal.com/features/msaccess/article.php/3407531/How-to-Execute-SQL-Stored-Procedures-from-Microsoft-Access.htm>
Happy coding!!! |
8,896,349 | I created a singly linked list in java. This list has the property that the first item pushed is the last item that will be popped.
The popping performance is nice compared to the Queue. I like to improve the push performance. Instead of prepending I also tried appending in the push method, this didn't improve the pe... | 2012/01/17 | [
"https://Stackoverflow.com/questions/8896349",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/730277/"
] | If you look in the schema of the Date module you will find something like
```
'day' => array(
'type' => 'datetime',
'mysql_type' => 'datetime',
)
```
Actually the answer of Clive was the one i picked first but later gave me problems with the Views module.
This implementation of the Date module save my day | The following works for me (Drupal 7.10):
```
'day' => array(
'mysql_type' => 'DATETIME',
'not null' => TRUE,
)
```
(notice the `mysql_type` key *instead of* `type`)
From the [Schema docs](http://api.drupal.org/api/drupal/includes--database--schema.inc/group/schemaapi/7):
> If you need to use a record type not... |
8,896,349 | I created a singly linked list in java. This list has the property that the first item pushed is the last item that will be popped.
The popping performance is nice compared to the Queue. I like to improve the push performance. Instead of prepending I also tried appending in the push method, this didn't improve the pe... | 2012/01/17 | [
"https://Stackoverflow.com/questions/8896349",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/730277/"
] | The following works for me (Drupal 7.10):
```
'day' => array(
'mysql_type' => 'DATETIME',
'not null' => TRUE,
)
```
(notice the `mysql_type` key *instead of* `type`)
From the [Schema docs](http://api.drupal.org/api/drupal/includes--database--schema.inc/group/schemaapi/7):
> If you need to use a record type not... | The Date contrib module has:
```
function date_field_schema($field) {
$db_columns = array();
switch ($field['type']) {
case 'datestamp':
$db_columns['value'] = array(
'type' => 'int',
'not null' => FALSE,
'sortable' => TRUE,
'views' => TRUE,
);
break;
case... |
8,896,349 | I created a singly linked list in java. This list has the property that the first item pushed is the last item that will be popped.
The popping performance is nice compared to the Queue. I like to improve the push performance. Instead of prepending I also tried appending in the push method, this didn't improve the pe... | 2012/01/17 | [
"https://Stackoverflow.com/questions/8896349",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/730277/"
] | If you look in the schema of the Date module you will find something like
```
'day' => array(
'type' => 'datetime',
'mysql_type' => 'datetime',
)
```
Actually the answer of Clive was the one i picked first but later gave me problems with the Views module.
This implementation of the Date module save my day | The Date contrib module has:
```
function date_field_schema($field) {
$db_columns = array();
switch ($field['type']) {
case 'datestamp':
$db_columns['value'] = array(
'type' => 'int',
'not null' => FALSE,
'sortable' => TRUE,
'views' => TRUE,
);
break;
case... |
207,468 | I am stuck with placing Label on the Grid lines. Below is the data grid on the map. I created the grid using data driven pages.
After I turned on the Label, the labelling appeared inside the grid. I want it to be placed on the line itself with a little buffer around it. I have explored the placement properties of the g... | 2016/08/18 | [
"https://gis.stackexchange.com/questions/207468",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/64017/"
] | Just a hint if you can't find the `Polygonize` tool. In my QGIS 2.18.3 installation (Windows) I could not find the `Polygonize` tool at `Vector geometry tools` within the Toolbox. It took me some time to realize that I needed to install the `python-shapely` library with OSGeo4W (thanks [Nick Hopton : Perfect Polygons i... | I had the same unwanted output and after doing some research it seems the cause can vary.
**My case was** I had some polyline layers with very, very small gaps (in which some fragments were formed by two or less nodes) (Figure 1 and Figure 2).
So, after directly running `Lines to polygons` tool, the algorithm would r... |
207,468 | I am stuck with placing Label on the Grid lines. Below is the data grid on the map. I created the grid using data driven pages.
After I turned on the Label, the labelling appeared inside the grid. I want it to be placed on the line itself with a little buffer around it. I have explored the placement properties of the g... | 2016/08/18 | [
"https://gis.stackexchange.com/questions/207468",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/64017/"
] | I had the same unwanted output and after doing some research it seems the cause can vary.
**My case was** I had some polyline layers with very, very small gaps (in which some fragments were formed by two or less nodes) (Figure 1 and Figure 2).
So, after directly running `Lines to polygons` tool, the algorithm would r... | If there are no holes, I would create a scratch layer with a single polygon big enough to cover your whole area. Then I would intersect it with your lines-to-polygons result and split it further as necessary. |
207,468 | I am stuck with placing Label on the Grid lines. Below is the data grid on the map. I created the grid using data driven pages.
After I turned on the Label, the labelling appeared inside the grid. I want it to be placed on the line itself with a little buffer around it. I have explored the placement properties of the g... | 2016/08/18 | [
"https://gis.stackexchange.com/questions/207468",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/64017/"
] | The ["Polygonize"](https://docs.qgis.org/3.16/en/docs/user_manual/processing_algs/qgis/vectorgeometry.html#polygonize) tool from the Processing toolbox still works fine for me on simple lines:
[](https://i.stack.imgur.com/nQzi9.png)
It is however nec... | If there are no holes, I would create a scratch layer with a single polygon big enough to cover your whole area. Then I would intersect it with your lines-to-polygons result and split it further as necessary. |
207,468 | I am stuck with placing Label on the Grid lines. Below is the data grid on the map. I created the grid using data driven pages.
After I turned on the Label, the labelling appeared inside the grid. I want it to be placed on the line itself with a little buffer around it. I have explored the placement properties of the g... | 2016/08/18 | [
"https://gis.stackexchange.com/questions/207468",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/64017/"
] | The ["Polygonize"](https://docs.qgis.org/3.16/en/docs/user_manual/processing_algs/qgis/vectorgeometry.html#polygonize) tool from the Processing toolbox still works fine for me on simple lines:
[](https://i.stack.imgur.com/nQzi9.png)
It is however nec... | I had the same unwanted output and after doing some research it seems the cause can vary.
**My case was** I had some polyline layers with very, very small gaps (in which some fragments were formed by two or less nodes) (Figure 1 and Figure 2).
So, after directly running `Lines to polygons` tool, the algorithm would r... |
207,468 | I am stuck with placing Label on the Grid lines. Below is the data grid on the map. I created the grid using data driven pages.
After I turned on the Label, the labelling appeared inside the grid. I want it to be placed on the line itself with a little buffer around it. I have explored the placement properties of the g... | 2016/08/18 | [
"https://gis.stackexchange.com/questions/207468",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/64017/"
] | Just a hint if you can't find the `Polygonize` tool. In my QGIS 2.18.3 installation (Windows) I could not find the `Polygonize` tool at `Vector geometry tools` within the Toolbox. It took me some time to realize that I needed to install the `python-shapely` library with OSGeo4W (thanks [Nick Hopton : Perfect Polygons i... | If there are no holes, I would create a scratch layer with a single polygon big enough to cover your whole area. Then I would intersect it with your lines-to-polygons result and split it further as necessary. |
207,468 | I am stuck with placing Label on the Grid lines. Below is the data grid on the map. I created the grid using data driven pages.
After I turned on the Label, the labelling appeared inside the grid. I want it to be placed on the line itself with a little buffer around it. I have explored the placement properties of the g... | 2016/08/18 | [
"https://gis.stackexchange.com/questions/207468",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/64017/"
] | The ["Polygonize"](https://docs.qgis.org/3.16/en/docs/user_manual/processing_algs/qgis/vectorgeometry.html#polygonize) tool from the Processing toolbox still works fine for me on simple lines:
[](https://i.stack.imgur.com/nQzi9.png)
It is however nec... | Looking at your image I would assume that each line does not fully encompass an area, the lines are just acting as fences and not reconnecting back at the beginning. Your polygons are being created from the ends of the lines so the 'lines to polygons' tool is working fine, its the data thats the issue.
I'm afraid the ... |
207,468 | I am stuck with placing Label on the Grid lines. Below is the data grid on the map. I created the grid using data driven pages.
After I turned on the Label, the labelling appeared inside the grid. I want it to be placed on the line itself with a little buffer around it. I have explored the placement properties of the g... | 2016/08/18 | [
"https://gis.stackexchange.com/questions/207468",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/64017/"
] | If the polylines overlap each other, `Polygonize` tool cannot handle it as follows:
[](https://i.stack.imgur.com/A4rss.png)
However `Lines to polygons` tool works as expected as follows:
[](https://i.stack.imgur.com/A4rss.png)
However `Lines to polygons` tool works as expected as follows:
[ tool from the Processing toolbox still works fine for me on simple lines:
[](https://i.stack.imgur.com/nQzi9.png)
It is however nec... | If the polylines overlap each other, `Polygonize` tool cannot handle it as follows:
[](https://i.stack.imgur.com/A4rss.png)
However `Lines to polygons` tool works as expected as follows:
[ tool from the Processing toolbox still works fine for me on simple lines:
[](https://i.stack.imgur.com/nQzi9.png)
It is however nec... | Just a hint if you can't find the `Polygonize` tool. In my QGIS 2.18.3 installation (Windows) I could not find the `Polygonize` tool at `Vector geometry tools` within the Toolbox. It took me some time to realize that I needed to install the `python-shapely` library with OSGeo4W (thanks [Nick Hopton : Perfect Polygons i... |
63,198,258 | [](https://i.stack.imgur.com/Xx84o.png)I am working on Firstcry .com website for automation. After searched for Shoes int he search box, I need to scroll down to the bottom of the page to click "View All products" link. BUt scrolling is not happening..... | 2020/07/31 | [
"https://Stackoverflow.com/questions/63198258",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12356755/"
] | After searching for Shoes in the search box and selecting the first suggestion, to scroll down to the bottom of the page to click on the element with text as **View All Products** you need to induce [WebDriverWait](https://stackoverflow.com/questions/48989049/selenium-how-selenium-identifies-elements-visible-or-not-is-... | // following code to scroll until element is visible and click that element
```
JavascriptExecutor js = (JavascriptExecutor) driver;
WebElement viewALL = Driver.findElement(By.xpath(Viewall));
js.executeScript("arguments[0].scrollIntoView();", viewALL);
viewALL.click();
}
```
} |
63,198,258 | [](https://i.stack.imgur.com/Xx84o.png)I am working on Firstcry .com website for automation. After searched for Shoes int he search box, I need to scroll down to the bottom of the page to click "View All products" link. BUt scrolling is not happening..... | 2020/07/31 | [
"https://Stackoverflow.com/questions/63198258",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12356755/"
] | Below code worked for me:
```
WebDriver Driver = new ChromeDriver();
Driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
Driver.manage().window().maximize();
String url = "https://www.firstcry.com/";
Driver.get(url);
WebElement searchbox=Driver.findElement(By.id("search_box"));
... | // following code to scroll until element is visible and click that element
```
JavascriptExecutor js = (JavascriptExecutor) driver;
WebElement viewALL = Driver.findElement(By.xpath(Viewall));
js.executeScript("arguments[0].scrollIntoView();", viewALL);
viewALL.click();
}
```
} |
9,221,970 | I want to use embedded HSQLDB file-based tables in my production system, but I heard that it had some issues with data corruption before. So my question is - are new versions of it (2.2.8) vulnerable to data corruption issues, for example when the machine lost power or java process was killed? And are there some config... | 2012/02/10 | [
"https://Stackoverflow.com/questions/9221970",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/486057/"
] | HSQLDB is designed to recover the database after a machine or java process crash.
Over the years, persistence has been improved. Currently there is no known issue. With the default settings, in case of a crash, you may lose only the changes made to the database in the last half second. And you can reduce this to zero... | Yes, hsqldb **may** corrupt data even without suddenly dying process. Be prepared to build an automatic backup/recovery system and sometimes tools to fix corrupted data.
My experiences of HSQL upsies:
* Non unique values in a column set as unique. (hsql 1.8).
* Corrupted all non-ascii characters in all varchar column... |
49,700,912 | In the following example, why should we favour using `f1` over `f2`? Is it more efficient in some sense? For someone used to base R, it seems more natural to use the "substitute + eval" option.
```
library(dplyr)
d = data.frame(x = 1:5,
y = rnorm(5))
# using enquo + !!
f1 = function(mydata, myvar) {
... | 2018/04/06 | [
"https://Stackoverflow.com/questions/49700912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5443023/"
] | I want to give an answer that is independent of `dplyr`, because there is a very clear advantage to using `enquo` over `substitute`. Both look in the calling environment of a function to identify the expression that was given to that function. The difference is that `substitute()` does it only once, while `!!enquo()` w... | Imagine there is a different x you want to multiply:
```
> x <- 3
> f1(d, !!x)
x y two_y
1 1 -2.488894875 6
2 2 -1.133517746 6
3 3 -1.024834108 6
4 4 0.730537366 6
5 5 -1.325431756 6
```
vs without the `!!`:
```
> f1(d, x)
x y two_y
1 1 -2.488894875 2
2 2 -1.133517... |
49,700,912 | In the following example, why should we favour using `f1` over `f2`? Is it more efficient in some sense? For someone used to base R, it seems more natural to use the "substitute + eval" option.
```
library(dplyr)
d = data.frame(x = 1:5,
y = rnorm(5))
# using enquo + !!
f1 = function(mydata, myvar) {
... | 2018/04/06 | [
"https://Stackoverflow.com/questions/49700912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5443023/"
] | Imagine there is a different x you want to multiply:
```
> x <- 3
> f1(d, !!x)
x y two_y
1 1 -2.488894875 6
2 2 -1.133517746 6
3 3 -1.024834108 6
4 4 0.730537366 6
5 5 -1.325431756 6
```
vs without the `!!`:
```
> f1(d, x)
x y two_y
1 1 -2.488894875 2
2 2 -1.133517... | To add some nuance, these things are not necessarily that complex in base R.
It is important to remember to use `eval.parent()` when relevant to evaluate substituted arguments in the right environment, if you use `eval.parent()` properly the expression in nested calls will find their ways. If you don't you might disco... |
49,700,912 | In the following example, why should we favour using `f1` over `f2`? Is it more efficient in some sense? For someone used to base R, it seems more natural to use the "substitute + eval" option.
```
library(dplyr)
d = data.frame(x = 1:5,
y = rnorm(5))
# using enquo + !!
f1 = function(mydata, myvar) {
... | 2018/04/06 | [
"https://Stackoverflow.com/questions/49700912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5443023/"
] | I want to give an answer that is independent of `dplyr`, because there is a very clear advantage to using `enquo` over `substitute`. Both look in the calling environment of a function to identify the expression that was given to that function. The difference is that `substitute()` does it only once, while `!!enquo()` w... | `enquo()` and `!!` also allows you to program with other `dplyr` verbs such as `group_by` and `select`. I'm not sure if `substitute` and `eval` can do that. Take a look at this example where I modify your data frame a little bit
```
library(dplyr)
set.seed(1234)
d = data.frame(x = c(1, 1, 2, 2, 3),
y =... |
49,700,912 | In the following example, why should we favour using `f1` over `f2`? Is it more efficient in some sense? For someone used to base R, it seems more natural to use the "substitute + eval" option.
```
library(dplyr)
d = data.frame(x = 1:5,
y = rnorm(5))
# using enquo + !!
f1 = function(mydata, myvar) {
... | 2018/04/06 | [
"https://Stackoverflow.com/questions/49700912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5443023/"
] | `enquo()` and `!!` also allows you to program with other `dplyr` verbs such as `group_by` and `select`. I'm not sure if `substitute` and `eval` can do that. Take a look at this example where I modify your data frame a little bit
```
library(dplyr)
set.seed(1234)
d = data.frame(x = c(1, 1, 2, 2, 3),
y =... | To add some nuance, these things are not necessarily that complex in base R.
It is important to remember to use `eval.parent()` when relevant to evaluate substituted arguments in the right environment, if you use `eval.parent()` properly the expression in nested calls will find their ways. If you don't you might disco... |
49,700,912 | In the following example, why should we favour using `f1` over `f2`? Is it more efficient in some sense? For someone used to base R, it seems more natural to use the "substitute + eval" option.
```
library(dplyr)
d = data.frame(x = 1:5,
y = rnorm(5))
# using enquo + !!
f1 = function(mydata, myvar) {
... | 2018/04/06 | [
"https://Stackoverflow.com/questions/49700912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5443023/"
] | I want to give an answer that is independent of `dplyr`, because there is a very clear advantage to using `enquo` over `substitute`. Both look in the calling environment of a function to identify the expression that was given to that function. The difference is that `substitute()` does it only once, while `!!enquo()` w... | To add some nuance, these things are not necessarily that complex in base R.
It is important to remember to use `eval.parent()` when relevant to evaluate substituted arguments in the right environment, if you use `eval.parent()` properly the expression in nested calls will find their ways. If you don't you might disco... |
8,615 | OK i have created a content type. But what will be the url that will show the list of all posts in specific content type?
Basically I want to make a link or a menu item that will show all posts in specific content type but off course paginated. | 2011/08/05 | [
"https://drupal.stackexchange.com/questions/8615",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/1403/"
] | You will have to use the [Views](http://drupal.org/project/views) module to create list filtering for a specific content type.
The Views module provides a flexible method for Drupal site designers to control how lists and tables of content (nodes in Views 1, almost anything in Views 2) are presented. Traditionally, Dr... | If you are referring to a URL that every user with permission to view published nodes would see, then a Drupal fresh installation doesn't have such a URL. There is a URL that only users with the permission to administer nodes can see, and that shows the list of all the nodes, which can then be filtered by content type ... |
55,243,002 | I'm building an MSFlow which sends a SharePoint pic lib pic to a just-trained CustomVision Classifier, which then sends back a label (eg "Green", "Red", etc);
Challenges:
* My MSFlow "CustomVision" action is failing, stating "there's no default iteration for this project. please provide an Iteration ID"
* There is *... | 2019/03/19 | [
"https://Stackoverflow.com/questions/55243002",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7651124/"
] | Turns out the IterationID can be found as follows:
Browse to your custom vision projects page URL
(eg <https://www.customvision.ai/projects>)
=> browser will display a set of "tiles" - one for each of your existing projects;
Navigate (click) on your particular project for which you seek the IterationID;
=> browse... | In the custom vision portal [home](https://www.customvision.ai), Select the project you are using, then select the Performance Tab. On the left side of the page you would see Iterations. Select the Iteration that you want and select Prediction URL. This will open a new dialog which gives the URL's for image URL and ima... |
10,128,812 | Suppose we have the following markup for navigation bar using Twitter Bootstrap 2.0.
```
<div class="navbar navbar-fixed-top">
<div class="navbar-inner pull-center">
<ul class="nav">
<li class="active"><a href="#">HOME</a></li>
<li><a href="#contact">CONTACT</a></li>
<... | 2012/04/12 | [
"https://Stackoverflow.com/questions/10128812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/876181/"
] | Override the width of the container within the navbar from `auto` to `960px`.
```
.navbar-inner .container {width:960px;}
``` | Just using the container class as per <http://twitter.github.com/bootstrap/components.html#navbar> is centering my nav; however, it is fixed width and the formatting is off (the height of the nav bar is increased and its very possible something I'm doing wrong).
It would be nice to have the nav centered in a fluid, pe... |
10,128,812 | Suppose we have the following markup for navigation bar using Twitter Bootstrap 2.0.
```
<div class="navbar navbar-fixed-top">
<div class="navbar-inner pull-center">
<ul class="nav">
<li class="active"><a href="#">HOME</a></li>
<li><a href="#contact">CONTACT</a></li>
<... | 2012/04/12 | [
"https://Stackoverflow.com/questions/10128812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/876181/"
] | Override the width of the container within the navbar from `auto` to `960px`.
```
.navbar-inner .container {width:960px;}
``` | I have found this useful and clean:
```
<div class="navbar navbar-fixed-top">
<div class="container">
<ul class="nav">
<li class="active"><a href="#">HOME</a></li>
<li><a href="#contact">CONTACT</a></li>
</ul>
</div>
</div>
```
where, css is:
```
.containe... |
10,128,812 | Suppose we have the following markup for navigation bar using Twitter Bootstrap 2.0.
```
<div class="navbar navbar-fixed-top">
<div class="navbar-inner pull-center">
<ul class="nav">
<li class="active"><a href="#">HOME</a></li>
<li><a href="#contact">CONTACT</a></li>
<... | 2012/04/12 | [
"https://Stackoverflow.com/questions/10128812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/876181/"
] | Override the width of the container within the navbar from `auto` to `960px`.
```
.navbar-inner .container {width:960px;}
``` | ```
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</div>
</div>
``` |
10,128,812 | Suppose we have the following markup for navigation bar using Twitter Bootstrap 2.0.
```
<div class="navbar navbar-fixed-top">
<div class="navbar-inner pull-center">
<ul class="nav">
<li class="active"><a href="#">HOME</a></li>
<li><a href="#contact">CONTACT</a></li>
<... | 2012/04/12 | [
"https://Stackoverflow.com/questions/10128812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/876181/"
] | Override the width of the container within the navbar from `auto` to `960px`.
```
.navbar-inner .container {width:960px;}
``` | To align it in the center with a dynamic width, I used the following:
HTML:
```
<div class="navbar">
<div class="navbar-inner">
<ul class="nav">
....
</ul>
</div>
</div>
```
CSS:
```
.navbar .navbar-inner {
text-align: center;
}
.navbar .navbar-inner .nav {
float: none;
display:inline... |
10,128,812 | Suppose we have the following markup for navigation bar using Twitter Bootstrap 2.0.
```
<div class="navbar navbar-fixed-top">
<div class="navbar-inner pull-center">
<ul class="nav">
<li class="active"><a href="#">HOME</a></li>
<li><a href="#contact">CONTACT</a></li>
<... | 2012/04/12 | [
"https://Stackoverflow.com/questions/10128812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/876181/"
] | Just using the container class as per <http://twitter.github.com/bootstrap/components.html#navbar> is centering my nav; however, it is fixed width and the formatting is off (the height of the nav bar is increased and its very possible something I'm doing wrong).
It would be nice to have the nav centered in a fluid, pe... | I have found this useful and clean:
```
<div class="navbar navbar-fixed-top">
<div class="container">
<ul class="nav">
<li class="active"><a href="#">HOME</a></li>
<li><a href="#contact">CONTACT</a></li>
</ul>
</div>
</div>
```
where, css is:
```
.containe... |
10,128,812 | Suppose we have the following markup for navigation bar using Twitter Bootstrap 2.0.
```
<div class="navbar navbar-fixed-top">
<div class="navbar-inner pull-center">
<ul class="nav">
<li class="active"><a href="#">HOME</a></li>
<li><a href="#contact">CONTACT</a></li>
<... | 2012/04/12 | [
"https://Stackoverflow.com/questions/10128812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/876181/"
] | ```
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</div>
</div>
``` | Just using the container class as per <http://twitter.github.com/bootstrap/components.html#navbar> is centering my nav; however, it is fixed width and the formatting is off (the height of the nav bar is increased and its very possible something I'm doing wrong).
It would be nice to have the nav centered in a fluid, pe... |
10,128,812 | Suppose we have the following markup for navigation bar using Twitter Bootstrap 2.0.
```
<div class="navbar navbar-fixed-top">
<div class="navbar-inner pull-center">
<ul class="nav">
<li class="active"><a href="#">HOME</a></li>
<li><a href="#contact">CONTACT</a></li>
<... | 2012/04/12 | [
"https://Stackoverflow.com/questions/10128812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/876181/"
] | To align it in the center with a dynamic width, I used the following:
HTML:
```
<div class="navbar">
<div class="navbar-inner">
<ul class="nav">
....
</ul>
</div>
</div>
```
CSS:
```
.navbar .navbar-inner {
text-align: center;
}
.navbar .navbar-inner .nav {
float: none;
display:inline... | Just using the container class as per <http://twitter.github.com/bootstrap/components.html#navbar> is centering my nav; however, it is fixed width and the formatting is off (the height of the nav bar is increased and its very possible something I'm doing wrong).
It would be nice to have the nav centered in a fluid, pe... |
10,128,812 | Suppose we have the following markup for navigation bar using Twitter Bootstrap 2.0.
```
<div class="navbar navbar-fixed-top">
<div class="navbar-inner pull-center">
<ul class="nav">
<li class="active"><a href="#">HOME</a></li>
<li><a href="#contact">CONTACT</a></li>
<... | 2012/04/12 | [
"https://Stackoverflow.com/questions/10128812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/876181/"
] | ```
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</div>
</div>
``` | I have found this useful and clean:
```
<div class="navbar navbar-fixed-top">
<div class="container">
<ul class="nav">
<li class="active"><a href="#">HOME</a></li>
<li><a href="#contact">CONTACT</a></li>
</ul>
</div>
</div>
```
where, css is:
```
.containe... |
10,128,812 | Suppose we have the following markup for navigation bar using Twitter Bootstrap 2.0.
```
<div class="navbar navbar-fixed-top">
<div class="navbar-inner pull-center">
<ul class="nav">
<li class="active"><a href="#">HOME</a></li>
<li><a href="#contact">CONTACT</a></li>
<... | 2012/04/12 | [
"https://Stackoverflow.com/questions/10128812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/876181/"
] | To align it in the center with a dynamic width, I used the following:
HTML:
```
<div class="navbar">
<div class="navbar-inner">
<ul class="nav">
....
</ul>
</div>
</div>
```
CSS:
```
.navbar .navbar-inner {
text-align: center;
}
.navbar .navbar-inner .nav {
float: none;
display:inline... | I have found this useful and clean:
```
<div class="navbar navbar-fixed-top">
<div class="container">
<ul class="nav">
<li class="active"><a href="#">HOME</a></li>
<li><a href="#contact">CONTACT</a></li>
</ul>
</div>
</div>
```
where, css is:
```
.containe... |
50,398,520 | How can I assign variable to primeng TurboTable ColGroup colspan property.
```
<ng-template pTemplate="header">
<tr>
<th rowspan="3">Brand</th>
<th colspan="4">Sale Rate</th>
</tr>
<tr>
<th colspan="colSpanCount">Sales</th>
<th colspan="2">Profits</th>
</tr>
<tr>
... | 2018/05/17 | [
"https://Stackoverflow.com/questions/50398520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1530600/"
] | I think, I have found an answer myself. We can set [attr.colspan]="colSpanCount" property to set colspan dynamically.
```
<ng-template pTemplate="header">
<tr>
<th rowspan="3">Brand</th>
<th colspan="4">Sale Rate</th>
</tr>
<tr>
<th [attr.colspan]="colSpanCount">Sales</th>
<... | As you've discovered, you can change `colspan` to `[attr.colspan]`.
Another solution is to change `colspan` to `[colSpan]`.
[See this answer for a deeper explanation](https://stackoverflow.com/questions/35615751/why-is-colspan-not-a-known-native-attribute-in-angular-2) |
21,861,564 | I have a button that looks like this:
```
<button id="button-1" onclick="adjustValue(1, 1, 30, 1, 'user');">Test</button>
```
The function that I currently have with this button is working properly. However, what can I add to the function to allow it to edit the values of the onclick field?
```
function adjustValue... | 2014/02/18 | [
"https://Stackoverflow.com/questions/21861564",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3320550/"
] | If you only want to analyse a specific `TypeSymbol`, use pattern matching. Here is an example.
```
TypeSymbol t;
if (class(l,_) := t) {
println(l);
}
```
or in a comprehension
```
{ l | <_,class(l,_)> <- m3@types};
```
or as part of a lookup in a comprehension:
```
{ <v, l> | <_,v> <- m3@containment, isVariabl... | You could use the `containment` relation from the M3 model. All local variables are declared in the `declarations` relation, but they also appear in `containment`. If you want to get all the variables in a method `m`, you can have a look at `containment[m]` and filter on the `java+variable` scheme.
Interesting corner... |
863,638 | What is the name of a notation that looks as follows:
```
"1 2 9 8 4 6 + * / + *"
```
But is evaluated as "1 + 2 \* 9 / 8 + 4 \* 6"
**EDIT**: I do think it's RPN now and my eval above is incorrect (as it's supposed to be evaluated in the stack on the first occurrence of an operator after the first operand). | 2014/07/10 | [
"https://math.stackexchange.com/questions/863638",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/127071/"
] | The most likely explanation seems to be that you're misremembering the meaning of the notation, and that the interviewer actually was using [Reverse Polish notation](http://en.wikipedia.org/wiki/Reverse_Polish_notation). This notation, as given, is not used anywhere, while RPN is quite common for a lot of computer scie... | This is *almost* a version of [Polish notation](http://en.wikipedia.org/wiki/Polish_notation) called [Reverse](http://en.wikipedia.org/wiki/Reverse_Polish_notation) (or postfix) polish notation, but with the operators in inverted order. |
863,638 | What is the name of a notation that looks as follows:
```
"1 2 9 8 4 6 + * / + *"
```
But is evaluated as "1 + 2 \* 9 / 8 + 4 \* 6"
**EDIT**: I do think it's RPN now and my eval above is incorrect (as it's supposed to be evaluated in the stack on the first occurrence of an operator after the first operand). | 2014/07/10 | [
"https://math.stackexchange.com/questions/863638",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/127071/"
] | This is *almost* a version of [Polish notation](http://en.wikipedia.org/wiki/Polish_notation) called [Reverse](http://en.wikipedia.org/wiki/Reverse_Polish_notation) (or postfix) polish notation, but with the operators in inverted order. | "Not practical " or "unusual", because that "all args first then all ops" notation would only work if the operators used all have a unique arity. So what about a - operator?
Also one would pile up much memory, no intermediate reductions. |
863,638 | What is the name of a notation that looks as follows:
```
"1 2 9 8 4 6 + * / + *"
```
But is evaluated as "1 + 2 \* 9 / 8 + 4 \* 6"
**EDIT**: I do think it's RPN now and my eval above is incorrect (as it's supposed to be evaluated in the stack on the first occurrence of an operator after the first operand). | 2014/07/10 | [
"https://math.stackexchange.com/questions/863638",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/127071/"
] | The most likely explanation seems to be that you're misremembering the meaning of the notation, and that the interviewer actually was using [Reverse Polish notation](http://en.wikipedia.org/wiki/Reverse_Polish_notation). This notation, as given, is not used anywhere, while RPN is quite common for a lot of computer scie... | "Not practical " or "unusual", because that "all args first then all ops" notation would only work if the operators used all have a unique arity. So what about a - operator?
Also one would pile up much memory, no intermediate reductions. |
61,244,782 | in my code below, I have the option to call one of the two custom fields (swf or swf2), depending on my need:
```
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php if ( get_post_meta($post->ID, 'swf', true) ) { ?>
<?php $values = get_post_custom_values("swf"); echo $values[0]; ?>
<?php } els... | 2020/04/16 | [
"https://Stackoverflow.com/questions/61244782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7082272/"
] | There should be only one `else` in a `if` condition.
Your your code should be like this:
```
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php if ( get_post_meta($post->ID, 'swf', true) ) { ?>
<?php $values = get_post_custom_values("swf"); echo $values[0]; ?>
<?php } else if ( ... | Change your code like this to make it work
Use elseif in place of second else
```
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php if ( get_post_meta($post->ID, 'swf', true) ) { ?>
<?php $values = get_post_custom_values("swf"); echo $values[0]; ?>
<?php } else if { ?>
<?php $values = ge... |
53,092,651 | I have a backend system developed with C# .NET 4.0. I wish to embed the light weight web server Kestrel on it. Has anyone done so? or can point me to a direction how to do such?
Cheers! | 2018/10/31 | [
"https://Stackoverflow.com/questions/53092651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1034912/"
] | [**KestrelHttpServer** : "A cross platform web server for ASP.NET ***Core***."](https://github.com/aspnet/KestrelHttpServer). (emphasis added by me).
So that's no, and no. | I did it, but of course only by opening Kestrel which serves a .net core application as a background process. The .Net Framework app communicates with the .net core app via inter-process communication over a websocket on localhost. |
1,136,155 | If $x, y$ are coprime, then for any integer $a,b$ there is an integer $m$ such that:
$m \equiv a \;(\bmod\; x)$
$m \equiv b \;(\bmod\; y)$
I approached it like this:
Since they are coprime then
>
> $xi + yj = 1$
>
>
>
Then
$1 - yj = xi \;\text{ and } \; 1 - xi = yj $
Then
$1 \equiv yj \;(\bmod\; x) \;\te... | 2015/02/06 | [
"https://math.stackexchange.com/questions/1136155",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/110993/"
] | There are thre options here: either you are sloppy or the book is or both.
It is pretty easy to show the following fact:
>
> If $A$ and $B$ are square matrices, then $AB$ is invertible if and only if $A$ and $B$ are invertible.
>
>
>
Using this fact, the proof used in your book is "correct".
1. If the statement... | Assume for exemple $AB=I$.
Then $A$ and $B$ represent two linear maps $f$ and $g : \mathbb{R}^n \to \mathbb{R}^n$, $n$ is the size of the matrix.
Then you have $f\circ g= id$, which implies easily that $f$ is surjective and $g$ is injective (1). But in finite dimensional linear algebra, those facts are equivalent $f$ a... |
1,136,155 | If $x, y$ are coprime, then for any integer $a,b$ there is an integer $m$ such that:
$m \equiv a \;(\bmod\; x)$
$m \equiv b \;(\bmod\; y)$
I approached it like this:
Since they are coprime then
>
> $xi + yj = 1$
>
>
>
Then
$1 - yj = xi \;\text{ and } \; 1 - xi = yj $
Then
$1 \equiv yj \;(\bmod\; x) \;\te... | 2015/02/06 | [
"https://math.stackexchange.com/questions/1136155",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/110993/"
] | There are thre options here: either you are sloppy or the book is or both.
It is pretty easy to show the following fact:
>
> If $A$ and $B$ are square matrices, then $AB$ is invertible if and only if $A$ and $B$ are invertible.
>
>
>
Using this fact, the proof used in your book is "correct".
1. If the statement... | We assume that $AB = I$ and we want to prove that $BA$ will be $I$ as well. I'll prove by contradiction.
Let's assume that $AB = I$, but $BA = C \neq I$(a $C$ which is not the identity matrix). Then left-multiplying both sides by $A$ it gives $A(BA) = A(C)\,\,\, != A(I)$. Also since matrix multiplication is associativ... |
1,136,155 | If $x, y$ are coprime, then for any integer $a,b$ there is an integer $m$ such that:
$m \equiv a \;(\bmod\; x)$
$m \equiv b \;(\bmod\; y)$
I approached it like this:
Since they are coprime then
>
> $xi + yj = 1$
>
>
>
Then
$1 - yj = xi \;\text{ and } \; 1 - xi = yj $
Then
$1 \equiv yj \;(\bmod\; x) \;\te... | 2015/02/06 | [
"https://math.stackexchange.com/questions/1136155",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/110993/"
] | Assume for exemple $AB=I$.
Then $A$ and $B$ represent two linear maps $f$ and $g : \mathbb{R}^n \to \mathbb{R}^n$, $n$ is the size of the matrix.
Then you have $f\circ g= id$, which implies easily that $f$ is surjective and $g$ is injective (1). But in finite dimensional linear algebra, those facts are equivalent $f$ a... | We assume that $AB = I$ and we want to prove that $BA$ will be $I$ as well. I'll prove by contradiction.
Let's assume that $AB = I$, but $BA = C \neq I$(a $C$ which is not the identity matrix). Then left-multiplying both sides by $A$ it gives $A(BA) = A(C)\,\,\, != A(I)$. Also since matrix multiplication is associativ... |
24,906,073 | Below is the stacktrace of the error log I'm getting. If someone can tell what exactly could be causing this because as per the stacktrace I've everything in place.
```
Exception in thread "main" java.lang.NoClassDefFoundError: com/hp/hpl/jena/iri/IRIFactory
at net.rootdev.javardfa.uri.IRIResolver.<init>(IRIResolv... | 2014/07/23 | [
"https://Stackoverflow.com/questions/24906073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1289758/"
] | I got the reason, I've tried both java-rdfa version 0.4 and 0.5 snapshot but both of them refer to `com.hp.hpl.jena.iri.IRIFactory`, however in the current packaging IRIFactory is moved to package `org.apache.jena.iri.IRIFactory`. | com/hp/hpl/jena/iri/IRIFactory class is not in any of the JARs specified in the class path.
To find the whether the class IRIFactory is in any of the jar files in the CLASS\_PATH
1) In windows extract each jar file and check for the class name
2) In linux use "jar -tvf [jar-file-name] |grep "IRIFactory"
If none of t... |
25,098,825 | It's very strange, I cannot find any **standard** way with Ruby to copy a directory recursively while dereferencing symbolic links. The best I could find is `FindUtils.cp_r` but it only supports dereferencing the root src directory.
`copy_entry` is the same although documentation falsely shows that it has an option `d... | 2014/08/02 | [
"https://Stackoverflow.com/questions/25098825",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/520567/"
] | The standard way to recurse into directories is to use the [Find](http://www.ruby-doc.org/stdlib-2.1.2/libdoc/find/rdoc/index.html) class but I think you're going to have to write something. The built-in [FileUtils](http://www.ruby-doc.org/stdlib-2.1.2/libdoc/fileutils/rdoc/index.html) methods are building blocks for n... | Here's my implementation of `find -follow` in ruby:
<https://gist.github.com/akostadinov/05c2a976dc16ffee9cac>
I could have isolated it into a class or monkey patch Find but I decided to do it as a self-contained method. There might be room for improvement ~~because it doesn't work with jruby. If anybody has an idea,... |
25,258 | Is it possible to reconstruct a grid of polygones or polylines from the centroids?
I am looking for a arcGIS tool or script that will allow me to reconstruct a grid of polygons or polylines from their centroids.



```
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elap... | 2013/01/30 | [
"https://Stackoverflow.com/questions/14614374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/180509/"
] | You should call `mvn verify` instead of `mvn integration-test`.
Quoting the [Failsafe Plugin page](http://maven.apache.org/surefire/maven-failsafe-plugin/) (emphasis mine):
>
> The Failsafe Plugin is used during the integration-test and verify phases of the build lifecycle to execute the integration tests of an appl... | You should set the version of the maven-failsafe-plugin. For example to 2.14.1.
And your integration test classes must have ending "IntegrationTest", for example:
CustomDaoIntegrationTest |
16,392,975 | I am new to iphone can not understand how to parse this data so that, i will display the result in table view. Following data is result of AFHTTPRequestOperation when i call api of megento.
```
{
"callforprice_id" = 13;
country = Austria;
"created_time" = "2013-05-03 12:03:05";
emailid... | 2013/05/06 | [
"https://Stackoverflow.com/questions/16392975",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2311417/"
] | Try this in your code, it worked for me -
give an id to the element, to which you want to make transparent
for eg according to your code -
```
<div class="navbar-inner" id="nav1">
```
Then apply this in your css-
```
#nav1
{
background-color:#F00; /*whichever you want*/
opacity: 0.5; /*0.5 de... | ```
<nav class="navbar navbar-fixed-top navbar-light" style="background-color: transparent;">
<!--This should work just fine. it will make it transparent. hope i helped!-->
``` |
16,392,975 | I am new to iphone can not understand how to parse this data so that, i will display the result in table view. Following data is result of AFHTTPRequestOperation when i call api of megento.
```
{
"callforprice_id" = 13;
country = Austria;
"created_time" = "2013-05-03 12:03:05";
emailid... | 2013/05/06 | [
"https://Stackoverflow.com/questions/16392975",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2311417/"
] | ```
<nav class="navbar navbar-fixed-top navbar-light" style="background-color: transparent;">
<!--This should work just fine. it will make it transparent. hope i helped!-->
``` | For **Spring** + **Thymeleaf** (*boostrap*) project i usually use:
Inside css the following code
```
.navbar-inner {
background:transparent;
}
```
Inside the HTML the line
```
<nav class="navbar-inner">
``` |
16,392,975 | I am new to iphone can not understand how to parse this data so that, i will display the result in table view. Following data is result of AFHTTPRequestOperation when i call api of megento.
```
{
"callforprice_id" = 13;
country = Austria;
"created_time" = "2013-05-03 12:03:05";
emailid... | 2013/05/06 | [
"https://Stackoverflow.com/questions/16392975",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2311417/"
] | What you people are doing is unnecessary.
For transparent background, simply do:
```html
<div class="navbar">
// your navbar content
</div>
```
without class navbar-default or navbar-inverse. | ```html
<nav class="navbar navbar-expand-lg navbar-light fixed-top bg-transparent">
<a class="navbar-brand" href="#">Navbar w/ text</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="T... |
16,392,975 | I am new to iphone can not understand how to parse this data so that, i will display the result in table view. Following data is result of AFHTTPRequestOperation when i call api of megento.
```
{
"callforprice_id" = 13;
country = Austria;
"created_time" = "2013-05-03 12:03:05";
emailid... | 2013/05/06 | [
"https://Stackoverflow.com/questions/16392975",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2311417/"
] | ***Update 2019***
**Bootstrap 4 - The Navbar is transparent by default**
Most of the answers here are misleading because they relate to Bootstrap 3. **By default, the Bootstrap 4 Navbar is transparent**. Just remember to use `navbar-light` or `navbar-dark` so the link colors work against the contrast of the backgroun... | This works for 4.0.
```
<nav class="navbar navbar-expand-sm fixed-top navbar-light">
or
<nav class="navbar navbar-expand-lg fixed-top navbar-dark">
```
key item is ***fixed-top***, otherwise, white or default page background is displayed even if there is a image top.
***navbar-light*** gives dark letters, ***navbar-... |
16,392,975 | I am new to iphone can not understand how to parse this data so that, i will display the result in table view. Following data is result of AFHTTPRequestOperation when i call api of megento.
```
{
"callforprice_id" = 13;
country = Austria;
"created_time" = "2013-05-03 12:03:05";
emailid... | 2013/05/06 | [
"https://Stackoverflow.com/questions/16392975",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2311417/"
] | Add the bg-transparent class to the navbar.
```
<div class="bg-primary">
<div class="navbar navbar-dark bg-transparent">
...
</div>
</div>
``` | just add
**background-color: rgb(255, 255, 255, 0);**
to your navbar class |
16,392,975 | I am new to iphone can not understand how to parse this data so that, i will display the result in table view. Following data is result of AFHTTPRequestOperation when i call api of megento.
```
{
"callforprice_id" = 13;
country = Austria;
"created_time" = "2013-05-03 12:03:05";
emailid... | 2013/05/06 | [
"https://Stackoverflow.com/questions/16392975",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2311417/"
] | ***Update 2019***
**Bootstrap 4 - The Navbar is transparent by default**
Most of the answers here are misleading because they relate to Bootstrap 3. **By default, the Bootstrap 4 Navbar is transparent**. Just remember to use `navbar-light` or `navbar-dark` so the link colors work against the contrast of the backgroun... | ```html
<nav class="navbar navbar-expand-lg navbar-light fixed-top bg-transparent">
<a class="navbar-brand" href="#">Navbar w/ text</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="T... |
16,392,975 | I am new to iphone can not understand how to parse this data so that, i will display the result in table view. Following data is result of AFHTTPRequestOperation when i call api of megento.
```
{
"callforprice_id" = 13;
country = Austria;
"created_time" = "2013-05-03 12:03:05";
emailid... | 2013/05/06 | [
"https://Stackoverflow.com/questions/16392975",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2311417/"
] | Add the bg-transparent class to the navbar.
```
<div class="bg-primary">
<div class="navbar navbar-dark bg-transparent">
...
</div>
</div>
``` | ```html
<nav class="navbar navbar-expand-lg navbar-light fixed-top bg-transparent">
<a class="navbar-brand" href="#">Navbar w/ text</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="T... |
16,392,975 | I am new to iphone can not understand how to parse this data so that, i will display the result in table view. Following data is result of AFHTTPRequestOperation when i call api of megento.
```
{
"callforprice_id" = 13;
country = Austria;
"created_time" = "2013-05-03 12:03:05";
emailid... | 2013/05/06 | [
"https://Stackoverflow.com/questions/16392975",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2311417/"
] | Add the bg-transparent class to the navbar.
```
<div class="bg-primary">
<div class="navbar navbar-dark bg-transparent">
...
</div>
</div>
``` | Try this in your code, it worked for me -
give an id to the element, to which you want to make transparent
for eg according to your code -
```
<div class="navbar-inner" id="nav1">
```
Then apply this in your css-
```
#nav1
{
background-color:#F00; /*whichever you want*/
opacity: 0.5; /*0.5 de... |
16,392,975 | I am new to iphone can not understand how to parse this data so that, i will display the result in table view. Following data is result of AFHTTPRequestOperation when i call api of megento.
```
{
"callforprice_id" = 13;
country = Austria;
"created_time" = "2013-05-03 12:03:05";
emailid... | 2013/05/06 | [
"https://Stackoverflow.com/questions/16392975",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2311417/"
] | This works for 4.0.
```
<nav class="navbar navbar-expand-sm fixed-top navbar-light">
or
<nav class="navbar navbar-expand-lg fixed-top navbar-dark">
```
key item is ***fixed-top***, otherwise, white or default page background is displayed even if there is a image top.
***navbar-light*** gives dark letters, ***navbar-... | Test with `background-image: none`. That property will remove the `linear-gradient`.
You can see the result here: <http://jsfiddle.net/eugip9/8D36M/> |
16,392,975 | I am new to iphone can not understand how to parse this data so that, i will display the result in table view. Following data is result of AFHTTPRequestOperation when i call api of megento.
```
{
"callforprice_id" = 13;
country = Austria;
"created_time" = "2013-05-03 12:03:05";
emailid... | 2013/05/06 | [
"https://Stackoverflow.com/questions/16392975",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2311417/"
] | >
> Simply add this to your css :-
>
>
>
```
.navbar-inner {
background:transparent;
}
``` | ***Update 2019***
**Bootstrap 4 - The Navbar is transparent by default**
Most of the answers here are misleading because they relate to Bootstrap 3. **By default, the Bootstrap 4 Navbar is transparent**. Just remember to use `navbar-light` or `navbar-dark` so the link colors work against the contrast of the backgroun... |
8,169 | I remember reading a book in the 70s, so it could be YA. It is set on modern-day Earth, and the story is about a boy. His mother is sick (maybe cancer?) and he is socially awkward, so he doesn't have much self-esteem. He stumbles upon an old building (maybe a barn?) and somehow meets a person/creature who tells him tha... | 2011/12/24 | [
"https://scifi.stackexchange.com/questions/8169",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/3929/"
] | * If you mean, the luckiest, TVTropes has this to say:
>
> Whenever a poker game is shown in Star Trek: The Next Generation, you can bet that Riker will always turn out with a possible straight that he's bluffing about. Whether or not the bluff is called, though, depends on which would be more dramatically convenient... | Data seems the most able to fill that role given that he is shown to clean house with the players in "Time's Arrow". He mentions at some point during the series that he initially memorized virtually every book on the subject but found that the actual game was different than the mere "book" knowledge. Given that he can ... |
8,169 | I remember reading a book in the 70s, so it could be YA. It is set on modern-day Earth, and the story is about a boy. His mother is sick (maybe cancer?) and he is socially awkward, so he doesn't have much self-esteem. He stumbles upon an old building (maybe a barn?) and somehow meets a person/creature who tells him tha... | 2011/12/24 | [
"https://scifi.stackexchange.com/questions/8169",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/3929/"
] | Riker, Geordi, Troi, and Data all have bonuses going for them:
* Riker is great at bluffing, and has rather good luck
* Geordi could see through the back of the cards
* Troi is an empath, and can generally tell when someone is bluffing
* Data has memorized an immense number of games and can easily calculate probabilit... | Data seems the most able to fill that role given that he is shown to clean house with the players in "Time's Arrow". He mentions at some point during the series that he initially memorized virtually every book on the subject but found that the actual game was different than the mere "book" knowledge. Given that he can ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.