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 |
|---|---|---|---|---|---|
12,529,023 | I have a `<textarea>` in HTML. When I put cursor in it, it's not starting from the beginning, but is blinking in middle.
### HTML
```
<TD width="21%">
<textarea class="txtarea" style="height:30px;" rows="3" name="Text" Id="Text" value=""> </textarea>
</TD>
```
### CSS
```
.txtarea{
border-right: #646464 ;
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12529023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1495475/"
] | ```
<textarea class="txtarea" style="height:30px;" rows="3" name="Text" Id="Text" value=""> </textarea>
```
What you have is a space between `<textarea>` and `</textarea>` tags. | Textarea's opening and closing tag must be in same line because Whatever in between textarea tag it will considered as "value" of textarea.
Now for below code placeholder will also shown as expected.
```
<textarea
placeholder="Enter text here"
class="txtarea"
style="height:30px;"
rows="3"
name="Text"
id="... |
17,842,296 | I have the following excel table:
```
StartDate YTDActual
1/1/2013 100
2/1/2013 200
3/1/2013 99
4/1/2013 33
5/1/2013 45
6/1/2013 0
7/1/2013 0
```
Is there a formula that returns, for each StartDate, the associated value in YTDActual, if it is different than 0, otherwise it would return the last YTDAct... | 2013/07/24 | [
"https://Stackoverflow.com/questions/17842296",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/832783/"
] | This would do it:
```
Col A Col B Col C
StartDate YTDActual NewValue
1/1/2013 100 =if(B2<>0,B2,C1)
...
```
Then just drag down the formula in Column C | If your dates start at A2 and YTD Actual amounts start at B2 try this formula for C2 copied down
`=LOOKUP(2,1/(B$2:B2<>0),B$2:B2)`
that will give you the required results |
17,842,296 | I have the following excel table:
```
StartDate YTDActual
1/1/2013 100
2/1/2013 200
3/1/2013 99
4/1/2013 33
5/1/2013 45
6/1/2013 0
7/1/2013 0
```
Is there a formula that returns, for each StartDate, the associated value in YTDActual, if it is different than 0, otherwise it would return the last YTDAct... | 2013/07/24 | [
"https://Stackoverflow.com/questions/17842296",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/832783/"
] | If your dates start at A2 and YTD Actual amounts start at B2 try this formula for C2 copied down
`=LOOKUP(2,1/(B$2:B2<>0),B$2:B2)`
that will give you the required results | Is the new data going in a column next to YTDActual? What I am getting at here is does it need to reference the date or could it just be a column C with:
```
=if(B2=0,C1,B2)
```
This would return B2 if not zero or otherwise the cell above it, this could be entered in cell C2 then dragged down to cover the other cell... |
17,842,296 | I have the following excel table:
```
StartDate YTDActual
1/1/2013 100
2/1/2013 200
3/1/2013 99
4/1/2013 33
5/1/2013 45
6/1/2013 0
7/1/2013 0
```
Is there a formula that returns, for each StartDate, the associated value in YTDActual, if it is different than 0, otherwise it would return the last YTDAct... | 2013/07/24 | [
"https://Stackoverflow.com/questions/17842296",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/832783/"
] | If your dates start at A2 and YTD Actual amounts start at B2 try this formula for C2 copied down
`=LOOKUP(2,1/(B$2:B2<>0),B$2:B2)`
that will give you the required results | I ended up using this formula for the NewValue column:
```
=IF(INDEX(Availability[YTDActual], MATCH(B2, Availability[StartDate], 0)) <>0, INDEX(Availability[YTDActual], MATCH(B32, Availability[StartDate], 0)), INDEX(Availability[YTDActual],MATCH(0,Availability[YTDActual],0)-1))
```
where Availability is the name of ... |
17,842,296 | I have the following excel table:
```
StartDate YTDActual
1/1/2013 100
2/1/2013 200
3/1/2013 99
4/1/2013 33
5/1/2013 45
6/1/2013 0
7/1/2013 0
```
Is there a formula that returns, for each StartDate, the associated value in YTDActual, if it is different than 0, otherwise it would return the last YTDAct... | 2013/07/24 | [
"https://Stackoverflow.com/questions/17842296",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/832783/"
] | This would do it:
```
Col A Col B Col C
StartDate YTDActual NewValue
1/1/2013 100 =if(B2<>0,B2,C1)
...
```
Then just drag down the formula in Column C | Is the new data going in a column next to YTDActual? What I am getting at here is does it need to reference the date or could it just be a column C with:
```
=if(B2=0,C1,B2)
```
This would return B2 if not zero or otherwise the cell above it, this could be entered in cell C2 then dragged down to cover the other cell... |
17,842,296 | I have the following excel table:
```
StartDate YTDActual
1/1/2013 100
2/1/2013 200
3/1/2013 99
4/1/2013 33
5/1/2013 45
6/1/2013 0
7/1/2013 0
```
Is there a formula that returns, for each StartDate, the associated value in YTDActual, if it is different than 0, otherwise it would return the last YTDAct... | 2013/07/24 | [
"https://Stackoverflow.com/questions/17842296",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/832783/"
] | This would do it:
```
Col A Col B Col C
StartDate YTDActual NewValue
1/1/2013 100 =if(B2<>0,B2,C1)
...
```
Then just drag down the formula in Column C | I ended up using this formula for the NewValue column:
```
=IF(INDEX(Availability[YTDActual], MATCH(B2, Availability[StartDate], 0)) <>0, INDEX(Availability[YTDActual], MATCH(B32, Availability[StartDate], 0)), INDEX(Availability[YTDActual],MATCH(0,Availability[YTDActual],0)-1))
```
where Availability is the name of ... |
7,222,443 | I have a 9 million rows table and I'm struggling to handle all this data because of its sheer size.
What I want to do is add IMPORT a CSV to the table without overwriting data.
Before I would of done something like this; INSERT if not in(select email from tblName where source = "number" and email != "email") INTO (em... | 2011/08/28 | [
"https://Stackoverflow.com/questions/7222443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/761501/"
] | If you have unique keys on these fields you can use LOAD DATA INFILE with IGNORE option. It's faster then inserting row by row, and is faster then multi-insert as well.
Look at <http://dev.mysql.com/doc/refman/5.1/en/load-data.html> | Set a `UNIQUE` constraint on `email` and `source` columns.
Then do:
```sql
INSERT INTO table_name(email, source, ...) VALUES ('email', 'source', ...)
ON DUPLICATE KEY UPDATE email = email;
```
---
`INSERT IGNORE` will not notify you of any kind of error. I would not recommend it. Neither would I recommend `INSERT ... |
39,761,575 | In my app I generate a QR name in Arabic and then scan and I use `zxing` library to generate but it seems that `zxing` library doesn't support Arabic language because when I scan the generated name it gives me `????`. What is the solution?
This is my code to generate:
```
BitMatrix bitMatrix = multiFormatWriter.enco... | 2016/09/29 | [
"https://Stackoverflow.com/questions/39761575",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4347233/"
] | I found solution:
```
MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
Map<EncodeHintType, Object> hintMap = new EnumMap<EncodeHintType, Object>(EncodeHintType.class);
hintMap.put(EncodeHintType.CHARACTER_SET, "UTF-8");
hintMap.put(EncodeHintType.MARGIN, 1); /* default = 4 */
hintMap.put(EncodeHintType.... | dont forget to set text encoding.
`Hashtable hints = new Hashtable();
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");`
so, based on your code it should be
`multiFormatWriter.encode(text2QR, BarcodeFormat.QR_CODE, 500, 500, hints);` |
48,243,404 | I'm curious what the design argument for `doParallel:::doParallelSNOW()` giving a warning when globals are explicitly specified in `.export` could be? For example,
```
library("doParallel")
registerDoParallel(cl <- parallel::makeCluster(2L))
a <- 1
y <- foreach(i = 1L, .export = "a") %dopar% { 2 * a }
## Warning in e... | 2018/01/13 | [
"https://Stackoverflow.com/questions/48243404",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1072091/"
] | So it turns out that the solution to this question requires a bit of scripting using `groovy`.
Below is the updated process model diagram, in it I start a new instance of the `Complete Task` process using a script task then if the user wishes to add more tasks the exclusive gateway can return the user to the Create ta... | 1. Seems like you are updating only one variable (or a single set of variables) as a result of each task. This will override the previous value. use distinct variables, or append something before each variable to mark it unique for the task/ sub-process completed. see [collapsed sub-process](https://www.activiti.org/us... |
72,041,403 | The input boxes move up when the error message appears at the bottom . The error message is enclosed in a span tag
When the input boxes are blank and the user tries to hit enter the error message should appear below the input box asking the user to enter the valid input , however when the input appears it moves the box... | 2022/04/28 | [
"https://Stackoverflow.com/questions/72041403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12993416/"
] | Update Columns
--------------
```
Option Explicit
Sub UpdateMin()
Const FirstCellAddress As String = "N2"
Const ColumnOffset As Long = 22
Const ColumnsCount As Long = 100
Const MinCriteria As Double = 8
Dim ws As Worksheet: Set ws = ActiveSheet ' improve!
Dim fCell As Range: Set fCell = ws.... | Imagine the following data in column A
[](https://i.stack.imgur.com/XeoWS.png)
Use the following code to loop through all data and if it is smaller then 8 turn it into 8, omit the cells if they're not numeric or if they are empty.
```
Option Explici... |
72,041,403 | The input boxes move up when the error message appears at the bottom . The error message is enclosed in a span tag
When the input boxes are blank and the user tries to hit enter the error message should appear below the input box asking the user to enter the valid input , however when the input appears it moves the box... | 2022/04/28 | [
"https://Stackoverflow.com/questions/72041403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12993416/"
] | I propose to separate obtaining and processing of data. As for the latter, why not to apply a formula `=IF(Data < Minimum, Minimum, Data)` to numbers in a data range? To select only numbers, we can use `SpecialCells`.
```
Sub UpdateMin(Data As Range, Optional MinCriteria As Double)
Dim Numbers As Range
Dim Area As Ran... | Imagine the following data in column A
[](https://i.stack.imgur.com/XeoWS.png)
Use the following code to loop through all data and if it is smaller then 8 turn it into 8, omit the cells if they're not numeric or if they are empty.
```
Option Explici... |
23,371,582 | I created [this website](http://www.oooysterfestival.com) with the original intention of having it be mobile. However I've had to take that function out and for the time being just wanted to have it so when you visit the site on a mobile device you just see the website as you would see on the screen. Not mobile friendl... | 2014/04/29 | [
"https://Stackoverflow.com/questions/23371582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1140019/"
] | I didn't find a css for mobile devices in your themes style.css file. Please write some css for various device like android, iphone, ipad, tablet pc etc.
Example:
```
* @media Rule */
@media all and (max-width: 1024px) {here is your css code}
@media all and (min-width: 800px) and (max-width: 1024px) {here is your c... | If you want it to looked zoom out, then remove the viewport restrictions. It is limiting your field of vision and preventing it from sizing your site correctly.
You should only use the mobile viewport if you are reorienting your content based on screen resolution, like the previous example for responsive design. |
23,371,582 | I created [this website](http://www.oooysterfestival.com) with the original intention of having it be mobile. However I've had to take that function out and for the time being just wanted to have it so when you visit the site on a mobile device you just see the website as you would see on the screen. Not mobile friendl... | 2014/04/29 | [
"https://Stackoverflow.com/questions/23371582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1140019/"
] | In your case you should not use any of the suggested meta viewport tags. If you leave the page without any meta viewport tags you should get the desired result in most mobile browsers.
You could add `<meta name="viewport" content="width=980">` to tell the browser that you content is 980 px, if that is the case. You s... | I didn't find a css for mobile devices in your themes style.css file. Please write some css for various device like android, iphone, ipad, tablet pc etc.
Example:
```
* @media Rule */
@media all and (max-width: 1024px) {here is your css code}
@media all and (min-width: 800px) and (max-width: 1024px) {here is your c... |
23,371,582 | I created [this website](http://www.oooysterfestival.com) with the original intention of having it be mobile. However I've had to take that function out and for the time being just wanted to have it so when you visit the site on a mobile device you just see the website as you would see on the screen. Not mobile friendl... | 2014/04/29 | [
"https://Stackoverflow.com/questions/23371582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1140019/"
] | I didn't find a css for mobile devices in your themes style.css file. Please write some css for various device like android, iphone, ipad, tablet pc etc.
Example:
```
* @media Rule */
@media all and (max-width: 1024px) {here is your css code}
@media all and (min-width: 800px) and (max-width: 1024px) {here is your c... | I think you want the look of website in mobile same as you look in the Desktop. as i can see the screeshot you have provided. For that REMOVE the Viewport code which you have putted in header. Also be sure of if some tags are not correctly closed. it might be cause of the issue. |
23,371,582 | I created [this website](http://www.oooysterfestival.com) with the original intention of having it be mobile. However I've had to take that function out and for the time being just wanted to have it so when you visit the site on a mobile device you just see the website as you would see on the screen. Not mobile friendl... | 2014/04/29 | [
"https://Stackoverflow.com/questions/23371582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1140019/"
] | I didn't find a css for mobile devices in your themes style.css file. Please write some css for various device like android, iphone, ipad, tablet pc etc.
Example:
```
* @media Rule */
@media all and (max-width: 1024px) {here is your css code}
@media all and (min-width: 800px) and (max-width: 1024px) {here is your c... | Try only one of this Meta Viewports each time, remove the others.
Try this first: `<meta name="viewport" content="width=device-width" />` |
23,371,582 | I created [this website](http://www.oooysterfestival.com) with the original intention of having it be mobile. However I've had to take that function out and for the time being just wanted to have it so when you visit the site on a mobile device you just see the website as you would see on the screen. Not mobile friendl... | 2014/04/29 | [
"https://Stackoverflow.com/questions/23371582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1140019/"
] | I didn't find a css for mobile devices in your themes style.css file. Please write some css for various device like android, iphone, ipad, tablet pc etc.
Example:
```
* @media Rule */
@media all and (max-width: 1024px) {here is your css code}
@media all and (min-width: 800px) and (max-width: 1024px) {here is your c... | Add this in your body tag:
```
body {min-width: 1024px;}
```
Should not effect your meta or media queries with this, but this meta as mentioned is a great one:
```
<meta name="viewport" content="width=device-width" />
``` |
23,371,582 | I created [this website](http://www.oooysterfestival.com) with the original intention of having it be mobile. However I've had to take that function out and for the time being just wanted to have it so when you visit the site on a mobile device you just see the website as you would see on the screen. Not mobile friendl... | 2014/04/29 | [
"https://Stackoverflow.com/questions/23371582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1140019/"
] | In your case you should not use any of the suggested meta viewport tags. If you leave the page without any meta viewport tags you should get the desired result in most mobile browsers.
You could add `<meta name="viewport" content="width=980">` to tell the browser that you content is 980 px, if that is the case. You s... | If you want it to looked zoom out, then remove the viewport restrictions. It is limiting your field of vision and preventing it from sizing your site correctly.
You should only use the mobile viewport if you are reorienting your content based on screen resolution, like the previous example for responsive design. |
23,371,582 | I created [this website](http://www.oooysterfestival.com) with the original intention of having it be mobile. However I've had to take that function out and for the time being just wanted to have it so when you visit the site on a mobile device you just see the website as you would see on the screen. Not mobile friendl... | 2014/04/29 | [
"https://Stackoverflow.com/questions/23371582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1140019/"
] | In your case you should not use any of the suggested meta viewport tags. If you leave the page without any meta viewport tags you should get the desired result in most mobile browsers.
You could add `<meta name="viewport" content="width=980">` to tell the browser that you content is 980 px, if that is the case. You s... | I think you want the look of website in mobile same as you look in the Desktop. as i can see the screeshot you have provided. For that REMOVE the Viewport code which you have putted in header. Also be sure of if some tags are not correctly closed. it might be cause of the issue. |
23,371,582 | I created [this website](http://www.oooysterfestival.com) with the original intention of having it be mobile. However I've had to take that function out and for the time being just wanted to have it so when you visit the site on a mobile device you just see the website as you would see on the screen. Not mobile friendl... | 2014/04/29 | [
"https://Stackoverflow.com/questions/23371582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1140019/"
] | In your case you should not use any of the suggested meta viewport tags. If you leave the page without any meta viewport tags you should get the desired result in most mobile browsers.
You could add `<meta name="viewport" content="width=980">` to tell the browser that you content is 980 px, if that is the case. You s... | Try only one of this Meta Viewports each time, remove the others.
Try this first: `<meta name="viewport" content="width=device-width" />` |
23,371,582 | I created [this website](http://www.oooysterfestival.com) with the original intention of having it be mobile. However I've had to take that function out and for the time being just wanted to have it so when you visit the site on a mobile device you just see the website as you would see on the screen. Not mobile friendl... | 2014/04/29 | [
"https://Stackoverflow.com/questions/23371582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1140019/"
] | In your case you should not use any of the suggested meta viewport tags. If you leave the page without any meta viewport tags you should get the desired result in most mobile browsers.
You could add `<meta name="viewport" content="width=980">` to tell the browser that you content is 980 px, if that is the case. You s... | Add this in your body tag:
```
body {min-width: 1024px;}
```
Should not effect your meta or media queries with this, but this meta as mentioned is a great one:
```
<meta name="viewport" content="width=device-width" />
``` |
49,970,283 | Consider this example:
```
import numpy as np
a = np.array(1)
np.save("a.npy", a)
a = np.load("a.npy", mmap_mode='r')
print(type(a))
b = a + 2
print(type(b))
```
which outputs
```
<class 'numpy.core.memmap.memmap'>
<class 'numpy.int32'>
```
So it seems that `b` is not a `memmap` any more, and I assume that this... | 2018/04/22 | [
"https://Stackoverflow.com/questions/49970283",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/880783/"
] | You can use `nextTick` which will call a function after the next DOM update cycle.
```
this.datepicker = true;
Vue.nextTick(function () {
$(".jquery-date-picker").datepicker();
})
```
And here is it's page in the documentation [VueJS Docs](https://v2.vuejs.org/v2/api/#Vue-nextTick) | Vue features triggers, in your case the `mounted()` function could be used. This articles describes how to use it and the whole Vue hook timeline : <https://alligator.io/vuejs/component-lifecycle/>
A stackoverflow explanation : [Vue JS mounted()](https://stackoverflow.com/q/45021907/7477557) |
383,744 | I am trying print data in rows and columns using bash script as follows.
```
#!/bin/bash
while IFS='' read -r line || [[ -n "$line" ]]; do
echo "$line"
done < "$1"
{
awk 'BEGIN { print "Points"}
/Points/ { id = $1; }'
}
```
My txt file looks like this:
```
Team Played Wins Tied
england 4 ... | 2017/08/03 | [
"https://unix.stackexchange.com/questions/383744",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/244887/"
] | You don't need a shell loop for this, at all:
```
awk '{$(NF+1) = NR==1 ? "Points" : $3*4 + $4*2; print}' OFS='\t' input.txt
Team Played Wins Tied Points
A 2 1 1 6
B 2 0 1 2
``` | In plain bash, you could write:
```
while read -ra fields; do
if [[ ${fields[0]} == "Team" ]]; then
fields+=("Points")
else
fields+=( $(( 4 * ${fields[2]} + 2 * ${fields[3]} )) )
fi
# changes to IFS variable done inside a subshell
(IFS=$'\t'; echo "${fields[*]}")
done < "$1"
``` |
7,998 | I'm replacing the floor in my bathroom, which was previously a vinyl sheet. Prior to that (and I think original to the house, built in early 70's) it was some peel and stick-type tiles, except they're very hard (they remind of me what would be sold as commercial tiles now). There were some tiles left under the old vani... | 2011/08/01 | [
"https://diy.stackexchange.com/questions/7998",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/157/"
] | I have made the mistake twice of demoing an old bathroom sink and throwing out the p-trap before the new sink and plumbing went in. Both times I regretted it because when I went to put in the new p-trap, I found some sort of strange/different plumbing setup which required several trips to the hardware store (and me rep... | Best way I've thought of so far is to use a drain tube extension coming out of the connector in the wall, then go into another female trap connector, then P-trap, and then finally female drain connector for the actual sink drain. Biggest downside is the pipe will get narrower between the wall and the p-trap, since it's... |
7,998 | I'm replacing the floor in my bathroom, which was previously a vinyl sheet. Prior to that (and I think original to the house, built in early 70's) it was some peel and stick-type tiles, except they're very hard (they remind of me what would be sold as commercial tiles now). There were some tiles left under the old vani... | 2011/08/01 | [
"https://diy.stackexchange.com/questions/7998",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/157/"
] | A 1 1/4" female FIP adapter worked perfectly. As soon as I saw it, I was embarassed for not having thought of it earlier.

I used some teflon tape, screwed the FIP adapter onto the adapter coming out of the wall, then just glued my 1 1/4" pipe direc... | I have made the mistake twice of demoing an old bathroom sink and throwing out the p-trap before the new sink and plumbing went in. Both times I regretted it because when I went to put in the new p-trap, I found some sort of strange/different plumbing setup which required several trips to the hardware store (and me rep... |
7,998 | I'm replacing the floor in my bathroom, which was previously a vinyl sheet. Prior to that (and I think original to the house, built in early 70's) it was some peel and stick-type tiles, except they're very hard (they remind of me what would be sold as commercial tiles now). There were some tiles left under the old vani... | 2011/08/01 | [
"https://diy.stackexchange.com/questions/7998",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/157/"
] | A 1 1/4" female FIP adapter worked perfectly. As soon as I saw it, I was embarassed for not having thought of it earlier.

I used some teflon tape, screwed the FIP adapter onto the adapter coming out of the wall, then just glued my 1 1/4" pipe direc... | Best way I've thought of so far is to use a drain tube extension coming out of the connector in the wall, then go into another female trap connector, then P-trap, and then finally female drain connector for the actual sink drain. Biggest downside is the pipe will get narrower between the wall and the p-trap, since it's... |
14,064,932 | I wrote this piece of code but not sure why it doesn't print the second sentence, it just prints the first part of it which is "Some string concat is like".
I was expecting to see the rest of the sentence from TalkToMe method too.
```
object1 = Object.new
def object1.TalkToMe
puts ("Depending on the time, they may... | 2012/12/28 | [
"https://Stackoverflow.com/questions/14064932",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/320724/"
] | `AccessLevel` is meant to represent a set of individual access rights. To check for specific right you should use something like this:
```
(object.getAccessAllowed() & AccessRight.DELETE_AS_INT) == AccessRight.DELETE_AS_INT
``` | Here is a way:
```
int accessAllowed = document.getAccessAllowed();
if (checkRight(accessAllowed, AccessRight.DELETE))
{
log.trace("Access level "
+ AccessRight.DELETE.toString() + " is present");
}
private boolean checkRight(int rights, AccessRight ar)
{
return (rights & ar.getValue()) != 0;
}
``` |
42,449,250 | I am working on a class assignment (which is why only relevant code is being displayed). I have assigned an array of pointers to an array of random numbers and have to use the bubble sort technique.
The array is set up as follows:
```
int array[DATASIZE] = {71, 1899, 272, 1694, 1697, 296, 722, 12, 2726, 1899};
int *... | 2017/02/24 | [
"https://Stackoverflow.com/questions/42449250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5553114/"
] | In the call:
```
pointerSwap(toStore[j],toStore[j+1]);
```
you are passing an `int` (`toStore[j]` is equivelent to `*(toStore + j)`) to a function that expects a pointer. You need to pass a pointer, namely:
```
pointerSwap(toStore + j, toStore + j + 1);
```
The second question pertains to sorting out of place. Yo... | Just to expand on the prior answer ...
In C the bracket operator [] is equivalent to \*() so that
```
a[5]
```
is equivalent to
```
*(a + 5)
```
Both add an offset to a pointer to get a new pointer and then get the value that's being pointed to. When you pass in toStore[j] to pointerSwap you are passing the inte... |
47,656,329 | I created a react component that I want to use twice(or more) inside my page, and I need to load a script tag for it inside the head of my page but just once! I mean even if I use the component twice or more in the page it should add the script tag just once in the head.
The Problem is that this script tag should be a... | 2017/12/05 | [
"https://Stackoverflow.com/questions/47656329",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9056870/"
] | Here what I did to fix my issue:
In Git Settings, Global Settings in Team Explorer, there is an option to choose between OpenSSL and Secure Channel.
Starting with Visual Studio 2017 (version 15.7 preview 3) use of SChannel in Git Global settings fixed my issue. | After two day with system admin support, I got the solution.
I post it here in case it may help somebody else.
Visual Studio 2017 looks not accepting a self signed certificate, as error states ("local issuer blah blah"). It has to be a local CA to approve it.
Steps were:
**Server:**
1. Install Company/Trusted CA on ... |
47,656,329 | I created a react component that I want to use twice(or more) inside my page, and I need to load a script tag for it inside the head of my page but just once! I mean even if I use the component twice or more in the page it should add the script tag just once in the head.
The Problem is that this script tag should be a... | 2017/12/05 | [
"https://Stackoverflow.com/questions/47656329",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9056870/"
] | After two day with system admin support, I got the solution.
I post it here in case it may help somebody else.
Visual Studio 2017 looks not accepting a self signed certificate, as error states ("local issuer blah blah"). It has to be a local CA to approve it.
Steps were:
**Server:**
1. Install Company/Trusted CA on ... | In a browser open the tfs url
then click on the lock icon in the address bar
then export the root certificate as Base 64 X.509 (.CER)
then appended the root certificate to the cert file here:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explo... |
47,656,329 | I created a react component that I want to use twice(or more) inside my page, and I need to load a script tag for it inside the head of my page but just once! I mean even if I use the component twice or more in the page it should add the script tag just once in the head.
The Problem is that this script tag should be a... | 2017/12/05 | [
"https://Stackoverflow.com/questions/47656329",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9056870/"
] | After two day with system admin support, I got the solution.
I post it here in case it may help somebody else.
Visual Studio 2017 looks not accepting a self signed certificate, as error states ("local issuer blah blah"). It has to be a local CA to approve it.
Steps were:
**Server:**
1. Install Company/Trusted CA on ... | I faced the same issue. Below are two steps that worked for me to fix the issue:
1. Go to Tools > Options > Source Control > Git Global Settings
Set *Cryptographic network provider* as *Secure Channel*.
2. Reconnect Project. Go to Team Explorer > Manage Connection > Connect to Project. |
47,656,329 | I created a react component that I want to use twice(or more) inside my page, and I need to load a script tag for it inside the head of my page but just once! I mean even if I use the component twice or more in the page it should add the script tag just once in the head.
The Problem is that this script tag should be a... | 2017/12/05 | [
"https://Stackoverflow.com/questions/47656329",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9056870/"
] | Here what I did to fix my issue:
In Git Settings, Global Settings in Team Explorer, there is an option to choose between OpenSSL and Secure Channel.
Starting with Visual Studio 2017 (version 15.7 preview 3) use of SChannel in Git Global settings fixed my issue. | You can do a quick workaround by:
```
git config --global http.sslVerify false
```
Ref: <https://confluence.atlassian.com/bitbucketserverkb/ssl-certificate-problem-unable-to-get-local-issuer-certificate-816521128.html> |
47,656,329 | I created a react component that I want to use twice(or more) inside my page, and I need to load a script tag for it inside the head of my page but just once! I mean even if I use the component twice or more in the page it should add the script tag just once in the head.
The Problem is that this script tag should be a... | 2017/12/05 | [
"https://Stackoverflow.com/questions/47656329",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9056870/"
] | Here what I did to fix my issue:
In Git Settings, Global Settings in Team Explorer, there is an option to choose between OpenSSL and Secure Channel.
Starting with Visual Studio 2017 (version 15.7 preview 3) use of SChannel in Git Global settings fixed my issue. | In a browser open the tfs url
then click on the lock icon in the address bar
then export the root certificate as Base 64 X.509 (.CER)
then appended the root certificate to the cert file here:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explo... |
47,656,329 | I created a react component that I want to use twice(or more) inside my page, and I need to load a script tag for it inside the head of my page but just once! I mean even if I use the component twice or more in the page it should add the script tag just once in the head.
The Problem is that this script tag should be a... | 2017/12/05 | [
"https://Stackoverflow.com/questions/47656329",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9056870/"
] | Here what I did to fix my issue:
In Git Settings, Global Settings in Team Explorer, there is an option to choose between OpenSSL and Secure Channel.
Starting with Visual Studio 2017 (version 15.7 preview 3) use of SChannel in Git Global settings fixed my issue. | I faced the same issue. Below are two steps that worked for me to fix the issue:
1. Go to Tools > Options > Source Control > Git Global Settings
Set *Cryptographic network provider* as *Secure Channel*.
2. Reconnect Project. Go to Team Explorer > Manage Connection > Connect to Project. |
47,656,329 | I created a react component that I want to use twice(or more) inside my page, and I need to load a script tag for it inside the head of my page but just once! I mean even if I use the component twice or more in the page it should add the script tag just once in the head.
The Problem is that this script tag should be a... | 2017/12/05 | [
"https://Stackoverflow.com/questions/47656329",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9056870/"
] | You can do a quick workaround by:
```
git config --global http.sslVerify false
```
Ref: <https://confluence.atlassian.com/bitbucketserverkb/ssl-certificate-problem-unable-to-get-local-issuer-certificate-816521128.html> | In a browser open the tfs url
then click on the lock icon in the address bar
then export the root certificate as Base 64 X.509 (.CER)
then appended the root certificate to the cert file here:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explo... |
47,656,329 | I created a react component that I want to use twice(or more) inside my page, and I need to load a script tag for it inside the head of my page but just once! I mean even if I use the component twice or more in the page it should add the script tag just once in the head.
The Problem is that this script tag should be a... | 2017/12/05 | [
"https://Stackoverflow.com/questions/47656329",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9056870/"
] | You can do a quick workaround by:
```
git config --global http.sslVerify false
```
Ref: <https://confluence.atlassian.com/bitbucketserverkb/ssl-certificate-problem-unable-to-get-local-issuer-certificate-816521128.html> | I faced the same issue. Below are two steps that worked for me to fix the issue:
1. Go to Tools > Options > Source Control > Git Global Settings
Set *Cryptographic network provider* as *Secure Channel*.
2. Reconnect Project. Go to Team Explorer > Manage Connection > Connect to Project. |
60,980,163 | This is very simple example of what I want to get. My question is about @returns tag. What should I write there?
```js
class Base{
/**
* @returns {QUESTION: WHAT SHOUL BE HIRE??}
*/
static method(){
return new this()
}
}
class Sub extends Base{
}
let base= Base.method() // IDE should understand that b... | 2020/04/01 | [
"https://Stackoverflow.com/questions/60980163",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3011740/"
] | I did it for you with MU Grids and media queries, if you have questions, ask. I am always ready to help. This is codesandbox link. Let me know if it help you.
<https://codesandbox.io/s/charming-shirley-oq6l5> | Show my codesandbox answering your problem : <https://codesandbox.io/s/amazing-sound-1nj87>
It display your layout for **md lg xl** correctly. For **xs and sm** screens, sidenav & map take **full height** with a **break page between sidenav and appBa**r |
60,980,163 | This is very simple example of what I want to get. My question is about @returns tag. What should I write there?
```js
class Base{
/**
* @returns {QUESTION: WHAT SHOUL BE HIRE??}
*/
static method(){
return new this()
}
}
class Sub extends Base{
}
let base= Base.method() // IDE should understand that b... | 2020/04/01 | [
"https://Stackoverflow.com/questions/60980163",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3011740/"
] | I did it for you with MU Grids and media queries, if you have questions, ask. I am always ready to help. This is codesandbox link. Let me know if it help you.
<https://codesandbox.io/s/charming-shirley-oq6l5> | Thanks to both, it solved the main part o what i need.
Also need to implement a change of page.
I forget to mention that the map will be React-Leaflet,
so need to implement a flap button over the map for the mobile version.
The button is for scroll to up, because any finger movement in the map area only will affect t... |
92,235 | I've been taught that a carbocation mainly rearranges because of:
* increasing degree (1 to 2, 1 to 3, or 2 to 3)
* +M stabilization
* ring expansion (in an exceptional case, ring contraction as well).
However, I've never been taught whether the following carbocation **A** would rearrange:
[![enter image description... | 2018/03/13 | [
"https://chemistry.stackexchange.com/questions/92235",
"https://chemistry.stackexchange.com",
"https://chemistry.stackexchange.com/users/5026/"
] | The answer to this question is quite difficult to deduce logically. In the first place, the carbocation that is formed is secondary. Rearranging will only change the position of the carbocation, but it will be still secondary. But then there is also a stabilising +I effect.
Instead, if we take into account that that t... | I think that without any experimental data, it is no possible to decide. Personally, I don't think the inductive effect differences between the two ($\ce{CH3}$ and $\text{iBu}$ *vs.* $\text{Et}$ and $\text{iPr}$) and are large enough so that the energy gain from the stabilization of the carbocation is enough to overcom... |
30,354,168 | I have an HTML page (`courses.html`) that shows a list of courses. These courses are loaded from a database by an AJAX call into the array "courses" defined as global variable in `script_1.js`. Once I go to the page of a specific course in `course.html` I want to be able to pass this array to `script_2.js` to mantain t... | 2015/05/20 | [
"https://Stackoverflow.com/questions/30354168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4347551/"
] | The way to approach this would to be use cookies.
An answer to a previous stack overflow question explains really well how to store javascript objects in cookies and how to retrieve them.
<https://stackoverflow.com/a/11344672/1130119> | You have a couple of options:
1) If you are developing a Single Page Application (SPA): Create a global variable to store your courses, for example:
window.courses = []; // fill with your data courses
then when you load your page 2 you could access to window.courses variable
(keep in mind that you could create a obj... |
30,354,168 | I have an HTML page (`courses.html`) that shows a list of courses. These courses are loaded from a database by an AJAX call into the array "courses" defined as global variable in `script_1.js`. Once I go to the page of a specific course in `course.html` I want to be able to pass this array to `script_2.js` to mantain t... | 2015/05/20 | [
"https://Stackoverflow.com/questions/30354168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4347551/"
] | You have the following option for passing data from one page to the next:
1. **Cookie.** Store some data in a cookie in page1. When page2 loads, it can read the value from the cookie.
2. **Local Storage.** Store some data in Local Storage in page1. When page2 loads, it can read the value from the Local Storage.
3. **S... | The way to approach this would to be use cookies.
An answer to a previous stack overflow question explains really well how to store javascript objects in cookies and how to retrieve them.
<https://stackoverflow.com/a/11344672/1130119> |
30,354,168 | I have an HTML page (`courses.html`) that shows a list of courses. These courses are loaded from a database by an AJAX call into the array "courses" defined as global variable in `script_1.js`. Once I go to the page of a specific course in `course.html` I want to be able to pass this array to `script_2.js` to mantain t... | 2015/05/20 | [
"https://Stackoverflow.com/questions/30354168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4347551/"
] | You have the following option for passing data from one page to the next:
1. **Cookie.** Store some data in a cookie in page1. When page2 loads, it can read the value from the cookie.
2. **Local Storage.** Store some data in Local Storage in page1. When page2 loads, it can read the value from the Local Storage.
3. **S... | You have a couple of options:
1) If you are developing a Single Page Application (SPA): Create a global variable to store your courses, for example:
window.courses = []; // fill with your data courses
then when you load your page 2 you could access to window.courses variable
(keep in mind that you could create a obj... |
64,600,292 | I'm trying to build a new WebApi secured using access tokens from azure active directory.
I'm using .net core v3.1 and visual studio 2019.
I created a new project using the "Asp.net core web application" template and picked an "API" project and changed the authentication type to "Work or School Accounts" and set the ... | 2020/10/29 | [
"https://Stackoverflow.com/questions/64600292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/428280/"
] | You missed some important steps, your access token is also wrong, it lacks the necessary permissions. You can try to follow my method:
You need to create 2 applications, one representing the client application and the other representing the api application, and then use the client application to call the Web api appli... | I've made some further progress which I'm going to use to provide my own answer.
The generated code is using the Microsoft.AspNetCore.Authentication.AzureAD.UI package v 3.1.x to validate the token.
using Fiddler I was able to see that it is using the older endpoints instead of the current "V2.0" endpoints.
the sign... |
64,600,292 | I'm trying to build a new WebApi secured using access tokens from azure active directory.
I'm using .net core v3.1 and visual studio 2019.
I created a new project using the "Asp.net core web application" template and picked an "API" project and changed the authentication type to "Work or School Accounts" and set the ... | 2020/10/29 | [
"https://Stackoverflow.com/questions/64600292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/428280/"
] | I've found a better way of doing it so thought I would post the answer as an alternative to my first answer.
I found this very good [sample application and tutorial](https://github.com/azure-samples/active-directory-dotnet-native-aspnetcore-v2) and worked through the 1st part "Desktop App Calls Web Api" and produces a... | I've made some further progress which I'm going to use to provide my own answer.
The generated code is using the Microsoft.AspNetCore.Authentication.AzureAD.UI package v 3.1.x to validate the token.
using Fiddler I was able to see that it is using the older endpoints instead of the current "V2.0" endpoints.
the sign... |
38,473,994 | I am using webapi-avplay to play video on samsung tizen tv web app.
Video starts buffering when I am forwarding the video and after the completion of buffering, video starts playing.
At the time when buffering in progress, I am trying to forward/backward video but unfortunately unable to forward/backward video.
So I wa... | 2016/07/20 | [
"https://Stackoverflow.com/questions/38473994",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4264085/"
] | Have you tried coding inside **onbufferingprogress** method. Like:
```
var listener = {
onbufferingprogress: function(percent) {
console.log("Buffering in progress");
loadingObj.setPercent(percent);
/* Move 5 seconds back */
var back_button = document.getElementById("v-back"); /... | when you are trying to seek you should pause the video after that you should seek visually update the progress bar and current time. When the user stopped seeking you should use webapis.avplay.seekTo(seekingTime) and play the video. It works for me.
```
const handleSeekForward = () => {
setForwardSteps((prev) => prev ... |
47,965,975 | While using google map activity in my android application I get this error.
**"Could not resolve com.google.android.gms:play-services:11.8.0."**
**Project level** Gradle file:
```
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NO... | 2017/12/25 | [
"https://Stackoverflow.com/questions/47965975",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4601864/"
] | So, finally I got the answer,
I've turned on gradle offline mode that's why it could not find out cached files for that version play-service.
I turned it off (under File-Settings-Build,Execution,Deployment-Gradle) and again sync project and some files have been downloaded then it works now. | You need to include this *class path* inside project level *gradle*.
```
classpath 'com.google.gms:google-services:3.0.0'
```
As well as inside app level *build.gradle*.
```
apply plugin: 'com.google.gms.google-services'
``` |
1,578,322 | I am so confused that I thought to ask you for your opinion.
I have written few jquery code with asp.net. But there is group of developer in my company who think that javascript/jquery can be turned off and is insecure
* if javascript is insecure, why to use it at the first place
* what are the advantages of using jq... | 2009/10/16 | [
"https://Stackoverflow.com/questions/1578322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/84950/"
] | >
> if javascript is insecure, why to use it at the first place
>
>
>
To provide advanced browsing experience to those who have it on.
>
> what are the advantages of using jquery with asp.net apart from cross-browser. why not use javascript?
>
>
>
Rapid development. If you're not comfortable with jQuery, cod... | Javascript is no less secure than using the Internet. I would definitely recommend it for the sheer purpose of enhancing the user experience. However, it is also important to make sure your application functions properly with Javascript disabled.
How you write your Javascript is up to you. I use jQuery because I am mu... |
1,578,322 | I am so confused that I thought to ask you for your opinion.
I have written few jquery code with asp.net. But there is group of developer in my company who think that javascript/jquery can be turned off and is insecure
* if javascript is insecure, why to use it at the first place
* what are the advantages of using jq... | 2009/10/16 | [
"https://Stackoverflow.com/questions/1578322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/84950/"
] | >
> if javascript is insecure, why to use it at the first place
>
>
>
To provide advanced browsing experience to those who have it on.
>
> what are the advantages of using jquery with asp.net apart from cross-browser. why not use javascript?
>
>
>
Rapid development. If you're not comfortable with jQuery, cod... | 1. To provide a better experience for the users. People today expect web pages to be interactive. The idea of having a totally static site died a while ago. It should also be said, that if someone is really skilled at compromising systems, whether you use JavaScript or not is inconsequential. With cross site scripting ... |
1,578,322 | I am so confused that I thought to ask you for your opinion.
I have written few jquery code with asp.net. But there is group of developer in my company who think that javascript/jquery can be turned off and is insecure
* if javascript is insecure, why to use it at the first place
* what are the advantages of using jq... | 2009/10/16 | [
"https://Stackoverflow.com/questions/1578322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/84950/"
] | >
> if javascript is insecure, why to use it at the first place
>
>
>
To provide advanced browsing experience to those who have it on.
>
> what are the advantages of using jquery with asp.net apart from cross-browser. why not use javascript?
>
>
>
Rapid development. If you're not comfortable with jQuery, cod... | Javascript is not insecure per se -- but you can certainly create insecure code with it, if you're not careful. All code that is 'critical' security-wise should be run **in the server**, not in the user's browser, because it can be turned off. |
1,578,322 | I am so confused that I thought to ask you for your opinion.
I have written few jquery code with asp.net. But there is group of developer in my company who think that javascript/jquery can be turned off and is insecure
* if javascript is insecure, why to use it at the first place
* what are the advantages of using jq... | 2009/10/16 | [
"https://Stackoverflow.com/questions/1578322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/84950/"
] | ```
• what are the advantages of using jquery with asp.net apart from cross-browser.
why not use javascript?
```
jQuery *is* javascript. The purpose of javascript is to enhance the user's browser experience. If this is something you want to include in your website then I would advise you use it. If you do opt to u... | Javascript is no less secure than using the Internet. I would definitely recommend it for the sheer purpose of enhancing the user experience. However, it is also important to make sure your application functions properly with Javascript disabled.
How you write your Javascript is up to you. I use jQuery because I am mu... |
1,578,322 | I am so confused that I thought to ask you for your opinion.
I have written few jquery code with asp.net. But there is group of developer in my company who think that javascript/jquery can be turned off and is insecure
* if javascript is insecure, why to use it at the first place
* what are the advantages of using jq... | 2009/10/16 | [
"https://Stackoverflow.com/questions/1578322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/84950/"
] | ```
• what are the advantages of using jquery with asp.net apart from cross-browser.
why not use javascript?
```
jQuery *is* javascript. The purpose of javascript is to enhance the user's browser experience. If this is something you want to include in your website then I would advise you use it. If you do opt to u... | 1. To provide a better experience for the users. People today expect web pages to be interactive. The idea of having a totally static site died a while ago. It should also be said, that if someone is really skilled at compromising systems, whether you use JavaScript or not is inconsequential. With cross site scripting ... |
1,578,322 | I am so confused that I thought to ask you for your opinion.
I have written few jquery code with asp.net. But there is group of developer in my company who think that javascript/jquery can be turned off and is insecure
* if javascript is insecure, why to use it at the first place
* what are the advantages of using jq... | 2009/10/16 | [
"https://Stackoverflow.com/questions/1578322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/84950/"
] | ```
• what are the advantages of using jquery with asp.net apart from cross-browser.
why not use javascript?
```
jQuery *is* javascript. The purpose of javascript is to enhance the user's browser experience. If this is something you want to include in your website then I would advise you use it. If you do opt to u... | Javascript is not insecure per se -- but you can certainly create insecure code with it, if you're not careful. All code that is 'critical' security-wise should be run **in the server**, not in the user's browser, because it can be turned off. |
39,164,187 | I have two columns which I want to combine and show the data, I tried like below
```
select
case
when status = 'R'
then 'Resign'
when status = 'A'
then 'Active'
end as status1,
Program_name + ' ' + emp_card_no as program_details,
*
from
GetEmployeeDetails
w... | 2016/08/26 | [
"https://Stackoverflow.com/questions/39164187",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1216804/"
] | Try this :
```
select
case when status='R' then 'Resign'
when status='A' then 'Active'
end as status1,
Program_name + ' (' + convert(varchar, emp_card_no) + ') ' as program_details,
*
from GetEmployeeDetails
Where emp_name ='ABHAY ASHOK MANE'and STATUS= 'A' ORDER BY EMP_NAME
``` | If you need parentheses, use following:
```
select
case when status='R' then 'Resign'
when status='A' then 'Active'
end as status1,
Program_name + ' (' + convert(varchar(10), emp_card_no)+')' as program_details,
*
from GetEmployeeDetails
Where emp_name ='ABHAY ASHOK MANE'and STATUS= 'A' ORDER BY EMP_N... |
39,164,187 | I have two columns which I want to combine and show the data, I tried like below
```
select
case
when status = 'R'
then 'Resign'
when status = 'A'
then 'Active'
end as status1,
Program_name + ' ' + emp_card_no as program_details,
*
from
GetEmployeeDetails
w... | 2016/08/26 | [
"https://Stackoverflow.com/questions/39164187",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1216804/"
] | Try this :
```
select
case when status='R' then 'Resign'
when status='A' then 'Active'
end as status1,
Program_name + ' (' + convert(varchar, emp_card_no) + ') ' as program_details,
*
from GetEmployeeDetails
Where emp_name ='ABHAY ASHOK MANE'and STATUS= 'A' ORDER BY EMP_NAME
``` | **CAST** Int value column to VARCHAR:
In your query **cast emp\_card\_no** to VARCHAR
```
select
case when status='R' then 'Resign'
when status='A' then 'Active' end as status1,
[Program_name] + ' ' + CAST(emp_card_no AS VARCHAR(50)) as program_details,
*
from GetEmployeeDetails
Where emp_name ='ABHAY ... |
39,164,187 | I have two columns which I want to combine and show the data, I tried like below
```
select
case
when status = 'R'
then 'Resign'
when status = 'A'
then 'Active'
end as status1,
Program_name + ' ' + emp_card_no as program_details,
*
from
GetEmployeeDetails
w... | 2016/08/26 | [
"https://Stackoverflow.com/questions/39164187",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1216804/"
] | Try this :
```
select
case when status='R' then 'Resign'
when status='A' then 'Active'
end as status1,
Program_name + ' (' + convert(varchar, emp_card_no) + ') ' as program_details,
*
from GetEmployeeDetails
Where emp_name ='ABHAY ASHOK MANE'and STATUS= 'A' ORDER BY EMP_NAME
``` | You can use concat which will convert internally..
```
select case when status='R' then 'Resign'
when status='A' then 'Active' end as status1,
concat(Program_name, ' ', emp_card_no) as program_details,
* from GetEmployeeDetails
Where emp_name ='ABHAY ASHOK MANE'and STATUS= 'A' ORDER BY EMP_NAME
``` |
39,164,187 | I have two columns which I want to combine and show the data, I tried like below
```
select
case
when status = 'R'
then 'Resign'
when status = 'A'
then 'Active'
end as status1,
Program_name + ' ' + emp_card_no as program_details,
*
from
GetEmployeeDetails
w... | 2016/08/26 | [
"https://Stackoverflow.com/questions/39164187",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1216804/"
] | Try this :
```
select
case when status='R' then 'Resign'
when status='A' then 'Active'
end as status1,
Program_name + ' (' + convert(varchar, emp_card_no) + ') ' as program_details,
*
from GetEmployeeDetails
Where emp_name ='ABHAY ASHOK MANE'and STATUS= 'A' ORDER BY EMP_NAME
``` | column combination can be done for string type values. so you have to convert columns into varchar data type if not.
Below is your solution with **one improvement in case statement.**
```
select
case status
when 'R'
then 'Resign'
when 'A'
then 'Active'
end as status1,
Program_name + ' ' + conv... |
39,164,187 | I have two columns which I want to combine and show the data, I tried like below
```
select
case
when status = 'R'
then 'Resign'
when status = 'A'
then 'Active'
end as status1,
Program_name + ' ' + emp_card_no as program_details,
*
from
GetEmployeeDetails
w... | 2016/08/26 | [
"https://Stackoverflow.com/questions/39164187",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1216804/"
] | If you need parentheses, use following:
```
select
case when status='R' then 'Resign'
when status='A' then 'Active'
end as status1,
Program_name + ' (' + convert(varchar(10), emp_card_no)+')' as program_details,
*
from GetEmployeeDetails
Where emp_name ='ABHAY ASHOK MANE'and STATUS= 'A' ORDER BY EMP_N... | You can use concat which will convert internally..
```
select case when status='R' then 'Resign'
when status='A' then 'Active' end as status1,
concat(Program_name, ' ', emp_card_no) as program_details,
* from GetEmployeeDetails
Where emp_name ='ABHAY ASHOK MANE'and STATUS= 'A' ORDER BY EMP_NAME
``` |
39,164,187 | I have two columns which I want to combine and show the data, I tried like below
```
select
case
when status = 'R'
then 'Resign'
when status = 'A'
then 'Active'
end as status1,
Program_name + ' ' + emp_card_no as program_details,
*
from
GetEmployeeDetails
w... | 2016/08/26 | [
"https://Stackoverflow.com/questions/39164187",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1216804/"
] | If you need parentheses, use following:
```
select
case when status='R' then 'Resign'
when status='A' then 'Active'
end as status1,
Program_name + ' (' + convert(varchar(10), emp_card_no)+')' as program_details,
*
from GetEmployeeDetails
Where emp_name ='ABHAY ASHOK MANE'and STATUS= 'A' ORDER BY EMP_N... | column combination can be done for string type values. so you have to convert columns into varchar data type if not.
Below is your solution with **one improvement in case statement.**
```
select
case status
when 'R'
then 'Resign'
when 'A'
then 'Active'
end as status1,
Program_name + ' ' + conv... |
39,164,187 | I have two columns which I want to combine and show the data, I tried like below
```
select
case
when status = 'R'
then 'Resign'
when status = 'A'
then 'Active'
end as status1,
Program_name + ' ' + emp_card_no as program_details,
*
from
GetEmployeeDetails
w... | 2016/08/26 | [
"https://Stackoverflow.com/questions/39164187",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1216804/"
] | **CAST** Int value column to VARCHAR:
In your query **cast emp\_card\_no** to VARCHAR
```
select
case when status='R' then 'Resign'
when status='A' then 'Active' end as status1,
[Program_name] + ' ' + CAST(emp_card_no AS VARCHAR(50)) as program_details,
*
from GetEmployeeDetails
Where emp_name ='ABHAY ... | You can use concat which will convert internally..
```
select case when status='R' then 'Resign'
when status='A' then 'Active' end as status1,
concat(Program_name, ' ', emp_card_no) as program_details,
* from GetEmployeeDetails
Where emp_name ='ABHAY ASHOK MANE'and STATUS= 'A' ORDER BY EMP_NAME
``` |
39,164,187 | I have two columns which I want to combine and show the data, I tried like below
```
select
case
when status = 'R'
then 'Resign'
when status = 'A'
then 'Active'
end as status1,
Program_name + ' ' + emp_card_no as program_details,
*
from
GetEmployeeDetails
w... | 2016/08/26 | [
"https://Stackoverflow.com/questions/39164187",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1216804/"
] | **CAST** Int value column to VARCHAR:
In your query **cast emp\_card\_no** to VARCHAR
```
select
case when status='R' then 'Resign'
when status='A' then 'Active' end as status1,
[Program_name] + ' ' + CAST(emp_card_no AS VARCHAR(50)) as program_details,
*
from GetEmployeeDetails
Where emp_name ='ABHAY ... | column combination can be done for string type values. so you have to convert columns into varchar data type if not.
Below is your solution with **one improvement in case statement.**
```
select
case status
when 'R'
then 'Resign'
when 'A'
then 'Active'
end as status1,
Program_name + ' ' + conv... |
39,164,187 | I have two columns which I want to combine and show the data, I tried like below
```
select
case
when status = 'R'
then 'Resign'
when status = 'A'
then 'Active'
end as status1,
Program_name + ' ' + emp_card_no as program_details,
*
from
GetEmployeeDetails
w... | 2016/08/26 | [
"https://Stackoverflow.com/questions/39164187",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1216804/"
] | You can use concat which will convert internally..
```
select case when status='R' then 'Resign'
when status='A' then 'Active' end as status1,
concat(Program_name, ' ', emp_card_no) as program_details,
* from GetEmployeeDetails
Where emp_name ='ABHAY ASHOK MANE'and STATUS= 'A' ORDER BY EMP_NAME
``` | column combination can be done for string type values. so you have to convert columns into varchar data type if not.
Below is your solution with **one improvement in case statement.**
```
select
case status
when 'R'
then 'Resign'
when 'A'
then 'Active'
end as status1,
Program_name + ' ' + conv... |
11,851,938 | So I have a page with about 60 of links on it, with random URL's, each one needs to be clicked and downloaded individually.
I'm working on the fundamental script to tab over to the next link, hit enter, and then 'ok' to download to desktop.
I'm new, but I cannot seem to get the 'floating' window which pops up, to let... | 2012/08/07 | [
"https://Stackoverflow.com/questions/11851938",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1169758/"
] | Try passing `fastIframe: false` in the colorbox configuration. It makes colorbox wait until all contents of the iframe are loaded before attempting to show anything.
```
$('a').colorbox({ iframe: true, fastIframe: false });
``` | The white flash is the result of colorbox dynamically generating the iframe. While the iframe is loading you see the background color of the colorbox window itself.
One way to solve this issue is to use the "black" colorbox css styles as demonstrated in [this jsfiddle](http://jsfiddle.net/XSzq5/4/embedded/result/). Yo... |
17,702,895 | I have the following code in a batch file:
```
set /p user="Enter username: " %=%
cd w:\Files
@echo off
setLocal EnableDelayedExpansion
set /a value=0
set /a sum=0
set /a valA=0
FOR /R %1 %%I IN (*) DO (
set /a value=%%~zI/1024
set /a sum=!sum!+!value!
set /a sum=!sum... | 2013/07/17 | [
"https://Stackoverflow.com/questions/17702895",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2252537/"
] | try to remove the `for /r` parameter `%1`:
```
FOR /R %%I IN (*) DO (
```
---
Try this code:
```
@ECHO OFF &SETLOCAL
FOR /R "w:\Files" %%I IN (*) DO set /a asum+=%%~zI
SET /a sum=asum/1048576
echo Size of "FILES" is: %sum% MB
set /a sum=asum/1073741824
echo Size of "FILES" is: %sum% GB
FOR /R "W:\Documents and Set... | Use the `dir` command output. See this example
This will take the folder size and convert it into the different values.
Note that the conversion only works for numeric values up to 2 gigabytes.
```
@echo off
for /f "tokens=3" %%A IN ('dir /s /-c ^| find /i "bytes" ^| find /v /i "free"') do set T=%%A
echo Bytes = %T%... |
17,702,895 | I have the following code in a batch file:
```
set /p user="Enter username: " %=%
cd w:\Files
@echo off
setLocal EnableDelayedExpansion
set /a value=0
set /a sum=0
set /a valA=0
FOR /R %1 %%I IN (*) DO (
set /a value=%%~zI/1024
set /a sum=!sum!+!value!
set /a sum=!sum... | 2013/07/17 | [
"https://Stackoverflow.com/questions/17702895",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2252537/"
] | try to remove the `for /r` parameter `%1`:
```
FOR /R %%I IN (*) DO (
```
---
Try this code:
```
@ECHO OFF &SETLOCAL
FOR /R "w:\Files" %%I IN (*) DO set /a asum+=%%~zI
SET /a sum=asum/1048576
echo Size of "FILES" is: %sum% MB
set /a sum=asum/1073741824
echo Size of "FILES" is: %sum% GB
FOR /R "W:\Documents and Set... | This should report the size of the trees in bytes up to 999 GB.
The lower answer uses a VBS script to convert the numbers to GB (dropping decimals)
```
@echo off
call :size "w:\Files"
call :size "W:\Documents and Settings\%user%\Desktop"
pause
goto :eof
:size
for /f "tokens=3" %%b in ('dir /s "%~1" 2^>nul ^|find " ... |
24,809,965 | I noticed a weird thing when I was writing an angular directive. In the isolated scope of the directive, if I bind an attribute using `myAttr: '@'` to the parent scope variable with the same name, and then use that attribute in the html template, there will be an extra space trailing the attribute value. If the attribu... | 2014/07/17 | [
"https://Stackoverflow.com/questions/24809965",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1264587/"
] | [Known bug](https://github.com/angular/angular.js/issues/8132) in Angular, likely will not be fixed | I had a similar problem - I added "@id" as an attribute in m Directive. That worked - however it inserted me an additional blank space at the end of the id value.
It turned out that Angular takes over the id by default! After removing "@id" from the scope attributes of my directive, I could use "{{id}}" without any pr... |
9,675 | I am starting some tests for building a game on the Android program.
So far everything is working and seems nice.
However I do not understand how to make sure my game looks correct on all phones as they all will have slightly different screen ratios (and even very different on some odd phones)
What I am doing right n... | 2011/03/12 | [
"https://gamedev.stackexchange.com/questions/9675",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/6053/"
] | From a high-level perspective there's only a handful of options, depending on which is more important, maintaining a consistent aspect ratio, or ensuring that no one to see more than someone else just because they have a wider or taller screen.
Your options are:
1. Cropping the parts that don't fit.
2. Stretching the... | The ratio you're referring to is called the 'aspect ratio'. It is usually calculated as the
'width / height' (although if you arranged your viewport differently that could be 'height / width')
Remember to cast the divisor to a float!
```
float aspect_ratio = width / (float) height;
```
HTH |
9,675 | I am starting some tests for building a game on the Android program.
So far everything is working and seems nice.
However I do not understand how to make sure my game looks correct on all phones as they all will have slightly different screen ratios (and even very different on some odd phones)
What I am doing right n... | 2011/03/12 | [
"https://gamedev.stackexchange.com/questions/9675",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/6053/"
] | The 3 options from Davy8's answer are:
* Cropping the parts that don't fit.
* Stretching the screen to fit, which has the issue you're seeing of
stretched images.
* "Letterboxing" which maintains both aspect ratio and ensures that no
player sees more than any other player because of their screen size
I would add a fo... | The ratio you're referring to is called the 'aspect ratio'. It is usually calculated as the
'width / height' (although if you arranged your viewport differently that could be 'height / width')
Remember to cast the divisor to a float!
```
float aspect_ratio = width / (float) height;
```
HTH |
9,675 | I am starting some tests for building a game on the Android program.
So far everything is working and seems nice.
However I do not understand how to make sure my game looks correct on all phones as they all will have slightly different screen ratios (and even very different on some odd phones)
What I am doing right n... | 2011/03/12 | [
"https://gamedev.stackexchange.com/questions/9675",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/6053/"
] | From a high-level perspective there's only a handful of options, depending on which is more important, maintaining a consistent aspect ratio, or ensuring that no one to see more than someone else just because they have a wider or taller screen.
Your options are:
1. Cropping the parts that don't fit.
2. Stretching the... | The 3 options from Davy8's answer are:
* Cropping the parts that don't fit.
* Stretching the screen to fit, which has the issue you're seeing of
stretched images.
* "Letterboxing" which maintains both aspect ratio and ensures that no
player sees more than any other player because of their screen size
I would add a fo... |
52,443,412 | i have to insert data with ajax into database, now it insert data in to database,but not upload the image.
**ajax Code**
```
$(document).on("click","#save", function(){
jQuery.ajax({
method :'post',
url:''+APP_URL+'/products/add_product',
data:$("#product_form").serialize(... | 2018/09/21 | [
"https://Stackoverflow.com/questions/52443412",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8648172/"
] | ```
Try below code to upload image:
`$(document).on("click","#save", function(){
var fd = new FormData();
fd.append('product_photo',$('#id_of_image_uploader').prop('files')[0]);
fd.append('item_name', $('#id_of_item_name').val());
fd.append('barcode', $('#id_of_barcode').val());
jQuery.ajax({
method ... | You have to modify:
```
data:$("#product_form").serialize()
```
To become:
```
data: new FormData("#product_form")
```
And your form must have the `enctype` attribute set to `multipart/form-data`. |
52,443,412 | i have to insert data with ajax into database, now it insert data in to database,but not upload the image.
**ajax Code**
```
$(document).on("click","#save", function(){
jQuery.ajax({
method :'post',
url:''+APP_URL+'/products/add_product',
data:$("#product_form").serialize(... | 2018/09/21 | [
"https://Stackoverflow.com/questions/52443412",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8648172/"
] | ```
Try below code to upload image:
`$(document).on("click","#save", function(){
var fd = new FormData();
fd.append('product_photo',$('#id_of_image_uploader').prop('files')[0]);
fd.append('item_name', $('#id_of_item_name').val());
fd.append('barcode', $('#id_of_barcode').val());
jQuery.ajax({
method ... | you can upload image and serialize form data as the following:
```
<script>
var formData = new FormData($("#FormId")[0]);
$.ajax({
url:''+APP_URL+'/products/add_product',
type: "POST",
data: formData,
processData: false,
contentType: false,
dataType: 'applicati... |
73,750,583 | Here's what i have at the moment:
```
let userTeams = ['Liverpool', 'Manchester City', 'Manchester United'];
let object = {
teams: {
'Liverpool': {
player:
['Salah',
'Nunez']
},
'Manchester United': {
player:
['Ronaldo',
... | 2022/09/16 | [
"https://Stackoverflow.com/questions/73750583",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17265256/"
] | I'm guessing that the OP really aims to get a random team name (key) and that team's data (value) in an object. Abstractly, in a few steps:
Here's how to get a random element from an array:
```
const randomElement = array => array[Math.floor(Math.random()*array.length)];
```
That can be used to get a random key fro... | You can use random on the array which is the keys (or values) of `object.teams`
```js
let object = {
teams: {
'Liverpool': {
player: ['Salah',
'Nunez'
]
},
'Manchester United': {
player: ['Ronaldo',
'Rashford'
]
},
'Manchester City': {
player: ['Haala... |
33,973,634 | I am getting some peculiar behavior in Firefox with localForage. I set up a page to load two arrays using the standard 'setItem' form:
```
<script src="localforage.js"></script>
<body>
<script>
var data = [1,2,3,4,5];
localforage.setItem("saveData", data, function(err, value) {
if (err) {
console.error('error: ', e... | 2015/11/28 | [
"https://Stackoverflow.com/questions/33973634",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4370702/"
] | I also had the same issue but solved it after some researching, trials and discussions. Extensions like FireStorage Plus! and simple session storage do not work flawlessly for detecting this data, especially if it is being performed on a page/file other than the original root page/file.
The solution for me was to use ... | Are you testing this from `file://` as opposed to `http://`? I believe in Firefox you cannot access IndexedDB if you open an HTML page from `file://`. So in this case you would need to run an HTTP server – easiest way is to do `python -m SimpleHTTPServer 8080` and then go to `http://localhost:8080`. Chrome might be dif... |
279,840 | Let's consider a function with evaluated and unevaluated arguments inside:
```
list1 = {1,2,3}
list2 = {x,y,z}
fun[list_]:={list,ToString@Unevaluated@list}
```
When I use Map over `fun` I expect to get result like this:
```
{fun[list1],fun[list2]}
(*{{{1, 2, 3}, "list1"}, {{x, y, z}, "list2"}}*)
```
But instead ... | 2023/02/11 | [
"https://mathematica.stackexchange.com/questions/279840",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/72560/"
] | ```
sol1 = {#[[1]] - 172, #[[2]]} & /@ points ;
sol2 = points - Threaded[{172, 0}];
sol3 = MapAt[Subtract[#, 172] &, points, {All, 1}];
sol4 = {#1 - 172, #2} & @@@ points;
sol1 == sol2 == sol3 == sol4
(* True *)
``` | Try the following variations:
```
TranslationTransform[{-172, 0}][points]
SubsetMap[# - 172 &, points, {All, 1}]
First@Last@Reap@Do[Sow[points[[i]] - {172, 0}], {i, 1, Length@points}]
points - ConstantArray[{172, 0}, Length@points]
``` |
236,424 | I have the data stored in the textfile like this:
0.5 0.5 -0.7 -0.8
0.51 0.51 -0.75 -0.85
0.6 0.1 0.1 1.00
and so on
4 numbers in each row.
Two first numbers means coordinates (x0,y0), two last - (x1,y1). This determines the coordinates of a line. So, the first row tells, that I have a line starting from (0.5, 0.5... | 2020/12/12 | [
"https://mathematica.stackexchange.com/questions/236424",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/76234/"
] | ```
data = Import["/Users/roberthanlon/Downloads/lines.txt", "Data"]
(* {{0.5, 0.5, -0.7, -0.8}, {0.51, 0.51, -0.75, -0.85}, {0.6, 0.1, 0.1, 1.}} *)
Graphics[Line /@ (Partition[#, 2] & /@ data), Axes -> True]
```
[](https://i.stack.imgur.com/vTHRm.... | This is another way to do it:
```
data = ImportString[
"0.5 0.5 -0.7 -0.8
0.51 0.51 -0.75 -0.85
0.6 0.1 0.1 1.00", "Table"]
```
```
Graphics[
Table[
Line[Partition[row, 2]],
{row, data}
]
]
```
Try each piece of the code separately to see what it does (this applies to all situations when you are trying ... |
236,424 | I have the data stored in the textfile like this:
0.5 0.5 -0.7 -0.8
0.51 0.51 -0.75 -0.85
0.6 0.1 0.1 1.00
and so on
4 numbers in each row.
Two first numbers means coordinates (x0,y0), two last - (x1,y1). This determines the coordinates of a line. So, the first row tells, that I have a line starting from (0.5, 0.5... | 2020/12/12 | [
"https://mathematica.stackexchange.com/questions/236424",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/76234/"
] | You can use `"Table"` to keep the structure of your data.
And then you define a function `Line[{{#1, #2}, {#3, #4}}]&` to draw the `Line` by two points `{#1,#2}` and `{#3,#4}`.
```
0.5 0.5 -0.7 -0.8
0.51 0.51 -0.75 -0.85
0.6 0.1 0.1 1.00
```
```
data = Import["data.txt", "Table"]
(* {{0.5, 0.5, -0.7, -0.8}, {0.51, ... | This is another way to do it:
```
data = ImportString[
"0.5 0.5 -0.7 -0.8
0.51 0.51 -0.75 -0.85
0.6 0.1 0.1 1.00", "Table"]
```
```
Graphics[
Table[
Line[Partition[row, 2]],
{row, data}
]
]
```
Try each piece of the code separately to see what it does (this applies to all situations when you are trying ... |
272,779 | I wrote an answer to this question on [Distinct States](https://physics.stackexchange.com/questions/272556/schroeders-thermal-physics-multiplicity-of-a-single-ideal-gas-molecule/272585#272585), but I am not happy with the answer I gave to the short question at the end.
Hopefully this question is self contained, but pl... | 2016/08/05 | [
"https://physics.stackexchange.com/questions/272779",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/-1/"
] | **OBJECTIVE:** **how to Wick rotate a path integral using Cauchy's theorem**. I like the approach of using Cauchy's theorem and I must admit I haven't seen the finite-time problem approached from this viewpoint before, so it seemed like a fun thing to think about (on this rainy Sunday afternoon!).
When I started thin... | Normally (in quantum field theory) the integration would go to infinity. Then the part that closes the loop at infinity should vanish because the fields are assumed to go to zero there. For the remaining integral one should find that in different half spaces (upper or lower) the exponential either grows or decays and o... |
63,419,309 | MISRA c++:2008 was published in 2008. It was written for C++03.
Does this refer to just the syntax of C++2003 standard or do have to use the compiler as well.
We have written our code base in VS2017 and we only have available for the Language Standard:
* ISO C++14 Standard
* ISO C++17 Standard
* ISO C++ Latest Dra... | 2020/08/14 | [
"https://Stackoverflow.com/questions/63419309",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/767829/"
] | It will be very hard to argue and say that you are MISRA-C++ compliant when not even compiling in C++03 mode. MISRA-C++ is a safe subset of C++03, so it bans a lot of things from that standard. If you run off and compile for C++11 or later, all bets are off.
Visual Studio is not suitable for the kind of mission-critic... | From what I can see on their website, the MISRA standard is not public, so there's really no way for the average person to answer this question. It's probably mostly an issue of what, if any, of the Standard C++ Library you can use and meet the MIRSA requirements.
>
> I suspect given the vast majority of the Standard... |
969,986 | Okay, this is an example from *Challenge and Trill of Pre-college Mathematics* by Krishnamurthy et al.
>
> In how many ways can we form a committee of three from a group of 10 men and 8 women, so that our committee consists of at least one woman?
>
>
>
I know howit usualy goes: let the answer be *$N$*. The number... | 2014/10/12 | [
"https://math.stackexchange.com/questions/969986",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/42814/"
] | Your first way is absolutely correct, and the easiest way to do it.
Another, more cumbersome, way, is to consider cases:
1. exactly one woman: ${8 \choose 1}{10 \choose 2} = 8 \times 45 = 360$ ways.
2. exactly two women: ${8 \choose 2}{10 \choose 1} = 28 \times 10 = 280$ ways.
3. exactly three women: ${8 \choose 3} ... | If you want to use your idea, you'd better separate your discussion into three cases:1) choose 1 woman and two men,2)choose two women and 1 men,3) choose three women
In your answer, you double count some cases, say 1)choose woman A first, then choose woman B, 2)choose woman B and then choose woman A. They are the same... |
126,659 | The $10$ generators of the Poincare group $P(1;3)$ are $M^{\mu\nu}$ and $P^\mu$. These generators can be determined explicitly in the matrix form. However, I have found that $M^{\mu\nu}$ and $P^\mu$ are often written in terms of position $x^\mu$ and momentum $p^\mu$ as
$$ M^{\mu\nu} = x^\mu p^\nu - x^\nu p^\mu $$
and
... | 2014/07/15 | [
"https://physics.stackexchange.com/questions/126659",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/21270/"
] | One obtains those expressions by considering a particular action of the Poincare group on fields.
Consider, for example, a single real scalar field $\phi:\mathbb R^{3,1}\to\mathbb R$. Let $\mathcal F$ denote the space of such fields. Define an action $\rho\_\mathcal F$ of $P(3,1)$ acting on $\mathcal F$ as follows
\be... | The generators of isometry, also generators of the Poincare group, are the Killing vectors, hence we need the Killing vectors of Minkowski spacetime, $ds^2 = -dt^2 + dx^2 + dy^2+ dz^2$. The defining equation of the Killing vectors in terms of their components ($\xi = \xi^\mu \partial\_\mu$ is a Killing vector with comp... |
43,242,076 | I am quite new to MySQL. I have data in more than 2000 text files that I need to import into a table. I have created the table as follow:
```
CREATE TABLE test1
(
Month TINYINT UNSIGNED,
Day TINYINT UNSIGNED,
Year TINYINT UNSIGNED,
Weight FLOAT UNSIGNED,
length FLOAT UNSIGNED,
Site_Number C... | 2017/04/05 | [
"https://Stackoverflow.com/questions/43242076",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7821588/"
] | Pattern match is performed linearly as it appears in the sources, so, this line:
```
case Row(t1: Seq[String], t2: Seq[String]) => Some((t1 zip t2).toMap)
```
Which doesn't have any restrictions on the values of t1 and t2 never matter match with the null value.
Effectively, put the null check before and it should w... | I think you will need to encode null values to blank or special String before performing assert operations. Also keep in mind that Spark executes lazily. So from the like "val values = df.flatMap" onward everything is executed only when show() is executed. |
43,242,076 | I am quite new to MySQL. I have data in more than 2000 text files that I need to import into a table. I have created the table as follow:
```
CREATE TABLE test1
(
Month TINYINT UNSIGNED,
Day TINYINT UNSIGNED,
Year TINYINT UNSIGNED,
Weight FLOAT UNSIGNED,
length FLOAT UNSIGNED,
Site_Number C... | 2017/04/05 | [
"https://Stackoverflow.com/questions/43242076",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7821588/"
] | The issue is that whether you find `null` or not the first pattern matches. After all, `t2: Seq[String]` could theoretically be `null`. While it's true that you can solve this immediately by simply making the `null` pattern appear first, I feel it is imperative to use the facilities in the Scala language to get rid of ... | I think you will need to encode null values to blank or special String before performing assert operations. Also keep in mind that Spark executes lazily. So from the like "val values = df.flatMap" onward everything is executed only when show() is executed. |
26,137,413 | I have an old website, and I would like to add a glyphicons to a page of this site.
I cannot install bootstrap (link bootstrap.js and bootstrap.css to this page) because it will change all styled elements on the page.
Is there a way to add only "glyphicons functionality"? | 2014/10/01 | [
"https://Stackoverflow.com/questions/26137413",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1049569/"
] | You can build your bootstrap to components, which you need, on
<http://getbootstrap.com/customize/>
For example for **only glyphicon**, you can check only glyphicon checkbox and download.
Direct url for this setting is
**<http://getbootstrap.com/customize/?id=428c81f3f639eb0564a5>**
Scroll down and download it.
Yo... | You can download glyphicons png on <http://glyphicons.com/> |
26,137,413 | I have an old website, and I would like to add a glyphicons to a page of this site.
I cannot install bootstrap (link bootstrap.js and bootstrap.css to this page) because it will change all styled elements on the page.
Is there a way to add only "glyphicons functionality"? | 2014/10/01 | [
"https://Stackoverflow.com/questions/26137413",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1049569/"
] | I prefer to use something called 'font-awsome' it has a huge library of icons and it only takes one line of code to include it into any project. - It works the same way as glyphicon being able to format with CSS etc.
I know this is not a answer to your question, but its a valid work around, and I prefer the font-aweso... | You can download glyphicons png on <http://glyphicons.com/> |
26,137,413 | I have an old website, and I would like to add a glyphicons to a page of this site.
I cannot install bootstrap (link bootstrap.js and bootstrap.css to this page) because it will change all styled elements on the page.
Is there a way to add only "glyphicons functionality"? | 2014/10/01 | [
"https://Stackoverflow.com/questions/26137413",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1049569/"
] | You can build your bootstrap to components, which you need, on
<http://getbootstrap.com/customize/>
For example for **only glyphicon**, you can check only glyphicon checkbox and download.
Direct url for this setting is
**<http://getbootstrap.com/customize/?id=428c81f3f639eb0564a5>**
Scroll down and download it.
Yo... | I prefer to use something called 'font-awsome' it has a huge library of icons and it only takes one line of code to include it into any project. - It works the same way as glyphicon being able to format with CSS etc.
I know this is not a answer to your question, but its a valid work around, and I prefer the font-aweso... |
50,027,919 | I can trigger my AWS pipeline from jenkins but I don't want to create buildspec.yaml and instead use the pipeline script which already works for jenkins. | 2018/04/25 | [
"https://Stackoverflow.com/questions/50027919",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7372933/"
] | In order to user Codebuild you need to provide the Codebuild project with a buildspec.yaml file along with your source code or incorporate the commands into the actual project.
However, I think you are interested in having the creation of the buildspec.yaml file done within the Jenkins pipeline.
Below is a snippet of... | You will need to write a buildspec for the commands that you want AWS CodeBuild to run. If you use the CodeBuild plugin for Jenkins, you can add that to your Jenkins pipeline and use CodeBuild as a Jenkins build slave to execute the commands in your buildspec.
See more details here: <https://docs.aws.amazon.com/codebu... |
50,027,919 | I can trigger my AWS pipeline from jenkins but I don't want to create buildspec.yaml and instead use the pipeline script which already works for jenkins. | 2018/04/25 | [
"https://Stackoverflow.com/questions/50027919",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7372933/"
] | In order to user Codebuild you need to provide the Codebuild project with a buildspec.yaml file along with your source code or incorporate the commands into the actual project.
However, I think you are interested in having the creation of the buildspec.yaml file done within the Jenkins pipeline.
Below is a snippet of... | @hynespm - excellent example mate.
Here is another one based off yours but with stripIndent() and "withAWS" to switch roles:
```
#!/usr/bin/env groovy
def cbResult = null
pipeline {
.
.
.
script {
echo ("app_version TestwithAWS value : " + "${app_version}")
... |
22,820,666 | I have a string like this and I want to convert it to DateTime format(MM/dd/yyyyTHH:mm:ss).
but it fails, Please let me know where I'm wrong.
```
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
string stime = "4/17/2014T12:00:00";
DateTime dt = DateTime.ParseExact(stime, "MM/dd/yyyyTHH:mm:ss", Culture... | 2014/04/02 | [
"https://Stackoverflow.com/questions/22820666",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3475314/"
] | You wrote `MM` in your format string, which means that you need a two digit month. If you want a one digit month, just use `M`.
```
DateTime dt = DateTime.ParseExact(stime, "M/dd/yyyyTHH:mm:ss", CultureInfo.InvariantCulture);
```
The other solution is to change your string to match your format.
```
string stime = "... | **Problem :** in your date string `4/17/2014T12:00:00` you have only single digit `Month` value (4) but in your DateFormat string you mentione double `MM`
**Solution :** you should specify single `M` instead of double `MM`
Try This:
```
DateTime dt = DateTime.ParseExact(stime, "M/dd/yyyyTHH:mm:ss",
... |
22,820,666 | I have a string like this and I want to convert it to DateTime format(MM/dd/yyyyTHH:mm:ss).
but it fails, Please let me know where I'm wrong.
```
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
string stime = "4/17/2014T12:00:00";
DateTime dt = DateTime.ParseExact(stime, "MM/dd/yyyyTHH:mm:ss", Culture... | 2014/04/02 | [
"https://Stackoverflow.com/questions/22820666",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3475314/"
] | **Problem :** in your date string `4/17/2014T12:00:00` you have only single digit `Month` value (4) but in your DateFormat string you mentione double `MM`
**Solution :** you should specify single `M` instead of double `MM`
Try This:
```
DateTime dt = DateTime.ParseExact(stime, "M/dd/yyyyTHH:mm:ss",
... | Pay attention your date string contains only 1 digit for month but your patters defines `MM`.
So either use month `04` or change pattern to `M`. |
22,820,666 | I have a string like this and I want to convert it to DateTime format(MM/dd/yyyyTHH:mm:ss).
but it fails, Please let me know where I'm wrong.
```
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
string stime = "4/17/2014T12:00:00";
DateTime dt = DateTime.ParseExact(stime, "MM/dd/yyyyTHH:mm:ss", Culture... | 2014/04/02 | [
"https://Stackoverflow.com/questions/22820666",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3475314/"
] | You wrote `MM` in your format string, which means that you need a two digit month. If you want a one digit month, just use `M`.
```
DateTime dt = DateTime.ParseExact(stime, "M/dd/yyyyTHH:mm:ss", CultureInfo.InvariantCulture);
```
The other solution is to change your string to match your format.
```
string stime = "... | Pay attention your date string contains only 1 digit for month but your patters defines `MM`.
So either use month `04` or change pattern to `M`. |
8,256,104 | I have a sliding section set up as below. I was wondering if I can somehow add `easeIn` and `easeOut` when the slide goes up and down.
```
$('a#slide-up').click(function () {
$('.slide-container').slideUp(400, function(){
$('#slide-toggle').removeClass('active');
});
return false;
});
$('a#slide-t... | 2011/11/24 | [
"https://Stackoverflow.com/questions/8256104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/893654/"
] | You can. Please check the documentation of [slideDown](http://api.jquery.com/slideDown/) at jQuery docs;.
By default jQUery implements only linear and swing easing functions. For additional easing functions you have to user jQUery UI
---
UPDATE:
Acoording to the doc, the second optional argument is a string indicat... | You sure can, make sure you include the jQuery UI script as you do you regular jQuery library and add in the easing parameter to the [slideUp()](http://api.jquery.com/slideUp/) function.
Like so...
```
$('a#slide-up').click(function () {
$('.slide-container').slideUp(400,'easeIn', function(){
$('#slide-toggl... |
8,256,104 | I have a sliding section set up as below. I was wondering if I can somehow add `easeIn` and `easeOut` when the slide goes up and down.
```
$('a#slide-up').click(function () {
$('.slide-container').slideUp(400, function(){
$('#slide-toggle').removeClass('active');
});
return false;
});
$('a#slide-t... | 2011/11/24 | [
"https://Stackoverflow.com/questions/8256104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/893654/"
] | You can. Please check the documentation of [slideDown](http://api.jquery.com/slideDown/) at jQuery docs;.
By default jQUery implements only linear and swing easing functions. For additional easing functions you have to user jQUery UI
---
UPDATE:
Acoording to the doc, the second optional argument is a string indicat... | for *slideUp* and *slideDown* you ca add the easing effect:
```
$(".slide-container").slideUp({
duration:500,
easing:"easeOutExpo",
complete:function(){
$(slideToggle).removeClass("active");
}
});
```
HTH |
8,256,104 | I have a sliding section set up as below. I was wondering if I can somehow add `easeIn` and `easeOut` when the slide goes up and down.
```
$('a#slide-up').click(function () {
$('.slide-container').slideUp(400, function(){
$('#slide-toggle').removeClass('active');
});
return false;
});
$('a#slide-t... | 2011/11/24 | [
"https://Stackoverflow.com/questions/8256104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/893654/"
] | for *slideUp* and *slideDown* you ca add the easing effect:
```
$(".slide-container").slideUp({
duration:500,
easing:"easeOutExpo",
complete:function(){
$(slideToggle).removeClass("active");
}
});
```
HTH | You sure can, make sure you include the jQuery UI script as you do you regular jQuery library and add in the easing parameter to the [slideUp()](http://api.jquery.com/slideUp/) function.
Like so...
```
$('a#slide-up').click(function () {
$('.slide-container').slideUp(400,'easeIn', function(){
$('#slide-toggl... |
41,099 | I have a tentative understanding of modal logic. Can anyone explain modal logic as it is used in computer science? | 2015/04/07 | [
"https://cs.stackexchange.com/questions/41099",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/30383/"
] | I think you can find many good examples if you search a bit online. Some very-easy-to-find examples are in the following list:
From [Stanford Encyclopedia](http://plato.stanford.edu/entries/logic-modal/)
>
> In computer science, labeled transition systems (LTSs) are commonly used to represent possible computation pa... | Modal logic is useful for verification of [reactive systems](http://en.wikipedia.org/wiki/Reactive_system)
>
> A reactive system is a system that responds (reacts) to external events.
> Typically, biological systems are reactive, because they react to certain events. However, the term is used primarily for describing... |
30,332,197 | I am working with learning SQL, I have taken the basics course on pluralsight, and now I am using MySQL through Treehouse, with dummy databases they've set up, through the MySQL server. Once my training is complete I will be using SQLServer daily at work.
I ran into a two-part challenge yesterday that I had some troub... | 2015/05/19 | [
"https://Stackoverflow.com/questions/30332197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4611445/"
] | Remove `float:left` from `.menu` and `.menu a` and just add
```
margin: 0 auto;
```
to `.menu` to make the links centered.
Also, change your `display` from `block` to `inline-block` for `.menu a`
Remember to give a width for `.menu`. I just tried a width of `61%` via Inspect Element and it got right.
**OR**
Add... | Taken from [Learn CSS Layout](http://learnlayout.com/margin-auto.html):
```
.menu
{
width: 600px;
margin: 0 auto;
}
```
>
> Setting the `width` of a block-level element will prevent it from
> stretching out to the edges of its container to the left and right.
> Then, you can set the left... |
48,185,675 | I´ve been searching for a solution to create a dropdownlist in ColumnC (with start from row 2) if there is value in ColumnA same row.
But all I was able to find is how to create one dropdownlist using VBA.
```
Sub DVraschwab()
Dim myList$, i%
myList = ""
For i = 1 To 7
myList = myList & "ListItem" & i &... | 2018/01/10 | [
"https://Stackoverflow.com/questions/48185675",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7888468/"
] | Do you mean like this? You basically just need a loop added to your code to check column A.
```
Sub DVraschwab()
Dim myList As String, r As Range
myList = "Yes,No"
For Each r In Range("A2", Range("A" & Rows.Count).End(xlUp))
If r.Value <> vbNullString Then
With r.Offset(, 2).Vali... | This code will set the validation and write the default value in each cell.
```
Sub DVraschwab()
' 10 Jan 2018
Const MyList As String = "Yes,No"
Dim Rl As Long, R As Long
With Worksheets("Duplicates") ' replace with your sheet's name
' change column from "A" if not applicable
... |
7,811,268 | I have recently started going through sound card drivers in Linux[ALSA].
Can a link or reference be suggested where I can get good basics of Audio like :
Sampling rate,bit size etc.
I want to know exactly how samples are stored in Audio files on a computer and reverse of this which is how samples(numbers) are played... | 2011/10/18 | [
"https://Stackoverflow.com/questions/7811268",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/993969/"
] | The [Audacity](http://audacity.sourceforge.net/) [tutorial](http://audacity.sourceforge.net/manual-1.2/tutorial_basics_1.html) is a good place to start. Another [introduction](http://www.pgmusic.com/tutorial_digitalaudio.htm) that covers similar ground. The [PureData](http://puredata.info/) [tutorial at flossmanuals](h... | I was in the same situation, and certainly this kind of information is out there but you need to do some research first. This is what I have found:
Digital Audio processing is a branch of DSP (Digital Signal
Processing).
>
> DSP is one of the most powerful technologies that will
> shape science and engineering in the... |
3,800,925 | What are some of the better libraries for image generation in Python? If I were to implement a GOTCHA (for example's sake), thereby having to manipulate an image on the pixel level, what would my options be? Ideally I would like to save resulting image as a low-resolution jpeg, but this is mere wishing, I'll settle for... | 2010/09/27 | [
"https://Stackoverflow.com/questions/3800925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/181165/"
] | The Python Imaging Library (PIL) is the *de facto* image manipulation library on Python. You can find it [here](http://www.pythonware.com/products/pil/), or through **easy\_install** or **pip** if you have them.
Edit: PIL has not been updated in a while, but it has been forked and maintained under the name **[pillow](... | If you should generate text or other vector based images (and then save to .png or .jpg), you could also consider Cairo (PyCairo, in this case). I use it a lot.
Otherwise, for pixel-level manipulation, PIL is the obvious choice. |
3,800,925 | What are some of the better libraries for image generation in Python? If I were to implement a GOTCHA (for example's sake), thereby having to manipulate an image on the pixel level, what would my options be? Ideally I would like to save resulting image as a low-resolution jpeg, but this is mere wishing, I'll settle for... | 2010/09/27 | [
"https://Stackoverflow.com/questions/3800925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/181165/"
] | The Python Imaging Library (PIL) is the *de facto* image manipulation library on Python. You can find it [here](http://www.pythonware.com/products/pil/), or through **easy\_install** or **pip** if you have them.
Edit: PIL has not been updated in a while, but it has been forked and maintained under the name **[pillow](... | [Pillow](http://pillow.readthedocs.org/) is a fork of PIL that is still actively developed. While PIL is not dead it has been a number of years since the last release. |
3,800,925 | What are some of the better libraries for image generation in Python? If I were to implement a GOTCHA (for example's sake), thereby having to manipulate an image on the pixel level, what would my options be? Ideally I would like to save resulting image as a low-resolution jpeg, but this is mere wishing, I'll settle for... | 2010/09/27 | [
"https://Stackoverflow.com/questions/3800925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/181165/"
] | [Pillow](http://pillow.readthedocs.org/) is a fork of PIL that is still actively developed. While PIL is not dead it has been a number of years since the last release. | If you should generate text or other vector based images (and then save to .png or .jpg), you could also consider Cairo (PyCairo, in this case). I use it a lot.
Otherwise, for pixel-level manipulation, PIL is the obvious choice. |
3,013,831 | I have an existing database design that stores Job Vacancies.
The "Vacancy" table has a number of fixed fields across all clients, such as "Title", "Description", "Salary range".
There is an EAV design for "Custom" fields that the Clients can setup themselves, such as, "Manager Name", "Working Hours". The field names... | 2010/06/10 | [
"https://Stackoverflow.com/questions/3013831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40655/"
] | Have you thought about using an XML column? You can enforce all your constraints declaratively through XSL.
Instead of EAV, have a single column with XML data validated by a schema (or a collection of schemas). | Why not store the custom fields in a key-value table?
```
| vacancy ID | CustomFieldType | CustomFieldValue |
```
Then have auxillary tables listing possible values per type (1 table) and may be possible types per vacancy type (it seems to be the original ClientCategory) |
3,013,831 | I have an existing database design that stores Job Vacancies.
The "Vacancy" table has a number of fixed fields across all clients, such as "Title", "Description", "Salary range".
There is an EAV design for "Custom" fields that the Clients can setup themselves, such as, "Manager Name", "Working Hours". The field names... | 2010/06/10 | [
"https://Stackoverflow.com/questions/3013831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40655/"
] | Take a look [**at this**](https://stackoverflow.com/questions/2932322/how-to-design-a-schema-where-the-columns-of-a-table-are-not-fixed/2932403#2932403) question/answer; describes the observation pattern.
It uses five tables and can be implemented in a "standard" RDBMS -- Sql Server 2005 will do.
No limit on number of ... | Why not store the custom fields in a key-value table?
```
| vacancy ID | CustomFieldType | CustomFieldValue |
```
Then have auxillary tables listing possible values per type (1 table) and may be possible types per vacancy type (it seems to be the original ClientCategory) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.