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 |
|---|---|---|---|---|---|
83,684 | I recently bought my first DSLR and made the decision to spend a similar amount on the lens as on the body, on the basis that the lens is where the optics are, and I would guess that changing the optics make a much greater difference to image quality than changing the sensor. Camera reviews seemed to implicitly confirm... | 2016/10/14 | [
"https://photo.stackexchange.com/questions/83684",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/56937/"
] | >
> What effect does the body have on the character and quality of images?
>
>
>
After you eliminate "... things like APS-C vs. full-frame, in-body image stabilisation, ISO range or resolution..." there's not much left. Sensor size, pixel size, sensor efficiency (how much of the light that hits a sensor actually m... | Probably we can narrow them into
* Noise 1. I would not discard ISO range. This is one of the most important things. Ok I am not refering on the maximum ISO directly. But if a camera has a higher ISO sensitivity, for example one with a max ISO of 1,600 and one with max ISO of 64,000, the second most likely will perfor... |
51,480,481 | I am creating a new freestyle project in `Jenkins` and wanted to pass parameters with my batch file.
I created a multi-line string parameter in the `Command` section of the `Execute Windows batch command` box:
```
echo The build names are: %Build%
gitPull.bat (Pass in the variables here?)
```
But it only shows the... | 2018/07/23 | [
"https://Stackoverflow.com/questions/51480481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7565634/"
] | My Answer is for **Chrome Browser**
* If you need to View event listeners registered on objects then you
can use [getEventListeners(object)](https://developers.google.com/web/tools/chrome-devtools/console/command-line-reference#geteventlistenersobject)
* If you need to monitor events use [monitorEvents()](https://dev... | ```html
<div>
<input type = "text" onkeydown="funct(event)"/>
</div>
<script>
function funct(e) {
console.log(e);
}
</script>
```
```js
function funct(e){
console.log(e);
}
```
```html
<div>
<input type = "text" onkeydown="funct(event)"/>
</div>
```
Now run the program and go to inspect ele... |
51,480,481 | I am creating a new freestyle project in `Jenkins` and wanted to pass parameters with my batch file.
I created a multi-line string parameter in the `Command` section of the `Execute Windows batch command` box:
```
echo The build names are: %Build%
gitPull.bat (Pass in the variables here?)
```
But it only shows the... | 2018/07/23 | [
"https://Stackoverflow.com/questions/51480481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7565634/"
] | I don't know on others brows but at least in chrome console in elements tab on the right side you can open the *Event Listeners* tab and see them all, moreover clicking on it You will find where they have been set.[](https://i.stack.imgur.com/apql7.png... | ```html
<div>
<input type = "text" onkeydown="funct(event)"/>
</div>
<script>
function funct(e) {
console.log(e);
}
</script>
```
```js
function funct(e){
console.log(e);
}
```
```html
<div>
<input type = "text" onkeydown="funct(event)"/>
</div>
```
Now run the program and go to inspect ele... |
51,480,481 | I am creating a new freestyle project in `Jenkins` and wanted to pass parameters with my batch file.
I created a multi-line string parameter in the `Command` section of the `Execute Windows batch command` box:
```
echo The build names are: %Build%
gitPull.bat (Pass in the variables here?)
```
But it only shows the... | 2018/07/23 | [
"https://Stackoverflow.com/questions/51480481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7565634/"
] | My Answer is for **Chrome Browser**
* If you need to View event listeners registered on objects then you
can use [getEventListeners(object)](https://developers.google.com/web/tools/chrome-devtools/console/command-line-reference#geteventlistenersobject)
* If you need to monitor events use [monitorEvents()](https://dev... | I don't know on others brows but at least in chrome console in elements tab on the right side you can open the *Event Listeners* tab and see them all, moreover clicking on it You will find where they have been set.[](https://i.stack.imgur.com/apql7.png... |
15,779,588 | I was wondering how to get radio button values. So suppose, I have a form that has two radio buttons. I would like to get the value associated with the button. However, I get null when I try to.
Form portion
```
<form method="post" action="insert.jsp" enctype=text/plain>
<table>
<INPUT TYPE="radio" name="command" val... | 2013/04/03 | [
"https://Stackoverflow.com/questions/15779588",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1709294/"
] | Use `GET` method instead of `POST` and your code will run. (if you want to use 'text/plain') and also see the answer given by @divyabharathi for the correct `enctype` for POST method.
```
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<bo... | The `null` value returned by the `request.getParameter("command")` is due to the fact that you are using `enctype="plain/text"` in your jsp.
The default encoding for an HTTP post request (what your servlet is expecting) is application/x-www-form-urlencoded; not text/plain. |
58,940,796 | I have tried the below code:
```
import pandas as pd
dataframe = pd(C1,columns=['School-A','School-B','School-C','School-D','School-E'])
sum_column = daeframet.sum(axis=0)
print (sum_column)
```
I am getting the below error
>
> TypeError: 'module' object is not callable
>
>
>
**Data:**
;
```
Shows:
```
Object {
"data": Object {
"size": 40,
"team": "yellow",
},
}
```
But then accesing the object....
Doing a:
```
console.log(data.size);
```
I get :
```
undefined
```
... | 2020/10/07 | [
"https://Stackoverflow.com/questions/64240343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5712250/"
] | You probably want to do this,
```
console.log(data.data.size);
```
```js
const data = {
"data": {
"size": 40,
"team": "yellow",
},
}
console.log(data.data.size)
```
the is `data` object inside data. So, u also have to access that `data` for `size` | ```
const data = { data: { size: 40 }};
```
So it should be `data.data.size` |
12,629,347 | Where can I find the list of default word breakers for English in sql server full text search? | 2012/09/27 | [
"https://Stackoverflow.com/questions/12629347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/572207/"
] | ```
Msg 8152, Level 16, State 14, Line 1
String or binary data would be truncated.
The statement has been terminated.
```
There are two reasons for this:
1. Your varchar column is not large enough. Appending 7 characters to an existing 10 into a varchar(15) column won't work
2. Your column is defined as char (why?!)... | Is it possible that [concat](http://www.1keydata.com/sql/sql-concatenate.html) is more useful?
As far as the error message goes, I do not know why it is generated, but than again, it has been a while since I used MS SQL for the last time. |
12,629,347 | Where can I find the list of default word breakers for English in sql server full text search? | 2012/09/27 | [
"https://Stackoverflow.com/questions/12629347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/572207/"
] | ```
Msg 8152, Level 16, State 14, Line 1
String or binary data would be truncated.
The statement has been terminated.
```
There are two reasons for this:
1. Your varchar column is not large enough. Appending 7 characters to an existing 10 into a varchar(15) column won't work
2. Your column is defined as char (why?!)... | I'm thinking it's possible that your column is being aggregated recursively, ad infinitum. Or at least ad 512 characters.
If this is the case, you'll have to offload the current table contents into a temporary table, then use that data to perform the update back onto the original table.
I'm researching if this is pos... |
896,644 | I was curious what is considered the better way to manage the reading and writing of a High Score plist file. My High Score class is:
```
@interface HighScore : NSObject <NSCoding> {
NSString *name;
int score;
int level;
int round;
NSDate *date;
}... | 2009/05/22 | [
"https://Stackoverflow.com/questions/896644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86020/"
] | Both your ways look fine to me. There is also Core Data in the 3.0 OS, although it might be overkill if all you want to save is a single high score value. | check out [this](https://stackoverflow.com/questions/367198/iphone-high-scores-framework) question, maybe it's useful for your app |
896,644 | I was curious what is considered the better way to manage the reading and writing of a High Score plist file. My High Score class is:
```
@interface HighScore : NSObject <NSCoding> {
NSString *name;
int score;
int level;
int round;
NSDate *date;
}... | 2009/05/22 | [
"https://Stackoverflow.com/questions/896644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86020/"
] | I'm not sure that I understand your objections! Both should work just fine.
Personally I prefer method A. I think it makes sense that an object knows how to encode itself. It makes maintenance easier and any changes more localised. Plus it probably uses less memory. | check out [this](https://stackoverflow.com/questions/367198/iphone-high-scores-framework) question, maybe it's useful for your app |
896,644 | I was curious what is considered the better way to manage the reading and writing of a High Score plist file. My High Score class is:
```
@interface HighScore : NSObject <NSCoding> {
NSString *name;
int score;
int level;
int round;
NSDate *date;
}... | 2009/05/22 | [
"https://Stackoverflow.com/questions/896644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86020/"
] | I went with method B because: 1. The plist file is more readable and 2. I can save off some file and class version numbering into this method easily:
In my HighScore class:
```
- (id)initFromDictionary: (NSDictionary *)dict;
{
if (self = [super init]) {
self.name = [dict objectForKey:kHighScoreNameKey];
... | check out [this](https://stackoverflow.com/questions/367198/iphone-high-scores-framework) question, maybe it's useful for your app |
1,442,526 | What I am trying to do is when I insert something into column `A` or `B` current date and time to be inserted/updated into column `D`. Of course I already done that but I want to exclude columns `C` and `D` which means when something is inserted in these columns date/time should not be inserted/updated.
```
Private Su... | 2019/05/29 | [
"https://superuser.com/questions/1442526",
"https://superuser.com",
"https://superuser.com/users/995043/"
] | Updating BIOS from 1.80 to 3.21 **didn't** help.
Those two SATA ports are controlled by ASMedia ASM1061.
I don't know if this controller is garbage or if *exactly these 2 ports* (controlled by ASM1061) were improperly made. But these 2 SATA ports don't work as they must. | >
> sometimes detected, sometimes not
>
>
>
that is very NOT likely to be fixed with a bios/efi update. Especially for a SATA disk, which is not new technology.
your problems are likely to be, because the connection is intermittent
* a bad sata cable, with the wiring between the two connectors at each end of the... |
1,442,526 | What I am trying to do is when I insert something into column `A` or `B` current date and time to be inserted/updated into column `D`. Of course I already done that but I want to exclude columns `C` and `D` which means when something is inserted in these columns date/time should not be inserted/updated.
```
Private Su... | 2019/05/29 | [
"https://superuser.com/questions/1442526",
"https://superuser.com",
"https://superuser.com/users/995043/"
] | Updating BIOS from 1.80 to 3.21 **didn't** help.
Those two SATA ports are controlled by ASMedia ASM1061.
I don't know if this controller is garbage or if *exactly these 2 ports* (controlled by ASM1061) were improperly made. But these 2 SATA ports don't work as they must. | You could try disabling the "fast boot" option in bios. This function speeds up boot time by leaving some devices uninitialized during boot.
In my case, I remember it resulted into similar problems - some HDDs could sometimes be detected and other times not. |
1,442,526 | What I am trying to do is when I insert something into column `A` or `B` current date and time to be inserted/updated into column `D`. Of course I already done that but I want to exclude columns `C` and `D` which means when something is inserted in these columns date/time should not be inserted/updated.
```
Private Su... | 2019/05/29 | [
"https://superuser.com/questions/1442526",
"https://superuser.com",
"https://superuser.com/users/995043/"
] | >
> sometimes detected, sometimes not
>
>
>
that is very NOT likely to be fixed with a bios/efi update. Especially for a SATA disk, which is not new technology.
your problems are likely to be, because the connection is intermittent
* a bad sata cable, with the wiring between the two connectors at each end of the... | You could try disabling the "fast boot" option in bios. This function speeds up boot time by leaving some devices uninitialized during boot.
In my case, I remember it resulted into similar problems - some HDDs could sometimes be detected and other times not. |
1,092,396 | I've been following Apple's documentation on writing unit tests for the iPhone, and out of the box, the routine doesn't seem to work. I'm not sure I understand where the unit test is going to get the reference to the application delegate.
My Dependencies are like the following:
My\_Program\_target -> UnitTesting\_tar... | 2009/07/07 | [
"https://Stackoverflow.com/questions/1092396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/128433/"
] | Ok, so I've figured it out. In order to open a file in a unit test, you'll need to specify the file to open as:
```
NSString * filePath = [[NSBundle bundleForClass:[self class] ] pathForResource:@"SimpleTestList" ofType:@"plist"];
```
If you include this in a class that's compiled as part of your unit test bundle, t... | If you need the application delegate, you have to run the unit tests on the device itself and not the simulator. Also, you will see unit test output appear in the console, not in the build results.
The key thing to know is that there are two types of unit tests - logic tests that are run outside of the executable, and... |
1,092,396 | I've been following Apple's documentation on writing unit tests for the iPhone, and out of the box, the routine doesn't seem to work. I'm not sure I understand where the unit test is going to get the reference to the application delegate.
My Dependencies are like the following:
My\_Program\_target -> UnitTesting\_tar... | 2009/07/07 | [
"https://Stackoverflow.com/questions/1092396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/128433/"
] | If you need the application delegate, you have to run the unit tests on the device itself and not the simulator. Also, you will see unit test output appear in the console, not in the build results.
The key thing to know is that there are two types of unit tests - logic tests that are run outside of the executable, and... | The Swift 3 translation of Gary's answer above (using an URL instead of a string path) is:
```
let url = Bundle(for: type(of: self)).url(forResource: "SimpleTestList", withExtension: "plist")
```
Notice the critical and non-obvious part **`type(of: self)`** instead of `[self class]`. |
1,092,396 | I've been following Apple's documentation on writing unit tests for the iPhone, and out of the box, the routine doesn't seem to work. I'm not sure I understand where the unit test is going to get the reference to the application delegate.
My Dependencies are like the following:
My\_Program\_target -> UnitTesting\_tar... | 2009/07/07 | [
"https://Stackoverflow.com/questions/1092396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/128433/"
] | Ok, so I've figured it out. In order to open a file in a unit test, you'll need to specify the file to open as:
```
NSString * filePath = [[NSBundle bundleForClass:[self class] ] pathForResource:@"SimpleTestList" ofType:@"plist"];
```
If you include this in a class that's compiled as part of your unit test bundle, t... | The Swift 3 translation of Gary's answer above (using an URL instead of a string path) is:
```
let url = Bundle(for: type(of: self)).url(forResource: "SimpleTestList", withExtension: "plist")
```
Notice the critical and non-obvious part **`type(of: self)`** instead of `[self class]`. |
94,837 | Apologies from a QGIS beginner but I have added a WMS layer of polygons to fill in the gaps of an existing data set I have. the problem is that I want all of this data to have the same style (colour etc) and the WMS layer which comes up as orange cross hatching doesn't seeem to be able to be modified to a single colour... | 2014/05/02 | [
"https://gis.stackexchange.com/questions/94837",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/29843/"
] | No. WMS is a image that is generated and sent from a server. Once you have it in QGIS it's too late to change it. | Yes, if you use GeoServer with [Dynamic Colormap Generation](http://docs.geoserver.org/stable/en/user/community/colormap/index.html). |
65,780,026 | I have the following df:
```
dff=pd.DataFrame(index=[1]*10+[2]*10,data={'mth':list(range(1,11))*2,'pmt':[10,5,3,10,20,4,1,6,5,6]*2,'min_pmt':[5]*10+[4]*10,'Stat':[np.nan]*20,'up':[np.nan]*20,'up_cum':[np.nan]*20})
```
I have in it 2 different values in the index: customer 1 and customer 2, and for each one I have co... | 2021/01/18 | [
"https://Stackoverflow.com/questions/65780026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6659388/"
] | `def f(arg=i)` says "make me a function `f` where the default value for `arg` is whatever `i` is right now". At the time of defining the function, `i=5`. | This is because you are assigning the value when the function is created. `arg` at the time of creation will be defaulted to what `i` is in that moment. Since at the time of the function being created the value of `i` is 5 then that's what the default value of that argument becomes. After the initial creation of the fu... |
65,780,026 | I have the following df:
```
dff=pd.DataFrame(index=[1]*10+[2]*10,data={'mth':list(range(1,11))*2,'pmt':[10,5,3,10,20,4,1,6,5,6]*2,'min_pmt':[5]*10+[4]*10,'Stat':[np.nan]*20,'up':[np.nan]*20,'up_cum':[np.nan]*20})
```
I have in it 2 different values in the index: customer 1 and customer 2, and for each one I have co... | 2021/01/18 | [
"https://Stackoverflow.com/questions/65780026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6659388/"
] | ```
i = 5
def f(arg=i)
print(arg)
```
The `i` is evaluated at the time of definition, so the code above has the same meaning as the code below:
```
def f(arg=5)
print(arg)
```
This means that, when the function is called without arguments, `arg` will have the value `5`, no matter what the value of `i` is n... | Because the function takes its default value on the first declaration of 'i'.
Change to i=6 on the first line if you want you code to print 6.
Hope I helped ! |
65,780,026 | I have the following df:
```
dff=pd.DataFrame(index=[1]*10+[2]*10,data={'mth':list(range(1,11))*2,'pmt':[10,5,3,10,20,4,1,6,5,6]*2,'min_pmt':[5]*10+[4]*10,'Stat':[np.nan]*20,'up':[np.nan]*20,'up_cum':[np.nan]*20})
```
I have in it 2 different values in the index: customer 1 and customer 2, and for each one I have co... | 2021/01/18 | [
"https://Stackoverflow.com/questions/65780026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6659388/"
] | What others have said is true...the default is evaluated at the time of function creation, but it is not that it takes the "value of i" at the time of creation. The default is assigned the *object* referred to by "i" at the time of creation. This is an important point, because if that object is mutable, the default can... | This is because you are assigning the value when the function is created. `arg` at the time of creation will be defaulted to what `i` is in that moment. Since at the time of the function being created the value of `i` is 5 then that's what the default value of that argument becomes. After the initial creation of the fu... |
65,780,026 | I have the following df:
```
dff=pd.DataFrame(index=[1]*10+[2]*10,data={'mth':list(range(1,11))*2,'pmt':[10,5,3,10,20,4,1,6,5,6]*2,'min_pmt':[5]*10+[4]*10,'Stat':[np.nan]*20,'up':[np.nan]*20,'up_cum':[np.nan]*20})
```
I have in it 2 different values in the index: customer 1 and customer 2, and for each one I have co... | 2021/01/18 | [
"https://Stackoverflow.com/questions/65780026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6659388/"
] | Because the function takes its default value on the first declaration of 'i'.
Change to i=6 on the first line if you want you code to print 6.
Hope I helped ! | This is the difference between something being handled by reference vs by value. When you defined the function `f` you told it to set the argument's default value to `i` this is done by value, not by reference, so it took whatever the value of `i` was at that time and set the default for the function to that. Changing ... |
65,780,026 | I have the following df:
```
dff=pd.DataFrame(index=[1]*10+[2]*10,data={'mth':list(range(1,11))*2,'pmt':[10,5,3,10,20,4,1,6,5,6]*2,'min_pmt':[5]*10+[4]*10,'Stat':[np.nan]*20,'up':[np.nan]*20,'up_cum':[np.nan]*20})
```
I have in it 2 different values in the index: customer 1 and customer 2, and for each one I have co... | 2021/01/18 | [
"https://Stackoverflow.com/questions/65780026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6659388/"
] | ```
i = 5
def f(arg=i)
print(arg)
```
The `i` is evaluated at the time of definition, so the code above has the same meaning as the code below:
```
def f(arg=5)
print(arg)
```
This means that, when the function is called without arguments, `arg` will have the value `5`, no matter what the value of `i` is n... | What others have said is true...the default is evaluated at the time of function creation, but it is not that it takes the "value of i" at the time of creation. The default is assigned the *object* referred to by "i" at the time of creation. This is an important point, because if that object is mutable, the default can... |
65,780,026 | I have the following df:
```
dff=pd.DataFrame(index=[1]*10+[2]*10,data={'mth':list(range(1,11))*2,'pmt':[10,5,3,10,20,4,1,6,5,6]*2,'min_pmt':[5]*10+[4]*10,'Stat':[np.nan]*20,'up':[np.nan]*20,'up_cum':[np.nan]*20})
```
I have in it 2 different values in the index: customer 1 and customer 2, and for each one I have co... | 2021/01/18 | [
"https://Stackoverflow.com/questions/65780026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6659388/"
] | Because the function takes its default value on the first declaration of 'i'.
Change to i=6 on the first line if you want you code to print 6.
Hope I helped ! | What others have said is true...the default is evaluated at the time of function creation, but it is not that it takes the "value of i" at the time of creation. The default is assigned the *object* referred to by "i" at the time of creation. This is an important point, because if that object is mutable, the default can... |
65,780,026 | I have the following df:
```
dff=pd.DataFrame(index=[1]*10+[2]*10,data={'mth':list(range(1,11))*2,'pmt':[10,5,3,10,20,4,1,6,5,6]*2,'min_pmt':[5]*10+[4]*10,'Stat':[np.nan]*20,'up':[np.nan]*20,'up_cum':[np.nan]*20})
```
I have in it 2 different values in the index: customer 1 and customer 2, and for each one I have co... | 2021/01/18 | [
"https://Stackoverflow.com/questions/65780026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6659388/"
] | ```
i = 5
def f(arg=i)
print(arg)
```
The `i` is evaluated at the time of definition, so the code above has the same meaning as the code below:
```
def f(arg=5)
print(arg)
```
This means that, when the function is called without arguments, `arg` will have the value `5`, no matter what the value of `i` is n... | This is because you are assigning the value when the function is created. `arg` at the time of creation will be defaulted to what `i` is in that moment. Since at the time of the function being created the value of `i` is 5 then that's what the default value of that argument becomes. After the initial creation of the fu... |
65,780,026 | I have the following df:
```
dff=pd.DataFrame(index=[1]*10+[2]*10,data={'mth':list(range(1,11))*2,'pmt':[10,5,3,10,20,4,1,6,5,6]*2,'min_pmt':[5]*10+[4]*10,'Stat':[np.nan]*20,'up':[np.nan]*20,'up_cum':[np.nan]*20})
```
I have in it 2 different values in the index: customer 1 and customer 2, and for each one I have co... | 2021/01/18 | [
"https://Stackoverflow.com/questions/65780026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6659388/"
] | ```
i = 5
def f(arg=i)
print(arg)
```
The `i` is evaluated at the time of definition, so the code above has the same meaning as the code below:
```
def f(arg=5)
print(arg)
```
This means that, when the function is called without arguments, `arg` will have the value `5`, no matter what the value of `i` is n... | This is the difference between something being handled by reference vs by value. When you defined the function `f` you told it to set the argument's default value to `i` this is done by value, not by reference, so it took whatever the value of `i` was at that time and set the default for the function to that. Changing ... |
65,780,026 | I have the following df:
```
dff=pd.DataFrame(index=[1]*10+[2]*10,data={'mth':list(range(1,11))*2,'pmt':[10,5,3,10,20,4,1,6,5,6]*2,'min_pmt':[5]*10+[4]*10,'Stat':[np.nan]*20,'up':[np.nan]*20,'up_cum':[np.nan]*20})
```
I have in it 2 different values in the index: customer 1 and customer 2, and for each one I have co... | 2021/01/18 | [
"https://Stackoverflow.com/questions/65780026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6659388/"
] | This is the difference between something being handled by reference vs by value. When you defined the function `f` you told it to set the argument's default value to `i` this is done by value, not by reference, so it took whatever the value of `i` was at that time and set the default for the function to that. Changing ... | This is because you are assigning the value when the function is created. `arg` at the time of creation will be defaulted to what `i` is in that moment. Since at the time of the function being created the value of `i` is 5 then that's what the default value of that argument becomes. After the initial creation of the fu... |
65,780,026 | I have the following df:
```
dff=pd.DataFrame(index=[1]*10+[2]*10,data={'mth':list(range(1,11))*2,'pmt':[10,5,3,10,20,4,1,6,5,6]*2,'min_pmt':[5]*10+[4]*10,'Stat':[np.nan]*20,'up':[np.nan]*20,'up_cum':[np.nan]*20})
```
I have in it 2 different values in the index: customer 1 and customer 2, and for each one I have co... | 2021/01/18 | [
"https://Stackoverflow.com/questions/65780026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6659388/"
] | Because the function takes its default value on the first declaration of 'i'.
Change to i=6 on the first line if you want you code to print 6.
Hope I helped ! | This is because you are assigning the value when the function is created. `arg` at the time of creation will be defaulted to what `i` is in that moment. Since at the time of the function being created the value of `i` is 5 then that's what the default value of that argument becomes. After the initial creation of the fu... |
90,014 | I still can't wrap my head around this one and have to consult references every time I want to be safe:
* Is it "0.4 point" or "0.4 points"?
* Is it "1.0 point" or "1.0 points"?
I know that I can work around that by using ***four tenths of a point*** or ***one point*** instead, but sometimes writing ***0.4 point/poin... | 2016/05/15 | [
"https://ell.stackexchange.com/questions/90014",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/3281/"
] | I started analyzing this question by trying to figure out a context where I might use this. I thought of a gymnastics meet, where someone might say:
>
> *Alex lost by X points*.
>
>
>
If X = 1, the answer is obvious. If X = 1.0, though, the answer isn't so clear, particularly if the it's presumed the speaker wou... | The simple rule is that 1 is singular and anything else is plural so 1.0 point all else is plural as it is a multiple or fraction of 1. However, in the written form 0.5 points would be half point |
222,793 | Let's say I have a character that is obsessed with drinking warm tea (or cider, or...).
Tea needs to be steeped at a high temperature; say, 90°c. However, drinking it at that temperature will result in burns. My character would prefer to drink her tea at 50°c... and she's impatient. Sipping it slowly or waiting for it... | 2022/01/20 | [
"https://worldbuilding.stackexchange.com/questions/222793",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/43697/"
] | **Are you sure about the 2800W ?**
Q: *"Can cool 1 liter of beverage in "a few" minutes. Ideally, one"*
I expect you can do with far less, if you have a full 60 seconds.
**Proposed experiment**
There's easy heat transfer. Let's avoid ceramics, glass, or paper,
.. take a metal tea pot, cylindrical, single wand
[![... | Prepare a large canister with a hand pump and cooling fins. Manually (or electrically) pump the canister full and let it cool.
The tea can be then poured in a container with a perforated partition on the bottom, so that the compressed air bubbles through the tea, expanding and cooling. Having lots of tiny bubbles ensu... |
222,793 | Let's say I have a character that is obsessed with drinking warm tea (or cider, or...).
Tea needs to be steeped at a high temperature; say, 90°c. However, drinking it at that temperature will result in burns. My character would prefer to drink her tea at 50°c... and she's impatient. Sipping it slowly or waiting for it... | 2022/01/20 | [
"https://worldbuilding.stackexchange.com/questions/222793",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/43697/"
] | **Are you sure about the 2800W ?**
Q: *"Can cool 1 liter of beverage in "a few" minutes. Ideally, one"*
I expect you can do with far less, if you have a full 60 seconds.
**Proposed experiment**
There's easy heat transfer. Let's avoid ceramics, glass, or paper,
.. take a metal tea pot, cylindrical, single wand
[![... | Why wouldn't the character just use a modifed heat exchanger? AKA HVAC, refrigerator etc.
For the specific device:
Just need a top reservoir that user can dump drink into or another device can dump into. A middle heat exchanger block that pre regulated to be suitable for the drink temperature. Then lower chamber with ... |
222,793 | Let's say I have a character that is obsessed with drinking warm tea (or cider, or...).
Tea needs to be steeped at a high temperature; say, 90°c. However, drinking it at that temperature will result in burns. My character would prefer to drink her tea at 50°c... and she's impatient. Sipping it slowly or waiting for it... | 2022/01/20 | [
"https://worldbuilding.stackexchange.com/questions/222793",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/43697/"
] | Bowl of ice. On top, a flat saucer. Pour the hot tea in. The more shallow the saucer and so the greater the surface area, the quicker it will be. | Prepare a large canister with a hand pump and cooling fins. Manually (or electrically) pump the canister full and let it cool.
The tea can be then poured in a container with a perforated partition on the bottom, so that the compressed air bubbles through the tea, expanding and cooling. Having lots of tiny bubbles ensu... |
222,793 | Let's say I have a character that is obsessed with drinking warm tea (or cider, or...).
Tea needs to be steeped at a high temperature; say, 90°c. However, drinking it at that temperature will result in burns. My character would prefer to drink her tea at 50°c... and she's impatient. Sipping it slowly or waiting for it... | 2022/01/20 | [
"https://worldbuilding.stackexchange.com/questions/222793",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/43697/"
] | Bowl of ice. On top, a flat saucer. Pour the hot tea in. The more shallow the saucer and so the greater the surface area, the quicker it will be. | Why wouldn't the character just use a modifed heat exchanger? AKA HVAC, refrigerator etc.
For the specific device:
Just need a top reservoir that user can dump drink into or another device can dump into. A middle heat exchanger block that pre regulated to be suitable for the drink temperature. Then lower chamber with ... |
222,793 | Let's say I have a character that is obsessed with drinking warm tea (or cider, or...).
Tea needs to be steeped at a high temperature; say, 90°c. However, drinking it at that temperature will result in burns. My character would prefer to drink her tea at 50°c... and she's impatient. Sipping it slowly or waiting for it... | 2022/01/20 | [
"https://worldbuilding.stackexchange.com/questions/222793",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/43697/"
] | Prepare a large canister with a hand pump and cooling fins. Manually (or electrically) pump the canister full and let it cool.
The tea can be then poured in a container with a perforated partition on the bottom, so that the compressed air bubbles through the tea, expanding and cooling. Having lots of tiny bubbles ensu... | Why wouldn't the character just use a modifed heat exchanger? AKA HVAC, refrigerator etc.
For the specific device:
Just need a top reservoir that user can dump drink into or another device can dump into. A middle heat exchanger block that pre regulated to be suitable for the drink temperature. Then lower chamber with ... |
610,109 | Prove or disprove: Every commutative binary operation on a set having just $2$ elements is associative. This is from John Fraleigh's 7th edition of A First Course in Abstract Algebra.

First of all, how did they realize this is false?
Second, how did... | 2013/12/17 | [
"https://math.stackexchange.com/questions/610109",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | While the example can be constructed easily enough by reasoning of the sort that you used, there is another very straightforward possibility. Since the operation is commutative, we must have $a\*b=b\*a$. There are $2$ independent choices each for $a\*a$, $a\*b$, and $b\*b$, and once these are made, the operation is def... | For $(a\cdot b)\cdot a$,let $a\cdot b=b\cdot a=a$,then $(a\cdot b)\cdot a=a\cdot a$
But $a\cdot(b\cdot a)=a\cdot a$.how say associative is false? |
26,298,208 | I am making a phonegap project. I have made a native plugin in android for it. In it, AsyncTask is being called too. In it, I have `context.startActivity(intent)` function. I want to perform a task after this Activity completes. I found a solution to use `context.startActivityForResult(intent,i)` instead. But this func... | 2014/10/10 | [
"https://Stackoverflow.com/questions/26298208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3982220/"
] | This should work:
`$add_button = "[<a href='javascript:pop_booking_item_add({ID})'>Add New Item</a>]";`
or
`$add_button = "[<a href=\"javascript:pop_booking_item_add({ID})\">Add New Item</a>]";` | `"` is a valid replacement for `'` or `"` in mixed HTML / javascript. Have you tried with :
```php
$add_button = "[<a href="javascript:pop_booking_item_add({ID});">Add New Item</a>]";
``` |
26,298,208 | I am making a phonegap project. I have made a native plugin in android for it. In it, AsyncTask is being called too. In it, I have `context.startActivity(intent)` function. I want to perform a task after this Activity completes. I found a solution to use `context.startActivityForResult(intent,i)` instead. But this func... | 2014/10/10 | [
"https://Stackoverflow.com/questions/26298208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3982220/"
] | `"` is a valid replacement for `'` or `"` in mixed HTML / javascript. Have you tried with :
```php
$add_button = "[<a href="javascript:pop_booking_item_add({ID});">Add New Item</a>]";
``` | isn't it better to do it like this?
```
<a href="#" class="classnameofyourlink" data-id="3">link</a>
[].forEach.call(document.querySelectorAll('.classnameofyourlink'), function (el) {
el.addEventListener('click', function() {
// put your stuff here
// retrieve the {{ID}} like this: this.getAttribu... |
26,298,208 | I am making a phonegap project. I have made a native plugin in android for it. In it, AsyncTask is being called too. In it, I have `context.startActivity(intent)` function. I want to perform a task after this Activity completes. I found a solution to use `context.startActivityForResult(intent,i)` instead. But this func... | 2014/10/10 | [
"https://Stackoverflow.com/questions/26298208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3982220/"
] | This should work:
`$add_button = "[<a href='javascript:pop_booking_item_add({ID})'>Add New Item</a>]";`
or
`$add_button = "[<a href=\"javascript:pop_booking_item_add({ID})\">Add New Item</a>]";` | isn't it better to do it like this?
```
<a href="#" class="classnameofyourlink" data-id="3">link</a>
[].forEach.call(document.querySelectorAll('.classnameofyourlink'), function (el) {
el.addEventListener('click', function() {
// put your stuff here
// retrieve the {{ID}} like this: this.getAttribu... |
12,560,443 | I was reading about external blob storage in SQL Server and was wondering how this relates to the database size. When talking SQL Server Express, you have a limit in database size (for 2008 it's 10GB I believe). So how about your ESB storage? Is that taken into account for this limit, or does it only count the actual `... | 2012/09/24 | [
"https://Stackoverflow.com/questions/12560443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/122036/"
] | The 10gb size limit concerns the `.mdf` only - no limit on the `.ldf`.
Also, in SQL Server 2008 - the database size limit does **not** apply to data stored as `FILESTREAM` in your database (see [FILESTREAM compatibility](http://msdn.microsoft.com/en-us/library/bb895334.aspx): *SQL Server Express supports FILESTREAM. T... | FILESTREAM size is [not accounted against the total 10Gb restriction size](http://technet.microsoft.com/en-us/library/bb895334.aspx#SQLServerExpress).
>
> SQL Server Express supports FILESTREAM. The 10-GB database size limit
> does not include the FILESTREAM data container.
>
>
>
But the [Remote Blob Store](http... |
12,446,849 | My phone has a strange problem: the touchscreen doesn't work when unplugged from the charger.
I want to try to fool Android by sending a broadcast (or whatever) that will make the system think it's charging so that my touchscreen starts working.
Should I send a broadcast event `ACTION_POWER_CONNECTED` via code? or som... | 2012/09/16 | [
"https://Stackoverflow.com/questions/12446849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1675613/"
] | You seem to have a hardware problem. While you can't send system broadcasts from your own processes, even if you could, I doubt it would fix your touchscreen. | As 323go has suggested , you might have a hardware problem. So broadcasting an intent might not help.Anyway If you have a rooted phone, On adb shell give below command
```
am broadcast -a android.intent.action.YOURINTENT
``` |
38,609,404 | I have a `Datagrid` where a add items using `grid.Items.Insert(0, row);`
I always want the last row I insert to be displayed first on Grid.
I also want the 1st row to have different color from others. For this purpose I am using `LoadingRow` event :
```
private void dataGrid_LoadingRow(object sender, DataGridRowEventA... | 2016/07/27 | [
"https://Stackoverflow.com/questions/38609404",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1000827/"
] | You can replace string using regex,
```
output = re.sub(r'(?is)(href="../)([^.])','http://www.phonebook.com.pk/'+r'\2',str(html))
``` | Try using the following:
```
linkList1 = re.findall(re.compile(u'(?<=href=")../\w.*?(?=")'), str(html))
```
That guarantees that there has to be a word character after the slash. |
38,609,404 | I have a `Datagrid` where a add items using `grid.Items.Insert(0, row);`
I always want the last row I insert to be displayed first on Grid.
I also want the 1st row to have different color from others. For this purpose I am using `LoadingRow` event :
```
private void dataGrid_LoadingRow(object sender, DataGridRowEventA... | 2016/07/27 | [
"https://Stackoverflow.com/questions/38609404",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1000827/"
] | By Using BeautifulSoup as requested :
```
from bs4 import Beautifulsoup
soup = BeautifulSoup(html)
all = soup.select('li')
for i in all:
try:
output = re.sub(r'(?is)(href="../)([^.])','http://www.phonebook.com.pk/'+r'\2',str(i))
except:
output = i
print(output)
``` | Try using the following:
```
linkList1 = re.findall(re.compile(u'(?<=href=")../\w.*?(?=")'), str(html))
```
That guarantees that there has to be a word character after the slash. |
38,609,404 | I have a `Datagrid` where a add items using `grid.Items.Insert(0, row);`
I always want the last row I insert to be displayed first on Grid.
I also want the 1st row to have different color from others. For this purpose I am using `LoadingRow` event :
```
private void dataGrid_LoadingRow(object sender, DataGridRowEventA... | 2016/07/27 | [
"https://Stackoverflow.com/questions/38609404",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1000827/"
] | By Using BeautifulSoup as requested :
```
from bs4 import Beautifulsoup
soup = BeautifulSoup(html)
all = soup.select('li')
for i in all:
try:
output = re.sub(r'(?is)(href="../)([^.])','http://www.phonebook.com.pk/'+r'\2',str(i))
except:
output = i
print(output)
``` | You can replace string using regex,
```
output = re.sub(r'(?is)(href="../)([^.])','http://www.phonebook.com.pk/'+r'\2',str(html))
``` |
48,268,424 | i am working on javascript to create weight conversion . but unfortunately i am not getting correct outut rather then i am getting **NaN** in my required text fields
```js
<script>
function Convert(valNum) {
document.getElementById("outputPounds").innerHTML=valNum*2.2046;
document.getElementById("outputGrams").... | 2018/01/15 | [
"https://Stackoverflow.com/questions/48268424",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9220733/"
] | Try this:
```js
function Convert() {
var valNum = document.getElementById("kgid").value;
document.getElementById("outputPounds").innerHTML=valNum*2.2046;
document.getElementById("outputGrams").innerHTML=valNum*1000;
document.getElementById("outputMilligrams").innerHTML=valNum*1000000;
docum... | You could also use parseInt inside your function.
Browsers sometime interpret the number as string, input from text field, resulting in NaN
```
<script>
function Convert(v) {
var valNum = parseInt(v);
//or var valNum = Number(v);
document.getElementById("outputPounds").innerHTML=valNum*2.2046;
document.getE... |
48,174,134 | I'm using post title for url hash, like this:
```
window.location.hash = news_title;
```
Yes, it works good but like this:
```
http://example.com/news.html#This%20Is%20Kul%C3%BCb%C3%BC%20%E2%80%93%20News%20Build
```
Because some titles contain spaces and special characters.
I tried that but its not working:
```... | 2018/01/09 | [
"https://Stackoverflow.com/questions/48174134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9185196/"
] | That is correct behavior for SQL Server. Some databases allow aliases in the `GROUP BY`. SQL Server is not one of them.
Databases are also inconsistent about aliases in the `HAVING` clause. However, most databases allow aliases in the `ORDER BY` -- some (such as Hive) even require aliases there, not allowing functiona... | Use can use `cross apply` if you don't want to repeat the expression twice
```
SELECT ca.DOW,
Revenue = Sum(subtotal),
Orders = Count(*),
RPO = Sum(subtotal)
FROM sales.salesorderheader
CROSS apply (SELECT Datename(dw, orderdate)) ca (DOW)
WHERE Year(orderdate) = 2008
AND OnlineO... |
23,636,158 | I've got a gem (authy's devise gem) where I want to render a different layout than the application layout. It seems like I need to extend their controller DeviseAuthyController, but I'm not sure how to go about doing that How can I accomplish this when the controller is embedded in the gem? | 2014/05/13 | [
"https://Stackoverflow.com/questions/23636158",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48784/"
] | You can just put a `devise.html.erb` under `/app/views/layouts` and all devise views will grab that one. | There's a method called [`devise_controller?`](http://rubydoc.info/github/plataformatec/devise/master/Devise/Controllers/Helpers#devise_controller?-instance_method) which Devise introduces - perhaps it will work for you:
```
#app/controllers/application_controller.rb
class ApplicationController < ActionController::Bas... |
12,089,796 | I have an ImageView.
I set it in xml as below:
```
<ImageView
android:id="@+id/background"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
```
And set image as below:
```
ImageView background
background.setImageBitmap(bitmap);
```
But if the ImageView's parent layout n... | 2012/08/23 | [
"https://Stackoverflow.com/questions/12089796",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1070896/"
] | Try setting [adjustViewBounds](http://developer.android.com/reference/android/widget/ImageView.html#attr_android:adjustViewBounds) parameter to true on the ImageView.
```
<ImageView
android:id="@+id/background"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBoun... | Why don't you use `scaledBitmap` like this
```
Bitmap bMap = Bitmap.createScaledBitmap(chosenBitmap, needed_width, needed_height, true);
imageView.setImageBitmap(bMap);
``` |
745,599 | As the title suggest I am basically screwed. Before all this happen; I had one problem: My group policies were not replicating from PDC to other DCs. I have three Dc's in production.

 in a form. I want the text in the textbox to be higlighted whenever it gets foucs. The code for that looks like:
```
Private Sub txtBillNo_GotFocus(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtBillNo.GotFocus
HoverText(txtBillNo)
End Sub
Private Sub HoverTe... | 2013/01/13 | [
"https://Stackoverflow.com/questions/14302386",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1175279/"
] | You can list all your textboxes in the `Handles` clause:
```
Private Sub atextbox_GotFocus(ByVal sender As System.Object, ByVal e As _
System.EventArgs) _
Handles txt1.GotFocus, _
txt2.GotFocus, _
txt3.GotFocus, _
(...remaining text boxes..)
... | The .NET way to alter the behavior of a class is to derive a new one. That's well supported by VB.NET and Winforms as well. For any class derived from Control, you can intercept an event by overriding the protected OnXxx event where Xxx is the event name. You should be using the Enter event btw. Use Project + Add Class... |
31,015,119 | I read all the answers from [Does it help GC to null local variables in Java](https://stackoverflow.com/questions/473685/does-it-help-gc-to-null-local-variables-in-java) where everybody agrees that by nullifying a local variable in Java does not help the GC (with some specific exceptions mentioned there). However I ref... | 2015/06/23 | [
"https://Stackoverflow.com/questions/31015119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3969395/"
] | All versions of C++, and C since C99, add an implicit `return 0;` at the end of main before falling off the end.
C89 (which is the default for most compilers) does not, so it is UB if you actually return from main by falling off the end.
Edit: In practice (assuming you are running without sanitizers), this means that... | You forgot the return statement in the end of main indicating success. |
63,984,312 | My question is how to make a vandermonde matrix. This is the definition:
In linear algebra, a Vandermonde matrix, named after Alexandre-Théophile Vandermonde, is a matrix with the terms of a geometric progression in each row, i.e., an m × n matrix
I would like to make a 4\*4 version of this.
So farI have defined valu... | 2020/09/20 | [
"https://Stackoverflow.com/questions/63984312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10634786/"
] | Given a starting column `a` of length `m` you can create a Vandermonde matrix `v` with `n` columns `a**0` to `a**(n-1)`like so:
```
import numpy as np
m = 4
n = 4
a = range(1, m+1)
v = np.array([a]*n).T**range(n)
print(v)
#[[ 1 1 1 1]
# [ 1 2 4 8]
# [ 1 3 9 27]
# [ 1 4 16 64]]
``` | As proposed by [michael szczesny](https://stackoverflow.com/users/14277722/michael-szczesny) you could use [numpy.vander](https://numpy.org/doc/stable/reference/generated/numpy.vander.html).
But this will **not** be according to the definition on [Wikipedia](https://en.wikipedia.org/wiki/Vandermonde_matrix).
```
x = n... |
40,882,567 | Has anyone come across problems with the Browse for Folder panel under the Option button in the native burn bundle BA?
I have an Edit box that specifies where the install location is. It is set to a default location. Pressing the Browse button launches a directory list (Browse for Folder) for picking another installat... | 2016/11/30 | [
"https://Stackoverflow.com/questions/40882567",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7045325/"
] | ```
JArray array = JsonConvert.DeserializeObject<JArray>(json);
foreach(JObject item in array)
{
var a = item.Children<JProperty>().FirstOrDefault().Name;
var b = item.Children<JProperty>().FirstOrDefault().Value;
}
```
Here if you have only one property in every element of the array. If you have multiple p... | You can deserialize your json string to a `List<Dictionary<string, string>>`
```
List<Dictionary<string, string>> list = JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(str);
```
Then loop this list
```
List<string> values = new List<string>();
foreach(Dictionary<string, string> dict in list)
{
... |
178,468 | I have a question about changing the default sender From name/email on default wp\_mail notifications (e.g., Lost Password response), but WITHOUT it messing up notifications being passed on by Gravity Forms.
I've found a few threads on changing the default From name/email, and this is what I ended up using. It did wor... | 2015/02/17 | [
"https://wordpress.stackexchange.com/questions/178468",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/67697/"
] | I think I found the answer on another forum discussing using Contact Form7, with the same issue I was having.
This is what I got from that thread and tried. It does appear to work and does appear to be only targeting email from the default 'Wordpress' sender name/email.
```
// Change default WP email sender
add_filte... | I had a related issue and coded a plugin a few weeks ago. [WP-HTML Mail](http://wp-html-mail.com) doesn't support gravity forms now, but if you decide to change you form to Ninja Forms, the plugin is perfect for you.
I added detectors for plugins to find out which plugin just sent the mail.
Changing formatting and send... |
178,468 | I have a question about changing the default sender From name/email on default wp\_mail notifications (e.g., Lost Password response), but WITHOUT it messing up notifications being passed on by Gravity Forms.
I've found a few threads on changing the default From name/email, and this is what I ended up using. It did wor... | 2015/02/17 | [
"https://wordpress.stackexchange.com/questions/178468",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/67697/"
] | I think I found the answer on another forum discussing using Contact Form7, with the same issue I was having.
This is what I got from that thread and tried. It does appear to work and does appear to be only targeting email from the default 'Wordpress' sender name/email.
```
// Change default WP email sender
add_filte... | I have an SMTP plugin that will set the default Sender Address and Sender Name, but still allow plugins (like Gravity Forms) to override these values.
<https://wordpress.org/plugins/postman-smtp/>
Having said that, depending on who your email accounts belong to, changing the Sender Email address to a different value ... |
1,982,822 | I have a program which has multiple objects of type PublisherTask and SubscriberTask.
A given subscriber can be subscribed to one or more Publishers.
To describe my problem I will post some code....
```
abstract class Publication {
// some published information
}
class ConcretePublicationA extends Publication ... | 2009/12/30 | [
"https://Stackoverflow.com/questions/1982822",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Yes, it's possible to peek at all the elements of a ConcurrentLinkedQueue using an iterator.
```
Iterator<Publication> itr = newPublications.iterator();
while (itr.hasNext()) {
Publication existing = itr.next();
if (existing.getClass().equals(pub)) {
itr.remove();
}
}
```
Because the iterator returned... | I've solved this problem (or similar) before. The way that I solved it was to effectively embed a counter in every new Publication object (you would need a counter per class type for what you are doing). When you read the publication objects off the queue if the counter within the consumed object is less than the curre... |
15,608,876 | I am working on a script in which I need to supply the PID of my application. I am able to list all the processes with their PIDs by following command and could see the entry of my application.
>
> adb shell ps
>
>
>
This gives me a huge list of processes. And I need a single entry (which I can further supply to ... | 2013/03/25 | [
"https://Stackoverflow.com/questions/15608876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1723001/"
] | Since Android 7.0 the easiest way to find out the process ID by package name is to use `pidof` command:
```
usage: pidof [-s] [-o omitpid[,omitpid...]] [NAME]...
Print the PIDs of all processes with the given names.
-s single shot, only return one pid.
-o omit PID(s)
```
Just run it like this:
```
adb s... | The processes shown by ps can be limited to those belonging to any given user by piping the output through grep, a filter that is used for searching text. For example, processes belonging to a user with a username adam can be displayed with the following:
```
ps -ef | grep adam
```
The -e option generates a list of ... |
15,608,876 | I am working on a script in which I need to supply the PID of my application. I am able to list all the processes with their PIDs by following command and could see the entry of my application.
>
> adb shell ps
>
>
>
This gives me a huge list of processes. And I need a single entry (which I can further supply to ... | 2013/03/25 | [
"https://Stackoverflow.com/questions/15608876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1723001/"
] | Instead of using `adb shell ps`, firstly enter `adb shell` and then use `ps`.
**Step by step:**
1. Enter `adb shell` command while a device (or emulator) is connected.
(Command line prefix will be `shell@android:/ $` after executing this command.)
2. Enter `ps | grep <package_name_to_be_filtered>` (i.e. `ps | grep ... | The processes shown by ps can be limited to those belonging to any given user by piping the output through grep, a filter that is used for searching text. For example, processes belonging to a user with a username adam can be displayed with the following:
```
ps -ef | grep adam
```
The -e option generates a list of ... |
15,608,876 | I am working on a script in which I need to supply the PID of my application. I am able to list all the processes with their PIDs by following command and could see the entry of my application.
>
> adb shell ps
>
>
>
This gives me a huge list of processes. And I need a single entry (which I can further supply to ... | 2013/03/25 | [
"https://Stackoverflow.com/questions/15608876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1723001/"
] | Since Android 7.0 the easiest way to find out the process ID by package name is to use `pidof` command:
```
usage: pidof [-s] [-o omitpid[,omitpid...]] [NAME]...
Print the PIDs of all processes with the given names.
-s single shot, only return one pid.
-o omit PID(s)
```
Just run it like this:
```
adb s... | Instead of using `adb shell ps`, firstly enter `adb shell` and then use `ps`.
**Step by step:**
1. Enter `adb shell` command while a device (or emulator) is connected.
(Command line prefix will be `shell@android:/ $` after executing this command.)
2. Enter `ps | grep <package_name_to_be_filtered>` (i.e. `ps | grep ... |
15,608,876 | I am working on a script in which I need to supply the PID of my application. I am able to list all the processes with their PIDs by following command and could see the entry of my application.
>
> adb shell ps
>
>
>
This gives me a huge list of processes. And I need a single entry (which I can further supply to ... | 2013/03/25 | [
"https://Stackoverflow.com/questions/15608876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1723001/"
] | Since Android 7.0 the easiest way to find out the process ID by package name is to use `pidof` command:
```
usage: pidof [-s] [-o omitpid[,omitpid...]] [NAME]...
Print the PIDs of all processes with the given names.
-s single shot, only return one pid.
-o omit PID(s)
```
Just run it like this:
```
adb s... | [Alex P.'s answer](https://stackoverflow.com/a/15622698) is technically answering the question "Find out the running process ID by *process name*", and not "Find out the running process ID by *package name*". The difference is subtle, and manifests in process renames via the "android:process" attribute in the `<activit... |
15,608,876 | I am working on a script in which I need to supply the PID of my application. I am able to list all the processes with their PIDs by following command and could see the entry of my application.
>
> adb shell ps
>
>
>
This gives me a huge list of processes. And I need a single entry (which I can further supply to ... | 2013/03/25 | [
"https://Stackoverflow.com/questions/15608876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1723001/"
] | Instead of using `adb shell ps`, firstly enter `adb shell` and then use `ps`.
**Step by step:**
1. Enter `adb shell` command while a device (or emulator) is connected.
(Command line prefix will be `shell@android:/ $` after executing this command.)
2. Enter `ps | grep <package_name_to_be_filtered>` (i.e. `ps | grep ... | [Alex P.'s answer](https://stackoverflow.com/a/15622698) is technically answering the question "Find out the running process ID by *process name*", and not "Find out the running process ID by *package name*". The difference is subtle, and manifests in process renames via the "android:process" attribute in the `<activit... |
3,599,410 | The usual definition of a category states: a category $\mathbf{C}$ consists of:
1. A collection $\text{ob}(\mathbf{C})$ of *objects*
2. A collection $\text{arr}(\mathbf{C})$ of *arrows*
3. Some rules on the behaviour of these two types of objects
Leaving aside what *collection* here means, I realized that I have neve... | 2020/03/28 | [
"https://math.stackexchange.com/questions/3599410",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/365761/"
] | There are already many excellent answers, but I want to add another perspective, already partly found in other answers, but I hope distinct enough to stand on its own.
I like to explain by analogy. Consider the question, "What is a vector?"
**What *is* a vector?**
Well, you might get you any of the following informa... | Given two objects $A$ and $B$, there is an associated set/class (depending on your definition) $\operatorname{Hom}\_\mathcal{C}(A,B)$ of morphisms $A \to B$. An arrow is just such a morphism, i.e. an element of this set/class. |
3,599,410 | The usual definition of a category states: a category $\mathbf{C}$ consists of:
1. A collection $\text{ob}(\mathbf{C})$ of *objects*
2. A collection $\text{arr}(\mathbf{C})$ of *arrows*
3. Some rules on the behaviour of these two types of objects
Leaving aside what *collection* here means, I realized that I have neve... | 2020/03/28 | [
"https://math.stackexchange.com/questions/3599410",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/365761/"
] | $\text{Hom}\_C(A,B)$ can be literally any set you want and has nothing at all to do with functions $A \rightarrow B$, as long as you define what "composing" arrows means and there is an identity arrow for each object you have a category, your set of arrows can be literally any set you want. Same goes for your collectio... | I recall a really fun talk at a topology conference sometime in the late 1980s/ early 1990s. The speaker said "we're going to take as objects in a category the set of finite collections of evenly-distributed points on the $x$-axis between $x = 1$ and $x = 2$ -- we might have 3 points or 12 points or ...whatever."
OK, ... |
3,599,410 | The usual definition of a category states: a category $\mathbf{C}$ consists of:
1. A collection $\text{ob}(\mathbf{C})$ of *objects*
2. A collection $\text{arr}(\mathbf{C})$ of *arrows*
3. Some rules on the behaviour of these two types of objects
Leaving aside what *collection* here means, I realized that I have neve... | 2020/03/28 | [
"https://math.stackexchange.com/questions/3599410",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/365761/"
] | $\text{Hom}\_C(A,B)$ can be literally any set you want and has nothing at all to do with functions $A \rightarrow B$, as long as you define what "composing" arrows means and there is an identity arrow for each object you have a category, your set of arrows can be literally any set you want. Same goes for your collectio... | To respond to your first remark, the collections $ob(C)$ and $arr(C)$ are what we call $\textbf{classes}$. Naively, this means that we can think of them each as a "set," except that they do not necessarily obey the axioms that are necessary to describe them as a set in the formal sense. If this feels wishy-washy to you... |
3,599,410 | The usual definition of a category states: a category $\mathbf{C}$ consists of:
1. A collection $\text{ob}(\mathbf{C})$ of *objects*
2. A collection $\text{arr}(\mathbf{C})$ of *arrows*
3. Some rules on the behaviour of these two types of objects
Leaving aside what *collection* here means, I realized that I have neve... | 2020/03/28 | [
"https://math.stackexchange.com/questions/3599410",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/365761/"
] | $\text{Hom}\_C(A,B)$ can be literally any set you want and has nothing at all to do with functions $A \rightarrow B$, as long as you define what "composing" arrows means and there is an identity arrow for each object you have a category, your set of arrows can be literally any set you want. Same goes for your collectio... | An arrow is an element of the set of arrows. The set of arrows is any set you want.
Let me explain by talking about directed graphs. You can imagine a category as a directed graph with an associative composition law. A directed graph is something with a set of vertices $V$ and a set of directed arcs $A$ together with ... |
3,599,410 | The usual definition of a category states: a category $\mathbf{C}$ consists of:
1. A collection $\text{ob}(\mathbf{C})$ of *objects*
2. A collection $\text{arr}(\mathbf{C})$ of *arrows*
3. Some rules on the behaviour of these two types of objects
Leaving aside what *collection* here means, I realized that I have neve... | 2020/03/28 | [
"https://math.stackexchange.com/questions/3599410",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/365761/"
] | There are already many excellent answers, but I want to add another perspective, already partly found in other answers, but I hope distinct enough to stand on its own.
I like to explain by analogy. Consider the question, "What is a vector?"
**What *is* a vector?**
Well, you might get you any of the following informa... | To respond to your first remark, the collections $ob(C)$ and $arr(C)$ are what we call $\textbf{classes}$. Naively, this means that we can think of them each as a "set," except that they do not necessarily obey the axioms that are necessary to describe them as a set in the formal sense. If this feels wishy-washy to you... |
3,599,410 | The usual definition of a category states: a category $\mathbf{C}$ consists of:
1. A collection $\text{ob}(\mathbf{C})$ of *objects*
2. A collection $\text{arr}(\mathbf{C})$ of *arrows*
3. Some rules on the behaviour of these two types of objects
Leaving aside what *collection* here means, I realized that I have neve... | 2020/03/28 | [
"https://math.stackexchange.com/questions/3599410",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/365761/"
] | There are already many excellent answers, but I want to add another perspective, already partly found in other answers, but I hope distinct enough to stand on its own.
I like to explain by analogy. Consider the question, "What is a vector?"
**What *is* a vector?**
Well, you might get you any of the following informa... | I recall a really fun talk at a topology conference sometime in the late 1980s/ early 1990s. The speaker said "we're going to take as objects in a category the set of finite collections of evenly-distributed points on the $x$-axis between $x = 1$ and $x = 2$ -- we might have 3 points or 12 points or ...whatever."
OK, ... |
3,599,410 | The usual definition of a category states: a category $\mathbf{C}$ consists of:
1. A collection $\text{ob}(\mathbf{C})$ of *objects*
2. A collection $\text{arr}(\mathbf{C})$ of *arrows*
3. Some rules on the behaviour of these two types of objects
Leaving aside what *collection* here means, I realized that I have neve... | 2020/03/28 | [
"https://math.stackexchange.com/questions/3599410",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/365761/"
] | There are already many excellent answers, but I want to add another perspective, already partly found in other answers, but I hope distinct enough to stand on its own.
I like to explain by analogy. Consider the question, "What is a vector?"
**What *is* a vector?**
Well, you might get you any of the following informa... | An arrow is an element of the set of arrows. The set of arrows is any set you want.
Let me explain by talking about directed graphs. You can imagine a category as a directed graph with an associative composition law. A directed graph is something with a set of vertices $V$ and a set of directed arcs $A$ together with ... |
3,599,410 | The usual definition of a category states: a category $\mathbf{C}$ consists of:
1. A collection $\text{ob}(\mathbf{C})$ of *objects*
2. A collection $\text{arr}(\mathbf{C})$ of *arrows*
3. Some rules on the behaviour of these two types of objects
Leaving aside what *collection* here means, I realized that I have neve... | 2020/03/28 | [
"https://math.stackexchange.com/questions/3599410",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/365761/"
] | I recall a really fun talk at a topology conference sometime in the late 1980s/ early 1990s. The speaker said "we're going to take as objects in a category the set of finite collections of evenly-distributed points on the $x$-axis between $x = 1$ and $x = 2$ -- we might have 3 points or 12 points or ...whatever."
OK, ... | To respond to your first remark, the collections $ob(C)$ and $arr(C)$ are what we call $\textbf{classes}$. Naively, this means that we can think of them each as a "set," except that they do not necessarily obey the axioms that are necessary to describe them as a set in the formal sense. If this feels wishy-washy to you... |
3,599,410 | The usual definition of a category states: a category $\mathbf{C}$ consists of:
1. A collection $\text{ob}(\mathbf{C})$ of *objects*
2. A collection $\text{arr}(\mathbf{C})$ of *arrows*
3. Some rules on the behaviour of these two types of objects
Leaving aside what *collection* here means, I realized that I have neve... | 2020/03/28 | [
"https://math.stackexchange.com/questions/3599410",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/365761/"
] | An arrow is an element of the set of arrows. The set of arrows is any set you want.
Let me explain by talking about directed graphs. You can imagine a category as a directed graph with an associative composition law. A directed graph is something with a set of vertices $V$ and a set of directed arcs $A$ together with ... | Given two objects $A$ and $B$, there is an associated set/class (depending on your definition) $\operatorname{Hom}\_\mathcal{C}(A,B)$ of morphisms $A \to B$. An arrow is just such a morphism, i.e. an element of this set/class. |
3,599,410 | The usual definition of a category states: a category $\mathbf{C}$ consists of:
1. A collection $\text{ob}(\mathbf{C})$ of *objects*
2. A collection $\text{arr}(\mathbf{C})$ of *arrows*
3. Some rules on the behaviour of these two types of objects
Leaving aside what *collection* here means, I realized that I have neve... | 2020/03/28 | [
"https://math.stackexchange.com/questions/3599410",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/365761/"
] | An arrow is an element of the set of arrows. The set of arrows is any set you want.
Let me explain by talking about directed graphs. You can imagine a category as a directed graph with an associative composition law. A directed graph is something with a set of vertices $V$ and a set of directed arcs $A$ together with ... | To respond to your first remark, the collections $ob(C)$ and $arr(C)$ are what we call $\textbf{classes}$. Naively, this means that we can think of them each as a "set," except that they do not necessarily obey the axioms that are necessary to describe them as a set in the formal sense. If this feels wishy-washy to you... |
26,580,265 | I'm having difficulties dealing with character encoding. I'm trying to scrape the following url:
```
http://www.google.com/movies?near=Montreal&date=0
```
My code looks like this:
```
var http = require('http');
var url = require('url');
var Iconv = require('iconv').Iconv;
var location = 'montreal';
var googleMo... | 2014/10/27 | [
"https://Stackoverflow.com/questions/26580265",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1906344/"
] | The � characters come from the concatenation:
```
response.on('data', function(chunk) {
str += chunk;
});
```
This converts each `chunk` to a `String` with the [default `encoding` of `utf8`](http://nodejs.org/api/buffer.html#buffer_buf_tostring_encoding_start_end). Any sequences in the `Buffer`s that aren't vali... | If you set your `User-Agent` to that of a desktop browser, the meta tag in the HTML and the `Content-Type` in the response headers will have the `charset` set to UTF-8 instead of latin1. Example:
```
var dest = url.parse('http://www.google.com/movies?near=montreal');
dest.headers = {
'User-Agent': 'Mozilla/5.0 (Wind... |
26,580,265 | I'm having difficulties dealing with character encoding. I'm trying to scrape the following url:
```
http://www.google.com/movies?near=Montreal&date=0
```
My code looks like this:
```
var http = require('http');
var url = require('url');
var Iconv = require('iconv').Iconv;
var location = 'montreal';
var googleMo... | 2014/10/27 | [
"https://Stackoverflow.com/questions/26580265",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1906344/"
] | If you set your `User-Agent` to that of a desktop browser, the meta tag in the HTML and the `Content-Type` in the response headers will have the `charset` set to UTF-8 instead of latin1. Example:
```
var dest = url.parse('http://www.google.com/movies?near=montreal');
dest.headers = {
'User-Agent': 'Mozilla/5.0 (Wind... | A `Buffer`'s default encoding is UTF-8, which is a variable-width encoding system. Characters after the ASCII range are encoded using multiple bytes. If you're receiving latin1-specific characters (codepoints > 127), they'll have the first bit set, which a UTF-8 decoder will consider as a multi-byte character, eventual... |
26,580,265 | I'm having difficulties dealing with character encoding. I'm trying to scrape the following url:
```
http://www.google.com/movies?near=Montreal&date=0
```
My code looks like this:
```
var http = require('http');
var url = require('url');
var Iconv = require('iconv').Iconv;
var location = 'montreal';
var googleMo... | 2014/10/27 | [
"https://Stackoverflow.com/questions/26580265",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1906344/"
] | The � characters come from the concatenation:
```
response.on('data', function(chunk) {
str += chunk;
});
```
This converts each `chunk` to a `String` with the [default `encoding` of `utf8`](http://nodejs.org/api/buffer.html#buffer_buf_tostring_encoding_start_end). Any sequences in the `Buffer`s that aren't vali... | A `Buffer`'s default encoding is UTF-8, which is a variable-width encoding system. Characters after the ASCII range are encoded using multiple bytes. If you're receiving latin1-specific characters (codepoints > 127), they'll have the first bit set, which a UTF-8 decoder will consider as a multi-byte character, eventual... |
24,564,094 | currently I'm looking for an open source project that gives me the opportunity to install software easily. I prefer direct calls or access with a REST interface.
I thought that CloudFoundry would fits my needs but it is'nt so.
AppFog (<https://www.appfog.com/product/>) comes much closer to my goal. It allows me to in... | 2014/07/03 | [
"https://Stackoverflow.com/questions/24564094",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1477415/"
] | [Docker](http://docker.com) is seems to be the next big thing in the PaaS world. There are dozens new projects that build on top of docker or supporting it. For example OpenShift and Apache Stratos support docker. So if you look at solutions based on docker you can find a solution for you needs.
Right now I'm using do... | Tobias,
Suggest you look at **Apache Stratos:**
* 100% open source
* Easy to Get Up and Running
* Highly extensible, flexible, expandable
* Uses REST APIs
* Runs on Linux (Ubuntu or SUSE)
* Mature (version 4)
See:
* **Intro article -- "Why Apache Stratos is the Preferred Choice in the PaaS Space"**
<http://wso2.com... |
24,564,094 | currently I'm looking for an open source project that gives me the opportunity to install software easily. I prefer direct calls or access with a REST interface.
I thought that CloudFoundry would fits my needs but it is'nt so.
AppFog (<https://www.appfog.com/product/>) comes much closer to my goal. It allows me to in... | 2014/07/03 | [
"https://Stackoverflow.com/questions/24564094",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1477415/"
] | [Docker](http://docker.com) is seems to be the next big thing in the PaaS world. There are dozens new projects that build on top of docker or supporting it. For example OpenShift and Apache Stratos support docker. So if you look at solutions based on docker you can find a solution for you needs.
Right now I'm using do... | OpenShift is what you looking for :
1. it is open source and free for 3 gears for ever.
2. gives that possibility to install, configure and uninstall software in [openshift.redhat.com](https://www.openshift.com/) or in [rhc client tools](https://www.openshift.com/developers/rhc-client-tools-install).
3. it is extendab... |
6,646,522 | ```
<?php cp_latest_tweet('<?=$next_fixture?>'); ?>
```
The `next_fixture` part is where I'm having trouble. How do I go about this? | 2011/07/11 | [
"https://Stackoverflow.com/questions/6646522",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/838335/"
] | Why the hell would you do that?
Simply pass the var directly:
```
<?php cp_latest_tweet($next_fixture); ?>
```
---
If you want to have a string before/after it, e.g.:
```
<?php '<div>' . cp_latest_tweet($next_fixture) . '</div>'; ?>
```
or
```
<div><?php cp_latest_tweet($next_fixture); ?></div>
``` | Assuming you mean:
>
> How do I call a function using a variable instead of a string literal?
>
>
>
```
<?php cp_latest_tweet($next_fixture); ?>
``` |
6,646,522 | ```
<?php cp_latest_tweet('<?=$next_fixture?>'); ?>
```
The `next_fixture` part is where I'm having trouble. How do I go about this? | 2011/07/11 | [
"https://Stackoverflow.com/questions/6646522",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/838335/"
] | Why the hell would you do that?
Simply pass the var directly:
```
<?php cp_latest_tweet($next_fixture); ?>
```
---
If you want to have a string before/after it, e.g.:
```
<?php '<div>' . cp_latest_tweet($next_fixture) . '</div>'; ?>
```
or
```
<div><?php cp_latest_tweet($next_fixture); ?></div>
``` | Have you got this fixed yet, the previous two answers are correct but do you know where the variable $next\_fixture exists? if it's in the same script where you CALL the function then you should have no problem, but if it's in another script called something like next\_fixture.php you will have to include this script i... |
6,646,522 | ```
<?php cp_latest_tweet('<?=$next_fixture?>'); ?>
```
The `next_fixture` part is where I'm having trouble. How do I go about this? | 2011/07/11 | [
"https://Stackoverflow.com/questions/6646522",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/838335/"
] | Assuming you mean:
>
> How do I call a function using a variable instead of a string literal?
>
>
>
```
<?php cp_latest_tweet($next_fixture); ?>
``` | Have you got this fixed yet, the previous two answers are correct but do you know where the variable $next\_fixture exists? if it's in the same script where you CALL the function then you should have no problem, but if it's in another script called something like next\_fixture.php you will have to include this script i... |
18,159,087 | I'm trying to vertically center an absolutely positioned caption over an image that has a flexible height (max-width: 100%;) and having trouble. I know I need to use JS to detect the height of the div and adjust the top positioning of the caption div, but I'm having trouble.
<http://jsfiddle.net/A69Xr/>
```
<div ... | 2013/08/10 | [
"https://Stackoverflow.com/questions/18159087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1684537/"
] | You can try following way. Inside the for loop get the data node as JSONObject. From that data node you can extract every property. I just extracted mother name from data.
```
JSONObject data = (JSONObject) jsonObject.get("data");
final String motherName = (String) data.get("MOTHERS_NAME");
``` | What library are you using to parse JSON ? I'd recommend that you use [Jackson](https://github.com/FasterXML/jackson-core)
For eg: To get the data you read from the file in a Map, you can write a method like this.
```
@SuppressWarnings("rawtypes")
public static Map toMap(Object object) throws JsonProcessingExcep... |
44,771,678 | I have a array like this:
```
var test = [
[1,1,1],
[0,1,1],
[0,0,0],
[0,0,0]
];
```
I'm wondering how to it from the bottom like this:
```
var test = [
[0,0,0,1],
[0,0,1,1],
[0,0,1,1]
];
```
I've trie... | 2017/06/27 | [
"https://Stackoverflow.com/questions/44771678",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4494358/"
] | The code you've shown actually does *reverse* the input, but your desired output is a *rotation*, not a reversal.
Here's one way to do that with one line of code:
```js
var test = [
[1,1,1],
[0,1,1],
[0,0,0],
[0,0,0]
];
var output = test[0].map((_,... | Unfortunately, I don't think there are any nifty javascript tricks for rotating a matrix, but the below is still a pretty clean way to do it:
```
let cols = [], reversed = test.reverse();
for(let i = 0; i < reversed[0].length; i++)
cols.push(reversed.map(row=> row[i]));
```
`cols` should be a matrix in the desir... |
319,821 | I have seen some general comments online about running a 6V DC motor on 9V Battery being OK.
I am looking to run an air mattress pump originally designed for 4x 1.5V D batteries (6V DC) from a universal car laptop adapter. The lowest output voltage on the car adapter is 9V.
Nothing on the air pump motor mentions inpu... | 2017/07/22 | [
"https://electronics.stackexchange.com/questions/319821",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/157702/"
] | Yes, the same number of electrons is being transferred per unit of time in each case.
Nonetheless, more power is being delivered to the load in the case with higher voltage. | Practically, I have two situations where that amperage is the same. My Electric Vehicle charges at 16 Amps with either a 110 Volt charger or a 220 Volt charger. The 110 Volt charger takes twice the time to charge the car battery at the same amperage. When I look at my electric company's energy use in kWh the total cost... |
319,821 | I have seen some general comments online about running a 6V DC motor on 9V Battery being OK.
I am looking to run an air mattress pump originally designed for 4x 1.5V D batteries (6V DC) from a universal car laptop adapter. The lowest output voltage on the car adapter is 9V.
Nothing on the air pump motor mentions inpu... | 2017/07/22 | [
"https://electronics.stackexchange.com/questions/319821",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/157702/"
] | Short answer, yes. Both the circuits have same amount of electrons transferred in the same period of time.
**Theory behind it:**
Current is the rate of flow of charge and voltage is the amount of work done in moving that charge from some point to another point.
Now since both the circuits are drawing 100mA of curren... | Practically, I have two situations where that amperage is the same. My Electric Vehicle charges at 16 Amps with either a 110 Volt charger or a 220 Volt charger. The 110 Volt charger takes twice the time to charge the car battery at the same amperage. When I look at my electric company's energy use in kWh the total cost... |
19,890,492 | I'd like to auto-populate an invoice in Excel from data I enter into a lesson roster (`blank_monthly.xlsx`).

Here I fill in the lesson cost under the date each time they come for tuition.
In the invoice sheet I would like to start writing a custome... | 2013/11/10 | [
"https://Stackoverflow.com/questions/19890492",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1134241/"
] | Your entity should not know about other entities and the [Entity Manager](https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/EntityManager.php) because of the [separation of concerns](http://fabien.potencier.org/article/49/what-is-symfony2).
Why don't you simply map your `User` to the appropriate Role... | In this line:
```
$em = $this->getDoctrine()->getManager();
```
`$this` refers to the current class, the `User Entity` that does not have a method called `getDoctrine()`. `$this->getDoctrine()` works in controllers where you extend the `Controller` class a subclass of `ContainerAware` which contains the `getDoctrin... |
19,890,492 | I'd like to auto-populate an invoice in Excel from data I enter into a lesson roster (`blank_monthly.xlsx`).

Here I fill in the lesson cost under the date each time they come for tuition.
In the invoice sheet I would like to start writing a custome... | 2013/11/10 | [
"https://Stackoverflow.com/questions/19890492",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1134241/"
] | Your entity should not know about other entities and the [Entity Manager](https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/EntityManager.php) because of the [separation of concerns](http://fabien.potencier.org/article/49/what-is-symfony2).
Why don't you simply map your `User` to the appropriate Role... | I solved this:
```
global $kernel;
$em = $kernel->getContainer()->get('doctrine')->getManager();
$role = $em->getRepository('BackendBundle:user_types')->findOneBy(array(
'id' => 10
));
``` |
19,890,492 | I'd like to auto-populate an invoice in Excel from data I enter into a lesson roster (`blank_monthly.xlsx`).

Here I fill in the lesson cost under the date each time they come for tuition.
In the invoice sheet I would like to start writing a custome... | 2013/11/10 | [
"https://Stackoverflow.com/questions/19890492",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1134241/"
] | In this line:
```
$em = $this->getDoctrine()->getManager();
```
`$this` refers to the current class, the `User Entity` that does not have a method called `getDoctrine()`. `$this->getDoctrine()` works in controllers where you extend the `Controller` class a subclass of `ContainerAware` which contains the `getDoctrin... | I solved this:
```
global $kernel;
$em = $kernel->getContainer()->get('doctrine')->getManager();
$role = $em->getRepository('BackendBundle:user_types')->findOneBy(array(
'id' => 10
));
``` |
37,915,516 | Where `entries` is a Hash:
```
entries = { foo: 1, bar: 2 }
```
This is the syntax I'm familiar with:
```
entries.map { |key, val| "#{key} #{val}" }
#=> ["foo 1", "bar 2"]
```
This is the syntax I came upon in a tutorial:
```
entries.map { |key_val| "#{key_val.first} #{key_val.last}" }
#=> ["foo 1", "bar 2"]
``... | 2016/06/20 | [
"https://Stackoverflow.com/questions/37915516",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5086917/"
] | No, it has nothing to do with hashes and enumerables (well, almost). It is a thing I call "array destructuring". Ruby has a nice way of taking arrays apart. Suppose you have this two-element array
```
ary = [1, 2]
```
You can get its elements by accessing them individually
```
a = ary.first # or ary[0]
b = ary.last... | In Ruby, [`Hash#each`](http://docs.ruby-lang.org/en/2.3.0/Hash.html#method-i-each) is an alias of `Hash#each_pair`, in other words, both methods point to [same implementation](https://github.com/ruby/ruby/find/trunk#L4296). The block passed to `each` always receives key-value pair in the form of two-element array.
Sin... |
2,615,259 | I believe that for any real symmetric matrix $A$, I am always be able to write in the eigen decomposition form
$$A = P\Lambda P^T \tag{1}$$
**whatever the rank of $A$**. (see [Real symmetric matrix is never defective](https://www.quora.com/Why-is-symmetric-matrix-never-defective-has-a-full-set-of-independent-eigenvec... | 2018/01/21 | [
"https://math.stackexchange.com/questions/2615259",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/523589/"
] | Welcome to Math SX! You have to use *Euler's theorem* as $\varphi(4)=2$, $\;\varphi(25)=20$ we have
$$ 7^{30}\equiv7^{30\bmod2}=1\mod 4,\qquad 7^{30}\equiv7^{30\bmod20}=7^{10}\mod 25$$
To find the latter power, you can use the *modular fast exponentiation algorithm*, but here, it will be simpler: modulo $25$,
$$7^2\equ... | Chinese Remainder Theorem says:
$$\mathbb{Z}/100 \simeq \mathbb{Z}/25 \times \mathbb{Z}/4$$
where the isomorphism is given by mapping $x \pmod {100}$ to $(x \pmod {25}, x \pmod {4})$. Thus, the class of $x$ is a number from $0$ to $99$ that congruence to $1 \bmod 4$ and $24 \bmod 25$. The numbers $0 \le x \le 99$ and... |
2,615,259 | I believe that for any real symmetric matrix $A$, I am always be able to write in the eigen decomposition form
$$A = P\Lambda P^T \tag{1}$$
**whatever the rank of $A$**. (see [Real symmetric matrix is never defective](https://www.quora.com/Why-is-symmetric-matrix-never-defective-has-a-full-set-of-independent-eigenvec... | 2018/01/21 | [
"https://math.stackexchange.com/questions/2615259",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/523589/"
] | Welcome to Math SX! You have to use *Euler's theorem* as $\varphi(4)=2$, $\;\varphi(25)=20$ we have
$$ 7^{30}\equiv7^{30\bmod2}=1\mod 4,\qquad 7^{30}\equiv7^{30\bmod20}=7^{10}\mod 25$$
To find the latter power, you can use the *modular fast exponentiation algorithm*, but here, it will be simpler: modulo $25$,
$$7^2\equ... | From here
$$\begin{cases}
x \equiv 7^{30} \pmod4\\
x\equiv 7^{30} \pmod{25}
\end{cases}$$
by CRT we know that solutions exist $\pmod{100}$.
Then note that since $7^2=49\equiv 1 \pmod4$
$$x\equiv7^{30} \implies x\equiv 49^{15} \equiv 1\pmod4$$
and since $7^2=49\equiv -1 \pmod{25}$
$$x\equiv7^{30} \implies x\equiv ... |
2,615,259 | I believe that for any real symmetric matrix $A$, I am always be able to write in the eigen decomposition form
$$A = P\Lambda P^T \tag{1}$$
**whatever the rank of $A$**. (see [Real symmetric matrix is never defective](https://www.quora.com/Why-is-symmetric-matrix-never-defective-has-a-full-set-of-independent-eigenvec... | 2018/01/21 | [
"https://math.stackexchange.com/questions/2615259",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/523589/"
] | Welcome to Math SX! You have to use *Euler's theorem* as $\varphi(4)=2$, $\;\varphi(25)=20$ we have
$$ 7^{30}\equiv7^{30\bmod2}=1\mod 4,\qquad 7^{30}\equiv7^{30\bmod20}=7^{10}\mod 25$$
To find the latter power, you can use the *modular fast exponentiation algorithm*, but here, it will be simpler: modulo $25$,
$$7^2\equ... | $$7^{30}\equiv x\pmod{ 100}$$
Could be solved easily without Chinese Remainder Theorem. Note that $7^4=2401 \equiv 1\pmod {100} $ Thus $$ 7^{30} = 7^{28}\times 49 \equiv 49 \pmod {100}$$
Solving the system with Chinese Remainder Theorem requires finding a linear combination of $25$ and $4$ to equal 1.
Such a combina... |
27,336,834 | I am new to grails and implementing one-to-one relationship in grails and trying to query on tables and not sure on how to represent one-to-one relationship in domain classes and query the results.
I have two tables
```
car(car_id number primary key,name varchar2(255))
engine(eng_id number primary key,name varchar2(2... | 2014/12/06 | [
"https://Stackoverflow.com/questions/27336834",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2905383/"
] | Your issue is that the function has finished by the time the data arrives. This is due to the asynchronous nature of AJAX. You need to handle your data *when* it arrives, not assume it has arrived before it has.
```
function getNewValues(){
$.ajax({
dataType: 'json',
url: 'get.php',
type: '... | Edit: Reread your question. Think [this response](https://stackoverflow.com/a/4293438/3503285) to a similar question could help.
Once you have executed the prepared statement, something like this could work instead of the PDO::FETCH\_ASSOC
```
...
$result = $statement->execute();
for ($file_data = array(); $row = $re... |
27,336,834 | I am new to grails and implementing one-to-one relationship in grails and trying to query on tables and not sure on how to represent one-to-one relationship in domain classes and query the results.
I have two tables
```
car(car_id number primary key,name varchar2(255))
engine(eng_id number primary key,name varchar2(2... | 2014/12/06 | [
"https://Stackoverflow.com/questions/27336834",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2905383/"
] | Your issue is that the function has finished by the time the data arrives. This is due to the asynchronous nature of AJAX. You need to handle your data *when* it arrives, not assume it has arrived before it has.
```
function getNewValues(){
$.ajax({
dataType: 'json',
url: 'get.php',
type: '... | You need to set and return the variable inside the function, not try to return the ajax return value as the function. In other words, pass the ajax return to a variable to a function variable and then return that. Something like this:
```
function getNewValues(){
var returnedJSON= $.ajax({
dataType: 'json',... |
8,255,578 | Begin with an simple attempt, I defined an Constructor and used it to create an instance `myobject`:
```
function MyConstructor () {};
var myobject = new MyConstructor ();
```
Then, I modified the `prototype` property of this Constructor and created another instance `myobject1` with it:
```
MyConstructor.prototype ... | 2011/11/24 | [
"https://Stackoverflow.com/questions/8255578",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/966437/"
] | That's not really an Android topic. I guess working with the Audio buffer will help you with that. Check out this link: <http://www.daniweb.com/software-development/java/threads/197893> | See <http://developer.android.com/reference/android/media/audiofx/Visualizer.html> |
4,085,186 | How can I create a `ListPreference` with `checkbox`?
I know how to use `ListPreference`, but I need multiple selection like in Alarm application on "repeat" preference.
like this screenshot:
 | 2010/11/03 | [
"https://Stackoverflow.com/questions/4085186",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/453407/"
] | Since API 11 you can use MultiSelectListPreference
```
String[] selections = {"selection1","Selection2"};
Set<String> selectionSet = new HashSet<String>();
selectionSet.addAll(Arrays.asList(selections));
MultiSelectListPreference multiSelectPref = new MultiSelectListPreference(this);
multiSelectPref.setKey("m... | There is no built-in preference for that AFAIK. `ListPreference` is single-select only.
You could create your own custom `Preference` class, though, by extending `DialogPreference`. |
4,085,186 | How can I create a `ListPreference` with `checkbox`?
I know how to use `ListPreference`, but I need multiple selection like in Alarm application on "repeat" preference.
like this screenshot:
 | 2010/11/03 | [
"https://Stackoverflow.com/questions/4085186",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/453407/"
] | There is no built-in preference for that AFAIK. `ListPreference` is single-select only.
You could create your own custom `Preference` class, though, by extending `DialogPreference`. | For boolean values you must use a SwitchPreference, as follows:
```
<SwitchPreference
android:defaultValue="true"
android:key="example_switch"
android:summary="@string/pref_description_social_recommendations"
android:title="@string/pref_title_social_recommendations" />
``` |
4,085,186 | How can I create a `ListPreference` with `checkbox`?
I know how to use `ListPreference`, but I need multiple selection like in Alarm application on "repeat" preference.
like this screenshot:
 | 2010/11/03 | [
"https://Stackoverflow.com/questions/4085186",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/453407/"
] | Use, MultiSelectListPreference
```
<MultiSelectListPreference
app:defaultValue="@array/watermark_entries_view"
app:dialogTitle="Select Watermark Type"
app:entries="@array/watermark_entries_view"
app:entryValues="@array/watermark_entries_values"
app:key="mode_repeat"
app:... | There is no built-in preference for that AFAIK. `ListPreference` is single-select only.
You could create your own custom `Preference` class, though, by extending `DialogPreference`. |
4,085,186 | How can I create a `ListPreference` with `checkbox`?
I know how to use `ListPreference`, but I need multiple selection like in Alarm application on "repeat" preference.
like this screenshot:
 | 2010/11/03 | [
"https://Stackoverflow.com/questions/4085186",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/453407/"
] | Since API 11 you can use MultiSelectListPreference
```
String[] selections = {"selection1","Selection2"};
Set<String> selectionSet = new HashSet<String>();
selectionSet.addAll(Arrays.asList(selections));
MultiSelectListPreference multiSelectPref = new MultiSelectListPreference(this);
multiSelectPref.setKey("m... | For boolean values you must use a SwitchPreference, as follows:
```
<SwitchPreference
android:defaultValue="true"
android:key="example_switch"
android:summary="@string/pref_description_social_recommendations"
android:title="@string/pref_title_social_recommendations" />
``` |
4,085,186 | How can I create a `ListPreference` with `checkbox`?
I know how to use `ListPreference`, but I need multiple selection like in Alarm application on "repeat" preference.
like this screenshot:
 | 2010/11/03 | [
"https://Stackoverflow.com/questions/4085186",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/453407/"
] | Since API 11 you can use MultiSelectListPreference
```
String[] selections = {"selection1","Selection2"};
Set<String> selectionSet = new HashSet<String>();
selectionSet.addAll(Arrays.asList(selections));
MultiSelectListPreference multiSelectPref = new MultiSelectListPreference(this);
multiSelectPref.setKey("m... | Use, MultiSelectListPreference
```
<MultiSelectListPreference
app:defaultValue="@array/watermark_entries_view"
app:dialogTitle="Select Watermark Type"
app:entries="@array/watermark_entries_view"
app:entryValues="@array/watermark_entries_values"
app:key="mode_repeat"
app:... |
4,085,186 | How can I create a `ListPreference` with `checkbox`?
I know how to use `ListPreference`, but I need multiple selection like in Alarm application on "repeat" preference.
like this screenshot:
 | 2010/11/03 | [
"https://Stackoverflow.com/questions/4085186",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/453407/"
] | Use, MultiSelectListPreference
```
<MultiSelectListPreference
app:defaultValue="@array/watermark_entries_view"
app:dialogTitle="Select Watermark Type"
app:entries="@array/watermark_entries_view"
app:entryValues="@array/watermark_entries_values"
app:key="mode_repeat"
app:... | For boolean values you must use a SwitchPreference, as follows:
```
<SwitchPreference
android:defaultValue="true"
android:key="example_switch"
android:summary="@string/pref_description_social_recommendations"
android:title="@string/pref_title_social_recommendations" />
``` |
41,558,083 | I'm using bootstrap for my website with a link that opens a new tab. In my desktop browser, the link remains focused(red) after I close the tab(without moving my mouse pointer in the window).
I added `onclick="this.blur()` to remove the focus(red), but `hover` is still in effect(green).
How to I remove both focus and... | 2017/01/09 | [
"https://Stackoverflow.com/questions/41558083",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1221857/"
] | simply override it in CSS using the same color as the link,
```css
a, a:hover, a:focus{
color:black;
}
```
and if you want, you can override `:visited` and `:active` too
```css
a, a:hover, a:visited, a:active, a:focus{
color:black;
}
```
---
Here is a snippet
```css
a,
a:hover,
a:visited,
a:active,
a:f... | Use this:
```
a:active, visited {
color:black;
}
```
`active` is the state a link has after you clicked it. You won't loose the hover effect in this case. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.