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 |
|---|---|---|---|---|---|
17,696,760 | 
As show in Picture above UIView A & UIView C are Added on UIView B. for B ClipToBounds is YES so the Red area is not visible.
Is it possible to get Visible rectangle of A & C ( shown with Lines )
I need show Rectangle in visible area when I touche... | 2013/07/17 | [
"https://Stackoverflow.com/questions/17696760",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/355082/"
] | Yes you can with this function:
```
CGRect CGRectIntersection (
CGRect r1,
CGRect r2
);
```
If you tell exactly what you want to do maybe are better ways, for example i needed something similar and instead cropping manually i just captured the UIView B content as an image. | Use for this
```
[UIView convertRect:<#(CGRect)#> fromView:<#(UIView *)#>]
[UIView convertRect:<#(CGRect)#> toView:<#(UIView *)#>]
```
And CGRectIntersection function |
17,696,760 | 
As show in Picture above UIView A & UIView C are Added on UIView B. for B ClipToBounds is YES so the Red area is not visible.
Is it possible to get Visible rectangle of A & C ( shown with Lines )
I need show Rectangle in visible area when I touche... | 2013/07/17 | [
"https://Stackoverflow.com/questions/17696760",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/355082/"
] | Yes you can with this function:
```
CGRect CGRectIntersection (
CGRect r1,
CGRect r2
);
```
If you tell exactly what you want to do maybe are better ways, for example i needed something similar and instead cropping manually i just captured the UIView B content as an image. | on `touchesEnded:` method you can find it like bellow..
```
-(void) touchesEnded:(NSSet *) touches {
if(CGRectIntersectsRect([ViewA frame], [ViewB frame]) {
//Do something here
}
}
```
Read More Information about RectInterSect From [This Link](https://developer.apple.com/library/mac/#documentation/... |
5,524,712 | I currently have a design like follows
View1(mainview) creates a view2, sets a reference back to view1 in view2, presents view2
view2 creates a view3, sets view3 to have the same view1 reference, presents view3
view3 then needs to , depending on user selection, call a function on view1, which currently works perfect... | 2011/04/02 | [
"https://Stackoverflow.com/questions/5524712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/356387/"
] | I suddenly realised what caused my problem.
I had previously changed the default setting for mass\_assignment in a config file to enforce that all attributes were protected unless declared otherwise.
An obvious mistake in retrospect but hopefully this might save someone else some time too | Attr\_accessible is a safety feature. It tells your model to only save the mentioned values, upon a mass assignment (like save). Im' pretty sure that you will notice a Warning on mass assignment if you look at your logs.
If you have try to save a model even with a single accessible attribute, ONLY this will be saved i... |
5,524,712 | I currently have a design like follows
View1(mainview) creates a view2, sets a reference back to view1 in view2, presents view2
view2 creates a view3, sets view3 to have the same view1 reference, presents view3
view3 then needs to , depending on user selection, call a function on view1, which currently works perfect... | 2011/04/02 | [
"https://Stackoverflow.com/questions/5524712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/356387/"
] | Attr\_accessible is a safety feature. It tells your model to only save the mentioned values, upon a mass assignment (like save). Im' pretty sure that you will notice a Warning on mass assignment if you look at your logs.
If you have try to save a model even with a single accessible attribute, ONLY this will be saved i... | To add to Peter Nixey's answer, to resolve this problem in rails 3 I changed the following:
```
# application.rb
config.active_record.whitelist_attributes = false #it was true
```
When set to true, a whitelist is enforced for all attributes that can be mass assigned. This needs to be disabled or you can add them to ... |
5,524,712 | I currently have a design like follows
View1(mainview) creates a view2, sets a reference back to view1 in view2, presents view2
view2 creates a view3, sets view3 to have the same view1 reference, presents view3
view3 then needs to , depending on user selection, call a function on view1, which currently works perfect... | 2011/04/02 | [
"https://Stackoverflow.com/questions/5524712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/356387/"
] | I suddenly realised what caused my problem.
I had previously changed the default setting for mass\_assignment in a config file to enforce that all attributes were protected unless declared otherwise.
An obvious mistake in retrospect but hopefully this might save someone else some time too | To add to Peter Nixey's answer, to resolve this problem in rails 3 I changed the following:
```
# application.rb
config.active_record.whitelist_attributes = false #it was true
```
When set to true, a whitelist is enforced for all attributes that can be mass assigned. This needs to be disabled or you can add them to ... |
2,415,297 | Find the least positive integer $m$ such that $m^2 - m + 11$ is a product of at least four not necessarily distinct primes.
I tried but not able to solve it.
**Edit** : Please note that I am looking for mathematical solution not the programming one. | 2017/09/03 | [
"https://math.stackexchange.com/questions/2415297",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Let the equality $$m(m-1)+11=N$$ It is clear that $N$ must be odd and that can be divisible by the prime $11$. However the following congruences have no solution as it is easy to prove directly checking the few possibilities with $m(m-1)$ not divisible by $3,5$ and $7$ respectively
$$\begin{cases}m(m-1)+2\equiv 0\pmod... | $$132^2 - 132 + 11 = 11 \times 11 \times 11 \times 13$$
[Pyth program](http://pyth.herokuapp.com/?code=f%3C3lP%2B%2aTtT11&debug=0):
```
f<3lP+*TtT11
``` |
2,415,297 | Find the least positive integer $m$ such that $m^2 - m + 11$ is a product of at least four not necessarily distinct primes.
I tried but not able to solve it.
**Edit** : Please note that I am looking for mathematical solution not the programming one. | 2017/09/03 | [
"https://math.stackexchange.com/questions/2415297",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Let the equality $$m(m-1)+11=N$$ It is clear that $N$ must be odd and that can be divisible by the prime $11$. However the following congruences have no solution as it is easy to prove directly checking the few possibilities with $m(m-1)$ not divisible by $3,5$ and $7$ respectively
$$\begin{cases}m(m-1)+2\equiv 0\pmod... | By checking the choices $m=0,1,\ldots,p-1$, you can show that $m^2-m+11$ is never divisible by $p$ when $p=2,3,5$ or $7$. So the smallest possible product of four primes is $11^4$. The next smallest is $11^3\cdot 13$. (Taking a peek at Kenny Lau's answer). All you need to do is to check that
$$m^2-m+11=11^4$$
has no in... |
69,152,784 | I'm trying to create an HTML page with a footer sticking to the bottom, independently from the size of the browser window. I created the following HTML file:
```html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title> Home </title>
<link rel="stylesheet" href="./assets/css/styles.c... | 2021/09/12 | [
"https://Stackoverflow.com/questions/69152784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12293618/"
] | According to your requirement, if you don't want to show `right` and `left` border of the footer then you can only use `left:0px;` with your footer `CSS`.
i.e.
```
#footer {
position: fixed;
bottom: 0px;
width: 100%;
padding: 10px;
border: 1px solid;
left: 0px;
}
```
And also if you want to s... | to answer your question, please look at this question.
[How to get rid of white space on left and right of div?](https://stackoverflow.com/questions/34302798/how-to-get-rid-of-white-space-on-left-and-right-of-div)
You have to reset your CSS. You can do this by adding the following to your Code.
```
html,
body {
... |
69,152,784 | I'm trying to create an HTML page with a footer sticking to the bottom, independently from the size of the browser window. I created the following HTML file:
```html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title> Home </title>
<link rel="stylesheet" href="./assets/css/styles.c... | 2021/09/12 | [
"https://Stackoverflow.com/questions/69152784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12293618/"
] | If you use the position property outside of normal (such as absolute or fixed), you must give the property you gave on the vertical axis also on the horizontal. The Width value may not work because you are no longer in a normal flow.
Therefore, using it like this will give the correct result.
```
#footer {
positio... | to answer your question, please look at this question.
[How to get rid of white space on left and right of div?](https://stackoverflow.com/questions/34302798/how-to-get-rid-of-white-space-on-left-and-right-of-div)
You have to reset your CSS. You can do this by adding the following to your Code.
```
html,
body {
... |
42,734,801 | everyone! I'm using matplotlib and I have a field with randomly generated circles. Also I have button which has to generate new random circles in the field but every time I press it, circles are generated inside the BUTTON, but not in the field. Please show me what I'm doing wrong, I'm new to python(actually started le... | 2017/03/11 | [
"https://Stackoverflow.com/questions/42734801",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | What you have is efficient enough, really. In this context almost anything you could dream up is efficient enough, but for neatness? Well, I would've at least refactored the conversion into a function, and do you really need a long int to store the age levels? I doubt it as humans generally don't become *that* old. I w... | Create a class like below:
```
public class PersonRecord
{
public int MinAge { get; set; }
public string Maturity { get; set; }
}
```
Create a method which will parse the string like below:
```
public static List<PersonRecord> Parse(string records)
{
var splits = records.Split('|');
var persons = splits... |
42,734,801 | everyone! I'm using matplotlib and I have a field with randomly generated circles. Also I have button which has to generate new random circles in the field but every time I press it, circles are generated inside the BUTTON, but not in the field. Please show me what I'm doing wrong, I'm new to python(actually started le... | 2017/03/11 | [
"https://Stackoverflow.com/questions/42734801",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Create a class like below:
```
public class PersonRecord
{
public int MinAge { get; set; }
public string Maturity { get; set; }
}
```
Create a method which will parse the string like below:
```
public static List<PersonRecord> Parse(string records)
{
var splits = records.Split('|');
var persons = splits... | try this
```
string str = "0=Child|13=Teen|18=Adult";
List<string> seplist = str.Split('|').ToList();
int Age = 14;
string Maturity = string.Empty;
foreach (var item in seplist)
{
var part = item.Split('=');
if (int.Parse(part.... |
42,734,801 | everyone! I'm using matplotlib and I have a field with randomly generated circles. Also I have button which has to generate new random circles in the field but every time I press it, circles are generated inside the BUTTON, but not in the field. Please show me what I'm doing wrong, I'm new to python(actually started le... | 2017/03/11 | [
"https://Stackoverflow.com/questions/42734801",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | What you have is efficient enough, really. In this context almost anything you could dream up is efficient enough, but for neatness? Well, I would've at least refactored the conversion into a function, and do you really need a long int to store the age levels? I doubt it as humans generally don't become *that* old. I w... | try this
```
string str = "0=Child|13=Teen|18=Adult";
List<string> seplist = str.Split('|').ToList();
int Age = 14;
string Maturity = string.Empty;
foreach (var item in seplist)
{
var part = item.Split('=');
if (int.Parse(part.... |
47,814,410 | I have an array of numbers, for example (calendar days):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
I want to highlight every three numbers after two.
So it should looks like: **1** **2** **3** 4 5 **6** **7** **8** 9 10 **11** **12** **13** 14 15 **16** **17** **18** 19 20 **... | 2017/12/14 | [
"https://Stackoverflow.com/questions/47814410",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1379147/"
] | You can use modulo `%`. If modulo is less than or equal to 2 (0,1,2) highlight it.
```
$arr = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
foreach( $arr as $key => $value ) {
if ( ( $key % 5 ) <= 2 ) echo "<b>" . $value . "</b>"... | You can achieve this with a simple `mod` on `$i` in a for loop:
```
for ($i = 0; $i < 31; $i++) {
if ($i%5 == 1 || $i%5 == 2 || $i%5 == 3 ) {
echo "<strong>" . $i . "</strong>";
} else {
echo $i;
}
}
```
It will need slight adjustments to output how you need it output, but the general log... |
47,814,410 | I have an array of numbers, for example (calendar days):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
I want to highlight every three numbers after two.
So it should looks like: **1** **2** **3** 4 5 **6** **7** **8** 9 10 **11** **12** **13** 14 15 **16** **17** **18** 19 20 **... | 2017/12/14 | [
"https://Stackoverflow.com/questions/47814410",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1379147/"
] | Here is one method using [array\_slice](http://php.net/manual/en/function.array-slice.php) and [implode](http://php.net/manual/en/function.implode.php) to build the string.
This does fewer loops. How many loops depends on the "settings".
In this case you mention it makes seven loops compared to 31 when you loop ev... | You can achieve this with a simple `mod` on `$i` in a for loop:
```
for ($i = 0; $i < 31; $i++) {
if ($i%5 == 1 || $i%5 == 2 || $i%5 == 3 ) {
echo "<strong>" . $i . "</strong>";
} else {
echo $i;
}
}
```
It will need slight adjustments to output how you need it output, but the general log... |
47,814,410 | I have an array of numbers, for example (calendar days):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
I want to highlight every three numbers after two.
So it should looks like: **1** **2** **3** 4 5 **6** **7** **8** 9 10 **11** **12** **13** 14 15 **16** **17** **18** 19 20 **... | 2017/12/14 | [
"https://Stackoverflow.com/questions/47814410",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1379147/"
] | You can use modulo `%`. If modulo is less than or equal to 2 (0,1,2) highlight it.
```
$arr = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
foreach( $arr as $key => $value ) {
if ( ( $key % 5 ) <= 2 ) echo "<b>" . $value . "</b>"... | Here is one method using [array\_slice](http://php.net/manual/en/function.array-slice.php) and [implode](http://php.net/manual/en/function.implode.php) to build the string.
This does fewer loops. How many loops depends on the "settings".
In this case you mention it makes seven loops compared to 31 when you loop ev... |
1,337 | When asking an "ID My Bike" question what information about the bike should I include?
Would a good "ID My Bike" question need all of the following or are there a few key things that would offer the best chance of an ID? Maybe something like - if these three things are included the chance of ID is 50/50. If these two... | 2019/05/28 | [
"https://bicycles.meta.stackexchange.com/questions/1337",
"https://bicycles.meta.stackexchange.com",
"https://bicycles.meta.stackexchange.com/users/41662/"
] | In order to ID a bike a question **must have**:
At least one clear picture.
If there is no picture there is zero chance of providing an ID. The question will be closed.
The picture should be high resolution (any modern smart-phone will work)
In the picture the bike should be:
- well lit
- right side up (sitt... | First, accept that the chances of your bike manufacturer, brand or model being identified are low, effectively zero in many cases (repainted BMX frames, generic 80's drop bar ten-speeds, 90's inexpensive hybrids ...)
Having seen a great many id-my-bike questions on this site I think the goal is not so much getting the... |
1,337 | When asking an "ID My Bike" question what information about the bike should I include?
Would a good "ID My Bike" question need all of the following or are there a few key things that would offer the best chance of an ID? Maybe something like - if these three things are included the chance of ID is 50/50. If these two... | 2019/05/28 | [
"https://bicycles.meta.stackexchange.com/questions/1337",
"https://bicycles.meta.stackexchange.com",
"https://bicycles.meta.stackexchange.com/users/41662/"
] | First, accept that the chances of your bike manufacturer, brand or model being identified are low, effectively zero in many cases (repainted BMX frames, generic 80's drop bar ten-speeds, 90's inexpensive hybrids ...)
Having seen a great many id-my-bike questions on this site I think the goal is not so much getting the... | This answer emphasizes a few things in other answers for clarity. In general, we ask for clear photographs of the entire bike, and preferably some close ups of select parts as well. Be aware that these are usually necessary *but not sufficient* to ID a manufacturer, model, and year. Identifying a manufacturer is easier... |
1,337 | When asking an "ID My Bike" question what information about the bike should I include?
Would a good "ID My Bike" question need all of the following or are there a few key things that would offer the best chance of an ID? Maybe something like - if these three things are included the chance of ID is 50/50. If these two... | 2019/05/28 | [
"https://bicycles.meta.stackexchange.com/questions/1337",
"https://bicycles.meta.stackexchange.com",
"https://bicycles.meta.stackexchange.com/users/41662/"
] | In order to ID a bike a question **must have**:
At least one clear picture.
If there is no picture there is zero chance of providing an ID. The question will be closed.
The picture should be high resolution (any modern smart-phone will work)
In the picture the bike should be:
- well lit
- right side up (sitt... | **Photos**
a. the first photo should be a clear and well lit shot of the right-hand side of the bike. Ideally it should be sunlit or good incandescent or LED lighting. Avoid fluorescent tube lighting at all costs.
b. the bike should be clean-ish. Doesn't have to be concours level but we need to see the details and sm... |
1,337 | When asking an "ID My Bike" question what information about the bike should I include?
Would a good "ID My Bike" question need all of the following or are there a few key things that would offer the best chance of an ID? Maybe something like - if these three things are included the chance of ID is 50/50. If these two... | 2019/05/28 | [
"https://bicycles.meta.stackexchange.com/questions/1337",
"https://bicycles.meta.stackexchange.com",
"https://bicycles.meta.stackexchange.com/users/41662/"
] | **Photos**
a. the first photo should be a clear and well lit shot of the right-hand side of the bike. Ideally it should be sunlit or good incandescent or LED lighting. Avoid fluorescent tube lighting at all costs.
b. the bike should be clean-ish. Doesn't have to be concours level but we need to see the details and sm... | This answer emphasizes a few things in other answers for clarity. In general, we ask for clear photographs of the entire bike, and preferably some close ups of select parts as well. Be aware that these are usually necessary *but not sufficient* to ID a manufacturer, model, and year. Identifying a manufacturer is easier... |
1,337 | When asking an "ID My Bike" question what information about the bike should I include?
Would a good "ID My Bike" question need all of the following or are there a few key things that would offer the best chance of an ID? Maybe something like - if these three things are included the chance of ID is 50/50. If these two... | 2019/05/28 | [
"https://bicycles.meta.stackexchange.com/questions/1337",
"https://bicycles.meta.stackexchange.com",
"https://bicycles.meta.stackexchange.com/users/41662/"
] | In order to ID a bike a question **must have**:
At least one clear picture.
If there is no picture there is zero chance of providing an ID. The question will be closed.
The picture should be high resolution (any modern smart-phone will work)
In the picture the bike should be:
- well lit
- right side up (sitt... | This answer emphasizes a few things in other answers for clarity. In general, we ask for clear photographs of the entire bike, and preferably some close ups of select parts as well. Be aware that these are usually necessary *but not sufficient* to ID a manufacturer, model, and year. Identifying a manufacturer is easier... |
50,187,829 | I want from `path="/users/:login/:repo"` to view login's repo detail page but it doesn't work and views UserProfile component.
Here is the click:
```
<Link to={this.props.location.pathname+'/'+item.name}>
<div>
<h4>{item.name}</h4>
<p>{item.description} </p>
</div>
</Link>
<Switch>
<Route exac... | 2018/05/05 | [
"https://Stackoverflow.com/questions/50187829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4868320/"
] | You need to reverse the ordering of your routes, since `Switch` matches the first route
```
<Switch>
<Route exact path="/" component={Contributors}/>
<Route path="/users/:login/:repo" component={RepoPage}/>
<Route path="/users/:login" component={UserProfile}/>
</Switch>
```
With React-router the paths ... | Any url matched by `"/users/:login/:repo"` will be matched by `"/users/:login"` as well, unless you use `exact` qualifier.
In the context of `Switch` it means that `UserProfile` will be rendered every time because it comes first.
Solution would be to change:
```
<Route path="/users/:login" component={UserProfile}/... |
57,588 | I observed that dictators often appoint highly educated and qualified technocrats as advisors or spokespersons.
For example,
* Dr. Gowher Rizvi, advisor to Sheikh Hasina, Ph.D. from Oxford University.
* Ibrahim Kalin, spokesperson of Erdogan, Ph.D. from George Washington University.
* Bouthaina Shaaban, advisor to Ba... | 2020/09/28 | [
"https://politics.stackexchange.com/questions/57588",
"https://politics.stackexchange.com",
"https://politics.stackexchange.com/users/32479/"
] | >
> Do dictators find such people, Or, those people find dictators?
>
>
>
It's mutual.
Dictators need someone to "make the trains run on time" and operating a modern state is a complex enterprise beyond the capacity of the ambitious soldiers and politicians who usually end up as dictators to do without expert adv... | A simple factual analysis leads to the following conclusion: the autocratic power that dictators hold may not have been granted through a process reflecting the will of some concept of majority of the citizens in the country but, see, their decisions are not based on their whims or personal interests, but on solid tech... |
43,998,352 | I am using netCDF4 to store multidimensional data. The data has, for example, three dimensions, `time = [0, 1, 2]`, `height = [10, 20]`, `direction = [0, 120, 180, 240, 300]`, but not for all combinations (grid points) there is data. In our example, let this be limited to `height`/`direction`-combinations. Namely, supp... | 2017/05/16 | [
"https://Stackoverflow.com/questions/43998352",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/671672/"
] | Basically your answer number 2 is the correct one. NETCDF files are gridded files, and so the natural structure for the data describe is to define three dimensions, time, height and direction. For the array entries for which data does not exist you need to set the data to equal the value defined by the metadata:
```
... | When reading up on metadata conventions, I encountered another option: ‘[compression by gathering](http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.html#compression-by-gathering)’ of the `height` and `direction` variables into a single `location variable`.
How would this work in the toy example? First gat... |
2,559,314 | I recently looked at the proof given for the fundamental theorem of calculus in this link:
[Why is the area under a curve the integral?](https://math.stackexchange.com/questions/15294/why-is-the-area-under-a-curve-the-integral/15301#15301)
It made perfect sense, except for one thing. The proof relies on creating a fu... | 2017/12/10 | [
"https://math.stackexchange.com/questions/2559314",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/446153/"
] | In the notation of the post you linked to, you are confusing $\mathcal{M}$ and $F$. What you are calling $F(b)$, a function which measures the area under the curve from $0$ to $b$, is what the post calls $\mathcal{M}(b)$. The function $F$ is instead *any* antiderivative of $f$. That is, we know *nothing* about $F$ at a... | Adding to what Dylan said, I think you are misunderstanding how to calculate a definite integral, as in your example: There are three steps to calculating one, which are:
$1)$ Find the *indefinite integral* - the integral without the bounds:
$\int \sin x = -\cos x$ (the classical way is to prove this by Taylor series,... |
2,559,314 | I recently looked at the proof given for the fundamental theorem of calculus in this link:
[Why is the area under a curve the integral?](https://math.stackexchange.com/questions/15294/why-is-the-area-under-a-curve-the-integral/15301#15301)
It made perfect sense, except for one thing. The proof relies on creating a fu... | 2017/12/10 | [
"https://math.stackexchange.com/questions/2559314",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/446153/"
] | In the notation of the post you linked to, you are confusing $\mathcal{M}$ and $F$. What you are calling $F(b)$, a function which measures the area under the curve from $0$ to $b$, is what the post calls $\mathcal{M}(b)$. The function $F$ is instead *any* antiderivative of $f$. That is, we know *nothing* about $F$ at a... | From my point.of view a simple way to see this fact is to consider the integral function:
$$F(x) = \int\_{0}^{x}f(t)dt $$
that rapresent the area “under” the graph from 0 to x.
Now if we think to calculate its derivative is pretty clear that for a small change $\Delta x$ the area varies of the quantity:
$$\Delta F(... |
2,559,314 | I recently looked at the proof given for the fundamental theorem of calculus in this link:
[Why is the area under a curve the integral?](https://math.stackexchange.com/questions/15294/why-is-the-area-under-a-curve-the-integral/15301#15301)
It made perfect sense, except for one thing. The proof relies on creating a fu... | 2017/12/10 | [
"https://math.stackexchange.com/questions/2559314",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/446153/"
] | In the notation of the post you linked to, you are confusing $\mathcal{M}$ and $F$. What you are calling $F(b)$, a function which measures the area under the curve from $0$ to $b$, is what the post calls $\mathcal{M}(b)$. The function $F$ is instead *any* antiderivative of $f$. That is, we know *nothing* about $F$ at a... | An antiderivative of $f$ is a function that collects area under the graph of $f$, starting somewhere. In order to find the area from $a$ to $b$, we need to plug $x=b$ into the particular antiderivative that collects area starting at $a$. One name for this function is $$\int\_a^x f(t) \,dt$$
When we write down some ran... |
36,386,358 | I am trying to create UML Class Diagram for this problem: So, user is prompted to enter a password. It's a 9 digit number. System receives passwords and checks if it's correct or not by looking into database which has correct password stored inside. If the password is correct, System needs to show message "Correct". Ot... | 2016/04/03 | [
"https://Stackoverflow.com/questions/36386358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6108379/"
] | You generally do not want to model this much detail because you'll wind up with a stale, inert model. Users and counters are more of a concern for OOP, and are akin to modeling the sand and clay that make up the bricks to make a house. Who cares about that level of detail? Instead, you're better off modeling the proble... | This is not really a good design. Database and Counter should not be classes. The first for its complexity and the second because of its simplicity. Instead of using System for the password check, make this one Authentication. What you call System will be a conglomerate of many other classes besides Authentication. The... |
10,835,355 | I have a ListView with 3 columns and would like to edit the third column, aka Subitem[1]. If I set ListView.ReadOnly to True, it allows me to edit the caption of the selected item. Is there an easy way to do the same thing for the subitem? I would like to stay away from adding a borderless control on top that does the ... | 2012/05/31 | [
"https://Stackoverflow.com/questions/10835355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/981120/"
] | You can Edit a subitem of the listview (in report mode) using a TEdit, a custom message and handling the `OnClick` event of the ListView.
Try this sample
```
Const
USER_EDITLISTVIEW = WM_USER + 666;
type
TForm1 = class(TForm)
ListView1: TListView;
procedure FormCreate(Sender: TObject);
procedure List... | I wrote sample code on CodeCentral that shows how to do this.
[How to use the Build-in Editor of TListView to Edit SubItems](http://codecentral.embarcadero.com/Item/23873)
**Update:**
Here is an updated version that should compile now:
```pascal
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, ... |
10,835,355 | I have a ListView with 3 columns and would like to edit the third column, aka Subitem[1]. If I set ListView.ReadOnly to True, it allows me to edit the caption of the selected item. Is there an easy way to do the same thing for the subitem? I would like to stay away from adding a borderless control on top that does the ... | 2012/05/31 | [
"https://Stackoverflow.com/questions/10835355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/981120/"
] | I wrote sample code on CodeCentral that shows how to do this.
[How to use the Build-in Editor of TListView to Edit SubItems](http://codecentral.embarcadero.com/Item/23873)
**Update:**
Here is an updated version that should compile now:
```pascal
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, ... | I took RRUZ's code and decided to make a self-contained unit of it, with a derived TListView object that supports multiple editable columns. It also allows you to move between editable items using the arrows, enter and tab.
```
unit EditableListView;
interface
uses
Messages,
Classes, StdCtrls, ComCtrls, System.T... |
10,835,355 | I have a ListView with 3 columns and would like to edit the third column, aka Subitem[1]. If I set ListView.ReadOnly to True, it allows me to edit the caption of the selected item. Is there an easy way to do the same thing for the subitem? I would like to stay away from adding a borderless control on top that does the ... | 2012/05/31 | [
"https://Stackoverflow.com/questions/10835355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/981120/"
] | I wrote sample code on CodeCentral that shows how to do this.
[How to use the Build-in Editor of TListView to Edit SubItems](http://codecentral.embarcadero.com/Item/23873)
**Update:**
Here is an updated version that should compile now:
```pascal
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, ... | From the [review queue](https://stackoverflow.com/review/first-posts/16571510):
>
> For those interested, I've created a TListView extension based in
> RRUZ's answer
>
>
> <https://github.com/BakasuraRCE/TEditableListView>
>
>
>
The code is as follows:
```
unit UnitEditableListView;
interface
uses
Winapi.... |
10,835,355 | I have a ListView with 3 columns and would like to edit the third column, aka Subitem[1]. If I set ListView.ReadOnly to True, it allows me to edit the caption of the selected item. Is there an easy way to do the same thing for the subitem? I would like to stay away from adding a borderless control on top that does the ... | 2012/05/31 | [
"https://Stackoverflow.com/questions/10835355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/981120/"
] | You can Edit a subitem of the listview (in report mode) using a TEdit, a custom message and handling the `OnClick` event of the ListView.
Try this sample
```
Const
USER_EDITLISTVIEW = WM_USER + 666;
type
TForm1 = class(TForm)
ListView1: TListView;
procedure FormCreate(Sender: TObject);
procedure List... | I took RRUZ's code and decided to make a self-contained unit of it, with a derived TListView object that supports multiple editable columns. It also allows you to move between editable items using the arrows, enter and tab.
```
unit EditableListView;
interface
uses
Messages,
Classes, StdCtrls, ComCtrls, System.T... |
10,835,355 | I have a ListView with 3 columns and would like to edit the third column, aka Subitem[1]. If I set ListView.ReadOnly to True, it allows me to edit the caption of the selected item. Is there an easy way to do the same thing for the subitem? I would like to stay away from adding a borderless control on top that does the ... | 2012/05/31 | [
"https://Stackoverflow.com/questions/10835355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/981120/"
] | You can Edit a subitem of the listview (in report mode) using a TEdit, a custom message and handling the `OnClick` event of the ListView.
Try this sample
```
Const
USER_EDITLISTVIEW = WM_USER + 666;
type
TForm1 = class(TForm)
ListView1: TListView;
procedure FormCreate(Sender: TObject);
procedure List... | From the [review queue](https://stackoverflow.com/review/first-posts/16571510):
>
> For those interested, I've created a TListView extension based in
> RRUZ's answer
>
>
> <https://github.com/BakasuraRCE/TEditableListView>
>
>
>
The code is as follows:
```
unit UnitEditableListView;
interface
uses
Winapi.... |
10,835,355 | I have a ListView with 3 columns and would like to edit the third column, aka Subitem[1]. If I set ListView.ReadOnly to True, it allows me to edit the caption of the selected item. Is there an easy way to do the same thing for the subitem? I would like to stay away from adding a borderless control on top that does the ... | 2012/05/31 | [
"https://Stackoverflow.com/questions/10835355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/981120/"
] | I took RRUZ's code and decided to make a self-contained unit of it, with a derived TListView object that supports multiple editable columns. It also allows you to move between editable items using the arrows, enter and tab.
```
unit EditableListView;
interface
uses
Messages,
Classes, StdCtrls, ComCtrls, System.T... | From the [review queue](https://stackoverflow.com/review/first-posts/16571510):
>
> For those interested, I've created a TListView extension based in
> RRUZ's answer
>
>
> <https://github.com/BakasuraRCE/TEditableListView>
>
>
>
The code is as follows:
```
unit UnitEditableListView;
interface
uses
Winapi.... |
58,320,581 | Is there a way in xpath to select an element and than select children of the element?
i.e. given a parent result, how can I find a child that is relative to `this` paraent
suppose the following code:
```html
<div class="product-general" prod-id="4407">
<img src="..."/>
<div class="prod-name">Black Dog</div>
<... | 2019/10/10 | [
"https://Stackoverflow.com/questions/58320581",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1406269/"
] | The second param to the `query` is a `$contextnode` that way you can use **relative XPath** like this:
```
foreach ($articles as $article) {
$href = $xpath->query('./a/@href', $article)->item(0)->nodeValue;
# $href = $xpath->evaluate('string(./a/@href)', $article); # using evaluate
}
``` | I came up with this:
```
$results = $xpath->query("//*[@id='searchPage']//article");
for ($i = 0; $i < $results->length; $i++) {
$counter = $i+1;
$href = $xpath->query("//*[@id='searchPage']//article[".$counter."]/a/@href")->item(0)->nodeValue;
}
```
This code will loop on all `article` in `searchPage` and e... |
46,984,896 | I'm trying to determine if a list `A` contains a value different from two other values, which make up list `B` (`0` and `1`):
```
[0, 1, 0, 1, 0] # False
[0, 0, 0, 0, 0] # False
[1, 1, 1, 1, 1] # False
[0, 1, 0, 2, 0] # True
```
Here's what I have so far but I feel like there's a nice one-liner or a generally mu... | 2017/10/27 | [
"https://Stackoverflow.com/questions/46984896",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6611672/"
] | You can use `set.issubset()` for this purpose.
```
if not set(A).issubset(B):
print("True")
else:
print("False")
```
Input:
```
A = [0, 1, 0, 2, 0]
B = [0, 1]
```
Output: `True`
Input:
```
A = [0, 1, 0, 1, 0]
B = [0, 1]
```
Output: `False` | The complexity of a solution is at best linear, meaning that in the worst case you will have to check all the items in the list. That's, however, the **worst** case. So, if performance is the issue, you can just stop when you find the first different value:
```
for i in A:
if i not in B:
indicator = True
... |
650,215 | I came across the term "Particle Phenomenology", which is "the application of theoretical physics to experimental data by making quantitative predictions based upon known theories" (quote from Wikipedia).
It appears to be a field between particle experiment and particle theory. My question is: who contributes to the f... | 2021/07/08 | [
"https://physics.stackexchange.com/questions/650215",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/210948/"
] | I copy here from a [prominent US university.](https://phy.princeton.edu/research/research-areas/particle-phenomenology)
>
> Particle physics phenomenolog*y is the field of theoretical physics* that focuses on the observable consequences of the fundamental particles of Nature and their interactions. The recent discove... | >
> It appears to be a field between particle experiment and particle theory.
>
>
>
Exactly. There is one big gray wash from engineering to experimental (particle) physics to phenomenology to theoretical physics to mathematics that defining clear boundaries between those is a moot exercise.
Typically when particl... |
1,174,609 | I'm trying to use this formula, but Excel keeps telling me there's an error.
```
=SI(NB.SI(A2;"*D*");"Data";"SI(NB.SI(A2;"*V*");"Voice";"Autres")")
```
(In English:
```
=IF(COUNTIF(A2;"*D*");"Data";"IF(COUNTIF(A2;"*V*");"Voice";"Autres")")
```
)
I don't understand where it is.
SI Means IF, I am using a french ... | 2017/02/02 | [
"https://superuser.com/questions/1174609",
"https://superuser.com",
"https://superuser.com/users/674711/"
] | I don't have the french version, so I can't rule out that SI and NB.SI are good or bad. Assuming they're good, here is the formula broken down:
```
=SI
(
NB.SI
(
A2;
"D"
); *
"Data";
"SI <
(
NB.SI
(
A2;
"V"
); ... | =IF(COUNTIF(A2,"D\*"),"Data",IF(COUNTIF(A2,"V\*"),"Voice","Autres"))
In French the following after your update:
`=SI(NB.SI(A2;"D*");"Data",SI(NB.SI(A2;"V*");"Voice";"Autres"))`
Maybe you should use SI instead of NB.SI if your Data in A2 is only D or V since no count is needed the formula become
`=SI(A2="D";"Dat... |
1,174,609 | I'm trying to use this formula, but Excel keeps telling me there's an error.
```
=SI(NB.SI(A2;"*D*");"Data";"SI(NB.SI(A2;"*V*");"Voice";"Autres")")
```
(In English:
```
=IF(COUNTIF(A2;"*D*");"Data";"IF(COUNTIF(A2;"*V*");"Voice";"Autres")")
```
)
I don't understand where it is.
SI Means IF, I am using a french ... | 2017/02/02 | [
"https://superuser.com/questions/1174609",
"https://superuser.com",
"https://superuser.com/users/674711/"
] | I don't have the french version, so I can't rule out that SI and NB.SI are good or bad. Assuming they're good, here is the formula broken down:
```
=SI
(
NB.SI
(
A2;
"D"
); *
"Data";
"SI <
(
NB.SI
(
A2;
"V"
); ... | Yorik helped me find the answer.
I used the formula:
```
=SI(GAUCHE(A2)="D";"Data";SI(GAUCHE(A2)="V";"Voice";"Autres"))
```
(English:
```
=IF(LEFT(A2)="D";"Data";IF(LEFT(A2)="V";"Voice";"Autres"))
```
And it worked perfectly. This also thought me a lesson about how to use Brackets and Quotes correctly ! Thanks... |
41,668,251 | Given a list of non negative integers, I would like to arrange them such that they form the largest number. Given [1, 20, 23, 4, 8], the largest formed number is 8423201. But I want to figure how the order of the variables in compareTo method influences the result of Arrays.sort. e.g, what's the difference between (s2 ... | 2017/01/16 | [
"https://Stackoverflow.com/questions/41668251",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6939031/"
] | Sort the numbers with reverse (*descending*) [lexicographical order](https://en.wikipedia.org/wiki/Lexicographical_order), that is the numbers are sorted with `String`(s) in the default *reverse order*. Like,
```
String[] strs = { "1", "20", "23", "4", "8" };
Stream.of(strs).sorted(Comparator.reverseOrder()) // <-- so... | Yes. The order in compareTo method will makes a difference. When you use compareTo method for string it compares the Unicode values of each character in a string and return the difference of two character value from the strings.
For example,
```
System.out.println("abdc".compareTo("abcd"));
```
will return the diff... |
14,385,003 | I have a database (on DB2 9.7) A in which suppose I have tables X,Y,Z...n
Now I have created same tables X,Y,Z...n in database B. I want to provide same GRANTs to users in database B as it was in database A. So based on SYSCAT.TABAUTH I am trying to generate GRANT SQLs. I have written the following query for it:
```
d... | 2013/01/17 | [
"https://Stackoverflow.com/questions/14385003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/969753/"
] | Add a function parameter and call it on success:
```
function myfunction(callback)
{
var value = "myvalue";
var post_url = "ajax.php";
$.post(
post_url,
{
value: value,
},
function(responseText){
var json = JSON.parse(responseText);
... | Have `myfunction` accept a callback:
```
function myfunction(callback)
{
var value = "myvalue";
var post_url = "ajax.php";
$.post(post_url, { value: value }, callback);
}
```
And then you can pass in any function to be executed when the `POST` comes back:
```
myfunction(function(responseText){
va... |
14,385,003 | I have a database (on DB2 9.7) A in which suppose I have tables X,Y,Z...n
Now I have created same tables X,Y,Z...n in database B. I want to provide same GRANTs to users in database B as it was in database A. So based on SYSCAT.TABAUTH I am trying to generate GRANT SQLs. I have written the following query for it:
```
d... | 2013/01/17 | [
"https://Stackoverflow.com/questions/14385003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/969753/"
] | Have `myfunction` accept a callback:
```
function myfunction(callback)
{
var value = "myvalue";
var post_url = "ajax.php";
$.post(post_url, { value: value }, callback);
}
```
And then you can pass in any function to be executed when the `POST` comes back:
```
myfunction(function(responseText){
va... | Yes, you will either need to have a parameter to identify the caller, like
```
function myfunction(caller) {
if (caller == "Foo") {
// some code
}
}
myFunction("Foo");
```
Or use a global variable
```
function myFunction() {
if (caller == "Foo") {
// some code
}
}
caller = "Foo";
m... |
14,385,003 | I have a database (on DB2 9.7) A in which suppose I have tables X,Y,Z...n
Now I have created same tables X,Y,Z...n in database B. I want to provide same GRANTs to users in database B as it was in database A. So based on SYSCAT.TABAUTH I am trying to generate GRANT SQLs. I have written the following query for it:
```
d... | 2013/01/17 | [
"https://Stackoverflow.com/questions/14385003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/969753/"
] | Add a function parameter and call it on success:
```
function myfunction(callback)
{
var value = "myvalue";
var post_url = "ajax.php";
$.post(
post_url,
{
value: value,
},
function(responseText){
var json = JSON.parse(responseText);
... | Yes, you will either need to have a parameter to identify the caller, like
```
function myfunction(caller) {
if (caller == "Foo") {
// some code
}
}
myFunction("Foo");
```
Or use a global variable
```
function myFunction() {
if (caller == "Foo") {
// some code
}
}
caller = "Foo";
m... |
122,836 | I am trying to search all input elements that starts with a partcular set of characters such as 'idAcc' where my VF page has two inputfields with id = idAccFN and id= idAccLN respectively.
```
<apex:inputField id="idAccFN" value="{!cr.FirstName__c}" />
<apex:inputField id="idAccLN" value="{!cr.LastName__c}" />
```
... | 2016/05/21 | [
"https://salesforce.stackexchange.com/questions/122836",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/16234/"
] | the Id you set gets prepended by VF, so you need to do a "contains" selector. And if you want each element on the page, you need to use a ".each", like this:
```
j$(document).ready(function(){
jQuery( 'input[id*=Name]' ).each(function(el){
el.val('Foo'); // do something with the input here.
});
``` | If you inspect the elements on the page you will notice that the id's are actually prepended by VF with j\_id0 etc (`j_id0:j_id1:page:messageDetail`)if you do not place IDs on all parent elements in your vf page. Thus the ID's do not start with the `idAcc` that you expect.
If you need the 'Starts With' then you could ... |
67,547,166 | This is the **Home Page** Code
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HZ Everything Business</title>
<link rel="stylesheet" href="home.css" />
<style>
.menu {
height: 70px;
width: 70px;
right: 70px;
top: 20px;
text-align: center;
position: absolute;
... | 2021/05/15 | [
"https://Stackoverflow.com/questions/67547166",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13097698/"
] | try this
```
foreach( $terms_arg as $display_term ){
if( $display_term->term_id != $queried_object->term_id ) {
printf(
'<div class="cat-list"><h3><a href="%s">%s</a></h3></div>',
esc_url(get_term_link($display_term->term_id)),
$display_term->name,
);
}
}
`... | According to me get\_terms() is having the options of exclude under the argument parameter
Try with below code
```
$terms_arg = get_terms( 'product_cat', array(
'orderby' => 'name',
'hide_empty' => false,
'parent' => $main_term->term_id,
'exclude' => $display_term->term_id, //assuming that $dis... |
10,521 | I just want to know whether both the usages are right or not. Also, do these usages depend on geography? | 2011/01/29 | [
"https://english.stackexchange.com/questions/10521",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/1749/"
] | It's a noun so it's necessary to specify the quantity. "One hundred" is the same as saying "a hundred," just like if you had six hundred it would be necessary to say "six hundred." The same rule applies to other nouns; you don't say "I have dollar" you say "I have one dollar" and you don't say "I have car" you say "I h... | 'Hundred' is a noun, not a quantity. Thus it needs a determiner like 'a' or 'one' to function as a quantity. 'Dozen' is functionally similar. |
10,521 | I just want to know whether both the usages are right or not. Also, do these usages depend on geography? | 2011/01/29 | [
"https://english.stackexchange.com/questions/10521",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/1749/"
] | 'Hundred' is a noun, not a quantity. Thus it needs a determiner like 'a' or 'one' to function as a quantity. 'Dozen' is functionally similar. | Hundred in English signifies a unit of 10x10, 100. If you want to think about it mathematically, one hundred is 1x100. Two hundred is 2x100, or 200. In English you must specify how many units of 10x10 you have if you wish to make sense. Oyu can't just tell me that you have the unit 10x10, you need to say how many.
Ex... |
10,521 | I just want to know whether both the usages are right or not. Also, do these usages depend on geography? | 2011/01/29 | [
"https://english.stackexchange.com/questions/10521",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/1749/"
] | It's a noun so it's necessary to specify the quantity. "One hundred" is the same as saying "a hundred," just like if you had six hundred it would be necessary to say "six hundred." The same rule applies to other nouns; you don't say "I have dollar" you say "I have one dollar" and you don't say "I have car" you say "I h... | Hundred in English signifies a unit of 10x10, 100. If you want to think about it mathematically, one hundred is 1x100. Two hundred is 2x100, or 200. In English you must specify how many units of 10x10 you have if you wish to make sense. Oyu can't just tell me that you have the unit 10x10, you need to say how many.
Ex... |
223,731 | I have one store (base) and I need to create another root category to test a new strucutre out so my plan was to create a new `Root Category` and then tell magmi to import into that... No such luck.
I've created a new root category called Testing.
Here is a sample of the Data.
```
sku,categories
12345, [Testing]/Lev... | 2018/04/25 | [
"https://magento.stackexchange.com/questions/223731",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/50626/"
] | Can you please add the following to the index.php of your website
```
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
``` | Can you try to disable any custom module one by one to see that causes the issue?
That may be cause by a faulty module or conflicting modules. |
1,302,927 | ### Background
By default, Microsoft [BitLocker](https://en.wikipedia.org/wiki/BitLocker) does not allow the user to enable full disk encryption (FDE) of the system disk, unless the PC has a compatible [TPM](https://en.wikipedia.org/wiki/Trusted_Platform_Module).
However, if the "Allow BitLocker without a compatible ... | 2018/03/13 | [
"https://superuser.com/questions/1302927",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | You cannot make your own startup key or import startup keys, BUT:
>
> When encrypting a drive with BitLocker, so as to require a startup
> key, can the user specify her own custom startup key (e.g. if she has
> previously generated one with the wizard and wants to use it on
> additional PCs), or must she accept th... | To answer your question:
>
> When encrypting a drive with BitLocker, so as to require a startup key, can the user specify her own custom startup key (e.g. if she has previously generated one with the wizard and wants to use it on additional PCs), or must she accept the key generated by the BitLocker wizard?
>
>
>
... |
22,726,562 | I cannot understand the difference between `interleaving` and `concatenation`
Interleaving
```
proc sort data=ds1
out=ds1;
by var1;
run;
proc sort data=ds2
out=ds2;
by var1;
run;
data testInterleaving ;
set ds1 ds2 ;
run ;
```
Concatenation
```
data testConcatenation;
set ds... | 2014/03/29 | [
"https://Stackoverflow.com/questions/22726562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2178635/"
] | SAS defines [INTERLEAVING](https://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a001318366.htm) as using a BY statement with a SET statement. The included link shows two data sets, sorted by the same variable(s), generating one data set using a BY statement with a SET statement. | The data steps at the end are the exact same. You are performing the same code, it doesn't matter if you sort before hand.
What I think you mean in the interleaving is
```
data testInterleaving ;
MERGE ds1 ds2;
by var1;
run;
```
The `set` statement reads sequentially through the data sets in the order you list them... |
22,726,562 | I cannot understand the difference between `interleaving` and `concatenation`
Interleaving
```
proc sort data=ds1
out=ds1;
by var1;
run;
proc sort data=ds2
out=ds2;
by var1;
run;
data testInterleaving ;
set ds1 ds2 ;
run ;
```
Concatenation
```
data testConcatenation;
set ds... | 2014/03/29 | [
"https://Stackoverflow.com/questions/22726562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2178635/"
] | Interleaving, as CarolinaJay notes, is combining `SET` with `BY`. It is not merging, and it is not just sorting prior to setting.
For example, let's create a pair of datasets, the female and the male members of `sashelp.class`.
```
data male female;
set sashelp.class;
if sex='F' then output female;
else output male;
... | The data steps at the end are the exact same. You are performing the same code, it doesn't matter if you sort before hand.
What I think you mean in the interleaving is
```
data testInterleaving ;
MERGE ds1 ds2;
by var1;
run;
```
The `set` statement reads sequentially through the data sets in the order you list them... |
22,726,562 | I cannot understand the difference between `interleaving` and `concatenation`
Interleaving
```
proc sort data=ds1
out=ds1;
by var1;
run;
proc sort data=ds2
out=ds2;
by var1;
run;
data testInterleaving ;
set ds1 ds2 ;
run ;
```
Concatenation
```
data testConcatenation;
set ds... | 2014/03/29 | [
"https://Stackoverflow.com/questions/22726562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2178635/"
] | Interleaving, as CarolinaJay notes, is combining `SET` with `BY`. It is not merging, and it is not just sorting prior to setting.
For example, let's create a pair of datasets, the female and the male members of `sashelp.class`.
```
data male female;
set sashelp.class;
if sex='F' then output female;
else output male;
... | SAS defines [INTERLEAVING](https://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a001318366.htm) as using a BY statement with a SET statement. The included link shows two data sets, sorted by the same variable(s), generating one data set using a BY statement with a SET statement. |
6,045,317 | I have a small database with several hundred resources of varying types (medical, education and research, for example). Each resource will need to be identified by its region. Some of the resources serve multiple regions. I need to be able to define each resource by its type, and it's region.
Since one region will ha... | 2011/05/18 | [
"https://Stackoverflow.com/questions/6045317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/619741/"
] | I don't know if need to use CSV only, but a good plugin/function that I use is this one: <http://codeigniter.com/wiki/Excel_Plugin/>
It's works with CodeIgniter Query system for exporting stuff to Excel. I use it a lot and never have problems with it. | Use `ob_clean();` before writing CSV to remove White spaces. |
6,045,317 | I have a small database with several hundred resources of varying types (medical, education and research, for example). Each resource will need to be identified by its region. Some of the resources serve multiple regions. I need to be able to define each resource by its type, and it's region.
Since one region will ha... | 2011/05/18 | [
"https://Stackoverflow.com/questions/6045317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/619741/"
] | try to print on the browser, if you see some extra space then remove.
if the extra is still on the csv file when you download, then this extra space is coming from any of your include file.
when you start writing your code try not to leave some space on the top/bottom of the code. | Use `ob_clean();` before writing CSV to remove White spaces. |
43,923 | The following problem is homework of a sort -- but homework I can't do!
The following problem is in Problem 1.F in *Van Lint and Wilson*:
>
> Let $G$ be a graph where every vertex
> has degree $d$. Suppose that $G$ has
> no loops, multiple edges, $3$-cycles
> or $4$-cycles. Then $G$ has at least
> $d^2+1$ verti... | 2010/10/28 | [
"https://mathoverflow.net/questions/43923",
"https://mathoverflow.net",
"https://mathoverflow.net/users/297/"
] | This is the [Moore graph](http://en.wikipedia.org/wiki/Moore_graph), which is a regular graph of degree $d$ with diameter $k$, with maximum possible nodes. A calculation shows that the number of nodes $n$ is at most
$$
1+d \sum\_{i=0}^{k-1} (d-1)^i
$$
and as you mentioned it can be shown by spectral techniques that t... | Additional random facts.
The Peterson Graph can be obtained by identifying the antipodal points of a dodecahedron and it has $S\_5$ as its automorphism group (order 120 of course).
There are a number of geometric constructions of the Hoffman-Singleton Graph (the 25 points and 25 non-vertical lines of an affine plane... |
31,533,155 | I am using Zotero as a plugin in Firefox on a Ubuntu12.4 machine.
Since last week, the BibTex format for export seems to have disappeared from the options in the preferences. I have absolutely no idea why and I don't really care why. I simply want to get it back since it worked before.
So I am looking for explanation ... | 2015/07/21 | [
"https://Stackoverflow.com/questions/31533155",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4799951/"
] | Use a parameterized query and set the parameter type to [`Datetime`](https://msdn.microsoft.com/en-us/library/system.data.sqldbtype(v=vs.110).aspx):
```
SqlCommand cmd = new SqlCommand(
"INSERT INTO ... (..., datetimecolumn, ...) VALUES (..,@datetimeparameter,...",
connection);
SqlParameter datetimeParam... | Excel stores internally the datetime as a number. So you will probably have to read it as number as well and convert it "manually" before storing it in SQL |
31,533,155 | I am using Zotero as a plugin in Firefox on a Ubuntu12.4 machine.
Since last week, the BibTex format for export seems to have disappeared from the options in the preferences. I have absolutely no idea why and I don't really care why. I simply want to get it back since it worked before.
So I am looking for explanation ... | 2015/07/21 | [
"https://Stackoverflow.com/questions/31533155",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4799951/"
] | I did't test so i'm not 100% sure.
Can you change your column to be datetime2(7) on database? and then send the datetime in following format YYYY-MM-DD hh:mm:ss.
I suggest that because the datetime2 as a Default string literal in above format while the datetime don't has it so it's based on the system culture.
I sugge... | Excel stores internally the datetime as a number. So you will probably have to read it as number as well and convert it "manually" before storing it in SQL |
31,533,155 | I am using Zotero as a plugin in Firefox on a Ubuntu12.4 machine.
Since last week, the BibTex format for export seems to have disappeared from the options in the preferences. I have absolutely no idea why and I don't really care why. I simply want to get it back since it worked before.
So I am looking for explanation ... | 2015/07/21 | [
"https://Stackoverflow.com/questions/31533155",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4799951/"
] | Use a parameterized query and set the parameter type to [`Datetime`](https://msdn.microsoft.com/en-us/library/system.data.sqldbtype(v=vs.110).aspx):
```
SqlCommand cmd = new SqlCommand(
"INSERT INTO ... (..., datetimecolumn, ...) VALUES (..,@datetimeparameter,...",
connection);
SqlParameter datetimeParam... | I did't test so i'm not 100% sure.
Can you change your column to be datetime2(7) on database? and then send the datetime in following format YYYY-MM-DD hh:mm:ss.
I suggest that because the datetime2 as a Default string literal in above format while the datetime don't has it so it's based on the system culture.
I sugge... |
5,853,804 | I am working on a camera application. For first time if I capture image its working fine but if I take a picture again its throwing a error
>
> ERROR/dalvikvm-heap(2398): 10077696-byte external allocation too large for this process." VM won't let us allocate 10077696 bytes" and finally"05-02 05:35:38.390: ERROR/Andro... | 2011/05/02 | [
"https://Stackoverflow.com/questions/5853804",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/707942/"
] | I found the answer.
I used the following code:
```
BitmapFactory.Options bfOptions=new BitmapFactory.Options();
bfOptions.inDither=false; //Disable Dithering mode
bfOptions.inPurgeable=true; //Tell to gc that whether it needs free memory, the ... | You don't. You can soft reset the device, but I doubt that will do any good. Android's garbage collector should take care of it.
Most probably, your app is using too much memory for some operation. You can use DDMS to check memory consumption ([read about it here](http://developer.android.com/guide/developing/debuggin... |
91,635 | I work in an office with 8 people.
We have no allocated seating. Which I am quite cool with. However, recently the tidiness has gotten quite out of hand. Papers, coffee stains, and some brochures scatter over the tables.
It's quite a rude shock when I almost put my laptop down on someone's old coffee stain in the mor... | 2017/05/26 | [
"https://workplace.stackexchange.com/questions/91635",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/70574/"
] | The answer would be either:
1. To hire a cleaner
2. Have allocated desks | You didn't mention any communication with the other 7 members of your work space, so I would suggest that as a first step.
This is very similar to sharing an apartment with roommates, or having a common area. Sometimes you just need to set out rules for everyone to follow to maintain cleanliness. You could even provi... |
91,635 | I work in an office with 8 people.
We have no allocated seating. Which I am quite cool with. However, recently the tidiness has gotten quite out of hand. Papers, coffee stains, and some brochures scatter over the tables.
It's quite a rude shock when I almost put my laptop down on someone's old coffee stain in the mor... | 2017/05/26 | [
"https://workplace.stackexchange.com/questions/91635",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/70574/"
] | The answer would be either:
1. To hire a cleaner
2. Have allocated desks | Those who refuse to return the space they are using for the day back to a neutral clean environment are likely doing so as a way to make the free seating arrangement painful.
If all the work environments were equal in resources, space, and comfort; and the work required in the morning and the evening to convert those... |
91,635 | I work in an office with 8 people.
We have no allocated seating. Which I am quite cool with. However, recently the tidiness has gotten quite out of hand. Papers, coffee stains, and some brochures scatter over the tables.
It's quite a rude shock when I almost put my laptop down on someone's old coffee stain in the mor... | 2017/05/26 | [
"https://workplace.stackexchange.com/questions/91635",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/70574/"
] | The answer would be either:
1. To hire a cleaner
2. Have allocated desks | It's the <https://en.wikipedia.org/wiki/Tragedy_of_the_commons> .
Make it the Owner's problem, everyone's problem, or keep it to yourself (see who cracks first).
Don't be Felix and live with Oscar. |
91,635 | I work in an office with 8 people.
We have no allocated seating. Which I am quite cool with. However, recently the tidiness has gotten quite out of hand. Papers, coffee stains, and some brochures scatter over the tables.
It's quite a rude shock when I almost put my laptop down on someone's old coffee stain in the mor... | 2017/05/26 | [
"https://workplace.stackexchange.com/questions/91635",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/70574/"
] | You didn't mention any communication with the other 7 members of your work space, so I would suggest that as a first step.
This is very similar to sharing an apartment with roommates, or having a common area. Sometimes you just need to set out rules for everyone to follow to maintain cleanliness. You could even provi... | Those who refuse to return the space they are using for the day back to a neutral clean environment are likely doing so as a way to make the free seating arrangement painful.
If all the work environments were equal in resources, space, and comfort; and the work required in the morning and the evening to convert those... |
91,635 | I work in an office with 8 people.
We have no allocated seating. Which I am quite cool with. However, recently the tidiness has gotten quite out of hand. Papers, coffee stains, and some brochures scatter over the tables.
It's quite a rude shock when I almost put my laptop down on someone's old coffee stain in the mor... | 2017/05/26 | [
"https://workplace.stackexchange.com/questions/91635",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/70574/"
] | You didn't mention any communication with the other 7 members of your work space, so I would suggest that as a first step.
This is very similar to sharing an apartment with roommates, or having a common area. Sometimes you just need to set out rules for everyone to follow to maintain cleanliness. You could even provi... | It's the <https://en.wikipedia.org/wiki/Tragedy_of_the_commons> .
Make it the Owner's problem, everyone's problem, or keep it to yourself (see who cracks first).
Don't be Felix and live with Oscar. |
46,986,793 | I'm trying to create a default value in Sequel:
```
create_table(:my_table) do
primary_key :id
# ..........
Timestamp :created_at, default: "now()"
```
After running a migration, it generates a table with this column definition:
```
--........
created_at timestamp without time zone DEFAULT '2017-10-28 12:... | 2017/10/28 | [
"https://Stackoverflow.com/questions/46986793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8841042/"
] | I know this was asked a while ago but I had a similar problem that I solved by using `Sequal.lit`
`Timestamp :created_at, default: Sequel.lit("now()")` | Are you trying to set a String in a Time field? I don't think this is going to work. You'll have to use `String :created_at, default: "now()"` |
46,986,793 | I'm trying to create a default value in Sequel:
```
create_table(:my_table) do
primary_key :id
# ..........
Timestamp :created_at, default: "now()"
```
After running a migration, it generates a table with this column definition:
```
--........
created_at timestamp without time zone DEFAULT '2017-10-28 12:... | 2017/10/28 | [
"https://Stackoverflow.com/questions/46986793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8841042/"
] | I know this was asked a while ago but I had a similar problem that I solved by using `Sequal.lit`
`Timestamp :created_at, default: Sequel.lit("now()")` | The way to do it is as follows, using either `Sequel.function(:now)` or `Sequel::CURRENT_TIMESTAMP`
```rb
Time :created_at, default: Sequel.function(:now)
# or...
Time :created_at, default: Sequel::CURRENT_TIMESTAMP
``` |
60,295,386 | I am trying to delete a row in my table. Here is my sample code
```
String DBDate = new String();
Long date = new Date().getTime();
String dateToday = date.toString();
dbobj.clear();
dbobj.put(LAST_TIME_ANSWERED, "");
int hasDB = dbobj.getFromDB(tableName,column key, primary key);
if(hasDB != ... | 2020/02/19 | [
"https://Stackoverflow.com/questions/60295386",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12923933/"
] | This is awkward to achieve in java, because you need to run a job on a schedule to achieve this. You should strongly consider using the mysql event scheduler. See [this answer](https://stackoverflow.com/a/14806127/2051454) for an example of this.
When you insert the row in the db you should set up an event that is tri... | there are two options for this.
1.) use java scheduler or
2.) use a scheduled job at DB level to clear data at the end of each day |
60,295,386 | I am trying to delete a row in my table. Here is my sample code
```
String DBDate = new String();
Long date = new Date().getTime();
String dateToday = date.toString();
dbobj.clear();
dbobj.put(LAST_TIME_ANSWERED, "");
int hasDB = dbobj.getFromDB(tableName,column key, primary key);
if(hasDB != ... | 2020/02/19 | [
"https://Stackoverflow.com/questions/60295386",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12923933/"
] | One common practice is to delete database records which are older than some threshold value. For this purpose, the database table should have a column with a timestamp representing insert or update time. When executing the scheduled task there a command is performed (pseudocode, assuming an 'update' timestamp):
DELETE... | there are two options for this.
1.) use java scheduler or
2.) use a scheduled job at DB level to clear data at the end of each day |
33,081,669 | I'm taking a Udacity course on making a site responsive and I tried applying `<meta name="viewport" content="width=device-width, initial-scale=1.0">` on a non-responsive site. The result was that page did not try to fit the device's width. Am I misunderstanding something?
[
//
pri... | 2012/04/26 | [
"https://Stackoverflow.com/questions/10330598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/568975/"
] | I have made it run for these dependencies:
```
def poiVersion='3.9'
compile 'org.apache.poi:poi:'+poiVersion
compile 'org.apache.poi:poi-ooxml:'+poiVersion
compile 'org.apache.poi:poi-ooxml-schemas:'+poiVersion
```
When I try for others it does not work:
3.10 : is not known to maven central
3.... | I use 3.7 but have you try adding
```
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.8</version>
</dependency>
``` |
10,330,598 | I'm using Netbeans, SWING to get data from mysql table to jTable. I done it, but headers of table. Headers are the same like in mysql table. How to change headers of jTable after getting data from DB?
P.S.
Default headers don't works in this issue.
This is auto-generated code:
@SuppressWarnings("unchecked")
//
pri... | 2012/04/26 | [
"https://Stackoverflow.com/questions/10330598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/568975/"
] | I tried using `poi 3.10`, `3.11` and `3.12 beta` with Grails and get this error as well.
After downloading and including <http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/poi/ooxml-schemas/1.0/ooxml-schemas-1.0.jar> the error is gone. | I use 3.7 but have you try adding
```
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.8</version>
</dependency>
``` |
10,330,598 | I'm using Netbeans, SWING to get data from mysql table to jTable. I done it, but headers of table. Headers are the same like in mysql table. How to change headers of jTable after getting data from DB?
P.S.
Default headers don't works in this issue.
This is auto-generated code:
@SuppressWarnings("unchecked")
//
pri... | 2012/04/26 | [
"https://Stackoverflow.com/questions/10330598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/568975/"
] | I used poi with version 3.12. The following dependency is also required:
`compile 'org.apache.poi:ooxml-schemas:1.1'`
see also <http://poi.apache.org/faq.html#faq-N10025> | I use 3.7 but have you try adding
```
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.8</version>
</dependency>
``` |
10,330,598 | I'm using Netbeans, SWING to get data from mysql table to jTable. I done it, but headers of table. Headers are the same like in mysql table. How to change headers of jTable after getting data from DB?
P.S.
Default headers don't works in this issue.
This is auto-generated code:
@SuppressWarnings("unchecked")
//
pri... | 2012/04/26 | [
"https://Stackoverflow.com/questions/10330598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/568975/"
] | I used poi with version 3.12. The following dependency is also required:
`compile 'org.apache.poi:ooxml-schemas:1.1'`
see also <http://poi.apache.org/faq.html#faq-N10025> | I have made it run for these dependencies:
```
def poiVersion='3.9'
compile 'org.apache.poi:poi:'+poiVersion
compile 'org.apache.poi:poi-ooxml:'+poiVersion
compile 'org.apache.poi:poi-ooxml-schemas:'+poiVersion
```
When I try for others it does not work:
3.10 : is not known to maven central
3.... |
10,330,598 | I'm using Netbeans, SWING to get data from mysql table to jTable. I done it, but headers of table. Headers are the same like in mysql table. How to change headers of jTable after getting data from DB?
P.S.
Default headers don't works in this issue.
This is auto-generated code:
@SuppressWarnings("unchecked")
//
pri... | 2012/04/26 | [
"https://Stackoverflow.com/questions/10330598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/568975/"
] | I have made it run for these dependencies:
```
def poiVersion='3.9'
compile 'org.apache.poi:poi:'+poiVersion
compile 'org.apache.poi:poi-ooxml:'+poiVersion
compile 'org.apache.poi:poi-ooxml-schemas:'+poiVersion
```
When I try for others it does not work:
3.10 : is not known to maven central
3.... | This is happening due to inconsistency is the poi jars.
You can download latest jars and it will start working.
you can add latest jar files for all below:
Commons-compress ,
ooxml-schemas ,
poi-scratchpad ,
poi-ooxml ,
poi ,
poi-ooxml-schemas ,
dom4j ,
poi-excelant |
10,330,598 | I'm using Netbeans, SWING to get data from mysql table to jTable. I done it, but headers of table. Headers are the same like in mysql table. How to change headers of jTable after getting data from DB?
P.S.
Default headers don't works in this issue.
This is auto-generated code:
@SuppressWarnings("unchecked")
//
pri... | 2012/04/26 | [
"https://Stackoverflow.com/questions/10330598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/568975/"
] | I used poi with version 3.12. The following dependency is also required:
`compile 'org.apache.poi:ooxml-schemas:1.1'`
see also <http://poi.apache.org/faq.html#faq-N10025> | I tried using `poi 3.10`, `3.11` and `3.12 beta` with Grails and get this error as well.
After downloading and including <http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/poi/ooxml-schemas/1.0/ooxml-schemas-1.0.jar> the error is gone. |
10,330,598 | I'm using Netbeans, SWING to get data from mysql table to jTable. I done it, but headers of table. Headers are the same like in mysql table. How to change headers of jTable after getting data from DB?
P.S.
Default headers don't works in this issue.
This is auto-generated code:
@SuppressWarnings("unchecked")
//
pri... | 2012/04/26 | [
"https://Stackoverflow.com/questions/10330598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/568975/"
] | I tried using `poi 3.10`, `3.11` and `3.12 beta` with Grails and get this error as well.
After downloading and including <http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/poi/ooxml-schemas/1.0/ooxml-schemas-1.0.jar> the error is gone. | This is happening due to inconsistency is the poi jars.
You can download latest jars and it will start working.
you can add latest jar files for all below:
Commons-compress ,
ooxml-schemas ,
poi-scratchpad ,
poi-ooxml ,
poi ,
poi-ooxml-schemas ,
dom4j ,
poi-excelant |
10,330,598 | I'm using Netbeans, SWING to get data from mysql table to jTable. I done it, but headers of table. Headers are the same like in mysql table. How to change headers of jTable after getting data from DB?
P.S.
Default headers don't works in this issue.
This is auto-generated code:
@SuppressWarnings("unchecked")
//
pri... | 2012/04/26 | [
"https://Stackoverflow.com/questions/10330598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/568975/"
] | I used poi with version 3.12. The following dependency is also required:
`compile 'org.apache.poi:ooxml-schemas:1.1'`
see also <http://poi.apache.org/faq.html#faq-N10025> | This is happening due to inconsistency is the poi jars.
You can download latest jars and it will start working.
you can add latest jar files for all below:
Commons-compress ,
ooxml-schemas ,
poi-scratchpad ,
poi-ooxml ,
poi ,
poi-ooxml-schemas ,
dom4j ,
poi-excelant |
21,536,218 | Alright, so I'm trying to compare two columns, in two tables, in separate databases. I am going to warn you, I quite new to SQL. I am trying to write a query to do something like this:
```
If a field in tableA column2 contains a field from tableB column1 at least once, increment a counter
```
I want to know the valu... | 2014/02/03 | [
"https://Stackoverflow.com/questions/21536218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/989859/"
] | I think this is what you are after. it will obviously not loop, but it accomplishes what you are trying to do.
```
select a.c2,
count(case when a.c2 = b.c1 then 1 else 0 end) as c1count
from table1 as a
left join
table2 as b
on a.key = b.key
group by a.c2
```
or something like that. that join will probably need ... | This will get you the number of times that the contents of tableB.col1 is found as part of the contents of tableA.col2:
```
SELECT COUNT(*)
FROM tableA
JOIN tableB ON tableA.col2 RLIKE tableB.col1
```
In general, SQL engines are optimized to work better with set-based logic as opposed to procedural algorithms, such... |
50,644,513 | I have a scenario where I need to identify a result. Below is a sample excel cells with three columns `Prod Name, Qty and Result`.
```
Prod Name Qty Result
abc 10
zyz 9
test1 5
```
If the product name is `abc or zyz` and its qty is 10, then I need to add text `Refill` in Column R... | 2018/06/01 | [
"https://Stackoverflow.com/questions/50644513",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7468305/"
] | Try this formula:
```
=IF(OR(AND(OR(A1="abc", A1="xyz"), B1=10), AND(AND(A1<>"abc", A1<>"xyz"), B1=5)),
"Refill",
"Don't Refill")
``` | The formula provided by Tim above should work nicely, but if you're looking for VBA approach:
>
> *(Presuming the data is in a table called Table1 in a sheet called
> Sheet1)*
>
>
>
```
Private Sub comb_products()
Dim tbl As ListObject: Set tbl = Sheets("Sheet1").ListObjects("Table1")
For Each Rng In tbl.Lis... |
856,665 | I basically have something like this:
```
void Foo(Type ty)
{
var result = serializer.Deserialize<ty>(inputContent);
}
Foo(typeof(Person));
```
The `Deserialize<ty>` doesn't work because it expects `Deserialize<Person>` instead. How do I work around this?
I'd also like to understand how generics work and why i... | 2009/05/13 | [
"https://Stackoverflow.com/questions/856665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50475/"
] | Which serializer is that? If you only know the `Type` at runtime (not compile time), and it doesn't have a non-generic API, then you might have to use `MakeGenericMethod`:
```
void Foo(Type ty)
{
object result = typeof(ContainingClass).GetMethod("Bar").
.MakeGenericMethod(ty).Invoke(null, new object[] {inp... | Use
```
void Foo<T>(){ var result = serializer.Deserialize<T>(inputContent); }
```
With the following call
```
Foo<Person>();
``` |
856,665 | I basically have something like this:
```
void Foo(Type ty)
{
var result = serializer.Deserialize<ty>(inputContent);
}
Foo(typeof(Person));
```
The `Deserialize<ty>` doesn't work because it expects `Deserialize<Person>` instead. How do I work around this?
I'd also like to understand how generics work and why i... | 2009/05/13 | [
"https://Stackoverflow.com/questions/856665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50475/"
] | Use
```
void Foo<T>(){ var result = serializer.Deserialize<T>(inputContent); }
```
With the following call
```
Foo<Person>();
``` | In this case, just do this:
```
void Foo<ty>()
{
var result = serializer.Deserialize<ty>(inputContent);
}
Foo<Person>();
```
Otherwise, you need to call the generic method late-bound, since you have to get the correct generic method for it first (it is not known at compile time). Have a look at the [MethodInfo.... |
856,665 | I basically have something like this:
```
void Foo(Type ty)
{
var result = serializer.Deserialize<ty>(inputContent);
}
Foo(typeof(Person));
```
The `Deserialize<ty>` doesn't work because it expects `Deserialize<Person>` instead. How do I work around this?
I'd also like to understand how generics work and why i... | 2009/05/13 | [
"https://Stackoverflow.com/questions/856665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50475/"
] | If `ty` is known at compile-time, why don't just
```
void Foo<T>()
{
var result = serializer.Deserialize<T>(inputContext);
}
```
Otherwise,
```
MethodInfo genericDeserializeMethod = serializer.GetType().GetMethod("Deserialize");
MethodInfo closedDeserializeMethod = genericDeserializeMethod.MakeGenericMethod(ty... | Use
```
void Foo<T>(){ var result = serializer.Deserialize<T>(inputContent); }
```
With the following call
```
Foo<Person>();
``` |
856,665 | I basically have something like this:
```
void Foo(Type ty)
{
var result = serializer.Deserialize<ty>(inputContent);
}
Foo(typeof(Person));
```
The `Deserialize<ty>` doesn't work because it expects `Deserialize<Person>` instead. How do I work around this?
I'd also like to understand how generics work and why i... | 2009/05/13 | [
"https://Stackoverflow.com/questions/856665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50475/"
] | Use
```
void Foo<T>(){ var result = serializer.Deserialize<T>(inputContent); }
```
With the following call
```
Foo<Person>();
``` | Like Lucero said,
```
void Foo<ty>()
{
var result = serializer.Deserialize<ty>(inputContent);
}
Foo<Person>();
```
typeof(Person) is not the same thing as Person. Person is a compile-time type, whereas typeof(Person) is an expression that *returns a Type instance representing the runtime type information of Per... |
856,665 | I basically have something like this:
```
void Foo(Type ty)
{
var result = serializer.Deserialize<ty>(inputContent);
}
Foo(typeof(Person));
```
The `Deserialize<ty>` doesn't work because it expects `Deserialize<Person>` instead. How do I work around this?
I'd also like to understand how generics work and why i... | 2009/05/13 | [
"https://Stackoverflow.com/questions/856665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50475/"
] | Which serializer is that? If you only know the `Type` at runtime (not compile time), and it doesn't have a non-generic API, then you might have to use `MakeGenericMethod`:
```
void Foo(Type ty)
{
object result = typeof(ContainingClass).GetMethod("Bar").
.MakeGenericMethod(ty).Invoke(null, new object[] {inp... | In this case, just do this:
```
void Foo<ty>()
{
var result = serializer.Deserialize<ty>(inputContent);
}
Foo<Person>();
```
Otherwise, you need to call the generic method late-bound, since you have to get the correct generic method for it first (it is not known at compile time). Have a look at the [MethodInfo.... |
856,665 | I basically have something like this:
```
void Foo(Type ty)
{
var result = serializer.Deserialize<ty>(inputContent);
}
Foo(typeof(Person));
```
The `Deserialize<ty>` doesn't work because it expects `Deserialize<Person>` instead. How do I work around this?
I'd also like to understand how generics work and why i... | 2009/05/13 | [
"https://Stackoverflow.com/questions/856665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50475/"
] | If `ty` is known at compile-time, why don't just
```
void Foo<T>()
{
var result = serializer.Deserialize<T>(inputContext);
}
```
Otherwise,
```
MethodInfo genericDeserializeMethod = serializer.GetType().GetMethod("Deserialize");
MethodInfo closedDeserializeMethod = genericDeserializeMethod.MakeGenericMethod(ty... | Which serializer is that? If you only know the `Type` at runtime (not compile time), and it doesn't have a non-generic API, then you might have to use `MakeGenericMethod`:
```
void Foo(Type ty)
{
object result = typeof(ContainingClass).GetMethod("Bar").
.MakeGenericMethod(ty).Invoke(null, new object[] {inp... |
856,665 | I basically have something like this:
```
void Foo(Type ty)
{
var result = serializer.Deserialize<ty>(inputContent);
}
Foo(typeof(Person));
```
The `Deserialize<ty>` doesn't work because it expects `Deserialize<Person>` instead. How do I work around this?
I'd also like to understand how generics work and why i... | 2009/05/13 | [
"https://Stackoverflow.com/questions/856665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50475/"
] | Which serializer is that? If you only know the `Type` at runtime (not compile time), and it doesn't have a non-generic API, then you might have to use `MakeGenericMethod`:
```
void Foo(Type ty)
{
object result = typeof(ContainingClass).GetMethod("Bar").
.MakeGenericMethod(ty).Invoke(null, new object[] {inp... | Like Lucero said,
```
void Foo<ty>()
{
var result = serializer.Deserialize<ty>(inputContent);
}
Foo<Person>();
```
typeof(Person) is not the same thing as Person. Person is a compile-time type, whereas typeof(Person) is an expression that *returns a Type instance representing the runtime type information of Per... |
856,665 | I basically have something like this:
```
void Foo(Type ty)
{
var result = serializer.Deserialize<ty>(inputContent);
}
Foo(typeof(Person));
```
The `Deserialize<ty>` doesn't work because it expects `Deserialize<Person>` instead. How do I work around this?
I'd also like to understand how generics work and why i... | 2009/05/13 | [
"https://Stackoverflow.com/questions/856665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50475/"
] | If `ty` is known at compile-time, why don't just
```
void Foo<T>()
{
var result = serializer.Deserialize<T>(inputContext);
}
```
Otherwise,
```
MethodInfo genericDeserializeMethod = serializer.GetType().GetMethod("Deserialize");
MethodInfo closedDeserializeMethod = genericDeserializeMethod.MakeGenericMethod(ty... | In this case, just do this:
```
void Foo<ty>()
{
var result = serializer.Deserialize<ty>(inputContent);
}
Foo<Person>();
```
Otherwise, you need to call the generic method late-bound, since you have to get the correct generic method for it first (it is not known at compile time). Have a look at the [MethodInfo.... |
856,665 | I basically have something like this:
```
void Foo(Type ty)
{
var result = serializer.Deserialize<ty>(inputContent);
}
Foo(typeof(Person));
```
The `Deserialize<ty>` doesn't work because it expects `Deserialize<Person>` instead. How do I work around this?
I'd also like to understand how generics work and why i... | 2009/05/13 | [
"https://Stackoverflow.com/questions/856665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50475/"
] | If `ty` is known at compile-time, why don't just
```
void Foo<T>()
{
var result = serializer.Deserialize<T>(inputContext);
}
```
Otherwise,
```
MethodInfo genericDeserializeMethod = serializer.GetType().GetMethod("Deserialize");
MethodInfo closedDeserializeMethod = genericDeserializeMethod.MakeGenericMethod(ty... | Like Lucero said,
```
void Foo<ty>()
{
var result = serializer.Deserialize<ty>(inputContent);
}
Foo<Person>();
```
typeof(Person) is not the same thing as Person. Person is a compile-time type, whereas typeof(Person) is an expression that *returns a Type instance representing the runtime type information of Per... |
53,452,226 | In C++, if I try to do this:
```
std::function<void(bool,void)>
```
then the compiler will throw errors. Why is this? It's useful in many cases. One example:
```
//g++ -std=c++17 prblm.cpp
#include <cstdio>
#include <functional>
template<class type_t>
class some_callback
{
public:
using callback_t = st... | 2018/11/23 | [
"https://Stackoverflow.com/questions/53452226",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10438811/"
] | *"Why is this?"*
Because the only permitted usage of `void` in a parameter list is to show that the function doesn't accept any parameters.
From [[function]](https://en.cppreference.com/w/cpp/language/function):
>
> `void`
>
>
> Indicates that the function takes no parameters, it is the exact synonym for an empty... | The problem is not the code you showed, it is because in C/C++, you cannot define a function, f, as
```
void f(bool b, void v) {}
```
The reason is that, as @Peter Ruderman said, `void` is not a valid parameter type. |
53,452,226 | In C++, if I try to do this:
```
std::function<void(bool,void)>
```
then the compiler will throw errors. Why is this? It's useful in many cases. One example:
```
//g++ -std=c++17 prblm.cpp
#include <cstdio>
#include <functional>
template<class type_t>
class some_callback
{
public:
using callback_t = st... | 2018/11/23 | [
"https://Stackoverflow.com/questions/53452226",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10438811/"
] | *"Why is this?"*
Because the only permitted usage of `void` in a parameter list is to show that the function doesn't accept any parameters.
From [[function]](https://en.cppreference.com/w/cpp/language/function):
>
> `void`
>
>
> Indicates that the function takes no parameters, it is the exact synonym for an empty... | Variadic templates are one way to do this:
```
template <class... T>
struct some_callback
{
std::function<void(bool, T...)> myfunc;
};
using callback_with_just_bool = some_callback<>;
using callback_with_an_int_too = some_callback<int>;
```
This is even cleaner with an alias template:
```
template <class... T> u... |
53,452,226 | In C++, if I try to do this:
```
std::function<void(bool,void)>
```
then the compiler will throw errors. Why is this? It's useful in many cases. One example:
```
//g++ -std=c++17 prblm.cpp
#include <cstdio>
#include <functional>
template<class type_t>
class some_callback
{
public:
using callback_t = st... | 2018/11/23 | [
"https://Stackoverflow.com/questions/53452226",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10438811/"
] | *"Why is this?"*
Because the only permitted usage of `void` in a parameter list is to show that the function doesn't accept any parameters.
From [[function]](https://en.cppreference.com/w/cpp/language/function):
>
> `void`
>
>
> Indicates that the function takes no parameters, it is the exact synonym for an empty... | You might create specialization:
```
template<class type_t>
class some_callback
{
std::function<void(bool,type_t)> myfunc;
};
template<>
class some_callback<void>
{
std::function<void(bool)> myfunc;
};
``` |
53,452,226 | In C++, if I try to do this:
```
std::function<void(bool,void)>
```
then the compiler will throw errors. Why is this? It's useful in many cases. One example:
```
//g++ -std=c++17 prblm.cpp
#include <cstdio>
#include <functional>
template<class type_t>
class some_callback
{
public:
using callback_t = st... | 2018/11/23 | [
"https://Stackoverflow.com/questions/53452226",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10438811/"
] | The problem is not the code you showed, it is because in C/C++, you cannot define a function, f, as
```
void f(bool b, void v) {}
```
The reason is that, as @Peter Ruderman said, `void` is not a valid parameter type. | Other answers have explained the why. This answers "is there a clean way around it?"
What I usually do for callbacks is use lambdas.
```
std::function<void(void)> myfunc;
bool b = false;
int i = 42;
myfunc = [&]() { if (b) ++i; };
``` |
53,452,226 | In C++, if I try to do this:
```
std::function<void(bool,void)>
```
then the compiler will throw errors. Why is this? It's useful in many cases. One example:
```
//g++ -std=c++17 prblm.cpp
#include <cstdio>
#include <functional>
template<class type_t>
class some_callback
{
public:
using callback_t = st... | 2018/11/23 | [
"https://Stackoverflow.com/questions/53452226",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10438811/"
] | There is a proposal to add "regular void" to the language.
In it, void becomes a monostate type that all other types implicitly convert to.
You can emulate this with
```
struct monostate_t {
template<class T>
monostate_t(T&&) {}
};
```
then
```
using callback_with_just_bool = some_callback<monostate_t>;
auto ... | Other answers have explained the why. This answers "is there a clean way around it?"
What I usually do for callbacks is use lambdas.
```
std::function<void(void)> myfunc;
bool b = false;
int i = 42;
myfunc = [&]() { if (b) ++i; };
``` |
53,452,226 | In C++, if I try to do this:
```
std::function<void(bool,void)>
```
then the compiler will throw errors. Why is this? It's useful in many cases. One example:
```
//g++ -std=c++17 prblm.cpp
#include <cstdio>
#include <functional>
template<class type_t>
class some_callback
{
public:
using callback_t = st... | 2018/11/23 | [
"https://Stackoverflow.com/questions/53452226",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10438811/"
] | You might create specialization:
```
template<class type_t>
class some_callback
{
std::function<void(bool,type_t)> myfunc;
};
template<>
class some_callback<void>
{
std::function<void(bool)> myfunc;
};
``` | The problem is not the code you showed, it is because in C/C++, you cannot define a function, f, as
```
void f(bool b, void v) {}
```
The reason is that, as @Peter Ruderman said, `void` is not a valid parameter type. |
53,452,226 | In C++, if I try to do this:
```
std::function<void(bool,void)>
```
then the compiler will throw errors. Why is this? It's useful in many cases. One example:
```
//g++ -std=c++17 prblm.cpp
#include <cstdio>
#include <functional>
template<class type_t>
class some_callback
{
public:
using callback_t = st... | 2018/11/23 | [
"https://Stackoverflow.com/questions/53452226",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10438811/"
] | There is a proposal to add "regular void" to the language.
In it, void becomes a monostate type that all other types implicitly convert to.
You can emulate this with
```
struct monostate_t {
template<class T>
monostate_t(T&&) {}
};
```
then
```
using callback_with_just_bool = some_callback<monostate_t>;
auto ... | Variadic templates are one way to do this:
```
template <class... T>
struct some_callback
{
std::function<void(bool, T...)> myfunc;
};
using callback_with_just_bool = some_callback<>;
using callback_with_an_int_too = some_callback<int>;
```
This is even cleaner with an alias template:
```
template <class... T> u... |
53,452,226 | In C++, if I try to do this:
```
std::function<void(bool,void)>
```
then the compiler will throw errors. Why is this? It's useful in many cases. One example:
```
//g++ -std=c++17 prblm.cpp
#include <cstdio>
#include <functional>
template<class type_t>
class some_callback
{
public:
using callback_t = st... | 2018/11/23 | [
"https://Stackoverflow.com/questions/53452226",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10438811/"
] | There is a proposal to add "regular void" to the language.
In it, void becomes a monostate type that all other types implicitly convert to.
You can emulate this with
```
struct monostate_t {
template<class T>
monostate_t(T&&) {}
};
```
then
```
using callback_with_just_bool = some_callback<monostate_t>;
auto ... | The problem is not the code you showed, it is because in C/C++, you cannot define a function, f, as
```
void f(bool b, void v) {}
```
The reason is that, as @Peter Ruderman said, `void` is not a valid parameter type. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.